/* Elect - shared design system. Gold header, navy text, white content panel (the "Classic" site style).

 * SITE STYLES (Settings > Site style; scripts/theme.js sets <html data-theme="..."> before first paint).
 * Twelve styles: classic (default), parchment, ocean, crimson, blossom, meadow (light); dark, midnight, emerald, navy, navysky, ember (dark).
 * Time-travel accounts get purple accents unless Settings > "Use my style colors in time travel" is on (html.tt-own-colors); light/dark backgrounds always carry over.
 * RULES for anything new (owner, 2026-09-28: every style must apply to all future changes):
 *   - Text/surface/border colors come from the theme tokens below (--text, --text-soft, --surface, --surface-2, --panel-bg,
 *     --line, --input-border, --link, --note-bg ...). Never write a raw #hex/white/navy for those in CSS or JS.
 *   - --navy and --gold stay BRAND colors: dark text on the gold header/buttons, navy chips. Do not use --navy as page text.
 *   - New tokens go in :root AND in every html[data-theme] block. New pages load scripts/theme.js in <head>.
 *   - SVG attributes can't use var(); set colors from JS with el.style.fill = "var(--text)" or give the element a CSS class.
 */

:root {
  --gold: #ffbf00;
  --gold-deep: #d99e00;
  --gold-soft: #fff3c4;
  --navy: #0d1b4a;
  --navy-soft: #4a5680;
  --blue: #1f45e0;
  --green: #12a544;
  --red: #d62020;
  --maroon: #8c0f0f;
  --paper: rgba(255, 255, 255, 0.94);
  --radius: 10px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Theme tokens (Classic values) */
  --text: #0d1b4a;
  --text-soft: #4a5680;
  --body-bg: #dfe6f2;
  --login-bg: #fff;
  --surface: #fff;
  --surface-2: #f7f9fd;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-soft: rgba(255, 255, 255, .7);
  --line: #dfe3ee;
  --input-border: #c3cadb;
  --placeholder: #8b93ab;
  --link: #1f45e0;
  --focus: #0d1b4a;
  --note-bg: #eef2ff;
  --tip-bg: #e8f6ee;
  --ok-bg: #e3f6ea;
  --ok-text: #0b6b2b;
  --err-bg: #fde8e8;
  --err-text: #d62020;
  --danger-text: #b31212;
  /* Yes / No buttons (shareholder votes): green and red, or the style's own green/red where the style is one */
  --yes: #1f9d4a; --yes-deep: #0b7a31; --yes-text: #fff;
  --no: #d62020; --no-deep: #9d1010; --no-text: #fff;
  --lean-l: #1f45e0;
  --lean-r: #c21b1b;
  --menu-bg: #fff;
  --menu-text: #0d1b4a;
  --menu-bg-inline: rgba(255, 255, 255, .6);
  --bg-dim: transparent;
  color-scheme: light;
}

/* Parchment: warm light */
html[data-theme="parchment"] {
  --text: #2d2416; --text-soft: #6a5b3f;
  --body-bg: #ece2c9; --login-bg: #f6efdc;
  --surface: #fffdf7; --surface-2: #f6efdc;
  --panel-bg: rgba(255, 251, 240, .9); --panel-soft: rgba(255, 251, 240, .72);
  --line: #e0d5b8; --input-border: #cbbd98; --placeholder: #9a8c6c;
  --link: #8a3d00; --focus: #2d2416;
  --note-bg: #f3ecd6; --tip-bg: #e6efd8;
  --ok-bg: #e2efd3; --ok-text: #2f6b16; --err-bg: #f8e1d8; --err-text: #a31d12; --danger-text: #a31d12;
  --lean-l: #1f45e0; --lean-r: #b3261e;
  --menu-bg: #fffdf7; --menu-text: #2d2416; --menu-bg-inline: rgba(255, 251, 240, .7);
  --gold-soft: #f7e7b0;
}

/* Ocean: cool light with a teal header/accent instead of gold */
html[data-theme="ocean"] {
  --gold: #34c3d6; --gold-deep: #1f95a6; --gold-soft: #d3f2f7;
  --text: #0d2a45; --text-soft: #47637a;
  --body-bg: #dcecf2; --login-bg: #f2fafc;
  --surface: #fff; --surface-2: #f0f9fb;
  --panel-bg: rgba(255, 255, 255, .88); --panel-soft: rgba(255, 255, 255, .72);
  --line: #cde2e8; --input-border: #b3ccd6; --placeholder: #7d97a6;
  --link: #0a5fb5; --focus: #0d2a45;
  --note-bg: #e3f2fa; --tip-bg: #e2f5ec;
  --menu-bg: #fff; --menu-text: #0d2a45;
}

/* Dark: neutral charcoal. The gold header stays (dark text on gold), everything below it goes dark. */
html[data-theme="dark"] {
  color-scheme: dark;
  --text: #e8eaf2; --text-soft: #a7aec4;
  --body-bg: #0f1117; --login-bg: #0f1117;
  --surface: #1a1d27; --surface-2: #222634;
  --panel-bg: rgba(24, 27, 37, .72); --panel-soft: rgba(24, 27, 37, .52);
  --line: #343a4d; --input-border: #4a516a; --placeholder: #7b849c;
  --link: #8fb0ff; --focus: #ffd35a;
  --note-bg: #1d2a4d; --tip-bg: #17352a;
  --ok-bg: #163524; --ok-text: #5fd88a; --err-bg: #3d1a1d; --err-text: #ff8a8a; --danger-text: #ff8a8a;
  --lean-l: #86a6ff; --lean-r: #ff8585;
  --menu-bg: #1a1d27; --menu-text: #e8eaf2; --menu-bg-inline: rgba(26, 29, 39, .92);
  --gold-soft: #3b3520;
  --bg-dim: rgba(6, 8, 14, .6);
}

/* Midnight: deep blue-black */
html[data-theme="midnight"] {
  color-scheme: dark;
  --text: #e6ecff; --text-soft: #a3b3e0;
  --body-bg: #070d1f; --login-bg: #070d1f;
  --surface: #101a38; --surface-2: #16224a;
  --panel-bg: rgba(12, 20, 46, .72); --panel-soft: rgba(12, 20, 46, .52);
  --line: #2a3a6b; --input-border: #3d4f88; --placeholder: #7d8ec0;
  --link: #7fb4ff; --focus: #ffd35a;
  --note-bg: #182a5c; --tip-bg: #10362e;
  --ok-bg: #0f3324; --ok-text: #5fd88a; --err-bg: #3a1830; --err-text: #ff8fa0; --danger-text: #ff8fa0;
  --lean-l: #86b0ff; --lean-r: #ff8f9a;
  --menu-bg: #101a38; --menu-text: #e6ecff; --menu-bg-inline: rgba(16, 26, 56, .92);
  --gold-soft: #33301c;
  --bg-dim: rgba(3, 6, 20, .66);
}

/* Emerald: black with green accents (green header/buttons instead of gold) */
html[data-theme="emerald"] {
  --yes: #22c55e; --yes-deep: #15803d; --yes-text: var(--navy);
  color-scheme: dark;
  --gold: #22c55e; --gold-deep: #15803d; --gold-soft: #10301c;
  --text: #e4f5ea; --text-soft: #92b8a0;
  --body-bg: #050805; --login-bg: #050805;
  --surface: #0d130f; --surface-2: #142019;
  --panel-bg: rgba(8, 13, 10, .73); --panel-soft: rgba(8, 13, 10, .54);
  --line: #223a2b; --input-border: #2f5a40; --placeholder: #6f9581;
  --link: #4ade80; --focus: #4ade80;
  --note-bg: #12281b; --tip-bg: #0f3320;
  --ok-bg: #0f3320; --ok-text: #5fe08f; --err-bg: #3a1a1a; --err-text: #ff8a8a; --danger-text: #ff8a8a;
  --lean-l: #7fb2ff; --lean-r: #ff8585;
  --menu-bg: #0d130f; --menu-text: #e4f5ea; --menu-bg-inline: rgba(13, 19, 15, .92);
  --bg-dim: rgba(0, 4, 1, .68);
}

/* Navy: dark, built on #091747. Gold header kept. */
html[data-theme="navy"] {
  color-scheme: dark;
  --text: #e8edff; --text-soft: #a9b6e6;
  --body-bg: #091747; --login-bg: #091747;
  --surface: #0f2160; --surface-2: #162a72;
  --panel-bg: rgba(9, 23, 71, .72); --panel-soft: rgba(9, 23, 71, .52);
  --line: #2a3d85; --input-border: #3f54a0; --placeholder: #8090c8;
  --link: #8fb8ff; --focus: #ffd35a;
  --note-bg: #1a2f7a; --tip-bg: #10385a;
  --ok-bg: #0f3a35; --ok-text: #5fd88a; --err-bg: #3d1a3a; --err-text: #ff8fa0; --danger-text: #ff8fa0;
  --lean-l: #8fb3ff; --lean-r: #ff8f9a;
  --menu-bg: #0f2160; --menu-text: #e8edff; --menu-bg-inline: rgba(15, 33, 96, .92);
  --gold-soft: #2f3160;
  --bg-dim: rgba(2, 6, 28, .5);
}

/* Navy Sky: same #091747 base with a sky-blue header/accent instead of gold */
html[data-theme="navysky"] {
  color-scheme: dark;
  --gold: #4cc9f0; --gold-deep: #2a9bc4; --gold-soft: #123a68;
  --text: #e8f4ff; --text-soft: #a3bddf;
  --body-bg: #091747; --login-bg: #091747;
  --surface: #0e2158; --surface-2: #14296a;
  --panel-bg: rgba(9, 23, 71, .72); --panel-soft: rgba(9, 23, 71, .52);
  --line: #254a8a; --input-border: #3a6098; --placeholder: #7f9ac4;
  --link: #6fd6ff; --focus: #4cc9f0;
  --note-bg: #123a68; --tip-bg: #0f3d52;
  --ok-bg: #0f3a35; --ok-text: #5fd88a; --err-bg: #3d1a3a; --err-text: #ff8fa0; --danger-text: #ff8fa0;
  --lean-l: #8fb3ff; --lean-r: #ff8f9a;
  --menu-bg: #0e2158; --menu-text: #e8f4ff; --menu-bg-inline: rgba(14, 33, 88, .92);
  --bg-dim: rgba(2, 6, 28, .5);
}

/* Crimson: light with a red header/accent */
html[data-theme="crimson"] {
  --no: #ee5253; --no-deep: #c0282b; --no-text: var(--navy);
  --gold: #ee5253; --gold-deep: #c0282b; --gold-soft: #fbd9d9;
  --text: #3a0f14; --text-soft: #7a4a50;
  --body-bg: #f6e0e0; --login-bg: #fff6f6;
  --surface: #fff; --surface-2: #fdf1f1;
  --panel-bg: rgba(255, 255, 255, .88); --panel-soft: rgba(255, 255, 255, .72);
  --line: #ecd0d0; --input-border: #d9b3b5; --placeholder: #a58487;
  --link: #b3141c; --focus: #3a0f14;
  --note-bg: #fbe9e9; --tip-bg: #e8f6ee;
  --menu-bg: #fff; --menu-text: #3a0f14;
}

/* Blossom: light with a pink header/accent */
html[data-theme="blossom"] {
  --gold: #f78fb3; --gold-deep: #d6537f; --gold-soft: #fde0ea;
  --text: #3d1030; --text-soft: #7d4d6c;
  --body-bg: #f9e3ee; --login-bg: #fff6fa;
  --surface: #fff; --surface-2: #fdf1f6;
  --panel-bg: rgba(255, 255, 255, .88); --panel-soft: rgba(255, 255, 255, .72);
  --line: #efd2e0; --input-border: #dbb3c7; --placeholder: #a8869a;
  --link: #a8246a; --focus: #3d1030;
  --note-bg: #fbe8f1; --tip-bg: #e8f6ee;
  --menu-bg: #fff; --menu-text: #3d1030;
}

/* Meadow: light with a green header/accent */
html[data-theme="meadow"] {
  --yes: #5fcf80; --yes-deep: #2e9b54; --yes-text: var(--navy);
  --gold: #5fcf80; --gold-deep: #2e9b54; --gold-soft: #d8f3e0;
  --text: #0f3320; --text-soft: #4a6f58;
  --body-bg: #e0f0e4; --login-bg: #f4fbf6;
  --surface: #fff; --surface-2: #f1f9f3;
  --panel-bg: rgba(255, 255, 255, .88); --panel-soft: rgba(255, 255, 255, .72);
  --line: #cfe3d5; --input-border: #b3cfbc; --placeholder: #7e9d89;
  --link: #11703a; --focus: #0f3320;
  --note-bg: #e3f4e9; --tip-bg: #e2f5ec;
  --menu-bg: #fff; --menu-text: #0f3320;
}

/* Ember: dark with a red header/accent */
html[data-theme="ember"] {
  --no: #ef4444; --no-deep: #b91c1c; --no-text: var(--navy);
  color-scheme: dark;
  --gold: #ef4444; --gold-deep: #b91c1c; --gold-soft: #3d1517;
  --text: #fbe9e9; --text-soft: #c9a0a0;
  --body-bg: #120708; --login-bg: #120708;
  --surface: #1e0d0f; --surface-2: #2a1215;
  --panel-bg: rgba(24, 9, 11, .72); --panel-soft: rgba(24, 9, 11, .52);
  --line: #4a2327; --input-border: #6b3338; --placeholder: #a07378;
  --link: #ff8f8f; --focus: #ff8f8f;
  --note-bg: #321519; --tip-bg: #17352a;
  --ok-bg: #163524; --ok-text: #5fd88a; --err-bg: #4a1519; --err-text: #ffa0a0; --danger-text: #ffa0a0;
  --lean-l: #86a6ff; --lean-r: #ff8585;
  --menu-bg: #1e0d0f; --menu-text: #fbe9e9; --menu-bg-inline: rgba(30, 13, 15, .92);
  --bg-dim: rgba(14, 2, 3, .6);
}

/* Time-travel accounts (shell.js, from /me's isTimeTravel): the header and every other gold UI element (buttons,
 * stat labels, tags, dividers...) recolor to purple instead of the main game's gold, since they all key off these
 * three variables. Declared AFTER the site styles so purple wins over Ocean's teal (same specificity, later wins). */
html.tt-theme:not(.tt-own-colors) {
  /* A midpoint purple (owner, 2026-09-27): the first pass (#d000ff) only cleared ~4:1 contrast against the navy
   * text that sits directly on --gold (header nav links, buttons) - under the 4.5:1 normal-text minimum, so it read
   * as hard to read; the next pass (#d68cff) fixed that but came back "a little too light." This splits the
   * difference - still a clearly saturated purple, not a pastel, but clears ~5:1 against navy (#0d1b4a). */
  --gold: #d356fa;
  --gold-deep: #a945c8;
  --gold-soft: #f6ddfe;
}
html.tt-theme:not(.tt-own-colors)[data-theme="parchment"], html.tt-theme:not(.tt-own-colors)[data-theme="crimson"], html.tt-theme:not(.tt-own-colors)[data-theme="blossom"], html.tt-theme:not(.tt-own-colors)[data-theme="meadow"] { --gold-soft: #f6ddfe; }
html.tt-theme:not(.tt-own-colors)[data-theme="dark"], html.tt-theme:not(.tt-own-colors)[data-theme="midnight"], html.tt-theme:not(.tt-own-colors)[data-theme="emerald"], html.tt-theme:not(.tt-own-colors)[data-theme="navy"], html.tt-theme:not(.tt-own-colors)[data-theme="navysky"], html.tt-theme:not(.tt-own-colors)[data-theme="ember"] { --gold-soft: #3d2848; }

/* Dark styles dim the page-background photos/gradients behind the panels. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-dim); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 15px/1.5 var(--font);
  color: var(--text);
  background: var(--body-bg) fixed;
}

/* Page backgrounds. Gradients stand in for the photos used on the Bubble site. */
body[data-bg="login"]    { background: var(--login-bg); }
body[data-bg="storm"]    { background: linear-gradient(135deg, #7b1d3a, #3a1c5c) fixed; }
body[data-bg="capitol"]  { background: linear-gradient(#cfe0f2, #9fbbdc) fixed; }
body[data-bg="state"]    { background: linear-gradient(#4f86cc, #cddcec) fixed; }
body[data-bg="ballot"]   { background: linear-gradient(135deg, #1b2340, #5b6b9a) fixed; }

h1 { margin: 0 0 .75rem; text-align: center; font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; line-height: 1.15; }
h2 { margin: 1.5rem 0 .5rem; text-align: center; font-size: 1.5rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--link); }
.muted { color: var(--text-soft); }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--gold);
  box-shadow: 0 2px 8px rgba(13, 27, 74, .25);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  max-width: 1400px; margin: 0 auto; padding: .4rem 1rem;
}
.brand { display: flex; flex: none; }
/* multiply drops the logo's white background so it sits cleanly on the gold bar */
.brand img { height: 68px; width: auto; display: block; mix-blend-mode: multiply; }

/* Player stats: navy chips so they read as status, not navigation */
.stats { display: flex; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.stat {
  min-width: 82px; padding: .3rem .7rem .35rem;
  border-radius: 10px; background: var(--navy); cursor: help;
}
.stat-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--gold); }
.stat-value { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; color: #fff; }
.stat-bar { display: block; height: 3px; margin-top: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.stat-bar i { display: block; height: 100%; border-radius: 2px; background: var(--gold); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border: 0; border-radius: 8px;
  background: rgba(13, 27, 74, .12); color: var(--navy); cursor: pointer;
}
.nav { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 1rem; }
.nav-main, .nav-user { display: flex; align-items: center; gap: .25rem; }

.nav a, .nav button.nav-link {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px;
  padding: .4rem .85rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--navy);
  font: 600 15px var(--font); text-decoration: none; cursor: pointer;
}
.nav a:hover, .nav button.nav-link:hover { background: rgba(13, 27, 74, .12); }
.nav [aria-current="page"], .nav .is-current { background: rgba(13, 27, 74, .12); box-shadow: inset 0 -3px 0 var(--navy); }
.menu [aria-current="page"] { box-shadow: none; background: var(--gold-soft); color: var(--menu-text); }
.nav [aria-expanded="true"] { background: rgba(13, 27, 74, .18); }
.nav-item { position: relative; }
.caret { transition: transform .15s ease; }
[aria-expanded="true"] > .caret { transform: rotate(180deg); }

.icon-btn { position: relative; width: 44px; padding: 0 !important; justify-content: center; }
.icon-label { display: none; }
.badge {
  position: absolute; top: 3px; right: 2px; display: grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

.account-btn { background: #fff !important; padding-left: .4rem !important; }
.account-btn:hover { background: var(--gold-soft) !important; }
.avatar-sm {
  display: grid; place-items: center; position: relative; overflow: hidden; width: 32px; height: 32px; border-radius: 8px;
  background: var(--navy); color: var(--gold); font-size: 12px; font-weight: 700;
}
/* A picture that isn't square (e.g. a tall portrait crop) needs position:absolute to be cropped and centered reliably -
   percentage height alone doesn't resolve against a non-stretched grid item in every browser, so it was rendering at
   its natural height and spilling out of the circle/card below it. */
.avatar-sm img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.menu {
  display: none; position: absolute; top: calc(100% + .5rem); left: 50%; transform: translateX(-50%);
  width: min(320px, 92vw); padding: .75rem;
  background: var(--menu-bg); color: var(--menu-text); border-radius: 14px; box-shadow: 0 12px 32px rgba(13, 27, 74, .3);
}
.menu--right { left: auto; right: 0; transform: none; width: min(240px, 92vw); }
.menu.is-open { display: block; }
.menu-group + .menu-group { margin-top: .5rem; padding-top: .5rem; border-top: 3px solid var(--gold); }
.menu-group h3 { margin: 0 0 .25rem; padding: 0 .85rem; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.menu a { display: flex; width: 100%; color: var(--menu-text); }
.menu a:hover { background: var(--gold-soft) !important; }
.menu-sep { height: 1px; margin: .35rem 0; background: var(--line); }
.menu a.is-danger { color: var(--danger-text); }

@media (max-width: 1100px) {
  /* An open menu can be taller than the phone screen. The header is sticky, so let it scroll
     inside itself instead of pushing the links below it off-screen. */
  .site-header { max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .header-inner { flex-wrap: wrap; row-gap: .25rem; }
  .brand img { height: 56px; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .5rem; padding-bottom: .5rem; }
  .nav.is-open { display: flex; }
  .nav-main, .nav-user { flex-direction: column; align-items: stretch; }
  .nav-user { padding-top: .5rem; border-top: 2px solid rgba(13, 27, 74, .2); }
  .menu, .menu--right { position: static; transform: none; width: 100%; margin-top: .25rem; box-shadow: none; background: var(--menu-bg-inline); }
  .icon-btn { width: auto; padding: 0 .85rem !important; justify-content: flex-start; }
  .badge { position: static; }
  .icon-label { display: inline; }
}
@media (max-width: 480px) {
  .stat { min-width: 0; padding: .25rem .5rem .3rem; }
  .stats { gap: .35rem; }
}

/* ---------- Layout ---------- */
.page  { max-width: 960px; margin: 1rem auto 3rem; padding-inline: 1rem; }
.panel { padding: 1.5rem 1.25rem 2rem; background: var(--panel-bg); border-radius: 14px; box-shadow: 0 8px 28px rgba(13, 27, 74, .18); }
.rule  { width: 320px; max-width: 80%; height: 4px; margin: 1.25rem auto; background: var(--gold); border-radius: 4px; }
.stack > * + * { margin-top: 1rem; }
.row[role="tablist"] .btn { white-space: nowrap; } /* same one-line height for every View button, no taller than needed */
.row   { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.25rem;
  border: 0; border-radius: var(--radius);
  background: var(--gold); color: var(--navy);
  font: 600 15px/1.25 var(--font); text-align: center; text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-deep);
  transition: transform .08s ease, box-shadow .08s ease;
}
/* Text inside a colored button/chip must follow the button's own text color: --text-soft/--link are light in the dark
 * styles and vanish on the gold/colored fill. */
.btn .meta, .btn small, .btn .person-link, .btn a, .status--gold .meta, .status--gold small { color: inherit; }
.btn .meta { opacity: .75; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--gold-deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .nav a:focus-visible, .nav button:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.btn--navy  { background: var(--navy); color: #fff; box-shadow: 0 0 0 3px var(--blue); min-width: 190px; }
.btn--navy:hover { box-shadow: 0 0 0 3px var(--blue), 0 4px 10px rgba(13, 27, 74, .35); }
.btn--green { background: var(--green); color: #fff; box-shadow: 0 3px 0 #0b7a31; }
.btn--red   { background: var(--red);   color: #fff; box-shadow: 0 3px 0 #9d1010; }
.btn--blue  { background: var(--blue);  color: #fff; box-shadow: 0 3px 0 #16309e; }
.btn--yes { background: var(--yes); color: var(--yes-text); box-shadow: 0 3px 0 var(--yes-deep); }
.btn--no  { background: var(--no);  color: var(--no-text);  box-shadow: 0 3px 0 var(--no-deep); }
.btn--yes:hover { box-shadow: 0 4px 0 var(--yes-deep); }
.btn--yes:active { box-shadow: 0 1px 0 var(--yes-deep); }
.btn--no:hover { box-shadow: 0 4px 0 var(--no-deep); }
.btn--no:active { box-shadow: 0 1px 0 var(--no-deep); }
.btn--maroon{ background: var(--maroon);color: #fff; box-shadow: 0 3px 0 #5e0808; }
.btn--block { width: 100%; }
.btn.election-toggle { width: 340px; max-width: 100%; }

/* ---------- Content pieces ---------- */
.facts { align-items: center; display: grid; grid-template-columns: 1fr auto; gap: .15rem 1.5rem; max-width: 460px; margin: 1rem auto; font-size: 14px; }
.facts dt { margin: 0; text-align: left; color: var(--text-soft); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }
/* Facts whose values carry long explanations (treasury, taxes): wider, label column sized to its text, values left-aligned and top-aligned so wrapped lines stay readable. */
.facts.facts--wide { max-width: 760px; grid-template-columns: minmax(11rem, max-content) 1fr; align-items: start; gap: .35rem 1.5rem; }
.facts.facts--wide dt, .facts.facts--wide dd { display: block; min-height: 0; text-align: left; justify-content: flex-start; }
.facts.facts--wide dd { font-weight: 500; }
/* Info tip: a small "?" button whose explanation opens on hover, keyboard focus or tap. Used for formulas. */
.info-tip { position: relative; display: inline-block; margin-left: .35rem; vertical-align: middle; }
.info-tip__btn { width: 1.15rem; height: 1.15rem; padding: 0; border: 1px solid var(--input-border); border-radius: 50%; background: var(--surface); color: var(--text-soft); font: 700 .75rem/1 var(--font); cursor: help; }
.info-tip__btn:hover, .info-tip__btn:focus-visible { border-color: var(--focus); color: var(--text); }
.info-tip__body { display: none; position: absolute; z-index: 20; top: 1.6rem; left: 50%; transform: translateX(-50%); width: 22rem; max-width: 80vw; padding: .6rem .75rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .25); font: 400 13px/1.45 var(--font); text-align: left; white-space: normal; }
.info-tip--end .info-tip__body { left: auto; right: 0; transform: none; }
.info-tip:hover .info-tip__body, .info-tip:focus-within .info-tip__body { display: block; }
.info-tip__body code { display: block; margin: .3rem 0; padding: .3rem .4rem; background: var(--surface-2); border-radius: 4px; font-size: 12.5px; white-space: pre-wrap; }
/* Taxes table: tax | rate | share of GDP raised | money raised | growth cost. Numbers right-aligned in aligned columns; the total sits under a heavier rule. */
.tax-table-wrap { margin: .75rem 0 1rem; } /* no overflow scrolling here: it would clip the info-tip popovers */
.tax-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 14px; }
.tax-table th, .tax-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.tax-table thead th { color: var(--text-soft); font-weight: 600; font-size: 13px; border-bottom: 2px solid var(--line); vertical-align: bottom; }
.tax-table tbody th { font-weight: 600; }
.tax-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tax-table tbody tr:nth-child(even) { background: var(--surface-2); }
.tax-table tfoot th, .tax-table tfoot td { border-top: 2px solid var(--text); border-bottom: 0; font-weight: 700; }
@media (max-width: 640px) { .tax-table { font-size: 13px; } .tax-table th, .tax-table td { padding: .35rem .3rem; } .tax-table .num { white-space: normal; } }
.tax-warn { margin-top: .15rem; font-weight: 400; font-size: 12.5px; color: var(--danger-text); white-space: normal; }
/* Breakdown table (what drives GDP growth): label | signed value | plain-language reason. */
.driver-table { width: 100%; max-width: 760px; margin: .75rem auto 1rem; border-collapse: collapse; font-size: 14px; }
.driver-table th, .driver-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.driver-table th { font-weight: 600; width: 28%; }
.driver-table td.num { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; width: 6.5rem; }
.driver-table td.num.pos { color: var(--ok-text); }
.driver-table td.num.neg { color: var(--danger-text); }
.driver-table td.why { color: var(--text-soft); }
.driver-table tr.total th, .driver-table tr.total td { border-top: 2px solid var(--text); border-bottom: 0; font-size: 15px; }
@media (max-width: 640px) {
  .facts.facts--wide { grid-template-columns: 1fr; }
  .driver-table, .driver-table tbody, .driver-table tr, .driver-table th, .driver-table td { display: block; width: auto; }
  .driver-table tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .driver-table th, .driver-table td { border: 0; padding: .1rem .2rem; }
  .driver-table td.num { text-align: left; width: auto; }
}
.facts .party-link, .facts .person-link, .facts .country-link { margin-block: 0; }
.facts .party-link { justify-content: flex-end; }
.facts #p-fparty-label { white-space: nowrap; }
.facts #p-fparty .party-link { flex-wrap: nowrap; }
.facts dd .pic--party { margin-block: 0; }
/* Every row is the same height whether or not it holds a picture (party logo, religion icon), so the spacing is even. */
.facts dt, .facts dd { min-height: 28px; display: flex; align-items: center; }
.facts dd { justify-content: flex-end; }
.facts dd .party-dot, .facts dd .pic--party { width: 26px !important; height: 26px !important; }

.identity { text-align: center; }
.identity .avatar { width: 200px; max-width: 60%; aspect-ratio: 1; margin: .5rem auto; border-radius: 12px; }
.tier { font-weight: 700; letter-spacing: .04em; color: var(--ok-text); }
.verified { color: var(--ok-text); font-weight: 600; }

.avatar {
  display: grid; place-items: center; flex: none; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--gold), #c98a00); color: var(--navy);
  font-weight: 700; border-radius: 10px;
}

.party { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.party-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; position: relative; overflow: hidden; }
.party-dot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.party-dot--r { background: var(--red); }
.party-dot--d { background: var(--blue); }
.party-dot--c { background: #7a3fb5; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.75rem 1.5rem; margin: 1.5rem 0; }
.action { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; font-size: 14px; }
.action .btn { width: 100%; max-width: 260px; min-height: 5rem; } /* the four player actions stay the same height even when their text wraps to different line counts */

.field { display: grid; gap: .35rem; margin-bottom: 1rem; text-align: left; }
.field label { font-weight: 600; font-size: 14px; }
input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%; min-height: 44px; padding: .5rem .75rem;
  border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
input::placeholder { color: var(--placeholder); }
.check { display: flex; align-items: center; gap: .5rem; font-size: 14px; }

.card { position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
/* The AI pill sits in the same spot on every card: the top-right corner. (Outside cards it stays after the name; in list rows it goes to the far right.) */
.card .tag--ai { position: absolute; top: .5rem; right: .5rem; margin: 0; }
.card:has(.tag--ai) { padding-right: 3rem; }
.card .list-row .tag--ai, .list-row .tag--ai { position: static; margin-left: auto; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.member { display: flex; align-items: center; gap: .75rem; }
.member .avatar { width: 44px; height: 44px; }
.member strong { display: block; line-height: 1.2; }
.member small { color: var(--text-soft); display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .3rem; margin-top: .25rem; }
/* a little breathing room around the larger pictures next to names */
.person-link, .party-link, .country-link { margin-block: .1rem; }
.tag { margin-left: .25rem; padding: 0 .35rem; border-radius: 4px; background: var(--gold-soft); font-size: 11px; font-weight: 700; vertical-align: middle; }

.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1rem; text-align: center; }
.leaders .role { font-size: 13px; color: var(--text-soft); }
/* Leadership / presidency cards: bigger picture and text for higher offices */
.leader-card .role { margin-bottom: .35rem; }
.leader-card .person-link { gap: .6rem; font-size: 1em; }
.leader-card--low strong { font-size: 1.05rem; }
.leader-card--mid .role { font-size: 14px; }
.leader-card--mid strong { font-size: 1.2rem; }
.leader-card--top { padding-block: 1.25rem; }
.leader-card--top .role { font-size: 16px; margin-bottom: .6rem; }
.leader-card--top strong { font-size: 1.7rem; line-height: 1.2; }
.leader-card--top .person-link { gap: 1rem; }

.map-box {
  display: grid; place-items: center; max-width: 380px; aspect-ratio: 1; margin: 1rem auto;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--panel-soft);
  color: var(--text-soft); font-size: 14px;
}

.countdown { text-align: center; font-size: 18px; font-weight: 600; margin-bottom: .75rem; }
.candidate { display: grid; gap: .75rem; margin: 1rem auto; max-width: 560px; }
.candidate-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.candidate-head .avatar { width: 64px; height: 64px; font-size: 24px; }
.candidate-head .who { flex: 1 1 180px; }
/* Organisation logos (interest groups): transparent and often wide, so show the whole image on white instead of a cropped one on the gold tile. */
.candidate-head .avatar--logo { width: 96px; height: 64px; background: #fff; border: 1px solid var(--line); }
.avatar.avatar--logo img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; border-radius: 0; }
.ev { font-weight: 700; }
.ev-bar { display: flex; height: 14px; max-width: 560px; margin: 1rem auto; overflow: hidden; border-radius: 7px; background: var(--line); }
.ev-bar span { display: block; height: 100%; }

.login-wrap { display: grid; place-items: start center; padding: 2rem 1rem 3rem; }
.login-logo { width: min(240px, 60vw); height: auto; margin-bottom: 1.5rem; }
.login-card { width: min(420px, 100%); padding: 1.5rem; background: var(--surface); border-radius: 14px; box-shadow: 0 8px 30px rgba(13, 27, 74, .18); }
.login-card .btn { width: 100%; }
.login-links { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .25rem 0 1rem; font-size: 14px; }
.login-alt { margin-top: 1rem; text-align: center; font-size: 14px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- More page backgrounds (gradients stand in for Bubble's photos) ---------- */
body[data-bg="flag"]    { background: linear-gradient(135deg, #0a2a6b, #a31d2f) fixed; }
body[data-bg="law"]     { background: linear-gradient(#0f2a5f, #6b7ba3) fixed; }
body[data-bg="money"]   { background: linear-gradient(135deg, #2f5a3c, #a9c28a) fixed; }
body[data-bg="paper"]   { background: linear-gradient(#7d7d7d, #d6d6d6) fixed; }
body[data-bg="market"]  { background: linear-gradient(135deg, #3b3a2f, #c9a227) fixed; }
body[data-bg="prison"]  { background: linear-gradient(#454a52, #9aa0a6) fixed; }
body[data-bg="navy"]    { background: #10193a fixed; }
body[data-bg="floral"]  { background: linear-gradient(135deg, #a13a5a, #5e8f5a) fixed; }
body[data-bg="un"]      { background: linear-gradient(#4b78b3, #b7cde6) fixed; }
body[data-bg="fire"]    { background: linear-gradient(#4a0f00, #e07b00) fixed; }
body[data-bg="glass"]   { background: linear-gradient(135deg, #1e3a8a, #b45309) fixed; }
body[data-bg="space"]   { background: linear-gradient(135deg, #0b0620, #3a1c5c) fixed; }
body[data-bg="plain"]   { background: linear-gradient(#dfe6f2, #b5c3dc) fixed; }

/* ---------- State tile map ---------- */
.tile-map { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; max-width: 660px; margin: 1rem auto; }
.tile {
  grid-column: var(--c); grid-row: var(--r); aspect-ratio: 1; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 6px; background: var(--tile, #5f7aa3); color: #fff;
  font: 700 clamp(9px, 1.7vw, 14px)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .08s ease;
}
.tile:hover, .tile:focus-visible { transform: scale(1.14); z-index: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); outline: 2px solid var(--focus); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: center; margin: .5rem 0 1rem; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: .35rem; border-radius: 3px; vertical-align: -1px; }

/* ---------- Real US map (scripts/us-geomap.js, vendor Simplemaps library) ---------- */
.us-map { max-width: 700px; min-height: 260px; margin: 1rem auto; }
.us-map svg { max-width: 100%; height: auto; }

/* ---------- Real world map (scripts/world-geomap.js, vendor jsvectormap library) ---------- */
.world-map { max-width: 960px; width: 100%; aspect-ratio: 1000 / 647; margin: 1rem auto; }
.world-map .jvm-tooltip { background: var(--navy); color: #fff; font-family: var(--font); font-size: 13px; }
.world-map .jvm-zoom-btn { background: var(--navy); }
.world-map .jvm-zoom-btn:hover { background: var(--navy-soft); }

/* ---------- Lists, toolbars, misc ---------- */
.list { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.eo-actions { display: flex; gap: .5rem; margin-left: auto; flex: none; }
.list-row .grow { flex: 1 1 200px; min-width: 0; }
.list-row .meta { color: var(--text-soft); font-size: 14px; }
#richest { padding: 0 1rem 1rem; } /* the section headings and the "Richest players in ..." note sit directly in this card, so they need their own inset */
.icon-tile { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--gold-soft); font-size: 24px; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; align-items: flex-end; }
.toolbar .field { margin: 0; flex: 1 1 200px; max-width: 320px; }
/* Country actions: one button per line, all the same width. */
.toolbar--stack { flex-direction: column; align-items: center; }
.toolbar--stack .btn { width: 300px; max-width: 100%; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--text-soft); border: 2px dashed var(--line); border-radius: 12px; background: var(--panel-soft); }
.lean--l { color: var(--lean-l); font-weight: 600; }
.lean--r { color: var(--lean-r); font-weight: 600; }
.lean--c { color: var(--text-soft); font-weight: 600; }
.masthead { margin: 0; text-align: center; font: 700 1.35rem/1.1 Georgia, "Times New Roman", serif; }
.masthead--outlet { font-size: 1.9rem; }
.unread { border-left: 4px solid var(--gold); }
.money { font-variant-numeric: tabular-nums; }
.wide-map { display: grid; place-items: center; min-height: 260px; margin: 1rem auto; border: 2px dashed var(--line); border-radius: 12px; background: var(--panel-soft); color: var(--text-soft); }

/* Selected tab button (Congress, The Law, Market) */
.btn--navy[aria-selected="true"] { background: var(--blue); box-shadow: 0 0 0 3px var(--navy), 0 0 0 5px var(--gold); }

/* Messages under forms and after actions. */
.form-error { margin: 0 0 .75rem; color: var(--err-text); font-weight: 600; }
.form-note { margin: 0 0 .75rem; color: var(--text-soft); }
.flash { max-width: 560px; margin: .75rem auto; padding: .6rem .9rem; border-radius: var(--radius); font-weight: 600; text-align: center; }
.flash--ok { background: var(--ok-bg); color: var(--ok-text); }
.flash--error { background: var(--err-bg); color: var(--err-text); }
/* position:absolute (not just width/height:100%) so a non-square picture is reliably cropped and centered - percentage
   height on its own doesn't resolve consistently against a non-stretched grid item (place-items:center on .avatar). */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field textarea { width: 100%; padding: .55rem .7rem; font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); resize: vertical; }
.records { max-width: 760px; margin: 1rem auto 0; text-align: left; overflow-x: auto; }
.records h3 { margin: 0 0 .5rem; text-align: center; }
.records table { width: 100%; border-collapse: collapse; font-size: 14px; }
.records th, .records td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.records--mid td { vertical-align: middle; padding: .6rem .5rem; }
.records th { color: var(--text-soft); font-weight: 600; white-space: nowrap; }

/* ---------- Congress ---------- */
.hemicycle { display: block; width: 100%; max-width: 640px; margin: .5rem auto; }
.hemicycle-total { font: 700 30px var(--font); fill: var(--text); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.25rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: 14px; }
/* Legend buttons (the Law page's district buttons): all the same width */
.legend .btn { width: 190px; max-width: 100%; min-width: 0; }
.legend li { display: flex; align-items: center; gap: .4rem; }
.legend i { width: 12px; height: 12px; border-radius: 50%; }
.seat-table { display: flex; flex-wrap: wrap; gap: .35rem; }
.seat-chip { display: inline-block; padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; color: var(--text); text-decoration: none; }
.seat-chip:hover { border-color: var(--gold-deep); }
.seat-chip--gap { border-color: var(--gold-deep); background: var(--gold-soft); }
.bill { display: grid; gap: .6rem; }
.bill-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.bill-name { font-size: 1.05rem; }
.status { padding: .1rem .55rem; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy-soft); }
.status--green { background: var(--green); }
.status--red { background: var(--red); }
.status--gold { background: var(--gold); color: var(--navy); }
.status--grey { background: #6f7893; }
.tallies { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.tally-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .75rem; font-size: 14px; }
.tally-bar { display: flex; height: 12px; margin-top: .25rem; overflow: hidden; border-radius: 6px; background: var(--line); }
.bill-detail { padding-top: .5rem; border-top: 1px solid var(--line); font-size: 14px; }
.bill-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts-list { margin: .5rem 0; padding-left: 1.25rem; }
.vote-block h4 { margin: .75rem 0 .25rem; }
.vote-row { margin-top: .25rem; }
.voters { overflow-wrap: anywhere; }
.meta { color: var(--text-soft); font-size: 14px; }
[aria-pressed="true"].btn--navy { background: var(--blue); }
input[type="search"] { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }

/* BBCode text (bills, laws, executive orders) */
.bbcode { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.bbcode h2, .bbcode h3, .bbcode h4, .bbcode h5 { margin: .75rem 0 .25rem; line-height: 1.25; }
.bbcode h2 { font-size: 1.3rem; } .bbcode h3 { font-size: 1.15rem; } .bbcode h4 { font-size: 1.05rem; } .bbcode h5 { font-size: 1rem; }
.bbcode ul, .bbcode ol { margin: .4rem 0; padding-left: 1.5rem; white-space: normal; }
.bbcode li { white-space: pre-wrap; }
.bbcode blockquote { margin: .5rem 0; padding: .25rem .75rem; border-left: 4px solid var(--gold); color: var(--text-soft); }
.bbcode hr { border: 0; border-top: 1px solid var(--line); }
.eo-text { flex: 1 1 100%; }
.eo-text .bill-detail { border-top: 1px solid var(--line); margin-top: .25rem; }
.bbcode h2, .bbcode h3, .bbcode h4, .bbcode h5 { text-align: left; }

/* Rich text (BBCode) editor */
.bbeditor { border: 1px solid var(--input-border); border-radius: 10px; background: var(--surface); text-align: left; }
.bbeditor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 10px 10px 0 0; }
.bbeditor-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 .5rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.bbeditor-btn:hover { background: var(--gold-soft); }
.bbeditor-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.bbeditor-color { position: relative; overflow: hidden; }
.bbeditor-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bbeditor-select { height: 34px; min-height: 34px; width: auto; padding: 0 .4rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--text); font: 14px var(--font); }
.bbeditor-sep { width: 1px; height: 22px; margin: 0 .2rem; background: var(--line); }
.bbeditor-toggle { margin-left: auto; }
.bbeditor-area, .bbeditor-source { display: block; width: 100%; min-height: 220px; max-height: 60vh; padding: .75rem; overflow: auto; border: 0; outline: 0; font: 15px/1.55 var(--font); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.bbeditor-area h2, .bbeditor-area h3, .bbeditor-area h4, .bbeditor-area h5 { margin: .75rem 0 .25rem; text-align: left; }
.bbeditor-area ul, .bbeditor-area ol { margin: .4rem 0; padding-left: 1.5rem; white-space: normal; }
.bbeditor-area li { white-space: pre-wrap; }
.bbeditor-source { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; resize: vertical; border-radius: 0 0 10px 10px; }
.bbeditor:focus-within { border-color: var(--link); box-shadow: 0 0 0 2px rgba(31, 69, 224, .2); }
.bbeditor-count { padding: .25rem .75rem; border-top: 1px solid var(--line); text-align: right; font-size: 12px; }
.bbeditor-over { color: var(--red); font-weight: 700; }
.write-panel { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.write-panel h3 { margin: 0; }
.vote-buttons .btn, .vote-btn { width: 112px; min-width: 0; padding-left: .5rem; padding-right: .5rem; }
.vote-btn.is-selected { outline: 3px solid var(--focus); outline-offset: 2px; }
.vote-buttons .btn[aria-pressed="true"] { outline: 3px solid var(--focus); outline-offset: 2px; }
.penalties { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; }
.penalties summary { cursor: pointer; font-weight: 600; }
.write-panel select { width: 100%; }
.write-panel .bbeditor-select { width: auto; }
.slider { width: 100%; max-width: 280px; }

/* ---------- In-game guide ---------- */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; align-items: start; text-align: left; }
.guide-nav { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; padding-right: .5rem; font-size: 14px; }
.guide-nav h2 { margin: 1.1rem 0 .35rem; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); text-align: left; }
.guide-nav h2:first-child { margin-top: 0; }
.guide-nav ul { margin: 0; padding: 0; list-style: none; }
.guide-nav a { display: block; padding: .3rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.guide-nav a:hover { background: var(--gold-soft); }
.guide-nav a[aria-current="page"] { background: var(--navy); color: #fff; box-shadow: 0 0 0 1px var(--line); font-weight: 600; }
.guide-search { margin-bottom: .5rem; }
.guide-results { margin: .4rem 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.guide-results a { display: block; padding: .4rem .6rem; }
.guide-results small { display: block; color: var(--text-soft); font-size: 12px; line-height: 1.35; }
.guide-no-results { padding: .4rem .6rem; color: var(--text-soft); }
.guide-soon li { padding: .2rem .6rem; color: var(--text-soft); }
.guide-article { min-width: 0; max-width: 820px; line-height: 1.65; }
.guide-article h1 { margin: 0 0 .25rem; text-align: left; }
.guide-article .lead { margin: 0 0 1.25rem; font-size: 1.1rem; color: var(--text-soft); }
.guide-article h2 { margin: 2.25rem 0 .5rem; padding-top: .5rem; border-top: 3px solid var(--gold); font-size: 1.4rem; text-align: left; scroll-margin-top: 80px; }
.guide-article h3 { margin: 1.5rem 0 .4rem; font-size: 1.15rem; text-align: left; scroll-margin-top: 80px; }
.guide-article p, .guide-article li { max-width: 72ch; }
.guide-article ul, .guide-article ol { padding-left: 1.4rem; }
.guide-article li + li { margin-top: .3rem; }
.guide-toc { margin: 0 0 1.5rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.guide-toc ul { margin: .35rem 0 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.guide-table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: 14.5px; }
.guide-table th, .guide-table td { padding: .55rem .7rem; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.guide-table thead th { background: var(--navy); color: #fff; font-weight: 600; }
.guide-table tbody tr:nth-child(even) { background: var(--surface-2); }
.note, .tip { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--blue); border-radius: 0 8px 8px 0; background: var(--note-bg); }
.tip { border-left-color: var(--green); background: var(--tip-bg); }
.soon { display: inline-block; margin-left: .25rem; padding: 0 .5rem; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold-deep); font-size: 12px; font-weight: 700; color: var(--text); vertical-align: middle; }
ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 700; }
ol.rules > li { margin: .5rem 0; }
ol.sub { list-style: none; padding-left: 1.2rem; }
.glossary dt { margin-top: 1rem; font-weight: 700; scroll-margin-top: 80px; }
.glossary dd { margin: .15rem 0 0; }
.guide-cards { margin: 1rem 0; }
.guide-card { display: grid; gap: .25rem; text-decoration: none; color: var(--text); }
.guide-card:hover { border-color: var(--gold-deep); box-shadow: 0 2px 10px rgba(13, 27, 74, .15); }
.guide-card span { color: var(--text-soft); font-size: 14px; }
.guide-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.guide-pager .btn { flex: 0 1 auto; }
@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .guide-nav { position: static; max-height: none; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
  .guide-toc ul { columns: 1; }
  .guide-table { display: block; overflow-x: auto; }
}

/* Committees */
.committee-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.committee { display: grid; gap: .5rem; align-content: start; text-align: left; }
.committee-head { display: flex; justify-content: space-between; gap: .5rem; }
.committee-members { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.committee-members li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.party-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.tag--chair { background: var(--navy); color: #fff; }
.linkish { border: 0; background: none; padding: 0 .25rem; color: var(--link); font: 13px var(--font); text-decoration: underline; cursor: pointer; }
.appoint-row, .assign-row { display: flex; gap: .5rem; align-items: center; }
.appoint-row input, .assign-row select { flex: 1 1 160px; min-width: 0; }
.committee-info { display: grid; gap: .4rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.committee-info .btn { min-width: 0; padding: .4rem .7rem; font-size: 13px; }
.guide-article .two-col { columns: 2; column-gap: 2rem; }
.guide-article .formula { margin: 1rem 0; padding: .85rem 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: 13.5px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }
@media (max-width: 860px) { .guide-article .two-col { columns: 1; } }
.appoint-box { margin-top: .5rem; text-align: left; }
.card .appoint-row { display: flex; gap: .5rem; }
.card .appoint-row .btn { min-width: 0; padding: .4rem .8rem; }

/* State page: House election vote-share pie chart */
.pie-wrap { position: relative; width: 100%; max-width: 260px; margin: 1rem auto; }
.pie-chart { display: block; width: 100%; }
.pie-chart path, .pie-chart circle { cursor: pointer; stroke: var(--surface); stroke-width: 1; }
.pie-chart path:hover, .pie-chart path:focus, .pie-chart circle:hover, .pie-chart circle:focus { opacity: .85; outline: none; }
.pie-tooltip {
  position: absolute; z-index: 5; transform: translate(-50%, -110%);
  padding: .4rem .6rem; border-radius: 8px; background: var(--navy); color: #fff;
  font-size: 13px; line-height: 1.3; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 12px rgba(13, 27, 74, .35);
}
.pie-tooltip strong { display: block; }

/* State page: a primary's pie charts split one per party (each shows that party's own candidates' relative share) */
.party-pies { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin: 1rem 0; }
.party-pie { width: 200px; }
.party-pie h4 { margin: 0 0 .35rem; text-align: center; font-size: 14px; color: var(--text-soft); }
.party-pie .pie-wrap { max-width: 200px; margin: 0 auto; }

/* Flag beside a country's name (World page list) */
.country-flag { width: auto; height: auto; max-width: 32px; max-height: 22px; vertical-align: -4px; margin-right: 8px; filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }

/* Debate statement boxes (1v1 debates on the profile page, the presidential debate) stretch to the full width of their panel. */
#debate-view textarea, #pd-box textarea, #pd-box input[type="text"], #pd-box select {
  display: block; width: 100%; box-sizing: border-box; padding: .55rem .7rem; font: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
#debate-view textarea, #pd-box textarea { resize: vertical; }

/* ---------- AI judge philosophy bars (Law page "Judge Pool" tab and the judge's profile) ---------- */
.jp-list { display: flex; flex-direction: column; gap: .6rem; text-align: left; }
.jp-row { display: block; }
.jp-top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: .9rem; line-height: 1.3; }
.jp-val { font-variant-numeric: tabular-nums; color: var(--text-soft); font-weight: 600; }
.jp-track { height: 6px; margin-top: .25rem; border-radius: 3px; background: var(--line); overflow: hidden; }
.jp-fill { display: block; height: 100%; border-radius: 3px; background: var(--text-soft); }
.jp-card { text-align: left; }
.jp-card h4 { margin: 0; }
.jp-details > summary { cursor: pointer; font-weight: 600; margin: .25rem 0 .6rem; }

/* Election Records: keep the party beside the candidate's name even when it is long (it wraps in its own column instead of dropping below). */
.er-head { flex-wrap: nowrap; }
.er-head .who { flex: 1 1 0; min-width: 0; }
.er-head .party { flex: 0 1 45%; min-width: 0; justify-content: flex-end; text-align: right; }
.er-head .party .party-dot { flex: none; }
.er-pie { display: grid; justify-items: center; gap: .5rem; margin: .5rem 0 1rem; }
.er-pie h3 { margin: 0; font-size: 14px; color: var(--text-soft); }
.er-pie .pie-wrap { width: 200px; }
.er-legend { list-style: none; margin: 0; padding: 0; font-size: 14px; display: grid; gap: .2rem; }
.er-bar { width: 100%; }

/* ---------- Settings: site style picker ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.theme-opt { display: grid; gap: .25rem; justify-items: start; padding: .6rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.theme-opt:hover { border-color: var(--gold-deep); }
.theme-opt[aria-checked="true"] { border-color: var(--link); box-shadow: 0 0 0 2px var(--link); }
.theme-opt small { color: var(--text-soft); line-height: 1.3; }
.theme-swatch { display: flex; width: 100%; height: 28px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); }
.theme-swatch i { flex: 1; }
.theme-opt:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Pictures next to names (Elect.avatar / Elect.partyIcon / Elect.personLink in scripts/api.js) ---------- */
.pic { display: inline-grid; place-items: center; position: relative; flex: none; overflow: hidden; border-radius: 50%; vertical-align: middle; color: #fff; font-weight: 700; line-height: 1; }
/* U.S. party pages: bigger player pictures, with their text a bit larger too */
.party-page .person-link { font-size: 1.15em; gap: .6rem; }
.party-page .leaders strong { font-size: 1.2rem; }
.pic.pic--square { border-radius: 10px; }
.pic--person { background: var(--navy); color: var(--gold); }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.person-link { display: inline-flex; align-items: center; gap: .55rem; vertical-align: middle; font-size: 1.1em; }
/* In a line of small text, the larger picture needs a little room above and below so neighbouring lines don't touch it. */
.meta .person-link, p .person-link, small .person-link, li .person-link { margin-block: .2rem; }
.party-link { display: inline-flex; align-items: center; gap: .4rem; }
.country-link { display: inline-flex; align-items: center; gap: .4rem; vertical-align: middle; }
.country-flag { height: 1.4em; width: auto; max-width: 2.3em; max-height: none; object-fit: contain; border-radius: 2px; }

/* The logo image has a white background: on the dark styles show it as a white tile instead of a floating white box. */
html[data-theme="dark"] .login-logo, html[data-theme="midnight"] .login-logo, html[data-theme="emerald"] .login-logo, html[data-theme="navy"] .login-logo, html[data-theme="navysky"] .login-logo, html[data-theme="ember"] .login-logo { padding: .5rem; border-radius: 14px; background: #fff; box-sizing: content-box; }

/* Gambling Market: the View/Hide game buttons are all the same width (fits "Hide Election Betting"). */
.game-toggle { width: 16rem; max-width: 100%; justify-self: center; margin-inline: auto; }

/* Market: one corporation's panel (market.js showCorp) */
.corp { text-align: left; }
.corp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.corp-title { flex: 1 1 240px; min-width: 0; }
.corp-title h3 { margin: 0 0 .25rem; }
.corp-title .meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.corp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 1rem 0; }
.corp-stat { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.corp-stat small { display: block; color: var(--text-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.corp-stat strong { font-size: 1.15rem; }
.corp-stat--bad strong { color: var(--err-text); }
.corp-section { margin-top: 1.5rem; }
/* A dividing line between the big sections of the corporation popup (buy and sell, shareholders, board and votes, sector investments, CEO controls) */
.corp > .corp-section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 2px solid var(--line); }
.corp-minor { margin: 1rem 0 .4rem; font-size: 1rem; }
.corp-section > h4 { margin: 0 0 .4rem; font-size: 1.35rem; }
.corp-sector { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.corp-sector:last-child { border-bottom: 0; }
.corp-sector-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.corp-bar { height: 10px; margin: .4rem 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.corp-bar > span { display: block; height: 100%; background: var(--gold); }
.corp-bar--hot > span { background: var(--err-text); }
.corp-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; }
.corp-tool { padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.corp-tool--wide { grid-column: 1 / -1; }
.corp-tool h5, .corp-danger h5 { margin: 0 0 .55rem; font-size: 1.15rem; }
.corp-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.corp-row .field { margin: 0; flex: 1 1 150px; min-width: 0; max-width: none; }
.corp-row .field input, .corp-row .field select { width: 100%; }
.corp-hint { margin: .6rem 0 .2rem; }
/* Board card (market.js boardSection): messages sit inside the card; stacked rows and button groups get breathing room */
.board-card > * + * { margin-top: .75rem; }
.board-card .list { margin-top: .5rem; }
.board-msg { margin: 0; padding: .5rem .75rem; border-radius: 8px; background: var(--note-bg); color: var(--text); }
.board-msg.form-error { background: transparent; border: 1px solid var(--err-text); color: var(--err-text); }
.board-ballot-rows { display: grid; gap: .75rem; }
.board-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.corp-danger { margin-top: 1.5rem; padding: .85rem; border: 1px solid var(--err-text); border-radius: 10px; }
.corp > .btn { margin-top: 1rem; }
.corp-row .corp-grow { flex: 3 1 260px; }
.corp-row input[type="number"], .corp-row select { min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }

/* Market: a corporation opens in a popup (market.js showCorp). Sits below Elect.ask's confirmation (z-index 1000) and above the sticky header. */
.corp-overlay { position: fixed; inset: 0; z-index: 900; overflow-y: auto; padding: 4vh 1rem; background: rgba(0, 0, 0, .55); }
.corp-overlay[hidden] { display: none; }
.corp-overlay > .card { width: min(980px, 100%); margin: 0 auto; }
body.modal-open { overflow: hidden; }
.corp-tag { display: inline-flex; align-items: center; gap: .45rem; }
.corp-logo-sm { display: inline-grid; place-items: center; position: relative; flex: none; overflow: hidden; border-radius: 22%; background: #fff; border: 1px solid var(--line); box-sizing: border-box; vertical-align: middle; } /* logos stay white tiles */
.corp-logo-sm img { position: absolute; inset: 4%; width: 92%; height: 92%; max-width: none; max-height: none; object-fit: contain; display: block; }
.corp-logo-sm--letter { background: var(--surface-2); color: var(--text-soft); font-weight: 700; }
.corp-led { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; }

/* Market: buying and selling share one section of the popup */
.corp-trade h5 { margin: 1rem 0 .4rem; font-size: 1.15rem; }
.board-card h5 { margin-top: 1.25rem; }
.board-card > h5:first-child { margin-top: 0; }
.corp-subsection { margin-top: 1.25rem; padding-top: .25rem; border-top: 1px solid var(--line); }

/* Market: the richest-list toggle buttons are equal width with space between them */
#richest .toolbar { margin: 1rem 0 .5rem; }
.btn.richest-toggle { width: 100%; max-width: 30rem; min-width: 0; margin: 0; }
#richest .list { margin-bottom: 1rem; }

/* Market: stock ticker tape (market.js loadTicker) - green = bought, red = sold or listed; scrolls until hovered or focused, and is a plain scrollable row for reduced motion */
.forsale-strong { font-weight: 800; color: var(--text); }
.corp-offers .list-row { background: var(--surface-2); }
.ticker { min-height: 4.4rem; overflow-x: auto; overflow-y: hidden; white-space: nowrap; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); scrollbar-width: thin; cursor: grab; }
.ticker:active { cursor: grabbing; }
.ticker-track { display: inline-flex; width: max-content; }
.ticker-half { display: inline-flex; flex: none; }
.tick { flex: none; padding: 1rem 1.5rem; border: 0; border-right: 1px solid var(--line); background: transparent; font: 600 14px/1.2 var(--font); cursor: pointer; }
.tick:hover { background: var(--surface); }
.tick--up { color: var(--ok-text); }
.tick--down { color: var(--err-text); }
.ticker-empty { display: block; padding: .55rem 1rem; color: var(--text-soft); }
@media (prefers-reduced-motion: reduce) { .ticker-half[aria-hidden] { display: none; } }

/* Market: your own corporation inside a sector card (market.js sectorInvest) */
.sector-card { border-bottom: 1px solid var(--line); }
.sector-card:last-child { border-bottom: 0; }
.sector-card > .list-row { border-bottom: 0; }
.sector-mine { margin: 0 1rem 1rem; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; }
.sector-mine-name { margin: 0 0 .25rem; }
.sector-mine .corp-row { margin-top: .25rem; }
.sector-mine .corp-row input[type="number"] { width: 100%; }
.sector-mine-ok { margin: .4rem 0 0; font-weight: 600; color: var(--ok-text); }
.list-row > .sector-mine { flex: 1 1 100%; margin: .25rem 0 0; }

/* Guide: Supreme Moderator in-page editing (scripts/guide-edit.js) */
.guide-edit-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; padding: .5rem; border: 1px solid var(--border, currentColor); border-radius: 8px; background: var(--surface); color: var(--text); position: sticky; top: 64px; z-index: 5; }
.guide-edit-bar .spacer { flex: 1; }
#guide-body.guide-editing { outline: 2px dashed var(--accent, currentColor); outline-offset: 6px; min-height: 8rem; }
.guide-edited { margin-top: 1.5rem; font-size: 13px; color: var(--text-soft); }

/* Space between a corporation tool's controls and its result message ("Dividend set.", "Deposited.") */
.corp-tool .board-msg { margin-top: .75rem; }

/* Profile: office titles above the name, jail bars over an imprisoned player's picture, religion icon beside the religion */
.p-titles { margin: 0 0 .25rem; font-size: 17px; font-weight: 600; color: var(--text-soft); text-align: center; }
.p-titles span + span::before { content: " \00b7  "; }
.avatar.avatar--jailed { overflow: hidden; }
.avatar.avatar--jailed::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(90deg, transparent 0 14%, rgba(30, 30, 34, .88) 14% 18%, rgba(255, 255, 255, .35) 18% 19%); box-shadow: inset 0 0 0 4px rgba(30, 30, 34, .88); }
.icon-tile--sm { width: 26px; height: 26px; border-radius: 6px; font-size: 16px; vertical-align: middle; display: inline-grid; margin-right: .4rem; }

/* Bills and foreign laws with several provisions (owner, 2026-10-02) */
.prov-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.prov-box .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.provisions-list { margin: 6px 0 10px 1.2em; padding: 0; }
.provisions-list li { margin-bottom: 6px; }

/* Line charts (scripts/linechart.js): theme tokens only. */
.linechart { position: relative; margin: .6rem 0 1.2rem; }
.linechart-title { margin: 0 0 .3rem; font-size: 1rem; }
.linechart-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; margin-bottom: .3rem; font-size: 14px; color: var(--text); }
.linechart-key { display: inline-flex; align-items: center; gap: .3rem; }
.linechart svg { display: block; max-width: 100%; touch-action: pan-y; }
.linechart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: .4rem .6rem; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.linechart-table summary { cursor: pointer; font-size: 13px; color: var(--link); margin-top: .3rem; }
.linechart-table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: .3rem; }
.linechart-table th, .linechart-table td { text-align: left; padding: .2rem .5rem; border-bottom: 1px solid var(--line); }

/* Country map (scripts/citymap.js): page chrome uses theme tokens; the terrain fills are data colors drawn on the canvas. */
.citymap { display: flex; flex-direction: column; gap: .6rem; }
.citymap-bar { justify-content: flex-start; align-items: center; gap: .4rem; }
.citymap-bar .btn { padding: .35rem .8rem; min-width: 2.4rem; }
.citymap-bar .btn[aria-pressed="true"] { background: var(--gold-soft); color: var(--text); box-shadow: inset 0 0 0 2px var(--gold-deep); }
.citymap-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--note-bg); touch-action: pan-y; }
.citymap-canvas { display: block; cursor: grab; max-width: 100%; touch-action: none; }
.citymap-canvas:active { cursor: grabbing; }
.citymap-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.citymap-tip { position: absolute; pointer-events: none; max-width: 220px; padding: .3rem .5rem; border-radius: 6px; font-size: .8rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.citymap-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--text-soft); }
.citymap-key { display: inline-flex; align-items: center; gap: .35rem; }
.citymap-key i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; }
.citymap-key i.citymap-river { width: 8px; height: 8px; border-radius: 50%; background: #2f6fd6; border: none; margin: 0 3px; }
.citymap-info { min-height: 3rem; }
.citymap-note { font-size: .8rem; }
.citymap-credits { font-size: .8rem; }
.citymap-credits summary { cursor: pointer; color: var(--link); }
.citymap-credits p { margin: .25rem 0; }
.citymap-cities summary { cursor: pointer; color: var(--link); font-weight: 600; }
.citymap-table { width: 100%; border-collapse: collapse; margin-top: .4rem; font-size: .9rem; }
.citymap-table th, .citymap-table td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--line); }
.citymap-table td.num, .citymap-table th.num { text-align: right; }
.citymap-table th, .citymap-table td { vertical-align: top; }
.citymap-rural-line { margin: 0; font-weight: 600; }
.citymap-table tr.citymap-rural td { font-style: italic; color: var(--text-soft); }
.citymap-select { padding: .35rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.citymap-key i.citymap-dot { border-radius: 50%; }
.citymap-bar select.citymap-select { width: auto; max-width: 100%; }
.regime-tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: help; }
.regime-state_only { border-color: var(--link); } .regime-private_only { border-color: var(--gold-deep); } .regime-local { border-style: dashed; } .regime-subsidized, .regime-mixed { border-style: solid; }
.citymap-found { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.citymap-found input { padding: .4rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.citymap-dev summary { cursor: pointer; color: var(--link); font-weight: 600; }
.citymap-regimes { margin: .3rem 0 .6rem 1.2rem; font-size: .85rem; }
.who-pay { font-size: .85rem; min-width: 16rem; }
.who-line { margin: .1rem 0; } .who-yes strong { color: var(--ok-text); } .who-no strong { color: var(--err-text); }
.who-law { font-size: .78rem; margin-top: .2rem; }
.track-name { white-space: nowrap; font-weight: 600; }

.pct-input { width: 5.5rem; margin: 0 .3rem; }

.proj-box { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.proj-box select, .proj-box input { max-width: 100%; }
.proj-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .2rem; }

.mk-scroll { overflow-x: auto; }

/* the Market page: every button the same width (owner, 2026-10-05); wide enough for the longest label ("View Improvements Market") */
body[data-bg="market"] .btn { width: 15rem; max-width: 100%; min-width: 0; flex: 0 0 auto; }
.mk-act { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; min-width: 20rem; }
.mk-pairs { display: flex; flex-wrap: wrap; gap: .45rem .9rem; }
.mk-pair { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }

/* Shareholder pie chart (Market page): categorical colors in a fixed order, a lighter set on the dark site styles. */
.share-pie {
  --pie-1: #2a78d6; --pie-2: #eb6834; --pie-3: #1baf7a; --pie-4: #eda100; --pie-5: #e87ba4; --pie-6: #008300; --pie-7: #4a3aa7;
  --pie-other: #9a9a94; --pie-float: #c9c8bf;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1.5rem; margin: .5rem 0 1rem;
}
html[data-theme="dark"] .share-pie, html[data-theme="midnight"] .share-pie {
  --pie-1: #3987e5; --pie-2: #d95926; --pie-3: #199e70; --pie-4: #c98500; --pie-5: #d55181; --pie-6: #008300; --pie-7: #9085e9;
  --pie-other: #7c7b75; --pie-float: #52514e;
}
.share-pie .pie-wrap { margin: 0; flex: 0 0 auto; width: 220px; }
.share-pie .pie-chart path, .share-pie .pie-chart circle { stroke-width: 2; }
.share-pie-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: 14px; color: var(--text); }
.share-pie-legend li { display: flex; align-items: center; gap: .5rem; }
.share-pie-swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }

/* Banned accounts: large red notice under the name and in the moderator row (shown to staff) */
.ban-banner { margin: .4rem auto; padding: .45rem .9rem; max-width: 640px; text-align: center; font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--err-text); background: var(--err-bg); border: 2px solid var(--err-text); border-radius: 8px; }
#mod-ban-note { color: var(--err-text); font-size: 16px; font-weight: 700; }
.nc-votes { display: block; margin-top: .25rem; white-space: nowrap; }
#fp-name { display: flex; align-items: center; justify-content: center; gap: .6rem; text-align: center; }

/* Portraits: heads sit near the top of a photo, so when a tall picture is cropped to a square keep the top, not the middle. */
.pic--person img, .avatar img { object-position: center 12%; }

/* Prison actions: uniform tiles with an icon and a color each */
#pr-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 480px; margin-inline: auto; }
.prison-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 14px; text-align: left; white-space: normal; line-height: 1.2; color: #fff; }
.prison-btn span { flex: 1; text-align: center; }
.prison-btn__icon { width: 30px; height: 30px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prison-btn--navy   { background: var(--navy);   box-shadow: 0 3px 0 #060d2e; }
.prison-btn--red    { background: var(--red);    box-shadow: 0 3px 0 #9d1010; }
.prison-btn--green  { background: var(--green);  box-shadow: 0 3px 0 #0b7a31; }
.prison-btn--maroon { background: var(--maroon); box-shadow: 0 3px 0 #5e0808; }
.prison-btn--blue   { background: var(--blue);   box-shadow: 0 3px 0 #16309e; }
.prison-btn:hover { filter: brightness(1.08); }
.prison-btn--navy:hover   { box-shadow: 0 4px 0 #060d2e; }
.prison-btn--red:hover    { box-shadow: 0 4px 0 #9d1010; }
.prison-btn--green:hover  { box-shadow: 0 4px 0 #0b7a31; }
.prison-btn--maroon:hover { box-shadow: 0 4px 0 #5e0808; }
.prison-btn--blue:hover   { box-shadow: 0 4px 0 #16309e; }
.prison-btn:active { box-shadow: 0 1px 0 rgba(0,0,0,.4); }
@media (max-width: 480px) { #pr-actions { grid-template-columns: 1fr; } }

/* construction queue: details on the left, one compact Cancel button on the right */
.cq-list { list-style: none; margin: .4rem 0 .8rem; padding: 0; }
.cq-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem 1rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.cq-title { font-size: .95rem; } .cq-units { color: var(--text-soft); }
.cq-state { font-size: .85rem; }
.cq-act { text-align: right; }
.cq-list .cq-act .btn, body[data-bg="market"] .cq-list .cq-act .btn { width: auto; min-width: 6rem; padding: .35rem 1rem; }
@media (max-width: 560px) { .cq-list li { grid-template-columns: 1fr; } .cq-act { text-align: left; } }

.cq-cell { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cq-cell .btn { width: auto; min-width: 6rem; padding: .35rem 1rem; }

/* Compact unit / base info boxes (Military section of a country page) */
.mil-info { padding: .55rem .75rem; font-size: 13px; line-height: 1.4; text-align: left; }
.mil-info__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; margin-bottom: .4rem; }
.mil-info__head strong { font-size: 15px; }
.mil-info__head span { color: var(--text-soft); }
.mil-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.mil-chips span { display: flex; flex-direction: column; min-width: 4.2rem; padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.mil-chips small { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.mil-chips b { font-size: 14px; }
.mil-rows { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; margin: 0; }
.mil-rows dt { margin: 0; color: var(--text-soft); }
.mil-rows dd { margin: 0; text-align: left; }

/* Whether a bill/law type's spending counts as economic development (shown when proposing). */
.ed-note { margin: 0 0 .5rem; padding: .4rem .6rem; border-left: 3px solid var(--line); font-size: 14px; color: var(--text-soft); }
.ed-note--yes { border-left-color: var(--yes); color: var(--text); }

/* Alliances tab (World page): the action buttons Propose ... / Leave the alliance / Found alliance share one width */
#al-host .btn.al-wide { width: 17rem; max-width: 100%; box-sizing: border-box; text-align: center; }
