/* =============================================================================
   EV Referral Atlas — design system  (ATLAS / COUNTRY-DIRECTORY archetype)
   Distinct identity vs siblings:
     · Condensed / grotesque headings (no serif), UPPERCASE tracked overlines.
     · Cool violet / aubergine palette (never warm cream).
     · Dense reference/atlas grid of country tiles, hairline dividers, compact rows.
     · The code lives in a persistent DARK TOP UTILITY BAR (.codebar), not a card.
     · A sticky horizontal country switcher (.geoswitch) reinforces the index feel.
   System-available fonts only → no font fetch, no CLS. Light + dark via media query.
   All bespoke class names — deliberately share nothing with the sibling sites.
   ============================================================================= */

:root {
  /* cool neutrals + aubergine ink (NOT warm cream) */
  --bg:        #f3f1f9;
  --surface:   #ffffff;
  --surface-2: #eae7f3;
  --ink:       #1b1330;   /* deep aubergine — used for the toolbar + dark blocks */
  --ink-2:     #241a3c;
  --line:      #e0dcec;
  --line-2:    #d3cde3;
  --text:      #241a38;
  --text-2:    #6a6182;

  /* violet / magenta accents */
  --violet:    #6d3fd4;
  --violet-2:  #8b5cf6;
  --magenta:   #d62f79;
  --grad:      linear-gradient(100deg, #7c4ddb 0%, #d62f79 100%);
  --ok:        #17855a;
  --ok-bg:     #e2f3ea;
  --warn:      #b96f14;
  --bad:       #c73253;

  --shadow-sm: 0 1px 2px rgba(27, 19, 48, .07);
  --shadow-md: 0 8px 26px rgba(30, 18, 56, .12);

  --r:   10px;
  --r-sm: 6px;
  --bound: 1180px;

  /* condensed / grotesque display stack + neutral body sans */
  --f-head: "Roboto Condensed", "Arial Narrow", "Franklin Gothic Medium",
            "Franklin Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
            Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
            Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #140e22;
    --surface:   #1e1633;
    --surface-2: #261c3f;
    --ink:       #0f0a1c;
    --ink-2:     #191128;
    --line:      #322843;
    --line-2:    #3d3151;
    --text:      #ece7f6;
    --text-2:    #a99fc0;
    --violet:    #a98bf3;
    --violet-2:  #b79cff;
    --magenta:   #f26aa0;
    --ok:        #4fc98d;
    --ok-bg:     #143024;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 26px rgba(0, 0, 0, .5);
  }
}

/* ── base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--f-body); color: var(--text); background: var(--bg);
  line-height: 1.62; font-size: 1rem; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--violet); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--f-head); font-weight: 700; line-height: 1.04;
  letter-spacing: -0.015em; margin: 0 0 .5em; font-stretch: condensed;
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); text-transform: none; }
h2 { font-size: clamp(1.55rem, 3.3vw, 2.25rem); }
h3 { font-size: 1.22rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.14rem; color: var(--text-2); max-width: 66ch; line-height: 1.6; }
.muted { color: var(--text-2); }
.small { font-size: .9rem; } .xsmall { font-size: .79rem; line-height: 1.5; }

/* UPPERCASE tracked section label */
.overline {
  font-family: var(--f-head); font-weight: 700; font-size: .82rem;
  letter-spacing: .22em; text-transform: uppercase; color: var(--magenta);
  margin: 0 0 .55rem; font-stretch: condensed;
}

.container { width: min(100% - 2rem, var(--bound)); margin-inline: auto; }

/* ── block (section) ──────────────────────────────────────────────────────── */
.block { padding: clamp(2.2rem, 5.5vw, 4rem) 0; }
.block--tint { background: var(--surface-2); }
.block--ink  { background: var(--ink); color: #efe9f8; }
.block--ink .lead, .block--ink .muted { color: #c4b8dc; }
.block--narrow > .container { max-width: 820px; }

.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 200;
  background: var(--surface); padding: .6rem 1rem; border-radius: 6px; box-shadow: var(--shadow-md); }
.skip-link:focus { left: .5rem; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 3px; }

/* ── sticky top stack: header + codebar + country switcher ─────────────────── */
.topstick { position: sticky; top: 0; z-index: 60; }

.sitehead {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(160%) blur(9px);
  border-bottom: 1px solid var(--line);
}
.sitehead-inner { display: flex; align-items: center; gap: 1rem; height: 58px; }
.wordmark { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  color: var(--text); font-weight: 800; }
.wordmark-name { font-family: var(--f-head); font-size: 1.15rem; font-weight: 700;
  letter-spacing: .01em; text-transform: uppercase; font-stretch: condensed; }
.wordmark-accent { color: var(--magenta); }
.mainnav { margin-left: auto; display: flex; align-items: center; gap: .1rem; }
.mainnav a { color: var(--text-2); text-decoration: none; padding: .45rem .65rem;
  border-radius: 6px; font-weight: 600; font-size: .92rem; }
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--magenta);
  border-radius: 0; }
.navtoggle { display: none; }

/* ── the code UTILITY BAR (dark toolbar strip; the site's code unit) ───────── */
.codebar { background: var(--ink); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.codebar-inner { display: flex; align-items: center; gap: .7rem; min-height: 46px;
  padding: .4rem 0; flex-wrap: wrap; }
.codebar-tag { font-family: var(--f-head); font-weight: 700; font-size: .74rem;
  letter-spacing: .18em; text-transform: uppercase; color: #c9b8f2; font-stretch: condensed;
  white-space: nowrap; }
.codebar-code {
  font-family: var(--f-mono); font-size: 1.02rem; font-weight: 600; letter-spacing: .03em;
  color: #fff; background: rgba(255,255,255,.09);
  border: 1px dashed rgba(178,150,246,.6); border-radius: var(--r-sm);
  padding: .28rem .7rem; min-width: 8.5rem; min-height: 2rem;
  display: inline-flex; align-items: center; white-space: nowrap; overflow-x: auto;
}
.codebar-copy {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .86rem;
  background: var(--violet-2); color: #fff; border: 0; border-radius: var(--r-sm);
  padding: .42rem .85rem; transition: background .12s ease, transform .1s ease;
}
.codebar-copy:hover { background: var(--violet); }
.codebar-copy:active { transform: translateY(1px); }
.codebar-copy.copied { background: var(--ok); }
.codebar-open {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: .86rem; text-decoration: none;
  color: #fff; background: var(--grad); border-radius: var(--r-sm); padding: .42rem 1rem;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.codebar-open:hover { box-shadow: var(--shadow-md); }
.codebar-stamp { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap;
  font-size: .72rem; font-weight: 700; color: #b6f0d0; }
.codebar-stamp svg { color: var(--ok); }

/* ── sticky country switcher (the atlas index, compact) ───────────────────── */
.geoswitch { background: var(--surface); border-bottom: 1px solid var(--line); }
.geoswitch-inner { display: flex; align-items: stretch; gap: 0; overflow-x: auto;
  scrollbar-width: thin; }
.geoswitch-lead { flex: none; display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--f-head); font-weight: 700; font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-2); font-stretch: condensed;
  padding: .5rem .8rem .5rem 0; white-space: nowrap; }
.geoswitch-item { flex: none; display: inline-flex; align-items: center; gap: .4rem;
  text-decoration: none; color: var(--text-2); font-size: .82rem; font-weight: 600;
  padding: .5rem .7rem; border-left: 1px solid var(--line); white-space: nowrap; }
.geoswitch-item:first-of-type { border-left: 0; }
.geoswitch-item:hover { color: var(--text); background: var(--surface-2); }
.geoswitch-item[aria-current="page"] { color: var(--violet); box-shadow: inset 0 -2px 0 var(--magenta); }
.geoswitch-item b { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .04em;
  text-transform: uppercase; opacity: .85; }
.geoswitch-flag { font-size: 1.05rem; line-height: 1; }

/* ── buttons (bespoke naming) ─────────────────────────────────────────────── */
.act { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  padding: .68rem 1.15rem; border-radius: var(--r-sm); border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s; }
.act:active { transform: translateY(1px); }
.act--fill { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
.act--fill:hover { box-shadow: var(--shadow-md); }
.act--line { background: transparent; border-color: var(--line-2); color: var(--text); }
.act--line:hover { border-color: var(--violet); color: var(--violet); }
.act--sm { padding: .44rem .9rem; font-size: .88rem; }
.act--block { display: flex; width: 100%; }

/* ── atlas lede (the pick-your-country masthead; the grid is the lead unit) ── */
.atlaslede { position: relative; overflow: clip; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(760px 380px at 92% -12%, rgba(214,47,121,.14), transparent 60%),
    radial-gradient(680px 400px at -4% 0%, rgba(124,77,219,.16), transparent 58%); }
.atlaslede-inner { padding: clamp(1.8rem, 4.5vw, 3rem) 0 clamp(1.8rem, 4vw, 2.8rem); }
.atlaslede-copy { max-width: 60ch; }
.atlaslede-copy h1 { margin: .5rem 0 .6rem; }
.atlaslede-copy h1 .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; }
.atlaslede-cta { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1.1rem; }

.stamp { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--f-head);
  font-weight: 700; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--violet); background: color-mix(in srgb, var(--violet) 13%, transparent);
  padding: .3rem .7rem; border-radius: 999px; font-stretch: condensed; }
.stamp svg { color: var(--ok); }

/* ── the atlas grid — dense hairline-divided country index ─────────────────── */
.atlas-caption { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: clamp(1.4rem, 3.5vw, 2rem) 0 .8rem; }
.atlas-caption h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
.atlas {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.atlas-tile { background: var(--surface); text-decoration: none; color: inherit;
  padding: .95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: .2rem;
  transition: background .12s ease; min-height: 118px; }
.atlas-tile:hover { background: var(--surface-2); }
.atlas-tile-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.atlas-flag { font-size: 1.55rem; line-height: 1; }
.atlas-cc { font-family: var(--f-mono); font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  color: var(--text-2); text-transform: uppercase; }
.atlas-tile h3 { font-family: var(--f-head); font-size: 1.02rem; margin: .3rem 0 .1rem;
  letter-spacing: -0.005em; }
.atlas-benefit { font-weight: 700; color: var(--violet); font-size: .92rem; margin: 0; line-height: 1.35; }
.atlas-meta { font-size: .76rem; color: var(--text-2); margin: .15rem 0 0; }

/* ── "why the reward differs" region glyphs (map explainer) ────────────────── */
.glyph { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px;
  background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet);
  margin-bottom: .65rem; }
.glyph svg { width: 22px; height: 22px; }

/* ── "jump to your country" region groups ─────────────────────────────────── */
.regionhead { display: flex; align-items: baseline; gap: .5rem; margin: 0; }
.regionhead h3 { margin: 0; }
.jumplinks { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .1rem; }
.jumplinks a { display: flex; align-items: center; gap: .55rem; text-decoration: none;
  color: var(--text); padding: .5rem .55rem; border-radius: var(--r-sm); font-weight: 600; font-size: .96rem; }
.jumplinks a:hover { background: var(--surface-2); color: var(--violet); }
.jl-flag { font-size: 1.15rem; line-height: 1; }
.jl-tag { margin-left: auto; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-2); }

/* links directly on dark ink blocks need a lighter tone for contrast;
   links inside light .panel cards keep the normal violet (readable on white) */
.block--ink a:not(.act) { color: #d3bcff; text-underline-offset: 3px; }
.block--ink a:not(.act):hover { color: #fff; }
.block--ink .panel a:not(.act) { color: var(--violet); }
.block--ink .panel a:not(.act):hover { color: var(--magenta); }

/* ── trust row + chips ────────────────────────────────────────────────────── */
.trustrow { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; margin: 1.1rem 0 0; padding: 0;
  list-style: none; color: var(--text-2); font-size: .88rem; font-weight: 600; }
.trustrow li { display: inline-flex; align-items: center; gap: .4rem; }
.trustrow svg { flex: none; color: var(--ok); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1rem 0; }
.chip { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: .38rem .75rem; font-size: .83rem; font-weight: 600; }
.chip--accent { border-color: transparent; background: var(--grad); color: #fff; }

/* ── the inline action strip (replaces the old boxed code card) ───────────── */
.ctarow {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.4rem;
  flex-wrap: wrap; border: 1px solid var(--line-2); border-left: 4px solid var(--violet);
  border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm);
  padding: 1rem 1.2rem; margin: 1.5rem 0;
}
.ctarow-text { min-width: 15rem; flex: 1; }
.ctarow-text strong { display: block; font-family: var(--f-head); font-size: 1.08rem;
  letter-spacing: -0.005em; }
.ctarow-text .muted { display: block; margin-top: .15rem; }
.ctarow-fine { flex-basis: 100%; margin: .2rem 0 0; }

/* ── generic panels / column grids ────────────────────────────────────────── */
.cols { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.panel { background: var(--surface); padding: 1.2rem 1.25rem; }
.panel h3 { margin-top: 0; }
a.panel { display: block; text-decoration: none; color: inherit; transition: background .12s ease; }
a.panel:hover { background: var(--surface-2); }
.cols a.panel { display: flex; flex-direction: column; }

.tag { font-family: var(--f-head); font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; display: inline-block; padding: .18rem .5rem; border-radius: 5px;
  margin-bottom: .5rem; font-stretch: condensed; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); }

.stepnum { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px;
  background: var(--grad); color: #fff; font-weight: 800; margin-bottom: .5rem;
  font-family: var(--f-head); font-size: 1.05rem; }

/* ── tables (dense reference feel) ────────────────────────────────────────── */
.tablescroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; min-width: 520px; background: var(--surface); }
th, td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--line);
  font-size: .93rem; }
thead th { background: var(--surface-2); font-family: var(--f-head); font-size: .76rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-stretch: condensed; }
tbody tr:last-child td { border-bottom: 0; }
.yes { color: var(--ok); font-weight: 700; } .noo { color: var(--bad); font-weight: 700; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: .5rem; max-width: 840px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: .95rem 1.1rem; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--f-head); font-size: 1.03rem; letter-spacing: -0.005em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-mark { position: relative; width: 13px; height: 13px; flex: none; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; background: var(--magenta);
  border-radius: 2px; }
.faq-mark::before { left: 0; top: 5.5px; width: 13px; height: 2px; }
.faq-mark::after { left: 5.5px; top: 0; width: 2px; height: 13px; transition: transform .2s; }
.faq-item[open] .faq-mark::after { transform: scaleY(0); }
.faq-a { padding: 0 1.1rem 1.05rem; color: var(--text-2); }
.faq-a :is(p):last-child { margin-bottom: 0; }

/* ── callouts ─────────────────────────────────────────────────────────────── */
.note { border-left: 4px solid var(--violet); background: var(--surface-2); padding: .95rem 1.1rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 1.2rem 0; }
.note.warn { border-color: var(--warn); }
.note.verified { border-color: var(--ok); }
.note strong { color: var(--text); }

/* ── breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0;
  margin: 0 0 1rem; font-size: .84rem; color: var(--text-2); }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--text-2); }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

/* ── prose ────────────────────────────────────────────────────────────────── */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2.1rem; } .prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; } .prose li { margin: .35rem 0; }
.prose table { margin: 1rem 0; }
.prose code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px;
  font-family: var(--f-mono); font-size: .88em; }
.byline { display: flex; align-items: center; gap: .6rem; color: var(--text-2); font-size: .9rem;
  margin: -.3rem 0 1.4rem; }
.byline .avatar { width: 36px; height: 36px; border-radius: 6px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--f-head);
  flex: none; font-size: .82rem; letter-spacing: .04em; }

/* ── post figure (news/blog images — explicit ratio box, zero CLS) ──────────── */
.post-figure { margin: 1.4rem 0; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: var(--r);
  box-shadow: var(--shadow-sm); background: var(--surface-2); }
.post-figure figcaption { font-size: .8rem; color: var(--text-2); margin-top: .5rem; }
.post-figure figcaption a { color: var(--text-2); }

/* incentive + source lists */
.incentive { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.15rem;
  background: var(--surface); margin: .8rem 0; box-shadow: var(--shadow-sm); }
.incentive h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.incentive .src { font-size: .83rem; margin: .5rem 0 0; }
.sources { font-size: .9rem; }
.sources li { margin: .3rem 0; }

/* ── footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: #d9cfec; border-top: 1px solid var(--line);
  margin-top: 2rem; padding-top: 2.4rem; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 1.5rem; }
.footer-brand .wordmark { color: #fff; margin-bottom: .5rem; }
.footer-brand .muted { color: #a99cc4; }
.footer-grid nav { display: flex; flex-direction: column; gap: .35rem; }
.footer-grid nav a { color: #c3b6dc; text-decoration: none; font-size: .9rem; }
.footer-grid nav a:hover { color: #fff; }
.foot-h { font-family: var(--f-head); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .14em; color: #fff; margin: 0 0 .3rem; font-stretch: condensed; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding: 1.1rem 0; }
.foot-bottom .muted { color: #a99cc4; }

/* ── utilities ────────────────────────────────────────────────────────────── */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.field { width: 100%; padding: .65rem; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; }

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .atlas, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .codebar-open { margin-left: 0; }
  .navtoggle { display: inline-flex; flex-direction: column; gap: 4px; margin-left: auto;
    background: transparent; border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 8px;
    cursor: pointer; }
  .navtoggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
  .navtoggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .navtoggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .navtoggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mainnav { position: fixed; inset: 58px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .7rem 1rem 1.2rem;
    gap: .2rem; transform: translateY(-130%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
  .mainnav.open { transform: translateY(0); }
  .mainnav a { padding: .7rem .5rem; }
  .mainnav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--magenta); }
  .mainnav .act { margin-top: .4rem; }
}
@media (max-width: 460px) {
  .atlas, .cols-4 { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; }
  .codebar-stamp { display: none; }
}
