:root {
  --bg: #08060E;
  --surface: #0F0B19;
  --surface-2: #120D1E;
  --surface-award: #120D16;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #EEEAF6;
  --muted: #A79FBC;
  --muted-on-glow: #D3CDE3;
  --faint: #8C84A3;
  --accent: #A57BFF;
  --accent-deep: #4B2C8F;
  --accent-wash: rgba(165, 123, 255, .10);
  --link: #C3A6FF;
  --link-hover: #E2D4FF;
  --gold: #E9C46A;
  --silver: #C7CCD8;
  --bronze: #D08B5B;
  --on-metal: #140E1C;
  --note: #D9CFA8;
  --live: #7EE0A8;
  --up: #7EE0A8;
  --down: #FF8E9C;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* Washes behind Live and Note text */
  --live-wash: rgba(126, 224, 168, .12);
  --live-edge: rgba(126, 224, 168, .3);
  --note-wash: rgba(233, 196, 106, .1);
  /* Wash behind a bad KvK Status (--down text) */
  --down-wash: rgba(255, 142, 156, .12);
  /* Wash behind the gold Draft and needs ID tags */
  --tag-wash: rgba(233, 196, 106, .14);
  /* Radii */
  --radius-sm: 12px;
  --radius-md: 14px;
  --pill: 999px;
  /* Chart swatches and the tops of the Overview's Fort Weeks columns */
  --radius-xs: 3px;
  /* Motion */
  --dur-fast: .2s;
  --dur: .6s;
  --dur-slow: 1.1s;
  --stagger: 70ms;
  /* Elevation, for bars that float over content */
  --shadow-float: 0 18px 50px rgba(0, 0, 0, .5);
  /* Reward item icons (King's Chests, resources). The chest art is 114 px, so never above 48 px */
  --reward-icon: 28px;
  --reward-icon-pick: 40px;
  /* Council admin shell (ticket 21): the icon sidebar's width */
  --rail-w: 64px;
  /* Overview charts: the Fort Weeks columns' height, the KvK ring, a calendar day, the thin meters */
  --chart-h: 120px;
  --ring-size: 132px;
  --cal-day: 34px;
  --meter-h: 8px;
  /* The Live Week's column: hatched, since it is still being read */
  --hatch: repeating-linear-gradient(135deg, var(--accent) 0 4px, var(--accent-deep) 4px 8px);
  /* Over a KvK's key art: clear at the top, the page ground under its name */
  --art-scrim: linear-gradient(180deg, rgba(8, 6, 14, .05) 0%, rgba(8, 6, 14, .55) 55%, rgba(8, 6, 14, .96) 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--sans);
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-weight: 400; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
main { flex: 1; width: 100%; }
.page { padding-top: 40px; padding-bottom: 72px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8, 6, 14, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.brand-text small { font: 12px var(--mono); color: var(--muted); }
.tabs { display: flex; gap: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 10px 14px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: color .2s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #FFFFFF; }
.tab.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--accent); animation: grow .5s var(--ease);
}
.reset-pill {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.reset-label { color: var(--muted); }
.reset-pill b { font-weight: 500; color: var(--text); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live);
  animation: ping 2s ease-out infinite;
}

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 24px; padding-bottom: 24px; font-size: 13px; color: var(--faint); }

/* ---------- Type and generic pieces ---------- */
h1, h2, h3 { margin: 0; }
h1 { font: 400 clamp(40px, 5vw, 56px)/1 var(--serif); letter-spacing: -.02em; }
h2 { font: 400 32px/1.1 var(--serif); letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow { font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.card, .panel {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px;
}
.card-head, .panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.card-head a { font-size: 14px; font-weight: 500; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h1 { margin-top: 8px; }
.section-head p { margin: 12px 0 0; max-width: 640px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }
.tag {
  display: inline-block; flex: none; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1.6;
  background: var(--accent-wash); color: var(--link);
}
.tag.draft, .tag.needs-id { background: var(--tag-wash); color: var(--gold); }
.tag.migrated, .tag.away, .tag.vacation { background: rgba(255, 255, 255, .06); color: var(--muted); }
tr.is-away td { color: var(--muted); }
tr.is-away .linkish, tr.is-away b { color: var(--muted); }
.tag.partial { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; background: none; border: 1px solid rgba(233, 196, 106, .4); color: var(--gold); }
.tag.tie { text-transform: none; letter-spacing: 0; font-weight: 500; background: none; border: 1px solid var(--line-strong); color: var(--muted); cursor: help; }
.tag.farm { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
/* Sentence-case tags: Live, Final and a KvK Status */
.tag.live, .tag.final, .tag.kvk-status { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.tag.live { background: var(--live-wash); color: var(--live); }
/* A KvK Status, toned by its rule's place: the first good, the last bad, any between a warning */
.tag.kvk-status, .tag.vacation { margin-left: 4px; }
.tag.kvk-status.good { background: var(--live-wash); color: var(--up); }
.tag.kvk-status.warn { background: var(--tag-wash); color: var(--gold); }
.tag.kvk-status.bad { background: var(--down-wash); color: var(--down); }
.tag.final { background: none; border: 1px solid var(--line-strong); color: var(--text); }
.live-line { margin-top: 8px; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); font-weight: 600; text-align: left; max-width: 100%; }
.linkish:hover { color: var(--link); }
.pid { font: 12px var(--mono); color: var(--faint); }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.note {
  display: flex; gap: 12px; padding: 12px 16px; border-radius: 12px; font-size: 13px; color: var(--note);
  background: rgba(233, 196, 106, .07); border: 1px solid rgba(233, 196, 106, .22);
}
.note svg { flex: none; margin-top: 2px; }
.pause-note { margin-bottom: 16px; }
/* A note inside a card keeps 16 px from the block under it (the KvK toolbar, a wizard's text) */
.card > .note:where(:not(:last-child)) { margin-bottom: 16px; }
/* A card's opening line, such as the KvK table's "Counted N days": flush with the card's top padding */
.count-line { margin-top: 0; }
/* A KvK's Story key art behind its name (ticket 19), the credit under it */
.kvk-banner { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: 280px; padding: 24px 32px; border-radius: var(--radius); border: 1px solid var(--line-2); }
.kvk-banner .kvk-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.kvk-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--art-scrim); }
.kvk-banner h1 { margin: 8px 0 0; }
.kvk-credit { margin: 8px 4px 0; text-align: right; font: 12px var(--mono); color: var(--faint); }
.kvk-lede { margin: 12px 0 24px; max-width: 640px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .15s, border-color .2s;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* Segmented controls and chips */
.seg { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; }
.seg button { border: 0; background: none; padding: 8px 16px; min-height: 36px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--on-metal); font-weight: 600; }
/* The four Governor views (Mains · Mains + Farms · Others · All), each with its count */
.seg.views small { margin-left: 4px; font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  border-radius: 12px; padding: 8px 14px; cursor: pointer; text-align: left; line-height: 1.3;
}
.chip b { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.chip small { font: 12px var(--mono); }
.chip:hover { border-color: var(--line-strong); }
.chip.on { border-color: var(--accent); background: var(--accent-wash); }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.glow {
  position: absolute; left: 50%; bottom: -180px; width: 620px; height: 420px; margin-left: -310px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(165, 123, 255, .38), rgba(165, 123, 255, 0));
  filter: blur(10px); pointer-events: none; animation: breathe 7s ease-in-out infinite;
}
.orbit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.spin-a, .spin-b { transform-box: fill-box; transform-origin: 50% 50%; }
.spin-a { animation: spin 90s linear infinite; }
.spin-b { animation: spin 140s linear infinite reverse; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: end; padding-top: 64px; }
.hero-copy { padding-bottom: 56px; min-width: 0; }
.week-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.week-meta .eyebrow { color: var(--link); }
.hero h1 { margin-top: 16px; font-size: clamp(44px, 6vw, 76px); line-height: .98; overflow-wrap: anywhere; }
.hero h1 em { color: var(--gold); }
.hero-sub { margin: 20px 0 0; max-width: 480px; color: var(--muted); font-size: 17px; }

.find { margin-top: 28px; max-width: 520px; }
.find label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.search-box {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(165, 123, 255, .18); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { filter: invert(.7); }
.kbd { font: 500 12px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 6px; }
.find-out { display: grid; gap: 8px; margin-top: 12px; }
.find-out:empty { display: none; }
.find-hit {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 16px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--accent-wash); border: 1px solid rgba(165, 123, 255, .35); animation: up .4s var(--ease) both;
}
.find-hit:hover { border-color: var(--accent); }
.find-hit .r { font: 22px var(--mono); color: var(--link); min-width: 52px; }
.find-hit .who { flex: 1; min-width: 0; }
.find-hit .who b { display: block; font-weight: 600; }
.find-hit .who small { font: 12px var(--mono); color: var(--muted); }
.find-hit .fc { text-align: right; }
.find-hit .fc b { font-size: 20px; font-weight: 600; }
.find-hit .fc small { display: block; color: var(--muted); font-size: 12px; }
.find-more, .find-none { margin: 0; font-size: 13px; color: var(--muted); }

/* Podium */
.hero-podium { position: relative; min-width: 0; }
.podium-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.medal {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  color: var(--on-metal); font-weight: 700; font-size: 18px;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0) 46%), var(--c);
  box-shadow: 0 0 0 4px rgba(8, 6, 14, .9), 0 0 32px var(--halo);
  animation: pop .6s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--d) + 700ms);
}
.step.first .medal { width: 64px; height: 64px; font-size: 22px; }
.step-who { margin: 12px 0 16px; min-width: 0; max-width: 100%; }
.step-who .linkish { display: block; font-size: 15px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.first .step-who .linkish { font-size: 18px; }
.step-who .pid { font-size: 11px; color: var(--muted); }
.step-block {
  width: 100%; height: var(--h); padding-top: 18px; border-radius: 14px 14px 0 0;
  border: 1px solid var(--edge); border-bottom: 0;
  background: linear-gradient(180deg, var(--tint), rgba(18, 13, 30, .6));
  transform-origin: 50% 100%; animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d);
}
.step-block b { display: block; font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.step.first .step-block b { font-size: 52px; }
.step-block small { display: block; margin-top: 8px; color: var(--muted-on-glow); font-size: 12px; }
.step.first { --c: var(--gold); --halo: rgba(233, 196, 106, .45); --tint: rgba(233, 196, 106, .22); --edge: rgba(233, 196, 106, .45); --h: 176px; --d: 500ms; }
.step.second { --c: var(--silver); --halo: rgba(199, 204, 216, .3); --tint: rgba(199, 204, 216, .14); --edge: rgba(199, 204, 216, .32); --h: 128px; --d: 300ms; }
.step.third { --c: var(--bronze); --halo: rgba(208, 139, 91, .35); --tint: rgba(208, 139, 91, .16); --edge: rgba(208, 139, 91, .38); --h: 104px; --d: 150ms; }

/* ---------- Home: stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 24px 28px; border-left: 1px solid var(--line-2); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { margin-top: 8px; font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.stat .value.mono { font-size: 28px; font-weight: 500; margin-top: 8px; }
.stat .sub { font-size: 13px; color: var(--faint); }

/* ---------- Home: body ---------- */
.body-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 24px; padding-bottom: 80px; }
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ranking { padding: 0; overflow: hidden; }
.ranking .card-head { padding: 24px 24px 0; margin-bottom: 12px; }
.ranking .card-head h2 { margin-top: 4px; font-size: 34px; }
.ranking > .note { margin: 0 24px 8px; }
.ranking .rank-list { padding: 0 8px 12px; }

/* Ranking rows: flat list, hairline-free, hover wash */
.rank-list { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px 20px; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px; transition: background .2s;
}
.row.with-delta { grid-template-columns: 44px minmax(0, 1fr) 72px 64px; }
.row:hover, .row:focus-within { background: rgba(165, 123, 255, .06); }
.row .pos { font: 15px var(--mono); color: var(--faint); text-align: center; }
.row.first .pos { color: var(--gold); } .row.second .pos { color: var(--silver); } .row.third .pos { color: var(--bronze); }
.row-main { min-width: 0; }
.row-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-name .linkish { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-name .linkish::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.row-name .linkish:focus-visible { outline: none; }
.row-name .linkish:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.row .tag { position: relative; z-index: 1; }
.bar { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transform-origin: 0 50%; animation: fill 1.1s var(--ease) both;
}
.row.first .bar i { background: linear-gradient(90deg, rgba(165, 123, 255, .35), var(--gold)); }
.row.second .bar i { background: linear-gradient(90deg, rgba(165, 123, 255, .35), var(--silver)); }
.row.third .bar i { background: linear-gradient(90deg, rgba(165, 123, 255, .35), var(--bronze)); }
.row .count { text-align: right; font-size: 17px; font-weight: 600; }
/* "Main + Farm": a Main's count is its Group Score, and its parts (the Main's own Fort Count, then each
   Farm's real Fort Count) sit indented under it, quieter, so they never read as ranked or as extra. */
.row .count small { display: block; font: 400 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.row.part { padding-top: 8px; padding-bottom: 8px; }
.row.part .row-main { padding-left: 20px; border-left: 1px solid var(--line-2); }
.row.part .linkish { font-weight: 500; color: var(--muted); }
.row.part .linkish:hover { color: var(--link); }
.row.part .count { font-size: 15px; font-weight: 500; color: var(--muted); }
.row.part .bar i { background: var(--line-strong); }
.row .go { opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.row:hover .go, .row:focus-within .go { opacity: 1; transform: none; }
.delta { font: 500 12px var(--mono); white-space: nowrap; text-align: right; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--faint); } .delta.new { color: var(--link); }

/* Weekly Award card */
.award { position: relative; overflow: hidden; background: var(--surface-award); border-color: rgba(233, 196, 106, .3); }
.award-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.award-head .eyebrow { color: var(--gold); }
.award h2 { margin-top: 8px; }
.award > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.award > .paid-on { margin-top: 16px; }
.paid-on b { color: var(--text); font-weight: 600; }
.tiers { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 1px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.tiers li { display: flex; align-items: center; gap: 16px; padding: 12px 14px; background: var(--surface-award); }
.tiers .place { min-width: 56px; flex: none; white-space: nowrap; font-family: var(--mono); color: var(--text); }
.tiers li:nth-child(1) .place { color: var(--gold); }
.tiers li:nth-child(2) .place { color: var(--silver); }
.tiers li:nth-child(3) .place { color: var(--bronze); }
.tiers .reward { color: var(--muted); font-size: 14px; }
/* Weekly Award winners (home card, past winners, popup): the metal follows the place, not the row,
   so two Mains given 1st are both gold. Each winner stacks the Main, the award, then the Council's note. */
.tiers.winners li { align-items: flex-start; }
.tiers.winners li .place { color: var(--text); }
.tiers.winners li .place.p1, .mini-list .place.p1, .aw-rows .place.p1 { color: var(--gold); }
.tiers.winners li .place.p2, .mini-list .place.p2, .aw-rows .place.p2 { color: var(--silver); }
.tiers.winners li .place.p3, .mini-list .place.p3, .aw-rows .place.p3 { color: var(--bronze); }
.mini-list .place { min-width: 44px; flex: none; font-size: 13px; color: var(--muted); }
.aw { flex: 1; min-width: 0; display: grid; gap: 4px; }
.aw .linkish { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.aw small { font-size: 13px; color: var(--faint); }
/* Reward items on an award: icon, amount, name. They wrap as whole items, never mid-item. */
.reward-items { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.reward-item { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); white-space: nowrap; }
.reward-item img { width: var(--reward-icon); height: var(--reward-icon); object-fit: contain; flex: none; }
.reward-item b { font-weight: 600; }
.rules { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.shine::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .12), transparent);
  transform: translateX(-150%); animation: shine 5s ease-in-out 2s infinite;
}

/* Kingdom news */
.news-list { display: flex; flex-direction: column; margin-top: 12px; }
.news-list article { padding: 16px 0; border-top: 1px solid var(--line); }
.news-list article:last-child { padding-bottom: 0; }
.news-list .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--faint); }
.news-list h3 { margin-top: 4px; }
.news-list p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Mini lists (Events, popup) */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.mini-list li:first-child { border-top: 0; }
.mini-list .i { width: 24px; flex: none; font: 13px var(--mono); color: var(--faint); }
.mini-list .linkish { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list b { font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font: 500 11px var(--mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; padding: 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
th.r, td.r { text-align: right; }
th button { background: none; border: 0; padding: 4px 0; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
th button:hover, th.sorted button { color: var(--text); }
th.sorted button::after { content: " ↓"; color: var(--link); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.name-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tbody tr { transition: background .2s; }
tbody tr:hover td { background: rgba(165, 123, 255, .05); }
.spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; vertical-align: middle; }
.spark i { width: 8px; border-radius: 2px 2px 0 0; background: var(--accent); opacity: .85; }
.spark i.miss { background: var(--line-strong); height: 3px !important; opacity: 1; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .chips { margin-bottom: 0; flex: 1 1 auto; }
.search {
  flex: 1; min-width: 200px; height: 48px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
}
.search::placeholder { color: var(--faint); }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(165, 123, 255, .18); }
.more { display: flex; margin: 16px auto 0; }

/* Events grid */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }

/* ---------- Governor popup ---------- */
dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(5, 2, 10, .72); backdrop-filter: blur(3px); }
.dlg-head { position: relative; padding: 24px 24px 16px; border-bottom: 1px solid var(--line); }
.dlg-head .eyebrow { color: var(--muted); }
.dlg-head h2 { margin-top: 8px; font-size: 36px; padding-right: 40px; overflow-wrap: anywhere; }
.dlg-sub { margin: 8px 0 0; color: var(--muted); }
.dlg-sub .linkish { font-weight: 600; }
.dlg-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 20px; line-height: 1;
}
.dlg-close:hover { border-color: var(--accent); }
.dlg-body { padding: 20px 24px 24px; display: grid; gap: 20px; }
.dlg-body .eyebrow { margin-bottom: 8px; color: var(--muted); }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; gap: 1px; background: var(--line-2); }
.kv div { background: var(--surface); padding: 12px 14px; min-width: 0; }
.kv small { display: block; color: var(--muted); font-size: 12px; }
.kv b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.aka { display: flex; flex-wrap: wrap; gap: 6px; }
.aka span { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); overflow-wrap: anywhere; }

/* ---------- Council admin ---------- */
/* Shell (ticket 21): the icon sidebar, then the header over the Overview or a section's workspace */
.admin-shell { display: flex; gap: 24px; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px 32px 72px 24px; flex: 1; }
.rail { position: sticky; top: 24px; flex: none; width: var(--rail-w); height: calc(100vh - 48px); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rail-mark { display: grid; place-items: center; width: 44px; height: 44px; }
.rail-pill { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line-2); }
.rail-low { margin-top: auto; }
.rail-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.rail-btn:hover { color: var(--text); background: var(--surface-2); }
.rail-btn.on, .rail-btn.on:hover { background: var(--accent); color: var(--on-metal); }
.admin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.head-title { min-width: 0; }
.head-title h1 { font-size: clamp(36px, 4vw, 52px); }
.head-title .eyebrow + h1 { margin-top: 8px; }
.head-line { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.head-line.mono { font-size: 13px; }
.head-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.admin-who { color: var(--muted); font: 13px var(--mono); max-width: 260px; }
.gov-search { position: relative; width: 320px; max-width: 100%; }
.gov-search .search-box { height: 44px; border-radius: var(--pill); color: var(--faint); }
.gov-hits {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 4px;
  border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float);
}
.gov-hits li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; min-width: 0; }
.gov-hits li[aria-selected="true"] { background: var(--accent-wash); }
.gov-hits li.none { color: var(--muted); cursor: default; }
.gov-hits .pid { margin-left: 4px; }
.admin { flex: 1; min-width: 0; }
.workspace { display: grid; gap: 24px; min-width: 0; }
.admin-content { min-width: 0; }
.admin-content > section { display: grid; gap: 16px; }
.admin-content > section > div { display: grid; gap: 16px; min-width: 0; }
/* Cards inside one form, spaced like the cards around it */
.admin-stack { display: grid; gap: 16px; min-width: 0; }
.admin-signin { flex: 1 1 100%; max-width: 460px; margin: 24px auto; }
.admin-signin > p { color: var(--muted); }
.admin-signin form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.admin-msg { margin: 0; min-height: 1.4em; color: var(--muted); }

/* Task tabs: the open section's tasks, the open one underlined in the accent like the public .tab */
.task-tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; border-bottom: 1px solid var(--line); }
.task {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: color var(--dur-fast);
}
.task:hover { color: var(--text); }
.task[aria-current] { color: var(--text); }
.task[aria-current]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--accent); animation: grow var(--dur) var(--ease);
}
/* A task's status dot; also the Overview's legends */
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.ok, .dot.live, .dot.good { background: var(--up); }
.dot.warn { background: var(--gold); }
.dot.bad { background: var(--down); }
.dot.info { background: var(--note); }
.dot.main { background: var(--accent); }
.dot.farm { background: var(--link-hover); }
.dot.vacation { background: var(--line-strong); }
.badge { flex: none; padding: 1px 8px; border-radius: var(--pill); font: 11px var(--mono); background: var(--accent-wash); color: var(--link); }
.badge:empty { display: none; }
.badge.review { background: var(--note-wash); color: var(--note); }
.badge.soon { background: var(--surface-2); color: var(--muted); }

/* Task heading */
.task-title { margin-top: 8px; }
.task-lede { margin: 8px 0 0; max-width: 640px; color: var(--muted); }

/* Buttons: secondary is the plain .btn */
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-metal); }
.btn.primary:hover { background: var(--link); border-color: var(--link); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--text); border-color: var(--line-strong); }
.btn.sm { min-height: 36px; padding: 0 14px; }

/* Labelled fields */
.fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.field { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.field.wide { flex: 2 1 260px; }
.field input, .field select, .field textarea {
  height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; min-width: 0;
}
.field textarea { height: auto; padding: 10px 14px; font: 15px/1.5 var(--mono); resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.admin-card h2 { font-size: 28px; }
.admin-card > p { margin: 8px 0 0; font-size: 14px; }
/* A button standing alone in a card (Pause Forts, Set up a new KvK) keeps 16 px from the block above it */
.admin-card > .btn, .admin-card > p:has(> .btn:only-child) { margin-top: 16px; }
.match { margin: 12px 0 0; font-size: 13px; color: var(--faint); }
.match b { color: var(--text); font-weight: 600; }

/* Sticky save bar */
.save-bar {
  position: sticky; bottom: 16px; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 12px 12px 12px 20px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--accent-deep); box-shadow: var(--shadow-float); animation: up var(--dur) var(--ease) both;
}
.save-bar .sum { flex: 1 1 220px; font-size: 14px; }
.save-bar .sum b { font-weight: 600; }
.save-bar .sum span { color: var(--muted); }
.pulse.unsaved, .pulse.unsaved::after { background: var(--accent); }

/* Farm links */
.progress { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; font-size: 14px; }
.progress b { font-weight: 600; }
.progress .bar { flex: 1 1 200px; margin: 0; }
.progress .bar i { animation: none; transform: scaleX(var(--p)); transition: transform var(--dur-slow) var(--ease); }
.groups { display: grid; gap: 12px; }
.main-group { padding: 0; overflow: hidden; }
.main-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.main-head .eyebrow { font-size: 11px; color: var(--faint); }
.main-who, .farm-row .who, .farm-list .who, .farm-list .of { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.main-who { flex: 0 1 auto; font-weight: 600; }
.main-head .sum { margin-left: auto; font-size: 13px; color: var(--muted); }
.farm-rows { list-style: none; margin: 0; padding: 4px 8px; }
.farm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; }
.farm-row + .farm-row { border-top: 1px solid var(--line); }
.farm-row .link-icon { flex: none; color: var(--faint); }
.farm-row .who { flex: 1 1 200px; font-weight: 500; }
.farm-row.dismissed { opacity: .55; }
.why { font: 12px var(--mono); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--accent-wash); color: var(--link); }
.row-actions { display: flex; align-items: center; gap: 6px; }
.state { padding: 4px 10px; border-radius: var(--pill); font-size: 13px; font-weight: 600; }
.state.linked { background: var(--live-wash); color: var(--live); }
.state.dismissed { background: var(--surface-2); color: var(--muted); }
.none-left { color: var(--muted); }
.farm-list { list-style: none; margin: 12px 0 0; padding: 0; }
.farm-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.farm-list .who { flex: 1 1 200px; }
.farm-list .of { flex: 1 1 200px; }
/* A Main's rarer actions behind "⋯" (Mains task, ticket 28): a native <details>, its menu floating under it. */
.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; padding: 6px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-float); }
.vacation-line { margin: 12px 0 0; font-size: 14px; }

/* Fort Week */
.fw-rows { list-style: none; margin: 12px 0 0; padding: 0; }
.fw-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto minmax(180px, 1.2fr); align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fw-row.clash { box-shadow: inset 2px 0 0 var(--down); }
.fw-row .pos { font: 14px var(--mono); color: var(--faint); text-align: center; }
.fw-row .who { display: grid; gap: 2px; min-width: 0; }
.fw-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.fw-row .count { min-width: 40px; text-align: right; font-weight: 600; }

/* Weekly Awards on the Fort Week screen and the KvK list: flat rows like the Farm list, the place in its metal */
.field.narrow { flex: 0 1 96px; }
.aw-rows { list-style: none; margin: 12px 0 0; padding: 0; }
/* Rows reach 12 px past the card's text on each side, so the washed row being edited (a Weekly Award, a KvK) has room around its words */
.aw-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 -12px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.aw-rows .place { min-width: 44px; font: 14px var(--mono); color: var(--text); }
.aw-rows .who { flex: 1 1 200px; display: flex; align-items: baseline; gap: 8px; min-width: 0; font-weight: 500; }
.aw-rows .aw { flex: 2 1 240px; }
/* The Weekly Awards draft: Fill and where the draft came from, the row being edited, the add / edit form */
.aw-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.aw-fill .match { margin: 0; flex: 1 1 220px; }
.admin-card > .note { margin-top: 12px; }
.aw-rows li.editing { background: var(--accent-wash); }
.aw-rows .row-actions { margin-left: auto; }
.aw-form-title, .rules-head { margin: 24px 0 0; font-size: 15px; font-weight: 600; }
/* The KvK Status rules: one .fields row each, the last one's place taken by "Everyone else" */
.field.pct { flex: 0 1 240px; }
/* The Acclaim Requirement preview: a small table of example accounts under its Preview toggle */
.req-preview-toggle { margin: 8px 0 0; }
table.req-preview { width: auto; margin-top: 8px; font-size: 14px; }
table.req-preview th, table.req-preview td { padding: 8px 12px; }
table.req-preview th:first-child, table.req-preview td:first-child { padding-left: 0; }
.status-rules { list-style: none; margin: 0; padding: 0; }
.status-rules > li.fields { margin-top: 12px; }
.status-rules > li.fields + li.fields { padding-top: 12px; border-top: 1px solid var(--line); }
.status-rules .field.narrow { flex-basis: 136px; }
.status-rules .rule-rest { flex: 0 1 136px; margin: 0; padding-bottom: 12px; }
.rule-moves { display: flex; gap: 4px; }
/* The admin KvK card: the Story's key art with the KvK's name and Edit over it */
.kvk-card-art { min-height: 168px; padding: 20px 24px; border-radius: var(--radius-md); justify-content: space-between; gap: 16px; }
.kvk-card-art h2 { margin: 8px 0 0; }
.kvk-card h2 .tag { vertical-align: middle; }
.kvk-card .review { margin-top: 16px; }
/* Reward item picker: one tile per item, each with its own amount */
.field.reward-pick { flex: 1 1 100%; margin: 0; padding: 0; border: 0; }
.reward-pick legend { padding: 0; margin-bottom: 8px; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.reward-opt { display: grid; grid-template-columns: var(--reward-icon-pick) 1fr; align-items: center; gap: 4px 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text); }
.reward-opt:focus-within { border-color: var(--accent); }
.reward-opt img { width: var(--reward-icon-pick); height: var(--reward-icon-pick); object-fit: contain; grid-row: span 2; }
.reward-opt span { font-size: 13px; }
.field .reward-opt input { height: 36px; padding: 0 10px; background: var(--surface); }

/* KvK setup wizard (ticket 19): the steps, the Story cards, the review */
.wiz-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.wiz-steps button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--pill); background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.wiz-steps button:disabled { color: var(--faint); border-style: dashed; cursor: default; }
.wiz-steps .mono { color: var(--faint); margin-right: 4px; }
.wiz-steps .done button { color: var(--text); }
.wiz-steps .on button { border-color: var(--accent); background: var(--accent-wash); color: var(--text); }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; margin-top: 16px; }
.story-card { display: grid; gap: 8px; padding: 8px 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.story-card img { width: 100%; height: auto; aspect-ratio: 316 / 556; border-radius: var(--radius-sm); }
.story-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.story-card.on { border-color: var(--accent); background: var(--accent-wash); }
.wiz-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.wizard > .note { margin-top: 12px; }
.review { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 20px; margin: 12px 0 0; font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Tasks not built yet */
.plan { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan li { padding: 20px; border-radius: var(--radius-md); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; }
.plan .mono { display: block; font-size: 12px; color: var(--faint); }
.plan b { display: block; margin-top: 4px; color: var(--text); font-size: 15px; font-weight: 600; }
.soon-note { margin: 0; font-size: 13px; color: var(--faint); }

@media (max-width: 760px) {
  .task { padding: 0 10px; }
  .task[aria-current]::after { left: 10px; right: 10px; }
  .save-bar { padding-left: 16px; }
}
@media (max-width: 640px) {
  .story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wiz-steps button { min-height: 44px; min-width: 44px; }
  /* On a phone the steps show their numbers; the current one keeps its name */
  .wiz-steps li:not(.on) .wl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wiz-steps .mono { margin-right: 0; }
  .wiz-steps .on .mono { margin-right: 4px; }
  .review { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .review dd + dt { margin-top: 12px; }
  /* The icon sidebar becomes a row across the top */
  .admin-shell { flex-direction: column; gap: 16px; padding: 12px 16px 48px; }
  .rail { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .rail-mark { width: 36px; }
  .rail-pill { flex-direction: row; gap: 2px; padding: 4px; }
  .rail-low { margin: 0 0 0 auto; }
  .rail-btn { width: 40px; height: 40px; }
  .head-right { flex-wrap: wrap; width: 100%; }
  .gov-search { width: 100%; }
  .gov-search .kbd { display: none; }
  .admin-who { max-width: 100%; font-size: 12px; }
  .save-bar .sum { font-size: 13px; }
  .main-head .sum { margin-left: 0; }
  .fw-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .fw-row .fw-gov { grid-column: 2 / 4; }
}

/* ---------- Council Overview (ticket 21) ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ov-card { min-width: 0; }
.ov-grid > .ov-card:nth-child(2) { --d: var(--stagger); }
.ov-grid > .ov-card:nth-child(3) { --d: calc(var(--stagger) * 2); }
.ov-grid > .ov-card:nth-child(n+4) { --d: calc(var(--stagger) * 3); }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ov-head h2 { font-size: 28px; }
.ov-small { margin: 0; font-size: 13px; }
.ov-big { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.ov-big b { font-size: 44px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
.ov-big span { font-size: 13px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.legend li b { margin-left: auto; padding-left: 12px; color: var(--text); font-weight: 600; }
.legend-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: var(--radius-xs); }
.sw:not(:first-child) { margin-left: 8px; }
.sw.full { background: var(--accent); }
.sw.part { background: var(--accent-deep); }
.sw.live { background: var(--hatch); }
.sw.snap { background: var(--accent); border-radius: 50%; }
.sw.today { box-shadow: inset 0 0 0 1.5px var(--text); border-radius: 50%; }
.sw.kvkday { background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent-deep); border-radius: 50%; }

/* KvK card: two columns wide, the Story's key art behind the scrim */
.ov-kvk { grid-column: span 2; position: relative; isolation: isolate; overflow: hidden; padding: 0; display: flex; }
.ov-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.ov-kvk.has-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--art-scrim); }
.ov-kvk-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; width: 100%; padding: 24px; }
.ov-kvk-l { flex: 1 1 280px; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.ov-kvk h2 { margin: 0 0 8px; font-size: 40px; line-height: 1; overflow-wrap: anywhere; }
.ov-kvk-l .btn { margin-top: 8px; }
.daybar { width: 100%; height: var(--meter-h); border-radius: var(--pill); background: var(--line-2); overflow: hidden; }
.daybar i { display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: inherit; background: var(--accent); transform-origin: left; animation: fill var(--dur-slow) var(--ease) both; }
.ov-ring-box { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 20px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line-2); }
.ov-ring-box .legend { min-width: 150px; }
.ring-wait { display: grid; gap: 12px; max-width: 200px; }
.ring-wrap { position: relative; width: var(--ring-size); height: var(--ring-size); flex: none; }
.ring { width: 100%; height: 100%; animation: ring-in var(--dur-slow) var(--ease) both; }
.ring circle { fill: none; stroke-width: 16; }
.ring .arc-bg { stroke: var(--line-2); }
.ring .arc { stroke: var(--faint); }
.ring .arc.good { stroke: var(--up); }
.ring .arc.warn { stroke: var(--gold); }
.ring .arc.bad { stroke: var(--down); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-c b { font-size: 26px; font-weight: 600; }
.ring-c small { font-size: 12px; color: var(--muted); }
@keyframes ring-in { from { opacity: 0; transform: rotate(-60deg) scale(.92); } to { opacity: 1; transform: none; } }

/* Needs you: one row per open item, its arrow opening the task where it is done */
.ov-count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--pill); background: var(--tag-wash); color: var(--gold); font-size: 13px; font-weight: 600; }
.ov-count.none { background: var(--live-wash); color: var(--live); }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.needs li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.needs-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--tag-wash); color: var(--gold); }
.needs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.needs-t b { font-size: 14px; font-weight: 600; }
.needs-t small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.needs-go {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.needs-go:hover { background: var(--accent); border-color: var(--accent); color: var(--on-metal); }
.needs-clear { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--up); }

/* Fort Weeks columns: Complete in the accent, Partial deep, the Live Week hatched; they rise in week order */
.wbars { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 6px; height: var(--chart-h); }
.wbar { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wbar i { display: block; width: 100%; max-width: 28px; min-height: 3px; height: calc(var(--p) * 100%); border-radius: var(--radius-xs) var(--radius-xs) 0 0; background: var(--accent); transform-origin: bottom; animation: rise var(--dur-slow) var(--ease) both; animation-delay: var(--d, 0ms); }
.wbar.partial i { background: var(--accent-deep); }
.wbar.live i { background: var(--hatch); }
.wbars-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--faint); }

/* Roster Snapshots calendar: a dot on each snapshot day, today ringed, the KvK's days washed */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.cal th { padding: 0 0 6px; border: 0; font: 11px var(--mono); letter-spacing: 0; text-transform: none; color: var(--faint); font-weight: 400; text-align: center; }
.cal td, .cal tbody tr:hover td { padding: 2px 0; border: 0; background: none; }
.cal .d { position: relative; display: grid; place-items: center; width: var(--cal-day); height: var(--cal-day); max-width: 100%; margin: 0 auto; border-radius: 50%; font-size: 12px; color: var(--faint); }
.cal .d.kvkday { background: var(--accent-wash); color: var(--text); }
.cal .d.snap::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal .d.today { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }

/* Roster card: the Mains / Farms / Unmarked split */
.kindbar { display: flex; gap: 2px; height: var(--meter-h); margin: 0 0 16px; border-radius: var(--pill); overflow: hidden; transform-origin: left; animation: fill var(--dur-slow) var(--ease) both; }
.kindbar .main { background: var(--accent); }
.kindbar .farm { background: var(--link-hover); }
.kindbar .unmarked { background: var(--line-strong); }
.ov-strong { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; min-width: 0; }
.ov-strong b { min-width: 0; color: var(--text); font-weight: 600; }
.ov-strong .num { flex: none; }

/* Governor card: read-only, a panel over the current view */
.gov-card {
  position: fixed; top: 16px; right: 16px; bottom: 16px; z-index: 40; width: 400px; max-width: calc(100% - 32px); overflow-y: auto;
  padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float);
  animation: up var(--dur) var(--ease) both;
}
.gov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gov-card-who { min-width: 0; }
.gov-card-who h2 { margin-top: 8px; font-size: 32px; }
.gov-card h3 { margin: 24px 0 8px; }
.gov-card .review { margin-top: 16px; }
.gov-list, .gov-names, .gov-forts, .gov-awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.gov-list li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.gov-kind { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.gov-names { max-height: 180px; overflow-y: auto; }
.gov-names li, .gov-forts li { padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.gov-forts li { display: flex; justify-content: space-between; gap: 12px; }
.gov-awards li { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gov-awards .mono { font-size: 12px; }
.gov-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
@media (max-width: 960px) {
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-kvk { grid-column: 1 / -1; }
  .ov-kvk-in { padding: 20px; }
  .ov-kvk h2 { font-size: 30px; }
  .gov-card { top: 0; right: 0; bottom: 0; width: 100%; max-width: none; border-radius: 0; }
  /* Anything tapped on a phone is 44 px */
  .ov-card .btn.sm, .gov-card .btn.sm, .gov-hits li { min-height: 44px; }
}

/* ---------- Motion ---------- */
.reveal { animation: up .8s var(--ease) both; animation-delay: var(--d, 0ms); }
/* The next section after a page head: one stagger step behind it */
.reveal-next { --d: calc(var(--stagger) * 2); }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 75%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shine { 0% { transform: translateX(-150%); } 30%, 100% { transform: translateX(350%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .body-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 8px; }
  .hero-copy { padding-bottom: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 640px) {
  /* On a phone the Governor views take their own full-width row, the search under it; a label may wrap
     inside its button, the count sits under it, and nothing scrolls sideways */
  .toolbar .seg.views { display: flex; width: 100%; border-radius: var(--radius-md); }
  .seg.views button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 8px; line-height: 1.25; border-radius: var(--radius-sm); }
  .seg.views small { display: block; margin-left: 0; }
  .toolbar .search { flex-basis: 100%; min-width: 0; }
  .wrap { padding: 0 16px; }
  .page { padding-top: 28px; }
  .kvk-banner { min-height: 168px; padding: 16px; }
  .topbar-in { gap: 0 12px; min-height: 0; padding-top: 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-text b { font-size: 14px; }
  .brand-text small { font-size: 11px; }
  .reset-pill { padding: 6px 10px; font-size: 12px; gap: 8px; }
  .reset-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabs { order: 3; width: calc(100% + 32px); margin: 8px -16px 0; padding: 0 12px; overflow-x: auto; border-top: 1px solid var(--line); }
  .tab { border-radius: 0; padding: 12px; }
  .tab.active::after { left: 12px; right: 12px; bottom: 0; }
  .hero-grid { padding-top: 32px; }
  .hero h1 { font-size: 44px; line-height: 1; }
  .hero-sub { font-size: 15px; }
  .kbd { display: none; }
  .podium { gap: 8px; }
  .medal { width: 40px; height: 40px; font-size: 16px; }
  .step.first .medal { width: 50px; height: 50px; font-size: 18px; }
  .step-who .linkish { font-size: 13px; }
  .step.first .step-who .linkish { font-size: 14px; }
  .step.first { --h: 136px; } .step.second { --h: 96px; } .step.third { --h: 80px; }
  .step-block { padding-top: 14px; }
  .step-block b { font-size: 26px; }
  .step.first .step-block b { font-size: 36px; }
  .step-block small { font-size: 11px; }
  .stat { padding: 20px 16px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat .value { font-size: 28px; }
  .stat .value.mono { font-size: 22px; }
  .body-grid { padding-top: 16px; padding-bottom: 48px; gap: 20px; }
  .card, .panel { padding: 20px; }
  .ranking { padding: 0; }
  .ranking .card-head { padding: 20px 16px 0; }
  .ranking .card-head h2 { font-size: 30px; }
  .ranking > .note { margin: 0 16px 8px; }
  .ranking .rank-list { padding: 0 4px 8px; }
  .row { grid-template-columns: 30px minmax(0, 1fr) 48px; gap: 10px; padding: 14px 12px; }
  .row.with-delta { grid-template-columns: 30px minmax(0, 1fr) 48px 48px; }
  .row .go { display: none; }
  .table-wrap { margin: 0 -20px; padding: 0 20px; }
  /* The KvK table keeps Progress and the KvK Status on a phone; the Acclaim Requirement waits for a wider screen */
  .req-col { display: none; }
  .kv div { padding: 10px 12px; }
  .kv b { font-size: 16px; }
  h2 { font-size: 28px; }
}
