:root {
  color-scheme: light;
  --bg: #f5f5ee;
  --paper: #fffefa;
  --text: #202c25;
  --muted: #59665d;
  --forest: #172b23;
  --green: #2c5642;
  --green-dark: #234734;
  --sage: #eaf0e6;
  --line: #d9ded3;
  --accent: #934525;
  --focus: #aa522f;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, canvas, input, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:focus:not(:focus-visible), canvas:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }

.masthead { color: #f4f6ef; background: var(--forest); border-bottom: 1px solid #35473d; }
.masthead-inner, .shell { width: min(1328px, calc(100% - 80px)); margin-inline: auto; }
.masthead-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 740; font-size: 19px; line-height: 1.1; letter-spacing: .005em; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; display: grid; flex: 0 0 auto; place-items: center; background: #2b4336; border: 1px solid #4d6652; border-radius: 9px; color: #e6efdc; }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text { display: grid; gap: 3px; }
.brand-subtitle { color: #c4d2c7; font-size: 11px; font-weight: 600; }
.guide-button { border: 1px solid #607568; border-radius: 8px; min-height: 38px; color: #f4f6ef; background: transparent; padding: 0 13px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 670; white-space: nowrap; }
.guide-button:hover { background: #2b4336; }
.guide-button .icon { width: 16px; height: 16px; }

.segmented { display: inline-flex; align-items: stretch; border: 1px solid var(--line); background: #e9ede5; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button { min-height: 31px; padding: 2px 12px; border: 1px solid transparent; border-radius: 5px; font-size: 12px; font-weight: 650; background: transparent; color: var(--muted); white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--paper); border-color: #cfd9ca; color: var(--green-dark); box-shadow: 0 1px 2px #1c332312; }
.segmented button:hover { color: var(--green-dark); }

.practice-nav { display: flex; align-items: center; justify-content: space-between; gap: 11px; margin: 18px 0 16px; }
.lesson-tabs { display: flex; flex: 1 1 auto; min-width: 0; gap: 6px; overflow-x: auto; padding: 3px; margin: -3px; scrollbar-width: thin; scrollbar-color: #b5c3b4 transparent; }
.lesson-tabs button { flex: 1 0 auto; min-height: 42px; padding: 4px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; background: var(--paper); color: #4a584f; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 660; }
.practice-style { flex: 0 0 auto; }
.picker { min-height: 37px; min-width: 0; padding: 4px 7px; border: 1px solid #c7d6c7; border-radius: 7px; background: var(--paper); color: var(--green-dark); font: inherit; font-weight: 675; cursor: pointer; }
.lesson-picker { display: none; }
.lesson-tabs button:hover { border-color: #96aa97; background: #f3f6ef; }
.lesson-tabs button[aria-pressed="true"] { color: #fffefa; border-color: var(--green); background: var(--green); }
.lesson-tabs .icon { width: 17px; height: 17px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 352px); align-items: start; gap: 17px; }
.map-card, .drill, .feedback { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 5px #26332508; }
.map-card { overflow: hidden; container-type: inline-size; }
.map-header, .map-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 15px; }
.map-header { min-height: 49px; }
.map-header > div, .map-identity > div, .guide-head > div { display: flex; align-items: center; gap: 8px; }
.map-header h2 { margin: 0; font-weight: 720; font-size: 14px; }
.map-identity { flex: 1 1 auto; min-width: 0; }
.map-identity > div { flex-wrap: wrap; gap: 3px 8px; }
.area-picker { width: min(38%, 216px); min-width: 157px; font-size: 12px; }
.map-scale-label { color: #4f6656; font: 650 11px/1.1 var(--mono); white-space: nowrap; }
.map-header .icon { color: var(--green); width: 16px; height: 16px; }
.map-header-actions { flex: 0 0 auto; flex-wrap: wrap; }
.map-zone { background: #ebefe6; color: #365440; font: 650 12px/1 var(--mono); border-radius: 5px; padding: 7px 8px; white-space: nowrap; }
.map-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 4px 9px; border: 1px solid #c8d6c7; border-radius: 7px; background: var(--paper); color: var(--green-dark); font-size: 12px; font-weight: 690; white-space: nowrap; }
.map-tool:hover, .map-tool[aria-pressed="true"] { background: #e7efe3; border-color: #88a28a; }
.map-tool-launch { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.map-tool-launch:active { cursor: grabbing; }
.map-viewport { aspect-ratio: 3 / 2; background: #dedbc5; overflow: hidden; position: relative; isolation: isolate; border-block: 1px solid #c9cfb8; }
.map-viewport canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-viewport canvas.is-pick { cursor: crosshair; }
.map-viewport canvas.over-map-tool { cursor: grab; }
.map-viewport canvas.is-dragging, .map-viewport canvas.is-moving-map-tool { cursor: grabbing; }
.map-viewport canvas:focus-visible { outline-offset: -3px; }
.map-tool-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.map-tool-grip { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #ad6b3d; border-radius: 50%; background: #fcdfb3; color: #783c1e; box-shadow: 0 2px 5px #503a2838; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.map-tool-grip:active { cursor: grabbing; background: #ffd299; }
.map-tool-grip .icon { width: 20px; height: 20px; }
.protractor-string-grip, .protractor-string-grip:active { border: 0; background: transparent; box-shadow: none; }
.protractor-string-grip::before { content: ""; width: 13px; height: 13px; border: 2px solid #22627e; border-radius: 50%; box-shadow: 0 0 0 1.5px #fffdf1; }
.map-controls { position: absolute; z-index: 3; top: 13px; right: 13px; display: grid; gap: 1px; background: #bec7b3; border: 1px solid #a5b19c; border-radius: 8px; overflow: hidden; box-shadow: 0 3px 9px #26332726; }
.map-controls button { display: grid; place-items: center; width: 38px; height: 37px; color: var(--forest); background: #fffefa; border: 0; }
.map-controls button:hover { background: #eaf0e4; }
.map-controls button:disabled { color: #747c70; background: #f4f3ec; }
.map-controls button:focus-visible { outline-offset: -3px; }
.map-controls .icon { width: 18px; height: 18px; }
.map-zoom { position: absolute; z-index: 2; bottom: 25px; right: 9px; pointer-events: none; font: 630 11px/1 var(--mono); color: #26372e; background: #fffefaec; border: 1px solid #b3bba6; border-radius: 5px; padding: 5px 7px; }
.map-zoom:empty { display: none; }
.map-tool-panel { padding: 8px 12px; background: #eff3e9; border-bottom: 1px solid var(--line); }
.protractor-position { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-tool-panel p { margin: 7px 0 0; color: #455c4a; font-size: 12px; line-height: 1.4; }
.map-footer { min-height: 45px; color: #505b50; font-size: 11px; }
.map-footer:has(> .map-controls) { min-height: 47px; gap: 8px; padding-block: 4px; }
.map-footer > .map-controls { position: static; display: flex; flex: 0 0 auto; box-shadow: none; }
.map-footer:has(> .map-controls) .map-instruction { display: none; }
.topo-source { color: var(--green-dark); font-weight: 670; text-underline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.key { width: 13px; display: inline-block; border-top: 2px solid #a77a4c; }
.key-water { border-color: #4e8c9a; }
.key-trail { border-top: 2px dashed #6e6448; }
.key-road { border-color: #a39469; box-shadow: 0 1px 0 #776c57; }
.key-survey { display: inline-block; width: 6px; height: 6px; margin-inline: 2px; border: 1px solid #394d40; transform: rotate(45deg); }
.map-instruction { text-align: right; }

.side { display: grid; align-content: start; gap: 12px; min-width: 0; }
.brief { padding: 19px 19px 15px; }
.eyebrow { color: #456550; font-weight: 760; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; }
.brief :is(h1, h2) { font-size: clamp(21px, 2.25vw, 27px); letter-spacing: -.04em; line-height: 1.12; margin: 0; }
.brief p.question { color: #4b594f; font-size: 14px; line-height: 1.48; margin: 9px 0 0; }
.coord-card, .data-card { margin-top: 14px; padding: 12px 13px; border-radius: 7px; background: #edf1e7; border: 1px solid #dbe4d5; }
.coord-prefix { display: block; font: 670 12px/1.2 var(--mono); color: #4a6550; margin-bottom: 5px; }
.coord-groups { display: flex; flex-wrap: wrap; gap: 5px 15px; font: 700 clamp(25px, 2.3vw, 32px)/1.1 var(--mono); letter-spacing: -.06em; color: var(--green-dark); }
.data-card { display: grid; gap: 7px; font-size: 13px; color: #365440; }
.data-card div { display: flex; gap: 10px; justify-content: space-between; }
.data-card strong { text-align: right; font-family: var(--mono); color: var(--green-dark); }
.course-progress { display: flex; gap: 4px; margin: 13px 0 0; }
.course-progress i { height: 4px; flex: 1; border-radius: 3px; background: #e2e8de; }
.course-progress i[data-status="current"] { background: #a45b39; }
.course-progress i[data-status="done"] { background: var(--green); }
.course-progress i[data-status="miss"] { background: #c48e73; }

.answers { border-top: 1px solid #edf0e8; padding: 14px 19px 17px; display: grid; gap: 11px; }
.answers .pin-status { margin: 0; color: #546256; font-size: 12px; display: flex; gap: 7px; align-items: center; }
.pin-status .icon { width: 15px; height: 15px; }
.pin-status[data-ready="true"] { color: var(--green-dark); }
.button-row { display: flex; gap: 8px; }
.primary, .secondary { min-height: 43px; padding: 6px 12px; border-radius: 7px; border: 1px solid #ced9ce; font-size: 13px; font-weight: 690; display: inline-flex; gap: 7px; align-items: center; justify-content: center; }
.primary { flex: 1 1 auto; background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { background: #e8ede5; border-color: #e0e6db; color: #5e6b60; }
.secondary { background: #fffefa; color: var(--green-dark); }
.secondary:hover { background: #edf2e9; }
.secondary[aria-pressed="true"] { background: #e9f1e7; border-color: #839e88; }
.primary .icon, .secondary .icon { width: 16px; height: 16px; }
.tool-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-row .secondary { min-height: 36px; }
.auxiliary { font-size: 12px; color: #546256; margin: 0; line-height: 1.45; }
.hint-text { color: #4c604b; background: #f1f4ec; border: 1px solid #dce5d7; border-radius: 7px; padding: 9px 10px; font-size: 12px; line-height: 1.5; margin: 0; }
.field-group { display: grid; gap: 5px; min-width: 0; }
.field-group label, .field-group legend { font-size: 12px; color: #415548; font-weight: 680; }
.field-group input { display: block; min-width: 0; width: 100%; min-height: 43px; border: 1px solid #a8baa9; border-radius: 7px; background: white; color: var(--text); padding: 6px 9px; font: 600 16px/1.2 var(--mono); }
.field-group input::placeholder { color: #667768; font-weight: 450; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-set { padding: 0; margin: 0; border: 0; min-width: 0; display: grid; gap: 7px; }
.choice { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fffefa; border: 1px solid #d5dfd2; border-radius: 7px; color: #394c40; min-height: 39px; font-size: 13px; line-height: 1.35; cursor: pointer; }
.choice:hover, .choice:has(input:checked) { background: #eaf0e6; border-color: #8aa18e; }
.choice input { margin: 0; accent-color: var(--green); }
.choice input:disabled, .choice:has(input:disabled) { cursor: default; }
.form-error { color: #853b25; font-size: 12px; margin: 0; line-height: 1.45; }
.form-error:empty { display: none; }
.resection-tools { border-top: 1px solid var(--line); background: #eff3e9; padding: 8px 12px; }
.resection-tool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
.resection-actions { display: flex; gap: 6px; }
.resection-actions button:disabled { opacity: .5; }
#resectionSave { min-width: 84px; }
#resectionSave:enabled { background: var(--green); border-color: var(--green); color: white; }
#resectionSave:enabled:hover { background: var(--green-dark); }
.resection-notes { margin: 4px 0 0; color: var(--green-dark); font: 600 11px/1.45 var(--mono); }
.line-notes { border-top: 1px solid var(--line); font-size: 12px; }
.line-notes summary { padding-block: 7px; color: var(--green-dark); font-weight: 680; cursor: pointer; }
.line-notes .field-pair { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); }
.feedback { border-color: #b7c9b2; background: #f3f7ee; padding: 13px 15px; }
.feedback[data-correct="false"] { border-color: #dcb8a4; background: #fdf3eb; }
.feedback h3 { margin: 0 0 5px; font-size: 15px; color: #244b36; }
.feedback[data-correct="false"] h3 { color: #863d26; }
.feedback p { margin: 0; font-size: 13px; line-height: 1.5; color: #405244; }
.feedback .resection-key { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; }
.resection-key span { width: 18px; border-top: 2px dashed #235c46; }
.feedback .secondary { margin-top: 8px; min-height: 35px; }
.feedback .button-row { margin-top: 10px; }
.feedback .button-row .secondary { margin: 0; }
.grid-aids { font-size: 12px; color: var(--muted); }
.grid-aids summary { cursor: pointer; padding: 4px 0; color: var(--green-dark); font-weight: 660; }
.grid-aids .secondary { margin-block: 5px; min-height: 35px; }
.coach { display: flex; gap: 9px; align-items: flex-start; padding: 11px 14px; background: #e9eee2; border: 1px solid #d8e2d4; border-radius: 9px; color: #3d5845; }
.coach .icon { width: 17px; height: 17px; margin-top: 1px; }
.coach strong { display: block; font-size: 13px; }
.coach p { color: #4d6151; margin: 2px 0 0; line-height: 1.46; font-size: 12px; }

.page-footer { color: #59685c; padding: 14px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.page-footer button, .guide-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: transparent; color: #345b44; font-size: inherit; font-weight: 690; text-align: left; }
.page-footer button:hover, .guide-link:hover { text-decoration: underline; }
.page-footer .icon, .guide-link .icon { width: 13px; height: 13px; }

.guide { width: min(650px, calc(100% - 30px)); max-height: min(86vh, 820px); padding: 0; border: 1px solid #a8b9a8; border-radius: 14px; background: var(--paper); color: var(--text); box-shadow: 0 22px 90px #162b2380; }
.guide::backdrop { background: #14271eba; }
.guide-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 13px 19px; background: var(--forest); color: #f5f7ee; }
.guide-head h2 { font-size: 20px; margin: 0; }
.guide-head button { display: grid; place-items: center; height: 37px; width: 37px; border: 1px solid #6a7d70; background: transparent; color: inherit; border-radius: 6px; }
.guide-head button:hover { background: #344e3f; }
.guide-body { padding: 15px 19px 20px; }
.guide-body p, .guide-terms { font-size: 14px; line-height: 1.45; color: #445348; }
.guide-modes { display: grid; gap: 6px; margin: 0 0 12px; padding: 12px 14px; background: var(--sage); border: 1px solid #d2dfce; border-radius: 9px; font-size: 14px; line-height: 1.45; }
.guide-modes div { display: grid; grid-template-columns: 68px 1fr; gap: 8px; }
.guide-modes dt { color: var(--green-dark); font-weight: 750; }
.guide-modes dd { margin: 0; color: #445348; }
.guide-body details { border-top: 1px solid var(--line); }
.guide-body summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 5px; cursor: pointer; color: var(--green-dark); font-size: 15px; font-weight: 710; scroll-margin-top: 67px; }
.guide-body summary::-webkit-details-marker { display: none; }
.guide-body summary::after { content: ""; flex: 0 0 7px; height: 7px; border-right: 1.5px solid #536e5c; border-bottom: 1.5px solid #536e5c; margin-right: 4px; transform: rotate(45deg); }
.guide-body details[open] summary::after { transform: rotate(225deg); }
.guide-body summary:hover { background: var(--sage); }
.guide-body summary:focus-visible { outline-offset: -2px; }
.guide-content { padding: 0 5px 8px; }
.guide-content p { margin: 4px 0 9px; }
.guide-content ol, .guide-content ul { padding-inline-start: 19px; margin: 4px 0 8px; color: #445348; font-size: 14px; line-height: 1.45; }
.guide-content li + li { margin-top: 5px; }
.guide-content code { font-family: var(--mono); color: var(--green-dark); font-weight: 680; white-space: nowrap; }
.guide-inline-icon { width: 14px; height: 14px; vertical-align: -2px; }
.guide-callout { padding: 8px 11px; background: #eef3eb; border-left: 3px solid #8aa489; border-radius: 0 6px 6px 0; }
.guide-example { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 16px; margin: 11px 0; padding: 9px 12px 16px; border: 1px solid var(--line); border-radius: 7px; }
.guide-example-grid { position: relative; height: 86px; width: 86px; margin-left: 13px; border: 2px solid #557262; background: repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), #bccabd calc(10% - 1px) 10%), repeating-linear-gradient(to top, #ecf0e5 0 calc(10% - 1px), #bccabd calc(10% - 1px) 10%); }
.guide-example-grid span { position: absolute; left: 60%; bottom: 80%; width: 10%; height: 10%; background: #a0522e; }
.guide-example-grid b { position: absolute; font: 700 10px var(--mono); color: var(--green-dark); }
.guide-example-east { left: -7px; bottom: -15px; }
.guide-example-north { left: -17px; bottom: -4px; }
.guide-example figcaption { color: #445348; font-size: 13px; line-height: 1.45; }
.guide-links { display: flex; flex-wrap: wrap; gap: 4px 15px; }
.guide-link { font-size: 13px; min-height: 38px; }
.guide-terms { margin: 5px 0 10px; }
.guide-terms div { display: grid; grid-template-columns: minmax(86px, 28%) minmax(0, 1fr); gap: 8px; margin-bottom: 5px; }
.guide-terms dt { font-weight: 700; color: var(--green-dark); }
.guide-terms dd { margin: 0; }

@media (max-width: 1050px) {
  .masthead-inner, .shell { width: calc(100% - 42px); }
  .workspace { grid-template-columns: minmax(0, 1fr) 305px; gap: 13px; }
  .map-footer { padding-inline: 11px; }
  .legend { gap: 4px 9px; }
  .map-instruction { display: none; }
  .lesson-tabs button { padding-inline: 11px; font-size: 12px; }
}
@media (max-width: 755px) {
  .masthead-inner, .shell { width: calc(100% - 28px); }
  .masthead-inner { height: 55px; }
  .wordmark { font-size: 17px; gap: 8px; }
  .brand-subtitle { font-size: 10px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .guide-button { min-height: 36px; }
  .practice-nav { margin: 10px 0 9px; gap: 8px; }
  .lesson-tabs { display: none; }
  .lesson-picker { display: block; min-height: 41px; flex: 1 1 auto; font-size: 14px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .side, .drill { display: contents; }
  .brief { order: -2; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
  .brief :is(h1, h2) { font-size: 20px; }
  .brief p.question { font-size: 13px; margin-top: 5px; }
  .eyebrow { margin-bottom: 5px; font-size: 9px; }
  .coord-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 8px 9px; }
  .coord-prefix { margin: 0; }
  .coord-groups { font-size: 23px; gap: 8px; }
  .data-card { margin-top: 8px; padding: 7px 9px; gap: 4px; }
  .map-card { order: -1; border-radius: 10px; }
  .map-header { min-height: 45px; padding-inline: 8px; gap: 5px; }
  .map-header > div { gap: 5px; }
  .map-header h2 { font-size: 12px; }
  .map-zone { font-size: 9px; padding: 5px; }
  .map-identity > div { align-items: start; flex-direction: column; gap: 1px; }
  .map-identity .map-zone { padding: 2px 3px; }
  .area-picker { width: 100%; min-width: 0; min-height: 36px; padding-inline: 5px; font-size: 11px; }
  .map-scale-label { font-size: 10px; }
  .map-calculator span { display: none; }
  .map-calculator { min-width: 35px; }
  .map-tool { min-height: 34px; padding-inline: 7px; font-size: 11px; }
  .map-tool .icon { width: 14px; height: 14px; }
  .map-tool-panel { padding: 6px 7px; }
  .protractor-position { gap: 4px; }
  .map-tool-panel p { margin-top: 5px; font-size: 11px; }
  .map-controls { top: 6px; right: 6px; }
  .map-controls button { width: 38px; height: 38px; }
  .map-footer { min-height: 34px; font-size: 10px; }
  .legend { gap: 3px 9px; }
  .key { width: 10px; }
  .map-zoom { bottom: 18px; right: 5px; font-size: 9px; }
  .answers { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; gap: 8px; }
  .page-footer { align-items: start; padding: 10px 0 16px; font-size: 10px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.coord-groups > span { display: grid; gap: 5px; min-width: 58px; }
.coord-groups small { color: #506953; font: 650 10px/1.25 var(--mono); letter-spacing: 0; }
.answers > .data-card { margin-top: 0; }
.brief :is(h1, h2):focus { outline: none; }
@media (max-width: 755px) {
  .coord-groups > span { min-width: 0; }
}

.masthead-actions { display: flex; align-items: center; gap: 8px; }
.test-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 13px; border-radius: 8px; background: #e7efdf; color: var(--green-dark); border: 1px solid #bacbb4; text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 730; }
.test-link:hover { background: #fffefa; }

.exam-shell { width: min(100%, 790px); margin-inline: auto; padding: 29px 0 38px; }
.exam-heading { margin-bottom: 17px; }
.exam-heading h1 { margin: 0; font-size: clamp(28px, 4vw, 43px); line-height: 1.1; letter-spacing: -.045em; }
.exam-heading h1:focus { outline: none; }
.exam-heading p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; font-size: 14px; }
.exam-card, .exam-resume { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 17px; }
.exam-setup { display: grid; gap: 17px; }
.exam-setup fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.exam-setup legend, .exam-field > label { margin: 0 0 6px; padding: 0; color: var(--green-dark); font-size: 14px; font-weight: 730; }
.exam-settings { display: grid; grid-template-columns: minmax(240px, 1.2fr) 1fr 1fr; gap: 11px 18px; }
.exam-field { display: flex; flex-direction: column; min-width: 0; }
.exam-field .picker { min-height: 42px; font-size: 13px; }
.exam-count { display: flex; align-items: stretch; flex-wrap: wrap; gap: 7px; }
.exam-count input { width: 74px; min-height: 42px; padding: 5px 9px; border: 1px solid #c7d6c7; border-radius: 7px; color: var(--green-dark); background: var(--paper); font: 700 16px var(--mono); }
.exam-presets button { padding-inline: 9px; }
.exam-selection { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.exam-text-button { border: 0; padding: 4px 0 4px 5px; min-height: 28px; background: transparent; color: var(--green-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.exam-text-button:hover { text-decoration: underline; }
.exam-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.exam-category { display: flex; min-height: 46px; align-items: center; gap: 7px; padding: 7px 8px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; color: var(--green-dark); font-size: 13px; font-weight: 670; line-height: 1.25; }
.exam-category input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--green); }
.exam-category:hover, .exam-category:has(input:checked) { background: var(--sage); border-color: #86a18b; }
.exam-category:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.exam-category .icon { width: 15px; height: 15px; }
.exam-map-settings { border-block: 1px solid var(--line); }
.exam-map-settings summary { display: flex; align-items: center; min-height: 43px; gap: 10px; cursor: pointer; list-style: none; color: var(--green-dark); font-size: 14px; }
.exam-map-settings summary::-webkit-details-marker { display: none; }
.exam-map-settings summary::before { content: "›"; font-size: 17px; }
.exam-map-settings[open] summary::before { transform: rotate(90deg); }
.exam-map-settings summary span { margin-left: auto; color: var(--muted); font-size: 12px; }
.exam-map-grid { margin-bottom: 11px; }
#testSetupMessage { margin: -5px 0 0; }
#testSetupMessage:empty { display: none; }
.exam-resume { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; background: #edf2e9; }
.exam-resume strong { font-size: 14px; color: var(--green-dark); }
.exam-resume p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.exam-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 18px 0 13px; }
.exam-status p { margin: 0 0 3px; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.exam-status h1 { margin: 0; font-size: clamp(23px, 3vw, 32px); line-height: 1.1; letter-spacing: -.035em; }
.exam-status-actions { display: flex; gap: 7px; }
.exam-status progress { grid-column: 1 / -1; width: 100%; height: 6px; border: 0; border-radius: 9px; background: #dfe7dc; color: var(--green); accent-color: var(--green); }
.exam-status progress::-webkit-progress-bar { border-radius: 9px; background: #dfe7dc; }
.exam-status progress::-webkit-progress-value { border-radius: 9px; background: var(--green); }
.exam-status progress::-moz-progress-bar { border-radius: 9px; background: var(--green); }

.exam-question-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
.exam-question-link { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--muted); font: 650 14px var(--mono); }
.exam-question-link[data-answered="true"] { color: var(--green-dark); background: var(--sage); border-color: #8da793; }
.exam-question-link:hover { border-color: var(--green); color: var(--green-dark); }
.exam-report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.exam-report-actions .primary { flex: 1 1 140px; }
.exam-score-card { margin-bottom: 13px; }
.exam-score-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.exam-score-line strong { color: var(--green-dark); font: 740 clamp(34px, 6vw, 52px)/1 var(--mono); letter-spacing: -.07em; }
.exam-score-line span { color: var(--green-dark); font: 700 20px var(--mono); }
.exam-score-card > p { margin: 7px 0 0; font-size: 13px; color: var(--muted); }
.exam-breakdown { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 17px; margin: 13px 0 0; padding: 0; }
.exam-breakdown li { display: flex; justify-content: space-between; gap: 5px; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.exam-breakdown strong { font-family: var(--mono); white-space: nowrap; color: var(--green-dark); }
.exam-review-list h2 { margin: 0 0 11px; font-size: 18px; color: var(--green-dark); }
.exam-answer { border-top: 1px solid var(--line); font-size: 13px; color: #3f5244; }
.exam-answer summary { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 43px; cursor: pointer; font-weight: 690; list-style: none; }
.exam-answer summary::-webkit-details-marker { display: none; }
.exam-answer summary::before { content: "›"; color: var(--green); font-size: 16px; }
.exam-answer[open] summary::before { transform: rotate(90deg); }
.exam-answer summary > span:first-child { flex: 1; }
.exam-answer-status { color: #925033; white-space: nowrap; font-size: 11px; font-weight: 720; }
.exam-answer-status[data-correct="true"] { color: var(--green); }
.exam-answer > div { padding: 0 0 10px 14px; }
.exam-answer p { margin: 4px 0; line-height: 1.5; }
.exam-answer-area { color: var(--muted); font-size: 11px; font-weight: 710; }
.exam-answer dl { margin: 9px 0; display: grid; gap: 5px; }
.exam-answer dl > div { display: grid; grid-template-columns: minmax(85px, 1fr) minmax(0, 2fr); gap: 7px; }
.exam-answer dt { font-weight: 680; }
.exam-answer dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 755px) {
  .masthead-actions { gap: 5px; }
  .masthead-actions .guide-button, .test-link { min-height: 36px; padding-inline: 8px; font-size: 12px; gap: 4px; }
  .exam-shell { padding-top: 19px; }
  .exam-heading { margin-bottom: 12px; }
  .exam-heading p { font-size: 13px; }
  .exam-card, .exam-resume { padding: 12px; }
  .exam-setup { gap: 13px; }
  .exam-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 11px; }
  .exam-settings > :first-child { grid-column: 1 / -1; }
  .exam-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-category { min-height: 49px; }
  .exam-status { padding: 9px 0 10px; gap: 6px; }
  .exam-status .secondary { min-height: 36px; padding-inline: 8px; font-size: 12px; }
  .exam-question-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  .masthead-actions .guide-button .icon { display: none; }
  .wordmark { font-size: 16px; }
}

@container (max-width: 715px) {
  .map-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(157px, 49%); padding-block: 6px; }
  .map-identity > div { flex-direction: row; align-items: center; gap: 3px 5px; }
  .map-header-actions { grid-column: 1 / -1; }
  .area-picker { width: 100%; max-width: 216px; justify-self: end; }
}

@media (max-width: 365px) {
  .masthead-inner { gap: 8px; }
  .brand-mark { display: none; }
  .masthead-actions .guide-button, .test-link { padding-inline: 6px; font-size: 11px; }
  .map-header .map-tool { padding-inline: 6px; gap: 4px; }
}

.brief-heading { display: flex; flex-wrap: wrap; gap: 5px 8px; justify-content: space-between; align-items: center; }
.grid-precision button { min-height: 30px; padding-inline: 7px; font-size: 11px; }

.calculator { width: min(350px, calc(100% - 28px)); max-height: 90dvh; padding: 14px; border: 1px solid #a8b9a8; border-radius: 13px; color: var(--text); background: var(--paper); box-shadow: 0 16px 56px #162b2350; }
.calculator::backdrop { background: #14271e75; }
.calculator form { display: grid; gap: 7px; }
.calculator-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.calculator-head h2 { margin: 0; font-size: 18px; }
.calculator input, .calculator output { padding-inline: 9px; font: 650 17px/1.35 var(--mono); text-align: right; }
.calculator input { min-height: 44px; width: 100%; border: 1px solid #a8b9a8; border-radius: 7px; color: var(--green-dark); background: #f2f5ec; }
.calculator output { min-height: 24px; color: var(--green-dark); overflow-wrap: anywhere; }
.calculator-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.calculator-keys button { min-height: 41px; border: 1px solid #cbd6c9; border-radius: 6px; color: var(--text); background: #f4f6f0; font: 650 15px var(--mono); }
.calculator-keys button:hover { background: #e8efe3; }
.calculator-keys button.calculator-equals { grid-column: 1 / -1; background: var(--green); color: white; }

.exam-map-preview { position: relative; margin: 10px 0 6px; aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.exam-map-preview img { position: absolute; display: block; max-width: none; object-fit: fill; }
.exam-map-preview span { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.exam-feature-area { border: 2px solid #235c46; background: #21665232; box-shadow: 0 0 0 1px #fffdf1; }
.exam-user-pin { width: 10px; height: 10px; border: 1.5px solid #fffdf1; background: #963e26; }

.ground-view { margin: 0; background: #263d3d; color: #fff; }
.ground-view figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 7px 13px; font-size: 12px; }
.ground-view canvas { display: block; width: 100%; height: auto; }

@media (min-width: 756px) {
  .map-viewport.with-ground-view { aspect-ratio: 2 / 1; }
}

.learning-entry, .guided-session { width:100%; margin:0 0 16px; padding:12px 16px; border:1px solid #ccd8c6; border-radius:10px; background:#edf2e7; color:#2b4e39; display:flex; align-items:center; justify-content:space-between; gap:12px; text-align:left; font-size:13px; }
.learning-entry > span:last-child { font-weight:700; white-space:nowrap; }
.guided-session span { display:block; margin-top:3px; font-size:12px; }
.learning-dialog { width:min(590px,calc(100% - 24px)); max-height:calc(100dvh - 36px); padding:22px; border:1px solid #b5c4b0; border-radius:16px; background:var(--paper); color:var(--text); overflow:auto; }
.learning-dialog::backdrop { background:#10251b99; }
.learning-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.learning-head h2 { margin:0; font-size:21px; }
.learning-dialog h3 { font-size:23px; margin:12px 0; }
.learning-dialog p, .lesson-steps { font-size:14px; line-height:1.55; }
.lesson-example { display:grid; grid-template-columns:minmax(140px,220px) 1fr; align-items:center; gap:16px; padding:12px; background:#f0f3e9; border-radius:10px; }
.lesson-illustration { width:100%; height:auto; }
.lesson-steps { padding-left:24px; }
.lesson-steps li { padding:4px 0; }
.learning-dialog > .primary { width:100%; }
.lesson-list { margin:18px 0; }
.lesson-list summary { cursor:pointer; font-size:13px; padding:8px 0; }
.lesson-list button { width:100%; margin:3px 0; justify-content:flex-start; }
.review-note { margin-top:10px!important; padding-top:10px; border-top:1px solid #cad4c3; }
.exam-report-actions { flex-wrap:wrap; }
.exam-answer .secondary { margin-top:10px; }

/* A task, a map workspace, and one response. Controls stay in the same places. */
:root { --radius: 12px; --control-height: 44px; }
.shell { padding-bottom: 24px; }
.masthead-inner { min-height: 72px; }
.guide-button, .test-link, .picker, .map-tool, .secondary, .primary, .lesson-tabs button { min-height: var(--control-height); }
.segmented button { min-height: 38px; }
.workspace { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.task-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.task-card .brief-heading, .task-card .question, .task-card .eyebrow { grid-column: 1; }
.task-card .brief-heading { align-items: center; gap: 12px; }
.task-card .question { margin: 0; max-width: 80ch; font-size: 14px; }
.task-card :is(h1,h2) { font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
.task-card .coord-card, .task-card .data-card { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; min-width: 240px; }
.task-card .coord-card { display: flex; align-items: center; gap: 18px; padding: 12px 16px; }
.task-card .coord-prefix { margin: 0; }
.task-card .coord-groups { font-size: 29px; gap: 18px; }
.task-card .course-progress { grid-column: 1 / -1; margin-top: 4px; }
.side { display: grid; gap: 12px; position: sticky; top: 16px; }
.map-viewport { height: clamp(340px, 52dvh, 620px); aspect-ratio: auto; }
.drill:has(.answers[hidden]) { display: none; }
.answers { border: 0; padding: 18px; gap: 12px; }
.response-label { margin: 0 0 2px; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.answers .pin-status { font-size: 13px; line-height: 1.5; }
.choice { min-height: 46px; font-size: 14px; padding: 10px; }
.map-choices .choice-set { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.map-choices .choice { justify-content: center; gap: 6px; }
.button-row { gap: 8px; }
.button-row .primary { flex: 1 1 auto; min-width: 0; }
.button-row .secondary { flex: 0 0 auto; white-space: nowrap; }
.feedback .button-row { display: grid; grid-template-columns: minmax(0,1fr); }
.answer-correction { background: #ffffff75; padding: 8px 10px; border-radius: 6px; }
.map-viewport.with-ground-view { height: clamp(300px, 38dvh, 440px); }
.feedback .button-row .secondary { margin-top: 0; }
.feedback { padding: 18px; }
.feedback p { line-height: 1.55; }
.coach { font-size: 13px; }
.map-header { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,40%); padding: 12px; gap: 10px; }
.map-header h2 { font-size: 15px; }
.map-header .area-picker { width: 100%; max-width: none; font-size: 12px; }
.map-identity > div { flex-direction: row; align-items: center; gap: 4px 8px; }
.map-header-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.map-tool { font-size: 13px; padding: 6px 12px; }
.map-tool:disabled { opacity: .48; }
.map-tool[aria-pressed="true"] { border-color: #527b61; background: #e2eddf; box-shadow: inset 0 0 0 1px #527b61; }
.map-header-actions .map-tool { flex: 1; }
.map-header-actions .map-calculator { flex: 0 1 auto; }
.workspace-controls { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f7f8f1; border-bottom: 1px solid var(--line); }
.workspace-controls .map-controls { position: static; display: flex; flex: 0 0 auto; box-shadow: none; }
.workspace-controls .map-controls button { width: 44px; height: 42px; }
.workspace-controls .map-zoom { position: static; margin-left: auto; font-size: 12px; }
.workspace-status { font-size: 12px; color: var(--muted); }
.map-tool-panel { padding: 10px 12px; }
.map-tool-panel p { max-width: 76ch; font-size: 12px; line-height: 1.5; }
.map-tool-grip { width: 44px; height: 44px; }
.resection-tools { padding: 10px 12px; background: #eff3e9; }
.resection-tool-row { align-items: center; }
.resection-tool-row p { font-size: 13px; line-height: 1.45; }
.map-footer { padding: 10px 12px; min-height: 0; font-size: 11px; flex-wrap: wrap; gap: 8px; }
.map-instruction { display: none; }
.learning-entry { min-height: 48px; padding: 10px 14px; margin-bottom: 12px; }
.page-footer { font-size: 12px; gap: 12px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--green); }
dialog { max-height: 88dvh; overscroll-behavior: contain; }
@media (max-width: 1180px) {
  .lesson-tabs { display: none; }
  .lesson-picker { display: block; flex: 1; max-width: 400px; font-size: 15px; }
  .workspace { grid-template-columns: minmax(0,1fr) 275px; }
  .task-card .coord-card, .task-card .data-card { min-width: 210px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .side { position: static; display: grid; grid-template-columns: minmax(0,1fr); }
  .drill { display: block; }
  .map-card, .task-card { order: initial; }
  .answers { padding: 14px; }
  .choice-set { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .map-viewport { height: auto; aspect-ratio: 3 / 2; }
  .map-viewport.with-ground-view { height: auto; aspect-ratio: 2 / 1; }
}
@media (max-width: 600px) {
  .masthead-inner, .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 64px; }
  .brand-mark { display: none; }
  .wordmark { font-size: 17px; }
  .brand-subtitle { font-size: 10px; }
  .masthead-actions { gap: 6px; }
  .guide-button, .test-link { font-size: 12px; padding-inline: 9px; }
  .guide-button .icon { display: none; }
  .practice-nav { margin-block: 12px; }
  .practice-style button { padding-inline: 10px; font-size: 13px; }
  .workspace { gap: 10px; }
  .task-card { display: block; padding: 13px 14px; }
  .task-card :is(h1,h2) { font-size: 22px; }
  .task-card .question { font-size: 13px; margin-top: 6px; }
  .task-card .coord-card, .task-card .data-card { margin-top: 10px; min-width: 0; }
  .task-card .coord-card { padding: 9px 12px; }
  .task-card .coord-groups { font-size: 25px; }
  .grid-precision button { min-height: 36px; padding-inline: 8px; }
  .map-header { padding: 8px; grid-template-columns: minmax(0,1fr) minmax(165px,52%); gap: 8px; }
  .map-header h2 { font-size: 13px; }
  .map-header-actions { gap: 6px; }
  .map-header-actions .map-tool { font-size: 12px; padding-inline: 8px; }
  .map-calculator span { display: none; }
  .map-calculator { min-width: 44px; }
  .map-scale-label, .map-zone { font-size: 10px; }
  .workspace-controls { padding: 6px 8px; gap: 6px; }
  .map-tool-panel, .resection-tools { padding: 8px; }
  .map-footer { padding: 8px; }
  .legend { gap: 5px 10px; }
  .learning-entry { font-size: 12px; }
  .learning-entry > span:first-child { max-width: 220px; }
  .learning-entry-detail { display: none; }
  .lesson-picker { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media(max-width:540px) { .learning-entry { align-items:flex-start; } .learning-entry > span:first-child strong { display:block; } .learning-entry > span:last-child { font-size:12px; } .lesson-example { grid-template-columns:1fr; gap:0; } .lesson-illustration { max-height:170px; } .learning-dialog { padding:16px; } .page-footer { flex-wrap:wrap; } }

@media (max-width: 360px) {
  .map-tool-launch .icon { display: none; }
  .map-header-actions .map-tool { padding-inline: 6px; }
}
