:root {
  --paper: #f4f0e7;
  --paper-deep: #ebe5d9;
  --surface: #fffdf8;
  --surface-soft: #faf7ef;
  --ink: #172522;
  --ink-soft: #53605c;
  --ink-faint: #8a928e;
  --line: rgba(23, 37, 34, 0.12);
  --line-strong: rgba(23, 37, 34, 0.2);
  --teal: #0d746a;
  --teal-dark: #075a53;
  --teal-soft: #dceee9;
  --coral: #d96653;
  --coral-soft: #f7e4de;
  --gold: #b98b25;
  --gold-soft: #f3ead3;
  --blue: #466d8d;
  --blue-soft: #e5edf3;
  --success: #167665;
  --danger: #bd4c3c;
  --shadow-small: 0 8px 24px rgba(34, 49, 44, 0.07);
  --shadow-medium: 0 18px 60px rgba(34, 49, 44, 0.1);
  --radius-small: 12px;
  --radius-medium: 20px;
  --radius-large: 32px;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --header-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(217, 102, 83, 0.08), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(13, 116, 106, 0.1), transparent 32rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(13, 116, 106, 0.35);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: white;
  background: var(--teal-dark);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: var(--header-height);
  padding: 0 4.5vw;
  border-bottom: 1px solid rgba(23, 37, 34, 0.08);
  background: rgba(244, 240, 231, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--surface);
  background: var(--ink);
  border-radius: 13px 13px 13px 4px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 7px 18px rgba(23, 37, 34, 0.16);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 253, 248, 0.52);
  border: 1px solid rgba(23, 37, 34, 0.08);
  border-radius: 999px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 37, 34, 0.08);
}

.nav-count {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.header-menu {
  justify-self: end;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface);
  transform: translateY(-1px);
}

.view {
  display: none;
  min-height: calc(100vh - var(--header-height));
  animation: view-in 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.view.is-active {
  display: block;
}

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

.home-shell,
.session-shell,
.results-shell {
  width: min(1240px, calc(100% - 8vw));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  min-height: 610px;
  padding: 70px 2vw 58px;
  gap: 7vw;
}

.hero::before {
  position: absolute;
  top: 12%;
  left: 46%;
  width: 1px;
  height: 76%;
  content: "";
  background: linear-gradient(transparent, var(--line), transparent);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 660px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--teal);
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 7vw, 94px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero h1 em {
  color: var(--teal);
  font-style: normal;
}

.hero-description {
  max-width: 540px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  padding: 11px 19px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  color: white;
  background: var(--teal);
  box-shadow: 0 10px 26px rgba(13, 116, 106, 0.23);
}

.button-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 13px 30px rgba(13, 116, 106, 0.28);
}

.button-ghost {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.48);
  border-color: var(--line-strong);
}

.button-ghost:hover {
  background: var(--surface);
}

.button-soft {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: rgba(13, 116, 106, 0.1);
}

.button-large {
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 15px;
}

.text-button {
  display: inline-flex;
  padding: 8px 0;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.text-button span,
.text-button svg {
  transition: transform 180ms ease;
}

.text-button:hover span,
.text-button:hover svg {
  transform: translateX(3px);
}

.hero-orbit {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: center;
}

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(13, 116, 106, 0.15);
  border-radius: 50%;
}

.orbit-ring-one {
  width: 390px;
  height: 390px;
}

.orbit-ring-two {
  width: 460px;
  height: 460px;
  border-style: dashed;
  opacity: 0.6;
  animation: orbit-spin 50s linear infinite;
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.focus-card {
  position: relative;
  z-index: 1;
  width: min(330px, 82%);
  padding: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 253, 248, 0.97)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 34px;
  box-shadow:
    0 32px 80px rgba(23, 37, 34, 0.13),
    inset 0 0 0 1px rgba(23, 37, 34, 0.04);
  transform: rotate(1.5deg);
}

.focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
}

.focus-top > span:first-child {
  font-weight: 800;
  letter-spacing: 0.08em;
}

.focus-date {
  color: var(--ink-faint);
}

.focus-dial {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  margin: 16px auto 14px;
  place-items: center;
}

.focus-dial svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-track,
.dial-value {
  fill: none;
  stroke-width: 7;
}

.dial-track {
  stroke: #e7e3da;
}

.dial-value {
  stroke: var(--teal);
  stroke-dasharray: 414.69;
  stroke-dashoffset: 414.69;
  stroke-linecap: round;
  transition: stroke-dashoffset 650ms ease;
}

.dial-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dial-copy strong {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
}

.dial-copy span {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.focus-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(217, 102, 83, 0.14);
}

.orbit-label {
  position: absolute;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 6px solid var(--paper);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 12px;
  box-shadow: var(--shadow-small);
}

.orbit-label-top {
  top: 8%;
  right: 7%;
}

.orbit-label-bottom {
  bottom: 8%;
  left: 3%;
  color: #81501c;
  background: var(--gold-soft);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  position: relative;
  display: flex;
  min-height: 130px;
  padding: 26px 4vw 25px 0;
  flex-direction: column;
  justify-content: center;
}

.stat + .stat {
  padding-left: 4vw;
  border-left: 1px solid var(--line);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.stat strong {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  line-height: 1.2;
}

.stat small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.stat small span {
  color: var(--teal);
  font-weight: 700;
}

.content-section {
  padding: 78px 0 18px;
}

.quick-section {
  padding-top: 84px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading .section-kicker {
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-note {
  margin: 0 0 5px;
  color: var(--ink-faint);
  font-size: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.quick-card {
  position: relative;
  display: grid;
  min-height: 184px;
  padding: 25px;
  grid-template-columns: 50px 1fr;
  align-content: center;
  gap: 18px;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-medium);
  cursor: pointer;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.quick-card::before {
  position: absolute;
  right: -35px;
  bottom: -50px;
  width: 150px;
  height: 150px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.09;
}

.quick-card:hover {
  border-color: rgba(13, 116, 106, 0.22);
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
}

.quick-card-wrong {
  color: var(--coral);
  background: linear-gradient(145deg, #fffaf7, #fbede8);
}

.quick-card-random {
  color: var(--teal);
  background: linear-gradient(145deg, #fbfdf9, #e6f2ee);
}

.quick-card-bookmarks {
  color: var(--gold);
  background: linear-gradient(145deg, #fffdf8, #f5eddc);
}

.quick-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  align-self: start;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(23, 37, 34, 0.05);
  border-radius: 15px;
}

.quick-icon svg {
  width: 24px;
  height: 24px;
}

.quick-copy {
  display: flex;
  flex-direction: column;
}

.quick-copy small {
  color: currentColor;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.quick-copy strong {
  margin: 6px 0 3px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.quick-copy span {
  color: var(--ink-soft);
  font-size: 12px;
}

.quick-copy b {
  color: currentColor;
}

.quick-arrow {
  position: absolute;
  top: 19px;
  right: 20px;
  color: currentColor;
  font-size: 18px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.type-card {
  position: relative;
  display: flex;
  min-height: 160px;
  padding: 22px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: 200ms ease;
}

.type-card:hover {
  border-color: var(--type-color);
  box-shadow: var(--shadow-small);
  transform: translateY(-3px);
}

.type-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.type-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--type-color);
  background: var(--type-soft);
  border-radius: 13px;
}

.type-icon svg {
  width: 20px;
  height: 20px;
}

.type-count {
  color: var(--ink-faint);
  font-family: var(--serif);
  font-size: 13px;
}

.type-card strong {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.type-card small {
  color: var(--ink-soft);
  font-size: 11px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.chapter-card {
  display: grid;
  min-height: 138px;
  padding: 20px;
  grid-template-columns: 54px 1fr;
  gap: 17px;
  text-align: left;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    background 200ms ease;
}

.chapter-card:hover {
  background: var(--surface);
  border-color: rgba(13, 116, 106, 0.22);
  transform: translateY(-2px);
}

.chapter-number {
  display: flex;
  width: 54px;
  height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--chapter-color);
  background: var(--chapter-soft);
  border-radius: 15px 15px 15px 5px;
  font-family: var(--serif);
  line-height: 1;
}

.chapter-number small {
  margin-bottom: 4px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.chapter-number strong {
  font-size: 22px;
  font-weight: 600;
}

.chapter-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chapter-body strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chapter-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.chapter-progress {
  height: 4px;
  flex: 1;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: 999px;
}

.chapter-progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--chapter-color);
  border-radius: inherit;
  transition: width 420ms ease;
}

.chapter-progress-row small {
  flex: none;
  color: var(--ink-faint);
  font-size: 10px;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 80px;
  padding: 30px 0 42px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.home-footer p {
  margin: 0;
}

.home-footer > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-link {
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Session */
.session-shell {
  padding: 46px 0 72px;
}

.session-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.session-heading .section-kicker {
  margin-bottom: 7px;
}

.session-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.session-heading p:last-child {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.session-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.palette-count {
  padding-left: 8px;
  color: var(--ink-faint);
  border-left: 1px solid rgba(13, 116, 106, 0.15);
  font-size: 11px;
}

.session-progress-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 30px 0 26px;
}

.session-progress-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-faint);
  font-size: 11px;
}

.session-progress-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  background: rgba(23, 37, 34, 0.08);
  border-radius: 999px;
}

.progress-value {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #4d9f91);
  border-radius: inherit;
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 238px;
  align-items: start;
  gap: 18px;
}

.question-card {
  min-height: 590px;
  padding: clamp(26px, 4vw, 48px);
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  box-shadow: var(--shadow-small);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.tag {
  display: inline-flex;
  padding: 5px 9px;
  align-items: center;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag-chapter {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.bookmark-button {
  display: inline-flex;
  padding: 7px 9px;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  transition: 160ms ease;
}

.bookmark-button:hover {
  color: var(--gold);
  background: var(--gold-soft);
}

.bookmark-button svg {
  width: 17px;
  height: 17px;
}

.bookmark-button.is-active {
  color: var(--gold);
}

.bookmark-button.is-active svg {
  fill: currentColor;
}

.question-number {
  margin-top: 36px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.question-stem {
  max-width: 820px;
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: clamp(21px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.01em;
  white-space: pre-line;
}

.question-hint {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.options-list {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.option-button {
  display: grid;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.option-button:hover:not(:disabled) {
  background: white;
  border-color: rgba(13, 116, 106, 0.28);
  transform: translateX(2px);
}

.option-key {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  transition: 160ms ease;
}

.option-text {
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.7;
}

.option-status {
  width: 20px;
  height: 20px;
  color: transparent;
}

.option-status svg {
  width: 20px;
  height: 20px;
}

.option-button.is-selected {
  background: var(--teal-soft);
  border-color: rgba(13, 116, 106, 0.3);
}

.option-button.is-selected .option-key {
  color: white;
  background: var(--teal);
}

.option-button.is-correct {
  color: var(--teal-dark);
  background: #e4f2ed;
  border-color: rgba(22, 118, 101, 0.38);
}

.option-button.is-correct .option-key {
  color: white;
  background: var(--success);
}

.option-button.is-correct .option-status {
  color: var(--success);
}

.option-button.is-wrong {
  color: #82382d;
  background: #f8e8e3;
  border-color: rgba(189, 76, 60, 0.28);
}

.option-button.is-wrong .option-key {
  color: white;
  background: var(--danger);
}

.option-button.is-wrong .option-status {
  color: var(--danger);
}

.option-button.is-missed {
  background: rgba(228, 242, 237, 0.42);
  border-color: rgba(22, 118, 101, 0.22);
}

.option-button:disabled {
  cursor: default;
}

.feedback-panel {
  margin-top: 24px;
  padding: 19px 21px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--success);
  border-radius: 4px 14px 14px 4px;
}

.feedback-panel.is-wrong {
  border-left-color: var(--danger);
}

.feedback-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feedback-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
}

.feedback-panel.is-wrong .feedback-icon {
  background: var(--danger);
}

.feedback-heading strong {
  display: block;
  font-size: 14px;
}

.feedback-heading p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.feedback-explanation {
  margin: 13px 0 0 38px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-line;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.question-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.button-compact {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.next-step-row {
  display: flex;
  margin: 17px 0 4px 38px;
}

.next-step-button {
  width: 100%;
  min-height: 50px;
  justify-content: space-between;
  padding-inline: 19px;
}

.reveal-button {
  color: var(--ink-faint);
  font-weight: 600;
}

.session-aside {
  position: sticky;
  top: calc(var(--header-height) + 18px);
  display: grid;
  gap: 12px;
}

.aside-card,
.keyboard-card {
  padding: 21px;
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.aside-label {
  margin: 0 0 6px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.aside-card > strong {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
}

.mini-stats {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.mini-stats span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.mini-stats b {
  margin-left: auto;
  color: var(--ink);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-correct {
  background: var(--success);
}

.dot-wrong {
  background: var(--danger);
}

.keyboard-card {
  display: grid;
  gap: 9px;
}

.keyboard-card .aside-label {
  margin-bottom: 3px;
}

.keyboard-card > div:not(.aside-label) {
  display: flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
}

.keyboard-card span {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 9px;
}

kbd {
  min-width: 22px;
  padding: 3px 5px;
  color: var(--ink-soft);
  text-align: center;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.2;
}

/* Results */
.results-shell {
  max-width: 900px;
  padding: 80px 0;
}

.results-hero {
  text-align: center;
}

.results-hero .section-kicker {
  margin-bottom: 12px;
}

.results-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.results-hero > p:last-child {
  margin: 14px auto 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.result-score-card {
  display: grid;
  max-width: 700px;
  margin: 48px auto 0;
  padding: 34px;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 38px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-medium);
}

.score-ring {
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 61%, transparent 62%),
    conic-gradient(var(--teal) var(--score-angle, 0deg), var(--paper-deep) 0);
  border-radius: 50%;
}

.score-ring > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-ring strong {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
}

.score-ring span {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 10px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.result-metrics > div {
  display: flex;
  min-height: 85px;
  padding: 16px 18px;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.result-metrics span {
  color: var(--ink-faint);
  font-size: 10px;
}

.result-metrics strong {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

/* Answer palette */
.palette-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(16, 28, 25, 0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.palette-scrim.is-visible {
  opacity: 1;
}

.palette-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  display: flex;
  width: min(390px, 92vw);
  height: 100vh;
  padding: 30px;
  flex-direction: column;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -25px 0 70px rgba(23, 37, 34, 0.13);
  transform: translateX(105%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.palette-panel.is-open {
  transform: translateX(0);
}

.palette-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.palette-head .section-kicker {
  margin-bottom: 5px;
}

.palette-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
}

.palette-legend {
  display: flex;
  gap: 18px;
  margin-top: 22px;
  padding-bottom: 18px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.palette-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.legend-current {
  background: var(--gold);
}

.legend-correct {
  background: var(--success);
}

.legend-wrong {
  background: var(--danger);
}

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

.palette-item {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.palette-item.is-correct {
  color: var(--success);
  background: #e5f2ed;
  border-color: rgba(22, 118, 101, 0.2);
}

.palette-item.is-wrong {
  color: var(--danger);
  background: #fae9e4;
  border-color: rgba(189, 76, 60, 0.2);
}

.palette-item.is-current {
  color: white;
  background: var(--gold);
  border-color: var(--gold);
}

/* Settings */
.settings-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(23, 37, 34, 0.25);
}

.settings-dialog::backdrop {
  background: rgba(16, 28, 25, 0.36);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  padding: 26px 28px 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.dialog-head .section-kicker {
  margin-bottom: 4px;
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
}

.settings-content {
  padding: 24px 28px 28px;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.settings-summary > div {
  display: flex;
  min-height: 78px;
  padding: 13px;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-soft);
}

.settings-summary span {
  color: var(--ink-faint);
  font-size: 10px;
}

.settings-summary strong {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.settings-note {
  margin: 20px 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.danger-button {
  width: 100%;
  padding: 12px;
  color: var(--danger);
  background: var(--coral-soft);
  border: 1px solid rgba(189, 76, 60, 0.14);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  background: #f3d7d0;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  color: white;
  background: rgba(23, 37, 34, 0.92);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(23, 37, 34, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 3vw;
    padding-inline: 0;
  }

  .hero::before {
    display: none;
  }

  .hero h1 {
    font-size: clamp(55px, 7.8vw, 76px);
  }

  .orbit-ring-one {
    width: 330px;
    height: 330px;
  }

  .orbit-ring-two {
    width: 380px;
    height: 380px;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .session-layout {
    grid-template-columns: 1fr;
  }

  .session-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  :root {
    --header-height: 66px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
    backdrop-filter: none;
  }

  .brand-copy small {
    display: none;
  }

  .main-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 60;
    justify-content: space-around;
    padding: 7px;
    background: rgba(255, 253, 248, 0.93);
    box-shadow: 0 12px 35px rgba(23, 37, 34, 0.16);
    backdrop-filter: blur(16px);
  }

  .nav-item {
    flex: 1;
    justify-content: center;
  }

  .header-menu {
    display: none;
  }

  .home-shell,
  .session-shell,
  .results-shell {
    width: min(100% - 32px, 680px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 56px 0 45px;
    gap: 45px;
  }

  .hero h1 {
    font-size: clamp(50px, 13vw, 72px);
  }

  .hero-description {
    margin-top: 22px;
    font-size: 15px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 28px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-orbit {
    min-height: 370px;
  }

  .orbit-ring-one {
    width: 320px;
    height: 320px;
  }

  .orbit-ring-two {
    width: 365px;
    height: 365px;
  }

  .focus-card {
    width: 290px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat {
    min-height: 110px;
    padding: 20px;
  }

  .stat + .stat {
    padding-left: 20px;
  }

  .stat:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .content-section,
  .quick-section {
    padding-top: 58px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 22px;
  }

  .section-note {
    margin: 0;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .quick-card {
    min-height: 145px;
  }

  .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .home-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 56px;
    padding-bottom: 100px;
  }

  .session-shell {
    padding-top: 32px;
    padding-bottom: 110px;
  }

  .session-heading h1 {
    font-size: 31px;
  }

  .session-heading-actions .button {
    padding-inline: 13px;
  }

  .palette-count {
    display: none;
  }

  .session-progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 24px 0 16px;
  }

  .question-card {
    min-height: 0;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .question-number {
    margin-top: 28px;
  }

  .question-stem {
    font-size: 21px;
  }

  .option-button {
    padding: 12px;
  }

  .option-text {
    font-size: 13px;
  }

  .question-actions {
    align-items: center;
    flex-wrap: wrap;
  }

  .question-actions-right {
    display: flex;
    margin-left: auto;
  }

  .next-step-row {
    margin: 15px 0 4px;
  }

  .next-step-button {
    width: 100%;
    min-height: 52px;
  }

  .button-compact {
    min-height: 39px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .reveal-button {
    font-size: 11px;
  }

  .session-aside {
    grid-template-columns: 1fr;
  }

  .keyboard-card {
    display: none;
  }

  .results-shell {
    padding: 56px 0 120px;
  }

  .result-score-card {
    grid-template-columns: 1fr;
    padding: 26px 18px;
    gap: 25px;
  }

  .score-ring {
    margin: 0 auto;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 15px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .nav-item {
    padding-inline: 8px;
    font-size: 11px;
  }

  .hero h1 {
    font-size: 49px;
  }

  .hero-orbit {
    min-height: 330px;
  }

  .focus-card {
    width: 260px;
    padding: 21px;
  }

  .focus-dial {
    width: 166px;
    height: 166px;
  }

  .orbit-ring-one {
    width: 285px;
    height: 285px;
  }

  .orbit-ring-two {
    width: 324px;
    height: 324px;
  }

  .orbit-label {
    width: 48px;
    height: 48px;
  }

  .type-grid {
    grid-template-columns: 1fr;
  }

  .type-card {
    min-height: 132px;
  }

  .session-heading {
    gap: 10px;
  }

  .session-heading p:last-child {
    max-width: 220px;
  }

  .session-heading-actions {
    gap: 6px;
  }

  .session-heading-actions .button {
    min-height: 40px;
    font-size: 11px;
  }

  .question-meta {
    align-items: flex-start;
  }

  .bookmark-button span {
    display: none;
  }

  .option-button {
    grid-template-columns: 29px 1fr auto;
    gap: 10px;
  }

  .option-key {
    width: 28px;
    height: 28px;
  }

  .question-actions {
    gap: 8px;
  }

  .button-compact {
    padding-inline: 9px;
    font-size: 11px;
  }

  .feedback-explanation {
    margin-left: 0;
  }

  .palette-panel {
    padding: 24px 20px;
  }

  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .settings-content,
  .dialog-head {
    padding-inline: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
