/* Oral Exam Tutor — Prep Smarter */
:root {
  --bg: #f5faf8;
  --surface: #eef7f4;
  --surface-elevated: #e5f2ee;
  --border: #c8e6da;
  --text: #000000;
  --text-muted: #4a4a4a;
  --accent: #2d9d78;
  --accent-hover: #25916a;
  --accent-muted: rgba(45, 157, 120, 0.2);
  --success: #2d9d78;
  --error: #c75c5c;
  --radius: 12px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#root, .app {
  max-width: 900px;
  margin: 0 auto;
  height: 100vh;
  padding: 0.75rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
}

#root { padding: 0; }
.app { flex: 1; min-height: 0; }

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  position: relative;
  padding-bottom: 0.5rem;
}

.header-left { flex: 1; min-width: 0; }

.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin: 0;
  cursor: pointer;
}

.logo:hover { text-decoration: underline; }

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.btn-settings {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-settings:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--surface-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar.hidden { opacity: 0; }

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.stats-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.stat-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.35rem;
  text-align: center;
}

.stat-item:not(:last-child) { border-right: 1px solid var(--border); }

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  display: block;
}

.stat-value.stat-subject {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.2;
}

/* Voice tutor — sine wave assistant */
.voice-tutor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.voice-tutor__wave-wrap {
  width: 100%;
  max-width: 240px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-tutor--small .voice-tutor__wave-wrap {
  max-width: 160px;
  height: 48px;
}

.voice-tutor__canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.voice-tutor__footer {
  margin-top: 0.35rem;
  text-align: center;
}

.voice-tutor__hint {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.voice-tutor__hint--muted {
  font-style: italic;
}

.voice-tutor__hint--fallback {
  color: var(--warning, #b8860b);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.voice-tutor + .voice-tutor-actions,
.voice-tutor-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.voice-tutor-tile .tile-body.voice-tutor-tile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.charlotte-chat {
  margin-top: 1rem;
  width: 100%;
  max-width: 28rem;
}
.charlotte-chat-hint {
  font-size: 0.85rem;
  color: var(--muted, #666);
  margin-bottom: 0.5rem;
}
.charlotte-voice-input {
  margin-bottom: 0.5rem;
}
.charlotte-mic-btn {
  min-width: 10rem;
}
.charlotte-chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.charlotte-chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  font-size: 1rem;
}
.charlotte-chat-error {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--danger, #c00);
}

.session-voice-tutor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

.session-voice-tutor--compact {
  margin-bottom: 0.5rem;
}

.main {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: auto;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-home {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen-home.active { display: flex; }

.screen-library.active,
.screen-subjects.active,
.screen-folder.active,
.screen-performance.active,
.screen-weak.active,
.screen-settings.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.screen-preparing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.screen-preparing.active { display: flex; }
.preparing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.preparing-text { margin: 0; font-size: 1rem; color: var(--text); }
.preparing-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.questions-error-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--error, #c00) 12%, var(--surface));
  border: 1px solid var(--error, #c00);
  border-radius: var(--radius);
  margin: 0 1rem 1rem;
}
.questions-error-banner p { margin: 0; font-size: 0.9rem; color: var(--text); }

.home-cta {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem 1rem;
}

.btn-cta-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(45, 157, 120, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  text-align: center;
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(45, 157, 120, 0.45);
}

.btn-cta-primary:active { transform: translateY(0); }

.btn-cta-primary:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-muted);
}

.cta-label {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.cta-sublabel {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.01em;
}

.home-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.home-left,
.home-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.home-right .home-tile { flex: 1; min-height: 0; }

.home-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tile-title {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.tile-more { align-self: flex-start; margin-top: auto; }

.home-tile .btn-sm { padding: 0.35rem 0.6rem; font-size: 0.7rem; }

.start-exam-desc { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

.focus-today-body { display: flex; flex-direction: column; gap: 0.35rem; }

.focus-today-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text);
  min-height: 1.25em;
}

.focus-today-text.empty { color: var(--text-muted); font-style: italic; }

.focus-today-edit { display: flex; gap: 0.35rem; align-items: center; }

.focus-today-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}

.focus-today-input:focus { outline: none; border-color: var(--accent); }

.focus-today-btn { align-self: flex-start; }

.library-desc { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

.home-library { cursor: pointer; }

.home-library .btn { pointer-events: auto; }

.library-upload-label { margin: 0; cursor: pointer; }

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.library-add-files-count {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.continue-empty,
.performance-empty,
.weak-empty {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.continue-content { display: flex; flex-direction: column; gap: 0.25rem; }

.continue-topic { font-weight: 600; margin: 0; font-size: 0.75rem; }

.continue-progress { font-size: 0.65rem; color: var(--text-muted); margin: 0; }

.performance-preview,
.weak-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.performance-preview .performance-row,
.home-weak .weak-preview li {
  font-size: 0.7rem;
  padding: 0.15rem 0;
}

.home-weak .weak-preview ul { list-style: none; padding: 0; margin: 0; }

.countdown-card { min-height: 2rem; }

.session-settings { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }

.session-settings .setting { margin: 0; }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subject-name { font-weight: 600; font-size: 0.9375rem; }

.subject-card-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: auto;
}
.subject-card-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.subject-card-actions .btn-rename {
  flex: 0 0 auto;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.subject-card-actions .btn-rename:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.performance-stats { display: flex; flex-direction: column; gap: 0.5rem; }

.performance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
}

.performance-row strong { color: var(--text); }

.weak-list { list-style: none; padding: 0; margin: 0; }

.weak-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.weak-list li:last-child { border-bottom: none; }

.weak-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  line-height: 1;
}

.weak-remove:hover { color: var(--error); }

.countdown-set { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.countdown-set label { font-size: 0.9375rem; color: var(--text-muted); }

.countdown-set input[type="date"] {
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.countdown-set input[type="date"]:focus { outline: none; border-color: var(--accent); }

.countdown-display { display: flex; flex-direction: column; gap: 0.25rem; }

.countdown-label { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

.countdown-value { font-size: 1.5rem; font-weight: 600; color: var(--accent); margin: 0; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

.feedback-actions,
.session-actions,
.complete-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.screen-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.screen-header .screen-title { margin: 0; flex: 1; }

.btn-back {
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-back:hover { border-color: var(--accent); color: var(--accent); }

.screen-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.performance-card-full,
.weak-card-full {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.settings-section { margin-bottom: 1.5rem; }

.settings-subtitle {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.settings-note { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

.settings-voice-try { margin-top: 0.5rem; }

.weak-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.weak-practice { flex-shrink: 0; }

.library-list { flex: 1; min-height: 0; overflow: auto; }

.library-empty { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

.library-folders { list-style: none; padding: 0; margin: 0; }

.library-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.library-folder-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.library-folder-name { font-weight: 600; font-size: 0.9375rem; color: var(--text); }

.library-folder-meta { font-size: 0.75rem; color: var(--text-muted); }

.library-folder-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.library-folder-actions .btn-rename {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.library-folder-actions .btn-rename:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.folder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.folder-filter { display: flex; align-items: center; gap: 0.5rem; }

.folder-filter label { font-size: 0.875rem; color: var(--text-muted); }

.folder-filter select {
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
}

.folder-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }

.folder-upload { cursor: pointer; margin: 0; }

.folder-list { flex: 1; min-height: 200px; margin-bottom: 1rem; }

.folder-empty { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

.folder-items { list-style: none; padding: 0; margin: 0; }

.folder-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.folder-item-icon { font-size: 1.25rem; }

.folder-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.folder-item-name { font-weight: 500; font-size: 0.9375rem; }

.folder-item-sub { font-size: 0.75rem; color: var(--text-muted); }

.folder-item-actions { display: flex; gap: 0.25rem; }

.btn-icon {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon-danger:hover { border-color: var(--error); color: var(--error); }

.folder-practice { margin-top: auto; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] { display: none !important; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); }

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal.modal-sm .modal-content { max-width: 360px; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-title-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.modal-title-input:focus { outline: none; border-color: var(--accent); }

.modal-title { flex: 1; margin: 0; font-size: 1rem; }

.modal-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close:hover { color: var(--text); }

.modal-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  resize: vertical;
  font-family: inherit;
  font-size: 0.9375rem;
  border: none;
  border-bottom: 1px solid var(--border);
}

.modal-body:focus { outline: none; }

.modal-footer {
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-actions { display: flex; gap: 0.5rem; }

.modal-footer label { font-size: 0.875rem; color: var(--text-muted); }

.modal-footer input[type="text"] {
  margin-left: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  width: 10rem;
}

.screen-complete h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.setting {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.setting input {
  width: 4rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.setting input:focus { outline: none; border-color: var(--accent); }

.phase-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.question-text {
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  color: var(--text);
}

.timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.think-timer { background: var(--accent-muted); color: var(--accent); }

.answer-timer {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.answer-timer.warning {
  background: rgba(199, 92, 92, 0.15);
  color: var(--error);
  border-color: var(--error);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:focus { outline: none; }

.btn-primary { background: var(--accent); color: #ffffff; }

.btn-primary:hover { background: var(--accent-hover); }

.btn-primary:focus { box-shadow: 0 0 0 3px var(--accent-muted); }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover { background: var(--accent-muted); }

.btn-secondary:focus { box-shadow: 0 0 0 3px var(--accent-muted); }

.answer-notes { margin-bottom: 1.5rem; }

.answer-notes label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.answer-dictate-btn {
  margin-bottom: 0.5rem;
}

.answer-listening-area {
  margin-bottom: 1.5rem;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.answer-listening-indicator {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}

.answer-listening-indicator.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.answer-listening-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}

.answer-listening-indicator.active .answer-listening-icon {
  animation: answer-mic-wave 1.4s ease-in-out infinite;
}

@keyframes answer-mic-wave {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.25); }
}

/* Ripple ring to show “listening” state */
.answer-listening-indicator.active::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  opacity: 0.4;
  animation: answer-ripple 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes answer-ripple {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0; }
}

.answer-start-btn {
  margin-top: 0.75rem;
}

.answer-listening-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 22rem;
}

.answer-listening-indicator.active .answer-listening-text {
  color: var(--text);
}

.answer-listening-fallback {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.answer-notes textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
}

.answer-notes textarea::placeholder { color: var(--text-muted); }

.answer-notes textarea:focus { outline: none; border-color: var(--accent); }

.key-points { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.key-points li {
  padding: 0.6rem 0;
  padding-left: 1.25rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.key-points li:last-child { border-bottom: none; }

.key-points li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.screen-complete .summary { color: var(--text-muted); margin-bottom: 1.5rem; }

.complete-transcripts {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  text-align: left;
  width: 100%;
  max-width: 36rem;
}

.complete-transcripts h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.complete-transcript-block {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.complete-transcript-question {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.complete-transcript-answer {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.footer {
  flex-shrink: 0;
  padding: 0.25rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Auth & Onboarding */
.screen-auth,
.screen-onboarding {
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.auth-card,
.onboarding-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.auth-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.auth-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-tab.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-label input {
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.auth-label input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--error);
}

.onboarding-section {
  margin-bottom: 1.5rem;
}

.onboarding-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.onboarding-row .auth-input {
  flex: 1;
  min-width: 120px;
}

.auth-input {
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
}

.onboarding-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
