:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #15181c;
  --muted: #5f6772;
  --border: #e0e4e9;
  /* highway-sign green, carrier-count's colour: --accent fills and underlines, --link the text links */
  --accent: #1f7a4d;
  --accent-text: #ffffff;
  --link: #17663f;
  --track: #e8ebef;
  --radius: 12px;
  /* map: none, then five classes of one green ramp */
  --map-0: #e9ebee; --map-1: #e1f2e7; --map-2: #b3dec2; --map-3: #72bf93; --map-4: #35965d; --map-5: #176a3c;
  --map-sea: #eef3f8;
  --bar: #35965d; --bar-2: #b3dec2; --bar-weekend: #9fb7a9;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1215; --surface: #181c21; --text: #e7eaee; --muted: #9aa2ad; --border: #2a3038;
  --accent: #5fcf8f; --accent-text: #04140b; --link: #6fd99b; --track: #262c33;
  --map-0: #2c3038; --map-1: #173a26; --map-2: #1f5a37; --map-3: #2f824f; --map-4: #4fb174; --map-5: #9be0b4;
  --map-sea: #14171c;
  --bar: #4fb174; --bar-2: #1f5a37; --bar-weekend: #3b5c48;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1215; --surface: #181c21; --text: #e7eaee; --muted: #9aa2ad; --border: #2a3038;
    --accent: #5fcf8f; --accent-text: #04140b; --link: #6fd99b; --track: #262c33;
    --map-0: #2c3038; --map-1: #173a26; --map-2: #1f5a37; --map-3: #2f824f; --map-4: #4fb174; --map-5: #9be0b4;
    --map-sea: #14171c;
    --bar: #4fb174; --bar-2: #1f5a37; --bar-weekend: #3b5c48;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--link); }
h1, h2, h3, p { margin: 0; }

main, .foot { max-width: 1200px; margin: 0 auto; padding: 0 16px; } /* 1200 as the sister projects, so the maps line up */
main { padding-top: 16px; min-height: 100vh; display: flex; flex-direction: column; gap: 16px; } /* always scrolls, as the sister pages do */
.muted { color: var(--muted); font-weight: 400; }

/* mathemantique bar above the top bar, as on vote-count, beach-count and cricket-leagues */
.site-bar { background: #007FFF; text-align: center; padding: .4rem 16px; padding-left: calc(16px + 100vw - 100%); } /* the scrollbar's width added on the left: the name sits at the window's centre */
.site-bar a { color: #fff; text-decoration: none; font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; font-weight: bold; letter-spacing: .02em; }
.site-bar a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: .5rem 1rem; padding: .7rem 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .01em; flex: 1; }
.brand .muted { font-weight: 400; margin-left: .4rem; }
.theme-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--bg); flex-shrink: 0; }
.theme-toggle button { font: inherit; font-size: .82rem; border: 0; background: transparent; color: var(--muted); padding: .25rem .65rem; border-radius: 999px; cursor: pointer; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
@media (max-width: 560px) { .brand { flex-basis: 100%; } }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.panel h2 { font-size: 1.05rem; margin-bottom: .5rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 1.05rem; margin: 0 0 .6rem; }
.crumbs .sep { color: var(--muted); }
.crumbs .here { font-weight: 700; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-align: left; }
button.link:hover { text-decoration: underline; }

/* map with its filters on the left: the same layout as the sister projects */
.map-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.map-filters { display: flex; flex-direction: column; gap: .7rem; min-width: 0; font-size: .9rem; }
.map-filters label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); }
.map-filters select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .3rem .4rem; }
.map-main { min-width: 0; }
@media (max-width: 820px) { .map-layout { grid-template-columns: minmax(0, 1fr); } }
.summary { color: var(--muted); }
.note { color: var(--muted); font-size: .82rem; margin-top: .4rem; }

.periods { display: flex; flex-wrap: wrap; gap: 6px; }
.periods button { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.periods button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.periods button:disabled { opacity: .45; cursor: default; }

.totals { width: 100%; border-collapse: collapse; font-size: .85rem; }
.totals td { padding: 3px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.totals td.n { text-align: right; font-variant-numeric: tabular-nums; padding-left: 8px; white-space: nowrap; }
.totals tr.on td { font-weight: 700; }
.totals button.link { font-size: .85rem; }

.worldmap { position: relative; }
.worldmap svg { display: block; width: 100%; height: auto; max-height: 72vh; background: var(--map-sea); border-radius: 8px; touch-action: auto; cursor: grab; }
.worldmap svg.zoomed { touch-action: none; }
.worldmap svg.dragging { cursor: grabbing; }
.worldmap .unit { stroke: var(--surface); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; fill-rule: evenodd; }
.worldmap .unit.dot { stroke-width: 1; }
.worldmap .unit:hover, .worldmap .unit:focus { stroke: var(--text); stroke-width: 1.5; outline: none; }
.worldmap .unit.dim { opacity: .35; }
.worldmap .unit.selected { stroke: var(--text); stroke-width: 2; }
.worldmap .inset { fill: none; stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-zoom { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { font: inherit; min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; }
.map-zoom button.reset { font-size: .7rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-c0 { fill: var(--map-0); background: var(--map-0); }
.map-c1 { fill: var(--map-1); background: var(--map-1); }
.map-c2 { fill: var(--map-2); background: var(--map-2); }
.map-c3 { fill: var(--map-3); background: var(--map-3); }
.map-c4 { fill: var(--map-4); background: var(--map-4); }
.map-c5 { fill: var(--map-5); background: var(--map-5); }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .9rem; margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.map-legend .sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.chart-tip { position: absolute; transform: translateX(-50%); pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); white-space: nowrap; color: var(--text); z-index: 5; }
.chart-tip .tip-head { font-weight: 600; margin-bottom: .15rem; }

/* day-by-day bars */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 200px; }
.chart .bar { fill: var(--bar); }
.chart .bar.weekend { fill: var(--bar-weekend); }
.chart .bar.part { fill: var(--bar-2); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .bar:hover { opacity: .75; }
.chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.chart-key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.chart-key .sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }

.elsewhere { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9rem; }
.elsewhere .n { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: .3rem; }

.foot { color: var(--muted); font-size: 0.8rem; padding-top: 16px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 6px; }
