* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0f1419;
  color: #e7ecf3;
  min-height: 100dvh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.phase-label {
  font-size: 0.875rem;
  color: #8b98a5;
  margin-bottom: 4px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.progress-wrap {
  height: 6px;
  background: #2f3943;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #1d9bf0;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #8b98a5;
}

.complete-banner {
  font-size: 0.875rem;
  color: #00ba7c;
  margin-bottom: 12px;
}

.recording-list {
  margin-bottom: 24px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.list-title {
  font-size: 0.875rem;
  color: #8b98a5;
}

#clear-negative-btn {
  font-size: 0.75rem;
  padding: 6px 12px;
  flex-shrink: 0;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.list-item {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid #38444d;
  background: #1a2332;
  color: #8b98a5;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  touch-action: manipulation;
}

.list-item.recorded {
  background: #15202b;
  color: #e7ecf3;
  border-color: #1d9bf0;
}

.list-item.recorded::after {
  content: "✓";
  font-size: 0.65rem;
  margin-left: 2px;
  color: #1d9bf0;
}

.list-item.selected {
  border-color: #1d9bf0;
  box-shadow: 0 0 0 1px #1d9bf0;
}

.list-item.current:not(.recorded) {
  border-color: #536471;
  color: #e7ecf3;
}

.list-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.list-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.action-btn {
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #38444d;
  background: #1a2332;
  color: #e7ecf3;
  cursor: pointer;
}

.action-btn:hover:not(:disabled) {
  background: #243447;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn-danger {
  border-color: #671d1d;
  color: #f4212e;
}

.action-btn-danger:hover:not(:disabled) {
  background: #2a1515;
}

.prompt {
  flex: 1;
  margin-bottom: 32px;
}

.instruction {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1a2332;
  border: 1px solid #38444d;
}

.tag strong {
  color: #1d9bf0;
  font-weight: 600;
}

.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.record-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.nav-btn {
  font-size: 0.875rem;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #38444d;
  background: #1a2332;
  color: #e7ecf3;
  cursor: pointer;
  min-width: 72px;
  touch-action: manipulation;
}

.nav-btn:hover:not(:disabled) {
  background: #243447;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.record-btn {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  background: #1d9bf0;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s, transform 0.1s;
}

.record-btn:active:not(:disabled),
.record-btn.recording {
  background: #f4212e;
  transform: scale(0.96);
}

.record-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.record-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.record-btn.recording .record-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.record-label {
  font-size: 0.75rem;
  font-weight: 600;
}

.status {
  font-size: 0.875rem;
  color: #8b98a5;
  min-height: 1.25rem;
  text-align: center;
}

.status.error {
  color: #f4212e;
}

.negative {
  flex: 1;
  margin-bottom: 24px;
}

.negative-passage {
  font-size: 1.05rem;
  line-height: 1.8;
  padding: 16px;
  border-radius: 12px;
  background: #1a2332;
  border: 1px solid #38444d;
  max-height: 40vh;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

@media (max-width: 380px) {
  .record-btn {
    width: 100px;
    height: 100px;
  }

  .nav-btn {
    min-width: 60px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}
