:root {
  --blue: #0057b8;
  --blue-dark: #003f85;
  --cyan: #00a3e0;
  --cyan-soft: #e8f8fd;
  --green: #00873e;
  --green-dark: #00652e;
  --green-soft: #e8f6ee;
  --purple: #8246af;
  --purple-soft: #f4edf9;
  --orange: #c95516;
  --orange-soft: #fff2e9;
  --red: #b42318;
  --red-soft: #fff0ee;
  --navy: #173b63;
  --ink: #17212b;
  --muted: #5c6874;
  --muted-2: #788491;
  --line: #d9e1e7;
  --line-strong: #bbc8d2;
  --background: #f3f6f8;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --shadow-sm: 0 2px 10px rgba(23, 59, 99, 0.07);
  --shadow-md: 0 14px 38px rgba(23, 59, 99, 0.12);
  --shadow-lg: 0 28px 80px rgba(23, 59, 99, 0.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 26px;
  --max-width: 1440px;
  --topbar-height: 76px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Arial, Aptos, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(0, 163, 224, 0.08), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(130, 70, 175, 0.06), transparent 26rem),
    var(--background);
  color: var(--ink);
  line-height: 1.5;
}

body.drawer-open,
body.dialog-open {
  overflow: hidden;
}

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

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(0, 163, 224, 0.55);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.12;
}

p:last-child {
  margin-bottom: 0;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

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

/* Header */
.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(180px, 300px) auto auto;
  align-items: center;
  gap: 22px;
  min-height: var(--topbar-height);
  padding: 10px clamp(18px, 3vw, 44px);
  border-bottom: 1px solid rgba(187, 200, 210, 0.75);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 22px rgba(23, 59, 99, 0.06);
  backdrop-filter: blur(16px);
}

.topbar::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 118px;
  height: 4px;
  background: var(--cyan);
  content: "";
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
}

.brand-mark img {
  width: 27px;
  height: 33px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.brand-kicker {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  overflow: hidden;
  color: var(--navy);
  font-size: 0.98rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-progress {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #e7edf1;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width 260ms ease;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
}

.nav-links button {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-links button:hover,
.nav-links button.active {
  background: white;
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.present-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.icon-button:hover,
.present-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.present-button {
  gap: 8px;
  padding: 0 14px;
  border-color: var(--blue);
  color: var(--blue);
}

.present-button[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}

#caseMenuButton {
  display: none;
}

/* Shared page primitives */
#app-view {
  min-height: calc(100vh - var(--topbar-height));
}

.page-shell {
  width: min(var(--max-width), calc(100% - clamp(28px, 6vw, 88px)));
  margin: 0 auto;
  padding: clamp(28px, 4vw, 64px) 0 80px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 24px rgba(0, 87, 184, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  box-shadow: 0 14px 28px rgba(0, 87, 184, 0.26);
}

.button.secondary {
  border-color: var(--line-strong);
  background: white;
  color: var(--navy);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.button.ghost {
  background: transparent;
  color: var(--blue);
}

.button.danger {
  border-color: #f3b8b1;
  background: var(--red-soft);
  color: var(--red);
}

.button.wide {
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.chip.blue {
  border-color: #acd9f0;
  background: var(--cyan-soft);
  color: var(--blue-dark);
}

.chip.green {
  border-color: #b8ddc7;
  background: var(--green-soft);
  color: var(--green-dark);
}

.chip.purple {
  border-color: #d9c1ea;
  background: var(--purple-soft);
  color: var(--purple);
}

/* Home */
.home-page {
  overflow: hidden;
}

.home-page .page-shell {
  padding-top: clamp(24px, 4vw, 56px);
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(28px, 5vw, 74px);
  align-items: center;
  min-height: 560px;
  padding: clamp(34px, 5vw, 76px);
  border: 1px solid rgba(0, 87, 184, 0.14);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(246,251,254,0.98)),
    white;
  box-shadow: var(--shadow-md);
}

.hero::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 7px;
  background: var(--cyan);
  content: "";
}

.hero::after {
  position: absolute;
  right: -140px;
  bottom: -180px;
  width: 470px;
  height: 470px;
  border: 68px solid rgba(0, 163, 224, 0.06);
  border-radius: 50%;
  content: "";
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 11px;
  border: 1px solid #b8ddc7;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-badge::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
  box-shadow: 0 0 0 4px rgba(0, 135, 62, 0.1);
}

.hero h1 {
  max-width: 820px;
  margin-bottom: 16px;
  color: var(--navy);
  font-size: clamp(2.5rem, 5.5vw, 5.7rem);
  font-weight: 900;
  letter-spacing: -0.055em;
}

.hero h1 span {
  display: block;
  color: var(--blue);
}

.hero-subtitle {
  max-width: 720px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.25rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  display: grid;
  min-height: 420px;
  place-items: center;
}

.visual-orbit {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
}

.orbit-ring {
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(0, 87, 184, 0.25);
  border-radius: 50%;
}

.orbit-ring:nth-child(2) {
  inset: 28%;
  border-color: rgba(130, 70, 175, 0.24);
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid rgba(0, 87, 184, 0.12);
  border-radius: 38px;
  background: white;
  box-shadow: var(--shadow-lg);
}

.orbit-core strong {
  color: var(--navy);
  font-size: 3.1rem;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.orbit-core span {
  display: block;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orbit-icon {
  position: absolute;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow-md);
}

.orbit-icon img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.orbit-icon:nth-of-type(3) { top: 0; left: 50%; transform: translateX(-50%); }
.orbit-icon:nth-of-type(4) { top: 24%; right: 0; }
.orbit-icon:nth-of-type(5) { right: 13%; bottom: 2%; }
.orbit-icon:nth-of-type(6) { bottom: 2%; left: 13%; }
.orbit-icon:nth-of-type(7) { top: 24%; left: 0; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.stat-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
  font-size: 1.55rem;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.content-section {
  padding-top: clamp(42px, 7vw, 88px);
}

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

.section-heading h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.035em;
}

.section-heading p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.priority-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid #d8c4e8;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--purple-soft), white);
}

.priority-number {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  background: var(--purple);
  color: white;
  font-size: 1.4rem;
  font-weight: 900;
}

.priority-banner h3 {
  margin-bottom: 4px;
  color: var(--navy);
}

.priority-banner p {
  margin-bottom: 0;
  color: var(--muted);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.case-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 230px;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.case-tile::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 74px;
  height: 4px;
  background: var(--cyan);
  content: "";
}

.case-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 87, 184, 0.4);
  box-shadow: var(--shadow-md);
}

.case-tile.complete::before {
  background: var(--green);
}

.case-tile.missed::before {
  background: var(--orange);
}

.case-tile.reviewed::before {
  background: var(--blue);
}

.case-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.case-index {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-index strong {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.status-pill.correct {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-pill.missed {
  background: var(--orange-soft);
  color: var(--orange);
}

.case-tile-copy {
  display: grid;
  align-content: start;
  gap: 8px;
}

.case-tile-title {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
}

.case-tile-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.case-icon-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-icon-strip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.case-icon-strip span {
  color: var(--line-strong);
  font-weight: 900;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.workflow-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.workflow-card .step {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 12px;
  background: var(--cyan-soft);
  color: var(--blue);
  font-weight: 900;
}

.workflow-card h3 {
  margin-bottom: 8px;
  color: var(--navy);
}

.workflow-card p {
  color: var(--muted);
}

/* Case page */
.case-page {
  width: 100%;
}

.case-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  width: min(1680px, 100%);
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
}

.case-sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  overflow: auto;
  max-height: calc(100vh - var(--topbar-height));
  padding: 28px 18px 40px clamp(18px, 2.2vw, 34px);
  border-right: 1px solid var(--line);
  background: rgba(248, 250, 251, 0.86);
  backdrop-filter: blur(10px);
}

.sidebar-head {
  padding: 0 9px 16px;
}

.sidebar-head h2 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 1rem;
}

.sidebar-head p {
  color: var(--muted);
  font-size: 0.76rem;
}

.case-list {
  display: grid;
  gap: 5px;
}

.case-nav-item {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) 18px;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.case-nav-item:hover {
  background: white;
}

.case-nav-item.active {
  border-color: rgba(0, 87, 184, 0.24);
  background: white;
  box-shadow: var(--shadow-sm);
}

.case-nav-index {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: #e9eef2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.case-nav-item.active .case-nav-index {
  background: var(--blue);
  color: white;
}

.case-nav-copy {
  overflow: hidden;
}

.case-nav-copy strong,
.case-nav-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-nav-copy strong {
  color: var(--navy);
  font-size: 0.78rem;
}

.case-nav-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.case-nav-status {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #e9eef2;
  color: transparent;
  font-size: 0.7rem;
  font-weight: 900;
}

.case-nav-status.correct {
  background: var(--green);
  color: white;
}

.case-nav-status.missed {
  background: var(--orange);
  color: white;
}

.case-stage {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(30px, 4vw, 58px) 0 70px;
}

.case-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.case-heading-copy {
  min-width: 0;
}

.case-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.case-kicker .case-count {
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-heading h1 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.8rem);
  letter-spacing: -0.045em;
}

.case-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.bookmark-button,
.timer-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.bookmark-button:hover,
.bookmark-button.active,
.timer-button:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.bookmark-button.active {
  background: var(--purple-soft);
}

.timer-button {
  display: none;
}

.case-content-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
}

.case-content-card::before {
  display: block;
  width: 126px;
  height: 6px;
  background: var(--cyan);
  content: "";
}

.case-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.93fr) minmax(420px, 1.07fr);
  min-height: 490px;
}

.vignette-panel {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: clamp(26px, 3.6vw, 44px);
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, white, #fbfdfe);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-label::before {
  width: 20px;
  height: 3px;
  border-radius: 99px;
  background: var(--cyan);
  content: "";
}

.vignette-copy {
  display: grid;
  gap: 12px;
}

.vignette-copy p {
  margin-bottom: 0;
  color: #28333d;
  font-size: clamp(0.98rem, 1.3vw, 1.13rem);
  line-height: 1.58;
}

.visual-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid #dfe8ee;
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.visual-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.visual-item {
  display: grid;
  min-width: 0;
  gap: 7px;
  justify-items: center;
  text-align: center;
}

.visual-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.visual-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.visual-arrow {
  color: var(--line-strong);
  font-size: 1.25rem;
  font-weight: 900;
}

.question-panel {
  display: grid;
  align-content: start;
  padding: clamp(26px, 3.6vw, 44px);
  background: white;
}

.prompt-stack {
  display: grid;
  gap: 28px;
}

.prompt-block {
  display: grid;
  gap: 14px;
}

.prompt-block + .prompt-block {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.prompt-label {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt-text {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.03rem, 1.4vw, 1.25rem);
  font-weight: 800;
  line-height: 1.36;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: border-color 130ms ease, background 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.option:hover:not(:disabled) {
  transform: translateX(2px);
  border-color: rgba(0, 87, 184, 0.52);
  box-shadow: var(--shadow-sm);
}

.option:disabled {
  cursor: default;
}

.option-letter {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #edf1f4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.option-text {
  min-width: 0;
  color: #2f3943;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.option-result {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.option.selected {
  border-color: var(--blue);
  background: #f0f7ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.option.selected .option-letter {
  background: var(--blue);
  color: white;
}

.option.correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.option.correct .option-letter,
.option.correct .option-result {
  background: var(--green);
  color: white;
}

.option.incorrect {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px var(--red);
}

.option.incorrect .option-letter,
.option.incorrect .option-result {
  background: var(--red);
  color: white;
}

.option.dimmed {
  opacity: 0.58;
}

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

.keyboard-hint {
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 700;
}

kbd {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin: 0 2px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: white;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
}

.feedback-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.feedback-summary .feedback-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-weight: 900;
}

.feedback-summary.correct .feedback-icon {
  background: var(--green);
}

.feedback-summary.mixed .feedback-icon {
  background: var(--orange);
}

.feedback-summary.incorrect .feedback-icon {
  background: var(--red);
}

.feedback-summary.revealed .feedback-icon {
  background: var(--blue);
}

.answer-reveal {
  margin-top: 20px;
  border: 1px solid #b8ddc7;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
  animation: answer-in 260ms ease both;
}

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

.answer-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px clamp(24px, 3vw, 36px);
  border-bottom: 1px solid #cfe7d9;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--green-soft), white);
}

.answer-key {
  display: grid;
  min-width: 60px;
  height: 60px;
  place-items: center;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--green);
  color: white;
  font-size: 1.45rem;
  font-weight: 900;
}

.answer-hero p {
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.answer-hero h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.45rem, 2.6vw, 2.3rem);
  letter-spacing: -0.035em;
}

.answer-score {
  text-align: right;
}

.answer-score strong,
.answer-score span {
  display: block;
}

.answer-score strong {
  color: var(--green-dark);
  font-size: 1.25rem;
}

.answer-score span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.answer-body {
  padding: clamp(24px, 3.6vw, 40px);
}

.explanation-layout {
  display: block;
}

.explanation-layout.with-image {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.explanation-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.explanation-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.explanation-card h3 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 0.92rem;
}

.explanation-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.explanation-card li {
  color: #3f4a54;
  font-size: 0.87rem;
  line-height: 1.45;
}

.image-card {
  overflow: hidden;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.image-button {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #eef2f5;
  cursor: zoom-in;
}

.image-button::after {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(23, 33, 43, 0.82);
  color: white;
  content: "View larger";
  font-size: 0.65rem;
  font-weight: 800;
}

.image-button img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.image-card figcaption {
  padding: 14px 15px 16px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.image-card figcaption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 0.8rem;
}

.exam-clue {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid #a9ddec;
  border-radius: 12px;
  background: var(--cyan-soft);
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 850;
  text-transform: uppercase;
}

.exam-clue::before {
  content: "✦";
  color: var(--cyan);
  font-size: 1.05rem;
}

.integrity-note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #e1caef;
  border-radius: 12px;
  background: var(--purple-soft);
  color: #5c3775;
  font-size: 0.78rem;
  line-height: 1.5;
}

.source-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.source-details summary {
  width: fit-content;
  padding-top: 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 850;
}

.source-details ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.source-details li {
  color: var(--muted);
  font-size: 0.74rem;
}

.case-footer-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.case-footer-nav .next {
  justify-self: end;
}

.case-footer-nav .center-status {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

/* Cases overview */
.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.page-intro h1 {
  max-width: 760px;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  letter-spacing: -0.05em;
}

.page-intro p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.page-intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* Review */
.review-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
}

.filter-tabs button:hover,
.filter-tabs button.active {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--blue);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.memory-card {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 220px;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.memory-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 4px;
  background: var(--purple);
  content: "";
}

.memory-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-card h2 {
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.22rem;
}

.memory-card .takeaway {
  color: #35404a;
  font-size: 1rem;
  font-weight: 800;
}

.memory-card .exam-line {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 50px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.empty-state h2 {
  color: var(--navy);
}

/* Results */
.results-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(30px, 5vw, 70px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
}

.score-ring {
  position: relative;
  display: grid;
  width: 250px;
  height: 250px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--score-angle, 0deg), #e7edf1 0);
}

.score-ring::before {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: white;
  content: "";
}

.score-ring-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-ring-copy strong {
  display: block;
  color: var(--navy);
  font-size: 3.4rem;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.score-ring-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.results-copy h1 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: clamp(2.2rem, 4vw, 4rem);
  letter-spacing: -0.05em;
}

.results-copy > p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.result-stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}

.result-stat strong,
.result-stat span {
  display: block;
}

.result-stat strong {
  color: var(--navy);
  font-size: 1.35rem;
}

.result-stat span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-case-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.result-case {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  cursor: pointer;
  text-align: left;
}

.result-case:hover {
  border-color: var(--blue);
}

.result-case strong {
  color: var(--navy);
  font-size: 0.78rem;
}

/* Sources */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.source-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
}

.source-card.full {
  grid-column: 1 / -1;
}

.source-card h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 1.2rem;
}

.source-card p,
.source-card li {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.source-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.source-card a {
  color: var(--blue);
  font-weight: 750;
  word-break: break-word;
}

.disclaimer {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid #e8d3b2;
  border-radius: var(--radius);
  background: #fff9ef;
  color: #684916;
  font-size: 0.82rem;
}

/* Drawer */
.case-drawer {
  position: fixed;
  z-index: 1800;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.case-drawer.open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 30, 0.48);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 180ms ease;
}

.case-drawer.open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: min(420px, 92vw);
  height: 100%;
  grid-template-rows: auto 1fr auto;
  transform: translateX(105%);
  background: white;
  box-shadow: var(--shadow-lg);
  transition: transform 210ms ease;
}

.case-drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-panel > header,
.drawer-panel > footer {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.drawer-panel > header h2 {
  margin-bottom: 0;
  color: var(--navy);
}

.drawer-panel > footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  padding-bottom: calc(20px + var(--safe-bottom));
}

.drawer-cases {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
}

.drawer-case {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  text-align: left;
}

.drawer-case:hover,
.drawer-case.active {
  border-color: var(--blue);
  background: #f5faff;
}

.drawer-case .num {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-alt);
  color: var(--blue);
  font-weight: 900;
}

.drawer-case strong,
.drawer-case span {
  display: block;
}

.drawer-case strong {
  color: var(--navy);
  font-size: 0.85rem;
}

.drawer-case span {
  color: var(--muted);
  font-size: 0.7rem;
}

.drawer-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d7e0e6;
}

.drawer-status.correct { background: var(--green); }
.drawer-status.missed { background: var(--orange); }

/* Image dialog */
.image-dialog {
  width: min(1080px, calc(100% - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-lg);
}

.image-dialog::backdrop {
  background: rgba(10, 20, 30, 0.75);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: rgba(10, 20, 30, 0.72);
  color: white;
  cursor: pointer;
  font-size: 1.4rem;
}

.dialog-media {
  display: grid;
  max-height: 70vh;
  place-items: center;
  padding: 18px;
  background: #101820;
}

.dialog-media img {
  max-height: calc(70vh - 36px);
  object-fit: contain;
}

.dialog-caption {
  padding: 22px 24px 26px;
}

.dialog-caption h2 {
  margin-bottom: 8px;
  color: var(--navy);
}

.dialog-caption p {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Timer */
.timer-overlay {
  position: fixed;
  z-index: 1900;
  top: calc(var(--topbar-height) + 16px);
  right: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  min-width: 290px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.timer-ring {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--purple) var(--timer-angle, 360deg), #e7edf1 0);
  color: var(--navy);
  font-weight: 900;
}

.timer-ring::before {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  content: "";
}

.timer-ring span {
  position: relative;
  z-index: 1;
}

.timer-overlay strong,
.timer-overlay span {
  display: block;
}

.timer-overlay strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.timer-overlay span {
  color: var(--muted);
  font-size: 0.7rem;
}

.timer-overlay button {
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.timer-overlay.done .timer-ring {
  background: var(--green);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 2200;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  max-width: min(390px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  font-weight: 750;
  animation: toast-in 180ms ease both;
}

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

.noscript-card {
  width: min(680px, calc(100% - 32px));
  margin: 40px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

/* Presenter mode */
body.is-presenter {
  --topbar-height: 58px;
  background: white;
}

body.is-presenter .topbar {
  grid-template-columns: minmax(260px, 1fr) auto;
  min-height: var(--topbar-height);
  padding-block: 6px;
  background: white;
}

body.is-presenter .brand-mark,
body.is-presenter .top-progress,
body.is-presenter .nav-links,
body.is-presenter #caseMenuButton {
  display: none;
}

body.is-presenter .brand-copy {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

body.is-presenter .brand-kicker,
body.is-presenter .brand-title {
  font-size: 0.8rem;
}

body.is-presenter .top-actions {
  grid-column: 2;
}

body.is-presenter .present-button span:last-child::after {
  content: " mode";
}

body.is-presenter .case-shell {
  display: block;
}

body.is-presenter .case-sidebar {
  display: none;
}

body.is-presenter .case-stage {
  width: min(1500px, calc(100% - clamp(36px, 6vw, 100px)));
  padding-top: clamp(24px, 3vw, 42px);
}

body.is-presenter .case-heading h1 {
  font-size: clamp(2.5rem, 4.4vw, 5.2rem);
}

body.is-presenter .timer-button {
  display: inline-flex;
}

body.is-presenter .case-content-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(520px, 1.12fr);
  min-height: 56vh;
}

body.is-presenter .vignette-copy p {
  font-size: clamp(1.08rem, 1.45vw, 1.42rem);
}

body.is-presenter .prompt-text {
  font-size: clamp(1.18rem, 1.55vw, 1.52rem);
}

body.is-presenter .option {
  min-height: 58px;
}

body.is-presenter .option-text {
  font-size: clamp(0.98rem, 1.15vw, 1.18rem);
}

body.is-presenter .keyboard-hint {
  display: none;
}

body.is-presenter .answer-reveal {
  scroll-margin-top: 78px;
}

body.is-presenter .case-footer-nav {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  width: fit-content;
  min-width: min(620px, 100%);
  margin-right: auto;
  margin-left: auto;
  padding: 8px;
  border: 1px solid rgba(187, 200, 210, 0.8);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

/* Responsive */
@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) auto;
  }

  .nav-links {
    display: none;
  }

  #caseMenuButton {
    display: inline-flex;
  }

  .case-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .case-sidebar {
    padding-left: 14px;
  }

  .case-content-grid {
    grid-template-columns: minmax(0, 0.88fr) minmax(380px, 1.12fr);
  }

  .case-grid,
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-progress {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-visual {
    min-height: 350px;
  }

  .visual-orbit {
    width: min(100%, 380px);
  }

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

  .case-shell {
    display: block;
  }

  .case-sidebar {
    display: none;
  }

  .case-stage {
    width: min(100% - 32px, 940px);
  }

  .case-content-grid,
  body.is-presenter .case-content-grid {
    grid-template-columns: 1fr;
  }

  .vignette-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .visual-panel {
    margin-top: 0;
  }

  .results-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .results-actions {
    justify-content: center;
  }

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

  .source-card.full {
    grid-column: auto;
  }

  body.is-presenter .case-stage {
    width: min(100% - 28px, 940px);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 66px;
  }

  .topbar {
    gap: 10px;
    padding: 8px 14px;
  }

  .brand-mark {
    width: 28px;
    height: 35px;
  }

  .brand-mark img {
    width: 23px;
    height: 29px;
  }

  .brand-kicker {
    display: none;
  }

  .brand-title {
    max-width: 190px;
    font-size: 0.82rem;
  }

  .present-button {
    min-width: 42px;
    padding: 0 10px;
  }

  .present-button span:last-child {
    display: none;
  }

  .page-shell {
    width: min(100% - 28px, var(--max-width));
    padding-top: 24px;
  }

  .hero {
    gap: 20px;
    padding: 30px 22px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 4.1rem);
  }

  .hero-visual {
    min-height: 300px;
  }

  .visual-orbit {
    width: min(100%, 320px);
  }

  .orbit-icon {
    width: 66px;
    height: 66px;
    border-radius: 19px;
  }

  .orbit-icon img {
    width: 36px;
    height: 36px;
  }

  .orbit-core {
    width: 120px;
    height: 120px;
    border-radius: 30px;
  }

  .case-grid,
  .review-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .page-intro {
    display: grid;
    align-items: start;
  }

  .page-intro-actions {
    justify-content: start;
  }

  .priority-banner {
    grid-template-columns: auto 1fr;
  }

  .priority-banner .button {
    grid-column: 1 / -1;
  }

  .case-heading {
    display: grid;
  }

  .case-actions {
    justify-content: flex-start;
  }

  .case-heading h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .case-stage {
    width: min(100% - 24px, 720px);
    padding-top: 22px;
  }

  .case-content-card,
  .answer-reveal {
    border-radius: 18px;
  }

  .vignette-panel,
  .question-panel,
  .answer-body {
    padding: 22px 18px;
  }

  .visual-flow {
    gap: 4px;
  }

  .visual-item img {
    width: 38px;
    height: 38px;
  }

  .visual-item span {
    font-size: 0.61rem;
  }

  .option {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

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

  .keyboard-hint {
    display: none;
  }

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

  .answer-hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 20px 18px;
  }

  .answer-score {
    grid-column: 1 / -1;
    text-align: left;
  }

  .explanation-layout,
  .explanation-layout.with-image,
  .explanation-copy {
    grid-template-columns: 1fr;
  }

  .case-footer-nav {
    grid-template-columns: 1fr 1fr;
  }

  .case-footer-nav .center-status {
    display: none;
  }

  .case-footer-nav .button {
    width: 100%;
  }

  .review-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .result-stats,
  .result-case-list {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 210px;
    height: 210px;
  }

  .timer-overlay {
    top: auto;
    right: 12px;
    bottom: calc(12px + var(--safe-bottom));
    left: 12px;
    min-width: 0;
  }

  body.is-presenter .brand-copy {
    display: grid;
  }

  body.is-presenter .brand-title {
    max-width: none;
  }

  body.is-presenter .case-footer-nav {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 470px) {
  .top-actions {
    gap: 5px;
  }

  .icon-button,
  .present-button {
    min-width: 38px;
    min-height: 38px;
  }

  .brand-title {
    max-width: 150px;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    padding: 14px;
  }

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

  .visual-panel {
    padding: 13px 9px;
  }

  .visual-item span {
    display: none;
  }

  .visual-arrow {
    font-size: 1rem;
  }

  .case-footer-nav {
    gap: 8px;
  }

  .case-footer-nav .button {
    padding: 10px;
    font-size: 0.78rem;
  }
}

@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;
  }
}

@media print {
  .topbar,
  .case-sidebar,
  .case-actions,
  .quiz-actions,
  .case-footer-nav,
  .case-drawer,
  .timer-overlay,
  .toast {
    display: none !important;
  }

  body {
    background: white;
  }

  .case-stage,
  .page-shell {
    width: 100%;
    padding: 0;
  }

  .case-content-card,
  .answer-reveal,
  .source-card,
  .memory-card {
    break-inside: avoid;
    box-shadow: none;
  }
}
