/* NexGen Learning — Lesson app styles. Mobile-first; tokens from docs/UX_VISUAL_DIRECTION.md. */
:root {
  --ivory: #f9f7f1;
  --paper: #ffffff;
  --forest: #173f35;
  --forest-2: #215445;
  --forest-ink: #0f2b24;
  --ink: #22302d;
  --muted: #5b6964;
  --line: #e6e0d4;
  --line-2: #d6cfc0;
  --sage: #b9cfbd;
  --sage-soft: #e5eee6;
  --sage-ink: #2c5a49;
  --sand: #eadac0;
  --sand-soft: #f5eee1;
  --sand-ink: #77592c;
  --clay: #ecd5ca;
  --clay-ink: #7a4434;
  --error: #b34a42;
  --error-soft: #f8e9e6;
  --ok: #2d6a4e;
  --focus: #1f6fd1;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(23, 63, 53, 0.05), 0 6px 18px rgba(23, 63, 53, 0.05);
  --sh-2: 0 10px 34px rgba(23, 63, 53, 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --head: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
h1,
h2,
h3 {
  font-family: var(--head);
  color: var(--forest-ink);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
p {
  margin: 0;
}
a {
  color: var(--forest);
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--forest);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}
.skip-link:focus {
  top: 10px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.ic {
  flex: none;
  vertical-align: -0.18em;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(249, 247, 241, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
body:not([data-route='home']) .topbar {
  border-bottom-color: var(--line);
}
.topbar-in {
  max-width: 1120px;
  margin: 0 auto;
  height: 60px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--forest-ink);
  min-height: 44px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text strong {
  font: 800 17px/1.1 var(--head);
  letter-spacing: -0.01em;
}
.brand-text span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.profile {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--forest);
  display: grid;
  place-items: center;
}
.profile:hover {
  border-color: var(--forest);
}
.storage-warning {
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 8px var(--gutter);
  color: var(--sand-ink);
  font-size: 14px;
}

/* ---------- Layout ---------- */
#view {
  outline: none;
}
.view-enter {
  animation: viewIn 0.22s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--gutter) 56px;
}
.page.narrow {
  max-width: 760px;
}
.practice .stage {
  max-width: 780px;
  margin: 0 auto;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.stage {
  padding: 18px 16px 22px;
}
.boot {
  min-height: 60vh;
  display: grid;
  place-items: center;
}
.boot-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  to {
    transform: scale(1.6);
    opacity: 0.4;
  }
}
.eyebrow {
  font: 700 12.5px/1.3 var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage-ink);
  margin-bottom: 8px;
}
.lead {
  font-size: 17px;
  margin-top: 10px;
}
.bi-tr,
.prompt-tr,
.mission-tr,
.msg-tr,
.tray-tr,
.q-tr,
.lib-tr,
.forged-tr {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 700 15.5px/1.1 var(--head);
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s, transform 0.12s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--forest);
  color: #fff;
  box-shadow: 0 6px 18px rgba(23, 63, 53, 0.2);
}
.btn-primary:hover:not([disabled]) {
  background: var(--forest-2);
}
.btn-quiet {
  background: transparent;
  color: var(--forest);
  border-color: var(--line-2);
}
.btn-quiet:hover:not([disabled]) {
  border-color: var(--forest);
  background: rgba(23, 63, 53, 0.04);
}
.btn-danger {
  color: var(--error);
}
.btn-lg {
  min-height: 54px;
  padding: 0 24px;
  font-size: 16.5px;
}
.btn-sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14.5px;
}
.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--forest);
  display: grid;
  place-items: center;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 6px 2px;
  min-height: 36px;
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.toggle[aria-pressed='true'] {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-ink);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.cta-row .btn {
  flex: 1 1 220px;
}

/* ---------- Dashboard ---------- */
.dash {
  padding-top: 8px;
}
.hero {
  display: grid;
  gap: 18px;
  padding: 14px 0 6px;
}
.hero-title {
  font-size: clamp(38px, 10vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.mission {
  font-size: 18px;
  line-height: 1.5;
  margin-top: 14px;
  max-width: 36ch;
  color: var(--ink);
}
.mission-tr {
  margin-top: 6px;
  max-width: 44ch;
}
.ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-ink);
  font-weight: 700;
  font-size: 14.5px;
}
.meter {
  margin-top: 22px;
}
.meter-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  max-width: 420px;
}
.meter-seg {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}
.meter-seg.is-in_progress {
  background: linear-gradient(90deg, var(--sage) 50%, var(--line) 50%);
}
.meter-seg.is-completed {
  background: var(--forest);
}
.meter-label {
  margin-top: 9px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}
.meter-label .is-ready {
  color: var(--ok);
  font-weight: 600;
}
.hero-art {
  display: none;
}
.hero-art-svg {
  width: 100%;
  height: auto;
}
.art-ground,
.art-line {
  stroke: var(--line-2);
  stroke-width: 1.4;
  fill: none;
}
.art-floor {
  stroke: var(--forest);
  stroke-width: 1.4;
  transition: fill 0.4s;
}
.art-win {
  fill: none;
  stroke: rgba(23, 63, 53, 0.35);
  stroke-width: 1.2;
}
.art-crane {
  stroke: var(--sand-ink);
  stroke-width: 1.6;
  fill: none;
  opacity: 0.6;
}
.art-hook {
  fill: var(--sand);
}

.switcher {
  margin-top: 30px;
}
.switcher-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.switcher-head h2 {
  font-size: 19px;
}
.switcher-head .muted {
  font-weight: 600;
}
.switch-list {
  list-style: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 14px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.switch-list::-webkit-scrollbar {
  display: none;
}
.switch-list > li {
  scroll-snap-align: start;
  flex: 0 0 auto;
}
.switch-card {
  display: flex;
  flex-direction: column;
  width: 156px;
  min-height: 150px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.switch-card:hover {
  border-color: var(--forest);
  transform: translateY(-2px);
  box-shadow: var(--sh-1);
}
.switch-card.is-next {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.switch-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.switch-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 13px var(--head);
  background: var(--ivory);
  border: 1px solid var(--line-2);
  color: var(--forest);
}
.is-completed .switch-num {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.switch-ic {
  color: var(--sage-ink);
}
.switch-name {
  font: 700 15.5px/1.25 var(--head);
  color: var(--forest-ink);
}
.switch-tr {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.switch-status {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.is-completed .switch-status {
  color: var(--ok);
}
.is-in_progress .switch-status {
  color: var(--sand-ink);
}
.dash-links {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.dash-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 15px;
}
.dash-link:hover {
  border-color: var(--forest);
  background: var(--paper);
}
.dash-link > .ic:first-child {
  color: var(--sage-ink);
}
.dash-link .chev {
  margin-left: auto;
  color: var(--muted);
}
.dash-link strong {
  color: var(--forest-ink);
}
.device-note {
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Section nav ---------- */
.secnav {
  max-width: 780px;
  margin: 0 auto 14px;
}
.secnav-list {
  list-style: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.secnav-list::-webkit-scrollbar {
  display: none;
}
.secnav-list > li {
  flex: none;
}
.secnav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.secnav-item:hover {
  border-color: var(--line-2);
  background: var(--paper);
}
.secnav-item.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.secnav-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 12px var(--head);
  background: var(--ivory);
  color: var(--forest);
  border: 1px solid var(--line-2);
}
.secnav-item.is-completed .secnav-dot {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--forest-ink);
}
.secnav-item.is-active .secnav-dot {
  background: rgba(255, 255, 255, 0.16);
  border-color: transparent;
  color: #fff;
}
.secnav-testlink {
  border-style: dashed;
  border-color: var(--line-2);
}

/* ---------- Stage head / prompt ---------- */
.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 16px;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 13.5px var(--head);
  color: var(--sage-ink);
}
.crumb-sep {
  color: var(--line-2);
}
.crumb-step {
  color: var(--muted);
}
.dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper);
  font: 700 12.5px var(--head);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
}
.dot::after {
  /* larger touch target without visual bulk */
  content: '';
  position: absolute;
  inset: -6px;
}
.dot.is-current {
  border-color: var(--forest);
  color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.dot.is-done {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-ink);
}
.dots-sm {
  gap: 5px;
  max-width: 100%;
}
.dots-sm .dot {
  width: 14px;
  height: 14px;
  min-width: 0;
}
.dots-sm .dot::after {
  inset: -9px -3px;
}
.dots-sm .dot.is-done {
  background: var(--forest);
  border-color: var(--forest);
}
.prompt-en {
  font-size: clamp(21px, 5.4vw, 27px);
  font-weight: 700;
}
.prompt-tr {
  margin-top: 6px;
}
.hint-line {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.hint-line span {
  display: block;
}
.feedback {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 15px;
  display: flex;
  gap: 7px;
  align-items: flex-start;
}
.feedback:empty {
  margin-top: 0;
  min-height: 0;
}
.feedback.is-wrong {
  color: var(--error);
}
.feedback.is-good {
  color: var(--ok);
}
.feedback .ic {
  margin-top: 2px;
}
.done-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.done-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 600;
  color: var(--forest-ink);
  flex-wrap: wrap;
}
.done-msg .ic {
  color: var(--sage-ink);
  margin-top: 2px;
}
.done-msg .bi-tr {
  flex-basis: 100%;
  font-weight: 400;
  padding-left: 26px;
}
.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.done-actions .btn {
  flex: 1 1 200px;
}
.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--sand-soft);
  color: var(--ink);
  font-size: 15px;
}
.notice .ic {
  margin-top: 3px;
}
.notice-ok {
  background: var(--sage-soft);
  color: var(--forest-ink);
}
.notice-warn {
  background: var(--sand-soft);
  color: #5d4520;
}
.notice-error {
  background: var(--error-soft);
  color: #7f2f29;
}

/* ---------- Phrase Forge ---------- */
.forge-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.forge-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.col-label {
  font: 700 12px var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.fchip {
  position: relative;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.fchip-left {
  font-weight: 700;
  font-family: var(--head);
  color: var(--forest-ink);
}
.fchip:hover:not(:disabled) {
  border-color: var(--forest);
}
.fchip.is-selected {
  border-color: var(--forest);
  background: var(--sage-soft);
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.12);
  transform: translateY(-1px);
}
.fchip.is-solved {
  background: var(--ivory);
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
  font-weight: 500;
}
.fchip-check {
  margin-left: auto;
  color: var(--sage-ink);
}
.fchip.is-locking {
  border-color: var(--ok);
  background: var(--sage-soft);
  animation: lock 0.22s var(--ease);
}
.fchip.is-wrong {
  border-color: var(--error);
  animation: shake 0.32s;
}
@keyframes lock {
  50% {
    transform: scale(0.97);
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
.forged-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.forged {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--sage-soft);
}
.forged.is-new {
  animation: forgeIn 0.28s var(--ease);
}
@keyframes forgeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}
.forged-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}
.forged-en {
  font-size: 16px;
  color: var(--forest-ink);
}
.forged-ex {
  font-size: 13.5px;
  color: var(--sage-ink);
  font-style: italic;
  margin-top: 3px;
}

/* ---------- Sentence Climb ---------- */
.climb-zone {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--ivory);
  border: 1.5px dashed var(--line-2);
  transition: border-color 0.15s, background 0.15s;
}
.climb-zone.is-over,
.climb-tray.is-over {
  border-color: var(--forest);
  background: var(--sage-soft);
}
.climb-zone.is-solved {
  border-style: solid;
  border-color: var(--ok);
  background: var(--sage-soft);
}
.climb-zone.is-wrong {
  border-color: var(--error);
  animation: shake 0.32s;
}
.zone-label {
  font: 700 12px var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.climb-line,
.climb-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 52px;
}
.climb-tray {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
}
.zone-empty {
  color: var(--muted);
  font-size: 14.5px;
  padding: 10px 2px;
}
.tile {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--forest-ink);
  box-shadow: 0 2px 0 var(--line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tile:hover {
  border-color: var(--forest);
}
.climb-line .tile {
  background: var(--paper);
}
.tile.is-selected {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
  box-shadow: 0 6px 16px rgba(23, 63, 53, 0.25);
  transform: translateY(-2px);
}
.tile.is-dragging {
  opacity: 0.3;
}
.tile-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  border-color: var(--forest);
  box-shadow: var(--sh-2);
}
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}
.drop-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--forest);
  z-index: 55;
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.15);
}
.climb-zone.is-solved .tile {
  border-color: var(--sage);
  box-shadow: none;
}
.gap {
  width: 26px;
  min-height: 46px;
  margin: 0 -4px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.gap span {
  width: 4px;
  height: 30px;
  border-radius: 4px;
  background: var(--sage);
  transition: background 0.15s, width 0.15s;
}
.gap:hover span,
.gap:focus-visible span {
  background: var(--forest);
  width: 6px;
}
.movebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--sand-soft);
}
.movebar-word {
  font-weight: 700;
  color: var(--forest-ink);
  margin-right: 4px;
}
.movebar-tip {
  font-size: 13px;
  color: var(--muted);
}
.hint-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--sand-soft);
  color: #5d4520;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.hint-box .ic {
  margin-top: 3px;
}
.hint-answer {
  display: block;
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--line);
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.actions-row > .btn-primary {
  flex: 1 1 140px;
  max-width: 220px;
  margin-left: auto;
}

/* ---------- Conversations ---------- */
.threads {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.thread-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 600;
  font-size: 14px;
}
.thread-tab.is-active {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.thread-done {
  color: var(--ok);
  display: inline-grid;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font: 800 18px var(--head);
  background: var(--sage);
  color: var(--forest-ink);
}
.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 13.5px;
}
.avatar-rahul {
  background: var(--sage);
  color: var(--forest-ink);
}
.avatar-amir {
  background: var(--sand);
  color: #4f3a17;
}
.avatar-priya {
  background: var(--clay);
  color: #5c2f22;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}
.chat-id {
  flex: 1 1 180px;
  min-width: 0;
}
.chat-name {
  font-size: 19px;
}
.chat-role {
  font-family: var(--body);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
}
.chat-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sage-ink);
}
.chat-tools {
  display: flex;
  gap: 6px;
}
.chat-context {
  margin: 12px 0 4px;
  font-size: 14.5px;
  color: var(--ink);
}
.chat-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.chat-note .ic {
  margin-top: 2px;
}
.messages {
  list-style: none;
  margin: 12px 0 0;
  padding: 14px 10px;
  border-radius: var(--r-md);
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 92%;
}
.msg-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg.is-new {
  animation: msgIn 0.24s var(--ease);
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.msg-col {
  min-width: 0;
}
.msg-who {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 4px 3px;
}
.msg-me .msg-who {
  text-align: right;
}
.msg-time {
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}
.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.45;
}
.msg-them .bubble {
  border-bottom-left-radius: 6px;
}
.msg-me .bubble {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg-tr {
  margin: 4px 6px 0;
  font-size: 13.5px;
}
.msg-voice .bubble {
  padding: 8px 12px 10px;
  min-width: 230px;
}
.msg-voice .msg-text {
  margin-top: 6px;
  font-size: 14.5px;
}
.is-hidden-caption {
  display: none;
}
.caption-reveal {
  font-size: 13px;
  min-height: 28px;
  margin-top: 2px;
}
.msg-me .linkbtn {
  color: #fff;
}
.typing {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 10px 0;
}
.typing[hidden] {
  display: none;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes blink {
  50% {
    opacity: 0.25;
    transform: translateY(-2px);
  }
}
.tray-wrap {
  margin-top: 14px;
}
.tray-q {
  font: 700 16.5px var(--head);
  color: var(--forest-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tray-step {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--ivory);
  border-radius: 99px;
  padding: 2px 8px;
}
.tray-tr {
  margin-top: 2px;
}
.chat-done {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--sage-soft);
}
.chat-done .bi-tr {
  margin: 4px 0 0 26px;
}

/* ---------- Options (shared) ---------- */
.options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-2);
  background: var(--paper);
  text-align: left;
  font-size: 15.5px;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover:not([disabled]):not([aria-disabled='true']) {
  border-color: var(--forest);
}
.option:active:not([disabled]) {
  transform: scale(0.995);
}
.option-key {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ivory);
  border: 1px solid var(--line-2);
  font: 700 13px var(--head);
  color: var(--forest);
}
.option-text {
  padding-top: 3px;
}
.option.is-wrong {
  border-color: rgba(179, 74, 66, 0.5);
  background: var(--error-soft);
  color: #6f2a25;
  cursor: default;
}
.option.is-wrong .option-key {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.option.is-right {
  border-color: var(--ok);
  background: var(--sage-soft);
}
.option.is-right .option-key {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.option[disabled] {
  cursor: default;
}
.option-radio {
  cursor: pointer;
  position: relative;
}
.option-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.option-radio:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.option-radio.is-selected {
  border-color: var(--forest);
  background: #f0f5f1;
  box-shadow: inset 0 0 0 1px var(--forest);
}
.option-radio.is-selected .option-key {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

/* ---------- Audio controls ---------- */
.achip {
  display: flex;
  align-items: center;
  gap: 10px;
  --p: 0;
  flex-wrap: wrap;
}
.achip-btn,
.vp-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform 0.12s, background 0.15s;
}
.achip-btn:hover,
.vp-btn:hover {
  background: var(--forest-2);
}
.achip.on-dark .achip-btn {
  background: #fff;
  color: var(--forest);
}
.i-pause,
.i-retry {
  display: none;
}
[data-state='playing'] .i-play,
[data-state='loading'] .i-play {
  display: none;
}
[data-state='playing'] .i-pause,
[data-state='loading'] .i-pause {
  display: grid;
}
[data-state='error'] .i-play {
  display: none;
}
[data-state='error'] .i-retry {
  display: grid;
}
.i-play,
.i-pause,
.i-retry {
  place-items: center;
}
.i-play {
  display: grid;
}
[data-state='loading'] .achip-btn,
[data-state='loading'] .vp-btn {
  animation: pulse-soft 0.9s infinite alternate;
}
[data-state='blocked'] .achip-btn,
[data-state='blocked'] .vp-btn,
[data-state='idle'] .achip-btn.is-nudge {
  box-shadow: 0 0 0 0 rgba(23, 63, 53, 0.4);
  animation: ring 1.4s infinite;
}
@keyframes ring {
  to {
    box-shadow: 0 0 0 10px rgba(23, 63, 53, 0);
  }
}
@keyframes pulse-soft {
  to {
    opacity: 0.6;
  }
}
.wf {
  position: relative;
  flex: 1 1 auto;
  min-width: 90px;
  height: 28px;
  display: block;
}
.wf-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.wf-bars i {
  flex: 1 1 0;
  height: calc(var(--h) * 100%);
  min-height: 3px;
  border-radius: 2px;
  background: var(--line-2);
}
.wf-fill {
  clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0);
}
.wf-fill i {
  background: var(--forest);
}
.on-dark .wf-bars i {
  background: rgba(255, 255, 255, 0.35);
}
.on-dark .wf-fill i {
  background: #fff;
}
.achip-time {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 30px;
}
.on-dark .achip-time {
  color: rgba(255, 255, 255, 0.8);
}
.achip-err {
  display: none;
  flex-basis: 100%;
  font-size: 13.5px;
  color: var(--error);
}
.on-dark .achip-err,
.on-dark .achip-err .linkbtn {
  color: #ffd9d3;
}
[data-state='error'] .achip-err {
  display: block;
}
.vplayer {
  display: flex;
  gap: 14px;
  align-items: center;
  --p: 0;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--ivory);
  border: 1px solid var(--line);
}
.vp-btn {
  width: 56px;
  height: 56px;
}
.vp-main {
  flex: 1;
  min-width: 0;
}
.wf-lg {
  height: 40px;
  cursor: pointer;
}
.vp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.vp-restart {
  font-size: 13px;
  min-height: 36px;
}

/* ---------- Voice notes ---------- */
.note-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.note-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.note-from {
  font-weight: 700;
  color: var(--forest-ink);
}
.note-title {
  font-size: 14.5px;
  color: var(--sage-ink);
  font-weight: 600;
}
.transcript {
  margin-top: 10px;
}
.transcript-text {
  margin-top: 6px;
  padding: 12px 14px;
  border-left: 3px solid var(--sage);
  background: var(--ivory);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 15px;
}
.question {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.q-legend {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.q-num {
  font: 700 12px var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.q-en {
  font: 700 18px/1.35 var(--head);
  color: var(--forest-ink);
}

/* ---------- Test ---------- */
.test-intro h1,
.test-review h1 {
  font-size: clamp(30px, 8vw, 40px);
}
.facts {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}
.facts li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
}
.facts .ic {
  color: var(--sage-ink);
  margin-top: 2px;
}
.audio-check {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--ivory);
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 48px;
}
.audio-check.is-ok {
  background: var(--sage-soft);
  color: var(--forest-ink);
}
.audio-check.is-error {
  background: var(--error-soft);
  color: #7f2f29;
  align-items: flex-start;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.test-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chip-listen {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--sand-ink);
}
.test-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 10px 0 18px;
  overflow: hidden;
}
.test-bar span {
  display: block;
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
  transition: width 0.25s var(--ease);
}
.test-audio {
  margin-bottom: 4px;
}
.test-question {
  margin-top: 8px;
}
.test-question .q-en {
  font-size: clamp(19px, 5vw, 22px);
}
.test-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}
.test-nav .btn {
  flex: 1 1 0;
  max-width: 240px;
}
.qgrid-wrap {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.qgrid-wrap summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--forest);
}
.qgrid {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.qcell {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  font-weight: 700;
  color: var(--muted);
}
.qcell.is-answered {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--forest-ink);
}
.qcell.is-current {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
}
.review-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 6px;
}
.review-row {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 10px;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  min-height: 52px;
}
.review-row:hover {
  border-color: var(--forest);
}
.review-n {
  grid-row: span 2;
  font: 700 14px var(--head);
  color: var(--muted);
  padding-top: 1px;
}
.review-q {
  font-size: 14px;
  color: var(--muted);
}
.review-a {
  font-weight: 600;
  color: var(--forest-ink);
  font-size: 15px;
}
.review-row.is-missing {
  border-color: rgba(179, 74, 66, 0.4);
  background: #fffaf9;
}
.review-row.is-missing .review-a {
  color: var(--error);
}
.result-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 6px;
}
.result-hero h1 {
  font-size: clamp(24px, 6.5vw, 32px);
}
.score-ring {
  --v: 0;
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--forest) calc(var(--v) * 360deg), var(--line) 0);
  position: relative;
}
.is-notyet .score-ring {
  background: conic-gradient(var(--sand-ink) calc(var(--v) * 360deg), var(--line) 0);
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--paper);
}
.score-ring span {
  position: relative;
  font: 600 15px var(--head);
  color: var(--muted);
}
.score-ring strong {
  font-size: 28px;
  color: var(--forest-ink);
}
.score-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 0;
}
.score-split div {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--ivory);
}
.score-split dt {
  font: 700 12px var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-split dd {
  margin: 4px 0 0;
  font: 800 22px var(--head);
  color: var(--forest-ink);
}
.score-split dd .muted {
  font: 500 13px var(--body);
}
.suggest {
  margin-top: 16px;
}
.suggest-title {
  font-weight: 700;
  color: var(--forest-ink);
}
.suggest ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.suggest a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-underline-offset: 3px;
}
.answers {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.answers summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--forest);
}
.answer-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 10px;
}
.answer-list > li {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.answer-list > li.is-wrong {
  background: #fffaf9;
}
.al-q {
  display: flex;
  gap: 8px;
  font-weight: 600;
  color: var(--forest-ink);
}
.al-mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: #fff;
  margin-top: 1px;
}
.is-wrong .al-mark {
  background: var(--error);
}
.al-a,
.al-x {
  font-size: 14.5px;
  margin: 6px 0 0 30px;
}
.al-x {
  color: var(--muted);
}
.al-audio {
  margin: 10px 0 0 30px;
}

/* ---------- Prep ---------- */
.prep-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}
.prep-head h1 {
  font-size: clamp(30px, 8vw, 40px);
}
.prep-actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  flex-wrap: wrap;
}
.privacy {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.prep-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}
.prep-item {
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper);
}
.prep-item > p {
  margin-top: 6px;
}
.prep-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.prep-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  font: 700 13px var(--head);
}
.prep-min {
  font-weight: 700;
  color: var(--forest-ink);
}
.prep-mode {
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--sand-soft);
  color: var(--sand-ink);
  font-weight: 600;
}
.prep-title {
  font-size: 18.5px;
}
.prep-title .muted {
  font-family: var(--body);
  font-weight: 500;
  font-size: 14.5px;
}
.prep-cols {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.mini-label {
  font: 700 12px var(--head);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}
.phrase-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.phrase-pills li {
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--sage-soft);
  color: var(--forest-ink);
  font-size: 14px;
  font-weight: 500;
}
.followups {
  margin: 0;
  padding-left: 18px;
  font-size: 14.5px;
}
.note-field {
  display: block;
  margin-top: 12px;
}
.note-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--ivory);
  resize: vertical;
  font-size: 15px;
}
.note-field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.14);
  background: #fff;
}

/* ---------- Library ---------- */
.phrases-page h1 {
  font-size: clamp(30px, 8vw, 40px);
}
.library {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 8px;
}
.lib-item {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ivory);
}
.lib-en {
  font: 700 16.5px var(--head);
  color: var(--forest-ink);
}
.lib-ex {
  font-size: 14px;
  font-style: italic;
  color: var(--sage-ink);
  margin-top: 3px;
}

/* ---------- Dialog ---------- */
.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-lg);
  max-width: min(460px, calc(100vw - 32px));
  box-shadow: var(--sh-2);
  color: var(--ink);
  background: var(--paper);
}
.dialog::backdrop {
  background: rgba(15, 43, 36, 0.35);
  backdrop-filter: blur(2px);
}
.dialog-body {
  padding: 22px;
}
.dialog-body h2 {
  font-size: 21px;
  margin-bottom: 10px;
}
.dialog-body p + p {
  margin-top: 8px;
}
.dialog-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }
  .stage {
    padding: 26px 28px 28px;
  }
  .hint-line span {
    display: inline;
  }
  .forge-cols {
    gap: 16px;
  }
  .fchip {
    font-size: 16px;
    padding: 12px 16px;
  }
  .prep-cols {
    grid-template-columns: 1fr 1fr;
  }
  .switcher-head {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }
  .dash-links {
    grid-template-columns: 1fr 1fr;
  }
  .messages {
    padding: 18px 16px;
  }
  .msg {
    max-width: 80%;
  }
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
    gap: 40px;
    padding-top: 36px;
  }
  .hero-art {
    display: block;
    max-width: 340px;
    justify-self: end;
    width: 100%;
  }
  .mission {
    font-size: 20px;
  }
  .cta-row .btn {
    flex: 0 0 auto;
  }
  .switch-list {
    margin: 0;
    padding: 4px 0 8px;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .switch-card {
    width: auto;
  }
  .secnav {
    max-width: none;
  }
  .secnav-list {
    margin: 0;
    padding: 2px 0 6px;
    justify-content: safe center;
  }
  .secnav-item {
    font-size: 13.5px;
    gap: 6px;
    padding: 0 10px 0 6px;
  }
  .secnav-dot {
    width: 22px;
    height: 22px;
  }
  .page {
    padding-top: 24px;
  }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .topbar,
  .secnav,
  .no-print,
  .skip-link,
  .storage-warning {
    display: none !important;
  }
  body {
    background: #fff;
    font-size: 12pt;
  }
  .page {
    padding: 0;
    max-width: none;
  }
  .card,
  .prep-item {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .prep-item {
    break-inside: avoid;
    border-top: 1px solid #ccc;
    padding-top: 10px;
  }
  .note-field textarea {
    border: 1px solid #bbb;
    background: #fff;
    min-height: 60px;
  }
  .prep-cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* Headings receive focus on route change for screen readers; no ring for that programmatic focus. */
h1[tabindex='-1']:focus {
  outline: none;
}
