:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #e9efec;
  --surface-raised: #ffffff;
  --ink: #183036;
  --ink-soft: #587076;
  --line: #d6e0dc;
  --brand-950: #0b2c36;
  --brand-900: #123c4a;
  --brand-800: #175465;
  --brand-700: #1d6c77;
  --brand-600: #27868a;
  --brand-100: #d9efeb;
  --gold-700: #9b6a13;
  --gold-500: #d2a23c;
  --gold-100: #f8edcf;
  --success: #287653;
  --success-soft: #def2e7;
  --warning: #9a6110;
  --warning-soft: #fff0cc;
  --danger: #a8443e;
  --danger-soft: #f9e1df;
  --info: #2d6795;
  --info-soft: #e0edf8;
  --shadow-sm: 0 1px 2px rgb(10 35 42 / 7%), 0 5px 18px rgb(10 35 42 / 4%);
  --shadow-lg: 0 20px 60px rgb(9 31 38 / 14%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 276px;
  --topbar-height: 76px;
  --content-max: 1460px;
}

html[data-theme="dark"] {
  --bg: #0c1b20;
  --surface: #12272e;
  --surface-soft: #19343a;
  --surface-raised: #173038;
  --ink: #eef6f4;
  --ink-soft: #a9bfbc;
  --line: #29464c;
  --brand-950: #07181e;
  --brand-900: #0c303b;
  --brand-800: #14505d;
  --brand-700: #37a0a3;
  --brand-600: #64b9b6;
  --brand-100: #183f43;
  --gold-700: #efc56e;
  --gold-500: #d4a94f;
  --gold-100: #493c20;
  --success: #62c493;
  --success-soft: #173f31;
  --warning: #efbb62;
  --warning-soft: #49391c;
  --danger: #ef8a82;
  --danger-soft: #4a2929;
  --info: #7db5de;
  --info-soft: #19384e;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%), 0 5px 18px rgb(0 0 0 / 12%);
  --shadow-lg: 0 20px 60px rgb(0 0 0 / 32%);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-700); }
img { max-width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold-500) 75%, white);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: white;
  background: var(--brand-950);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: none; }

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-y: auto;
  color: #edf7f5;
  background:
    radial-gradient(circle at 18% 0%, rgb(71 158 154 / 22%), transparent 33%),
    linear-gradient(178deg, var(--brand-900), var(--brand-950));
  border-right: 1px solid rgb(255 255 255 / 8%);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #143842;
  background: linear-gradient(145deg, #f2d894, #c79a3a);
  border-radius: 14px 4px 14px 4px;
  box-shadow: inset 0 1px rgb(255 255 255 / 45%), 0 7px 18px rgb(0 0 0 / 18%);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .06em;
}

.brand-copy { min-width: 0; display: grid; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; }
.brand-copy small { color: #b8d2cf; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

.primary-nav { display: grid; gap: 5px; }
.primary-nav a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 13px;
  color: #c8dcda;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.primary-nav a span { color: #8fb7b3; text-align: center; font-size: 17px; }
.primary-nav a:hover { color: white; background: rgb(255 255 255 / 7%); transform: translateX(2px); }
.primary-nav a[aria-current="page"] {
  color: white;
  background: linear-gradient(90deg, rgb(67 153 149 / 34%), rgb(255 255 255 / 8%));
  border-color: rgb(255 255 255 / 9%);
  box-shadow: inset 3px 0 var(--gold-500);
}
.primary-nav a[aria-current="page"] span { color: #e9c46d; }

.sidebar-purpose {
  margin-top: auto;
  padding: 18px 14px;
  color: #d0e2df;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: var(--radius);
}
.sidebar-purpose p { margin: 7px 0 0; font-family: var(--font-serif); font-size: 13px; line-height: 1.5; }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 6px 0;
  color: #9cb8b5;
  font-size: 11px;
}

.eyebrow {
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  line-height: 1.3;
  text-transform: uppercase;
}
.sidebar .eyebrow { color: #e5bd64; }

.app-column { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(20px, 3.2vw, 48px);
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(clamp(20px, 3.2vw, 48px), env(safe-area-inset-right));
  padding-left: max(clamp(20px, 3.2vw, 48px), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-context { min-width: 0; display: grid; }
.topbar-context strong { overflow: hidden; font-size: 18px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-button { display: none; }

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.connection-pill i { width: 8px; height: 8px; background: var(--warning); border-radius: 50%; box-shadow: 0 0 0 4px var(--warning-soft); }
.connection-pill.is-online i { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.connection-pill.is-offline i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.main-view {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px) clamp(18px, 4vw, 56px) 70px;
  padding-right: max(clamp(18px, 4vw, 56px), env(safe-area-inset-right));
  padding-bottom: max(70px, calc(36px + env(safe-area-inset-bottom)));
  padding-left: max(clamp(18px, 4vw, 56px), env(safe-area-inset-left));
  flex: 1;
}

.site-footer {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  padding-right: max(clamp(20px, 4vw, 56px), env(safe-area-inset-right));
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  padding-left: max(clamp(20px, 4vw, 56px), env(safe-area-inset-left));
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.site-footer p { max-width: 780px; margin: 0; }

.icon-button, .menu-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 10px;
  cursor: pointer;
}
.menu-button { display: none; }
.icon-button:hover, .menu-button:hover { background: rgb(255 255 255 / 8%); }

.button {
  min-height: 44px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 1px rgb(10 35 42 / 3%);
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button:active { transform: none; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.button-primary { color: white; background: var(--brand-800); border-color: var(--brand-800); }
.button-primary:hover { background: var(--brand-700); }
.button-gold { color: #1c3338; background: linear-gradient(135deg, #f0d48d, #d2a23c); border-color: #d2a23c; }
.button-danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.button-small { min-height: 36px; padding: 8px 13px; font-size: 13px; }
.button-wide { width: 100%; }
.text-button { padding: 3px 0; color: var(--brand-700); background: none; border: 0; cursor: pointer; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.16; letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 4vw, 54px); }
h2 { font-size: clamp(24px, 2.7vw, 34px); }
h3 { font-size: 19px; }
p { text-wrap: pretty; }

.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin-top: 7px; font-size: clamp(30px, 3.3vw, 44px); }
.page-heading p { max-width: 760px; margin: 12px 0 0; color: var(--ink-soft); font-size: 17px; }
.page-heading-row { display: flex; gap: 20px; align-items: end; justify-content: space-between; }
.exam-title-compact { display: none; }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: 360px;
  padding: clamp(32px, 5vw, 64px);
  overflow: hidden;
  color: #f5fbfa;
  background:
    radial-gradient(circle at 85% 18%, rgb(90 177 169 / 28%), transparent 31%),
    linear-gradient(140deg, var(--brand-950), var(--brand-800));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 240px;
  height: 240px;
  border: 1px solid rgb(255 255 255 / 9%);
  transform: rotate(45deg);
}
.hero::before { right: -115px; bottom: -120px; }
.hero::after { right: -25px; bottom: -165px; }
.hero h1 { max-width: 720px; color: white; }
.hero h1 em { color: #edcb77; font-family: var(--font-serif); font-weight: 500; }
.hero p { max-width: 680px; margin: 18px 0 0; color: #c7ddda; font-size: 17px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .button:not(.button-gold) { color: white; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 20%); }

.hero-progress {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 24px;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50% 50% 18px 18px;
  backdrop-filter: blur(8px);
}
.progress-ring {
  --value: 0;
  width: 152px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: conic-gradient(#edc66d calc(var(--value) * 1%), rgb(255 255 255 / 12%) 0);
  border-radius: 50%;
}
.progress-ring::before { content: ""; grid-area: 1/1; width: 118px; aspect-ratio: 1; background: #174a56; border-radius: 50%; }
.progress-ring strong, .progress-ring small { z-index: 1; grid-area: 1/1; }
.progress-ring strong { margin-top: -15px; color: white; font-size: 31px; }
.progress-ring small { margin-top: 37px; color: #c5dcda; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.hero-progress > p { margin: 14px 0 0; color: #d5e5e2; font-size: 13px; text-align: center; }

.section-block { margin-top: 34px; }
.section-header { display: flex; gap: 18px; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-header p { margin: 5px 0 0; color: var(--ink-soft); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.metric-card { min-height: 132px; display: grid; align-content: space-between; padding: 20px; }
.metric-card .metric-label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin-top: 7px; font-size: 29px; letter-spacing: -.04em; }
.metric-card small { color: var(--ink-soft); font-size: 11px; }
.metric-accent { border-top: 3px solid var(--brand-600); }
.metric-gold { border-top: 3px solid var(--gold-500); }
.metric-success { border-top: 3px solid var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.card { padding: 24px; }
.card-header { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.card-header p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }

.chapter-mini-list { display: grid; gap: 10px; }
.chapter-mini {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 11px;
  color: inherit;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
}
.chapter-mini:hover { border-color: var(--brand-600); }
.chapter-number { width: 42px; aspect-ratio: 1; display: grid; place-items: center; color: var(--brand-700); background: var(--brand-100); border-radius: 10px; font-size: 12px; font-weight: 900; }
.chapter-mini strong { display: block; font-size: 13px; }
.chapter-mini small { color: var(--ink-soft); font-size: 11px; }

.progress-bar { width: 100%; height: 7px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.progress-bar > span { display: block; width: var(--progress, 0%); height: 100%; background: linear-gradient(90deg, var(--brand-700), var(--brand-600)); border-radius: inherit; }
.progress-bar.gold > span { background: linear-gradient(90deg, var(--gold-700), var(--gold-500)); }

.recommendation-card {
  position: relative;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, var(--brand-800), var(--brand-950));
  border-color: transparent;
}
.recommendation-card h3 { color: white; }
.recommendation-card p { color: #c8deda; }
.recommendation-card::after { content: ""; position: absolute; right: -60px; bottom: -70px; width: 180px; aspect-ratio: 1; border: 24px solid rgb(255 255 255 / 5%); border-radius: 50%; }

.badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 8px;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-info { color: var(--info); background: var(--info-soft); }
html[data-theme="dark"] .badge,
html[data-theme="dark"] .status-badge { color: #93d8d4; }
html[data-theme="dark"] .badge-success { color: #8ee0b5; }
html[data-theme="dark"] .badge-warning { color: #ffd185; }
html[data-theme="dark"] .badge-danger { color: #ffaaa3; }
html[data-theme="dark"] .badge-info { color: #9dcef1; }

/* Guide */
.guide-shell { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; align-items: start; }
.guide-index { position: sticky; top: calc(var(--topbar-height) + 20px); max-height: calc(100vh - var(--topbar-height) - 40px); max-height: calc(100dvh - var(--topbar-height) - 40px); padding: 18px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.guide-index-details > summary { display: none; cursor: pointer; font-weight: 800; }
@media (min-width: 1281px) {
  .guide-index-details:not([open]) > :not(summary) { display: block; }
}
.search-field { position: relative; }
.search-field input { width: 100%; min-height: 42px; padding: 9px 12px 9px 38px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.search-field::before { content: "⌕"; position: absolute; left: 13px; top: 8px; color: var(--ink-soft); font-size: 20px; }
.guide-index-list { display: grid; gap: 5px; margin-top: 14px; }
.guide-index-list button {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 11px;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 9px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}
.guide-index-list button:hover, .guide-index-list button.is-active { background: var(--surface-soft); border-color: var(--line); }
.guide-index-list button.is-active { box-shadow: inset 3px 0 var(--gold-500); }
.guide-index-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; aspect-ratio: 1; background: var(--line); border-radius: 50%; }
.status-dot.in-progress { background: var(--gold-500); }
.status-dot.completed { background: var(--success); }

.reader { min-width: 0; }
.reader-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.reader-toolbar-secondary { display: contents; }
.reader-card { padding: clamp(24px, 4vw, 58px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.reader-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.reader-header h1 { max-width: 850px; margin-top: 8px; font-family: var(--font-serif); font-size: clamp(32px, 4vw, 50px); font-weight: 500; }
.reader-meta { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 17px; }
.reader-section { max-width: 820px; margin: 42px auto 0; scroll-margin-top: 110px; }
.reader-section h2 { margin-bottom: 22px; font-family: var(--font-serif); font-weight: 500; }
.reader-subsection { scroll-margin-top: 110px; }
.reader-subsection + .reader-subsection { margin-top: 42px; padding-top: 34px; border-top: 1px solid var(--line); }
.content-block { margin: 18px 0; color: var(--ink); font-size: 17px; line-height: 1.78; }
.content-block p { margin: 0 0 1em; white-space: pre-line; }
.content-block ul, .content-block ol { padding-left: 1.4em; }
.content-block.callout, .content-block.normative, .content-block.warning, .content-block.summary {
  padding: 20px 22px;
  background: var(--brand-100);
  border-left: 4px solid var(--brand-600);
  border-radius: 4px var(--radius) var(--radius) 4px;
  font-size: 15px;
}
.content-block.normative { background: var(--gold-100); border-left-color: var(--gold-500); }
.content-block.warning { background: var(--warning-soft); border-left-color: var(--warning); }
.content-block.summary { background: var(--surface-soft); border-left-color: var(--success); }
.source-chip { display: inline-flex; margin-top: 8px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.reader-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; padding-top: 32px; margin-top: 44px; border-top: 1px solid var(--line); }
.reader-footer .button:last-child { justify-self: end; }
.reader-status { text-align: center; }

.search-results { display: grid; gap: 12px; }
.search-result { padding: 17px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.search-result:hover { border-color: var(--brand-600); box-shadow: var(--shadow-sm); }
.search-result p { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; }
mark { padding: 0 2px; color: inherit; background: var(--gold-100); }

.guide-search-navigation {
  position: sticky;
  z-index: 8;
  top: calc(var(--topbar-height) + 10px);
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 820px;
  min-width: 0;
  padding: 10px 12px;
  margin: 0 auto 18px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 94%, var(--gold-100));
  border: 1px solid color-mix(in srgb, var(--gold-500) 45%, var(--line));
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.guide-search-status {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.guide-search-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.guide-search-actions > button,
.guide-search-actions > a {
  min-width: 44px;
  min-height: 44px;
}
.guide-search-hit {
  padding: 0 .12em;
  color: #17272b;
  background: #ffe28a;
  border-radius: 3px;
  scroll-margin-top: calc(var(--topbar-height) + 84px);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.guide-search-hit.is-active {
  color: #152328;
  background: #ffd04f;
  outline: 3px solid var(--gold-700);
  outline-offset: 2px;
}
html[data-theme="dark"] .guide-search-hit {
  color: #142328;
  background: #f2c45f;
}
html[data-theme="dark"] .guide-search-hit.is-active {
  color: #0c1b20;
  background: #ffd873;
  outline-color: #fff0bd;
}

/* Forms and setup */
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field label, .field-label { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea, .select-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field select { cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.choice-tile { position: relative; }
.choice-tile input { position: absolute; opacity: 0; pointer-events: none; }
.choice-tile label {
  min-height: 78px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
}
.choice-tile label strong { display: block; color: var(--ink); font-size: 21px; }
.choice-tile label small { font-size: 10px; }
.choice-tile input:checked + label { color: var(--brand-700); background: var(--brand-100); border-color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-600); }
.choice-tile input:focus-visible + label { outline: 3px solid var(--gold-500); outline-offset: 3px; }

.setup-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(340px, 1.2fr); gap: 22px; }
.exam-promise { position: relative; padding: 34px; overflow: hidden; color: white; background: linear-gradient(155deg, var(--brand-900), var(--brand-700)); border-radius: var(--radius-lg); }
.exam-promise h2 { color: white; font-family: var(--font-serif); font-weight: 500; }
.exam-promise p { color: #d1e4e1; }
.exam-promise ul { display: grid; gap: 13px; padding: 0; margin: 25px 0 0; list-style: none; }
.exam-promise li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 13px; }
.exam-promise li::before { content: "✓"; color: #edcb77; font-weight: 900; }
.setup-card { padding: clamp(24px, 4vw, 38px); }
.notice { padding: 14px 16px; color: var(--ink-soft); background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 24%, transparent); border-radius: 10px; font-size: 12px; }
.notice.warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }

/* Study and questions */
.study-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.filter-panel { position: sticky; top: calc(var(--topbar-height) + 18px); display: grid; gap: 15px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-actions { display: flex; gap: 8px; }
.question-stage { min-width: 0; }
.question-card { padding: clamp(24px, 4vw, 42px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.question-topline { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.question-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.question-tools { display: flex; gap: 7px; }
.question-tools button.is-active { color: var(--gold-700); background: var(--gold-100); border-color: var(--gold-500); }
.question-stem { font-family: var(--font-serif); font-size: clamp(21px, 2.4vw, 28px); line-height: 1.48; white-space: pre-line; }
.option-list { display: grid; gap: 11px; padding: 0; margin: 26px 0 0; border: 0; }
.option-list legend { margin-bottom: 12px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.option-row { position: relative; }
.option-row input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; opacity: 0; }
.option-row label {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  white-space: pre-line;
  transition: border .15s ease, background .15s ease, transform .15s ease;
}
.option-row label:hover { border-color: var(--brand-600); transform: translateX(2px); }
.option-letter { width: 31px; height: 31px; display: grid; place-items: center; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 900; }
.option-row input:checked + label { background: var(--brand-100); border-color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-600); }
.option-row input:checked + label .option-letter { color: white; background: var(--brand-700); border-color: var(--brand-700); }
.option-row input:focus-visible + label { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.option-row.is-correct label { background: var(--success-soft); border-color: var(--success); }
.option-row.is-incorrect label { background: var(--danger-soft); border-color: var(--danger); }
.option-row.is-correct .option-letter { color: white; background: var(--success); border-color: var(--success); }
.option-row.is-incorrect .option-letter { color: white; background: var(--danger); border-color: var(--danger); }
.question-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 24px; }
.question-actions-group { display: flex; gap: 9px; }
.feedback-panel { margin-top: 22px; padding: 22px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.feedback-panel.correct { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.feedback-panel.incorrect { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.feedback-panel h3 { display: flex; gap: 8px; align-items: center; }
.feedback-panel p { margin: 10px 0 0; white-space: pre-line; }
.reference-note { margin-top: 14px; padding-top: 13px; color: var(--ink-soft); border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 11px; }

/* Exam */
.exam-shell { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.exam-main { min-width: 0; }
.exam-header-card { display: flex; gap: 14px; align-items: center; padding: 13px 17px; margin-bottom: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.exam-progress { flex: 1; }
.exam-progress-line { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; font-weight: 750; }
.timer { min-width: 112px; display: grid; text-align: right; }
.timer strong { font-variant-numeric: tabular-nums; font-size: 21px; letter-spacing: .02em; }
.timer small { color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.timer.is-warning strong { color: var(--warning); }
.timer.is-critical strong { color: var(--danger); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.exam-sidebar { position: sticky; top: calc(var(--topbar-height) + 18px); padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.exam-sidebar h3 { font-size: 14px; }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; }
.question-jump { height: 38px; display: grid; place-items: center; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 850; }
.question-jump:hover, .question-jump.is-current { border-color: var(--brand-600); }
.question-jump.is-current { color: white; background: var(--brand-700); }
.question-jump.is-answered:not(.is-current) { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.question-jump.is-marked { box-shadow: inset 0 -3px var(--gold-500); }
.question-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; color: var(--ink-soft); font-size: 10px; }
.question-legend span { display: flex; gap: 6px; align-items: center; }
.question-legend i { width: 9px; height: 9px; background: var(--line); border-radius: 3px; }
.question-legend .answered i { background: var(--success); }
.question-legend .current i { background: var(--brand-600); }
.question-legend .marked i { background: var(--gold-500); }
.mobile-question-strip { display: none; gap: 7px; padding: 9px 0 14px; overflow-x: auto; scrollbar-width: thin; }
.mobile-question-strip .question-jump { min-width: 39px; }

/* Results */
.score-hero { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; align-items: center; padding: clamp(28px, 5vw, 52px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.score-dial { --score: 0; width: 190px; aspect-ratio: 1; display: grid; place-items: center; background: conic-gradient(var(--success) calc(var(--score) * 1%), var(--surface-soft) 0); border-radius: 50%; }
.score-dial::before { content: ""; grid-area: 1/1; width: 154px; aspect-ratio: 1; background: var(--surface); border-radius: 50%; }
.score-dial strong, .score-dial span { z-index: 1; grid-area: 1/1; }
.score-dial strong { margin-top: -18px; font-size: 41px; letter-spacing: -.05em; }
.score-dial span { margin-top: 45px; color: var(--ink-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.result-summary h1 { margin-top: 7px; font-family: var(--font-serif); font-weight: 500; }
.result-summary p { color: var(--ink-soft); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.breakdown-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.performance-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(120px, 1.4fr) 54px; gap: 12px; align-items: center; margin: 13px 0; }
.performance-row label { font-size: 12px; font-weight: 750; }
.performance-row label small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.performance-row strong { font-size: 12px; text-align: right; }
.history-list { display: grid; gap: 10px; }
.history-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) repeat(3, auto); gap: 15px; align-items: center; padding: 14px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.history-score { width: 52px; aspect-ratio: 1; display: grid; place-items: center; color: var(--brand-700); background: var(--brand-100); border-radius: 12px; font-weight: 900; }
.history-item p { margin: 0; font-size: 13px; font-weight: 750; }
.history-item small { color: var(--ink-soft); }
.history-stat { color: var(--ink-soft); font-size: 11px; text-align: right; }
.trend-chart { width: 100%; height: 220px; display: block; }

/* Resources */
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.resource-card { min-height: 195px; display: flex; flex-direction: column; padding: 22px; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.resource-card:hover { border-color: var(--brand-600); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.resource-card .resource-type { width: 42px; height: 42px; display: grid; place-items: center; color: var(--brand-700); background: var(--brand-100); border-radius: 12px; font-weight: 900; }
.resource-card h3 { margin-top: 18px; }
.resource-card p { margin: 8px 0 18px; color: var(--ink-soft); font-size: 13px; }
.resource-card small { margin-top: auto; color: var(--ink-soft); font-weight: 700; }
.source-principle { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.source-principle > span { width: 44px; aspect-ratio: 1; display: grid; place-items: center; color: var(--gold-700); background: var(--gold-100); border-radius: 50%; font-weight: 900; }
.source-principle p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }

.empty-state { max-width: 620px; display: grid; place-items: center; gap: 10px; padding: 58px 24px; margin: 25px auto; color: var(--ink-soft); text-align: center; }
.empty-state .empty-mark { width: 68px; aspect-ratio: 1; display: grid; place-items: center; color: var(--brand-700); background: var(--brand-100); border-radius: 22px 7px 22px 7px; font-size: 23px; font-weight: 900; }
.empty-state h2 { margin-top: 8px; }
.empty-state p { max-width: 500px; margin: 0; }

.loading-view { min-height: 62vh; display: grid; place-items: center; align-content: center; text-align: center; }
.loading-emblem { width: 74px; aspect-ratio: 1; display: grid; place-items: center; color: white; background: var(--brand-800); border-radius: 24px 8px 24px 8px; box-shadow: var(--shadow-lg); font-weight: 900; }
.loading-view h1 { margin-top: 6px; font-size: 29px; }
.loading-line { width: 220px; height: 5px; margin-top: 25px; overflow: hidden; background: var(--line); border-radius: 99px; }
.loading-line span { display: block; width: 50%; height: 100%; background: var(--brand-600); border-radius: inherit; animation: loading 1.1s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(100%); } }

.toast-region { position: fixed; z-index: 100; right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 30px)); display: grid; gap: 9px; }
.toast { padding: 13px 15px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-left: 4px solid var(--brand-600); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .2s ease both; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.app-dialog { width: min(620px, calc(100vw - 30px)); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.app-dialog::backdrop { background: rgb(4 19 24 / 68%); backdrop-filter: blur(4px); }
.app-dialog form { padding: 30px; }
.dialog-close { position: absolute; top: 13px; right: 13px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.dialog-list { display: grid; gap: 10px; margin: 20px 0; }
.dialog-list .button { justify-content: flex-start; }

.sidebar-scrim { position: fixed; z-index: 25; inset: 0; background: rgb(5 21 26 / 55%); backdrop-filter: blur(2px); }
.noscript-message { position: fixed; z-index: 200; inset: auto 20px 20px; padding: 18px; color: white; background: var(--danger); border-radius: 10px; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-shell { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 1280px) {
  .app-shell { display: block; }
  .main-view { padding-top: 32px; }
  .sidebar { position: fixed; left: 0; transform: translateX(-103%); width: min(var(--sidebar-width), 86vw); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-button { display: inline-grid; }
  .topbar { padding-inline: 18px; }
  .hero { grid-template-columns: 1fr; }
  .hero-progress { min-height: 180px; grid-template-columns: auto 1fr; gap: 22px; border-radius: var(--radius); }
  .hero-progress > p { margin: 0; text-align: left; }
  .progress-ring { width: 126px; }
  .progress-ring::before { width: 96px; }
  .dashboard-grid, .setup-grid { grid-template-columns: 1fr; }
  .guide-shell { grid-template-columns: 1fr; }
  .guide-index { position: static; max-height: none; padding: 14px 16px; }
  .guide-index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-index-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; color: var(--brand-700); }
  .guide-index-details > summary::after { content: "+"; font-size: 20px; }
  .guide-index-details[open] > summary::after { content: "−"; }
  .guide-index-details[open] > .search-field { margin-top: 10px; }
  .guide-page-heading { align-items: center; margin-bottom: 14px; }
  .guide-page-heading .eyebrow, .guide-page-heading p { display: none; }
  .guide-page-heading h1 { margin-top: 0; font-size: 34px; }
  .reader-card { padding: clamp(28px, 3vw, 38px); }
  .reader-header { padding-bottom: 20px; }
  .reader-header h1 { font-size: clamp(34px, 3.5vw, 44px); line-height: 1.08; }
  .reader-section { margin-top: 28px; }
  .study-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel h3, .filter-actions { grid-column: 1 / -1; }
  .exam-shell { grid-template-columns: 1fr; }
  .exam-sidebar { display: none; }
  .exam-page-heading { margin-bottom: 10px; }
  .exam-page-heading .eyebrow { display: none; }
  .exam-page-heading h1 { margin-top: 0; }
  .mobile-question-strip { display: flex; }
  .mobile-question-strip { padding: 3px 0 5px; }
  .mobile-question-strip .question-jump { min-width: 44px; height: 44px; }
  .exam-header-card { padding: 7px 12px; }
  .question-card { padding: 24px; }
  .question-topline { margin-bottom: 16px; }
  .option-list { margin-top: 20px; }
  .reader-toolbar .button, .question-card .button-small, .exam-page-heading > .button,
  .topbar-actions .button-small, button.text-button { min-height: 44px; }
}

@media (max-width: 900px) {
  .reader-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
  .reader-toolbar .field { grid-column: 1 / -1; }
  .reader-toolbar .button { width: 100%; padding-inline: 10px; }
}

@media (max-width: 720px) {
  :root { --topbar-height: 66px; }
  .main-view { padding: 22px 14px 52px; }
  .topbar-context .eyebrow, .connection-pill { display: none; }
  .topbar-actions .button { min-width: 0; padding-inline: 11px; }
  .hero { min-height: 0; padding: 28px 22px; border-radius: var(--radius); }
  .hero h1 { font-size: 35px; }
  .hero p { font-size: 15px; }
  .hero-progress { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 24px; }
  .dashboard-grid, .resource-grid, .breakdown-grid { grid-template-columns: 1fr; }
  .guide-index-list { grid-template-columns: 1fr; }
  .guide-index { padding: 12px 14px; }
  .guide-search-navigation {
    top: calc(var(--topbar-height) + 6px);
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    padding: 10px;
    margin-bottom: 14px;
  }
  .guide-search-status { flex: 0 1 auto; width: 100%; }
  .guide-search-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .guide-search-actions > button,
  .guide-search-actions > a { width: 100%; min-width: 0; }
  .guide-search-actions > :only-child { grid-column: 1 / -1; }
  .reader-card { padding: 25px 20px; border-radius: var(--radius); }
  .reader-header { padding-bottom: 20px; }
  .reader-header h1 { font-size: 30px; line-height: 1.12; }
  .reader-section { margin-top: 24px; }
  .content-block { font-size: 16px; }
  .reader-footer { grid-template-columns: 1fr 1fr; }
  .reader-status { grid-column: 1 / -1; grid-row: 1; }
  .reader-footer .button:last-child { justify-self: stretch; }
  .reader-footer .button { width: 100%; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid, .filter-panel { grid-template-columns: 1fr; }
  .filter-panel > * { grid-column: 1 !important; }
  .question-card { padding: 22px 17px; border-radius: var(--radius); }
  .question-stem { font-size: 21px; }
  .option-row label { grid-template-columns: 31px minmax(0, 1fr); padding: 12px; }
  .question-actions { align-items: stretch; flex-direction: column; }
  .question-actions-group { display: grid; grid-template-columns: 1fr 1fr; }
  .page-heading-row.guide-page-heading, .page-heading-row.exam-page-heading { align-items: center; flex-direction: row; gap: 10px; margin-bottom: 14px; }
  .guide-page-heading > div, .exam-page-heading > div { min-width: 0; flex: 1; }
  .guide-page-heading .eyebrow, .guide-page-heading p, .exam-page-heading .eyebrow { display: none; }
  .guide-page-heading h1, .exam-page-heading h1 { margin: 0; font-size: 27px; }
  .guide-page-heading > .badge, .exam-page-heading > .button { flex: 0 0 auto; }
  .exam-page-heading > .button { min-height: 44px; padding-inline: 12px; }
  .exam-header-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 7px 12px; margin-bottom: 8px; }
  .timer { min-width: 90px; text-align: right; }
  .timer strong { font-size: 18px; }
  .mobile-question-strip { padding: 3px 0 5px; }
  .exam-main .question-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .exam-main #exam-autosave { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .score-hero { grid-template-columns: 1fr; text-align: center; }
  .score-dial { width: 164px; margin: 0 auto; }
  .score-dial::before { width: 132px; }
  .result-actions { justify-content: center; }
  .history-item { grid-template-columns: 50px 1fr auto; }
  .history-stat:nth-last-child(2), .history-stat:nth-last-child(3) { display: none; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .reader-toolbar { grid-template-columns: 1fr; }
  .reader-toolbar-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .reader-toolbar-secondary .button { width: 100%; min-height: 44px; padding-inline: 9px; font-size: 11px; }
  .reader-toolbar-secondary .button:only-child { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 98px; }
  .exam-title-wide { display: none; }
  .exam-title-compact { display: inline; }
  .page-heading-row { align-items: stretch; flex-direction: column; }
  .topbar-actions .button { font-size: 0; }
  .topbar-actions .button::after { content: "Seguir"; font-size: 12px; }
}

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

@media (forced-colors: active) {
  .guide-search-navigation {
    color: CanvasText;
    background: Canvas;
    border-color: CanvasText;
    box-shadow: none;
  }
  .guide-search-hit {
    color: HighlightText;
    background: Highlight;
    forced-color-adjust: none;
  }
  .guide-search-hit.is-active {
    outline: 3px solid CanvasText;
  }
}

@media print {
  .sidebar, .topbar, .site-footer, .reader-toolbar, .reader-footer, .question-tools, .question-actions, .exam-sidebar, .mobile-question-strip, .toast-region, .no-print { display: none !important; }
  .app-shell, .app-column, .main-view, .guide-shell, .study-layout, .exam-shell { display: block; }
  body, .main-view { color: #111; background: white; }
  .main-view { max-width: none; padding: 0; }
  .reader-card, .question-card, .card { box-shadow: none; border-color: #bbb; }
  .content-block { font-size: 11pt; }
}
