:root {
  color-scheme: light;
  --navy-950: #071c2c;
  --navy-900: #0b2638;
  --navy-800: #123b52;
  --navy-700: #1c526b;
  --sea-600: #087e83;
  --sea-500: #0f9a98;
  --sea-100: #dff4f0;
  --sand-100: #f4efe3;
  --sand-50: #fbf9f3;
  --ink: #102533;
  --muted: #5d6c75;
  --line: #d8e0e2;
  --white: #ffffff;
  --success: #157347;
  --success-bg: #e7f6ed;
  --danger: #b23a34;
  --danger-bg: #fff0ed;
  --warning: #a66512;
  --shadow: 0 18px 50px rgba(7, 28, 44, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 6%, rgba(15, 154, 152, 0.11), transparent 23rem),
    linear-gradient(180deg, var(--sand-50) 0, #fff 38rem);
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: var(--sea-600); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(15, 154, 152, 0.35);
  outline-offset: 3px;
}

.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 76px;
  padding: 0 5vw;
  color: var(--white);
  background: rgba(7, 28, 44, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.015em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--sea-100);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.16rem; }
.brand small { margin-top: 0.12rem; color: #acc4ce; font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 0.2rem; }
.main-nav { scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav button {
  border: 0;
  padding: 0.65rem 0.8rem;
  color: #c7d8df;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}
.main-nav button:hover, .main-nav button.active { color: #fff; background: rgba(255, 255, 255, 0.09); }

main { width: min(1180px, 90vw); min-height: calc(100vh - 150px); margin: 0 auto; padding: 4.5rem 0 6rem; }
main:focus { outline: none; }
.view { animation: view-in 240ms ease both; }

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

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--navy-950); letter-spacing: -0.025em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.9rem); line-height: 0.98; }
h2 { font-size: clamp(1.6rem, 3vw, 2.45rem); line-height: 1.08; }

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--sea-600);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.hero-copy { padding: 2.5rem 0; }
.hero-copy h1 { max-width: 760px; margin-bottom: 1.5rem; }
.hero-lede { max-width: 650px; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.25rem); line-height: 1.65; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 1.7rem; margin-top: 2.2rem; }
.hero-stats span { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; }
.hero-stats strong { display: block; margin-bottom: 0.12rem; color: var(--navy-900); font-family: Georgia, serif; font-size: 1.65rem; letter-spacing: -0.02em; }

.exam-builder, .result-panel, .navigator-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(18, 59, 82, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.exam-builder { padding: clamp(1.4rem, 4vw, 2rem); }
.panel-heading h2 { margin-bottom: 1.25rem; }

.segmented-control { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 1.25rem; padding: 4px; border: 0; border-radius: 12px; background: #edf2f2; }
.segmented-control legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span { display: block; padding: 0.72rem; border-radius: 9px; color: var(--muted); text-align: center; font-weight: 700; }
.segmented-control input:checked + span { color: var(--navy-900); background: #fff; box-shadow: 0 3px 10px rgba(7, 28, 44, 0.09); }

.field-label { display: block; margin-bottom: 0.5rem; font-size: 0.82rem; font-weight: 750; }
select, .search-box input { width: 100%; border: 1px solid var(--line); color: var(--ink); background: #fff; }
select { height: 48px; padding: 0 0.8rem; border-radius: 10px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0; cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 0.9rem; }
.toggle-row small { margin-top: 0.2rem; color: var(--muted); font-size: 0.77rem; line-height: 1.35; }
.toggle-row input { position: relative; width: 44px; height: 24px; flex: 0 0 auto; appearance: none; border-radius: 20px; background: #c8d2d5; cursor: pointer; transition: 180ms ease; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22); transition: 180ms ease; }
.toggle-row input:checked { background: var(--sea-600); }
.toggle-row input:checked::after { transform: translateX(20px); }

.button { min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 0.7rem 1.05rem; cursor: pointer; font-weight: 750; transition: transform 150ms ease, background 150ms ease, border 150ms ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.46; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--navy-900); }
.button-primary:hover:not(:disabled) { background: var(--navy-800); }
.button-secondary { color: var(--navy-900); background: #edf3f3; border-color: #d8e3e3; }
.button-ghost { color: var(--navy-800); background: transparent; border-color: var(--line); }
.button-block { width: 100%; margin-top: 0.65rem; }
.panel-hint { min-height: 1.1rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.75rem; text-align: center; }

.compact-heading { margin-top: 5.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 2.3rem; }
.section-heading h1, .section-heading h2 { margin-bottom: 0.6rem; }
.section-heading h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); }
.section-heading p:last-child { max-width: 680px; color: var(--muted); line-height: 1.6; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.quick-grid-four { grid-template-columns: repeat(4, 1fr); }
.quick-card { min-height: 180px; padding: 1.45rem; border: 1px solid var(--line); border-radius: var(--radius-md); color: inherit; background: rgba(255, 255, 255, 0.7); text-align: left; cursor: pointer; transition: 180ms ease; }
.quick-card:hover { border-color: var(--sea-500); transform: translateY(-3px); box-shadow: 0 14px 35px rgba(7, 28, 44, 0.08); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { margin: 1.6rem 0 0.35rem; font-family: Georgia, serif; font-size: 1.3rem; }
.quick-card small { color: var(--muted); line-height: 1.5; }
.quick-icon { color: var(--sea-600); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }

.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.topic-card { position: relative; display: flex; min-height: 245px; flex-direction: column; padding: 1.35rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.topic-card::after { content: ""; position: absolute; right: -30px; bottom: -55px; width: 130px; height: 130px; border: 22px solid var(--sea-100); border-radius: 50%; opacity: 0.7; }
.topic-number { color: var(--sea-600); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
.topic-card h2 { margin: 1.35rem 0 0.65rem; font-size: 1.42rem; }
.topic-card p { color: var(--muted); font-size: 0.87rem; line-height: 1.5; }
.topic-card footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 0; border: 0; }
.topic-card footer span { font-size: 0.78rem; font-weight: 700; }
.topic-card footer button { border: 0; color: var(--sea-600); background: transparent; cursor: pointer; font-weight: 800; }

.search-box { display: flex; align-items: center; gap: 0.7rem; max-width: 760px; padding: 0 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 25px rgba(7, 28, 44, 0.05); }
.search-box span { color: var(--sea-600); font-size: 1.6rem; }
.search-box input { height: 58px; border: 0; outline: 0; font-size: 1rem; }
.result-summary { min-height: 1.5rem; margin: 1.2rem 0; color: var(--muted); font-size: 0.85rem; }
.search-results { display: grid; gap: 0.8rem; }
.search-card { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.search-card h2 { margin-bottom: 0.45rem; font-family: inherit; font-size: 1.02rem; line-height: 1.45; letter-spacing: 0; }
.search-card p { margin: 0; color: var(--muted); font-size: 0.78rem; }

.materials-list { display: grid; gap: 0.9rem; }
.material-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 1.1rem; align-items: center; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.material-index { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--navy-900); background: var(--sea-100); font-family: Georgia, serif; }
.material-card h2 { margin: 0 0 0.35rem; font-family: inherit; font-size: 1.04rem; letter-spacing: 0; }
.material-card p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.source-meta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.material-link { display: inline-block; margin-top: 0.35rem; font-size: 0.78rem; font-weight: 750; }

.progress-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.summary-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.summary-card strong { display: block; margin-bottom: 0.25rem; font-family: Georgia, serif; font-size: 2rem; }
.summary-card span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.category-history { display: grid; gap: 0.75rem; margin-bottom: 2rem; }
.history-list { display: grid; gap: 0.6rem; }
.history-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.history-row time, .history-row span { color: var(--muted); }
.empty-state { padding: 3rem; border: 1px dashed #bdcace; border-radius: var(--radius-md); color: var(--muted); text-align: center; }

.exam-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.exam-topbar p { display: inline; margin: 0 0 0 0.65rem; color: var(--muted); font-size: 0.86rem; }
.mode-badge, .question-meta span { display: inline-flex; align-items: center; min-height: 26px; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.mode-badge { color: #fff; background: var(--sea-600); }
.progress-track { height: 5px; margin-bottom: 2rem; overflow: hidden; border-radius: 5px; background: #dfe7e8; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sea-500); transition: width 180ms ease; }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
.question-panel { min-height: 590px; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid rgba(18, 59, 82, 0.1); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow); }
.question-meta { display: flex; gap: 0.55rem; margin-bottom: 1.35rem; }
.question-meta span:first-child { color: var(--sea-600); background: var(--sea-100); }
.question-meta span:last-child { color: var(--navy-700); background: #edf2f4; }
.question-panel h1 { max-width: 840px; margin-bottom: 2rem; font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.25; }
.choice-list { display: grid; gap: 0.75rem; }
.choice { display: grid; grid-template-columns: 34px 1fr; gap: 0.8rem; align-items: center; width: 100%; min-height: 62px; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: 150ms ease; }
.choice:hover:not(:disabled) { border-color: var(--sea-500); background: #f7fcfb; }
.choice.selected { border-color: var(--navy-800); background: #edf4f6; }
.choice.correct { border-color: #69ad87; background: var(--success-bg); }
.choice.incorrect { border-color: #d98c84; background: var(--danger-bg); }
.choice:disabled { cursor: default; }
.choice-letter { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #c9d4d7; border-radius: 50%; font-size: 0.76rem; font-weight: 800; }
.choice.selected .choice-letter { color: #fff; border-color: var(--navy-800); background: var(--navy-800); }
.practice-feedback { margin-top: 1rem; padding: 1rem 1.1rem; border-left: 4px solid var(--success); border-radius: 0 10px 10px 0; background: var(--success-bg); line-height: 1.55; }
.practice-feedback.wrong { border-color: var(--danger); background: var(--danger-bg); }
.practice-feedback strong { display: block; margin-bottom: 0.35rem; }
.source-line { display: block; margin-top: 0.7rem; color: var(--muted); font-size: 0.78rem; }
.source-line a { font-weight: 700; }
.exam-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.navigator-panel { position: sticky; top: 98px; padding: 1.2rem; }
.navigator-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.navigator-heading span { color: var(--muted); font-size: 0.7rem; }
.question-navigator { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.42rem; }
.question-navigator button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.72rem; font-weight: 700; }
.question-navigator button.answered { color: #fff; border-color: var(--navy-700); background: var(--navy-700); }
.question-navigator button.current { color: var(--navy-950); border: 2px solid var(--sea-500); background: var(--sea-100); }
.navigator-key { display: grid; gap: 0.45rem; margin-top: 1.2rem; color: var(--muted); font-size: 0.68rem; }
.navigator-key span { display: flex; align-items: center; gap: 0.45rem; }
.navigator-key i { width: 11px; height: 11px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.navigator-key .key-current { border: 2px solid var(--sea-500); background: var(--sea-100); }
.navigator-key .key-answered { border-color: var(--navy-700); background: var(--navy-700); }

.result-hero { padding: clamp(2rem, 6vw, 4.5rem); border-radius: var(--radius-lg); color: #fff; background: linear-gradient(130deg, var(--navy-950), var(--navy-800)); text-align: center; box-shadow: var(--shadow); }
.result-hero .eyebrow { color: #8ed8cf; }
.result-hero h1 { margin-bottom: 0.8rem; color: #fff; font-size: clamp(3.4rem, 9vw, 6.6rem); }
.result-status { display: inline-block; margin: 0.6rem 0 1.3rem; padding: 0.4rem 0.85rem; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 0.8rem; font-weight: 850; letter-spacing: 0.16em; }
.result-figures { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; color: #c2d7df; font-size: 0.82rem; }
.results-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; margin-top: 1rem; }
.result-panel { padding: 1.5rem; box-shadow: none; }
.result-panel h2 { font-size: 1.55rem; }
.category-score { margin-bottom: 1rem; }
.category-score header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; padding: 0; color: var(--ink); background: transparent; border: 0; font-size: 0.82rem; }
.category-score .bar { height: 7px; overflow: hidden; border-radius: 6px; background: #e5ecec; }
.category-score .bar span { display: block; height: 100%; border-radius: inherit; background: var(--sea-500); }
.result-actions { display: grid; gap: 0.75rem; }
.review-section { margin-top: 4rem; }
.review-card { margin-bottom: 0.9rem; padding: 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.review-card h3 { margin-bottom: 1rem; font-family: Georgia, serif; line-height: 1.35; }
.review-answer { display: grid; grid-template-columns: 150px 1fr; gap: 0.7rem; margin: 0.35rem 0; font-size: 0.86rem; }
.review-answer span:first-child { color: var(--muted); }
.review-explanation { margin: 0.9rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; line-height: 1.55; }

.loading-view, .error-view { display: grid; min-height: 55vh; place-items: center; align-content: center; text-align: center; }
.loader { width: 38px; height: 38px; border: 3px solid #d5e5e5; border-top-color: var(--sea-600); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-view h1 { max-width: 720px; font-size: clamp(2rem, 5vw, 3.8rem); }
.error-view p { max-width: 680px; color: var(--muted); }
.error-view code { padding: 0.7rem 1rem; border-radius: 8px; background: #e9efef; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 5vw; color: #80929b; background: var(--navy-950); font-size: 0.74rem; }

@media (max-width: 980px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 0.65rem; padding-top: 0.8rem; padding-bottom: 0.65rem; }
  .main-nav { width: 100%; overflow-x: auto; }
  .main-nav button { white-space: nowrap; }
  .hero-grid, .exam-layout, .results-grid { grid-template-columns: 1fr; }
  .exam-builder { max-width: 640px; }
  .topic-grid, .quick-grid-four { grid-template-columns: repeat(2, 1fr); }
  .navigator-panel { position: static; order: -1; }
  .question-navigator { grid-template-columns: repeat(10, 1fr); }
}

/* Interactive navigation chart */
.chart-heading { align-items: center; }
.chart-only-page main { width: min(1440px, 96vw); padding: 1.5rem 0 4rem; }
.chart-only-page .chart-heading { margin-bottom: 1.25rem; }
.chart-only-page .chart-heading h1 { font-size: clamp(2.3rem, 5vw, 4rem); }

.plotting-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.plotting-panel { display: grid; gap: 0.9rem; }
.plotting-step {
  position: relative;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(7, 28, 44, 0.05);
}
@media (min-width: 821px) {
  .plotting-step.tool-panel-collapsed { display: none; }
}
.mobile-panel-close, .mobile-chart-actions, .mobile-panel-backdrop { display: none; }
.step-number {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  color: #a5b3b6;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.15em;
}
.step-copy .eyebrow { margin-bottom: 0.3rem; padding-right: 2.5rem; }
.step-copy h2 { margin-bottom: 1rem; font-size: 1.45rem; }
.documented-coordinate-section { margin: 1rem -0.25rem -0.25rem; padding: 0.75rem 0.25rem 0.25rem; border-top: 1px solid var(--line); }
.documented-coordinate-section summary { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.45rem 0.55rem; border: 1px solid #d9e3e1; border-radius: 9px; color: var(--navy-900); background: #f7faf8; cursor: pointer; list-style: none; }
.documented-coordinate-section summary::-webkit-details-marker { display: none; }
.documented-coordinate-section summary::after { content: "+"; display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--sea-600); font-size: 1rem; line-height: 1; }
.documented-coordinate-section[open] summary::after { content: "−"; }
.documented-coordinate-section summary span { flex: 1; font-family: Georgia, serif; font-size: 0.92rem; font-weight: 700; }
.documented-coordinate-section summary small { color: var(--muted); font-size: 0.62rem; white-space: nowrap; }
.documented-coordinate-content { padding: 0.75rem 0.25rem 0; }
.documented-coordinate-content > p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.documented-coordinate-form fieldset { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 0.35rem; align-items: end; margin: 0 0 0.65rem; padding: 0; border: 0; }
.documented-coordinate-form legend { margin-bottom: 0.35rem; color: var(--muted); font-size: 0.68rem; font-weight: 750; }
.documented-coordinate-form label span { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.62rem; }
.documented-coordinate-form input { width: 100%; height: 39px; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-950); background: #fff; font-variant-numeric: tabular-nums; }
.coord-mark { padding-bottom: 0.6rem; color: var(--navy-800); font-family: Georgia, serif; font-weight: 700; white-space: nowrap; }
.documented-coordinate-list { display: grid; max-height: 180px; gap: 0.35rem; margin: 0.65rem 0 0; padding: 0; overflow-y: auto; list-style: none; }
.documented-coordinate-list li { display: grid; grid-template-columns: 26px 1fr 28px; gap: 0.5rem; align-items: center; padding: 0.55rem; border-radius: 9px; background: #f7f3e8; }
.documented-coordinate-list .empty-documented-list { display: block; color: var(--muted); font-size: 0.7rem; text-align: center; }
.documented-coordinate-number { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #bda869; border-radius: 50%; color: #59471d; background: #fff9df; font-size: 0.67rem; font-weight: 850; }
.documented-coordinate-list strong, .documented-coordinate-list small { display: block; font-size: 0.69rem; font-variant-numeric: tabular-nums; }
.documented-coordinate-list small { margin-top: 0.1rem; color: var(--muted); }
.documented-coordinate-list button { width: 28px; height: 28px; border: 0; border-radius: 50%; color: #8f4b45; background: transparent; cursor: pointer; font-size: 1.2rem; }
.point-plotting-section { margin: 0; padding: 0; }
.manual-plot-instructions { margin: 0 0 0.8rem; padding: 0.7rem 0.75rem; border: 1px solid #cde1df; border-radius: 10px; color: var(--muted); background: var(--sea-100); font-size: 0.72rem; line-height: 1.45; }
.guide-nudge-grid { display: grid; gap: 0.35rem; margin-bottom: 0.65rem; }
.guide-nudge-grid > span { color: var(--muted); font-size: 0.66rem; font-weight: 800; }
.guide-nudge-grid > div { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.guide-nudge-grid button { min-height: 38px; border: 1px solid #cad8d8; border-radius: 8px; color: var(--navy-900); background: #fff; cursor: pointer; font-size: 0.7rem; font-weight: 800; }
.guide-nudge-grid button:active { background: var(--sea-100); }
.guide-nudge-grid button:disabled { opacity: .45; cursor: not-allowed; }
.guide-access-hint { margin: 0 0 0.65rem; color: var(--muted); font-size: 0.66rem; line-height: 1.4; }
.measurement-start { margin-top: 0.5rem; }
.form-error { min-height: 1.15rem; margin: 0.2rem 0; color: var(--danger); font-size: 0.73rem; line-height: 1.35; }
.point-actions { display: flex; justify-content: space-between; gap: 0.7rem; margin: 0.9rem 0 0.5rem; }
.text-button { border: 0; padding: 0; color: var(--sea-600); background: transparent; cursor: pointer; font-size: 0.73rem; font-weight: 800; }
.danger-text { color: var(--danger); }
.plot-point-list { display: grid; max-height: 230px; gap: 0.4rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.plot-point-list li { display: grid; grid-template-columns: 28px 1fr 28px; gap: 0.6rem; align-items: center; padding: 0.6rem; border-radius: 10px; background: #f3f6f5; }
.plot-point-list .empty-point-list { display: block; padding: 0.8rem; color: var(--muted); font-size: 0.75rem; text-align: center; }
.point-letter { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #fff; background: var(--navy-800); font-size: 0.72rem; font-weight: 850; }
.plot-point-list strong, .plot-point-list small { display: block; font-size: 0.73rem; font-variant-numeric: tabular-nums; }
.plot-point-list small { margin-top: 0.15rem; color: var(--muted); }
.plot-point-list button { width: 28px; height: 28px; border: 0; border-radius: 50%; color: #8f4b45; background: transparent; cursor: pointer; font-size: 1.2rem; }
.plot-point-list button:hover { background: #ffeae6; }
.leg-entry-section { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.leg-entry-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; }
.leg-entry-heading strong { color: var(--navy-900); font-family: Georgia, serif; font-size: 0.95rem; }
.leg-entry-heading span { color: var(--muted); font-size: 0.64rem; }
.leg-entry-list { display: grid; gap: 0.5rem; }
.leg-entry-card { padding: 0.65rem; border: 1px solid #dce5e4; border-radius: 10px; background: #f8faf8; }
.leg-entry-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.55rem; padding: 0; border: 0; color: inherit; background: transparent; }
.leg-entry-card header span { color: var(--sea-600); font-size: 0.62rem; font-weight: 900; letter-spacing: .1em; }
.leg-entry-card header strong { color: var(--navy-900); font-size: 0.75rem; }
.leg-entry-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.leg-entry-card label > span:first-child { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.62rem; font-weight: 750; }
.leg-input { display: flex; align-items: center; overflow: hidden; border: 1px solid #cad8d8; border-radius: 8px; background: #fff; }
.leg-input input { min-width: 0; width: 100%; height: 36px; padding: 0 0.45rem; border: 0; outline: 0; color: var(--navy-950); background: transparent; font-variant-numeric: tabular-nums; }
.leg-input b { padding: 0 0.45rem; color: var(--muted); font-size: 0.67rem; font-weight: 750; white-space: nowrap; }

.instrument-cards { display: grid; gap: 0.65rem; }
.instrument-center-button { margin-bottom: 0.75rem; }
.instrument-card { padding: 0.85rem; border: 1px solid #dfe6e5; border-radius: 12px; background: #fbfcfa; }
.instrument-card > div:first-child { display: flex; align-items: center; gap: 0.55rem; }
.instrument-card > p { margin: 0.55rem 0; color: var(--muted); font-size: 0.73rem; line-height: 1.45; }
.instrument-card > .measurement-marker-hint { color: var(--navy-800); font-weight: 750; }
.instrument-symbol { position: relative; display: inline-block; width: 31px; height: 25px; flex: 0 0 auto; }
.ruler-symbol::before, .ruler-symbol::after { content: ""; position: absolute; left: 2px; width: 27px; height: 5px; border: 1px solid #a86f24; border-radius: 2px; background: #e9bf72; transform: rotate(-12deg); }
.ruler-symbol::before { top: 5px; }
.ruler-symbol::after { top: 15px; }
.divider-symbol::before, .divider-symbol::after { content: ""; position: absolute; top: 1px; left: 14px; width: 2px; height: 25px; transform-origin: top; background: #607278; }
.divider-symbol::before { transform: rotate(25deg); }
.divider-symbol::after { transform: rotate(-25deg); }
.instrument-buttons { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.instrument-buttons button { min-height: 34px; border: 1px solid #d3dddd; border-radius: 7px; padding: 0.3rem 0.6rem; color: var(--navy-800); background: #fff; cursor: pointer; font-size: 0.74rem; font-weight: 750; }
.gesture-hint { margin: 0.75rem 0 0; padding: 0.7rem; border-radius: 8px; color: var(--muted); background: var(--sea-100); font-size: 0.7rem; line-height: 1.45; }
.divider-method { display: grid; gap: 0.35rem; margin: 0.65rem 0; padding: 0; list-style: none; }
.divider-method li { display: grid; grid-template-columns: 20px 1fr; gap: 0.4rem; align-items: center; color: var(--muted); font-size: 0.68rem; line-height: 1.35; }
.divider-method li span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: var(--navy-900); background: var(--sea-100); font-weight: 850; }
.distance-tally { display: grid; gap: 0.45rem; margin: 0.7rem 0; padding: 0.65rem; border: 1px solid #e1ded3; border-radius: 9px; background: #f7f3e8; }
.distance-tally > div, .distance-tally label, .distance-tally > p { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0; color: var(--muted); font-size: 0.67rem; }
.tally-stepper { display: flex; align-items: center; overflow: hidden; border: 1px solid #d8d1bf; border-radius: 7px; background: #fff; }
.tally-stepper button { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; font-weight: 850; }
.tally-stepper button:disabled { opacity: 0.3; }
.tally-stepper output { min-width: 28px; text-align: center; font-weight: 850; }
.distance-tally input { width: 58px; height: 30px; border: 1px solid #d8d1bf; border-radius: 7px; text-align: right; }
.distance-tally > p { padding-top: 0.4rem; border-top: 1px solid #ded8c8; }
.distance-tally > p output { color: var(--navy-900); font-size: 0.82rem; font-weight: 850; }
.verify-step > p, .share-step > p { color: var(--muted); font-size: 0.75rem; line-height: 1.45; }
.share-link-panel { margin-top: 0.75rem; }
.share-link-panel label { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.68rem; font-weight: 750; }
.share-link-panel textarea { width: 100%; resize: vertical; border: 1px solid #cad8d8; border-radius: 9px; padding: 0.55rem; color: var(--navy-900); background: #f8faf9; font: 0.65rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.share-link-panel p { min-height: 1rem; margin: 0.5rem 0 0; color: var(--sea-600); font-size: 0.68rem; line-height: 1.4; }

.chart-stage-wrap { position: sticky; top: 92px; min-width: 0; }
.chart-toolbar { display: grid; min-height: 52px; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 0.55rem 0.8rem; border: 1px solid #cbd5d6; border-bottom: 0; border-radius: 13px 13px 0 0; color: #b9cdd2; background: var(--navy-900); font-size: 0.76rem; }
.chart-toolbar > span { grid-column: 1; }
.chart-toolbar button { border: 1px solid rgba(255,255,255,.2); border-radius: 7px; padding: 0.35rem 0.6rem; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; font-size: 0.67rem; }
.chart-toolbar-actions { display: flex; grid-column: 3; justify-self: end; gap: 0.35rem; }
.chart-toolbar-actions button { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.chart-toolbar-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.chart-toolbar-actions button[aria-pressed="true"] { border-color: #55d0c7; color: #062532; background: #8fe5dd; font-weight: 850; }
.chart-only-page .chart-toolbar { position: sticky; z-index: 30; top: 0; }
.documented-coordinate-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; padding: 0.5rem 0.75rem; border: 1px solid #c7d1d1; border-top: 0; border-bottom: 0; color: var(--navy-900); background: #edf7f4; }
.documented-coordinate-strip > strong { font-family: Georgia, serif; font-size: 0.78rem; white-space: nowrap; }
.documented-coordinate-strip-values { display: flex; min-width: 0; gap: 0.4rem; overflow-x: auto; scrollbar-width: thin; }
.documented-coordinate-strip-values span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.3rem; padding: 0.28rem 0.5rem; border: 1px solid #c8ddd8; border-radius: 999px; color: #40585b; background: #fff; font-size: 0.65rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.documented-coordinate-strip-values b { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #fff; background: var(--sea-600); font-size: 0.58rem; }
.documented-coordinate-strip > button { min-height: 32px; padding: 0.3rem 0.6rem; border: 1px solid #9ebfba; border-radius: 7px; color: var(--navy-900); background: #fff; cursor: pointer; font-size: 0.66rem; font-weight: 800; }
.ruler-reading { display: grid; min-width: 190px; grid-column: 2; gap: 0.08rem; padding: 0.3rem 0.85rem; border: 1px solid rgba(143, 219, 211, .32); border-radius: 9px; background: rgba(255,255,255,.07); text-align: center; }
.ruler-reading span { color: #9bc7c8; font-size: 0.61rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.ruler-reading strong { color: #fff; font-family: Georgia, serif; font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.chart-stage { overflow: auto; border: 1px solid #c7d1d1; border-radius: 0 0 13px 13px; background: #e6e0d0; box-shadow: 0 18px 45px rgba(7, 28, 44, 0.12); }
#navigation-chart { display: block; width: 100%; min-width: 660px; height: auto; touch-action: none; user-select: none; }
.chart-sheet { fill: url(#chart-paper); stroke: #c2b797; stroke-width: 1.5; }
.plot-field { fill: rgba(255,255,255,.25); stroke: #223640; stroke-width: 2; }
.graticule-major { stroke: #263b43; stroke-width: 1.25; opacity: .84; }
.chart-tick { stroke: #172d36; stroke-width: 1.05; }
.chart-degree-label { fill: #142b35; font-family: Georgia, serif; font-size: 26px; font-weight: 800; }
.chart-minute-label { fill: #283d44; font-size: 14px; font-weight: 850; }
.chart-axis-title { fill: #4c5754; font-size: 13px; font-weight: 900; letter-spacing: .11em; }
.rose-disc { fill: #f5efdccc; stroke: #8b8779; stroke-width: 1; }
.rose-ring { fill: none; stroke: #263a42; stroke-width: 1.4; }
.rose-ring-inner { stroke-width: .8; }
.rose-tick { stroke: #263a42; stroke-width: .75; }
.rose-tick-major { stroke-width: 1.5; }
.rose-number { fill: #172f38; paint-order: stroke; stroke: #f5efdc; stroke-width: 3.5; font-size: 19px; font-weight: 400; }
.rose-cross { stroke: #263a42; stroke-width: 1.2; }
.rose-center { fill: #263a42; }
.rose-title { fill: #263a42; font-family: Georgia, serif; font-size: 23px; font-weight: 900; letter-spacing: .08em; }
.rose-subtitle { fill: #4b5c61; font-size: 14px; font-weight: 800; letter-spacing: .12em; }
.route-halo { fill: none; stroke: #fff7e5; stroke-linecap: round; stroke-linejoin: round; stroke-width: 9; opacity: .8; }
.route-line { fill: none; stroke: #cc3e35; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3.5; }
.route-measure-hit { fill: none; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32; pointer-events: stroke; cursor: crosshair; }
.route-measure-marker { cursor: pointer; outline: none; }
.route-measure-marker-hit { fill: transparent; }
.route-measure-marker-dot { fill: #0b2638; stroke: #8fe5dd; stroke-width: 3; }
.route-measure-marker path { fill: none; stroke: #fff; stroke-linecap: round; stroke-width: 2; pointer-events: none; }
.route-measure-marker:focus .route-measure-marker-dot { stroke: #fff; stroke-width: 5; }
.route-point-halo { fill: #fff7e5; opacity: .9; }
.route-point { fill: #cc3e35; stroke: #791f1a; stroke-width: 1.5; }
.route-point-label { fill: #801f1b; paint-order: stroke; stroke: #f7f1df; stroke-width: 4; font-size: 18px; font-weight: 900; }
.leg-label { fill: #8b2924; paint-order: stroke; stroke: #f7f1df; stroke-width: 5; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.plot-guide { cursor: grab; outline: none; }
.plot-guide:active { cursor: grabbing; }
.plot-guide:focus .plot-guide-body { stroke: #fff; stroke-width: 4; }
.plot-guide-hit { fill: transparent; }
.plot-guide-body { fill: rgba(0, 124, 132, .72); stroke: #075a63; stroke-width: 2; }
.plot-guide-centerline { stroke: #f7fffd; stroke-width: 2; stroke-dasharray: 8 6; }
.plot-guide-handle circle { fill: #0b2638; stroke: #55d0c7; stroke-width: 3; }
.plot-guide-handle path { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.plot-guide-label { fill: #0b2638; paint-order: stroke; stroke: #f7f1df; stroke-width: 4; font-size: 13px; font-weight: 900; letter-spacing: .08em; pointer-events: none; }
.plot-guide-intersection { pointer-events: none; }
.plot-guide-intersection > line { stroke: #0b2638; stroke-width: 2.5; }
.plot-guide-crosshair { fill: rgba(255,255,255,.88); stroke: #0b2638; stroke-width: 3; }
.plot-guide-target { fill: #d83c32; stroke: #fff; stroke-width: 3; }
.plot-guide-next-label circle { fill: #0b2638; stroke: #55d0c7; stroke-width: 3; }
.plot-guide-next-label text { fill: #fff; font-family: Georgia, serif; font-size: 20px; font-weight: 800; }
.ruler-connector line { stroke: #9f712f; stroke-width: 2; stroke-dasharray: 4 5; opacity: .48; }
.parallel-ruler { cursor: grab; }
.parallel-ruler:active { cursor: grabbing; }
.ruler-hit { fill: transparent; }
.ruler-body { fill: #e6b95ccc; stroke: #80581d; stroke-width: 1.5; }
.ruler-edge { stroke: #382a16; stroke-width: 2; }
.ruler-centerline { stroke: #75501e; stroke-width: .8; stroke-dasharray: 8 5; }
.ruler-label { fill: #553a18; font-size: 12px; font-weight: 900; }
.ruler-crossing-layer { pointer-events: none; }
.ruler-crossing-readout line { stroke: #0b2638; stroke-width: 2.5; }
.ruler-crossing-readout .crossing-point { fill: #fff; stroke: #0b2638; stroke-width: 3; }
.ruler-crossing-readout .crossing-bubble { fill: #0b2638; stroke: #55d0c7; stroke-width: 4; }
.ruler-crossing-readout .crossing-ruler-name { fill: #0b2638; paint-order: stroke; stroke: #f7f1df; stroke-width: 4; font-size: 10px; font-weight: 950; letter-spacing: .1em; }
.ruler-crossing-readout .crossing-value { fill: #fff; font-family: Georgia, serif; font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rotation-handle { cursor: crosshair; }
.rotation-handle line { stroke: #80581d; stroke-width: 2; }
.rotation-handle circle { fill: #fff7de; stroke: #80581d; stroke-width: 2; }
.rotation-handle path { fill: none; stroke: #80581d; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.4; }
.divider-leg { stroke: #5a676b; stroke-linecap: round; stroke-width: 12; }
.divider-inner { stroke: #d5dddc; stroke-linecap: round; stroke-width: 3; opacity: .8; }
.divider-move, .divider-tip { cursor: grab; }
.divider-move:active, .divider-tip:active { cursor: grabbing; }
.divider-move circle:first-child { fill: #eef3f1; stroke: #495b60; stroke-width: 3; }
.divider-move circle:nth-child(2) { fill: #495b60; }
.divider-move text { fill: #33494f; paint-order: stroke; stroke: #f7f1df; stroke-width: 4; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.divider-rotate { cursor: crosshair; }
.divider-rotate line { stroke: #41555b; stroke-width: 3; }
.divider-rotate circle { fill: #dff4f0; stroke: #41555b; stroke-width: 2.5; }
.divider-rotate path { fill: none; stroke: #41555b; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.divider-tip circle { fill: #fff8d9; stroke: #495b60; stroke-width: 2; }
.divider-tip path { fill: none; stroke: #495b60; stroke-width: 1.5; }
.chart-caption { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.7rem; text-align: right; }
.plot-results { margin-top: 0.8rem; }
.result-explainer { display: grid; gap: 0.12rem; margin-bottom: 0.6rem; }
.result-explainer strong { color: var(--success); }
.result-explainer span { color: var(--muted); font-size: 0.68rem; }
.leg-results { display: grid; gap: 0.4rem; }
.leg-results > div { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.5rem; padding: 0.6rem; border-radius: 8px; background: #edf5f1; font-size: 0.7rem; }
.leg-results > div > strong { grid-row: span 3; align-self: center; font-size: 0.76rem; }
.leg-results span, .leg-results small { color: var(--muted); text-align: right; }
.leg-results b { color: var(--navy-900); }
.leg-results .student-result { grid-column: 1 / -1; margin-top: 0.25rem; padding-top: 0.3rem; border-top: 1px solid #d7e5df; text-align: left; }
.route-total { display: flex; align-items: center; justify-content: space-between; margin: 0.55rem 0; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.75rem; }
.result-method, .result-empty { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.45; }

@media (max-width: 1100px) {
  .plotting-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .chart-stage-wrap { position: static; }
}

@media (max-width: 820px) {
  body.mobile-chart-modal-open { overflow: hidden; }
  #chart-view { padding-bottom: 5.8rem; animation: none; transform: none; }
  .plotting-layout { display: block; }
  .plotting-panel { display: block; }
  .plotting-step {
    position: fixed;
    z-index: 102;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(84dvh, 760px);
    margin: 0;
    padding: 1.25rem max(1.2rem, calc((100vw - 680px) / 2)) calc(1.4rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 55px rgba(7, 28, 44, 0.24);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms step-end;
  }
  .plotting-step.mobile-panel-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 220ms ease, visibility 0s;
  }
  .plotting-step .step-number { display: none; }
  .mobile-panel-close {
    position: sticky;
    z-index: 2;
    top: 0;
    float: right;
    display: grid;
    width: 42px;
    height: 42px;
    margin: -0.25rem -0.25rem 0.35rem 0.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--navy-900);
    background: rgba(255,255,255,.96);
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1;
  }
  .mobile-panel-backdrop {
    position: fixed;
    z-index: 101;
    inset: 0;
    display: block;
    background: rgba(4, 20, 31, .58);
    backdrop-filter: blur(3px);
  }
  .mobile-panel-backdrop[hidden] { display: none; }
  .mobile-chart-actions {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0.45rem max(0.45rem, calc((100vw - 680px) / 2)) calc(0.45rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.14);
    background: rgba(7, 28, 44, .97);
    box-shadow: 0 -10px 30px rgba(7, 28, 44, .2);
    backdrop-filter: blur(14px);
  }
  .mobile-chart-actions button {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    align-content: center;
    gap: 0.2rem;
    border: 0;
    border-radius: 10px;
    color: #c4d7dd;
    background: transparent;
    cursor: pointer;
    font-size: clamp(0.57rem, 2.5vw, 0.7rem);
  }
  .mobile-chart-actions button[aria-expanded="true"] { color: #fff; background: rgba(255,255,255,.1); }
  .mobile-chart-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .chart-stage-wrap { position: static; }
}

@media (max-width: 680px) {
  main { width: min(92vw, 1180px); padding-top: 2.5rem; }
  .brand strong { font-size: 1.02rem; }
  .hero-copy { padding: 1rem 0; }
  .hero-grid { gap: 1.25rem; }
  .compact-heading { margin-top: 4rem; }
  .quick-grid, .topic-grid, .progress-summary, .plotting-panel { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .material-card { grid-template-columns: 42px 1fr; }
  .source-meta { grid-column: 2; white-space: normal; }
  .search-card { grid-template-columns: 1fr; }
  .question-panel { min-height: 0; padding: 1.25rem; }
  .question-navigator { grid-template-columns: repeat(8, 1fr); }
  .exam-actions { position: sticky; bottom: 0; margin: 1.5rem -0.5rem -0.5rem; padding: 0.75rem 0.5rem; background: rgba(255,255,255,.95); }
  .review-answer { grid-template-columns: 1fr; gap: 0.15rem; }
  footer { flex-direction: column; }
  #chart-view .chart-heading { align-items: stretch; gap: 0.7rem; margin-bottom: 0.9rem; }
  #chart-view .chart-heading h1 { margin-bottom: 0.35rem; font-size: 2.35rem; }
  #chart-view .chart-heading .eyebrow { margin-bottom: 0.45rem; }
  #chart-view .chart-heading p:last-child { font-size: 0.82rem; line-height: 1.45; }
  .chart-only-page main { width: 100%; padding: 0.85rem 1rem 5.8rem; }
  .chart-only-page #chart-view .chart-heading { margin-bottom: 0.7rem; }
  .verify-step { grid-column: auto; }
  .share-step { grid-column: auto; }
  .chart-toolbar { grid-template-columns: 1fr auto; }
  .chart-toolbar > span { grid-column: 1; }
  .ruler-reading { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .chart-toolbar-actions { grid-column: 2; grid-row: 1; }
  .chart-toolbar-actions button { min-width: 42px; min-height: 42px; flex-direction: column; justify-content: center; gap: 0.12rem; padding: 0.25rem 0.35rem; }
  .chart-toolbar-actions svg { width: 17px; height: 17px; }
  .chart-toolbar-actions span { font-size: 0.56rem; }
  .documented-coordinate-strip { grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem; padding: 0.45rem 0.55rem; }
  .documented-coordinate-strip > strong { align-self: center; }
  .documented-coordinate-strip-values { grid-column: 1 / -1; grid-row: 2; }
  .documented-coordinate-strip > button { grid-column: 2; grid-row: 1; }
  .chart-stage { max-height: calc(100dvh - 245px); }
  #navigation-chart { min-width: 600px; }
}

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