:root {
  --bg: #f7f1e8;
  --bg-strong: #efe3d0;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: #fffaf2;
  --dashboard-paper: #fbf5ea;
  --dashboard-paper-strong: #fffaf1;
  --dashboard-paper-shadow: rgba(93, 69, 39, 0.12);
  --dashboard-raised-shadow:
    0 22px 40px rgba(79, 57, 28, 0.12),
    0 8px 18px rgba(94, 70, 39, 0.08);
  --dashboard-soft-shadow:
    0 14px 28px rgba(88, 65, 34, 0.1),
    0 5px 12px rgba(88, 65, 34, 0.05);
  --dashboard-inset-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -12px 18px rgba(149, 122, 83, 0.08),
    inset 0 16px 24px rgba(255, 255, 255, 0.16);
  --dashboard-accent-deep: #0f605b;
  --dashboard-accent-soft: #d8ebe5;
  --topic-surface:
    linear-gradient(180deg, rgba(232, 241, 236, 0.95), rgba(218, 231, 225, 0.91)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), transparent 68%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 72%);
  --text: #23180a;
  --muted: #69553d;
  --line: rgba(76, 54, 29, 0.16);
  --accent: #0f766e;
  --accent-soft: #d4eee8;
  --shadow: 0 18px 45px rgba(71, 48, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(220, 185, 128, 0.32), transparent 32%),
    radial-gradient(circle at top right, rgba(61, 152, 141, 0.22), transparent 28%),
    linear-gradient(180deg, #f8f1e7 0%, #f4eadf 42%, #efe2d4 100%);
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

#root {
  min-height: 100vh;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.app-shell-session {
  width: min(1440px, calc(100% - 24px));
  height: calc(100dvh - 12px);
  padding: 6px 0;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(31, 24, 17, 0.08);
  border-radius: 28px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.92), rgba(244, 232, 210, 0.92)),
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 60%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  top: -120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.16), transparent 70%);
}

.eyebrow,
.mini-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.hero h1,
.section-title,
.topic-card h3,
.question-card h2,
.pill,
.dialog-title {
  font-family: "Space Grotesk", sans-serif;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.96;
  margin: 10px 0 14px;
  max-width: 10ch;
}

.hero-grid,
.content-grid,
.stats-grid,
.topic-actions,
.question-actions,
.subtopic-list,
.toolbar,
.diagnostic-controls,
.top-row {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
}

.hero p,
.muted {
  color: var(--muted);
}

.score-good {
  color: #1f7a4d;
  font-weight: 700;
}

.score-bad {
  color: #b33a3a;
  font-weight: 700;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.hero-controls {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  max-width: 58rem;
}

.hero-primary-actions,
.hero-utility-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-utility-actions .button-ghost {
  background: rgba(255, 252, 247, 0.92);
}

.stat-card,
.panel,
.topic-card,
.question-card,
.results-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.stat-card,
.panel,
.question-card,
.results-card {
  padding: 18px;
}

.stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  margin: 8px 0 0;
}

.content-grid {
  grid-template-columns: 300px 1fr;
  margin-top: 24px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.button,
.button-ghost,
.choice-button,
.nav-chip {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button:hover,
.button-ghost:hover,
.choice-button:hover,
.nav-chip:hover {
  transform: none;
}

.button {
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  padding: 12px 18px;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.button-ghost,
.nav-chip {
  background: rgba(255, 252, 247, 0.8);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 11px 16px;
}

.topic-card-action-open {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.84), rgba(17, 94, 89, 0.8));
  color: white;
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 11px 22px rgba(15, 118, 110, 0.14);
}

.topic-card-action-generate {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.84), rgba(17, 94, 89, 0.8));
  color: white;
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 11px 22px rgba(15, 118, 110, 0.14);
}

.topic-card-action-open:hover,
.topic-card-action-generate:hover {
  border-color: rgba(15, 118, 110, 0.44);
}

.topic-modal-close-button {
  background: linear-gradient(135deg, #bf5a34, #a13f24);
  color: white;
  border-color: rgba(161, 63, 36, 0.34);
  box-shadow: 0 11px 22px rgba(161, 63, 36, 0.16);
}

.topic-modal-close-button:hover {
  border-color: rgba(161, 63, 36, 0.46);
}

.button[disabled],
.button-ghost[disabled],
.choice-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.topic-card {
  padding: 22px;
  overflow: hidden;
}

.topic-summary-panel {
  display: grid;
  gap: 16px;
  margin: -22px -22px 0;
  padding: 22px 22px 18px;
  border-radius: 24px 24px 20px 20px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
  background: var(--topic-surface);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.topic-actions-surface {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(15, 118, 110, 0.1);
  background: var(--topic-surface);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.topic-card.is-thin {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(244, 236, 224, 0.92)),
    repeating-linear-gradient(
      -45deg,
      rgba(164, 129, 86, 0.045),
      rgba(164, 129, 86, 0.045) 10px,
      rgba(255, 255, 255, 0.06) 10px,
      rgba(255, 255, 255, 0.06) 20px
    );
}

.topic-card h3 {
  margin: 10px 0 12px;
  font-size: 1.3rem;
}

.topic-header,
.topic-actions,
.subtopic-row,
.choice-row,
.card-row,
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f5c56;
  font-size: 0.9rem;
}

.pill.warn {
  background: rgba(191, 102, 24, 0.12);
  color: #8c4f14;
}

.pill.subtle {
  background: rgba(76, 54, 29, 0.08);
  color: var(--muted);
}

.quiz-topic-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  padding: 8px 15px;
  border-radius: 16px;
  border: 3px solid #a7a7a7;
  background: transparent;
  color: #8a8a8a;
  font-size: calc(0.9rem + 1px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.clear-answer-stamp {
  --clear-stamp-text: rgba(184, 95, 95, 0.62);
  --clear-stamp-text-strong: rgba(189, 66, 66, 0.88);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--clear-stamp-text);
  cursor: pointer;
  flex: 0 0 auto;
  overflow: visible;
  transition: color 180ms ease;
}

.clear-answer-stamp-svg {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  overflow: visible;
}

.clear-answer-stamp-text {
  fill: currentColor;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform-origin: 50% 50%;
  transform: rotate(180deg);
  transition: transform 220ms ease, fill 180ms ease;
}

.clear-answer-stamp-disc {
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.96), transparent 42%),
    radial-gradient(circle at 58% 62%, rgba(244, 203, 203, 0.56), transparent 72%),
    linear-gradient(180deg, rgba(251, 224, 224, 0.76), rgba(248, 212, 212, 0.62));
}

.clear-answer-stamp:hover:not(:disabled) {
  color: var(--clear-stamp-text-strong);
}

.clear-answer-stamp:hover:not(:disabled) .clear-answer-stamp-text,
.clear-answer-stamp:focus-visible .clear-answer-stamp-text {
  transform: rotate(0deg);
}

.clear-answer-stamp:focus-visible {
  outline: 0;
  color: var(--clear-stamp-text-strong);
}

.clear-answer-stamp:disabled {
  cursor: default;
  color: rgba(184, 95, 95, 0.32);
}

.clear-answer-stamp:disabled .clear-answer-stamp-disc {
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.88), transparent 42%),
    linear-gradient(180deg, rgba(251, 236, 236, 0.72), rgba(247, 229, 229, 0.68));
}

.score-bar {
  width: 100%;
  min-height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d13f34 0%, #e6ad2b 48%, #3ba968 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 250, 242, 0.18);
  transform-origin: right center;
}

.score-bar[data-value]::after {
  transform: scaleX(calc(1 - (attr(data-value number) / 100)));
}

.score-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 250, 242, 0.74);
}

.score-bar.is-disabled {
  min-height: 12px;
  background: linear-gradient(135deg, rgba(194, 189, 181, 0.62), rgba(224, 219, 210, 0.96));
  border: 1px solid rgba(120, 110, 98, 0.18);
}

.score-bar.is-disabled::after {
  display: none;
}

.score-bar.has-message {
  min-height: 40px;
}

.score-bar-message {
  position: relative;
  z-index: 1;
  padding: 0 14px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: rgba(86, 76, 66, 0.92);
}

.subtopic-list {
  margin-top: 20px;
}

.subtopic-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  margin-bottom: 4px;
}

.subtopic-section-header::before {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(160, 141, 120, 0.25);
}

.subtopic-section-header .mini-label {
  white-space: nowrap;
  flex-shrink: 0;
}

.subtopic-list.compact {
  gap: 10px;
}

.subtopic-row {
  border-top: 1px solid rgba(76, 54, 29, 0.08);
  padding-top: 12px;
}

.subtopic-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.subtopic-meta {
  display: grid;
  gap: 4px;
}

.subtopic-metrics {
  min-width: min(260px, 100%);
}

.section-title {
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.sidebar-note {
  font-size: 0.96rem;
  line-height: 1.45;
}

.question-card h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
  margin: 10px 0 14px;
}

.question-stem {
  font-size: 1.06rem;
  line-height: 1.6;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.choice-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  text-align: left;
}

.choice-button.selected {
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.16);
}

.choice-button.correct {
  background: rgba(59, 169, 104, 0.14);
  border-color: rgba(59, 169, 104, 0.44);
}

.choice-button.incorrect {
  background: rgba(209, 63, 52, 0.12);
  border-color: rgba(209, 63, 52, 0.28);
}

.answer-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(123, 123, 123, 0.08);
  border: 1px solid rgba(123, 123, 123, 0.16);
}

.answer-panel.is-clickable {
  cursor: pointer;
}

.result-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 180px;
  min-height: 64px;
  padding: 14px 22px 26px;
  border-radius: 18px;
  font-weight: 700;
  justify-content: center;
  border-width: 1px;
  border-style: solid;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 7px 14px rgba(108, 91, 69, 0.08);
}

.result-button-primary {
  background: linear-gradient(180deg, rgba(248, 253, 250, 0.99), rgba(233, 245, 238, 0.97));
  color: #2b7a59;
  border-color: rgba(79, 154, 117, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(199, 230, 214, 0.75),
    0 11px 18px rgba(87, 145, 114, 0.15),
    0 2px 5px rgba(87, 145, 114, 0.08);
}

.result-button-ghost {
  background: linear-gradient(180deg, rgba(255, 251, 250, 0.99), rgba(245, 234, 231, 0.95));
  color: #98574f;
  border-color: rgba(180, 110, 101, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -4px 8px rgba(187, 130, 122, 0.09),
    0 4px 8px rgba(173, 91, 82, 0.07);
}

.result-button-primary:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(241, 250, 245, 0.99), rgba(221, 239, 228, 0.98));
  color: #24694d;
  border-color: rgba(36, 105, 77, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(191, 222, 205, 0.82),
    0 11px 18px rgba(70, 126, 98, 0.16),
    0 2px 5px rgba(70, 126, 98, 0.09);
}

.result-button-ghost:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(255, 246, 244, 0.99), rgba(241, 225, 221, 0.97));
  color: #8a443d;
  border-color: rgba(138, 68, 61, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -4px 8px rgba(170, 106, 98, 0.12),
    0 4px 8px rgba(144, 71, 64, 0.08);
}

.shortcut-badge {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid currentColor;
  color: currentColor;
  opacity: 0.5;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  pointer-events: none;
}

.shortcut-badge-nav {
  bottom: 6px;
  font-size: 0.9rem;
  padding: 0;
  border: 0;
  opacity: 0.75;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(76, 54, 29, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #57b99b);
}

.empty-state {
  padding: 20px;
  border-radius: 20px;
  border: 1px dashed rgba(76, 54, 29, 0.24);
  color: var(--muted);
}

.footer-note {
  margin-top: 24px;
  font-size: 0.92rem;
  color: var(--muted);
}

.session-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 16px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(255, 252, 247, 0.72);
  box-shadow: 0 14px 30px rgba(71, 48, 18, 0.08);
}

.session-banner.is-active {
  border-color: rgba(15, 118, 110, 0.34);
  background:
    linear-gradient(135deg, rgba(231, 244, 238, 0.96), rgba(255, 252, 247, 0.94)),
    rgba(255, 252, 247, 0.72);
}

.session-banner.is-complete {
  border-color: rgba(217, 145, 24, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.97), rgba(255, 252, 247, 0.94)),
    rgba(255, 252, 247, 0.72);
}

.session-banner.is-clickable {
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease, background 120ms ease;
}

.session-banner.is-clickable:hover,
.session-banner.is-clickable:focus-visible {
  border-color: rgba(15, 118, 110, 0.44);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.12);
}

.session-banner:disabled {
  cursor: default;
}

.session-banner .muted {
  font-weight: 600;
}

.dashboard-hero {
  padding: 38px;
  border-radius: 32px;
  border-color: rgba(112, 91, 60, 0.1);
  background:
    radial-gradient(circle at top right, rgba(133, 167, 150, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(253, 249, 243, 0.98), rgba(245, 237, 226, 0.97));
  box-shadow:
    0 20px 44px rgba(76, 55, 28, 0.1),
    0 4px 10px rgba(76, 55, 28, 0.04);
}

.dashboard-hero::before {
  display: none;
}

.dashboard-hero::after {
  width: 380px;
  height: 380px;
  right: -140px;
  top: -150px;
  background: radial-gradient(circle, rgba(160, 187, 172, 0.14), transparent 62%);
}

.dashboard-hero-grid {
  gap: 28px;
  align-items: end;
}

.dashboard-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
}

.dashboard-hero .eyebrow {
  color: #7d6850;
  letter-spacing: 0.16em;
  font-weight: 650;
}

.dashboard-hero h1 {
  max-width: 11ch;
  margin-top: 10px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.55rem, 4.15vw, 4.25rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 650;
}

.dashboard-hero p {
  max-width: 39rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #66533d;
}

.dashboard-hero-controls {
  gap: 16px;
}

.dashboard-stats-grid {
  margin-top: 0;
  gap: 14px;
  align-content: end;
}

.dashboard-stat-card {
  min-height: 132px;
  padding: 18px 18px 16px;
  border-radius: 24px;
  border-color: rgba(127, 103, 71, 0.1);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(245, 237, 225, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 24px rgba(84, 61, 31, 0.08);
}

.dashboard-stat-card::before,
.dashboard-stat-card::after {
  display: none;
}

.dashboard-stat-card .mini-label {
  max-width: 9ch;
  color: #7a664c;
  line-height: 1.4;
  font-weight: 650;
}

.dashboard-stat-card .stat-value {
  margin-top: 14px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 2.9vw, 2.9rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
  font-weight: 620;
}

.dashboard-hero .button,
.dashboard-sidebar .button,
.dashboard-topic-card .button {
  border: 1px solid rgba(14, 96, 89, 0.22);
  background: #186f68;
  box-shadow: 0 8px 16px rgba(24, 111, 104, 0.16);
}

.dashboard-hero .button-ghost,
.dashboard-sidebar .button-ghost,
.dashboard-topic-card .button-ghost,
.dashboard-topic-card .nav-chip {
  border: 1px solid rgba(127, 103, 71, 0.12);
  background: rgba(255, 253, 249, 0.88);
  color: #43321d;
  box-shadow: 0 4px 10px rgba(94, 70, 39, 0.06);
}

.dashboard-hero .button:not(:disabled):is(:hover, :focus-visible),
.dashboard-sidebar .button:not(:disabled):is(:hover, :focus-visible),
.dashboard-topic-card .button:not(:disabled):is(:hover, :focus-visible) {
  background: #0f605b;
  box-shadow: 0 10px 18px rgba(15, 96, 91, 0.18);
}

.dashboard-hero .button-ghost:not(:disabled):is(:hover, :focus-visible),
.dashboard-sidebar .button-ghost:not(:disabled):is(:hover, :focus-visible),
.dashboard-topic-card .button-ghost:not(:disabled):is(:hover, :focus-visible),
.dashboard-topic-card .nav-chip:not(:disabled):is(:hover, :focus-visible) {
  border-color: rgba(127, 103, 71, 0.16);
  background: rgba(255, 254, 251, 0.98);
  box-shadow: 0 6px 12px rgba(94, 70, 39, 0.07);
}

.dashboard-session-banner {
  border-radius: 22px;
  border-color: rgba(117, 146, 132, 0.16);
  background: rgba(249, 251, 247, 0.92);
  box-shadow: 0 8px 16px rgba(74, 86, 74, 0.07);
}

.dashboard-session-banner.is-active {
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(243, 248, 245, 0.96);
}

.dashboard-grid {
  gap: 26px;
  margin-top: 30px;
  align-items: start;
}

.dashboard-sidebar,
.dashboard-main {
  gap: 18px;
}

.dashboard-sidebar .dashboard-panel {
  padding: 20px;
  border-radius: 26px;
  border-color: rgba(129, 105, 70, 0.08);
  background: linear-gradient(180deg, rgba(243, 236, 225, 0.92), rgba(238, 229, 216, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 22px rgba(90, 67, 37, 0.05);
}

.dashboard-sidebar .dashboard-panel::before {
  display: none;
}

.dashboard-panel-study {
  background: linear-gradient(180deg, rgba(241, 239, 232, 0.94), rgba(235, 230, 218, 0.9));
}

.dashboard-panel-diagnostic {
  background: linear-gradient(180deg, rgba(243, 236, 226, 0.94), rgba(236, 226, 212, 0.9));
}

.dashboard-sidebar .section-title,
.dashboard-topic-card h3 {
  font-family: "Fraunces", serif;
  letter-spacing: -0.035em;
}

.dashboard-sidebar .section-title {
  font-size: 1.28rem;
  margin-bottom: 10px;
  font-weight: 620;
}

.dashboard-sidebar .sidebar-note,
.dashboard-sidebar .reason-text,
.dashboard-topic-card .muted {
  color: #655441;
}

.dashboard-sidebar .mini-label,
.dashboard-topic-card .mini-label {
  color: #7a684f;
  font-weight: 620;
}

.dashboard-sidebar .stack {
  gap: 12px;
}

.dashboard-sidebar .dashboard-mini-card {
  padding: 16px;
  border-radius: 20px;
  border-color: rgba(133, 111, 77, 0.1);
  background: rgba(255, 252, 247, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 16px rgba(90, 67, 37, 0.05);
}

.dashboard-sidebar .dashboard-mini-card::after {
  display: none;
}

.dashboard-sidebar .dashboard-mini-card strong,
.dashboard-sidebar .diagnostic-history-card strong {
  display: block;
  font-size: 1.03rem;
  line-height: 1.22;
  font-weight: 620;
}

.dashboard-sidebar .pill,
.dashboard-topic-card .pill {
  border: 1px solid rgba(110, 139, 125, 0.12);
  background: rgba(228, 241, 236, 0.92);
  color: #20695f;
  box-shadow: none;
}

.dashboard-sidebar .pill.subtle,
.dashboard-topic-card .pill.subtle {
  border-color: rgba(137, 116, 86, 0.12);
  background: rgba(244, 238, 229, 0.92);
  color: #7a684f;
}

.dashboard-sidebar .pill.warn,
.dashboard-topic-card .pill.warn {
  border-color: rgba(188, 128, 53, 0.14);
  background: rgba(247, 234, 209, 0.94);
  color: #8a5619;
}

.dashboard-topic-card {
  padding: 22px;
  border-radius: 28px;
  border-color: rgba(125, 101, 69, 0.1);
  background: linear-gradient(180deg, rgba(252, 248, 242, 0.98), rgba(244, 236, 224, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 18px 34px rgba(87, 64, 34, 0.08);
}

.dashboard-topic-card::before {
  display: none;
}

.dashboard-topic-card.is-thin {
  background: linear-gradient(180deg, rgba(251, 247, 241, 0.98), rgba(242, 233, 220, 0.95));
}

.dashboard-topic-card .topic-summary-panel {
  gap: 18px;
  margin: -22px -22px 0;
  padding: 22px 22px 18px;
  border-radius: 28px 28px 20px 20px;
  border-bottom: 1px solid rgba(62, 112, 94, 0.08);
  background:
    linear-gradient(180deg, rgba(236, 242, 237, 0.9), rgba(230, 236, 231, 0.82)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.03), transparent 65%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.dashboard-topic-card h3 {
  margin-top: 8px;
  font-size: 1.42rem;
  line-height: 1.05;
  font-weight: 620;
}

.dashboard-topic-card .topic-progress-copy .muted,
.dashboard-topic-card .subtopic-summary .muted {
  font-weight: 500;
}

.dashboard-topic-card .topic-card-action-open,
.dashboard-topic-card .topic-card-action-generate {
  border-color: rgba(14, 96, 89, 0.22);
  background: #186f68;
  color: white;
  box-shadow: 0 8px 16px rgba(24, 111, 104, 0.14);
}

.dashboard-topic-card .topic-card-action-open:not(:disabled):is(:hover, :focus-visible),
.dashboard-topic-card .topic-card-action-generate:not(:disabled):is(:hover, :focus-visible) {
  border-color: rgba(14, 96, 89, 0.28);
  background: #0f605b;
}

.dashboard-topic-card .score-bar {
  min-height: 12px;
  border: 1px solid rgba(113, 93, 64, 0.08);
  box-shadow: inset 0 1px 2px rgba(110, 83, 46, 0.08);
}

.dashboard-topic-card .score-mask {
  background: rgba(251, 247, 240, 0.82);
  box-shadow: inset 1px 0 0 rgba(150, 122, 87, 0.1);
}

.dashboard-topic-card .score-bar.has-message {
  min-height: 40px;
}

.dashboard-topic-card .subtopic-section-header {
  margin-top: 22px;
  margin-bottom: 8px;
}

.dashboard-topic-card .subtopic-section-header::before {
  background: linear-gradient(90deg, rgba(170, 148, 118, 0.08), rgba(170, 148, 118, 0.24), rgba(170, 148, 118, 0.08));
}

.dashboard-topic-card .subtopic-list.compact {
  gap: 10px;
  margin-top: 16px;
}

.dashboard-topic-card .subtopic-row {
  padding: 13px 15px;
  border-top: 0;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 12px rgba(92, 69, 38, 0.04);
}

.dashboard-topic-card .subtopic-row:first-child {
  padding-top: 13px;
}

.dashboard-topic-card .subtopic-metrics {
  min-width: min(290px, 100%);
}

.dashboard-topic-card .subtopic-meta strong {
  display: block;
  font-size: 1rem;
  line-height: 1.24;
  font-weight: 620;
}

.dashboard-footer-note {
  margin-top: 26px;
  padding: 0 8px;
  color: #7a684f;
}

.reason-text {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

.topic-progress-copy,
.subtopic-summary {
  display: grid;
  gap: 4px;
}

.coverage-note {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(191, 102, 24, 0.08);
  color: #7a491d;
  border: 1px solid rgba(191, 102, 24, 0.14);
  font-size: 0.93rem;
}

.subtopic-toggle {
  display: none;
}

.file-input {
  display: none;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 24, 10, 0.32);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.topic-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 24, 10, 0.28);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
}

.topic-modal-shell {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(31, 24, 17, 0.08);
  background:
    linear-gradient(135deg, rgba(247, 239, 228, 0.98), rgba(239, 229, 212, 0.96)),
    linear-gradient(120deg, rgba(15, 118, 110, 0.07), transparent 58%);
  box-shadow: 0 26px 70px rgba(43, 29, 10, 0.28);
}

.topic-detail-modal-layout {
  margin-top: 0;
}

.dialog-card {
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(31, 24, 17, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.98), rgba(244, 232, 210, 0.98)),
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 60%);
  box-shadow: 0 22px 50px rgba(43, 29, 10, 0.24);
}

.dialog-title {
  margin: 10px 0 10px;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.05;
}

.dialog-actions {
  margin-top: 18px;
}

.dialog-option {
  position: relative;
}

.dialog-option.is-selected {
  outline: 3px solid rgba(15, 118, 110, 0.34);
  outline-offset: 3px;
}

.dialog-option.button-danger.is-selected {
  outline-color: rgba(181, 74, 38, 0.32);
}

.test-setup-dialog {
  width: min(620px, 100%);
}

.test-setup-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(31, 24, 17, 0.08);
}

.test-mix-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.test-mix-row {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.78);
  border: 1px solid rgba(31, 24, 17, 0.08);
}

.test-mix-label {
  font-weight: 700;
  color: var(--text);
}

.test-mix-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.test-mix-input {
  width: 88px;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(31, 24, 17, 0.12);
  background: rgba(255, 255, 255, 0.94);
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
}

.test-mix-cap {
  color: var(--muted);
  font-weight: 600;
}

.test-setup-total {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.test-setup-total strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
}

.test-setup-actions {
  margin-top: 20px;
}

.diagnostic-setup-dialog {
  width: min(640px, 100%);
}

.diagnostic-setup-summary {
  margin-bottom: 18px;
}

.diagnostic-input-row {
  margin-top: 0;
}

.diagnostic-estimate-total {
  margin-top: 14px;
}

.diagnostic-topic-count {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.button-danger {
  background: linear-gradient(135deg, #b54a26, #94351b);
  box-shadow: 0 12px 24px rgba(148, 53, 27, 0.22);
}

.quiz-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.quiz-header,
.quiz-footer,
.quiz-sidebar-card,
.quiz-card,
.quiz-empty .results-card {
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.88);
  box-shadow: var(--shadow);
}

.quiz-header,
.quiz-footer {
  border-radius: 24px;
  padding: 18px 20px;
}

.quiz-header {
  background:
    linear-gradient(
      90deg,
      rgba(145, 186, 164, 0.26) 0%,
      rgba(180, 211, 195, 0.16) 18%,
      rgba(255, 252, 247, 0.88) 35%,
      rgba(255, 252, 247, 0.88) 100%
    );
  border-left-color: rgba(175, 168, 149, 0.78);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quiz-header-meta {
  min-width: 0;
}

.quiz-title {
  font-family: "Space Grotesk", sans-serif;
  margin: 6px 0;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 0.96;
}

.quiz-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}

.quiz-header-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quiz-header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quiz-header-leave-button,
.quiz-header-submit-button {
  min-height: 44px;
  font-weight: 700;
  border-radius: 999px;
}

.quiz-header-leave-button {
  background: linear-gradient(180deg, rgba(255, 252, 249, 0.98), rgba(248, 241, 238, 0.95));
  color: #91564f;
  border: 1px solid rgba(169, 111, 103, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -4px 8px rgba(192, 149, 142, 0.08);
}

.quiz-header-leave-button:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(255, 246, 244, 0.98), rgba(245, 233, 230, 0.97));
  color: #84453f;
  border-color: rgba(132, 69, 63, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -4px 8px rgba(168, 110, 101, 0.1);
}

.quiz-header-submit-button {
  background: linear-gradient(180deg, #18786f 0%, #136660 54%, #115a55 100%);
  border: 1px solid rgba(17, 98, 91, 0.72);
  color: #f7f5ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 12px 20px rgba(14, 95, 88, 0.2),
    0 2px 6px rgba(10, 76, 71, 0.14);
}

.quiz-header-submit-button:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, #136b63 0%, #105c56 54%, #0d504c 100%);
  border-color: rgba(12, 80, 76, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 20px rgba(11, 83, 77, 0.18),
    0 2px 6px rgba(9, 62, 59, 0.14);
}

.quiz-header-statuses {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: nowrap;
}

.quiz-progress-block {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: max-content;
}

.quiz-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
}

.quiz-footer-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
}

.quiz-sidebar {
  min-height: 0;
}

.quiz-sidebar-card {
  height: 100%;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -6px 10px rgba(96, 74, 46, 0.07),
    inset 0 0 8px rgba(130, 106, 76, 0.055);
}

.question-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.question-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  border-radius: 14px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}

.question-chip.pending {
  opacity: 0.76;
}

.question-chip.review {
  background: rgba(217, 145, 24, 0.12);
  border-color: rgba(217, 145, 24, 0.26);
  color: #8c5b17;
}

.question-chip.correct {
  background: rgba(59, 169, 104, 0.14);
  border-color: rgba(59, 169, 104, 0.36);
  color: #1f7a4d;
}

.question-chip.incorrect {
  background: rgba(209, 63, 52, 0.12);
  border-color: rgba(209, 63, 52, 0.28);
  color: #a33b31;
}

.question-chip.is-current {
  box-shadow: inset 0 0 0 2px rgba(35, 24, 10, 0.22);
}

.quiz-sidebar-note {
  margin-top: 16px;
}

.quiz-stage {
  min-width: 0;
  min-height: 0;
}

.quiz-card {
  height: 100%;
  min-height: 0;
  border-radius: 28px;
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.quiz-card-top {
  position: relative;
  padding-right: 92px;
}

.quiz-card-top h2 {
  margin-bottom: 0;
}

.quiz-card-top-actions {
  position: absolute;
  top: 0;
  right: 0;
}

.quiz-card-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
}

.quiz-card-body.has-answer-dock {
  grid-template-rows: minmax(0, 1fr) minmax(108px, 156px);
}

.quiz-card-body.has-answer-dock.is-awaiting-answer {
  grid-template-rows: minmax(0, 1fr) auto;
}

.quiz-question-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.quiz-answer-dock {
  min-height: 0;
  overflow: auto;
  border-radius: 20px;
  padding: 14px 16px;
  background: rgba(123, 123, 123, 0.08);
  border: 1px solid rgba(123, 123, 123, 0.16);
}

.quiz-answer-dock.is-clickable {
  cursor: pointer;
}

.quiz-answer-content {
  margin-top: 10px;
  line-height: 1.55;
}

.answer-reveal-shell {
  position: relative;
  margin-top: 10px;
  min-height: 112px;
  border-radius: 18px;
  overflow: hidden;
}

.answer-reveal-content {
  transition: filter 140ms ease, opacity 140ms ease;
}

.answer-reveal-shell:not(.is-revealed) .answer-reveal-content {
  filter: blur(18px);
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

.answer-reveal-shell:not(.is-revealed)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 252, 247, 0.18);
}

.answer-reveal-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  white-space: nowrap;
  color: #4e4e4e;
  font-weight: 800;
  letter-spacing: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.quiz-prior-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(76, 54, 29, 0.06);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.quiz-source-link {
  margin-top: 12px;
  display: inline-flex;
}

.quiz-answer-placeholder {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(76, 54, 29, 0.05);
  border: 1px dashed rgba(76, 54, 29, 0.16);
}

.quiz-answer-placeholder p {
  margin: 8px 0 0;
}

.quiz-submit-card-body {
  display: block;
}

.quiz-submit-card {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 100%;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(244, 248, 245, 0.94)),
    rgba(255, 252, 247, 0.94);
  border: 1px solid rgba(76, 54, 29, 0.12);
}

.quiz-submit-card p {
  margin: 0;
}

.quiz-submit-title {
  margin: 0;
}

.quiz-submit-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 12px;
}

.quiz-submit-stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.quiz-submit-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.answer-panel-intro {
  margin-top: 20px;
}

.quiz-footer {
  display: grid;
  align-items: center;
  min-width: 0;
}

.quiz-footer-sidebar {
  grid-template-columns: minmax(0, 1fr);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -6px 10px rgba(96, 74, 46, 0.07),
    inset 0 0 8px rgba(130, 106, 76, 0.055);
}

.quiz-footer-stage {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -6px 10px rgba(96, 74, 46, 0.07),
    inset 0 0 8px rgba(130, 106, 76, 0.055);
}

.quiz-footer-nav,
.quiz-footer-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mobile-grade-actions {
  display: none;
}

.quiz-footer-nav > *,
.quiz-footer-actions > * {
  flex: 1 1 120px;
}

.quiz-nav-button {
  min-width: 120px;
  min-height: 64px;
  padding: 12px 18px 24px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(248, 245, 240, 0.98), rgba(238, 229, 216, 0.92));
  border: 1px solid rgba(185, 170, 145, 0.34);
  color: rgba(72, 57, 38, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -6px 10px rgba(145, 121, 89, 0.08);
}

.quiz-nav-button:is(.is-key-active, :hover:not(:disabled), :active:not(:disabled)) {
  border-color: rgba(76, 135, 109, 0.42);
  color: #3e725d;
  background: linear-gradient(180deg, rgba(244, 249, 246, 0.99), rgba(228, 239, 232, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -6px 10px rgba(84, 134, 108, 0.1);
}

.quiz-footer-center {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.quiz-action-dialog-actions {
  display: grid;
  gap: 14px;
  width: min(860px, 100%);
  margin-inline: auto;
  justify-items: stretch;
  justify-content: stretch;
}

.quiz-action-leave-layout {
  display: grid;
  gap: 12px;
  width: 100%;
}

.quiz-action-secondary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.quiz-action-save-button,
.quiz-action-keep-button,
.quiz-action-discard-button {
  min-height: 60px;
  border-radius: 18px;
  font-weight: 700;
}

.quiz-action-save-button {
  background: linear-gradient(180deg, rgba(248, 253, 250, 0.99), rgba(232, 245, 238, 0.97));
  color: #2d7858;
  border: 1px solid rgba(79, 154, 117, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(199, 230, 214, 0.78),
    0 11px 18px rgba(87, 145, 114, 0.15),
    0 2px 5px rgba(87, 145, 114, 0.08);
}

.quiz-action-save-button:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(241, 250, 245, 0.99), rgba(221, 239, 228, 0.98));
  color: #24694d;
  border-color: rgba(36, 105, 77, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(191, 222, 205, 0.82),
    0 11px 18px rgba(70, 126, 98, 0.16),
    0 2px 5px rgba(70, 126, 98, 0.09);
}

.quiz-action-keep-button {
  background: linear-gradient(180deg, rgba(248, 245, 240, 0.98), rgba(238, 229, 216, 0.92));
  color: rgba(72, 57, 38, 0.9);
  border: 1px solid rgba(185, 170, 145, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -6px 10px rgba(145, 121, 89, 0.08);
}

.quiz-action-keep-button:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(244, 249, 246, 0.99), rgba(228, 239, 232, 0.95));
  color: #3e725d;
  border-color: rgba(76, 135, 109, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -6px 10px rgba(84, 134, 108, 0.1);
}

.quiz-action-discard-button {
  background: linear-gradient(180deg, rgba(255, 251, 250, 0.99), rgba(245, 234, 231, 0.95));
  color: #98574f;
  border: 1px solid rgba(180, 110, 101, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -4px 8px rgba(187, 130, 122, 0.09),
    0 4px 8px rgba(173, 91, 82, 0.07);
}

.quiz-action-discard-button:not(:disabled):is(:hover, :active) {
  background: linear-gradient(180deg, rgba(255, 246, 244, 0.99), rgba(241, 225, 221, 0.97));
  color: #8a443d;
  border-color: rgba(138, 68, 61, 0.54);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -4px 8px rgba(170, 106, 98, 0.12),
    0 4px 8px rgba(144, 71, 64, 0.08);
}

.diagnostic-history-list {
  margin-top: 10px;
}

.diagnostic-history-card {
  gap: 0;
}

.quiz-empty {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
}

@media (max-width: 920px) {
  .hero-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero {
    padding: 24px;
    border-radius: 28px;
  }

  .dashboard-hero::before {
    display: none;
  }

  .dashboard-hero h1 {
    max-width: 12ch;
    font-size: clamp(2.35rem, 10vw, 3.3rem);
  }

  .dashboard-stat-card {
    min-height: 0;
    border-radius: 24px;
  }

  .dashboard-sidebar .dashboard-panel,
  .dashboard-topic-card {
    border-radius: 24px;
  }

  .dashboard-sidebar .dashboard-mini-card,
  .dashboard-topic-card .subtopic-row {
    border-radius: 18px;
  }

  .dashboard-topic-card .topic-summary-panel {
    margin: -18px -18px 0;
    padding: 20px 18px 18px;
    border-radius: 24px 24px 20px 20px;
  }

  .hero-primary-actions,
  .hero-utility-actions {
    gap: 10px;
  }

  .topic-card {
    padding: 18px;
  }

  .topic-modal-backdrop {
    padding: 12px;
  }

  .topic-modal-shell {
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 24px;
  }

  .test-mix-row {
    grid-template-columns: 1fr;
  }

  .test-mix-input-wrap {
    flex-wrap: wrap;
  }

  .subtopic-toggle {
    display: inline-flex;
  }

  .subtopic-list.mobile-collapsed .subtopic-row:nth-child(n + 3) {
    display: none;
  }

  .toolbar {
    gap: 10px;
  }

  .result-button {
    width: 100%;
  }

  .quiz-shell {
    height: auto;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .quiz-header,
  .quiz-footer {
    border-radius: 20px;
    padding: 16px;
  }

  .quiz-header,
  .quiz-layout,
  .quiz-footer-layout {
    grid-template-columns: 1fr;
  }

  .quiz-header-actions,
  .quiz-header-statuses {
    width: 100%;
    justify-content: space-between;
  }

  .quiz-header-statuses {
    justify-content: flex-end;
  }

  .quiz-header-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .quiz-header-buttons > * {
    flex: 1 1 180px;
  }

  .quiz-card-top {
    padding-right: 78px;
  }

  .quiz-action-secondary-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .quiz-layout {
    display: grid;
    gap: 12px;
  }

  .quiz-sidebar-card {
    height: auto;
  }

  .question-chip-grid {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    max-height: 190px;
  }

  .quiz-card {
    min-height: 70vh;
    padding: 16px;
  }

  .quiz-card-body {
    grid-template-rows: minmax(0, 1fr) minmax(140px, 210px);
  }

  .quiz-footer-layout {
    justify-items: stretch;
  }

  .quiz-footer-sidebar,
  .quiz-footer-stage {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .quiz-footer-stage {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    border-color: rgba(15, 118, 110, 0.24);
    background:
      linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 241, 231, 0.96)),
      var(--panel);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 16px 30px rgba(71, 48, 18, 0.16);
  }

  .quiz-footer-nav,
  .quiz-footer-actions {
    justify-content: stretch;
  }

  .mobile-grade-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 4px;
  }

  .quiz-footer-stage .quiz-footer-actions {
    display: none;
  }

  .quiz-footer-nav > *,
  .quiz-footer-actions > *,
  .mobile-grade-actions > * {
    flex: 1 1 160px;
    min-width: 0;
  }

  .quiz-footer-center {
    order: -1;
  }

  .quiz-submit-stats {
    grid-template-columns: 1fr;
  }

  .quiz-submit-actions > * {
    flex: 1 1 220px;
  }
}
