:root {
  --ink: #111936;
  --navy: #111936;
  --cream: #f6f2e8;
  --paper: #fffdf7;
  --line: #d8d3c7;
  --muted: #62677a;
  --lime: #c9f63c;
  --coral: #ff6b58;
  --sky: #70c9ff;
  --violet: #8d72ff;
  --yellow: #ffd949;
  --blue: #3f73ff;
  --green: #18865e;
  --danger: #bf3b37;
  --shadow: 0 9px 0 rgba(17, 25, 54, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .7rem; font-size: clamp(2rem, 4vw, 4.2rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: .65rem; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.15; letter-spacing: -.025em; }
h3 { margin-bottom: .45rem; font-size: 1.08rem; line-height: 1.25; }
p { margin-bottom: .75rem; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--lime); border: 2px solid var(--ink); padding: .6rem 1rem; font-weight: 800; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.topbar { position: sticky; top: 0; z-index: 30; min-height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: .65rem clamp(1rem, 3vw, 2.5rem); background: rgba(246, 242, 232, .95); border-bottom: 2px solid var(--ink); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: .65rem; padding: 0; background: transparent; text-align: left; }
.brand-mark { width: 42px; aspect-ratio: 1; display: grid; place-items: center; background: var(--lime); border: 2px solid var(--ink); border-radius: 50% 50% 50% 12%; font: 900 1.2rem/1 Georgia, serif; transform: rotate(-7deg); }
.brand strong, .brand small { display: block; white-space: nowrap; }
.brand strong { font-size: 1rem; line-height: 1; }
.brand small { margin-top: .2rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.main-nav { display: flex; justify-content: center; gap: .1rem; }
.nav-button { padding: .58rem .7rem; background: transparent; border-radius: 999px; color: var(--muted); font-size: .88rem; font-weight: 750; white-space: nowrap; }
.nav-button:hover { color: var(--ink); background: rgba(17, 25, 54, .06); }
.nav-button.active { color: var(--paper); background: var(--navy); }
.saved-button { display: flex; align-items: center; gap: .45rem; padding: .55rem .7rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; font-weight: 800; white-space: nowrap; }
.saved-button b { min-width: 1.7rem; padding: .05rem .35rem; border-radius: 999px; background: var(--yellow); }
.saved-button[aria-pressed="true"] { background: var(--yellow); }

.view { max-width: 1600px; min-height: calc(100vh - 72px); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.8rem) clamp(1rem, 4vw, 4rem) 7rem; }
.view[hidden] { display: none; }
.eyebrow { margin-bottom: .35rem; color: var(--muted); font-size: .73rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.mission-strip { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding-bottom: 1.25rem; }
.mission-strip h1 { max-width: 900px; font-size: clamp(2.2rem, 5vw, 5.4rem); }
.mission-strip p:last-child { max-width: 780px; margin: 0; color: var(--muted); }
.primary-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .7rem 1rem; border: 2px solid var(--ink); border-radius: 12px; font-weight: 850; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.primary-button { background: var(--lime); }
.primary-button:hover, .outline-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.primary-button.dark { color: var(--paper); background: var(--navy); box-shadow: 4px 4px 0 var(--lime); }
.outline-button { background: transparent; box-shadow: none; }
.text-button { padding: .25rem; color: var(--muted); background: transparent; font-size: .82rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.text-button.light { color: var(--paper); }

.stats-ribbon { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 1.3rem; background: var(--navy); border: 2px solid var(--ink); border-radius: var(--radius); color: var(--paper); overflow: hidden; }
.stats-ribbon article { display: flex; align-items: baseline; gap: .55rem; min-height: 84px; padding: 1rem 1.2rem; border-right: 1px solid rgba(255,255,255,.22); }
.stats-ribbon article:last-child { border-right: 0; }
.stats-ribbon span { color: var(--lime); font: 800 clamp(1.8rem, 3vw, 2.8rem)/1 Georgia, serif; }
.stats-ribbon small { max-width: 115px; color: rgba(255,255,255,.72); line-height: 1.2; }

.workspace { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.filter-panel { position: sticky; top: 88px; padding: 1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-heading, .result-toolbar, .checklist-title, .source-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.filter-heading h2, .result-toolbar h2 { margin: 0; }
.filter-panel fieldset { margin: 1rem 0; padding: 0; border: 0; }
.filter-panel legend, .field-label { display: block; margin-bottom: .4rem; font-size: .78rem; font-weight: 850; }
.filter-block { margin: .85rem 0; }
.search-box { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .75rem; background: #fff; border: 1.5px solid var(--line); border-radius: 11px; }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63,115,255,.12); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.search-box.wide { min-width: min(420px, 100%); flex: 1 1 340px; }
select, input[type="search"] { min-height: 42px; }
select { width: 100%; margin-bottom: .85rem; padding: .55rem .7rem; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; }
.chip-stack { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-chip { padding: .42rem .62rem; background: var(--cream); border: 1.5px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 800; }
.filter-chip[aria-pressed="true"] { color: var(--paper); background: var(--navy); border-color: var(--navy); }
.filter-chip small { opacity: .7; }
.multi-filter { position: relative; }
.multi-filter summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 44px; padding: .55rem .65rem; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; font-size: .82rem; font-weight: 750; list-style: none; cursor: pointer; }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: "⌄"; margin-left: auto; color: var(--muted); font-size: 1rem; transition: transform .16s ease; }
.multi-filter[open] summary { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63,115,255,.12); }
.multi-filter[open] summary::after { transform: rotate(180deg); }
.multi-filter summary b { display: grid; place-items: center; min-width: 1.55rem; height: 1.55rem; padding: 0 .35rem; color: var(--paper); background: var(--navy); border-radius: 999px; font-size: .68rem; }
.multi-filter summary b[data-empty="true"] { color: var(--muted); background: var(--cream); }
.multi-filter-menu { position: absolute; z-index: 12; top: calc(100% + .35rem); left: 0; width: min(340px, calc(100vw - 2rem)); max-height: 300px; overflow-y: auto; padding: .45rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 7px 7px 0 rgba(17,25,54,.16); }
.multi-option { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: .5rem; padding: .5rem; border-radius: 8px; cursor: pointer; }
.multi-option:hover { background: var(--cream); }
.multi-option input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--navy); }
.multi-option span { font-size: .78rem; }
.multi-option small { color: var(--muted); font-size: .68rem; }
.switch-row { display: flex; align-items: center; gap: .55rem; min-height: 42px; font-size: .86rem; font-weight: 700; }
.switch-row input { width: 1.15rem; height: 1.15rem; accent-color: var(--navy); }
.switch-row.inline { min-height: 44px; padding: 0 .7rem; background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; white-space: nowrap; }
.legend-box { margin-top: .8rem; padding: .75rem; background: var(--cream); border-radius: 12px; }
.legend-box strong { font-size: .8rem; }
.legend-box p { margin: .28rem 0; color: var(--muted); font-size: .75rem; }
.filter-logic { margin: .8rem 0 0; padding: .55rem .65rem; color: var(--muted); background: #eef5ff; border-left: 4px solid var(--blue); border-radius: 7px; font-size: .72rem; }
.dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .25rem; border-radius: 50%; }
.dot-lime { background: var(--lime); border: 1px solid var(--ink); }
.dot-violet { background: var(--violet); }
.dot-coral { background: var(--coral); }

.results-panel { min-width: 0; }
.result-toolbar { min-height: 58px; margin-bottom: .4rem; }
.result-toolbar label { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .78rem; font-weight: 800; }
.result-toolbar select { width: auto; margin: 0; }
.result-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; }
.view-switch { display: inline-flex; padding: .2rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 11px; }
.view-switch button { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .4rem .6rem; background: transparent; border-radius: 7px; font-size: .76rem; font-weight: 850; }
.view-switch button[aria-pressed="true"] { color: var(--paper); background: var(--navy); }
.active-filters { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 30px; margin-bottom: .55rem; }
.active-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .26rem .5rem; color: var(--muted); background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; }
button.active-tag { cursor: pointer; }
button.active-tag::after { content: "×"; color: var(--ink); font-weight: 950; }
button.active-tag:hover { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.formation-card { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 5px 5px 0 rgba(17,25,54,.09); overflow: hidden; transition: transform .16s ease; }
.formation-card:hover { transform: translateY(-3px); }
.formation-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; background: var(--accent, var(--sky)); }
.card-head { display: flex; justify-content: space-between; gap: .65rem; margin-top: .25rem; }
.family-badge, .status-badge { display: inline-flex; align-items: center; width: fit-content; padding: .25rem .5rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--accent, var(--sky)); font-size: .68rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.favorite-toggle { width: 36px; height: 36px; flex: 0 0 auto; background: transparent; border: 1.5px solid var(--line); border-radius: 50%; font-size: 1.1rem; }
.favorite-toggle.active { background: var(--yellow); border-color: var(--ink); }
.formation-card h3 { margin: .8rem 0 .35rem; }
.school-line { min-height: 2.8em; color: var(--muted); font-size: .82rem; }
.card-badges { display: flex; flex-wrap: wrap; gap: .32rem; margin: .35rem 0 .8rem; }
.micro-badge { padding: .2rem .42rem; background: var(--cream); border-radius: 6px; font-size: .67rem; font-weight: 800; }
.micro-badge.strong { background: var(--lime); }
.micro-badge.warning { color: #6c291e; background: #ffe1dc; }
.score-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: auto; }
.score { padding: .5rem .35rem; background: var(--cream); border-radius: 9px; text-align: center; }
.score b { display: block; font: 800 1.2rem/1 Georgia, serif; }
.score small { display: block; margin-top: .25rem; color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: .45rem; margin-top: .75rem; }
.card-actions button { min-height: 40px; padding: .5rem .65rem; border: 1.5px solid var(--ink); border-radius: 9px; background: transparent; font-size: .76rem; font-weight: 850; }
.card-actions .details-button { color: var(--paper); background: var(--navy); }
.card-actions .compare-button.active { background: var(--lime); }

.formation-map-view { min-width: 0; }
.map-zone-tabs { display: flex; gap: .4rem; margin-bottom: .65rem; overflow-x: auto; padding: .15rem .1rem .4rem; scrollbar-width: thin; }
.map-zone-tabs button { display: inline-flex; align-items: center; gap: .38rem; min-height: 38px; padding: .45rem .65rem; white-space: nowrap; background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; font-size: .74rem; font-weight: 850; }
.map-zone-tabs button b { display: grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .3rem; background: var(--cream); border-radius: 999px; font-size: .65rem; }
.map-zone-tabs button[aria-pressed="true"] { color: var(--paper); background: var(--navy); border-color: var(--navy); }
.map-zone-tabs button[aria-pressed="true"] b { color: var(--ink); background: var(--lime); }
.map-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: .8rem; align-items: start; }
.map-board, .map-results { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.map-board { min-width: 0; padding: .8rem; overflow: hidden; }
.map-board-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .55rem; }
.map-board-head h3 { margin: 0; }
.map-board-head > span { padding: .35rem .55rem; color: var(--paper); background: var(--navy); border-radius: 999px; font-size: .72rem; font-weight: 900; }
#formation-map { display: block; width: 100%; height: auto; min-height: 420px; background-color: #dff3ff; background-image: linear-gradient(rgba(17,25,54,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(17,25,54,.045) 1px, transparent 1px); background-size: 28px 28px; border: 1.5px solid var(--ink); border-radius: 14px; }
.map-region { fill: #fffdf7; stroke: #111936; stroke-width: 1.35; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .14s ease, opacity .14s ease; }
.map-region:hover, .map-region:focus { fill: #e9f9b7; outline: none; }
.map-region.selected { fill: var(--lime); }
.map-territory-frame { fill: rgba(255,253,247,.78); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 10 8; }
.map-watermark { fill: rgba(17,25,54,.35); font: 800 32px/1 Georgia, serif; text-anchor: middle; }
.map-cluster { cursor: pointer; }
.map-cluster:focus { outline: none; }
.map-cluster .cluster-halo { fill: rgba(255,255,255,.85); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-cluster .cluster-core { fill: var(--cluster-color, var(--violet)); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: transform .14s ease; transform-box: fill-box; transform-origin: center; }
.map-cluster:hover .cluster-core, .map-cluster:focus .cluster-core, .map-cluster.selected .cluster-core { transform: scale(1.16); }
.map-cluster.selected .cluster-halo { fill: var(--yellow); stroke-width: 3; }
.map-cluster text { fill: var(--ink); font: 900 12px/1 Inter, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: .4rem .75rem; margin-top: .6rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .32rem; color: var(--muted); font-size: .68rem; font-weight: 750; }
.map-legend i { width: 11px; height: 11px; border: 1px solid var(--ink); border-radius: 50%; background: var(--legend-color); }
.map-results { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; padding: .8rem; }
.map-results-head { margin-bottom: .65rem; padding-bottom: .6rem; border-bottom: 2px solid var(--ink); }
.map-results-head h3 { margin-bottom: .25rem; }
.map-results-head p { margin: 0; color: var(--muted); font-size: .76rem; }
.map-result-list { display: grid; gap: .55rem; }
.map-result-card { padding: .65rem; background: var(--cream); border-left: 6px solid var(--accent, var(--sky)); border-radius: 9px; }
.map-result-card h4 { margin: .2rem 0; font-size: .88rem; line-height: 1.25; }
.map-result-card p { margin: 0 0 .45rem; color: var(--muted); font-size: .7rem; }
.map-result-card button { padding: .35rem .5rem; color: var(--paper); background: var(--navy); border-radius: 7px; font-size: .7rem; font-weight: 850; }
.map-more { margin: .7rem 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
.map-empty { display: grid; min-height: 240px; place-items: center; padding: 1rem; text-align: center; }
.map-empty p { color: var(--muted); font-size: .8rem; }

.pagination { display: flex; justify-content: center; align-items: center; gap: .45rem; margin-top: 1.3rem; }
.pagination button { min-width: 40px; min-height: 40px; padding: .4rem .6rem; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--paper); font-weight: 800; }
.pagination button[aria-current="page"] { color: var(--paper); background: var(--navy); }
.pagination button:disabled { opacity: .35; cursor: default; }
.empty-state { grid-column: 1/-1; padding: 3rem 1.5rem; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; }

.section-intro { margin-bottom: 1.5rem; }
.section-intro p:not(.eyebrow) { max-width: 850px; color: var(--muted); }
.compact-intro { max-width: 1000px; }
.split-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.split-intro > div:first-child { max-width: 960px; }
.warning-note { max-width: 360px; padding: .8rem 1rem; background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; transform: rotate(1deg); }
.warning-note strong, .warning-note span { display: block; }
.warning-note span { margin-top: .25rem; font-size: .78rem; }

.route-quiz { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: .8rem; padding: 1rem; background: var(--navy); border-radius: var(--radius); color: var(--paper); }
.route-quiz label { display: block; margin-bottom: .35rem; font-size: .78rem; font-weight: 850; }
.route-quiz select { margin: 0; }
.route-answer { margin: 1rem 0; }
.answer-ticket { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; background: var(--lime); border: 2px solid var(--ink); border-radius: 14px; }
.answer-ticket strong { font-size: 1.1rem; }
.answer-ticket span { font-size: .85rem; }
.route-deck { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.route-card { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: .8rem; padding: 1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); }
.route-rank { width: 58px; height: 58px; display: grid; place-items: center; background: var(--accent, var(--sky)); border: 2px solid var(--ink); border-radius: 50%; font: 800 1.45rem/1 Georgia, serif; }
.route-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0; }
.route-card ul { margin: .45rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .8rem; }
.route-card .watch { color: #7b332b; }
.evidence-callout { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-top: 1.2rem; padding: 1rem; border: 2px dashed var(--ink); border-radius: var(--radius); }
.callout-number { font: 800 2rem/1 Georgia, serif; color: var(--violet); }
.evidence-callout p { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }
.evidence-callout a { font-size: .78rem; font-weight: 850; }

.horizontal-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; padding: .8rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); }
.horizontal-filters select { width: auto; max-width: 260px; margin: 0; }
.results-line { display: flex; justify-content: space-between; gap: 1rem; margin: .75rem 0; color: var(--muted); font-size: .82rem; }
.results-line strong { color: var(--ink); }
.master-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.master-card { display: grid; grid-template-columns: minmax(0,1fr) 118px; gap: .8rem; padding: 1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); }
.master-card .family-badge { background: var(--sky); }
.master-card h3 { margin-top: .65rem; }
.track-name { color: var(--muted); font-size: .86rem; }
.master-location { margin-bottom: 0; font-size: .78rem; }
.master-metrics { display: grid; align-content: start; gap: .4rem; }
.metric-tile { padding: .55rem; background: var(--cream); border-radius: 10px; text-align: center; }
.metric-tile b { display: block; font: 800 1.2rem/1 Georgia, serif; }
.metric-tile small { color: var(--muted); font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.metric-tile.accent { background: var(--lime); }
.master-card footer { grid-column: 1/-1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .72rem; }
.master-card footer a { font-weight: 850; }

.recognition-key { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; max-width: 460px; }
.recognition-key span { padding: .38rem .55rem; background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; font-size: .72rem; }
.recognition-key b { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-right: .25rem; background: var(--navy); border-radius: 50%; color: var(--paper); }
.decoder-grid { display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.recognition-explainer { position: sticky; top: 88px; padding: 1.1rem; color: var(--paper); background: var(--navy); border-radius: var(--radius); }
.recognition-step { display: grid; grid-template-columns: 34px 1fr; gap: .6rem; margin: .8rem 0; }
.recognition-step span { width: 32px; height: 32px; display: grid; place-items: center; background: var(--lime); border-radius: 50%; color: var(--ink); font: 800 1rem/1 Georgia, serif; }
.recognition-step p { margin: 0; font-size: .83rem; }
.recognition-explainer .outline-button { margin-top: .5rem; color: var(--paper); border-color: var(--paper); font-size: .8rem; }
.rncp-list { display: grid; gap: .65rem; }
.rncp-card { padding: .9rem 1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; }
.rncp-card summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1rem; align-items: center; list-style: none; cursor: pointer; }
.rncp-card summary::-webkit-details-marker { display: none; }
.rncp-card summary::after { content: "+"; width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 900; }
.rncp-card[open] summary::after { content: "−"; background: var(--lime); }
.rncp-title-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.rncp-title-line h3 { margin: 0; }
.status-badge { background: var(--lime); }
.status-badge.warning { background: var(--coral); }
.rncp-meta { margin-top: .35rem; color: var(--muted); font-size: .77rem; }
.rncp-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.rncp-body p, .rncp-body li { font-size: .79rem; }
.provider-list { max-height: 280px; overflow: auto; padding: .6rem; background: var(--cream); border-radius: 10px; }
.provider-list a { font-weight: 800; }
.provider-list li { margin-bottom: .35rem; }

.finance-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1rem; }
.finance-verdict { position: relative; padding: 1.2rem; color: var(--paper); background: var(--violet); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.finance-verdict::after { content: "€"; position: absolute; right: -20px; bottom: -55px; font: 800 10rem/1 Georgia, serif; color: rgba(255,255,255,.13); transform: rotate(12deg); }
.verdict-stamp { display: inline-block; margin-bottom: 1.2rem; padding: .35rem .6rem; background: var(--lime); border: 2px solid var(--ink); border-radius: 6px; color: var(--ink); font-size: .72rem; font-weight: 950; letter-spacing: .1em; transform: rotate(-3deg); }
.finance-verdict .small { font-size: .79rem; opacity: .82; }
.checklist-card { padding: 1.1rem; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); }
.checklist-title h2 { margin: 0; }
.checklist-title > span { min-width: 54px; padding: .35rem; background: var(--yellow); border: 1.5px solid var(--ink); border-radius: 999px; text-align: center; font-weight: 900; }
.wide-card { grid-column: 1/-1; }
.check-item { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; }
.check-item input { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; accent-color: var(--green); }
.check-item span { font-size: .88rem; }
.check-item input:checked + span { color: var(--muted); text-decoration: line-through; }
.practical-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.practical-grid .check-item { padding: .7rem; background: var(--cream); border: 0; border-radius: 10px; }
.warning-banner { display: flex; gap: 1rem; margin-top: 1rem; padding: 1rem; background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; }

.source-count { min-width: 140px; padding: .7rem 1rem; background: var(--lime); border: 2px solid var(--ink); border-radius: var(--radius); text-align: center; transform: rotate(2deg); }
.source-count span { display: block; font: 800 2.4rem/1 Georgia, serif; }
.source-count small { font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.method-grid article { padding: 1rem; border-top: 5px solid var(--ink); background: var(--paper); }
.method-grid article > span { font: 800 1.6rem/1 Georgia, serif; color: var(--violet); }
.method-grid h2 { margin-top: .6rem; }
.method-grid p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.downloads-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: 1rem; color: var(--paper); background: var(--navy); border-radius: var(--radius); }
.downloads-panel h2 { margin: 0; }
.download-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.download-links a { padding: .45rem .6rem; color: var(--ink); background: var(--lime); border-radius: 8px; font-size: .75rem; font-weight: 850; text-decoration: none; }
.limitations { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.limitation { padding: .7rem .8rem; background: #ffe5e1; border-left: 4px solid var(--coral); font-size: .78rem; }
.source-toolbar { margin: 1.4rem 0 .6rem; }
.source-toolbar h2 { margin: 0; }
.source-toolbar input { min-width: 280px; padding: .5rem .7rem; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; }
.source-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
.source-item { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: .65rem; align-items: center; padding: .7rem; background: var(--paper); border: 1.5px solid var(--line); border-radius: 11px; }
.source-index { font: 800 1.1rem/1 Georgia, serif; color: var(--violet); }
.source-item strong, .source-item small { display: block; }
.source-item small { color: var(--muted); font-size: .7rem; }
.source-item a { font-weight: 900; text-decoration: none; }

.compare-tray { position: fixed; z-index: 25; left: 50%; bottom: 18px; width: min(760px, calc(100% - 2rem)); transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; color: var(--paper); background: var(--navy); border: 2px solid var(--ink); border-radius: 15px; box-shadow: 0 12px 40px rgba(17,25,54,.28); }
.compare-tray[hidden] { display: none; }
.compare-tray > div { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.compare-tray strong, .compare-tray small { display: block; }
.compare-tray small { max-width: 420px; overflow: hidden; color: rgba(255,255,255,.7); text-overflow: ellipsis; white-space: nowrap; }
.compare-count { display: grid; place-items: center; min-width: 48px; min-height: 48px; background: var(--violet); border-radius: 50%; font-weight: 900; }
.modal { width: min(900px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; color: var(--ink); box-shadow: 12px 12px 0 rgba(17,25,54,.35); }
.wide-modal { width: min(1200px, calc(100% - 2rem)); }
.modal::backdrop { background: rgba(17,25,54,.72); backdrop-filter: blur(4px); }
.modal-close { position: sticky; z-index: 2; top: 12px; float: right; width: 42px; height: 42px; margin: 12px 12px 0 0; background: var(--coral); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.5rem; font-weight: 900; }
.modal-content { padding: 1.4rem; }
.modal-hero { margin: -1.4rem -1.4rem 1rem; padding: 1.5rem 4rem 1.2rem 1.4rem; background: var(--accent, var(--sky)); border-bottom: 2px solid var(--ink); }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin: .8rem 0; }
.fact { padding: .7rem; background: var(--cream); border-radius: 10px; }
.fact small, .fact strong { display: block; }
.fact small { color: var(--muted); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.fact strong { margin-top: .2rem; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-section { padding-top: .8rem; border-top: 2px solid var(--ink); }
.detail-section ul { padding-left: 1.1rem; }
.detail-section li { margin-bottom: .35rem; font-size: .84rem; }
.official-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.official-links a { padding: .5rem .65rem; background: var(--navy); border-radius: 8px; color: var(--paper); font-size: .75rem; font-weight: 850; text-decoration: none; }
.compare-table-wrap { overflow-x: auto; padding: 1.4rem; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.compare-table th, .compare-table td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table thead th { background: var(--lime); }
.compare-table tbody th { width: 160px; color: var(--muted); }
.toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: 320px; padding: .7rem 1rem; color: var(--paper); background: var(--navy); border-radius: 10px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .main-nav { grid-column: 1/-1; order: 3; justify-content: flex-start; overflow-x: auto; padding-bottom: .1rem; }
  .saved-button { justify-self: end; }
  .filter-panel { top: 130px; }
  .recognition-explainer { top: 130px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  h1 { font-size: clamp(2rem, 10vw, 3.5rem); }
  .topbar { position: static; }
  .mission-strip, .split-intro, .downloads-panel { align-items: stretch; flex-direction: column; }
  .mission-strip { display: flex; }
  .stats-ribbon { grid-template-columns: repeat(2, 1fr); }
  .stats-ribbon article:nth-child(2) { border-right: 0; }
  .stats-ribbon article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.22); }
  .workspace, .decoder-grid { grid-template-columns: 1fr; }
  .filter-panel, .recognition-explainer { position: static; }
  .filter-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem .8rem; }
  .filter-heading, .filter-panel fieldset, .filter-panel .search-box, .legend-box { grid-column: 1/-1; }
  .filter-logic { grid-column: 1/-1; }
  .map-workspace { grid-template-columns: 1fr; }
  .map-results { position: static; max-height: none; }
  .route-quiz { grid-template-columns: 1fr; }
  .master-grid, .route-deck { grid-template-columns: 1fr; }
  .finance-layout { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
  .practical-grid, .method-grid { grid-template-columns: 1fr; }
  .source-list { grid-template-columns: 1fr; }
  .recognition-key { justify-content: flex-start; }
  .evidence-callout { grid-template-columns: auto 1fr; }
  .evidence-callout a { grid-column: 2; }
}

@media (max-width: 560px) {
  .topbar { gap: .5rem; padding: .55rem .7rem; }
  .brand small { display: none; }
  .brand-mark { width: 36px; }
  .saved-button { padding: .45rem; font-size: .72rem; }
  .main-nav { margin: 0 -.7rem; padding: .15rem .7rem; }
  .nav-button { font-size: .78rem; }
  .view { padding: 1.1rem .75rem 7rem; }
  .mission-strip h1 { font-size: 2.55rem; }
  .stats-ribbon article { min-height: 74px; padding: .7rem; flex-direction: column; gap: .2rem; }
  .stats-ribbon small { max-width: none; }
  .filter-panel { display: block; }
  .card-grid { grid-template-columns: 1fr; }
  .formation-card { min-height: 310px; }
  .result-toolbar { align-items: flex-start; flex-direction: column; }
  .result-controls { width: 100%; justify-content: space-between; }
  .result-toolbar label { width: 100%; justify-content: space-between; }
  .result-toolbar select { flex: 1; }
  .result-controls > label { width: 100%; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; justify-content: center; }
  #formation-map { min-height: 360px; }
  .master-card { grid-template-columns: 1fr; }
  .master-metrics { grid-template-columns: repeat(3,1fr); }
  .master-card footer { flex-direction: column; align-items: flex-start; }
  .rncp-card summary { grid-template-columns: minmax(0,1fr) 36px; }
  .rncp-body, .detail-columns, .fact-grid { grid-template-columns: 1fr; }
  .horizontal-filters > * { width: 100%; max-width: none !important; }
  .results-line, .warning-banner { flex-direction: column; }
  .route-card { grid-template-columns: 48px minmax(0,1fr); }
  .route-rank { width: 44px; height: 44px; }
  .limitations { grid-template-columns: 1fr; }
  .source-toolbar { align-items: stretch; flex-direction: column; }
  .source-toolbar input { width: 100%; min-width: 0; }
  .source-item { grid-template-columns: 34px minmax(0,1fr) auto; }
  .compare-tray { bottom: 8px; width: calc(100% - 1rem); }
  .compare-tray small, .compare-tray .text-button { display: none; }
}

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