/* ==========================================================================
   NurseCoach — styles
   A calm, clinical-but-warm palette: teal + soft neutrals, coral/green accents.
   ========================================================================== */

:root {
  --bg: #f5f8f8;
  --surface: #ffffff;
  --surface-2: #f0f5f4;
  --ink: #16302d;
  --ink-soft: #5c6f6c;
  --muted: #8595927e;

  --primary: #0f9d8f;
  --primary-600: #0c8478;
  --primary-700: #0a6b61;
  --primary-050: #e5f4f2;

  --accent: #ef6f5b;
  --green: #17976b;
  --green-050: #e6f6ef;
  --red: #d95550;
  --red-050: #fcebea;
  --amber: #d99a2b;

  --border: #e1e8e7;
  --border-strong: #cdd8d6;

  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16, 42, 39, 0.06);
  --shadow: 0 6px 20px rgba(16, 42, 39, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 42, 39, 0.14);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--ink-soft); font-weight: 400; }

::selection { background: var(--primary-050); }

/* --------------------------------------------------------------- topbar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--primary-700);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; color: var(--ink); }
.brand-accent { color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.profile-chip {
  font-size: 0.82rem;
  color: var(--primary-700);
  background: var(--primary-050);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- layout -- */

#app {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 40px) 80px;
}
.view { animation: fade 0.35s ease; }
.fade-in { animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); }
.btn-secondary { background: var(--surface); color: var(--primary-700); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.96); }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; border-radius: var(--r); }
.btn-sm { padding: 7px 13px; font-size: 0.85rem; }
.btn-send { padding: 12px 18px; }

/* ------------------------------------------------------------- key banner - */

.key-banner {
  background: #fff8ec;
  border: 1px solid #f2dCA8;
  color: #7a5a12;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 22px;
  font-size: 0.92rem;
}
.key-banner code {
  background: #f3e6c8;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.86em;
}

/* --------------------------------------------------------------- welcome -- */

.hero { text-align: center; max-width: 720px; margin: 24px auto 8px; }
.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.grad {
  background: linear-gradient(120deg, var(--primary), #2bbf8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead { font-size: 1.14rem; color: var(--ink-soft); margin: 0 auto 26px; max-width: 600px; }
.hero-note { font-size: 0.86rem; color: var(--ink-soft); margin-top: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 54px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--primary-050);
  color: var(--primary-700);
  font-weight: 700;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.step-card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.step-card p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

/* ---------------------------------------------------------------- wizard -- */

.wizard { max-width: 640px; margin: 10px auto; }
.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
}
.wizard-card-wide { max-width: 640px; }
.wizard-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.wizard-lead { color: var(--ink-soft); font-size: 1.02rem; margin: 0 0 24px; }
.wizard-question {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.25;
  margin: 4px 0 22px;
  letter-spacing: -0.01em;
}

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #2bbf8a);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.options { display: flex; flex-direction: column; gap: 11px; }
.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 15px 17px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.option-card:hover { border-color: var(--primary); background: var(--primary-050); }
.option-card:active { transform: scale(0.995); }
.option-card.selected { border-color: var(--primary); background: var(--primary-050); }
.option-check {
  opacity: 0;
  color: var(--primary);
  font-weight: 800;
  transform: scale(0.6);
  transition: 0.15s;
}
.option-card.selected .option-check { opacity: 1; transform: scale(1); }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; }
.wizard-nav .btn-primary { margin-left: auto; }

.field { display: block; margin-bottom: 20px; }
.field-label { display: block; font-weight: 600; font-size: 0.94rem; margin-bottom: 9px; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }
.input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
.textarea { resize: vertical; min-height: 52px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235c6f6c' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-row:hover { border-color: var(--border-strong); }
.radio-row.selected { border-color: var(--primary); background: var(--primary-050); }
.radio-row input { accent-color: var(--primary); width: 17px; height: 17px; }

.pace-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pace-card {
  text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.pace-card:hover { border-color: var(--border-strong); }
.pace-card.selected { border-color: var(--primary); background: var(--primary-050); }
.pace-label { font-weight: 600; font-size: 0.96rem; }
.pace-sub { font-size: 0.82rem; color: var(--ink-soft); }

/* ------------------------------------------------------------- dashboard -- */

.profile-summary {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(135deg, #ffffff, #f2faf8);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 34px;
}
.dash-greeting {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.dash-sub { color: var(--ink-soft); margin: 0 0 16px; max-width: 640px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ptag {
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.ptag-style { background: var(--primary-050); color: var(--primary-700); }
.profile-goals { margin: 14px 0 0; font-size: 0.92rem; }

.subject-head { margin: 6px 0 22px; }
.subject-name { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.subject-tag { color: var(--ink-soft); margin: 0; }
.subject-note { color: var(--ink-soft); font-size: 0.9rem; margin: 10px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cat-block { margin-bottom: 30px; }
.cat-name {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700);
  margin: 0 0 13px;
  font-weight: 700;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 15px;
}
.topic-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 19px 19px 17px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); }
.topic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.topic-title { margin: 0; font-size: 1.06rem; }
.notes-badge {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--primary-700);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  vertical-align: middle;
}
.study-cat .notes-badge { margin-left: 2px; }
.topic-blurb { margin: 0; color: var(--ink-soft); font-size: 0.9rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.72rem;
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 500;
}
.topic-go { color: var(--primary); font-weight: 600; font-size: 0.9rem; margin-top: 2px; }
.more-note { color: var(--ink-soft); font-size: 0.9rem; margin-top: 8px; text-align: center; }

/* ----------------------------------------------------------------- study -- */

.study-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.study-title-wrap { flex: 1; min-width: 180px; }
.study-cat {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700);
  font-weight: 700;
}
.study-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 2px 0 0;
  letter-spacing: -0.015em;
}
.mode-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 3px;
}
.mode-tab {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 8px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mode-tab.active { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }

.study-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ------------------------------------------------------------------ learn - */

.learn { display: flex; flex-direction: column; }
.chat-log {
  height: clamp(340px, 56vh, 660px);
  overflow-y: auto;
  padding: 22px clamp(16px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}
.lesson-flag {
  align-self: center;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-700);
  background: var(--primary-050);
  padding: 4px 13px;
  border-radius: 999px;
  font-weight: 700;
}
.msg { display: flex; gap: 12px; max-width: 100%; }
.msg-avatar {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
}
.msg-assistant .msg-avatar { background: linear-gradient(135deg, var(--primary), var(--primary-700)); }
.msg-user .msg-avatar { background: #6b7c8a; }
.msg-user { flex-direction: row-reverse; }
.msg-body { min-width: 0; max-width: min(88%, 640px); }
.msg-user .msg-body { text-align: right; }
.msg-who { font-size: 0.74rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 3px; }
.msg-content {
  background: var(--surface-2);
  padding: 13px 16px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  font-size: 0.97rem;
  overflow-wrap: break-word;
  display: inline-block;
  text-align: left;
}
.msg-user .msg-content {
  background: var(--primary);
  color: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}

/* markdown content */
.msg-content p:first-child, .rationale-body p:first-child { margin-top: 0; }
.msg-content p:last-child, .rationale-body p:last-child { margin-bottom: 0; }
.msg-content p, .rationale-body p { margin: 0.55em 0; }
.msg-content ul, .msg-content ol, .rationale-body ul, .rationale-body ol { margin: 0.5em 0; padding-left: 1.35em; }
.msg-content li, .rationale-body li { margin: 0.25em 0; }
.msg-content h1, .msg-content h2, .msg-content h3, .msg-content h4 { margin: 0.7em 0 0.35em; line-height: 1.25; }
.msg-content h1 { font-size: 1.2rem; } .msg-content h2 { font-size: 1.12rem; } .msg-content h3 { font-size: 1.03rem; }
.msg-content code, .rationale-body code {
  background: rgba(15, 157, 143, 0.12);
  padding: 1px 5px; border-radius: 5px; font-size: 0.88em;
}
.msg-content pre { background: #10302c; color: #e6f4f1; padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.msg-content pre code { background: none; padding: 0; }
.msg-content table, .rationale-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.7em 0;
  font-size: 0.9rem;
  overflow: hidden;
  border-radius: 8px;
}
.msg-content th, .msg-content td, .rationale-body th, .rationale-body td {
  border: 1px solid var(--border-strong);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.msg-content th, .rationale-body th { background: var(--primary-050); color: var(--primary-700); font-weight: 700; }
.msg-content blockquote { border-left: 3px solid var(--primary); margin: 0.6em 0; padding: 2px 0 2px 14px; color: var(--ink-soft); }
.msg-content a { color: var(--primary-700); }

.error-text { color: var(--red); margin: 0; }

.typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  animation: blink 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.composer { border-top: 1px solid var(--border); padding: 14px clamp(16px, 3vw, 22px) 18px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  font: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-soft);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary-700); background: var(--primary-050); }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input {
  flex: 1;
  font: inherit;
  font-size: 0.98rem;
  padding: 12px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  resize: none;
  max-height: 160px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }

/* ------------------------------------------------------------------ quiz -- */

.quiz-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.difficulty { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.diff-btn {
  border: none; background: transparent; font: inherit; font-size: 0.83rem; font-weight: 600;
  color: var(--ink-soft); padding: 6px 15px; border-radius: 999px; cursor: pointer; transition: 0.15s;
}
.diff-btn.active { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }
.score { font-weight: 700; font-size: 0.92rem; color: var(--primary-700); }

.quiz-body { padding: clamp(20px, 3.5vw, 32px); }
.quiz-intro { text-align: center; max-width: 460px; margin: 20px auto; }
.quiz-intro-icon {
  width: 62px; height: 62px; border-radius: 16px;
  background: var(--primary-050); color: var(--primary-700);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.quiz-intro h2 { margin: 0 0 8px; font-size: 1.4rem; }
.quiz-intro .btn { margin-top: 18px; }

.quiz-loading { text-align: center; padding: 44px 0; }
.spinner {
  display: inline-block; width: 30px; height: 30px; margin-bottom: 12px;
  border: 3px solid var(--primary-050); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.quiz-error { text-align: center; padding: 30px 0; }
.quiz-error .btn { margin-top: 12px; }

.question-stem { font-size: 1.1rem; font-weight: 500; line-height: 1.45; margin-bottom: 20px; }
.answers { display: flex; flex-direction: column; gap: 11px; }
.answer {
  display: flex; align-items: center; gap: 13px;
  text-align: left; font: inherit; font-size: 1rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 14px 16px; cursor: pointer;
  color: var(--ink); transition: border-color 0.15s, background 0.15s;
}
.answer:hover:not(.locked) { border-color: var(--primary); background: var(--primary-050); }
.answer.selected { border-color: var(--primary); background: var(--primary-050); }
.answer-key {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); color: var(--ink-soft);
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
}
.answer.selected .answer-key { background: var(--primary); color: #fff; }
.answer.locked { cursor: default; }
.answer.correct { border-color: var(--green); background: var(--green-050); }
.answer.correct .answer-key { background: var(--green); color: #fff; }
.answer.wrong { border-color: var(--red); background: var(--red-050); }
.answer.wrong .answer-key { background: var(--red); color: #fff; }
.answer.missed { border: 1.5px dashed var(--green); background: transparent; }
.answer.missed .answer-key { background: var(--green-050); color: var(--green); }
.answers.multi .answer-key { border-radius: 7px; }
.sata-hint { font-size: 0.85rem; color: var(--primary-700); font-weight: 600; margin: -8px 0 14px; }

.question-actions { margin-top: 18px; }
.rationale {
  margin-top: 22px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 20px;
}
.rationale-verdict { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }
.rationale-verdict.ok { color: var(--green); }
.rationale-verdict.no { color: var(--red); }
.rationale-key { margin: 0 0 10px; font-size: 0.95rem; }
.rationale-body { font-size: 0.96rem; color: var(--ink); }
.rationale-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ----------------------------------------------------------------- toast -- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .pace-group { grid-template-columns: 1fr; }
  .profile-summary { flex-direction: column; }
  .study-head { gap: 12px; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; }
  .msg-body { max-width: 100%; }
}
