/* The archive: plain, readable pages. Follows the device's light or dark setting. */
:root { --bg: #fbfaf7; --text: #1d2230; --sub: #5a6274; --muted: #8790a3; --line: #e3e1da;
  --panel: #ffffff; --accent: #b8860b; --link: #1f4fa8; --good: #1c8a5a; --bad: #c0392b; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e131d; --text: #e6e9f0; --sub: #a7b0c3; --muted: #77819a; --line: #26304a;
    --panel: #151c2b; --accent: #f5c542; --link: #8fb4ff; --good: #3ccf91; --bad: #ff7b7b; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
  font: 17px/1.55 "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; padding: .6rem 1.2rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .45rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: #e04a3f; display: inline-block; }
nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
nav a { color: var(--sub); }
nav a.on { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
main { max-width: 980px; margin: 0 auto; padding: 1.2rem 1.2rem 3rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: .4rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.crumbs { font-family: system-ui, sans-serif; font-size: 14px; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--sub); }
.muted { color: var(--muted); }
.small, small { font-size: .85em; }
.button { display: inline-block; background: var(--accent); color: #111; padding: .45rem .9rem; border-radius: .4rem;
  font-family: system-ui, sans-serif; font-weight: 600; }
footer { text-align: center; color: var(--muted); font-size: 14px; padding: 2rem 1rem;
  border-top: 1px solid var(--line); font-family: system-ui, sans-serif; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; margin: 1rem 0; }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: .6rem; color: var(--text); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile span { color: var(--sub); font-size: .9rem; }

table.list { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; font-size: .95rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .05em; border-bottom: 1px solid var(--line); padding: .35rem .5rem; }
table.list td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 120px; height: .6rem; background: var(--line); border-radius: .3rem;
  overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .9em; white-space: nowrap; }
.chip::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--c, #888); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: 1rem 0;
  font-family: system-ui, sans-serif; font-size: .95rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.person { display: flex; gap: 1.4rem; align-items: flex-start; }
.avatar { flex: none; width: 96px; height: 96px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font: 700 2rem system-ui, sans-serif; box-shadow: inset 0 0 0 4px rgba(255,255,255,.25); }
/* painted portrait: bigger than the initials circle, ringed in the party colour */
.avatar.portrait { width: 160px; height: 160px; object-fit: cover; border: 4px solid; box-shadow: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: .6rem; padding: .8rem 1rem; margin: .6rem 0; }
.statute { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  padding: .4rem 1.2rem; border-radius: .3rem; }
details { margin: .4rem 0; background: var(--panel); border: 1px solid var(--line); border-radius: .4rem;
  padding: .4rem .8rem; }
details summary { cursor: pointer; font-family: system-ui, sans-serif; font-size: .95rem; }

.st { font: 600 .78rem system-ui, sans-serif; padding: .1rem .45rem; border-radius: 1rem;
  background: var(--line); color: var(--text); white-space: nowrap; }
.st-enacted, .st-overridden, .st-in_force { background: #d3f2e2; color: #0f5c3a; }
.st-vetoed, .st-died, .st-repealed, .st-struck_down, .st-expired, .st-superseded { background: #f6dcd8; color: #7a1f14; }
.st-on_floor, .st-on_floor_2 { background: #fdf0c4; color: #6b5200; }
@media (prefers-color-scheme: dark) {
  .st-enacted, .st-overridden, .st-in_force { background: #12402c; color: #a6f0c8; }
  .st-vetoed, .st-died, .st-repealed, .st-struck_down, .st-expired, .st-superseded { background: #4a1d18; color: #ffb3a8; }
  .st-on_floor, .st-on_floor_2 { background: #45380c; color: #ffe08a; }
}

svg.chart { width: 100%; height: auto; display: block; margin: .4rem 0; }
svg.chart .grid { stroke: var(--line); }
svg.chart .ax { fill: var(--muted); font: 11px system-ui, sans-serif; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font: 13px system-ui, sans-serif; color: var(--sub); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: -.05rem; }
svg.minimap { width: 100%; max-width: 520px; height: auto; display: block; margin: .6rem 0; }
svg.minimap path { stroke: rgba(255,255,255,.9); stroke-width: 2.5; fill-opacity: .4; }
svg.minimap a:hover path { fill-opacity: .65; }
svg.minimap text { fill: #fff; font: 700 22px system-ui, sans-serif; text-anchor: middle; paint-order: stroke;
  stroke: rgba(0,0,0,.5); stroke-width: 4px; }

.years { font-family: system-ui, sans-serif; display: flex; flex-wrap: wrap; gap: .2rem .7rem; }
.years a.on { font-weight: 700; color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font: 14px system-ui, sans-serif; margin: .6rem 0 1rem;
  position: sticky; top: 3.1rem; background: var(--bg); padding: .4rem 0; z-index: 2; }
.day h3 { position: relative; color: var(--sub); font-family: system-ui, sans-serif; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .06em; }
article.news { border-left: 3px solid var(--line); padding: .1rem 0 .1rem .9rem; margin: .5rem 0 .9rem; }
article.news h4 { margin: 0; font-size: 1.05rem; }
article.news p { margin: .2rem 0; }
article.news.g-politics { border-color: #6a5acd; } article.news.g-laws { border-color: #2e8b57; }
article.news.g-economy { border-color: #d4a017; } article.news.g-disasters { border-color: #d9534f; }
article.news.g-world { border-color: #1e90ff; }
article.news.hide { display: none; }
article.news:target { background: rgba(245,197,66,.15); }

#q { width: 100%; font: 1.15rem system-ui, sans-serif; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: .5rem; background: var(--panel); color: var(--text); }
ul.results { list-style: none; padding: 0; }
ul.results li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
ul.results li .k { font: 600 .72rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-right: .5rem; }
ul.results li .x { color: var(--muted); font-size: .9rem; margin-left: .4rem; }
mark { background: rgba(245,197,66,.45); color: inherit; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .person { flex-direction: column; }
  table.list { font-size: .85rem; }
  .bar { width: 70px; }
}
@media print { header.top, .filters, footer { display: none; } }

/* The zoomable map (map/index.html, map.js). --k is 1 at the whole map and shrinks as
   you zoom in, so labels and lines stay the same size on screen. */
.mapwrap { position: relative; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden;
  background: #9cc3de; }
@media (prefers-color-scheme: dark) { .mapwrap { background: #16314a; } }
.mapz { --k: 1; display: block; width: 100%; height: auto; max-height: 78vh; touch-action: none;
  cursor: grab; user-select: none; font-family: system-ui, sans-serif; }
.mapz.drag { cursor: grabbing; }
/* The regions are see-through tints over the painted island (site_assets/map.jpg). */
.mapz .mreg path { stroke: rgba(255,255,255,.9); stroke-width: calc(2px * var(--k)); fill-opacity: .24; }
.mapz .mreg:hover path { fill-opacity: .55; }
.mapz .hint { fill: transparent; stroke: transparent; }
.mapz .hint.river { fill: none; stroke-width: calc(8px * var(--k)); }
.mapz .rname { font-size: calc(22px * var(--k)); font-weight: 700; fill: #fff; text-anchor: middle;
  paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: calc(3px * var(--k)); pointer-events: none; opacity: .55; }
.mapz.zin .rname { opacity: .3; }
.mapz .city { cursor: pointer; }
.mapz .city circle, .mapz .city .star { fill: #fff; stroke: #1d2230; stroke-width: calc(1.5px * var(--k)); }
.mapz .city.cap circle { fill: #ffd54a; }
.mapz .city.nat .star { fill: #e04a3f; }
.mapz .city.sel circle, .mapz .city.sel .star { stroke: #e04a3f; stroke-width: calc(3px * var(--k)); }
.mapz .city text { font-size: calc(13px * var(--k)); fill: #10141d; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: #fff; stroke-width: calc(3px * var(--k)); }
.mapz .city.town text { display: none; }
.mapz.zin .city.town text { display: inline; }
.mapz .city.cap text, .mapz .city.nat text { font-weight: 700; }
.mapbtns { position: absolute; right: .6rem; top: .6rem; display: flex; flex-direction: column; gap: .3rem; z-index: 1; }
.mapbtns button { width: 2.2rem; height: 2.2rem; font-size: 1.2rem; border-radius: .4rem; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; }
#cityinfo { margin: .6rem 0 1rem; min-height: 1.6em; }

/* Banner illustrations (made once with Runway; see README). */
img.banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: .5rem;
  margin: 0 0 1.2rem; background: var(--line); }

/* Phase 7: newspapers side by side. */
.papers { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.paper { border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .9rem; }
.paper h3 { margin: .2rem 0; font-family: Georgia, serif; }
.paper ul { padding-left: 1.1rem; margin: .4rem 0; }
.paper li.lead { font-weight: 700; font-size: 1.05em; }
.st-upheld, .st-affirmed, .st-ratified, .st-reinstated { background: #d3f2e2; color: #0f5c3a; }
.st-reversed, .st-rejected, .st-revoked, .st-withdrawn, .st-failed_congress { background: #f6dcd8; color: #7a1f14; }
.st-negotiating, .st-signed, .st-sent_to_regions, .st-proposed { background: #fdf0c4; color: #6b5200; }
@media (prefers-color-scheme: dark) {
  .st-upheld, .st-affirmed, .st-ratified, .st-reinstated { background: #12402c; color: #a6f0c8; }
  .st-reversed, .st-rejected, .st-revoked, .st-withdrawn, .st-failed_congress { background: #4a1d18; color: #ffb3a8; }
  .st-negotiating, .st-signed, .st-sent_to_regions, .st-proposed { background: #45380c; color: #ffe08a; }
}

/* ---------- phase 8: news, life, travel, sports ---------- */
.leanbar { display: inline-block; position: relative; width: 140px; height: .55rem; border-radius: .3rem;
  background: linear-gradient(90deg, #2f6fdb, #8a8f98, #d23c3c); opacity: .85; vertical-align: middle; }
.leanbar i { position: absolute; top: -.3rem; width: .5rem; height: 1.15rem; margin-left: -.25rem;
  border-radius: .2rem; border: 2px solid var(--panel); }
.wire { font: 600 .68rem system-ui, sans-serif; color: var(--muted); border: 1px solid var(--line);
  border-radius: .7rem; padding: 0 .35rem; vertical-align: middle; }
.opinion { font: 700 .68rem system-ui, sans-serif; color: #fff; background: #6a5acd; border-radius: .7rem;
  padding: 0 .4rem; vertical-align: middle; }
.angle { font: 600 .7rem system-ui, sans-serif; color: var(--sub); background: var(--line); border-radius: .7rem;
  padding: 0 .4rem; vertical-align: middle; }
.angle.a-win { background: #d3f2e2; color: #0f5c3a; } .angle.a-attack, .angle.a-outrage { background: #f6dcd8; color: #7a1f14; }
.angle.a-alarm { background: #fdf0c4; color: #6b5200; } .angle.a-gossip { background: #fbdcef; color: #7a1453; }
li.wx { color: var(--sub); font-style: italic; list-style: none; margin-left: -1rem; }
.gauges { display: flex; gap: 1rem; flex-wrap: wrap; }
svg.gauge { width: 140px; height: auto; }
svg.gauge .track { fill: none; stroke: var(--line); stroke-width: 10; }
svg.gauge .fill { fill: none; stroke-width: 10; stroke-linecap: round; }
svg.gauge .v { fill: var(--text); font: 700 20px system-ui, sans-serif; }
svg.gauge .l { fill: var(--muted); font: 11px system-ui, sans-serif; }
.tile svg.gauge { width: 46%; }
.tabloid { background: #fff7d6; color: #111; border: 3px solid #111; padding: 1rem 1.2rem; margin: 1rem 0;
  font-family: Impact, "Arial Black", system-ui, sans-serif; }
.tabloid .splash { font-size: 2rem; line-height: 1.1; text-transform: uppercase; margin: 0 0 .6rem; color: #c8102e; }
.tabloid p, .tabloid ul { font-family: system-ui, sans-serif; }
.tabloid .wire { color: #555; border-color: #999; }
svg.network { width: 100%; height: auto; display: block; margin: .6rem 0; }
svg.network .land { fill: var(--panel); stroke: var(--line); stroke-width: 2; }
svg.network line { stroke-width: 4; stroke-linecap: round; }
svg.network line.m-air { stroke-width: 2; opacity: .55; }
svg.network circle { fill: var(--text); stroke: var(--panel); stroke-width: 3; }
svg.network text { fill: var(--text); font: 700 18px system-ui, sans-serif; paint-order: stroke;
  stroke: var(--panel); stroke-width: 4px; }
.board table { width: 100%; font: 13px ui-monospace, monospace; border-collapse: collapse; }
.board td { padding: .1rem .3rem; border-bottom: 1px solid var(--line); }
.board td.late { color: #b3261e; } .board td.ok { color: #1b7a3e; }
.bracket { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
td.up { color: #1b7a3e; } td.down { color: #b3261e; }

/* ---------- the travel map (travel/index.html: site_travel.py, map.js, travel.js) ----------
   Every link is a <g class="lk t-<tier> m-<road|rail|air> s-<open|delayed|closed>"> holding
   one stroke (.f) or a casing and a fill (.c, .f). Widths are times --k, so they hold their
   size on screen at any zoom. Smaller tiers stay hidden until map.js sets the zoom class:
   z2 (1.5x) highways and regional rail, z3 (2.6x) county roads, z5 (4.5x) city streets. */
.travelmap .treg { fill: none; stroke: rgba(255,255,255,.75); stroke-width: calc(1.5px * var(--k));
  stroke-dasharray: calc(6px * var(--k)) calc(4px * var(--k)); pointer-events: none; }
.travelmap .lk path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.travelmap .lk { cursor: help; }
.travelmap .t-interstate .c { stroke: #7a3d00; stroke-width: calc(6px * var(--k)); }
.travelmap .t-interstate .f { stroke: #f6a821; stroke-width: calc(3.4px * var(--k)); }
.travelmap .t-highway .f { stroke: #fff1a8; stroke-width: calc(2.6px * var(--k)); }
.travelmap .t-local .f { stroke: #ffffff; stroke-width: calc(1.5px * var(--k)); opacity: .95; }
.travelmap .m-rail .c { stroke-width: calc(4px * var(--k)); }
.travelmap .m-rail .f { stroke: #fff; stroke-width: calc(1.6px * var(--k));
  stroke-dasharray: calc(5px * var(--k)) calc(5px * var(--k)); stroke-linecap: butt; }
.travelmap .t-mainline .c { stroke: #262a33; }
.travelmap .t-intercity .c { stroke: #1f5fa8; }
.travelmap .t-regional .c { stroke: #7b3fa0; stroke-width: calc(3.2px * var(--k)); }
.travelmap .t-hsr .c { stroke: #d0213d; stroke-width: calc(4.6px * var(--k)); }
.travelmap .m-air .f { stroke: #1d3557; stroke-width: calc(1.4px * var(--k)); opacity: .6;
  stroke-dasharray: calc(2px * var(--k)) calc(6px * var(--k)); }
.travelmap .s-delayed .f { stroke: #e0a526; }
.travelmap .s-closed .f, .travelmap .s-closed .c { stroke: #d9534f; }
.travelmap .lk.build .f { stroke: #3b3b3b; stroke-width: calc(2px * var(--k)); opacity: .8;
  stroke-dasharray: calc(3px * var(--k)) calc(4px * var(--k)); }
.travelmap .streets { display: none; fill: none; stroke: rgba(255,255,255,.9); stroke-width: calc(1.2px * var(--k));
  pointer-events: none; }
.travelmap .t-highway, .travelmap .t-regional, .travelmap .t-local { display: none; }
.travelmap.z2 .t-highway, .travelmap.z2 .t-regional, .travelmap.z3 .t-local, .travelmap.z5 .streets { display: inline; }
.travelmap.z5 .city circle { fill-opacity: .35; }
.travelmap.hide-road .m-road, .travelmap.hide-rail .m-rail, .travelmap.hide-air .m-air,
.travelmap.hide-build .build, .travelmap .lk.future { display: none !important; }
.travelmap .lk.onroute { display: inline !important; }
.travelmap .lk.onroute .f, .travelmap .lk.onroute .c { stroke: #00b4ff; opacity: 1; stroke-dasharray: none; }
.travelmap .lk.onroute .c { stroke: #003a5c; stroke-width: calc(7px * var(--k)); }
.travelmap .lk.onroute .f { stroke-width: calc(4px * var(--k)); }
.mapctl { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .4rem 0 .6rem; }
.mapctl .asof { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.mapctl input[type=range] { width: 14rem; }
.maplegend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .5rem 0 0; font-size: .85rem; color: var(--sub); }
.maplegend .sw { display: inline-block; width: 1.8rem; height: .45rem; border-radius: .2rem; margin-right: .35rem;
  vertical-align: middle; }
.sw-interstate { background: #f6a821; box-shadow: 0 0 0 2px #7a3d00; }
.sw-highway { background: #fff1a8; box-shadow: 0 0 0 1px #b9a650; }
.sw-local { background: #fff; box-shadow: 0 0 0 1px #999; height: .25rem !important; }
.sw-mainline, .sw-intercity, .sw-regional, .sw-hsr {
  background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 10px); }
.sw-mainline { background-color: #262a33; } .sw-intercity { background-color: #1f5fa8; }
.sw-regional { background-color: #7b3fa0; } .sw-hsr { background-color: #d0213d; }
.sw-air { background: repeating-linear-gradient(90deg, #1d3557 0 2px, transparent 2px 7px); }
.sw-build { background: repeating-linear-gradient(90deg, #3b3b3b 0 3px, transparent 3px 7px); }
.sw-delayed { background: #e0a526; } .sw-closed { background: #d9534f; }
.planner { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin: .4rem 0 .6rem; }
.planner select { font: inherit; padding: .2rem .4rem; max-width: 14rem; }
.planner .modes { display: flex; gap: .8rem; }
#rout { min-height: 1.6em; margin-bottom: 1rem; }
ol.legs { margin: .4rem 0 0; }
details { margin: .3rem 0; } details summary { cursor: pointer; padding: .2rem 0; }

/* The world map (world/index.html, nationsim/worldmap.py): a painted picture with HTML pins on
   top, placed in percent so they stay put at any width. Each pin is a dot (the capital) with
   the country's name and capital beside it. */
.worldmap { position: relative; margin: 1rem 0; border-radius: .5rem; overflow: hidden; line-height: 1.15; }
.worldmap img { display: block; width: 100%; height: auto; }
.wpin { position: absolute; transform: translate(-6px, -6px); display: flex; flex-direction: column;
  padding-left: 16px; color: #fff; text-decoration: none; font-size: clamp(.55rem, 1.1vw, .85rem);
  text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
.wpin i { position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%;
  background: #f4f1ea; border: 2px solid #222; box-sizing: border-box; }
.wpin span { font-size: .85em; opacity: .9; }
.wpin.left { transform: translate(calc(-100% + 6px), -6px); padding: 0 16px 0 0; align-items: flex-end; }
.wpin.left i { left: auto; right: 0; }
.wpin:hover b { text-decoration: underline; }
.wpin.home { font-size: clamp(.65rem, 1.35vw, 1rem); }
.wpin.home i { background: #e8b923; width: 14px; height: 14px; }
.homebox { border: 1px solid var(--line); border-radius: .5rem; padding: .3rem 1rem .6rem; margin: 1rem 0; }
.homebox ul { columns: 2; margin: .3rem 0; }
@media (max-width: 600px) { .wpin span { display: none; } .homebox ul { columns: 1; } }

/* ======================================================================================
   THE POLISHED LOOK (icons and a desktop layout). Comes last, so it overrides the plain
   rules above where they overlap.
   - A dark navy brand bar, then a sticky section bar: each section's Runway icon above its
     name (icons.py), the current section underlined in gold.
   - Every page title carries its section's icon; archive tiles carry them too.
   - People: a role icon ringed in their party colour (person pages), small icons in lists.
   - Wider pages (1180px) for desktop and laptop screens; tables get a tinted header and
     stripes; cards and tiles get soft shadows.
   ====================================================================================== */
:root { --navy: #14213d; --navy2: #1d2d52; --gold: #d9a937; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 4px 14px rgba(20,33,61,.06);
  --head: #f1efe8; --stripe: #faf9f5; }
@media (prefers-color-scheme: dark) {
  :root { --head: #1a2234; --stripe: #121928; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); }
}
body { background: var(--bg); }

/* brand bar */
header.top { position: static; background: linear-gradient(90deg, var(--navy), var(--navy2)); border: 0;
  color: #fff; padding: .7rem 2rem; gap: 1rem; flex-wrap: nowrap; }
header.top .brand { color: #fff; font-size: 1.15rem; letter-spacing: .01em; }
header.top .tag { color: rgba(255,255,255,.6); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,.25); padding-left: 1rem; }
header.top .live { margin-left: auto; color: var(--gold); font-weight: 600; font-size: .9rem; }

/* section bar: icon above name */
nav.sections { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0; padding: .35rem 1rem .2rem; background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow); font: 12px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
nav.sections a { display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 62px;
  padding: .25rem .35rem .35rem; color: var(--sub); border-bottom: 2px solid transparent; border-radius: .3rem .3rem 0 0; }
nav.sections a:hover { color: var(--text); background: var(--stripe); text-decoration: none; }
nav.sections a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--gold); }
nav.sections img.ni { width: 30px; height: 30px; border-radius: 50%; }
.filters { top: 64px; }

/* page */
main { max-width: 1180px; padding: 1.6rem 2rem 3.5rem; }
h1.titled { display: flex; align-items: center; gap: .9rem; font-size: 2.1rem; margin: .5rem 0 1.2rem; }
h1.titled img.hi { width: 56px; height: 56px; border-radius: 50%; box-shadow: var(--shadow); flex: none; }
h2 { border-bottom: 2px solid var(--line); padding-bottom: .3rem; }
.crumbs { margin-bottom: .2rem; }
footer { background: var(--navy); color: rgba(255,255,255,.65); border: 0; margin-top: 2rem; }
footer a { color: var(--gold); }

/* tiles: icon on the left, title and line on the right */
.tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tile.ic { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto 1fr; column-gap: .9rem;
  align-items: start; }
.tile { padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tile img.ti { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 50%; }
.tile.ic b { font-size: 1.05rem; align-self: end; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,33,61,.12); }

/* tables */
table.list { background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; overflow: hidden;
  border-collapse: separate; border-spacing: 0; box-shadow: var(--shadow); }
table.list th { background: var(--head); padding: .5rem .7rem; }
table.list td { padding: .45rem .7rem; }
table.list tr:nth-child(even) td { background: var(--stripe); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: rgba(217,169,55,.08); }
td.who { white-space: nowrap; }
img.mi { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin: -4px .55rem -2px 0; }

/* person page: the role icon, ringed in the party colour, with the role written under it */
.person { gap: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: .7rem;
  padding: 1.3rem 1.6rem; box-shadow: var(--shadow); }
figure.avatar { width: auto; height: auto; margin: 0; background: none; box-shadow: none; display: flex;
  flex-direction: column; align-items: center; gap: .5rem; font: 600 .85rem system-ui, sans-serif; color: var(--sub); }
figure.avatar img { width: 150px; height: 150px; border-radius: 50%; border: 5px solid; box-shadow: var(--shadow); }
figure.avatar figcaption { text-transform: uppercase; letter-spacing: .07em; font-size: .75rem; text-align: center; }
.person dl.facts { margin: .2rem 0; }

.card, details, .statute { box-shadow: var(--shadow); }
.button { background: var(--navy); color: #fff; }
.button:hover { background: var(--navy2); text-decoration: none; }
@media (prefers-color-scheme: dark) { .button { background: var(--gold); color: #111; } }

@media (max-width: 900px) {
  nav.sections { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  header.top .tag { display: none; }
  main { padding: 1.2rem 1rem 3rem; }
}
@media (max-width: 640px) {
  .person { flex-direction: column; align-items: center; }
  h1.titled { font-size: 1.6rem; }
  h1.titled img.hi { width: 42px; height: 42px; }
  .tiles { grid-template-columns: 1fr; }
}
@media print { nav.sections { display: none; } }

/* the upcoming election page (site_upcoming.py): candidate lists and poll numbers */
ul.ballot { list-style: none; padding: 0; margin: .2rem 0 .6rem; }
ul.ballot li { padding: .15rem 0; }
ul.ballot .st { font-size: .7rem; margin-left: .2rem; }
b.poll { font: 700 .9rem system-ui, sans-serif; margin-left: .3rem; color: var(--text); }
table.ballot td:first-child { width: 34%; }
p.field { margin: .25rem 0; font: .92rem system-ui, sans-serif; }
p.field .st { font-size: .68rem; }
