/* CrankWeb site bundle */
/* ---- css/core.css ---- */
/* =============================================================================
   CrankWeb v9 "Machined" design system: core layer
   Shared by the public site and the admin. Tokens, reset, type, and every
   component. Layout for each surface lives in site.css / admin.css; page
   specifics live in css/pages/site-*.css and css/pages/admin-*.css.
   Rules: square corners, 2px pixel steps, hard shadows only, no gradient washes,
   no glow, no blur. Theme colours arrive from /theme.css as custom properties.
   See docs/DESIGN-SYSTEM.md for markup.
   ========================================================================== */

/* ---- fonts (self-hosted, SIL OFL; see /fonts/OFL-*.txt) ------------------- */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-400-italic.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Metric-matched fallbacks: while the web fonts load, text keeps nearly the same box. */
/* CrankWeb Craft: a proportional build of Monocraft (OFL, fonts/OFL-Monocraft.txt) that matches the in-game font. One weight; its pixel grid is
   9px per em, so it is only set at 18, 27, 36, 45 or 54px to keep every pixel square. */
@font-face { font-family: 'CrankWeb Craft'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/crankweb-craft.woff2') format('woff2'); }
@font-face { font-family: 'Plex Fallback'; src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue'), local('Helvetica'); size-adjust: 101.9%; ascent-override: 100.59%; descent-override: 26.99%; line-gap-override: 0%; }

/* ---- tokens ------------------------------------------------------------------ */
/* Defaults are the Machined preset. /theme.css overrides the themeable ones. */
:root {
  color-scheme: dark;

  /* themeable: surfaces */
  --bg: #1d1d21;            /* page */
  --bg-2: #232327;          /* bands, top bar */
  --surface: #2b2b30;       /* plates */
  --surface-2: #202024;     /* plate header strips */
  --surface-3: #232327;     /* key/value cells, table heads */
  --surface-hover: #303036; /* row hover */
  --surface-hi: #404047;    /* plate bevel light */
  --surface-lo: #1f1f23;    /* plate bevel dark */
  --strip-hi: #34343a;
  --well: #141417;          /* inputs, slots, footer */
  --side: #18181b;          /* admin sidebar */
  --frame: #3a3a40; --frame-hi: #5e5e66; --frame-lo: #232327;
  --tex-base: #232327; --tex-mortar: #111114; --tex-hi: #303036; --tex-mid: #2d2d33; --tex-lo: #1b1b1f;

  /* themeable: copper role (accent) */
  --accent: #c26b3c; --accent-plate: #c26b3c; --accent-hi: #e08a5a; --accent-lo: #8a4422; --accent-ink: #1a100b;
  --btn-accent: #9a4f28; --btn-accent-hover: #a6552b; --btn-accent-hi: #e08a5a; --btn-accent-lo: #5e2a10; --btn-accent-ink: #fff3e6; --btn-accent-shade: #4a200c;
  --link: #e8956a; --link-hover: #ffc39b;
  /* themeable: secondary metal (accent-2) */
  --accent-2: #5f9e8a; --accent-2-hi: #a8d8c6; --accent-2-lo: #24332e; --accent-2-text: #7fbfa9;

  /* themeable: imagery and effects (set by /theme.css; never inline) */
  --hero-image: none; --page-image: none; --fx-intensity: .55;

  /* fixed: ink. Contrast vs every surface preset >= 4.5:1 (muted is the lowest at 4.8+) */
  --ink-bright: #f6f3ec; --ink-strong: #f4f1ea; --ink: #ece8e1; --ink-2: #d6d1c8; --ink-3: #cfc9bf; --muted: #b9b3aa; --placeholder: #a39d94;
  --line: #0a0a0c; --black: #000;
  --rivet-hi: #d4d4da; --rivet: #8c8c94; --rivet-shadow: #0e0e10;
  --focus: #ffffa0;          /* the game's hover yellow */
  --hover-ink: #ffffa0;

  /* fixed: stone (neutral buttons) */
  --stone: #55555b; --stone-hover: #66666d; --stone-hi: #8e8e95; --stone-lo: #36363b; --stone-ink: #f4f1ea; --stone-shade: #2a2a2e;
  --dark: #26262b; --dark-hover: #34343a; --dark-hi: #4a4a51; --dark-lo: #111113;

  /* fixed: status. Each chip differs in lightness as well as hue. */
  --red: #d22f2f; --red-hi: #ff6a52; --red-lo: #7a1010; --red-ink: #ffb4a8; --red-bg: #2a1212; --red-text: #ff8f80;
  --danger: #a32626; --danger-hover: #b02a2a; --danger-hi: #e0533f; --danger-lo: #5a0e0e; --danger-ink: #fff1ee;
  --amber: #e3a04f; --amber-ink: #1a1008; --amber-lo: #b06a1e; --amber-bg: #2e2312; --amber-text: #f2bd73;
  --green: #2f5a4e; --green-ink: #e2f5ee; --green-bg: #17282a; --green-text: #8fd4b8;
  --blue: #2d4a66; --blue-ink: #dbe9f7; --blue-bg: #18222e; --blue-text: #9cc4ec;
  --lamp-on: #ffd774; --lamp-on-2: #f0a63a; --lamp-on-hi: #fff2b8; --lamp-on-lo: #b06818; --lamp-off: #4e3320; --lamp-off-2: #40291a; --lamp-off-hi: #6a4a32; --lamp-off-lo: #2a1a0e;

  /* type */
  --font-pixel: 'CrankWeb Craft', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-body: 'IBM Plex Sans', 'Plex Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  --fs-display: 3.375rem; /* 54: pixel headings stay on the 9px grid */
  --fs-h1: 2.8125rem;     /* 45 */
  --fs-h2: 2.25rem;       /* 36 */
  --fs-h3: 1.125rem;      /* 18 */
  --fs-h4: 1.125rem;      /* 18 */
  --fs-px: 1.125rem;      /* 18: labels, buttons, nav, typed text */
  --fs-px-lg: 1.6875rem;  /* 27 */
  --fs-lead: 1.1875rem;   /* 19 */
  --fs-body: 1.0625rem;   /* 17 site; admin sets 16 */
  --fs-sm: .9375rem;      /* 15 */
  --fs-xs: .875rem;       /* 14: the smallest text anywhere */
  --lh-body: 1.6;
  --lh-tight: 1.15;

  /* space: 4px grid */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-14: 56px; --sp-16: 64px; --sp-20: 80px;
  --gutter: 24px;
  --wrap: 1248px;

  /* edges and shadows: always hard */
  --bw: 2px;
  --shadow-1: 3px 3px 0 var(--black);
  --shadow-2: 4px 4px 0 var(--black);
  --shadow-3: 6px 6px 0 var(--black);
  --bevel: inset 2px 2px 0 var(--surface-hi), inset -2px -2px 0 var(--surface-lo);
  --inset: inset 2px 2px 0 #060608, inset -2px -2px 0 #34343a;
  --target: 44px;
}
@media (max-width: 720px) {
  :root { --fs-display: 2.25rem; --fs-h1: 1.6875rem; --fs-h2: 1.6875rem; --gutter: 16px; }
}
/* Theme Studio typography presets */
:root[data-typography='clean'] { --font-pixel-heading: var(--font-body); }
:root[data-typography='clean'] :is(h1, h2, h3, .h-display, .h1, .h2, .h3, .page-title) { font-family: var(--font-body); font-weight: 600; letter-spacing: -.01em; text-shadow: none; }
:root[data-typography='adventure'] { --fs-display: 4.5rem; --fs-h1: 3.375rem; --fs-h2: 2.8125rem; }
:root[data-typography='compact'] { --fs-body: 1rem; --fs-lead: 1.0625rem; --fs-h1: 2.25rem; --lh-body: 1.5; }
@media (max-width: 720px) { :root[data-typography='adventure'] { --fs-display: 2.8125rem; --fs-h1: 2.25rem; } }

/* ---- reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; font-variant-ligatures: no-common-ligatures; font-synthesis: none; }
body { margin: 0; min-height: 100vh; background-color: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, pre { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; margin: 0; padding: 0; }
img, svg, video, canvas, picture { display: block; max-width: 100%; }
img, video { height: auto; }
svg { flex: none; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
hr { height: 0; margin: var(--sp-8) 0; border: 0; border-top: 2px solid var(--line); box-shadow: 0 2px 0 var(--surface-hi); }
[hidden] { display: none !important; }
:target { scroll-margin-top: 24px; }
::selection { background: var(--accent-plate); color: var(--accent-ink); }

/* ---- type ---------------------------------------------------------------------- */
h1, h2, h3, h4, .h-display, .h1, .h2, .h3, .h4 { font-family: var(--font-pixel); color: var(--ink-strong); line-height: 1.1; text-wrap: balance; }
h1, .h1 { font-size: var(--fs-h1); font-weight: 600; text-shadow: 3px 3px 0 var(--black); }
h2, .h2 { font-size: var(--fs-h2); font-weight: 600; text-shadow: 3px 3px 0 var(--black); }
h3, .h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; }
h4, .h4 { font-size: var(--fs-h4); font-weight: 500; line-height: 1.3; }
.h-display { font-size: var(--fs-display); font-weight: 600; line-height: 1.02; color: var(--ink-bright); text-shadow: 4px 4px 0 var(--black); }
@media (max-width: 720px) { .h-display { text-shadow: 3px 3px 0 var(--black); } }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-2); max-width: 40em; }
.prose { max-width: 46em; color: var(--ink-2); }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { padding: var(--sp-3) var(--sp-5); background: var(--surface-3); border-left: 4px solid var(--accent-plate); }
p + p { margin-top: .9em; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
strong, b { font-weight: 600; color: var(--ink-strong); }
small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.px, .label { font-family: var(--font-pixel); }
.label { display: block; margin: 0 0 6px; font-size: var(--fs-px); line-height: 1.2; color: var(--muted); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.note { font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }
code, kbd, samp { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { padding: 1px 6px; background: var(--well); border: 2px solid var(--line); color: var(--ink-strong); }
kbd { display: inline-block; min-width: 1.8em; padding: 1px 6px; background: var(--stone); border: 2px solid var(--black); box-shadow: inset -2px -2px 0 var(--stone-lo), inset 2px 2px 0 var(--stone-hi); color: var(--stone-ink); text-align: center; }
pre { padding: var(--sp-4); overflow: auto; background: var(--well); border: 2px solid var(--black); box-shadow: var(--inset); color: var(--ink-strong); font-size: var(--fs-sm); line-height: 1.5; }
mark { background: var(--amber); color: var(--amber-ink); padding: 0 3px; }

/* ---- focus ------------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; }
input:is([type='date'], [type='datetime-local'], [type='time'], [type='month'], [type='week']):focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -200px; z-index: 1000; padding: 12px 18px; background: var(--focus); color: #000; font-family: var(--font-pixel); font-size: 18px; text-decoration: none; border: 2px solid #000; box-shadow: var(--shadow-1); }
.skip-link:focus { top: 12px; color: #000; }

/* ---- utilities ------------------------------------------------------------------ */
/* Spam trap on public forms: <div class="honeypot" aria-hidden="true"><label>Website<input name="website" tabindex="-1" autocomplete="off"></label></div> */
.honeypot { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--sp-4)); }
.stack-sm { --stack-gap: var(--sp-2); } .stack-lg { --stack-gap: var(--sp-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--sp-3)); }
.cluster-sm { --cluster-gap: var(--sp-2); } .cluster-lg { --cluster-gap: var(--sp-5); }
.cluster--end { justify-content: flex-end; } .cluster--between { justify-content: space-between; }
.grid { display: grid; gap: var(--grid-gap, var(--sp-6)); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 260px)), 1fr)); }
.grid-2 { display: grid; gap: var(--sp-6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--sp-6); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.span-all { grid-column: 1 / -1; }

/* ---- icons ------------------------------------------------------------------- */
.icon { display: inline-block; width: 16px; height: 16px; flex: none; fill: currentColor; vertical-align: -3px; shape-rendering: crispEdges; }
.icon--sm { width: 12px; height: 12px; vertical-align: -1px; }
.icon--lg { width: 24px; height: 24px; vertical-align: -6px; }
.icon--xl { width: 32px; height: 32px; }
.pixel-head { image-rendering: pixelated; }

/* ---- textures and rails (header, hero, footer only) ------------------------------ */
.tex { background-color: var(--tex-base); background-image: linear-gradient(var(--tex-mortar) 0 2px, transparent 2px), conic-gradient(at 2px 16px, transparent 75%, var(--tex-mortar) 0), conic-gradient(at 2px 16px, transparent 75%, var(--tex-mortar) 0), conic-gradient(at 4px 16px, transparent 75%, var(--tex-mid) 0), conic-gradient(at 4px 16px, transparent 75%, var(--tex-mid) 0), linear-gradient(transparent 2px, var(--tex-hi) 2px 4px, transparent 4px 13px, var(--tex-lo) 13px), repeating-conic-gradient(rgba(255, 255, 255, .03) 0 25%, rgba(0, 0, 0, .1) 0 50%); background-size: 32px 16px, 32px 32px, 32px 32px, 32px 32px, 32px 32px, 32px 16px, 8px 8px; background-position: 0 0, 0 0, 16px 16px, 0 0, 16px 16px, 0 0, 0 0; }
.redline { height: 4px; background: repeating-linear-gradient(90deg, var(--red) 0 8px, var(--red-lo) 8px 12px, #e04a3a 12px 16px, #3a0a0a 16px 20px); }
.rail { height: 20px; background-color: #45454b; border-top: 2px solid #000; border-bottom: 2px solid #000; box-shadow: inset 0 2px 0 #6a6a72, inset 0 -2px 0 #2a2a2f; background-image: repeating-linear-gradient(90deg, transparent 0 22px, #d4d4da 22px 24px, #8c8c94 24px 26px, transparent 26px 48px), repeating-linear-gradient(90deg, transparent 0 22px, #8c8c94 22px 26px, transparent 26px 48px), repeating-linear-gradient(90deg, transparent 0 24px, #121214 24px 28px, transparent 28px 48px); background-size: 100% 2px, 100% 2px, 100% 2px; background-position: 0 6px, 0 8px, 0 10px; background-repeat: no-repeat; }
.divider { height: 2px; margin: var(--sp-6) 0; background: repeating-linear-gradient(90deg, #3a3a41 0 4px, transparent 4px 8px); border: 0; }

/* ---- plates (riveted panels) --------------------------------------------------- */
.plate, .frame { position: relative; }
.plate { background: var(--surface); border: 2px solid var(--line); box-shadow: var(--bevel), var(--shadow-2); }
.plate::before, .frame::before, .rivets::before { content: ""; position: absolute; inset: 5px; z-index: 2; pointer-events: none; --rh: var(--rivet-hi); --rv: var(--rivet); --rs: var(--rivet-shadow); background: linear-gradient(var(--rh), var(--rh)) left 0 top 0/2px 2px no-repeat, linear-gradient(var(--rv), var(--rv)) left 0 top 0/4px 4px no-repeat, linear-gradient(var(--rs), var(--rs)) left 2px top 2px/4px 4px no-repeat, linear-gradient(var(--rh), var(--rh)) right 4px top 0/2px 2px no-repeat, linear-gradient(var(--rv), var(--rv)) right 2px top 0/4px 4px no-repeat, linear-gradient(var(--rs), var(--rs)) right 0 top 2px/4px 4px no-repeat, linear-gradient(var(--rh), var(--rh)) left 0 bottom 4px/2px 2px no-repeat, linear-gradient(var(--rv), var(--rv)) left 0 bottom 2px/4px 4px no-repeat, linear-gradient(var(--rs), var(--rs)) left 2px bottom 0/4px 4px no-repeat, linear-gradient(var(--rh), var(--rh)) right 4px bottom 4px/2px 2px no-repeat, linear-gradient(var(--rv), var(--rv)) right 2px bottom 2px/4px 4px no-repeat, linear-gradient(var(--rs), var(--rs)) right 0 bottom 0/4px 4px no-repeat; }
.plate--plain::before { content: none; }
.plate--flat { box-shadow: var(--bevel); }
.plate--copper { background: var(--accent-plate); color: var(--accent-ink); border-color: #2a1206; box-shadow: inset 2px 2px 0 var(--accent-hi), inset -2px -2px 0 var(--accent-lo), var(--shadow-2); }
.plate--copper::before { --rh: var(--accent-hi); --rv: var(--accent-lo); --rs: #1a0a03; }
.plate--copper :is(h1, h2, h3, h4, p, strong, a:not(.btn), .h1, .h2, .h3) { color: var(--accent-ink); text-shadow: none; }
.plate--copper a:not(.btn) { text-decoration-thickness: 2px; }
.plate--alert { background: var(--red-bg); border-color: #000; box-shadow: inset 2px 2px 0 #4a1c1c, inset -2px -2px 0 #160808, var(--shadow-2); }
.frame { background: var(--frame); border: 2px solid #000; padding: 12px; box-shadow: inset 2px 2px 0 var(--frame-hi), inset -2px -2px 0 var(--frame-lo), var(--shadow-3); }
@media (max-width: 720px) { .frame { padding: 8px; } }
.plate__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 54px; padding: 10px 20px 10px 22px; background: var(--surface-2); border-bottom: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--strip-hi); }
.plate__head > :is(h2, h3, h4) { font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; text-shadow: none; }
.plate__title { margin: 0; font-family: var(--font-pixel); font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; color: var(--ink-strong); text-shadow: none; }
.plate__link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--target); font-family: var(--font-pixel); font-size: 18px; }
.plate__body { padding: 22px 24px 26px; }
.plate__body--flush { padding: 0; }
.plate__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 20px; background: var(--surface-2); border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--strip-hi); }
.plate__body > * + * { margin-top: var(--sp-4); }
@media (max-width: 640px) { .plate__body { padding: 18px 16px 22px; } .plate__head { padding: 10px 16px; } .plate__foot { padding: 12px 16px; } }

/* ---- buttons (game menu buttons) ---------------------------------------------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--target); padding: 0 18px; margin: 0; font-family: var(--font-pixel); font-size: 18px; font-weight: 500; line-height: 1.05; color: var(--stone-ink); text-decoration: none; text-shadow: 2px 2px 0 var(--stone-shade); text-align: center; background: var(--stone); border: 2px solid #000; border-radius: 0; box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -4px 0 var(--stone-lo), var(--shadow-1); cursor: pointer; white-space: nowrap; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--stone-hover); color: var(--hover-ink); }
.btn:active, .btn[aria-pressed='true'], .btn.is-pressed { transform: translate(2px, 2px); box-shadow: inset 2px 2px 0 var(--stone-lo), inset -2px -2px 0 var(--stone-hi), 1px 1px 0 #000; }
.btn[aria-pressed='true'] { background: #4a4a50; color: var(--ink-bright); }
.btn--primary { background: var(--btn-accent); color: var(--btn-accent-ink); text-shadow: 2px 2px 0 var(--btn-accent-shade); box-shadow: inset 2px 2px 0 var(--btn-accent-hi), inset -2px -4px 0 var(--btn-accent-lo), var(--shadow-1); }
.btn--primary:hover { background: var(--btn-accent-hover); color: var(--hover-ink); }
.btn--primary:active, .btn--primary[aria-pressed='true'] { box-shadow: inset 2px 2px 0 var(--btn-accent-lo), inset -2px -2px 0 var(--btn-accent-hi), 1px 1px 0 #000; }
.btn--dark { background: var(--dark); color: var(--ink-strong); text-shadow: 2px 2px 0 #000; box-shadow: inset 2px 2px 0 var(--dark-hi), inset -2px -4px 0 var(--dark-lo), var(--shadow-1); }
.btn--dark:hover { background: var(--dark-hover); color: var(--hover-ink); }
.btn--dark:active { box-shadow: inset 2px 2px 0 var(--dark-lo), inset -2px -2px 0 var(--dark-hi), 1px 1px 0 #000; }
.btn--danger { background: var(--danger); color: var(--danger-ink); text-shadow: 2px 2px 0 #3a0808; box-shadow: inset 2px 2px 0 var(--danger-hi), inset -2px -4px 0 var(--danger-lo), var(--shadow-1); }
.btn--danger:hover { background: var(--danger-hover); color: var(--hover-ink); }
.btn--danger:active { box-shadow: inset 2px 2px 0 var(--danger-lo), inset -2px -2px 0 var(--danger-hi), 1px 1px 0 #000; }
.btn--ghost { background: transparent; color: var(--ink-strong); text-shadow: none; border-color: var(--stone); box-shadow: none; }
.btn--ghost:hover { background: var(--surface-hover); border-color: #000; color: var(--hover-ink); }
.btn--ghost:active { box-shadow: none; }
.btn--ghost.btn--danger-text, .btn--ghost-danger { background: transparent; color: var(--red-text); text-shadow: none; border-color: #6e2020; box-shadow: none; }
.btn--ghost-danger:active { box-shadow: none; }
.btn--ghost-danger:hover { background: #3e1616; color: #fff; }
.btn--link { min-height: var(--target); padding: 0 4px; background: none; border: 0; box-shadow: none; color: var(--link); text-shadow: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.btn--link:hover { background: none; color: var(--link-hover); }
.btn--link:active { transform: none; box-shadow: none; }
.btn--sm { min-height: 36px; padding: 0 12px; gap: 8px; font-size: 18px; }
.btn--lg { min-height: 54px; padding: 0 26px; font-size: 27px; }
@media (max-width: 480px) { .btn--lg { padding: 0 18px; font-size: 18px; } .btn { max-width: 100%; white-space: normal; padding-block: 6px; } }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--target); padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn--wrap { white-space: normal; }
@media (pointer: coarse) { .btn--sm { min-height: var(--target); } .btn--icon.btn--sm { width: var(--target); } }
.btn:disabled, .btn[aria-disabled='true'], .btn.is-disabled { background: #3a3a40; color: #9a958e; text-shadow: none; border-color: #111; box-shadow: inset 2px 2px 0 #46464c, inset -2px -2px 0 #2c2c31; cursor: not-allowed; transform: none; }
.btn.is-loading, .btn[aria-busy='true'] { color: transparent; text-shadow: none; pointer-events: none; }
.btn.is-loading > *, .btn[aria-busy='true'] > * { visibility: hidden; }
.btn.is-loading::after, .btn[aria-busy='true']::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ink-strong); box-shadow: -12px 0 0 var(--ink-strong), 12px 0 0 var(--ink-strong); animation: px-loading 900ms steps(3, end) infinite; }
@keyframes px-loading { 0% { box-shadow: -12px 0 0 var(--ink-strong), 12px 0 0 rgba(0,0,0,0); background: rgba(0,0,0,0); } 33% { box-shadow: -12px 0 0 var(--ink-strong), 12px 0 0 rgba(0,0,0,0); background: var(--ink-strong); } 66% { box-shadow: -12px 0 0 var(--ink-strong), 12px 0 0 var(--ink-strong); background: var(--ink-strong); } 100% { box-shadow: -12px 0 0 var(--ink-strong), 12px 0 0 var(--ink-strong); background: var(--ink-strong); } }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn-row--end { justify-content: flex-end; }
.btn-group { display: inline-flex; flex-wrap: wrap; }
.btn-group > .btn { box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -4px 0 var(--stone-lo); }
.btn-group > .btn + .btn { margin-left: -2px; }
.btn-group > .btn[aria-pressed='true'], .btn-group > .btn[aria-current] { transform: none; background: #44444a; color: var(--ink-bright); box-shadow: inset 2px 2px 0 var(--stone-lo), inset -2px -2px 0 #5c5c63; }

/* ---- brand ------------------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; color: var(--ink-bright); text-decoration: none; }
.brand:hover { color: var(--hover-ink); }
.brand__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand__name { font-family: var(--font-pixel); font-weight: 600; font-size: 27px; line-height: 1; text-shadow: 3px 3px 0 #000; }
.brand__sub { font-size: 14px; line-height: 1.2; color: var(--ink-3); text-shadow: 2px 2px 0 #000; }
.logo-slot { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3e3e45, var(--shadow-1); }
.logo-slot--sm { width: 44px; height: 44px; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark .m-cu { fill: var(--accent-plate); } .brand-mark .m-cu-d { fill: var(--btn-accent); } .brand-mark .m-cu-hi { fill: var(--accent-hi); } .brand-mark .m-cu-lo { fill: var(--accent-lo); } .brand-mark .m-cu-dd { fill: var(--btn-accent-lo); }
.brand-mark .m-cu-sh { fill: #f6c09a; } .brand-mark .m-cu-pk { fill: #ffd0ac; } .brand-mark .m-fe { fill: #c9c9cf; } .brand-mark .m-fe-d { fill: #7d7d85; }
/* Toggle buttons swap their label: <span data-when="closed">Menu</span><span data-when="open">Close</span> */
[aria-expanded='false'] > [data-when='open'], [aria-expanded='true'] > [data-when='closed'], :not([aria-expanded]) > [data-when='open'] { display: none; }
[data-when] { display: inline-flex; align-items: center; }

/* ---- redstone lamps and status ------------------------------------------------- */
.lamp { display: inline-block; flex: none; width: 20px; height: 20px; border: 2px solid #24140a; background: repeating-conic-gradient(var(--lamp-on) 0 25%, var(--lamp-on-2) 0 50%) 0 0/6px 6px; box-shadow: inset 2px 2px 0 var(--lamp-on-hi), inset -2px -2px 0 var(--lamp-on-lo); vertical-align: middle; }
.lamp--off { background: repeating-conic-gradient(var(--lamp-off) 0 25%, var(--lamp-off-2) 0 50%) 0 0/6px 6px; box-shadow: inset 2px 2px 0 var(--lamp-off-hi), inset -2px -2px 0 var(--lamp-off-lo); }
.lamp--alert { border-color: #2a0606; background: repeating-conic-gradient(var(--red-hi) 0 25%, var(--red) 0 50%) 0 0/6px 6px; box-shadow: inset 2px 2px 0 #ffb0a0, inset -2px -2px 0 var(--red-lo); }
.lamp--ok { border-color: #0e1f1a; background: repeating-conic-gradient(#a8e6c9 0 25%, #5fbf94 0 50%) 0 0/6px 6px; box-shadow: inset 2px 2px 0 #e0fff0, inset -2px -2px 0 #2b6b50; }
.lamp--sm { width: 14px; height: 14px; }
.lamp--lg { width: 30px; height: 30px; border-width: 3px; }
.lamp--blink { animation: lamp-blink 1.2s steps(1, end) infinite; }
@keyframes lamp-blink { 50% { filter: brightness(.55); } }
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-2); }
.status--lg { gap: 14px; font-size: 27px; color: var(--ink-bright); }
.status__sub { display: block; margin-top: 6px; font-family: var(--font-body); font-size: var(--fs-sm); color: var(--muted); }

/* ---- chips, tags, badges ---------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 8px; border: 2px solid #000; background: var(--stone); color: var(--stone-ink); font-family: var(--font-pixel); font-size: 18px; line-height: 1; white-space: nowrap; vertical-align: middle; }
.chip--pending, .chip--wait { background: var(--amber); color: var(--amber-ink); }
.chip--approved, .chip--ok { background: var(--green); color: var(--green-ink); }
.chip--denied, .chip--no { background: var(--well); color: var(--red-ink); border-color: var(--red); }
.chip--info { background: var(--blue); color: var(--blue-ink); }
.chip--neutral { background: var(--stone); color: var(--stone-ink); }
.chip--urgent { background: var(--red); color: #fff; }
.chip--muted { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }
.chip--accent { background: var(--accent-plate); color: var(--accent-ink); }
.chip .icon { width: 12px; height: 12px; vertical-align: 0; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border: 2px solid #5a3a28; background: #18181b; color: var(--link); font-family: var(--font-pixel); font-size: 18px; line-height: 1; vertical-align: middle; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 6px; background: var(--amber); color: var(--amber-ink); border: 2px solid #000; box-shadow: inset -2px -2px 0 var(--amber-lo); font-family: var(--font-pixel); font-size: 18px; line-height: 1; }
.badge--alert { background: var(--red); color: #fff; box-shadow: inset -2px -2px 0 var(--red-lo); }
.stamp { display: inline-flex; align-items: center; min-height: 22px; padding: 0 6px; background: var(--accent-plate); color: var(--accent-ink); border: 2px solid #000; font-family: var(--font-pixel); font-size: 18px; line-height: 1; }

/* ---- meters ------------------------------------------------------------------------ */
/* <progress class="meter" value="62" max="100">62%</progress> is preferred (no JS, accessible).
   A div works too: <div class="meter" data-fill="62" role="img" aria-label="62 percent"></div>
   (app.js copies data-fill into --fill; widths never come from style=""). */
.meter { --seg: var(--btn-accent-hi); --seg-2: var(--accent); --seg-track: #3a2a22; display: block; width: 100%; height: 20px; border: 2px solid #000; background-color: var(--well); box-shadow: inset 2px 2px 0 #08080a; background-image: repeating-linear-gradient(90deg, var(--seg) 0 2px, var(--seg-2) 2px 10px, transparent 10px 14px), repeating-linear-gradient(90deg, var(--seg-track) 0 10px, transparent 10px 14px); background-repeat: no-repeat, no-repeat; background-position: 2px 2px, 2px 2px; background-size: calc((100% - 4px) * var(--fill, 0) / 100) 12px, calc(100% - 4px) 12px; }
.meter--alt { --seg: var(--accent-2-hi); --seg-2: var(--accent-2); --seg-track: var(--accent-2-lo); }
.meter--alert { --seg: #ffb0a0; --seg-2: var(--red); --seg-track: #3a1414; }
.meter--sm { height: 14px; background-size: calc((100% - 4px) * var(--fill, 0) / 100) 6px, calc(100% - 4px) 6px; }
progress.meter, meter.meter { -webkit-appearance: none; appearance: none; padding: 2px; color: var(--seg-2); }
progress.meter { background-size: 0 0, calc(100% - 4px) 12px; }
progress.meter::-webkit-progress-bar { background: transparent; }
progress.meter::-webkit-progress-value { background: repeating-linear-gradient(90deg, var(--seg) 0 2px, var(--seg-2) 2px 10px, transparent 10px 14px); }
progress.meter::-moz-progress-bar { background: repeating-linear-gradient(90deg, var(--seg) 0 2px, var(--seg-2) 2px 10px, transparent 10px 14px); }
meter.meter { background-size: 0 0, calc(100% - 4px) 12px; }
meter.meter::-webkit-meter-bar { height: 12px; background: transparent; border: 0; border-radius: 0; }
meter.meter::-webkit-meter-optimum-value, meter.meter::-webkit-meter-suboptimum-value, meter.meter::-webkit-meter-even-less-good-value { background: repeating-linear-gradient(90deg, var(--seg) 0 2px, var(--seg-2) 2px 10px, transparent 10px 14px); }
meter.meter::-moz-meter-bar { background: repeating-linear-gradient(90deg, var(--seg) 0 2px, var(--seg-2) 2px 10px, transparent 10px 14px); }
meter.meter:-moz-meter-sub-optimum::-moz-meter-bar, meter.meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: repeating-linear-gradient(90deg, #ffb0a0 0 2px, var(--red) 2px 10px, transparent 10px 14px); }
meter.meter::-webkit-meter-even-less-good-value { background: repeating-linear-gradient(90deg, #ffb0a0 0 2px, var(--red) 2px 10px, transparent 10px 14px); }
.meter-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.meter-row__label { font-weight: 600; color: var(--ink-strong); }
.meter-row__value { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- inventory slots and hotbar ---------------------------------------------------- */
.slot { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 56px; height: 56px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3a3a40; color: var(--ink-strong); }
.slot--sm { width: 44px; height: 44px; }
.slot--lg { width: 76px; height: 76px; }
.slot--raised { box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3e3e45, var(--shadow-1); }
.slot__count { position: absolute; right: 3px; bottom: 2px; font-family: var(--font-pixel); font-size: 18px; line-height: 1; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.slot .icon { width: 24px; height: 24px; }
.slot--lg .icon { width: 32px; height: 32px; }
.slot.is-selected { box-shadow: 0 0 0 2px #000, 0 0 0 5px #e9e6df, 0 0 0 7px #000; z-index: 1; }
.inventory { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #0c0c0e; border: 2px solid #000; box-shadow: var(--shadow-2); width: max-content; max-width: 100%; }
.hotbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: 4px; padding: 4px; background: #0c0c0e; border: 2px solid #000; box-shadow: var(--shadow-2); }
.hotbar__slot { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 8px; background: #2c2c31; box-shadow: inset 2px 2px 0 #141417, inset -2px -2px 0 #4a4a51; color: #e2ddd4; font-family: var(--font-pixel); font-size: 18px; line-height: 1.1; text-align: center; text-decoration: none; border: 0; }
.hotbar__slot:hover { background: #38383e; color: var(--hover-ink); }
.hotbar__slot:focus-visible { z-index: 3; }
.hotbar__slot.is-current, .hotbar__slot[aria-current='page'], .hotbar__slot[aria-current='true'] { z-index: 2; background: #3c3c43; color: #fff; box-shadow: 0 0 0 2px #000, 0 0 0 5px #e9e6df, 0 0 0 7px #000; }
.hotbar__key { position: absolute; top: 4px; left: 6px; font-size: 12px; line-height: 1; color: #bdb7ae; }
.hotbar__slot .lamp { width: 12px; height: 12px; border-width: 2px; }
.hotbar__slot--primary { background: var(--btn-accent); color: var(--btn-accent-ink); text-shadow: 2px 2px 0 var(--btn-accent-shade); box-shadow: inset 2px 2px 0 var(--btn-accent-hi), inset -2px -2px 0 var(--btn-accent-lo); }
.hotbar__slot--primary:hover { background: var(--btn-accent-hover); color: var(--hover-ink); }
.hotbar--row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* ---- alerts and flash messages -------------------------------------------------------- */
.alert { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px 14px 14px; background: var(--surface-3); border: 2px solid #000; border-left-width: 6px; box-shadow: var(--shadow-1); color: var(--ink); font-size: var(--fs-sm); line-height: 1.5; }
.alert > .lamp, .alert > .icon { margin-top: 2px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { display: block; margin: 0 0 2px; font-family: var(--font-pixel); font-size: 18px; font-weight: 600; line-height: 1.25; color: var(--ink-strong); }
.alert__body > p { margin: 0; }
.alert__body > * + * { margin-top: 6px; }
.alert__close { margin: -8px -8px -8px auto; }
.alert--success { background: var(--green-bg); border-left-color: #5fbf94; }
.alert--warning { background: var(--amber-bg); border-left-color: var(--amber); }
.alert--danger, .alert--error { background: var(--red-bg); border-left-color: var(--red); }
.alert--info { background: var(--blue-bg); border-left-color: #6a9fd6; }
.alert a { color: var(--ink-strong); }
.alert--danger a { color: #ffc6b8; }

/* ---- forms ------------------------------------------------------------------------------ */
label { cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: var(--sp-5); }
.form-grid > .field + .field, .field-row > .field + .field { margin-top: 0; }
.field__label, .field > label:first-child { font-family: var(--font-pixel); font-size: 18px; font-weight: 500; line-height: 1.25; color: var(--ink-strong); }
.field__label .req, .req { color: var(--amber-text); }
.field__optional { margin-left: 6px; font-family: var(--font-body); font-size: var(--fs-xs); color: var(--muted); }
.field__help { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.field__error { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); line-height: 1.45; color: var(--red-text); font-weight: 500; }
.field__error .icon { margin-top: 2px; }
.field__count { align-self: flex-end; font-family: var(--font-pixel); font-size: var(--fs-px); color: var(--muted); }
input:not([type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='submit'], [type='button'], [type='reset'], [type='image'], [type='hidden']), select, textarea, .input {
  display: block; width: 100%; min-width: 0; min-height: var(--target); padding: 0 12px; -webkit-appearance: none; appearance: none; background: var(--well); border: 2px solid #000; border-radius: 0; box-shadow: var(--inset); color: var(--ink-strong); font-family: var(--font-pixel); font-size: var(--fs-px); line-height: 1.5; }
textarea { min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
select { padding-right: 40px; background-image: linear-gradient(var(--ink-2), var(--ink-2)), linear-gradient(var(--ink-2), var(--ink-2)), linear-gradient(var(--ink-2), var(--ink-2)), linear-gradient(var(--ink-2), var(--ink-2)); background-repeat: no-repeat; background-size: 10px 2px, 6px 2px, 2px 2px, 2px 2px; background-position: right 15px top 50%, right 17px top calc(50% + 2px), right 19px top calc(50% + 4px), right 19px top calc(50% + 4px); cursor: pointer; }
select[multiple], select[size] { padding: 6px; background-image: none; }
select option { background: var(--well); color: var(--ink-strong); }
::placeholder { color: var(--placeholder); opacity: 1; }
input:hover:not(:disabled, :focus), select:hover:not(:disabled, :focus), textarea:hover:not(:disabled, :focus) { border-color: #2c2c31; }
input:disabled, select:disabled, textarea:disabled { background-color: #232327; color: #8f8a83; cursor: not-allowed; box-shadow: none; }
input[readonly], textarea[readonly] { background-color: #1a1a1d; }
[aria-invalid='true'], .is-invalid, input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--red) !important; box-shadow: inset 2px 2px 0 #3a0a0a, inset -2px -2px 0 #4a1c1c !important; }
.is-valid { border-color: #3f8a6c !important; }
.input--sm { min-height: 36px !important; }
input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type='date'], input[type='datetime-local'], input[type='time'] { color-scheme: dark; }
input[type='number'] { font-variant-numeric: tabular-nums; }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group > input, .input-group > select, .input-group > .input { flex: 1 1 auto; width: auto; min-width: 0; }
.input-group > :not(:last-child) { border-right: 0; }
.input-group > .btn { box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -4px 0 var(--stone-lo); }
.input-group > .btn--primary { box-shadow: inset 2px 2px 0 var(--btn-accent-hi), inset -2px -4px 0 var(--btn-accent-lo); }
.input-group__addon { display: inline-flex; align-items: center; flex: none; padding: 0 12px; background: #34343a; border: 2px solid #000; color: #e2ddd4; font-family: var(--font-pixel); font-size: 18px; white-space: nowrap; }
/* checkbox / radio: an inventory slot that fills with copper */
input[type='checkbox'], input[type='radio'] { -webkit-appearance: none; appearance: none; flex: none; width: 24px; height: 24px; margin: 0; background: var(--well); border: 2px solid #000; border-radius: 0; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3a3a40; cursor: pointer; vertical-align: middle; }
input[type='checkbox']:checked { background-color: var(--accent-plate); box-shadow: inset 2px 2px 0 var(--accent-hi), inset -2px -2px 0 var(--accent-lo); background-image: linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)); background-repeat: no-repeat; background-size: 3px 3px; background-position: 2px 8px, 4px 10px, 6px 12px, 8px 10px, 10px 8px, 12px 6px, 14px 4px; }
input[type='checkbox']:indeterminate { background-color: var(--accent-plate); background-image: linear-gradient(var(--accent-ink), var(--accent-ink)); background-repeat: no-repeat; background-size: 10px 2px; background-position: center; }
/* Radios are a stepped pixel circle (2px notches) so they never read as checkboxes. clip-path also clips
   outlines, so a focused radio drops the clip and shows the normal square focus ring. */
input[type='radio'] { --corners: linear-gradient(#000, #000) 0 0/2px 2px no-repeat, linear-gradient(#000, #000) 100% 0/2px 2px no-repeat, linear-gradient(#000, #000) 0 100%/2px 2px no-repeat, linear-gradient(#000, #000) 100% 100%/2px 2px no-repeat; background: var(--corners), var(--well); clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 2px 4px, 2px 2px, 4px 2px); }
input[type='radio']:checked { background: var(--corners), linear-gradient(var(--accent-hi), var(--accent-hi)) 6px 6px/2px 2px no-repeat, linear-gradient(var(--accent-plate), var(--accent-plate)) 6px 4px/8px 12px no-repeat, linear-gradient(var(--accent-plate), var(--accent-plate)) 4px 6px/12px 8px no-repeat, var(--well); }
input[type='radio']:focus-visible { clip-path: none; }
input[type='checkbox']:disabled, input[type='radio']:disabled { opacity: .5; cursor: not-allowed; }
input[type='checkbox']:focus-visible, input[type='radio']:focus-visible { outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: var(--target); padding: 10px 0; cursor: pointer; line-height: 1.4; }
.check > input { margin-top: -1px; }
.check__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check__text > strong, .check__label { font-weight: 500; color: var(--ink-strong); }
.check__text > small, .check__hint { font-size: var(--fs-sm); color: var(--muted); }
.check--boxed { padding: 12px 14px; background: var(--surface-3); border: 2px solid var(--line); }
.check--boxed:has(input:checked) { border-color: var(--accent); }
.check-list { display: grid; gap: 4px; }
.check-grid { display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
/* switch: <input type="checkbox" class="switch" role="switch"> inside a .check label */
input[type='checkbox'].switch { width: 52px; height: 28px; background-color: #26262b; box-shadow: inset 2px 2px 0 #111113, inset -2px -2px 0 #3e3e45; background-image: linear-gradient(var(--lamp-off), var(--lamp-off)), linear-gradient(var(--stone-hi), var(--stone-hi)), linear-gradient(#000, #000); background-size: 8px 8px, 16px 16px, 20px 20px; background-position: 8px 8px, 4px 4px, 2px 2px; background-repeat: no-repeat; }
input[type='checkbox'].switch:checked { background-color: var(--green); box-shadow: inset 2px 2px 0 #1a3a31, inset -2px -2px 0 #4f8a78; background-image: linear-gradient(var(--lamp-on), var(--lamp-on)), linear-gradient(var(--stone-hi), var(--stone-hi)), linear-gradient(#000, #000); background-position: 32px 8px, 28px 4px, 26px 2px; }
@media (prefers-reduced-motion: no-preference) { input[type='checkbox'].switch { transition: background-position 120ms steps(3, end); } }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: var(--target); background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 12px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608; }
input[type='range']::-moz-range-track { height: 8px; background: var(--well); border: 2px solid #000; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 28px; margin-top: -10px; background: var(--stone); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -2px 0 var(--stone-lo); border-radius: 0; }
input[type='range']::-moz-range-thumb { width: 14px; height: 24px; background: var(--stone); border: 2px solid #000; border-radius: 0; box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -2px 0 var(--stone-lo); }
input[type='color'] { -webkit-appearance: none; appearance: none; width: 64px; height: var(--target); padding: 4px; background: var(--well); border: 2px solid #000; box-shadow: var(--inset); cursor: pointer; }
input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
input[type='color']::-webkit-color-swatch { border: 2px solid #000; border-radius: 0; }
input[type='color']::-moz-color-swatch { border: 2px solid #000; border-radius: 0; }
input[type='file'] { display: block; width: 100%; max-width: 100%; padding: 6px; background: var(--well); border: 2px dashed #4a4a51; color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; }
input[type='file']::file-selector-button { margin-right: 14px; min-height: 36px; padding: 0 14px; font-family: var(--font-pixel); font-size: 18px; color: var(--stone-ink); background: var(--stone); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -4px 0 var(--stone-lo); cursor: pointer; }
input[type='file']::file-selector-button:hover { background: var(--stone-hover); color: var(--hover-ink); }
fieldset, .fieldset { min-width: 0; margin: 0; padding: 18px 20px 20px; background: var(--surface-3); border: 2px solid var(--line); box-shadow: inset 2px 2px 0 var(--strip-hi); }
fieldset + fieldset, .fieldset + .fieldset { margin-top: var(--sp-6); }
legend { padding: 0 8px; margin-left: -8px; font-family: var(--font-pixel); font-size: 18px; font-weight: 500; color: var(--ink-strong); }
.fieldset__lead { margin: 0 0 var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }
fieldset.fieldset--bare { padding: 0; background: none; border: 0; box-shadow: none; }
.form-grid { display: grid; gap: var(--sp-5) var(--sp-6); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > .span-all, .form-grid > .field--wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: var(--sp-6); }
.form-actions--end { justify-content: flex-end; }
.form-actions--sticky { position: sticky; bottom: 0; z-index: 5; margin-top: var(--sp-6); padding: 14px 16px; background: var(--surface-2); border: 2px solid #000; box-shadow: inset 0 2px 0 var(--strip-hi), var(--shadow-1); }

/* ---- tables ------------------------------------------------------------------------------ */
.table-wrap { position: relative; overflow-x: auto; max-width: 100%; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--fs-sm); }
.table--auto { min-width: 0; }
.table caption { padding: 0 0 10px; text-align: left; font-family: var(--font-pixel); font-size: 18px; color: var(--ink-strong); caption-side: top; }
.table th { padding: 10px 16px; text-align: left; vertical-align: bottom; font-family: var(--font-pixel); font-weight: 500; font-size: 18px; color: var(--muted); background: var(--surface-3); border-bottom: 2px solid var(--line); white-space: nowrap; }
.table tbody th { vertical-align: middle; font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-strong); background: transparent; border-bottom: 2px solid var(--surface-3); white-space: normal; }
.table td { padding: 8px 16px; border-bottom: 2px solid var(--surface-3); vertical-align: middle; color: #e2ddd4; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover > * { background: var(--surface-hover); }
.table--striped tbody tr:nth-child(even) > * { background: var(--surface-2); }
.table--striped tbody tr:nth-child(even):hover > * { background: var(--surface-hover); }
.table--compact td { padding-top: 6px; padding-bottom: 6px; }
.table .num, .table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.is-actions, .table th.is-actions { width: 1%; white-space: nowrap; text-align: right; }
.table td.is-check, .table th.is-check { width: 1%; padding-right: 4px; }
.table tr[data-href] { cursor: pointer; }
.table tr.is-selected > * { background: #3a2a22; }
.table a.row-link { display: inline-flex; align-items: center; gap: 10px; min-height: var(--target); color: var(--ink-strong); font-weight: 500; text-decoration: none; }
.table a.row-link:hover { color: var(--hover-ink); text-decoration: underline; }
.table .pixel-head { border: 2px solid #000; }
/* sortable header: <th aria-sort="ascending"><button class="sort" type="button">Name</button></th> */
.sort { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: -6px -6px; padding: 0 6px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.sort::after { content: ""; width: 8px; height: 10px; background: linear-gradient(currentColor, currentColor) 3px 0/2px 2px no-repeat, linear-gradient(currentColor, currentColor) 1px 2px/6px 2px no-repeat, linear-gradient(currentColor, currentColor) 1px 6px/6px 2px no-repeat, linear-gradient(currentColor, currentColor) 3px 8px/2px 2px no-repeat; opacity: .55; }
.sort:hover { color: var(--hover-ink); }
th[aria-sort='ascending'] .sort, th[aria-sort='descending'] .sort { color: var(--ink-strong); }
th[aria-sort='ascending'] .sort::after { opacity: 1; background: linear-gradient(currentColor, currentColor) 3px 2px/2px 2px no-repeat, linear-gradient(currentColor, currentColor) 1px 4px/6px 2px no-repeat; }
th[aria-sort='descending'] .sort::after { opacity: 1; background: linear-gradient(currentColor, currentColor) 1px 4px/6px 2px no-repeat, linear-gradient(currentColor, currentColor) 3px 6px/2px 2px no-repeat; }

/* ---- tabs ------------------------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #0c0c0e; border: 2px solid #000; width: max-content; max-width: 100%; }
.tabs__tab { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 16px; background: #2c2c31; box-shadow: inset 2px 2px 0 #141417, inset -2px -2px 0 #4a4a51; border: 0; color: #e2ddd4; font-family: var(--font-pixel); font-size: 18px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.tabs__tab:hover { background: #38383e; color: var(--hover-ink); }
.tabs__tab[aria-current='page'], .tabs__tab[aria-selected='true'], .tabs__tab.is-current { z-index: 1; background: #3c3c43; color: #fff; box-shadow: 0 0 0 2px #000, 0 0 0 4px #e9e6df; }
.tabs__tab .badge { height: 22px; min-width: 22px; font-size: 18px; }
.tab-panel:focus-visible { outline-offset: 4px; }
.tabs--scroll { flex-wrap: nowrap; overflow-x: auto; }

/* ---- pagination and breadcrumbs ----------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pagination__list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pagination a, .pagination span[aria-current], .pagination .pagination__gap { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--target); min-height: var(--target); padding: 0 10px; background: #2c2c31; border: 2px solid #000; box-shadow: inset 2px 2px 0 #4a4a51, inset -2px -2px 0 #1c1c20; color: #e2ddd4; font-family: var(--font-pixel); font-size: 18px; text-decoration: none; }
.pagination a:hover { background: #38383e; color: var(--hover-ink); }
.pagination [aria-current='page'] { background: var(--btn-accent); color: var(--btn-accent-ink); box-shadow: inset 2px 2px 0 var(--btn-accent-hi), inset -2px -2px 0 var(--btn-accent-lo); }
.pagination .pagination__gap { background: transparent; border-color: transparent; box-shadow: none; min-width: 20px; padding: 0; }
.pagination [aria-disabled='true'] { opacity: .45; pointer-events: none; }
.pagination__info { margin-left: auto; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 0; padding: 0; list-style: none; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.breadcrumbs li + li::before { content: ""; width: 4px; height: 4px; background: #6a6a72; box-shadow: 2px 2px 0 #000; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--hover-ink); text-decoration: underline; }
.breadcrumbs [aria-current='page'] { color: var(--ink-strong); }

/* ---- empty state --------------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 24px 44px; text-align: center; border: 2px dashed #3e3e45; background: var(--surface-2); }
.empty .slot { margin-bottom: 4px; color: var(--muted); }
.empty__title { margin: 0; font-family: var(--font-pixel); font-size: 18px; font-weight: 500; color: var(--ink-strong); }
.empty__text { margin: 0; max-width: 34em; font-size: var(--fs-sm); color: var(--muted); }
.empty .btn-row { justify-content: center; margin-top: 6px; }
.empty--compact { padding: 24px 16px; flex-direction: row; text-align: left; justify-content: flex-start; }

/* ---- dialogs -------------------------------------------------------------------------------- */
dialog { color: var(--ink); }
.dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: visible; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--bevel), 8px 8px 0 #000; }
.dialog--wide { width: min(820px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(6, 6, 8, .78); }
.dialog__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 52px); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 6px 8px 6px 22px; background: var(--surface-2); border-bottom: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--strip-hi); }
.dialog__title { margin: 0; font-family: var(--font-pixel); font-size: 18px; font-weight: 500; color: var(--ink-strong); text-shadow: none; }
.dialog__body { padding: 22px 24px; overflow-y: auto; }
.dialog__body > * + * { margin-top: var(--sp-4); }
.dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 14px 20px; background: var(--surface-2); border-top: 2px solid var(--line); }
.dialog--danger .dialog__head { background: var(--red-bg); }
@media (max-width: 640px) { .dialog__body { padding: 18px 16px; } .dialog__foot { padding: 12px 16px; } .dialog__foot .btn { flex: 1 1 auto; } }

/* ---- toasts ------------------------------------------------------------------------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 12px 8px 12px 14px; background: var(--surface); border: 2px solid #000; border-left-width: 6px; border-left-color: var(--stone); box-shadow: var(--bevel), var(--shadow-2); color: var(--ink); font-size: var(--fs-sm); line-height: 1.45; pointer-events: auto; }
.toast > .lamp { margin-top: 2px; }
.toast__body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.toast__body strong { display: block; font-family: var(--font-pixel); font-weight: 500; font-size: 18px; }
.toast--success { border-left-color: #5fbf94; } .toast--warning { border-left-color: var(--amber); } .toast--danger { border-left-color: var(--red); } .toast--info { border-left-color: #6a9fd6; }
.toast .btn--icon { margin: -6px 0; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in 180ms steps(3, end); } }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---- tooltips ----------------------------------------------------------------------------- */
/* Supplementary only: the same text must also be in an aria-label or visible text. */
[data-tooltip] { position: relative; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 50; width: max-content; max-width: 260px; padding: 6px 10px; transform: translateX(-50%); background: #0c0c0e; border: 2px solid #000; box-shadow: inset 2px 2px 0 #2c2c31, var(--shadow-1); color: var(--ink-strong); font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; line-height: 1.35; text-align: left; text-shadow: none; white-space: normal; pointer-events: none; display: none; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { display: block; }
[data-tooltip-pos~='bottom']::after { bottom: auto; top: calc(100% + 8px); }
[data-tooltip-pos~='end']::after { left: auto; right: 0; transform: none; }
[data-tooltip-pos~='start']::after { left: 0; transform: none; }
.btn[data-tooltip].is-loading::after { content: ""; }

/* ---- code and secret display (2FA secret, backup codes, server address) ------------------- */
.secret { display: flex; align-items: stretch; min-width: 0; }
.secret__value { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; min-height: var(--target); padding: 6px 14px; background: var(--well); border: 2px solid #000; border-right: 0; box-shadow: var(--inset); color: var(--ink-bright); font-family: var(--font-mono); font-size: 17px; letter-spacing: .06em; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.secret__value--pixel { display: block; padding-block: 6px; line-height: 28px; font-family: var(--font-pixel); font-size: 18px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secret > .btn { flex: none; min-width: 110px; box-shadow: inset 2px 2px 0 var(--stone-hi), inset -2px -4px 0 var(--stone-lo), var(--shadow-1); }
.secret--masked .secret__value { letter-spacing: .3em; }
@media (max-width: 420px) { .secret > .btn { min-width: 0; padding: 0 12px; } .secret__value--pixel { font-size: 18px; padding-inline: 10px; } }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 4px; list-style: none; background: #0c0c0e; border: 2px solid #000; box-shadow: var(--shadow-2); counter-reset: code; }
.codes li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; background: var(--well); box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #34343a; font-family: var(--font-mono); font-size: 17px; letter-spacing: .08em; color: var(--ink-bright); counter-increment: code; }
.codes li::before { content: counter(code); min-width: 1.6em; font-family: var(--font-pixel); font-size: 18px; letter-spacing: 0; color: var(--muted); }
.codes li.is-used { color: var(--muted); text-decoration: line-through; }
@media (max-width: 420px) { .codes { grid-template-columns: minmax(0, 1fr); } }
.qr { display: inline-block; padding: 12px; background: #fff; border: 2px solid #000; box-shadow: var(--shadow-2); }
.qr img, .qr svg { width: 200px; height: 200px; image-rendering: pixelated; }

/* ---- avatars / player heads ----------------------------------------------------------------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3a3a40; overflow: hidden; }
.avatar > svg, .avatar > img { width: 32px; height: 32px; image-rendering: pixelated; box-shadow: 3px 3px 0 #000; }
.avatar--sm { width: 32px; height: 32px; } .avatar--sm > svg, .avatar--sm > img { width: 20px; height: 20px; box-shadow: 2px 2px 0 #000; }
.avatar--lg { width: 76px; height: 76px; } .avatar--lg > svg, .avatar--lg > img { width: 48px; height: 48px; }
.avatar--xl { width: 112px; height: 112px; } .avatar--xl > svg, .avatar--xl > img { width: 80px; height: 80px; box-shadow: 4px 4px 0 #000; }
.avatar__initial { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-strong); }
.who { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.who__name { display: block; font-family: var(--font-pixel); font-size: 18px; line-height: 1.15; color: var(--ink-strong); overflow-wrap: anywhere; }
.who__meta { display: block; margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }

/* ---- key/value -------------------------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: repeat(var(--kv-cols, 2), minmax(0, 1fr)); gap: 2px; margin: 0; background: var(--line); border: 2px solid var(--line); }
.kv--3 { --kv-cols: 3; } .kv--4 { --kv-cols: 4; } .kv--1 { --kv-cols: 1; }
.kv > div { min-width: 0; padding: 12px 14px; background: var(--surface-3); }
.kv dt { margin: 0 0 4px; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--muted); }
.kv dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-strong); overflow-wrap: anywhere; }
.kv--text dd { font-family: var(--font-body); font-size: var(--fs-sm); line-height: 1.45; }
/* In two-column grids a lone last cell spans the row, so no empty black cell is left behind. */
.kv:not(.kv--1, .kv--3, .kv--4) > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 640px) { .kv--3, .kv--4 { --kv-cols: 2; } .kv > div { padding: 10px; } .kv:is(.kv--3, .kv--4) > div:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.dl { margin: 0; border-bottom: 2px solid var(--line); }
.dl > div { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 6px 24px; padding: 14px 0; border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--surface-hover); }
.dl dt { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.dl dd { margin: 0; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.dl--spec dt { font-size: 18px; font-weight: 500; color: var(--link); }
@media (max-width: 640px) { .dl > div { grid-template-columns: minmax(0, 1fr); } }

/* ---- stat tiles --------------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 2px; background: var(--line); }
.stat { min-width: 0; padding: 18px 20px 20px; background: var(--surface); }
.stat__label { margin: 0 0 6px; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--muted); }
.stat__value { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--font-pixel); font-size: 27px; line-height: 1.1; color: var(--ink-bright); font-variant-numeric: tabular-nums; }
.stat__unit { font-size: 18px; color: var(--muted); }
.stat__sub { margin: 8px 0 0; font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
.stat .meter { margin-top: 10px; }
.stat--plate { background: var(--surface); border: 2px solid var(--line); box-shadow: var(--bevel), var(--shadow-1); }
/* uptime strip (views/partials/uptime-strip.ejs): the public stats page and the admin uptime page */
.uptime__days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; margin-top: 18px; }
.uptime__day { height: 36px; background: var(--well); border: 2px solid #000; }
.uptime__day--good { background: #5fbf94; box-shadow: inset 2px 2px 0 #a8e6c9, inset -2px -2px 0 #2b6b50; }
.uptime__day--fair { background: var(--amber); box-shadow: inset -2px -2px 0 var(--amber-lo); }
.uptime__day--poor { background: var(--red); box-shadow: inset -2px -2px 0 var(--red-lo); }
.uptime__legend { display: flex; justify-content: space-between; margin: 6px 0 0; font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 720px) { .uptime__days { gap: 2px; } .uptime__day { height: 28px; border-width: 1px; } }
.stat__trend { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-pixel); font-size: 18px; }
.stat__trend--up { color: var(--green-text); } .stat__trend--down { color: var(--red-text); }
@media (max-width: 640px) { .stat { padding: 14px 14px 16px; } .stat__value { font-size: 27px; } }

/* ---- date block ---------------------------------------------------------------------------- */
.date-block { display: block; flex: none; width: 92px; background: var(--well); border: 2px solid #000; box-shadow: var(--shadow-1); text-align: center; font-family: var(--font-pixel); }
.date-block__day { display: block; padding: 6px 0; background: var(--accent-plate); color: var(--accent-ink); border-bottom: 2px solid #000; font-size: 18px; line-height: 1.1; }
.date-block__num { display: block; padding: 10px 0 2px; font-size: 45px; line-height: 1; color: var(--ink-bright); }
.date-block__month { display: block; padding: 0 0 10px; font-size: 18px; line-height: 1.2; color: var(--muted); }
.date-block--sm { width: 64px; } .date-block--sm .date-block__num { font-size: 27px; padding-top: 6px; } .date-block--sm .date-block__day, .date-block--sm .date-block__month { font-size: 18px; }

/* ---- timeline (case history) -------------------------------------------------------------- */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline__item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding-bottom: 20px; }
.timeline__item::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: repeating-linear-gradient(180deg, #4a4a51 0 4px, transparent 4px 8px); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { content: none; }
.timeline__marker { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3a3a40; color: var(--ink-2); }
.timeline__item--decision .timeline__marker { background: var(--accent-plate); color: var(--accent-ink); box-shadow: inset 2px 2px 0 var(--accent-hi), inset -2px -2px 0 var(--accent-lo); }
.timeline__item--alert .timeline__marker { background: var(--red-bg); color: var(--red-text); }
.timeline__item--note .timeline__marker { color: var(--accent-2-text); }
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: 44px; padding-top: 10px; }
.timeline__title { font-weight: 600; color: var(--ink-strong); }
.timeline__time { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.timeline__body { margin-top: 4px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; }
.timeline__body > * + * { margin-top: 8px; }
.timeline__body--note { padding: 12px 14px; background: var(--surface-3); border: 2px solid var(--line); white-space: pre-wrap; }
.timeline--compact .timeline__item { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; }
.timeline--compact .timeline__marker { width: 28px; height: 28px; }
.timeline--compact .timeline__item::before { left: 13px; top: 28px; }
.timeline--compact .timeline__head { min-height: 28px; padding-top: 2px; }

/* ---- step roadmap (application / appeal status) --------------------------------------------- */
/* <ol class="steps"><li class="steps__step is-complete">... "is-current" with aria-current="step" ... "is-upcoming" */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps__step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 16px 0 0; counter-increment: step; }
.steps__step::after { content: ""; position: absolute; left: 52px; right: 8px; top: 21px; height: 4px; background: #3a3a41; border-top: 2px solid #000; border-bottom: 2px solid #000; height: 8px; top: 18px; }
.steps__step:last-child::after { content: none; }
.steps__marker { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, inset -2px -2px 0 #3a3a40; font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.steps__marker:empty::before { content: counter(step); }
.steps__title { font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-2); }
.steps__meta { font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
.steps__step.is-complete .steps__marker { background: var(--green); color: var(--green-ink); box-shadow: inset 2px 2px 0 #4f8a78, inset -2px -2px 0 #1a3a31; }
.steps__step.is-complete::after { background: var(--accent-2); }
.steps__step.is-complete .steps__title { color: var(--ink-strong); }
.steps__step.is-current .steps__marker, .steps__step[aria-current='step'] .steps__marker { background: var(--btn-accent); color: var(--btn-accent-ink); box-shadow: 0 0 0 2px #000, 0 0 0 5px #e9e6df, 0 0 0 7px #000; }
.steps__step.is-current .steps__title, .steps__step[aria-current='step'] .steps__title { color: var(--ink-bright); }
.steps__step.is-blocked .steps__marker { background: var(--red-bg); color: var(--red-text); }
@media (max-width: 720px) {
  .steps { grid-auto-flow: row; gap: 0; }
  .steps__step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 0 0 18px; }
  .steps__marker { grid-row: span 2; }
  .steps__title { padding-top: 4px; }
  .steps__step::after { left: 18px; right: auto; top: 44px; bottom: 0; width: 8px; height: auto; border: 0; border-left: 2px solid #000; border-right: 2px solid #000; }
}
.steps--vertical { grid-auto-flow: row; }
.steps--vertical .steps__step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 0 0 18px; }
.steps--vertical .steps__marker { grid-row: span 2; }
.steps--vertical .steps__title { padding-top: 4px; }
.steps--vertical .steps__step::after { left: 18px; right: auto; top: 44px; bottom: 0; width: 8px; height: auto; border: 0; border-left: 2px solid #000; border-right: 2px solid #000; }

/* ---- skeletons --------------------------------------------------------------------------------- */
.skeleton { display: block; min-height: 16px; background: #34343a; border: 2px solid #26262b; }
.skeleton--text { height: 16px; margin: 6px 0; } .skeleton--text:last-child { width: 62%; }
.skeleton--block { height: 120px; }
.skeleton--slot { width: 56px; height: 56px; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: skeleton-step 1.4s steps(2, jump-none) infinite; } }
@keyframes skeleton-step { 0% { background: #34343a; } 100% { background: #2a2a2f; } }

/* ---- disclosure: <details class="disclosure"><summary>Advanced<%- icon('chevron-down') %></summary><div class="disclosure__body">.. ---- */
.disclosure { background: var(--surface-3); border: 2px solid var(--line); }
.disclosure + .disclosure { margin-top: var(--sp-2); }
.disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--target); padding: 0 14px; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-strong); cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--hover-ink); background: var(--surface-hover); }
.disclosure[open] > summary { border-bottom: 2px solid var(--line); }
.disclosure[open] > summary .icon { transform: rotate(180deg); }
.disclosure__body { padding: 16px; }
.disclosure__body > * + * { margin-top: var(--sp-4); }

/* ---- misc -------------------------------------------------------------------------------- */
.list-plain { margin: 0; padding: 0; list-style: none; }
.list-rows { margin: 0; padding: 0; list-style: none; }
.list-rows > li { padding: 14px 0; border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--surface-hover); }
.list-rows > li:first-child { border-top: 0; box-shadow: none; }
.more-link { display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); font-family: var(--font-pixel); font-size: 18px; }
.more-link .icon { transition: none; }
.copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid #000; background: var(--well); }
.media-frame { background: var(--well); border: 2px solid #000; box-shadow: var(--shadow-1); overflow: hidden; }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---- charts, user colours, stored images ------------------------------------------------- */
/* Vertical bar chart (traffic per day, logins per hour). Heights come from data-fill (0-100) via app.js.
   <ol class="bars" aria-label="Logins by hour"><li class="bars__bar" data-fill="40" data-tooltip="03:00 · 12"><span class="sr-only">03:00, 12 logins</span></li></ol>
   <div class="bars-axis" aria-hidden="true"><span>00</span><span>06</span><span>12</span><span>18</span><span>23</span></div> */
.bars { display: flex; align-items: flex-end; gap: 3px; height: var(--bars-height, 160px); margin: 0; padding: 4px 4px 0; list-style: none; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608; }
.bars__bar { position: relative; flex: 1 1 0; min-width: 3px; height: calc(var(--fill, 0) * 1%); min-height: 2px; background: repeating-linear-gradient(0deg, var(--accent) 0 8px, var(--accent-lo) 8px 10px); box-shadow: inset 2px 0 0 var(--accent-hi); }
.bars__bar:hover { background: repeating-linear-gradient(0deg, var(--accent-hi) 0 8px, var(--accent) 8px 10px); }
.bars--alt .bars__bar { background: repeating-linear-gradient(0deg, var(--accent-2) 0 8px, var(--accent-2-lo) 8px 10px); box-shadow: inset 2px 0 0 var(--accent-2-hi); }
.bars--sm { --bars-height: 96px; }
.bars-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--font-pixel); font-size: var(--fs-px); line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; }
/* User-chosen colours: data-color="#hex" (validated by app.js) sets --swatch. */
.swatch-dot { display: inline-block; flex: none; width: 14px; height: 14px; background: var(--swatch, var(--stone)); border: 2px solid #000; vertical-align: -2px; }
.tag--color::before { content: ""; flex: none; width: 8px; height: 8px; margin-right: 6px; background: var(--swatch, var(--stone)); box-shadow: 0 0 0 2px #000; }
.avatar--color { box-shadow: inset 0 -4px 0 var(--swatch, transparent), inset 2px 2px 0 #060608; }
/* Stored images: data-bg-image="/media/x.webp" (validated by app.js) sets --bg-image and .has-bg-image. */
.has-bg-image { background-image: var(--bg-image); background-size: cover; background-position: center; background-repeat: no-repeat; }


/* ---- motion --------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .chip, .slot, .plate, input, select, textarea { border: 2px solid CanvasText; }
  .lamp { forced-color-adjust: none; }
}


/* ---- 44px hit areas for small controls (promoted from the a1/a3 page layers) ----------
   Checkboxes and switches keep their drawn size; a transparent border is the extra hit area,
   the black edge becomes an inset outline, and negative margins keep the layout footprint. */
input[type='checkbox']:not(.switch) { width: 44px; height: 44px; margin: -10px; border: 12px solid transparent; background-clip: padding-box; outline: 2px solid #000; outline-offset: -12px; }
input[type='checkbox']:not(.switch):focus-visible { outline: 3px solid var(--focus); outline-offset: -9px; box-shadow: inset 0 0 0 2px #000; }
.check > input[type='checkbox']:not(.switch) { margin-top: -11px; }
input[type='checkbox'].switch { width: 68px; height: 44px; margin: -8px; border: 10px solid transparent; background-clip: padding-box; outline: 2px solid #000; outline-offset: -10px; }
input[type='checkbox'].switch:focus-visible { outline: 3px solid var(--focus); outline-offset: -9px; }
.check > input.switch { margin-top: -10px; }
.sort { min-height: var(--target); margin-block: -12px; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: var(--target); margin-block: -6px; }


/* ---- css/site.css ---- */
/* =============================================================================
   CrankWeb v9 site layer: public layout. Loaded after core.css in the site bundle.
   Header (hotbar nav), alert banner, hero frame and carousel, sections, footer,
   form pages, status pages, theme effects.
   ========================================================================== */

body.site { background-color: var(--bg); background-image: var(--page-image); background-repeat: repeat; background-attachment: fixed; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }
.wrap--wide { max-width: 1392px; }
.site-main { display: block; }
.site-main:focus { outline: none; }

/* ---- notice bar (views/partials/banner.ejs): one bar at most ------------------------ */
.notice-bar { background: var(--surface-2); border-bottom: 2px solid #000; color: var(--ink); }
.notice-bar__row { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.notice-bar__text { flex: 1 1 auto; min-width: 0; margin: 0; padding-block: 10px; font-size: 16px; line-height: 1.5; }
.notice-bar__title { margin-right: 10px; font-family: var(--font-pixel); font-size: 18px; font-weight: 400; color: var(--notice-title, var(--ink-bright)); text-shadow: 2px 2px 0 #000; }
.notice-bar__msg { color: var(--ink-2); }
.notice-bar__link { margin-left: 6px; color: var(--notice-title, var(--link)); white-space: nowrap; }
.notice-bar__link:hover { color: var(--hover-ink); }
.notice-bar__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--target); height: var(--target); margin-right: -10px; padding: 0; background: none; border: 0; color: var(--ink-2); cursor: pointer; }
.notice-bar__close:hover { color: var(--hover-ink); }
.notice-bar--green { --notice-title: #8fe0a6; box-shadow: inset 4px 0 0 #3f8f55; }
.notice-bar--blue { --notice-title: #9cc4ec; box-shadow: inset 4px 0 0 #3d6d9c; }
.notice-bar--amber { --notice-title: #f2bd73; box-shadow: inset 4px 0 0 #b06a1e; }
.notice-bar--red { --notice-title: #ff8f80; background: var(--red-bg); box-shadow: inset 4px 0 0 var(--red); }
.notice-bar--poll { --notice-title: var(--lamp-on); }
@media (max-width: 720px) { .notice-bar__text { font-size: 15px; } }

/* ---- header ---------------------------------------------------------------------- */
.site-header { position: relative; z-index: 20; border-bottom: 2px solid #000; }
.site-header__row { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { flex: none; }
.brand__name { font-size: 27px; font-weight: 400; }
.site-nav { flex: 1 1 auto; min-width: 0; }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav__link { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); padding: 0 10px; font-family: var(--font-pixel); font-size: 18px; line-height: 1; color: var(--ink-2); text-decoration: none; text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.site-nav__link:hover { color: var(--hover-ink); }
.site-nav__link.is-current { color: var(--ink-bright); }
.site-nav__link.is-current::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 4px; background: var(--accent); box-shadow: 2px 2px 0 #000; }
.site-nav__link .lamp { width: 10px; height: 10px; border-width: 2px; }
.site-nav__extra { display: none; }
.site-nav__more { position: relative; }
.site-nav__more > summary { list-style: none; cursor: pointer; user-select: none; }
.site-nav__more > summary::-webkit-details-marker { display: none; }
.site-nav__more > summary .icon { width: 12px; height: 12px; transition: transform .12s steps(2); }
.site-nav__more[open] > summary .icon { transform: rotate(180deg); }
.site-nav__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: grid; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 2px solid #000; box-shadow: var(--bevel), var(--shadow-2); }
.site-nav__menu-link { display: flex; align-items: center; min-height: var(--target); padding: 0 12px; font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-nav__menu-link:hover, .site-nav__menu-link:focus-visible { background: var(--surface-hover); color: var(--hover-ink); }
.site-nav__menu-link.is-current { color: var(--ink-bright); box-shadow: inset 4px 0 0 var(--accent); }
.site-header__actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.menu-btn { display: none; }
@media (max-width: 1180px) {
  .site-header__row { flex-wrap: wrap; row-gap: 0; }
  .menu-btn { display: inline-flex; }
  .site-nav { order: 3; flex-basis: 100%; display: none; padding-bottom: 14px; }
  .site-nav.is-open { display: block; }
  .site-nav__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .site-nav__link { width: 100%; padding: 0 12px; background: var(--well); border: 2px solid #000; }
  .site-nav__link.is-current::after { left: 0; right: auto; top: 0; bottom: 0; width: 4px; height: auto; box-shadow: none; }
  .site-nav__extra { display: block; }
  .site-nav__more-item { display: none; }
}
@media (max-width: 960px) { .hide-md { display: none !important; } }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .site-header__row { min-height: 64px; gap: 12px; }
  .brand { gap: 10px; }
  .brand__name { font-size: 18px; }
  .logo-slot { width: 44px; height: 44px; }
}
@media (max-width: 400px) { .site-nav__list { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 721px) { .show-sm { display: none !important; } }

/* ---- carousel (views/partials/slideshow.ejs) ------------------------------------- */
.carousel { position: relative; width: 100%; height: 100%; min-height: 200px; overflow: hidden; background: var(--well); }
.carousel__viewport { position: absolute; inset: 0; }
.carousel__viewport:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.carousel__slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; }
.carousel__slide.is-active { opacity: 1; visibility: visible; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel__slide--art { background-color: var(--well); background-image: var(--hero-image); background-size: cover; background-position: center; }
@media (prefers-reduced-motion: no-preference) { .carousel__slide { transition: opacity 600ms steps(6, end), visibility 0s linear 600ms; } .carousel__slide.is-active { transition: opacity 600ms steps(6, end); } }
/* Small dots and a pause button, bottom centre. The slideshow pauses on hover and focus. */
.carousel__controls { position: absolute; left: 50%; bottom: 14px; z-index: 4; display: flex; align-items: center; gap: 2px; transform: translateX(-50%); }
.carousel__dots { display: flex; }
.carousel__dot { position: relative; width: 28px; height: 44px; padding: 0; background: transparent; border: 0; cursor: pointer; }
.carousel__dot::before { content: ""; position: absolute; left: 8px; top: 16px; width: 12px; height: 12px; background: rgba(0, 0, 0, .55); border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .25); }
.carousel__dot[aria-current='true']::before { background: #fff; box-shadow: inset -2px -2px 0 #a8a8a8; }
.carousel__dot:hover::before { background: var(--hover-ink); }
.carousel__toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; border: 0; color: #fff; filter: drop-shadow(2px 2px 0 #000); cursor: pointer; }
.carousel__toggle:hover { color: var(--hover-ink); }
.carousel__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Theme Studio time-of-day tint (flat, no gradient) */
:root[data-time-variant='night'] .carousel::after, :root[data-time-variant='dusk'] .carousel::after, :root[data-time-variant='dawn'] .carousel::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
:root[data-time-variant='night'] .carousel::after { background: rgba(12, 18, 54, .32); }
:root[data-time-variant='dusk'] .carousel::after { background: rgba(110, 42, 16, .2); }
:root[data-time-variant='dawn'] .carousel::after { background: rgba(255, 190, 140, .12); }

/* ---- sections ------------------------------------------------------------------- */
.section { padding-block: 80px; }
.section--tight { padding-block: 52px; }
.section--flush-top { padding-top: 0; }
.section--band { background: var(--surface-2); border-top: 2px solid #000; border-bottom: 2px solid #000; padding-block: 60px 64px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 30px; }
.section-head__sub { margin: 10px 0 0; font-size: 17px; color: var(--muted); }
@media (max-width: 720px) { .section { padding-block: 52px; } .section--band { padding-block: 44px 48px; } }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 28px; }
.col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: 1 / -1; } }
@media (max-width: 720px) { .grid-12 { gap: 22px; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); gap: 40px; } }

/* Inner page header: a short textured band with the page title. */
.page-banner { border-bottom: 2px solid #000; }
.page-banner__in { padding-block: 40px 44px; }
.page-banner .breadcrumbs { margin-bottom: 14px; }
.page-banner h1, .page-banner .h1 { font-size: 45px; line-height: 1.05; color: var(--ink-bright); }
.page-banner__lead { margin: 14px 0 0; max-width: 40em; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); text-shadow: 2px 2px 0 #000; }
.page-banner__meta { margin-top: 18px; }
@media (max-width: 720px) { .page-banner__in { padding-block: 28px 30px; } .page-banner h1, .page-banner .h1 { font-size: 36px; } .page-banner__lead { font-size: 17px; } }

/* Lists of updates and people */
.updates-list { margin: 0; padding: 0; list-style: none; border-bottom: 2px solid #000; }
.updates-list__row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 32px; padding: 26px 0; border-top: 2px solid #000; box-shadow: inset 0 2px 0 var(--surface-hover); }
.updates-list__date { font-family: var(--font-pixel); font-size: 18px; line-height: 1.5; color: var(--muted); }
.updates-list__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 27px; }
.updates-list__title a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--ink-strong); text-decoration: none; }
.updates-list__title a:hover { color: var(--hover-ink); text-decoration: underline; }
.updates-list__text { margin: 8px 0 0; max-width: 46em; color: var(--ink-2); }
@media (max-width: 720px) { .updates-list__row { grid-template-columns: minmax(0, 1fr); padding: 20px 0; } .updates-list__title { font-size: 18px; } }
.members { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 10px 18px; background: var(--surface); border: 2px solid #000; box-shadow: inset 2px 2px 0 #3e3e45, inset -2px -2px 0 #1c1c20, var(--shadow-1); text-align: center; }
.member .avatar { margin-bottom: 10px; }
.member__name { font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-strong); overflow-wrap: anywhere; }
.member__meta { font-size: 14px; line-height: 1.4; color: var(--muted); }
@media (max-width: 1100px) { .members { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .members { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* Map band */
.map-band__stage { position: relative; background: var(--well); }
.map-band__art { height: 460px; }
.map-band__art img { width: 100%; height: 100%; object-fit: cover; }
.map-band__wrap { position: absolute; inset: 0; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: flex-end; pointer-events: none; }
.map-band__plate { width: 460px; pointer-events: auto; }
@media (max-width: 720px) { .map-band__art { height: 220px; } .map-band__wrap { position: static; display: block; max-width: none; padding: 0; } .map-band__plate { width: auto; border-width: 2px 0 0; box-shadow: none; } }

/* Call to action (copper plate) */
.cta__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 48px; align-items: center; padding: 44px 48px 46px; }
.cta__title { margin: 0; font-family: var(--font-pixel); font-weight: 600; font-size: 45px; line-height: 1.05; color: var(--accent-ink); text-shadow: 3px 3px 0 var(--accent-hi) !important; }
.cta__text { margin: 14px 0 0; max-width: 38em; font-size: 18px; line-height: 1.55; color: var(--accent-ink); }
.cta__steps { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 22px 0 0; padding: 0; list-style: none; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--accent-ink); }
.cta__steps li { display: inline-flex; align-items: center; gap: 10px; }
.cta__n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: var(--accent-ink); color: var(--accent-plate); }
.cta__buttons { display: flex; flex-wrap: wrap; gap: 16px; }
@media (max-width: 720px) { .cta__in { grid-template-columns: minmax(0, 1fr); padding: 30px 20px 32px; } .cta__title { font-size: 36px; } .cta__buttons .btn { flex: 1 1 100%; } }

/* ---- footer --------------------------------------------------------------------- */
.site-footer__tex { height: 24px; border-top: 2px solid #000; border-bottom: 2px solid #000; }
.site-footer__body { background: var(--well); }
.site-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px 48px; padding-block: 40px 44px; }
.site-footer__brand .brand__name { font-size: 27px; }
.site-footer__p { margin: 6px 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }
.site-footer__p:first-of-type { margin-top: 14px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 26px; margin: 0; padding: 0; list-style: none; max-width: 560px; }
.site-footer__links a { display: inline-flex; align-items: center; gap: 8px; min-height: var(--target); font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); text-decoration: none; }
.site-footer__links a:hover { color: var(--hover-ink); text-decoration: underline; }

/* ---- form pages (apply, appeal, sign-in, poll) ------------------------------------- */
.form-page { padding-block: 48px 80px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.form-layout__aside { position: sticky; top: 20px; display: grid; gap: 24px; }
@media (max-width: 1000px) { .form-layout { grid-template-columns: minmax(0, 1fr); } .form-layout__aside { position: static; } }
.form-card > .plate__body { padding: 28px 32px 32px; }
@media (max-width: 640px) { .form-page { padding-block: 24px 52px; } .form-card > .plate__body { padding: 20px 16px 24px; } }
.auth-card { max-width: 480px; margin: 0 auto; }
.recaptcha-slot { min-height: 78px; }

/* ---- status pages (error, success, not found) -------------------------------------- */
.status-page { padding-block: 64px 96px; }
.status-card { max-width: 640px; margin: 0 auto; }
.status-card__in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 24px; align-items: start; padding: 32px 32px 34px; }
.status-card__in .slot { color: var(--ink-strong); }
.status-card--error .slot { color: var(--red-text); }
.status-card--ok .slot { color: var(--green-text); }
.status-card__title { margin: 0; font-size: 36px; }
.status-card__text { margin: 12px 0 0; color: var(--ink-2); }
.status-card__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.status-card__code { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
@media (max-width: 640px) { .status-page { padding-block: 32px 56px; } .status-card__in { grid-template-columns: minmax(0, 1fr); padding: 24px 18px 26px; } .status-card__title { font-size: 27px; } }

/* ---- theme effects (seasonal particles, ambient sound, confetti) ------------------- */
.fx { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.fx__p { position: absolute; top: -12px; left: var(--x, 50%); width: var(--size, 6px); height: var(--size, 6px); background: var(--c, #fff); opacity: var(--o, .8); box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); animation: fx-fall var(--dur, 12s) linear var(--delay, 0s) infinite; }
.fx__p--rise { top: auto; bottom: -12px; animation-name: fx-rise; }
.fx__p--twinkle { top: var(--y, 20%); animation: fx-twinkle var(--dur, 4s) steps(2, end) var(--delay, 0s) infinite; }
@keyframes fx-fall { to { transform: translate3d(var(--drift, 0), 110vh, 0); } }
@keyframes fx-rise { to { transform: translate3d(var(--drift, 0), -110vh, 0); opacity: 0; } }
@keyframes fx-twinkle { 50% { opacity: .15; } }
.ambient-toggle { position: fixed; left: 16px; bottom: 16px; z-index: 50; }
.confetti { position: fixed; inset: 0; z-index: 800; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -16px; left: var(--x, 50%); width: var(--size, 8px); height: var(--size, 8px); background: var(--c, var(--accent)); animation: fx-fall var(--duration, 2.4s) steps(24, end) var(--delay, 0s) 1 forwards; }
@media (prefers-reduced-motion: reduce) { .fx, .confetti { display: none; } }

/* ---- print ---------------------------------------------------------------------- */
@media print {
  .site-alert, .poll-strip, .site-header__nav, .menu-btn, .site-header__actions, .site-footer, .fx, .ambient-toggle, .carousel__controls { display: none !important; }
  body.site { background: #fff; color: #000; }
}


/* ---- css/pages/site-p1-about.css ---- */
/* About page (views/about.ejs) */
.about-prose .lead { color: var(--ink-strong); }
.about-rules-h { margin-top: var(--sp-16); scroll-margin-top: var(--sp-6); }
.about-rules { margin-top: var(--sp-6); border-bottom: 2px solid var(--line); counter-reset: none; }
.about-rules__row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 20px; align-items: start; padding: 20px 0; border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--surface-hover); }
.about-rules__n { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--well); border: 2px solid #000; box-shadow: var(--inset), var(--shadow-1); font-family: var(--font-pixel); font-size: 18px; color: var(--link); }
.about-rules__t { margin: 0; font-size: 27px; color: var(--ink-strong); }
.about-rules__d { margin: 6px 0 0; color: var(--ink-2); }
.about-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-content: start; }
/* Between the stacked layout and phones the picture and the joining plate sit side by side. */
@media (min-width: 721px) and (max-width: 1100px) { .about-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } .about-shot { aspect-ratio: 4 / 3; } }
.about-shot { aspect-ratio: 5 / 3; }
.about-aside .note a { white-space: nowrap; }
@media (max-width: 720px) { .about-rules-h { margin-top: var(--sp-12); } .about-rules__row { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; } .about-rules__t { font-size: 18px; } }


/* ---- css/pages/site-p1-events.css ---- */
/* Events list (views/events.ejs) and event page (views/event-detail.ejs) */
.ev-meta { margin: 6px 0 0; font-family: var(--font-pixel); font-size: 18px; line-height: 1.35; color: var(--link); }
.ev-count { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); }
.ev-count .icon { color: var(--muted); }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.ev-foot > .btn { margin-left: auto; }

.ev-feature { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.ev-feature__art { position: relative; display: block; min-height: 340px; background: var(--well); border-right: 2px solid var(--line); }
.ev-feature__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-art-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ev-feature__body { display: flex; flex-direction: column; gap: 18px; padding: 28px 30px 30px; }
.ev-feature__top { display: flex; align-items: flex-start; gap: 20px; }
.ev-feature__title { margin: 10px 0 0; font-size: 36px; line-height: 1.12; }
.ev-feature__title a, .ev-card__title a { color: var(--ink-strong); text-decoration: none; }
.ev-feature__title a:hover, .ev-card__title a:hover { color: var(--hover-ink); text-decoration: underline; }
.ev-feature__text { margin: 0; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); }
.ev-feature .ev-foot { margin-top: auto; }

.ev-more-h { margin: var(--sp-14) 0 var(--sp-6); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 28px; }
.ev-grid > li { display: flex; }
.ev-card { display: flex; flex-direction: column; width: 100%; }
.ev-card > .plate__body { display: flex; flex-direction: column; flex: 1 1 auto; }
.ev-card .ev-foot { margin-top: auto; padding-top: var(--sp-2); }
.ev-card__art { display: block; width: 100%; height: 170px; object-fit: cover; border-bottom: 2px solid var(--line); }
.ev-card__title { margin: 0; font-size: 27px; line-height: 1.2; }
.ev--cancelled .ev-feature__title a, .ev--cancelled .ev-card__title a { color: var(--ink-2); }
.ev--cancelled .ev-feature__art img, .ev--cancelled .ev-card__art { filter: grayscale(1); opacity: .6; }

@media (max-width: 900px) {
  .ev-feature { grid-template-columns: minmax(0, 1fr); }
  .ev-feature__art { min-height: 220px; border-right: 0; border-bottom: 2px solid var(--line); }
}
@media (max-width: 720px) {
  .ev-feature__body { padding: 20px 16px 22px; }
  .ev-feature__top { gap: 14px; }
  .ev-feature__top .date-block { width: 72px; }
  .ev-feature__title { font-size: 27px; }
  .ev-feature__text { font-size: 17px; }
  .ev-more-h { margin-top: var(--sp-10); }
}

/* Event page */
.evd-tags { margin-bottom: 12px; }
.evd-main { display: grid; gap: var(--sp-8); min-width: 0; }
.evd-main > * { min-width: 0; }
.evd-art { aspect-ratio: 2 / 1; }
.evd-text { margin: var(--sp-4) 0 0; max-width: 46em; color: var(--ink-2); white-space: pre-line; }
.plate__body .evd-text:first-child { margin-top: 0; }
.evd-winners { margin-top: 0; font-weight: 600; color: var(--ink-strong); }
.evd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; margin-top: var(--sp-4); }
.evd-figure { margin: 0; }
.evd-figure .thumb { box-shadow: var(--shadow-1); }
.evd-figure figcaption { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.evd-aside { display: grid; gap: var(--sp-6); align-content: start; }
.evd-countdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--line); }
.evd-countdown__cell { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; padding: 16px 8px 14px; background: var(--surface-3); }
.evd-countdown__n { font-family: var(--font-pixel); font-size: 36px; line-height: 1; color: var(--ink-bright); text-shadow: 3px 3px 0 #000; font-variant-numeric: tabular-nums; }
.evd-countdown__u { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
@media (max-width: 720px) { .evd-main { gap: var(--sp-6); } .evd-facts.kv--3 { --kv-cols: 1; } }
.ev-card__art--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.evd-solo .evd-main { max-width: 880px; }
.ev-feature__title a, .ev-card__title a { display: inline-flex; align-items: center; min-height: var(--target); }


/* ---- css/pages/site-p1-home.css ---- */
/* Home page (views/index.ejs): a full-width slideshow with one plate on it, then one row of
   what is on now (event, poll or goals, latest update). Nothing else. */

.home-hero { position: relative; border-bottom: 2px solid #000; background: var(--well); }
.home-hero__art { height: min(78vh, 720px); min-height: 520px; }
.home-hero__wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; padding-bottom: 72px; pointer-events: none; }
.home-hero__plate { width: 640px; max-width: 100%; pointer-events: auto; }
.home-hero__in { padding: 32px 36px 30px; }
.home-hero .h-display { color: var(--ink-bright); text-shadow: 4px 4px 0 #000; }
.home-hero__sub { margin: 16px 0 0; max-width: 34em; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); }
.home-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 26px; }
.home-addr { flex: 0 1 auto; }
.home-hero__status { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; padding-top: 16px; border-top: 2px solid #000; box-shadow: inset 0 2px 0 var(--surface-hi); font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); }
.home-hero__status .num { color: var(--ink-bright); }
.home-hero__stale { color: var(--muted); }

.home-now { padding-block: 48px 72px; }
.home-now__grid { display: grid; gap: 24px; }
.home-now__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-now__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-card { display: flex; flex-direction: column; }
.home-card .plate__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1 1 auto; }
.home-card .plate__body > .btn { margin-top: auto; }
.home-card__title { margin: 0; font-family: var(--font-body); font-size: 20px; font-weight: 600; line-height: 1.35; text-shadow: none; }
.home-card__title a { color: var(--ink-strong); text-decoration: none; }
.home-card__title a:hover { color: var(--hover-ink); text-decoration: underline; }
.home-card__meta { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.home-card__text { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-goals { display: grid; gap: 14px; width: 100%; }

@media (max-width: 1100px) {
  .home-now__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-now__grid--3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .home-hero__art { height: 260px; min-height: 0; }
  .home-hero__wrap { position: static; display: block; padding: 0; }
  .home-hero__plate { width: auto; border-width: 2px 0 0; box-shadow: none; }
  .home-hero__in { padding: 24px 16px 22px; }
  .home-hero__sub { font-size: 17px; }
  .home-hero__actions > * { width: 100%; }
  .home-hero__actions .secret { display: flex; }
  .home-hero__actions .secret__value { flex: 1 1 auto; min-width: 0; }
  .home-now { padding-block: 32px 48px; }
  .home-now__grid--2, .home-now__grid--3 { grid-template-columns: minmax(0, 1fr); }
  .home-now__grid--3 > :last-child { grid-column: auto; }
}
.home-card__art { aspect-ratio: 16 / 7; border-bottom: 2px solid #000; background-color: var(--well); background-size: cover; background-position: center; }


/* ---- css/pages/site-p1-map.css ---- */
/* Live map page (views/map.ejs): the map iframe sits in a machined monitor. */
.map-page { padding-block: 40px 80px; }
.map-monitor { padding: 0; }
.map-monitor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-height: 60px; padding: 8px 12px 8px 20px; background: var(--surface-2); border-bottom: 2px solid #000; box-shadow: inset 0 2px 0 var(--frame-hi); }
.map-monitor__host { flex: 1 1 12em; min-width: 0; font-family: var(--font-pixel); font-size: 18px; color: var(--muted); overflow-wrap: anywhere; }
.map-monitor__screen { margin: 14px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #060608, 0 0 0 2px var(--frame-lo); }
.map-monitor__frame { display: block; width: 100%; height: min(72vh, 760px); min-height: 420px; border: 0; background: var(--well); }
.map-monitor__foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 22px 14px; }
.map-monitor__vent { flex: 0 1 220px; height: 12px; background: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 8px); opacity: .55; }
.map-tips { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 28px; }
.map-tips__item { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 22em; margin: 0; color: var(--ink-2); }
.map-tips__item .icon { flex: none; margin-top: 5px; color: var(--link); }
.map-tips__item strong { color: var(--ink-strong); }
@media (max-width: 720px) {
  .map-page { padding-block: 20px 52px; }
  .map-monitor__bar { padding: 8px 10px 8px 14px; }
  .map-monitor__screen { margin: 8px; }
  .map-monitor__frame { height: 62vh; min-height: 360px; }
  .map-monitor__foot { padding: 0 14px 10px; }
}


/* ---- css/pages/site-p1-misc.css ---- */
/* Theme preview (views/theme-preview.ejs) */
.tp-next { display: flex; align-items: flex-start; gap: 22px; }
.tp-next.plate__body > * + * { margin-top: 0; }
.tp-stack { display: grid; gap: 16px; align-content: start; }
.tp-members { grid-template-columns: repeat(2, minmax(0, 1fr)); }


/* ---- css/pages/site-p1-shell.css ---- */
/* Public shell adjustments (views/partials/header, footer, banner). Owned with the shell partials. */

/* Footer: keep the brand column narrow so the link list sits beside it on desktop, as in the concept. */
.site-footer__brand { flex: 0 1 500px; min-width: 0; }
.site-footer__links { flex: 0 1 560px; }

/* Touch targets: short footer and breadcrumb links get a full 44px box. */
.site-footer__links a { min-width: var(--target); justify-content: center; }
.page-banner .breadcrumbs { margin-bottom: 4px; }
.page-banner .breadcrumbs a { display: inline-flex; align-items: center; min-height: var(--target); min-width: var(--target); }

/* Hero slideshow controls (views/partials/slideshow.ejs): full-size buttons and 44px-tall dots. */
.carousel__dots { gap: 0; }
.carousel__dot { width: var(--target); height: var(--target); }
.carousel__dot::before { left: 16px; top: 16px; }
@media (max-width: 720px) { .carousel__dot { width: var(--target); } }

/* Short pages (errors, empty lists): the footer sits at the bottom of the window, not halfway up. */
body.site { display: flex; flex-direction: column; }
body.site > .site-main { flex: 1 0 auto; }
body.site > .site-top, body.site > .site-footer { flex: none; }
@media print { body.site { display: block; } }


/* ---- css/pages/site-p1-stats.css ---- */
/* Stats (views/stats.ejs), leaderboard (views/leaderboard.ejs) and Year in Review (views/year-review.ejs) */
.stats-page { display: grid; gap: var(--sp-8); }
.stats-strip .stat__value { display: flex; align-items: center; gap: 10px; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: stretch; }
.stats-year > .plate__body { display: flex; flex-direction: column; }
.stats-year .more-link { align-self: flex-start; margin-top: auto; padding-top: var(--sp-4); }
.stats-strong { color: var(--ink-strong); }
.stats-year .kv dd { font-size: 27px; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: minmax(0, 1fr); } }

/* Leaderboard */
.lb-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 0; list-style: none; }
.lb-podium__item { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.lb-podium__rank { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; background: var(--well); border: 2px solid #000; box-shadow: var(--inset), var(--shadow-1); font-family: var(--font-pixel); font-size: 18px; color: var(--link); }
.lb-podium__item:first-child .lb-podium__rank { background: var(--accent-plate); color: var(--accent-ink); box-shadow: inset 2px 2px 0 var(--accent-hi), inset -2px -2px 0 var(--accent-lo), var(--shadow-1); }
.lb-podium__name { margin: 0; font-family: var(--font-pixel); font-size: 18px; line-height: 1.2; color: var(--ink-strong); overflow-wrap: anywhere; }
.lb-podium__time { margin: 4px 0 0; font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); }
.lb-rank { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.lb-who { display: inline-flex; align-items: center; gap: 12px; }
.lb-who .status { font-size: 18px; }
@media (max-width: 1000px) { .lb-podium { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.lb-list { display: none; }
@media (max-width: 720px) {
  .lb-tablewrap { display: none; }
  .lb-list { display: block; }
  .lb-list__row { display: grid; grid-template-columns: 28px auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-top: 2px solid var(--line); }
  .lb-list__row:nth-child(even) { background: var(--surface-3); }
  .lb-list__row .lb-rank { text-align: right; }
  .lb-list__name { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .lb-list__name .who__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lb-list__meta { display: block; margin-top: 2px; font-size: 14px; line-height: 1.3; color: var(--muted); }
  .lb-list__time { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
}

/* Year in Review */
.yr-stats .stat__value { font-size: 45px; }
.yr-sessions .table td:first-child { white-space: nowrap; }
.yr-banner { display: flex; align-items: center; gap: 24px; }
@media (max-width: 720px) { .yr-banner { align-items: flex-start; gap: 16px; } .yr-banner .avatar--xl { width: 76px; height: 76px; } .yr-banner .avatar--xl > svg { width: 48px; height: 48px; } .yr-stats .stat__value { font-size: 36px; } }
.stats-page > *, .stats-grid > * { min-width: 0; }
.lb-who { white-space: nowrap; }
.lb-table td.num { white-space: nowrap; }
@media (max-width: 720px) { .stats-strip .stats, .yr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }



/* ---- css/pages/site-p1-updates.css ---- */
/* Updates page (views/updates.ejs): a dated log, one entry per update. */
.upd-log { border-bottom: 2px solid var(--line); }
.upd-log__entry { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 40px; padding: 34px 0 38px; border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--surface-hover); scroll-margin-top: var(--sp-6); }
.upd-log__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.upd-log__date { font-family: var(--font-pixel); font-size: 18px; line-height: 1.3; color: var(--ink-2); }
.upd-log__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 27px; line-height: 1.15; color: var(--ink-strong); }
.upd-log__summary { margin: 12px 0 0; max-width: 46em; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-strong); }
.upd-log__text { margin: 12px 0 0; max-width: 46em; color: var(--ink-2); white-space: pre-line; }
.upd-log__gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 18px; margin-top: 22px; }
.upd-log__gallery--one { grid-template-columns: minmax(0, 480px); }
.upd-log__title .chip { text-shadow: none; }
.upd-log__figure { margin: 0; }
.upd-log__figure .thumb { box-shadow: var(--shadow-1); }
.upd-log__figure figcaption { margin-top: 8px; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
@media (max-width: 720px) {
  .upd-log__entry { grid-template-columns: minmax(0, 1fr); padding: 24px 0 28px; }
  .upd-log__meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .upd-log__title { font-size: 27px; }
  .upd-log__summary { font-size: 17px; }
}


/* ---- css/pages/site-p2-forms.css ---- */
/* p2: public forms (apply, ban appeal, Discord link, dashboard sign-in) and submission receipts.
   Uses tokens only. Shared form pieces built here that core.css does not have yet:
   .p2-error-summary (linked list of problems), .p2-has-error (field wrapper state),
   .field__count.is-near-limit, .p2-receipt (wide status card with a body and foot). */

/* ---- error summary ----------------------------------------------------------------- */
.p2-error-summary:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.p2-error-summary__list { margin: 4px 0 0; padding: 0; list-style: none; }
.p2-error-summary__list > li { position: relative; padding-left: 18px; }
.p2-error-summary__list > li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 6px; height: 6px; background: var(--red-text); box-shadow: 2px 2px 0 #000; }
.p2-error-summary__list a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; text-decoration-thickness: 2px; }

/* ---- fields ------------------------------------------------------------------------------ */
.p2-has-error > .field__label { color: var(--red-text); }
.field__count.is-near-limit { color: var(--amber-text); }
.managed-field > .field__help { margin-top: -2px; }
/* The field's own 6px gap spaces help, error and counter; no paragraph margins on top. */
[data-p2-field] > :is(.field__error, .field__count) { margin-top: 0; }
[data-p2-field] > .field__count { margin-top: -2px; }
/* Hidden form plumbing (CSRF input, honeypot, a hidden error summary) adds no gap above the next
   block; visible blocks carry the gap below them instead (block margins collapse, so the spacing
   between two visible blocks stays 16px). */
.form-card .plate__body > :is(input[type='hidden'], .honeypot, [hidden]) + * { margin-top: 0; }
.form-card .plate__body > :not(:last-child) { margin-bottom: var(--sp-4); }
.managed-form-grid > .empty { grid-column: 1 / -1; }
.p2-consent { margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 2px dashed var(--frame); }
.p2-consent .check--boxed { box-shadow: inset 2px 2px 0 var(--strip-hi); }
.p2-consent .check__text > strong .req { margin-left: 2px; }
.form-card .recaptcha-slot { margin-top: var(--sp-6); }
.form-card .form-actions .note { flex: 1 1 220px; }

/* live poll / event note in a form aside */
.p2-live .plate__body { display: grid; gap: 10px; justify-items: start; }
.p2-live .plate__body > * + * { margin-top: 0; }
.p2-live__text { font-weight: 600; color: var(--ink-strong); line-height: 1.4; }

/* ---- narrow single-purpose forms (dashboard sign-in, Discord link) ------------------------ */
.p2-narrow { padding-block: 56px 88px; }
.p2-narrow .auth-card { max-width: 560px; }
.p2-narrow__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.p2-narrow__head h1 { font-size: var(--fs-h2); line-height: 1.15; color: var(--ink-bright); }
.p2-narrow__head .note { margin-top: 6px; }
.p2-narrow .form-card > .plate__body > form > * + * { margin-top: var(--sp-5); }
.p2-narrow__privacy { display: flex; gap: 10px; align-items: flex-start; }
.p2-narrow__privacy .icon { flex: none; margin-top: 3px; color: var(--accent-2-text); }
@media (max-width: 640px) {
  .p2-narrow { padding-block: 28px 56px; }
  .p2-narrow__head { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

/* ---- receipts: status card with steps, reference and a private link ----------------------- */
.status-card.p2-receipt { max-width: 760px; }
.p2-receipt__body { padding: 0 32px 30px; }
.p2-receipt__body > * + * { margin-top: var(--sp-4); }
.p2-receipt__steps { margin-bottom: var(--sp-6); padding: 22px 20px 6px; background: var(--surface-3); border: 2px solid var(--line); box-shadow: inset 2px 2px 0 var(--strip-hi); }
.p2-receipt__ref { max-width: 320px; }
.p2-receipt__ref dd { font-size: 27px; letter-spacing: .04em; }
.p2-receipt__link { padding-top: var(--sp-6); border-top: 2px dashed var(--frame); }
.p2-receipt__link > * + * { margin-top: var(--sp-3); }
.p2-receipt__link .secret__value { font-family: var(--font-mono); font-size: var(--fs-sm); }
.p2-receipt__foot { justify-content: space-between; }
@media (max-width: 640px) {
  .p2-receipt__body { padding: 0 18px 24px; }
  .p2-receipt__steps { padding: 18px 14px 2px; }
  .p2-receipt__foot { justify-content: flex-start; }
  .p2-receipt__foot .btn { flex: 1 1 100%; }
  /* Long links and receipts: the value gets the full width, Copy sits under it. */
  .p2-receipt .secret { flex-direction: column; }
  .p2-receipt .secret__value { border-right: 2px solid #000; border-bottom: 0; }
  .p2-receipt .secret > .btn { width: 100%; }
}

/* Printable receipts: the card on white paper, controls hidden. */
@media print {
  .p2-print-hide, .p2-receipt__foot, .status-card .btn, .status-card .btn-row { display: none !important; }
  .status-page { padding: 0 !important; }
  .status-card, .status-card.p2-receipt { max-width: none; background: #fff !important; color: #000 !important; border: 2px solid #000; box-shadow: none !important; }
  .status-card::before { content: none; }
  .status-card :is(h1, h2, p, dt, dd, code, strong, span) { color: #000 !important; text-shadow: none !important; }
  .status-card :is(.slot, .secret__value, .kv > div, .p2-receipt__steps) { background: #fff !important; box-shadow: none !important; border-color: #000 !important; }
}

/* ---- .p2-hit: 44px hit box for checkboxes and switches ----------------------------------
   The input's own box grows to 44px with a transparent border; the visible slot or switch is
   drawn inside it at its normal size (black ring and bevel as inset shadows), and negative
   margins keep the row's layout unchanged. */
input[type='checkbox'].p2-hit { width: 44px; height: 44px; margin: -11px 2px -10px -10px; border: 10px solid transparent; background-clip: padding-box; background-origin: padding-box; box-shadow: inset 0 0 0 2px #000, inset 4px 4px 0 var(--line), inset -4px -4px 0 var(--frame); }
input[type='checkbox'].p2-hit:checked { box-shadow: inset 0 0 0 2px #000, inset 4px 4px 0 var(--accent-hi), inset -4px -4px 0 var(--accent-lo); background-position: 4px 10px, 6px 12px, 8px 14px, 10px 12px, 12px 10px, 14px 8px, 16px 6px; }
input[type='checkbox'].switch.p2-hit { width: 52px; height: 44px; margin: -9px 0 -8px; border-width: 8px 0; box-shadow: inset 0 0 0 2px #000, inset 4px 4px 0 var(--dark-lo), inset -4px -4px 0 var(--frame); background-position: 10px 10px, 6px 6px, 4px 4px; }
input[type='checkbox'].switch.p2-hit:checked { box-shadow: inset 0 0 0 2px #000, inset 4px 4px 0 var(--accent-2-lo), inset -4px -4px 0 var(--accent-2); background-position: 34px 10px, 30px 6px, 28px 4px; }

/* Breadcrumb links on p2 pages: 44px tall targets (core uses 32px) without moving the text. */
:is(.p2-case-form, .p2-poll) .page-banner .breadcrumbs a { min-height: var(--target); min-width: var(--target); margin-block: -6px; }
:is(.p2-case-form, .p2-poll) .page-banner .breadcrumbs { margin-bottom: 8px; }

/* Apply and appeal on tablets: the two-column questions need the full width, so the "what happens
   next" aside moves under the form (core stacks .form-layout only at 1000px). */
@media (max-width: 1100px) {
  .p2-case-form .form-layout { grid-template-columns: minmax(0, 1fr); }
  .p2-case-form .form-layout__aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; align-items: start; }
  .p2-case-form .form-layout__aside > :first-child { grid-row: span 2; }
}
@media (max-width: 640px) {
  .p2-case-form .form-layout__aside { grid-template-columns: minmax(0, 1fr); }
  .p2-case-form .form-layout__aside > :first-child { grid-row: auto; }
}


/* ---- css/pages/site-p2-player.css ---- */
/* p2: player dashboard, inactivity confirmation, access states, Discord link. Tokens only. */

/* ---- profile header --------------------------------------------------------------- */
.p2-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px 28px; align-items: center; }
.p2-profile__head { box-shadow: var(--inset), var(--shadow-3); }
.p2-profile__id { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.p2-profile__id .h1 { overflow-wrap: anywhere; }
.p2-profile__id .status { text-shadow: 2px 2px 0 #000; }
.p2-profile__meta { font-size: var(--fs-sm); color: var(--ink-2); text-shadow: 2px 2px 0 #000; }
.p2-profile__out { align-self: start; }
.p2-profile__out .btn { background: var(--well); }
@media (max-width: 720px) {
  .p2-profile { grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; }
  .p2-profile__head.avatar--xl { width: 88px; height: 88px; }
  .p2-profile__head.avatar--xl > svg { width: 64px; height: 64px; }
  .p2-profile__out { grid-column: 1 / -1; }
  .p2-profile__out .btn { width: 100%; }
}

/* ---- dashboard body ---------------------------------------------------------------- */
.p2-dash__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 1100px) { .p2-dash__grid { grid-template-columns: minmax(0, 1fr); } }
.p2-dash__pair { gap: 32px; }
.p2-dash__warn { color: var(--amber-text); }
.p2-dash .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.p2-dash__group { margin: 4px 0 8px; padding: 0; font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.p2-dash .plate__body > .fieldset--bare + .fieldset--bare { margin-top: var(--sp-5); }
.p2-dash .who .avatar .icon { width: 18px; height: 18px; color: var(--ink-strong); }

/* rows inside a plate: icon slot, text, status chip */
.p2-rows { padding: 0 22px; }
.p2-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.p2-row--compact { grid-template-columns: minmax(0, 1fr) auto; }
.p2-row__icon { color: var(--ink-2); }
.p2-row__main { min-width: 0; }
.p2-row__title { font-family: var(--font-pixel); font-size: 18px; line-height: 1.3; color: var(--ink-strong); overflow-wrap: anywhere; text-transform: none; }
.p2-row__title:first-letter { text-transform: uppercase; }
.p2-row__title a { display: inline-flex; align-items: center; min-height: var(--target); margin-block: -11px; }
.p2-row__meta { margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.p2-row__meta a { display: inline-flex; align-items: center; min-height: var(--target); min-width: var(--target); margin-block: -12px; }
.p2-row__text { margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-2); white-space: pre-wrap; }
.p2-row > .chip { margin-top: 2px; }
.plate--alert .p2-row { box-shadow: none; }
.plate--alert .p2-rows > li { border-top-color: var(--line); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--red-bg), var(--red-lo) 35%); }
.plate--alert .p2-rows > li:first-child { box-shadow: none; }
.plate--alert .slot { background: color-mix(in srgb, var(--red-bg), #000 45%); color: var(--red-text); }
@media (max-width: 640px) { .p2-rows { padding: 0 16px; } }

/* ---- single-card pages: confirm activity, access unavailable, Discord linked ------- */
.p2-card__facts { margin-top: var(--sp-5); }
.p2-card__form { margin-top: var(--sp-6); }
.p2-card__deadline { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--sp-4); font-family: var(--font-pixel); font-size: 18px; color: var(--amber-text); }
@media (max-width: 640px) {
  .p2-dash .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p2-dash .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .p2-dash .stat { padding: 14px 16px 16px; }
  .p2-row { grid-template-columns: auto minmax(0, 1fr); }
  .p2-row > .chip { grid-column: 2; justify-self: start; margin-top: -4px; }
  .p2-row--compact { grid-template-columns: minmax(0, 1fr); }
  .p2-row--compact > .chip { grid-column: 1; }
}

/* Rules acceptance on the dashboard (v10) */
.p2-rules__body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.p2-rules__body > div:first-child { flex: 1 1 360px; }
.p2-rules__h { margin: 0 0 6px; }


/* ---- css/pages/site-p2-poll.css ---- */
/* p2: community poll ballot, results and receipts. Tokens only.
   The ballot is an inventory: a dark well of slots, one per option. Each slot is a real
   radio/checkbox laid over the whole tile, so the tile is the 44px+ target and the browser
   keeps the native keyboard behaviour (arrow keys move between radios). */

.p2-ballot__set { min-width: 0; }
.p2-ballot__legend { margin: 0 0 6px; padding: 0; font-family: var(--font-pixel); font-size: 18px; font-weight: 500; color: var(--ink-strong); }
.p2-ballot__set > .field__help { margin-bottom: 12px; }
.p2-ballot__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 6px; margin: 10px 0 0; padding: 6px; list-style: none; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 #000, var(--shadow-2); }
.p2-ballot__grid--ranked { grid-template-columns: minmax(0, 1fr); }
.p2-ballot__grid > li { min-width: 0; }
.p2-ballot__set > .field__error { margin-top: 12px; }

.p2-option { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 28px; gap: 14px; align-items: center; min-height: 68px; height: 100%; padding: 10px 14px 10px 10px; background: var(--surface-3); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--strip-hi), inset -2px -2px 0 var(--surface-lo); color: var(--ink); cursor: pointer; }
.p2-option > input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.p2-option:hover { background: var(--surface-hover); }
.p2-option:hover .p2-option__label { color: var(--hover-ink); }
.p2-option:has(> input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; z-index: 1; }
.p2-option__slot { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--well); border: 2px solid #000; box-shadow: var(--inset); font-family: var(--font-pixel); font-size: 18px; line-height: 1; color: var(--ink-2); text-shadow: 2px 2px 0 #000; }
.p2-option__text { display: grid; gap: 6px; min-width: 0; }
.p2-option__label { font-family: var(--font-pixel); font-size: 18px; font-weight: 500; line-height: 1.25; color: var(--ink-strong); overflow-wrap: anywhere; }
.p2-option__tally { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.p2-option__mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--well); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--line); color: transparent; }
.p2-option__mark .icon { width: 16px; height: 16px; }
input[type='radio'] ~ .p2-option__mark { --notch: 4px; clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 calc(100% - var(--notch)), 0 var(--notch)); }

/* Selected: copper edge, the hotbar's white selection frame around the slot, a ticked mark. */
.p2-option:has(> input:checked), .p2-option.is-selected { background: var(--surface-hover); border-color: var(--accent); box-shadow: inset 2px 2px 0 var(--accent-lo), inset -2px -2px 0 var(--accent-lo); }
.p2-option:has(> input:checked) .p2-option__slot, .p2-option.is-selected .p2-option__slot { background: var(--btn-accent); color: var(--btn-accent-ink); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--ink-strong), 0 0 0 6px #000; }
.p2-option:has(> input:checked) .p2-option__mark, .p2-option.is-selected .p2-option__mark { background: var(--accent-plate); color: var(--accent-ink); box-shadow: inset 2px 2px 0 var(--accent-hi), inset -2px -2px 0 var(--accent-lo); }
.p2-option:has(> input:disabled) { cursor: not-allowed; opacity: .6; }

/* Ranked: a row per option with a rank picker on the right. */
.p2-option--ranked { grid-template-columns: 44px minmax(0, 1fr) 132px; cursor: default; }
.p2-option--ranked:hover { background: var(--surface-3); }
.p2-option--ranked:hover .p2-option__label { color: var(--ink-strong); }
.p2-option__rank { display: grid; gap: 4px; }
.p2-option__rank .field__label { font-size: 18px; color: var(--muted); }
.p2-option--ranked:has(option:checked:not([value='0'])) { border-color: var(--accent); }
.p2-option--ranked:has(option:checked:not([value='0'])) .p2-option__slot { background: var(--btn-accent); color: var(--btn-accent-ink); }
@media (max-width: 520px) {
  .p2-option--ranked { grid-template-columns: 44px minmax(0, 1fr); }
  .p2-option__rank { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
}

.p2-voter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; background: var(--surface-3); border: 2px solid var(--line); box-shadow: inset 2px 2px 0 var(--strip-hi); }
.p2-poll__had { display: flex; align-items: center; gap: 8px; color: var(--green-text); }
.p2-poll__feedback { font-weight: 600; }
.p2-key .field__label { display: inline-flex; align-items: center; gap: 8px; }
.p2-key input { font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.p2-key input::placeholder { text-transform: none; }
.p2-poll__dl > div { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; }
.p2-poll__dl > div:last-child { padding-bottom: 12px; }
/* core .dl resets its margin, which cancels the plate body's 16px rhythm */
.plate__body > * + .p2-poll__dl { margin-top: var(--sp-4); }
.p2-poll__dl .meter { display: block; width: 100%; margin-top: 8px; }

/* ---- results -------------------------------------------------------------------------- */
.p2-results__list { margin: 0; padding: 0; list-style: none; }
.p2-result { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 18px 24px; border-top: 2px solid var(--line); box-shadow: inset 0 2px 0 var(--surface-hover); }
.p2-result:first-child { border-top: 0; box-shadow: none; }
.p2-result .p2-option__slot { grid-row: span 2; }
.p2-result__label { font-family: var(--font-pixel); font-size: 18px; line-height: 1.25; color: var(--ink-strong); overflow-wrap: anywhere; }
.p2-result__label .chip { margin-left: 8px; vertical-align: 2px; }
.p2-result__pct { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-bright); font-variant-numeric: tabular-nums; text-align: right; }
.p2-result__bar { grid-column: 2 / -1; display: grid; gap: 6px; }
.p2-result__count { font-size: var(--fs-xs); color: var(--muted); }
.p2-result.is-leading .p2-option__slot { background: var(--btn-accent); color: var(--btn-accent-ink); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--ink-strong), 0 0 0 6px #000; }
@media (max-width: 640px) {
  .p2-result { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 16px; gap: 8px 12px; }
  .p2-result__bar { grid-column: 1 / -1; }
  .p2-result .p2-option__slot { grid-row: auto; }
  .p2-result__pct { font-size: 18px; }
}

/* receipt hash: long, so it wraps inside the well */
.p2-receipt-hash .secret__value { font-family: var(--font-mono); font-size: var(--fs-sm); word-break: break-all; }
.p2-poll .form-layout__aside .plate__body > .btn { margin-top: 20px; }
/* Core's disabled button ink is 3.8:1; the ballot's locked button keeps readable text. */
.p2-ballot .btn:disabled { color: var(--muted); }


/* ---- css/pages/site-p2-status.css ---- */
/* p2: private status page for applications and appeals (/status/:type/:token). Tokens only. */
.p2-status__who { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.p2-status__who .avatar { box-shadow: var(--inset), var(--shadow-2); }
.p2-status__kind { margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-2); text-shadow: 2px 2px 0 #000; }
.p2-status__kind strong { font-family: var(--font-pixel); font-size: 18px; font-weight: 500; color: var(--ink-strong); }
.p2-status__banner .page-banner__lead { max-width: 46em; }
.p2-status__updated { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-2); text-shadow: 2px 2px 0 #000; }
.p2-status__steps .steps__step.is-upcoming .steps__title { color: var(--muted); }
.p2-status__steps .steps__meta { font-family: var(--font-pixel); font-size: 18px; }
.p2-status__steps .steps__step.is-current .steps__meta { color: var(--amber-text); }
.p2-status__steps .steps__step.is-complete .steps__meta { color: var(--green-text); }
.p2-status__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.p2-status__dl > div { grid-template-columns: minmax(100px, 140px) minmax(0, 1fr); }
/* The plate head already draws a line above the list. */
.p2-status__dl > div:first-child { padding-top: 0; border-top: 0; box-shadow: none; }
@media (max-width: 1000px) { .p2-status__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .p2-status__who { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .p2-status__dl > div { grid-template-columns: 132px minmax(0, 1fr); gap: 4px 14px; }
}


/* ---- css/pages/site-p3-community.css ---- */
/* v10 community pages: guides (views/guides.ejs, guide.ejs), seasons and the hall of fame
   (seasons.ejs, season.ejs) and public player profiles (players.ejs, player-profile.ejs). */

/* ---- guides ---- */
.guide-group + .guide-group { margin-top: var(--sp-12); }
.guide-group__h { margin: 0 0 var(--sp-5); font-size: var(--fs-h2); }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px 22px 22px; text-decoration: none; color: var(--ink-2); }
.guide-card:hover { border-color: var(--hover-line, var(--line)); }
.guide-card:hover .guide-card__title { color: var(--hover-ink); text-decoration: underline; }
.guide-card__title { font-family: var(--font-body); font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--ink-strong); }
.guide-card__text { font-size: var(--fs-sm); line-height: 1.5; }
.guide-card__meta { margin-top: auto; padding-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-12); align-items: start; }
.guide-body { max-width: 44em; font-size: 17px; line-height: 1.7; }
.guide-body h2, .guide-body h3, .guide-body h4 { scroll-margin-top: 90px; color: var(--ink-strong); }
.guide-body h2 { font-size: var(--fs-h2); }
.guide-body h3 { font-size: var(--fs-h3); }
.guide-body code { padding: 1px 6px; background: var(--well); border: 1px solid var(--line); font-size: .92em; }
.guide-body pre { overflow-x: auto; padding: 14px 16px; background: var(--well); border: 2px solid #000; box-shadow: var(--inset); }
.guide-body pre code { padding: 0; border: 0; background: none; }
.guide-body figure { margin: 1.4em 0; }
.guide-body img { display: block; max-width: 100%; height: auto; border: 2px solid #000; }
.guide-body figcaption { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.guide-body hr { border: 0; border-top: 2px solid var(--line); margin: 2em 0; }
.guide-aside { position: sticky; top: 90px; display: grid; gap: 16px; justify-items: start; }
.guide-aside > .plate { width: 100%; }
.guide-toc .plate__body { padding: 16px 18px 18px; }
.guide-toc__h { margin: 0 0 10px; font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.guide-toc li + li { margin-top: 8px; }
.guide-toc a { font-size: var(--fs-sm); }

/* ---- seasons ---- */
.season-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.season-card { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink-2); }
.season-card:hover .season-card__title { color: var(--hover-ink); text-decoration: underline; }
.season-card__art { display: block; aspect-ratio: 16 / 7; border-bottom: 2px solid #000; background-color: var(--well); }
.season-card__art--empty { display: flex; align-items: center; justify-content: center; }
.season-card__n { font-family: var(--font-pixel); font-size: 54px; line-height: 1; color: var(--ink-bright); text-shadow: 4px 4px 0 #000; }
.season-card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 22px; }
.season-card__kicker { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.season-card__now { color: var(--link); }
.season-card__title { font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--ink-strong); }
.season-card__meta { font-size: var(--fs-sm); color: var(--muted); }
.season-card__text { font-size: var(--fs-sm); line-height: 1.5; }
.season-banner--art.has-bg-image { background-image: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .8)), var(--bg-image); }
.season-banner--art .page-banner__in { padding-block: 72px 52px; }
.season-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-12); align-items: start; }
.season-h { margin-top: var(--sp-12); }
.season-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; margin-top: var(--sp-5); }
.season-shot { margin: 0; }
.season-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 2px solid #000; }
.season-shot figcaption { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); }
.season-aside { display: grid; gap: 20px; justify-items: start; }
.season-aside > .plate { width: 100%; }
.season-top__row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 20px; border-top: 2px solid var(--line); }
.season-top__row:first-child { border-top: 0; }
.season-top__rank, .season-top__value { font-family: var(--font-pixel); font-size: 18px; color: var(--muted); }
.season-top__row:first-child .season-top__rank { color: var(--link); }
.season-top__name { overflow-wrap: anywhere; color: var(--ink-strong); }

/* hall of fame rows (seasons index, a season, a player profile) */
.hof { display: grid; gap: 2px; margin-top: var(--sp-5); background: var(--line); border: 2px solid var(--line); }
.hof--plate { margin: 0; border: 0; }
.hof__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; background: var(--surface); }
.hof__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--well); border: 2px solid #000; color: var(--link); }
.hof__title { margin: 0; font-family: var(--font-pixel); font-size: 18px; color: var(--ink-strong); }
.hof__who { margin: 2px 0 0; color: var(--ink-2); }
.hof__note { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.hof__season { font-size: var(--fs-sm); white-space: nowrap; }

/* ---- player profiles ---- */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.player-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px 18px; text-align: center; text-decoration: none; }
.player-tile:hover .player-tile__name { color: var(--hover-ink); text-decoration: underline; }
.player-tile__name { font-family: var(--font-pixel); font-size: 18px; color: var(--ink-strong); overflow-wrap: anywhere; }
.player-tile__meta { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 28px; }
.profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profile-stats__text { font-size: 18px; }

@media (max-width: 1000px) {
  .guide-layout, .season-layout { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
  .guide-aside { position: static; }
}
@media (max-width: 720px) {
  .profile-head { gap: 16px; }
  .profile-head .avatar--xl { width: 76px; height: 76px; }
  .profile-head .avatar--xl > svg { width: 48px; height: 48px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hof__row { grid-template-columns: 40px minmax(0, 1fr); }
  .hof__season { grid-column: 2; }
  .season-banner--art .page-banner__in { padding-block: 48px 36px; }
}


/* ---- css/utilities.css ---- */
/* Crankweb utilities: appended last to both bundles (after page CSS) so they win over
   component margins. Keep this file small: spacing and alignment only. */
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-0 { margin-bottom: 0 !important; } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.text-right { text-align: right; } .text-center { text-align: center; }


