/* Site-wide frame; audited dashboard and training bodies consume these tokens. */

/* World Map V2: plan 3.2. P3 land-only separation audit: tools/test_map_palette.cjs. */
:root {
    --map-ground: #ebe7dc; --map-far: #dfdbd0; --map-grid: #d6d2c8; --map-grid-major: #c2beb5; --map-axis: #949189;
    --map-label: var(--ink-soft); --map-halo: #1c1a17; --map-halo-alpha: .55; --map-halo-width: 1;
    --map-own: #9f7604; --map-ally: #2380d2; --map-confed: #04aa94; --map-nap: #692ba1;
    --map-war: #883327; --map-natar: #3d342c; --map-neutral: #8f8a80;
    --map-a0: #aaa598; --map-a1: #2a78d6; --map-a2: #eb6834; --map-a3: #1baf7a; --map-a4: #eda100;
    --map-a5: #e87ba4; --map-a6: #008300; --map-a7: #4a3aa7; --map-a8: #e34948;
    --map-wood: #305314; --map-clay: #b4562a; --map-iron: #5a6f88; --map-crop: #b08f00;
    --map-land-outline: rgba(28,26,23,.45); --map-territory-alpha: .20;
}
:root[data-theme="classic"], :root[data-theme="adaptive"] {
    --map-ground: #ebe7dc; --map-far: #dfdbd0; --map-grid: #d6d2c8; --map-grid-major: #c2beb5; --map-axis: #949189; --map-halo: #1c1a17;
}
:root[data-theme="roman"] {
    --map-ground: #efdede; --map-far: #e4d2d2; --map-grid: #dccbcb; --map-grid-major: #c9b7b7; --map-axis: #a08d8d; --map-halo: #321c1c;
}
:root[data-theme="teuton"] {
    --map-ground: #e8dfd0; --map-far: #ddd4c5; --map-grid: #d6cdbe; --map-grid-major: #c3baac; --map-axis: #9b9284; --map-halo: #30271c;
}
:root[data-theme="gaul"] {
    --map-ground: #dde9d8; --map-far: #d1decd; --map-grid: #cad6c5; --map-grid-major: #b7c4b2; --map-axis: #8c9b89; --map-halo: #1d301c;
}
:root[data-theme="egyptian"] {
    --map-ground: #dde5f2; --map-far: #d1dae8; --map-grid: #c9d2e1; --map-grid-major: #b6c0d0; --map-axis: #8b97ab; --map-halo: #192b49;
}
:root[data-theme="hun"] {
    --map-ground: #eee0d4; --map-far: #e3d5c9; --map-grid: #dccdc1; --map-grid-major: #cabaae; --map-axis: #a39185; --map-halo: #3c2418;
}
:root[data-theme="natar"] {
    --map-ground: #e4dbee; --map-far: #d9d0e4; --map-grid: #d2c8dc; --map-grid-major: #c0b6cb; --map-axis: #988ca4; --map-halo: #30203f;
}
:root[data-theme="oasis"] {
    --map-ground: #d6e9e2; --map-far: #cbdfd7; --map-grid: #c3d8d0; --map-grid-major: #b0c6be; --map-axis: #86a097; --map-halo: #183b30;
}
:root[data-theme="highcontrast"] {
    --map-ground: #ffffff; --map-far: #f0f0f0; --map-grid: #e6e6e6; --map-grid-major: #cccccc; --map-axis: #949494;
    --map-halo: #000000; --map-halo-alpha: 1; --map-halo-width: 1.5; --map-natar: #000000; --map-neutral: #5c5c5c; --map-land-outline: #000000;
}
:root[data-theme="dark"], :root[data-theme="obsidian"] {
    --map-halo-alpha: .9; --map-halo-width: 1.2;
    --map-own: #b58b2b; --map-ally: #4490fe; --map-confed: #04aa94; --map-nap: #8a67b4;
    --map-war: #c34f51; --map-natar: #e2d8c6; --map-neutral: #7d7a86;
    --map-a0: #5d5a66; --map-a1: #3987e5; --map-a2: #d95926; --map-a3: #199e70; --map-a4: #c98500;
    --map-a5: #d55181; --map-a6: #008300; --map-a7: #9085e9; --map-a8: #e66767;
    --map-wood: #83b152; --map-clay: #bd6534; --map-iron: #9fb4cb; --map-crop: #e8c547;
    --map-land-outline: rgba(0,0,0,.6); --map-territory-alpha: .26;
}
:root[data-theme="dark"] {
    --map-ground: #26262e; --map-far: #1b1b20; --map-grid: #35353d; --map-grid-major: #47474d; --map-axis: #6b6b71; --map-halo: #111115;
}
:root[data-theme="obsidian"] {
    --map-ground: #1b1e24; --map-far: #131519; --map-grid: #2b2e33; --map-grid-major: #3d4045; --map-axis: #64666a; --map-halo: #0c0e10; --map-a0: #555a63;
}
/* The one piece of the game's skin that is a picture rather than a colour: the
   table header strip. Classic keeps it, coloured and dark themes drop it and let the
   panel colour show, because a fixed light gradient under light text is the one
   thing a token cannot fix. An absolute path also works when an inline page style consumes the token. */
:root { --skin-strip: url("/assets/default/img/a/c2.gif"); }
:root[data-theme="dark"], :root[data-theme="obsidian"], :root[data-theme="highcontrast"] { --skin-strip: none; }
:root {
    color-scheme: light;
    --res-wood-bg: #f4eedf; --res-clay-bg: #f8ece5;
    --res-iron-bg: #edf0f4; --res-crop-bg: #f5f2dc;
    --role-hammer: #8b1e1e; --role-anvil: #315d91;
    --role-hybrid: #6f4590; --role-scout: #3f6a54; --role-siege: #7d5209;
    --good: #426b00;
    --muted: #6d685f;
    --focus: #8a5608;
    --wood: #4b6620; --clay: #8a4726; --iron: #48596e; --crop: #6f5b08;
    --control-line: #827b70;
    --hover: #fffdf9;
}
:root[data-theme="roman"] {
    --rail: #241a1a; --rail-2: #2f2020; --rail-line: #3d2a2a;
    --rail-accent: #d98b8b; --bg: #f5e8e8; --panel: #fff8f7;
    --panel-alt: #f2dddd; --line: #ac7777; --line-soft: #dcc0c0;
    --ink: #321c1c; --ink-soft: #5c3434; --muted: #705050;
    --hover: #ebcccc; --accent: #a11928; --accent-weak: #f2dddd;
    --accent-line: #ac7777; --focus: #a11928; --control-line: #5c3434;
    --res-wood-bg: #f3e8de; --res-clay-bg: #f6e7e2; --res-iron-bg: #efe9ec;
    --res-crop-bg: #f4ebdc; --skin-strip: none;
}
:root[data-theme="teuton"] {
    --rail: #241c16; --rail-2: #30251d; --rail-line: #3e3126;
    --rail-accent: #c9a07c; --bg: #eee6db; --panel: #fcf8ef;
    --panel-alt: #e9dcc6; --line: #a18a66; --line-soft: #d6c7ae;
    --ink: #30271c; --ink-soft: #594833; --muted: #6c5c46;
    --hover: #e1cfb2; --accent: #714316; --accent-weak: #e9dcc6;
    --accent-line: #a18a66; --focus: #714316; --control-line: #594833;
    --res-wood-bg: #f0e8d6; --res-clay-bg: #f3e6da; --res-iron-bg: #ece9e4;
    --res-crop-bg: #f1ead4; --skin-strip: none;
}
:root[data-theme="gaul"] {
    --rail: #18211a; --rail-2: #212c23; --rail-line: #2c382e;
    --rail-accent: #9ec898; --bg: #e4eee1; --panel: #f7fcf3;
    --panel-alt: #d9e9d2; --line: #7d9b73; --line-soft: #bfd1b6;
    --ink: #1d301c; --ink-soft: #3b5736; --muted: #536c4c;
    --hover: #c9dfbf; --accent: #256024; --accent-weak: #d9e9d2;
    --accent-line: #7d9b73; --focus: #256024; --control-line: #3b5736;
    --res-wood-bg: #ebecda; --res-clay-bg: #edebde; --res-iron-bg: #e6eee8;
    --res-crop-bg: #ebefd8; --skin-strip: none;
}
:root[data-theme="dark"] {
    --good-weak: #26301c; --bad-weak: #3a2222;
    color-scheme: dark;
    --bg: #1e1e24; --panel: #2a2a32; --panel-alt: #32323b;
    --ink: #f3efe7; --ink-soft: #d5d0c6; --muted: #b0aba2;
    --line: #65616b; --line-soft: #4a4751;
    --accent: #e0ad52; --accent-weak: #3b3227; --accent-line: #927443;
    --good: #b5d77d; --bad: #ffaba4; --warn: #e9bf79;
    --focus: #e0ad52;
    --res-wood-bg: #373126; --res-clay-bg: #3c2e2b;
    --res-iron-bg: #2c3340; --res-crop-bg: #373621;
    --role-hammer: #e89494; --role-anvil: #8dbbee;
    --role-hybrid: #b996d8; --role-scout: #8fc2a6; --role-siege: #e0b06a;
    --rail: #15151a; --rail-2: #22222a; --rail-ink: #f3efe7; --rail-muted: #b0aab6;
    --rail-line: #35353f; --rail-control-line: #8c8692; --rail-accent: #e0ad52;
    --wood: #a8c47a; --clay: #e0a184; --iron: #9db4cd; --crop: #dcc472;
    --control-line: #8c8692; --hover: #35353f;
}
:root[data-theme="obsidian"] {
    --good-weak: #1e2a1a; --bad-weak: #33211f;
    color-scheme: dark;
    --bg: #15171c; --panel: #1d2026; --panel-alt: #23262d;
    --ink: #eef1f5; --ink-soft: #c7ccd4; --muted: #9aa2ad;
    --line: #39404a; --line-soft: #2a2f37;
    --accent: #8fbce6; --accent-weak: #1d2a36; --accent-line: #3f5e7a;
    --good: #9fd67a; --bad: #ff9a92; --warn: #e9bf79; --focus: #8fbce6;
    --rail: #0f1116; --rail-2: #1a1e25; --rail-ink: #eef1f5; --rail-muted: #9aa2ad;
    --rail-line: #2a2f37; --rail-control-line: #75869a; --rail-accent: #8fbce6;
    --wood: #9fc47f; --clay: #dfa184; --iron: #a8c1d8; --crop: #d9c579;
    --res-wood-bg: #273023; --res-clay-bg: #352923; --res-iron-bg: #242d36; --res-crop-bg: #302e20;
    --role-hammer: #e89494; --role-anvil: #8dbbee;
    --role-hybrid: #b996d8; --role-scout: #8fc2a6; --role-siege: #e0b06a;
    --control-line: #75869a; --hover: #272b33;
}
:root[data-theme="highcontrast"] {
    --good-weak: #e8f5e0; --bad-weak: #fbe9e9;
    --bg: #ffffff; --panel: #ffffff; --panel-alt: #f2f2f2;
    --ink: #000000; --ink-soft: #1a1a1a; --muted: #3a3a3a;
    --line: #000000; --line-soft: #d9d9d9;
    --accent: #6a3a00; --accent-weak: #f4ead7; --accent-line: #6a3a00;
    --good: #274900; --bad: #800000; --warn: #6a3a00; --focus: #000000;
    --rail: #000000; --rail-2: #1a1a1a; --rail-ink: #ffffff; --rail-muted: #d6d6d6;
    --rail-line: #ffffff; --rail-control-line: #ffffff; --rail-accent: #ffcc66;
    --wood: #30450f; --clay: #622a0e; --iron: #26405c; --crop: #514000;
    --res-wood-bg: #f2f2f2; --res-clay-bg: #f2f2f2; --res-iron-bg: #f2f2f2; --res-crop-bg: #f2f2f2;
    --role-hammer: #800000; --role-anvil: #26405c;
    --role-hybrid: #4a2a6a; --role-scout: #1f4a36; --role-siege: #6a4500;
    --control-line: #000000; --hover: #eaeaea;
}
:root[data-theme="egyptian"] {
    --rail: #161b2a; --rail-2: #1f2637; --rail-line: #2b3346;
    --rail-accent: #d9b25f; --bg: #e5ebf6; --panel: #f7f9ff;
    --panel-alt: #dce5f5; --line: #7f99c3; --line-soft: #becde4;
    --ink: #192b49; --ink-soft: #374f75; --muted: #506589;
    --hover: #ccdcf4; --accent: #234fba; --accent-weak: #dce5f5;
    --accent-line: #7f99c3; --focus: #234fba; --control-line: #374f75;
    --res-wood-bg: #ecebe7; --res-clay-bg: #eeeaeb; --res-iron-bg: #e7ecf4;
    --res-crop-bg: #ecede5; --skin-strip: none;
}
:root[data-theme="hun"] {
    --rail: #241a15; --rail-2: #30231c; --rail-line: #3d2e25;
    --rail-accent: #e0956e; --bg: #f4e6dc; --panel: #fff8f1;
    --panel-alt: #f2dcca; --line: #b58a6c; --line-soft: #dfc3af;
    --ink: #3c2418; --ink-soft: #694430; --muted: #7a5944;
    --hover: #eecbb3; --accent: #a33512; --accent-weak: #f2dcca;
    --accent-line: #b58a6c; --focus: #a33512; --control-line: #694430;
    --res-wood-bg: #f3e8d8; --res-clay-bg: #f6e6dc; --res-iron-bg: #efe9e5;
    --res-crop-bg: #f4ead6; --skin-strip: none;
}
:root[data-theme="natar"] {
    --rail: #1d1a24; --rail-2: #26222f; --rail-line: #332d3e;
    --rail-accent: #b9a8e0; --bg: #eae3f2; --panel: #fcf8ff;
    --panel-alt: #e5d9f0; --line: #9e85b7; --line-soft: #cebedf;
    --ink: #30203f; --ink-soft: #554068; --muted: #6c567f;
    --hover: #d8c4e9; --accent: #663494; --accent-weak: #e5d9f0;
    --accent-line: #9e85b7; --focus: #663494; --control-line: #554068;
    --res-wood-bg: #efe7e5; --res-clay-bg: #f1e5e9; --res-iron-bg: #eae8f3;
    --res-crop-bg: #efe9e3; --skin-strip: none;
}
:root[data-theme="oasis"] {
    --rail: #13211d; --rail-2: #1c2c27; --rail-line: #26382f;
    --rail-accent: #7fc9b2; --bg: #dfeee9; --panel: #f4fcf9;
    --panel-alt: #cfe8de; --line: #719e8d; --line-soft: #b1d0c3;
    --ink: #183b30; --ink-soft: #315d4e; --muted: #406555;
    --hover: #bcdecf; --accent: #146b53; --accent-weak: #cfe8de;
    --accent-line: #719e8d; --focus: #146b53; --control-line: #315d4e;
    --res-wood-bg: #e7ecdf; --res-clay-bg: #eaebe3; --res-iron-bg: #e2edec;
    --res-crop-bg: #e8eedd; --skin-strip: none;
}
/* IDs identify appearance only; playable tribes still come from world config.
   Each calculator owns its tribe, so a hidden mode cannot recolor the active one. */
[data-theme="adaptive"] .theme-adaptive[data-tribe="1"] { --accent: #8b1e1e; --accent-weak: #f7eaea; --accent-line: #bd8888; }
[data-theme="adaptive"] .theme-adaptive[data-tribe="2"] { --accent: #8b4513; --accent-weak: #f3e9dd; --accent-line: #b39887; }
[data-theme="adaptive"] .theme-adaptive[data-tribe="3"] { --accent: #2d5a27; --accent-weak: #e6efe4; --accent-line: #8cac86; }
[data-theme="adaptive"] .theme-adaptive[data-tribe="6"] { --accent: #2a52be; --accent-weak: #f3eddc; --accent-line: #b8860b; }
[data-theme="adaptive"] .theme-adaptive[data-tribe="7"] { --accent: #a03816; --accent-weak: #f8e9df; --accent-line: #c46210; }
[data-theme] a:hover { color: var(--accent); }
[data-theme] .ntools-breadcrumb a { color: var(--accent); }
.ntools-theme-picker { margin: 14px 16px 0; padding-block-start: 12px; border-block-start: 1px solid var(--rail-line); font-size: 12px; }
.ntools-theme-picker label { display: block; margin-block-end: 5px; color: var(--rail-muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.ntools-theme-picker select { inline-size: 100%; min-inline-size: 0; min-block-size: 44px; padding: 6px; border: 1px solid var(--rail-control-line); border-radius: 3px; background: var(--rail-2); color: var(--rail-ink); }
.ntools-theme-picker [role="status"] { color: var(--rail-ink); }
@media (max-width: 820px) { .ntools-theme-picker { margin: 8px 12px 10px; padding: 0; border: 0; } }

/* Accent identifies active controls; good/bad retain their numeric meaning. */
.ntools-bg-table thead { background: var(--accent-weak); }
.ntools-tc-panel h3 { border-inline-start: 3px solid var(--accent); padding-inline-start: 8px; }

/* =====================================================================
   Building Guide value map (assets/css/ntools-guide.css).

   Five price bands, cheapest first, and the text that sits on each; the hatching
   for a level that adds nothing; and the grey of a level a village already has.
   Every theme defines all of them, so the map is legible in each. The ramp
   changes LIGHTNESS, not only hue, so it reads without colour vision: in a light
   theme the cheapest band is the darkest, in a dark theme the brightest, and
   either way it is the band that stands out most from the panel.

   Every text/band pair below is at least 4.5:1 - tools/tools/test_guide_ui.cjs
   measures the rendered colours, so an edit that breaks one fails there.
   The adaptive theme uses the Classic values (its accent varies by tribe on a
   scoped element and the ramp does not follow it).
   ===================================================================== */
:root {
    --h0: #7a4b05; --h0t: #ffffff; --h1: #b87a22; --h1t: #1c1a17; --h2: #dcae5c; --h2t: #1c1a17;
    --h3: #efd8a4; --h3t: #1c1a17; --h4: #f8efdc; --h4t: #4a463f;
    --flat: #efece5; --done: #d7d2c6; --done-t: #4a463f;
}
:root[data-theme="dark"] {
    --h0: #f0c06a; --h0t: #1e1e24; --h1: #c2913f; --h1t: #1e1e24; --h2: #7a5c30; --h2t: #f3efe7;
    --h3: #5a4a35; --h3t: #f3efe7; --h4: #3a3530; --h4t: #d5d0c6;
    --flat: #34343d; --done: #4a4751; --done-t: #e3ded5;
}
:root[data-theme="obsidian"] {
    --h0: #9cc4e9; --h0t: #1d2026; --h1: #64819d; --h1t: #000000; --h2: #46586b; --h2t: #eef1f5;
    --h3: #364250; --h3t: #eef1f5; --h4: #2b333d; --h4t: #eef1f5;
    --flat: #272b33; --done: #2c323a; --done-t: #c7ccd4;
}
:root[data-theme="highcontrast"] {
    --h0: #593100; --h0t: #ffffff; --h1: #a38561; --h1t: #000000; --h2: #c9b8a3; --h2t: #000000;
    --h3: #e1d8cc; --h3t: #000000; --h4: #f2ede8; --h4t: #000000;
    --flat: #e4e4e4; --done: #b3b3b3; --done-t: #1a1a1a;
}
:root[data-theme="roman"] {
    --h0: #871522; --h0t: #fff8f7; --h1: #c56e77; --h1t: #000000; --h2: #dda8ac; --h2t: #321c1c;
    --h3: #eccbce; --h3t: #321c1c; --h4: #f7e4e4; --h4t: #321c1c;
    --flat: #e6cdcd; --done: #e6d1d1; --done-t: #5c3434;
}
:root[data-theme="teuton"] {
    --h0: #5f3812; --h0t: #fcf8ef; --h1: #a68868; --h1t: #000000; --h2: #cab7a1; --h2t: #30271c;
    --h3: #e0d4c4; --h3t: #30271c; --h4: #efe8db; --h4t: #30271c;
    --flat: #dfd0b9; --done: #e1d7c6; --done-t: #594833;
}
:root[data-theme="gaul"] {
    --h0: #1f511e; --h0t: #f7fcf3; --h1: #759b73; --h1t: #000000; --h2: #abc4a8; --h2t: #1d301c;
    --h3: #cdddca; --h3t: #1d301c; --h4: #e4eee0; --h4t: #1d301c;
    --flat: #cbdcc3; --done: #d2dfcd; --done-t: #3b5736;
}
:root[data-theme="egyptian"] {
    --h0: #1d429c; --h0t: #f7f9ff; --h1: #7490d4; --h1t: #000000; --h2: #abbce6; --h2t: #192b49;
    --h3: #cdd7f1; --h3t: #192b49; --h4: #e4eaf9; --h4t: #192b49;
    --flat: #ccd8ec; --done: #d3dced; --done-t: #374f75;
}
:root[data-theme="hun"] {
    --h0: #892d0f; --h0t: #fff8f1; --h1: #c67f67; --h1t: #000000; --h2: #deb2a1; --h2t: #3c2418;
    --h3: #edd1c4; --h3t: #3c2418; --h4: #f7e6dd; --h4t: #3c2418;
    --flat: #e8cebb; --done: #e9d7c9; --done-t: #694430;
}
:root[data-theme="natar"] {
    --h0: #562c7c; --h0t: #fcf8ff; --h1: #9f7ebd; --h1t: #000000; --h2: #c6b1d8; --h2t: #30203f;
    --h3: #ded1ea; --h3t: #30203f; --h4: #efe6f5; --h4t: #30203f;
    --flat: #d8cae7; --done: #e0d6e9; --done-t: #554068;
}
:root[data-theme="oasis"] {
    --h0: #115a46; --h0t: #f4fcf9; --h1: #69a292; --h1t: #000000; --h2: #a3c8bd; --h2t: #183b30;
    --h3: #c7dfd8; --h3t: #183b30; --h4: #e0efea; --h4t: #183b30;
    --flat: #bfdbcf; --done: #cde0d9; --done-t: #315d4e;
}

/* =====================================================================
   Village Planner, Compare layouts chart (owner, 2026-10-09: the two lines
   looked alike). Layout A is blue and Layout B orange in every theme: the
   pair colour-blind readers tell apart best, and B is lighter than A in a
   light theme and brighter in a dark one, so they also differ without hue.
   A theme's accent is not used, because it is blue in some themes and
   orange-red in others. Each line is at least 3:1 on the theme's panel, and
   --vp2-on-a/-b is the text on a filled A/B tag (at least 4.5:1).
   tools/tools/test_planner_ui.cjs measures both in every theme.
   ===================================================================== */
:root {
    --vp2-line-a: #1a5fb4; --vp2-line-b: #e8590c; --vp2-on-a: #ffffff; --vp2-on-b: #1c1a17;
}
:root[data-theme="dark"], :root[data-theme="obsidian"] {
    --vp2-line-a: #5aa2f0; --vp2-line-b: #ffb36b; --vp2-on-a: #15171c; --vp2-on-b: #15171c;
}
:root[data-theme="highcontrast"] {
    --vp2-line-a: #0047ab; --vp2-line-b: #b34700; --vp2-on-a: #ffffff; --vp2-on-b: #ffffff;
}
