/* The atlas's design tokens: colour, type, radius, elevation, the lens accents, the dark
   themes and the colour-blind palette. Every page loads this sheet first (item 92, stage 2;
   STYLEGUIDE.md 3.3), so a token has one definition and a page cannot drift from another.
   Moved out of atlas.css as it stood; the order of the blocks is the order they had there. */

:root {
    --bg:#EDEFF2; --surface:#FFFFFF; --surface-2:#F5F6F9; --surface-3:#ECEEF2;
    --ink:#15181F; --ink-soft:#414855; --muted:#5C636F; --hatch:rgba(21,24,31,.40);
    --hairline:#E0E3E9; --hairline-strong:#CBD0D9;
    /* The prototype's names for the same two things. Eighteen declarations were written
       against them and every one was being dropped: an undefined var() makes the whole
       declaration invalid at computed-value time, so a border specified as
       `1px solid var(--line)` computes to no border at all — silently, and identically
       in both themes. Defined here in terms of the tokens that do exist, so one
       definition follows the theme wherever it is used. */
    --line:var(--hairline); --line-soft:color-mix(in srgb, var(--hairline) 55%, transparent);
    /* --brand: the red of the Swiss flag, as the Federal Chancellery defines it (Pantone 485 C,
       on screen #DA291C, RGB 218/41/28), in both themes (owner, 7 Oct 2026). */
    --brand:#DA291C; --focus:#2563EB; --link:#1D74C4; --positive:#13795B; --negative:#B42318;
    --sea:#DCE2EA;          /* ocean */
    /* One face for everything (owner, 8 Sep 2026: Helvetica Neue). It ships with macOS
       and iOS and is licensed, so it is not self-hosted; Arial and Liberation Sans are
       metric-compatible with Helvetica, so Windows and Linux lay out the same page in a
       near-identical face. The monospace it replaces was doing two jobs —
       a look and the alignment of figures — and only the second mattered, so
       the columns that need it now say `font-variant-numeric:tabular-nums`
       instead of borrowing a whole typeface to get it. */
    --font-ui:"Helvetica Neue",Helvetica,Arial,"Liberation Sans",sans-serif;
    /* Tier text: the figure beside a ranking bar, and the zoom header's value.
       Solved rather than picked — every one of the ten clears 5.2:1 against its
       own theme's surface, and the five keep a real luminance spread so the ramp
       can still be ordered by lightness alone. */
    --tier-r0:#5F1412; --tier-r1:#772D27; --tier-r2:#754C04; --tier-r3:#2C6D55; --tier-r4:#177B57;
    --tier-n0:#20323E; --tier-n1:#204A5D; --tier-n2:#1D597B; --tier-n3:#18669A; --tier-n4:#1570AF;
    --land-null:#BABABA;    /* no data: a neutral grey, no hue (owner, 4 Oct 2026) */
    --stroke:#FFFFFF;
    --shadow-sm:0 1px 2px rgba(18,24,36,.05);
    --shadow:0 1px 2px rgba(18,24,36,.05),0 8px 24px -12px rgba(18,24,36,.20);
    --shadow-lg:0 2px 6px rgba(18,24,36,.07),0 20px 44px -18px rgba(18,24,36,.30);
    --radius:14px;
    /* The shell was capped at 1300px, which left a wide screen mostly margin
       and squeezed the map into a column narrower than the data deserved.
       It now takes the width it is given, up to a bound that keeps long
       prose from running to unreadable line lengths. */
    --maxw:min(96vw, 1800px);

    /* One type scale for the whole page. The interface had grown twenty-eight sizes
       between 6px and 26px, which is not a hierarchy — it is noise that reads as
       clutter and, at the small end, as unreadable.
       ① page title, ①ᵇ masthead, ② section heading, ③ body, ④ caption / label / button.

       This said «four steps and no fifth», and the fifth arrived anyway, unnamed: the
       next shell slimmed the bar and pushed the masthead down to ②, which put the app's
       own name at the same size as «Arriving» and «What moved» below it — and, because
       those had drifted to a literal 20px, actually beneath them. A page whose h1 is
       smaller than its h2 has no hierarchy to read. ①ᵇ is that step, declared rather
       than left as a literal: below the page's own subject, above every section in it. */
    --t1:26px;
    --t1b:22px;
    --t2:18px;
    --t3:16px;
    --t4:14px;
    /* Owner, 8 Sep 2026: 16 body / 14 secondary / 12 labels / 10 for source lines.
       --t5 is the floor for anything a reader must read; --t6 is for the provenance
       line under a reading and nothing else. */
    --t5:12px;
    --t6:10px;
    /* The Issue's display sizes (plan item 99; owner, 9 Oct 2026: «as close as possible to the
       prototype»): its covers, section openers and one-finding headlines, nowhere else. They
       scale with the screen between a floor and the prototype's size. */
    --d1:clamp(40px, 5.2vw, 68px);
    --d2:clamp(28px, 3.2vw, 42px);
    --d3:clamp(24px, 2.4vw, 32px);
  }

/* Data and status colours (DESIGN.md: every colour resolves through a custom property).
     Each ramp step is named once and used by the map, its legend and its ranking bar, so the
     three cannot drift apart, and the colour-blind palette at the end of this file only
     redefines these values. */
:root {
    /* The risk ramp, worst (0) to best (4): the map, its legend and the ranking bars. */
    --risk-0:#A72B2B; --risk-1:#D96B5F; --risk-2:#E8B65D; --risk-3:#91C8A8; --risk-4:#237A5A;
    /* The other map ramps, light (0) to deep (4). */
    --trade-0:#B9DDD2; --trade-1:#88C8B7; --trade-2:#55AC97; --trade-3:#278875; --trade-4:#0D5F52; --trade-bar-end:#0D6F60;
    --neutral-0:#A5BFD2; --neutral-1:#86A9C2; --neutral-2:#649AB9; --neutral-3:#3E84B2; --neutral-4:#155A87; --neutral-bar-0:#D8E9F4; --neutral-bar-1:#AACDE1; --neutral-bar-2:#74AECF;
    --align-0:#A72B2B; --align-1:#C97A63; --align-2:#B3A98F; --align-3:#6E93BB; --align-4:#1D4F8C;
    --surplus-0:#D8EEE7; --surplus-1:#B6DFD3; --surplus-2:#82C8B5; --surplus-3:#42A087; --surplus-4:#0D6656;
    --deficit-0:#F5DAD7; --deficit-1:#EDB8B2; --deficit-2:#DE8C83; --deficit-3:#C9584D; --deficit-4:#9F2D24;
    /* Alignment with the four powers, faint (0) to close (4), and each power's text colour. */
    --allyus-0:#C6DBEF; --allyus-1:#9ECAE1; --allyus-2:#6BAED6; --allyus-3:#3182BD; --allyus-4:#08519C; --allyus-text:#2171B5;
    --allycn-0:#FCBBA1; --allycn-1:#FC9272; --allycn-2:#FB6A4A; --allycn-3:#DE2D26; --allycn-4:#A50F15; --allycn-text:#CB181D;
    --allyru-0:#F3E3A6; --allyru-1:#E6C65C; --allyru-2:#CFA22A; --allyru-3:#A07A10; --allyru-4:#6B5207; --allyru-text:#8A6A0A;
    --allyau-0:#DADAEB; --allyau-1:#BCBDDC; --allyau-2:#9E9AC8; --allyau-3:#756BB1; --allyau-4:#54278F; --allyau-text:#6A51A3;
    /* One colour per supplier group, the same on the map, the legend and the bars. */
    --supplier-anz:#6B7F2B; --supplier-cn:#A72B2B; --supplier-digital:#2E8577; --supplier-economic:#33628F; --supplier-europe:#2F7D6D; --supplier-humanitarian:#B34233; --supplier-in:#7B5EA7; --supplier-jp:#CE5A78; --supplier-kr:#2B7A8C; --supplier-multilateral:#9C7A3C; --supplier-none:#DCD7CB; --supplier-other:#8D8577; --supplier-ru:#D98A2B; --supplier-socgov:#6E5D8E; --supplier-us:#1D4F8C;
    /* Claimed areas and the parties to a claim. */
    --claim-area:#BFE8D0; --claim-area-label:#27664A; --claim-area-line:#4D9A72; --claim-party:#F1CD5A; --claim-party-line:#8D6A00;
    /* Status and marks: good and bad, ageing, warnings, outliers, the review badge. */
    --ageing:#8A5B00; --bad:#8F2C2C; --concern-bg:#A72B2B0D; --concern-ink:#9F211E; --concern-line:#B7453B; --good:#1D6B45; --highlight:#8F2C2C; --no-concern-bg:#237A5A0D; --no-concern-ink:#126044; --no-concern-line:#237A5A; --on-accent:#FFF; --out-bad-bg:#F8E4E0; --out-bad-line:#DBA79F; --out-good-bg:#E4F2E2; --out-good-line:#A9CDA4; --out-hi-bg:#F9EDD8; --out-hi-line:#E4CB9A; --out-lo-bg:#E3EDF4; --out-lo-line:#B9D0E0; --overview-full-bg:#0B0E13; --review-badge-bg:#F5C518; --review-badge-ink:#3D2E00; --stale:#9A6505; --warn:#B8860B;
    --balance-bar-surplus:var(--positive); --balance-bar-deficit:var(--negative);
    /* The reading's year, by how far behind this year it is (owner, 4 Oct 2026, item 88). */
    /* An amber tint for «ageing» marks and the assessed source tier; a backdrop under overlays; «held steady», the brand's
       soft fill and a form's error, once defined by the pages themselves (item 91, 15.1). */
    --amber-soft:rgba(214,158,46,.16); --steady:#A87400; --brand-soft:rgba(218,41,28,.09); --error:#8f1428; --error-bg:#fff0f1; --amber-line:rgba(214,158,46,.36); --scrim:rgba(21,24,31,.38);
    --year-0-bg:#1E7A4F; --year-0-ink:#FFFFFF; --year-0-line:#1E7A4F; --year-1-bg:#DCF0E2; --year-1-ink:#1D6B45; --year-1-line:#A9D5B6; --year-2-bg:#FBF1C7; --year-2-ink:#6B5300; --year-2-line:#E3CF74; --year-3-bg:#D69E00; --year-3-ink:#2E2200; --year-3-line:#D69E00; --year-4-bg:#F9DEDB; --year-4-ink:#8F2C2C; --year-4-line:#E5AAA3;
    /* The Systems graph: one colour per menu subject (item 128, owner 15 Oct 2026: «a node based approach like in Obsidian»). */
    --sys-rights:#7B4FA0; --sys-security:#B5533C; --sys-geopolitics:#2F6DB5; --sys-economy:#2E8B57; --sys-debt:#A87400; --sys-trade:#1A8A8A; --sys-society:#C2577A; --sys-environment:#5A8F29; --sys-science:#4B5BB7; --sys-diplomacy:#8A6D3B;
  }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --good:#5FBF8C; --bad:#E4788A; --ageing:#F0C674; --amber-soft:rgba(240,198,116,.16); --steady:#E8B640; --brand-soft:rgba(218,41,28,.14); --error:#ff91a0; --error-bg:#35151b; --amber-line:rgba(240,198,116,.34); --scrim:rgba(0,0,0,.55);
      --year-0-bg:#2E8B5C; --year-0-ink:#FFFFFF; --year-0-line:#2E8B5C; --year-1-bg:#1C3A2B; --year-1-ink:#8FD9AE; --year-1-line:#3E7A5A; --year-2-bg:#3A3320; --year-2-ink:#F0D27A; --year-2-line:#7A6A3A; --year-3-bg:#C99400; --year-3-ink:#1C1500; --year-3-line:#C99400; --year-4-bg:#3F2226; --year-4-ink:#F0A0AC; --year-4-line:#8A4A54;
      --sys-rights:#B48BD6; --sys-security:#E08A70; --sys-geopolitics:#6FA3E8; --sys-economy:#5FC28A; --sys-debt:#E0B54A; --sys-trade:#4FC4C4; --sys-society:#E58AA8; --sys-environment:#93C25E; --sys-science:#8E9BEA; --sys-diplomacy:#C4A577;
      --bg:#0D1014; --surface:#161B22; --surface-2:#1C222B; --surface-3:#232A34;
      --ink:#EDF0F5; --ink-soft:#B4BCC7; --muted:#8A93A0; --hatch:rgba(237,240,245,.34);
      --hairline:#262D37; --hairline-strong:#333B47;
      --brand:#DA291C; --focus:#6AA2FF; --link:#7FB6F5; --positive:#6BCBA6; --negative:#FF8B82;
      --sea:#121821; --land-null:#363636; --stroke:#0D1014;
      --tier-r0:#E26765; --tier-r1:#D78983; --tier-r2:#ED9B08; --tier-r3:#7AC9AC; --tier-r4:#4ADDA9;
      --tier-n0:#6594AF; --tier-n1:#5FA7C9; --tier-n2:#6DB5DD; --tier-n3:#80C1EB; --tier-n4:#95CCF2;
      --shadow-sm:0 1px 2px rgba(0,0,0,.4);
      --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 30px -14px rgba(0,0,0,.6);
      --shadow-lg:0 2px 6px rgba(0,0,0,.5),0 22px 48px -20px rgba(0,0,0,.75);
    }
  }

:root[data-theme="dark"] {
    --good:#5FBF8C; --bad:#E4788A; --ageing:#F0C674; --amber-soft:rgba(240,198,116,.16); --steady:#E8B640; --brand-soft:rgba(218,41,28,.14); --error:#ff91a0; --error-bg:#35151b; --amber-line:rgba(240,198,116,.34); --scrim:rgba(0,0,0,.55);
    --year-0-bg:#2E8B5C; --year-0-ink:#FFFFFF; --year-0-line:#2E8B5C; --year-1-bg:#1C3A2B; --year-1-ink:#8FD9AE; --year-1-line:#3E7A5A; --year-2-bg:#3A3320; --year-2-ink:#F0D27A; --year-2-line:#7A6A3A; --year-3-bg:#C99400; --year-3-ink:#1C1500; --year-3-line:#C99400; --year-4-bg:#3F2226; --year-4-ink:#F0A0AC; --year-4-line:#8A4A54;
    --sys-rights:#B48BD6; --sys-security:#E08A70; --sys-geopolitics:#6FA3E8; --sys-economy:#5FC28A; --sys-debt:#E0B54A; --sys-trade:#4FC4C4; --sys-society:#E58AA8; --sys-environment:#93C25E; --sys-science:#8E9BEA; --sys-diplomacy:#C4A577;
    --bg:#0D1014; --surface:#161B22; --surface-2:#1C222B; --surface-3:#232A34;
    --ink:#EDF0F5; --ink-soft:#B4BCC7; --muted:#8A93A0; --hatch:rgba(237,240,245,.34);
    --hairline:#262D37; --hairline-strong:#333B47;
    --brand:#DA291C; --focus:#6AA2FF; --link:#7FB6F5; --positive:#6BCBA6; --negative:#FF8B82;
    --sea:#121821; --land-null:#363636; --stroke:#0D1014;
    --tier-r0:#E26765; --tier-r1:#D78983; --tier-r2:#ED9B08; --tier-r3:#7AC9AC; --tier-r4:#4ADDA9;
    --tier-n0:#6594AF; --tier-n1:#5FA7C9; --tier-n2:#6DB5DD; --tier-n3:#80C1EB; --tier-n4:#95CCF2;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 30px -14px rgba(0,0,0,.6);
    --shadow-lg:0 2px 6px rgba(0,0,0,.5),0 22px 48px -20px rgba(0,0,0,.75);
  }

:root{--lens-accent:#8B2438;--lens-soft:rgba(139,36,56,.08)}

:root[data-lens="exposure"]{--lens-accent:#146B63;--lens-soft:rgba(20,107,99,.09)}

:root[data-lens="relationship"]{--lens-accent:#355FA3;--lens-soft:rgba(53,95,163,.09)}

/* The accent had no dark value at all — defined on bare :root and the two lens
     variants and nowhere else — so on a dark surface it sat at about 2:1. These three
     are the same hues moved to clear 4.6:1 against it. */
@media (prefers-color-scheme:dark){
    :root:not([data-theme="light"]){--lens-accent:#D55C74;--lens-soft:rgba(213,92,116,.14)}
    :root:not([data-theme="light"])[data-lens="exposure"]{--lens-accent:#1C9489;--lens-soft:rgba(28,148,137,.15)}
    :root:not([data-theme="light"])[data-lens="relationship"]{--lens-accent:#5B85CA;--lens-soft:rgba(91,133,202,.15)}
  }

:root[data-theme="dark"]{--lens-accent:#D55C74;--lens-soft:rgba(213,92,116,.14)}

:root[data-theme="dark"][data-lens="exposure"]{--lens-accent:#1C9489;--lens-soft:rgba(28,148,137,.15)}

:root[data-theme="dark"][data-lens="relationship"]{--lens-accent:#5B85CA;--lens-soft:rgba(91,133,202,.15)}

/* The three lenses at once (plan item 99): the Issue colours each section by its lens on one page, where
   --lens-accent is one lens per page. The same hues as the accent's, light and dark. */
:root{--lens-conditions:#8B2438;--lens-exposure:#146B63;--lens-relationship:#355FA3}
@media (prefers-color-scheme:dark){
    :root:not([data-theme="light"]){--lens-conditions:#D55C74;--lens-exposure:#1C9489;--lens-relationship:#5B85CA}
  }
:root[data-theme="dark"]{--lens-conditions:#D55C74;--lens-exposure:#1C9489;--lens-relationship:#5B85CA}

:root{--edge-allies:#0F6B4F;--edge-partners:#2E8B6B;--edge-friendly:#84B79F;--edge-neutral:#98A2AC;
    --edge-competitive_interdependence:#5F8CA6;--edge-rivals:#D9A33C;--edge-adversaries:#CE6F38;--edge-enemies:#B0342B}

/* v2.1 — the tendency's seven buckets on a diverging ramp, competitive to
     cooperative through a neutral midpoint. Seven steps rather than a continuous
     gradient: the matrix cell is 14px, where a continuous scale is not
     distinguishable and would defeat the legend that has to name the bands.
     The hues are the same family the class ladder used, so a reader who knew
     the old drawing is not relearning the palette as well as the model. */
:root{
    --tend-strongly_competitive:#B0342B; --tend-competitive:#CE6F38;
    --tend-leaning_competitive:#D9A33C;  --tend-neutral:#98A2AC;
    --tend-leaning_cooperative:#84B79F;  --tend-cooperative:#2E8B6B;
    --tend-strongly_cooperative:#0F6B4F;
    --tend-insufficient_evidence:transparent;
  }

/* The three comparators. Faint, because the region is the subject and these are
   the reference, but a colour apiece: «which of these grey lines is Switzerland»
   is the first question a chart of twenty-seven grey lines invites. Swiss red,
   a blue for the United States and a lighter red for China — the same three
   identities the rest of the atlas uses. Each is redefined for dark, where a
   dark red on a dark ground would disappear. */
:root{
  /* Every floating scale reads its air from here, in both states. */
  --legend-pad-y:12px; --legend-pad-x:14px;
  --trend-ch:#9E1B32; --trend-us:#2E6FA8; --trend-cn:#E0736B}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){--trend-ch:#E4586E; --trend-us:#7FB6F5; --trend-cn:#F0A79F}
}

:root[data-theme="dark"]{--trend-ch:#E4586E; --trend-us:#7FB6F5; --trend-cn:#F0A79F}

/* The handle's own width plus its margins. Nothing is padded by it any more — it is
     what the legend, the hint and the chart keep clear of, so that the three things a
     reader has to read are never behind the one thing they only have to reach for. */
:root{--navpane-gutter:62px; --navpane-width:430px}

/* Map colours for red-green colour blindness (plan item 86, stage 2; js/atlas/palette.js).
   The risk ramp runs brown (worst) to blue (best), the balance ramps brown for a deficit and
   blue for a surplus. Measured 3 Oct 2026 with the Machado (2009) simulation: every risk pair
   ≥ 32.7 ΔE under deuteranopia and protanopia (the green-to-red ramp: 6.3 under protanopia);
   matching balance steps ≥ 18.3 apart. The tier text clears 5.2:1 on both themes (≥ 6.7:1).
   Only the ramps' own classes change: --tier-r* also marks unrelated amber and stays. */
:root[data-palette="cvd"]{
  --risk-0:#8C3B0F; --risk-1:#E69A3C; --risk-2:#F0E2B6; --risk-3:#8FB8DE; --risk-4:#2B6CB0;
  --surplus-0:#DCE9F5; --surplus-1:#B4D0EA; --surplus-2:#7FAED6; --surplus-3:#3F7DB8; --surplus-4:#1D4E89;
  --deficit-0:#F6E3CF; --deficit-1:#EBC39A; --deficit-2:#D99652; --deficit-3:#B0601F; --deficit-4:#7A3A0C;
  --balance-bar-deficit:#B0601F; --balance-bar-surplus:#2B6CB0;
}

:root[data-palette="cvd"]{--cvd-t0:#7A330D; --cvd-t1:#8A4B10; --cvd-t2:#6B5A1E; --cvd-t3:#2D5E92; --cvd-t4:#1C4E8A}

@media (prefers-color-scheme: dark){
  :root[data-palette="cvd"]:not([data-theme="light"]){--cvd-t0:#F2A574; --cvd-t1:#F0BC73; --cvd-t2:#E0CD8E; --cvd-t3:#A7C6EA; --cvd-t4:#7DB0EC}
}

:root[data-palette="cvd"][data-theme="dark"]{--cvd-t0:#F2A574; --cvd-t1:#F0BC73; --cvd-t2:#E0CD8E; --cvd-t3:#A7C6EA; --cvd-t4:#7DB0EC}
