/* Fish & Sell — Statistiques. Thème sombre, aucune ressource externe. */

:root {
  color-scheme: dark;
  --topbar-h: 56px;
  --sim-h: 0px;
  --bg: #0d0f13;
  --surface: #16181d;
  --surface-2: #1d2027;
  --surface-3: #272b34;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.17);
  --text: #eceef2;
  --text-2: #a7acb8;
  --text-3: #8a909c;
  --grid: #2a2d35;
  --axis: #4a4e59;
  --accent: #338ced;
  --accent-2: #6aabf1;
  /* Catégories (ordre fixe, validé sur la surface sombre) */
  --c1: #338ced;
  --c2: #e76624;
  --c3: #00a888;
  --c4: #d28e05;
  --c5: #e24d8b;
  --c6: #0aac23;
  --c7: #9887ef;
  --c8: #eb6263;
  --mute: #6f7582;
  /* Rangs ordonnés (raretés) : une seule teinte, du foncé au clair */
  --o1: #1757ac;
  --o2: #2370cd;
  --o3: #338ced;
  --o4: #6aabf1;
  --o5: #9dc8f7;
  --o6: #cce3fd;
  --o7: #f2f8ff;
  /* Sens */
  --pos: #338ced;
  --neg: #eb6263;
  /* États (toujours avec une icône et un mot) */
  --good: #0aac23;
  --warn: #fbb315;
  --serious: #f18a59;
  --bad: #dc3c3d;
  --good-t: #53c556;
  --warn-t: #fbb315;
  --serious-t: #f6a47c;
  --bad-t: #ff8a8b;
  --radius: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + var(--sim-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  padding-top: var(--sim-h);
}
body.has-sim { --sim-h: 38px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-2); }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
.noscript { padding: 24px; }

/* ───── Bandeau de simulation ───── */
.simbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--sim-h); z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #fbb315 0 16px, #e9a40c 16px 32px);
  color: #111; font-weight: 800; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 0 12px;
  border-bottom: 2px solid #111;
}

/* ───── Structure ───── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: var(--sim-h); bottom: 0; left: 0; width: 240px; z-index: 70;
  display: flex; flex-direction: column; gap: 8px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.maincol { margin-left: 240px; flex: 1; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--text-3); font-size: 12px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.brand.big .logo { width: 44px; height: 44px; }
.navlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.navlist a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.navlist a:hover { background: var(--surface-2); color: var(--text); }
.navlist a[aria-current='page'] { background: rgba(51, 140, 237, 0.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.navlist .badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; min-width: 20px; text-align: center; border-radius: 999px; padding: 1px 6px; }
.navfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.backdrop { display: none; }

.topbar {
  position: sticky; top: var(--sim-h); z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: rgba(13, 15, 19, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.btn.menubtn { display: none; }
.livebar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; min-width: 0; }
.livebar .lb { color: var(--text-2); white-space: nowrap; }
.livebar .lb b { color: var(--text); font-size: 15px; font-weight: 700; }
.livebar .mute { color: var(--text-3); }
.livebar .pill { white-space: normal; max-width: 100%; border-radius: 12px; }
.alertlink { text-decoration: none; }

.filterbar { padding: 14px 24px 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.field > span:first-child { font-weight: 600; letter-spacing: 0.02em; }
.field.block { margin: 14px 0; font-size: 13px; }
.field small { color: var(--text-3); font-size: 12px; }
select, input[type='text'], input[type='password'], input[type='number'], input[type='search'], textarea {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 14px; min-height: 38px;
}
select { padding-right: 28px; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
input:disabled, select:disabled { opacity: 0.5; }
.inwrap input { width: 110px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 6px; cursor: pointer; min-height: 32px; }
.seg button:hover { color: var(--text); background: var(--surface-3); }
.seg button[aria-pressed='true'] { background: var(--accent); color: #fff; font-weight: 600; }
.fnote { flex-basis: 100%; display: flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 12.5px; }

main { padding: 0 24px 56px; outline: none; }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 22px 0 6px; }
.pagehead h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; outline: none; }
.pagehead p { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.headtools { display: flex; align-items: center; gap: 12px; }
.updated { color: var(--text-3); font-size: 12.5px; }
.updated.bad { color: var(--bad-t); }
.content { transition: opacity 0.15s; }
.content.loading { opacity: 0.55; }
.page { display: flex; flex-direction: column; gap: 16px; }
.sect { margin-top: 10px; }
.sect h2 { font-size: 17px; }
.sect p { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ───── Boutons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 38px;
}
.btn:hover { background: #313641; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #4a9bf0; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn.icon { padding: 8px; }

/* ───── Icônes ───── */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 13px; height: 13px; stroke-width: 2.2; }
.ico.lg { width: 24px; height: 24px; }

/* ───── Grille et cartes ───── */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.chead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.chead h3 { font-size: 15px; font-weight: 650; line-height: 1.35; }
.ctools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.help { color: var(--text-2); font-size: 13px; margin: 4px 0 12px; max-width: 80ch; }
.note { display: flex; gap: 6px; align-items: flex-start; color: var(--text-3); font-size: 12.5px; margin-top: 12px; }
.note .ico { margin-top: 2px; width: 14px; height: 14px; }
.cbody { min-width: 0; }
.src { font-size: 11.5px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.src-roblox { color: #8bbcf5; border-color: rgba(106, 171, 241, 0.5); }
.src-est { color: #f3c768; border-color: rgba(243, 199, 104, 0.5); }
.src-device { color: #b5a9f5; border-color: rgba(152, 135, 239, 0.5); }
.src-calc { color: #7fd3c2; border-color: rgba(0, 168, 136, 0.5); }

/* ───── Tuiles de chiffres ───── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile.hero { grid-column: span 2; background: linear-gradient(160deg, #1b2330, var(--surface) 70%); border-color: rgba(51, 140, 237, 0.35); }
.tlabel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.tvalue { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tvalue small { font-size: 15px; color: var(--text-2); font-weight: 600; margin-left: 4px; }
.tvalue.na { color: var(--text-3); }
.tile.hero .tvalue { font-size: 56px; }
.tsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--text-2); }
.tsub .vs { color: var(--text-3); }
.spark { display: block; margin-top: 4px; }
.spark .ln { stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 13px; }
.delta.good { color: var(--good-t); }
.delta.bad { color: var(--bad-t); }
.delta.neutral, .delta.none { color: var(--text-2); }

/* ───── États, pastilles, avis ───── */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill.good { color: var(--good-t); border-color: rgba(83, 197, 86, 0.45); background: rgba(10, 172, 35, 0.1); }
.pill.warn { color: var(--warn-t); border-color: rgba(251, 179, 21, 0.5); background: rgba(251, 179, 21, 0.1); }
.pill.serious { color: var(--serious-t); border-color: rgba(241, 138, 89, 0.5); background: rgba(241, 138, 89, 0.1); }
.pill.bad { color: var(--bad-t); border-color: rgba(255, 138, 139, 0.5); background: rgba(220, 60, 61, 0.14); }
.pill.info { color: #8bbcf5; border-color: rgba(106, 171, 241, 0.45); background: rgba(51, 140, 237, 0.1); }
.pill.mute { color: var(--text-2); border-color: var(--line-2); background: transparent; }
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line-2); background: var(--surface); }
.notice p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.notice strong { font-size: 15px; }
.notice.info { border-color: rgba(106, 171, 241, 0.5); background: rgba(51, 140, 237, 0.09); }
.notice.info .ico { color: #8bbcf5; }
.notice.warn { border-color: rgba(251, 179, 21, 0.5); background: rgba(251, 179, 21, 0.08); }
.notice.warn .ico { color: var(--warn-t); }
.notice.bad { border-color: rgba(255, 138, 139, 0.55); background: rgba(220, 60, 61, 0.1); }
.notice.bad .ico { color: var(--bad-t); }
.notice.good { border-color: rgba(83, 197, 86, 0.45); background: rgba(10, 172, 35, 0.08); }
.notice.good .ico { color: var(--good-t); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text-2); padding: 28px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty .ico { color: var(--text-3); }
.empty strong { color: var(--text); }
.empty p { font-size: 13px; max-width: 52ch; }
.empty.small { padding: 22px 12px; font-size: 13.5px; }
.na { color: var(--text-3); }

/* ───── Tableaux ───── */
.tscroll { position: relative; overflow: auto; max-height: 560px; border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { position: sticky; top: 0; background: var(--surface); color: var(--text-2); font-weight: 650; font-size: 12.5px; border-bottom: 1px solid var(--line-2); white-space: nowrap; z-index: 1; }
.tbl tbody tr:hover td, .tbl tbody tr:hover th { background: rgba(255, 255, 255, 0.025); }
.tbl tbody th { font-weight: 600; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-3); }
.tbl .wrap { white-space: normal; min-width: 220px; }
.tbl.cohort td.num { min-width: 64px; text-align: center; border-bottom: 2px solid var(--surface); border-right: 2px solid var(--surface); }
.tbl.cohort td.hmna { color: var(--text-3); }
.zbad { color: var(--bad-t); font-weight: 700; }

/* ───── Graphiques ───── */
.chart { min-width: 0; }
.plot { display: block; width: 100%; overflow: visible; }
svg text { font-family: inherit; }
.tick { fill: var(--text-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rlabel { fill: var(--text); font-size: 13px; }
.vlabel { fill: var(--text); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.gl { stroke: var(--grid); stroke-width: 1; }
.axisline { stroke: var(--axis); stroke-width: 1; }
.hit, .rowhit { fill: transparent; }
.hrow:hover .rowhit, .col:hover .rowhit { fill: rgba(255, 255, 255, 0.045); }
.hrow:hover .bar, .col:hover .bar, .segpart:hover rect { filter: brightness(1.22); }
.hrow, .col, .segpart { cursor: default; }
.c1, .k-c1 { --c: var(--c1); } .c2, .k-c2 { --c: var(--c2); } .c3, .k-c3 { --c: var(--c3); } .c4, .k-c4 { --c: var(--c4); }
.c5, .k-c5 { --c: var(--c5); } .c6, .k-c6 { --c: var(--c6); } .c7, .k-c7 { --c: var(--c7); } .c8, .k-c8 { --c: var(--c8); }
.mute, .k-mute { --c: var(--mute); }
.o1, .k-o1 { --c: var(--o1); } .o2, .k-o2 { --c: var(--o2); } .o3, .k-o3 { --c: var(--o3); } .o4, .k-o4 { --c: var(--o4); }
.o5, .k-o5 { --c: var(--o5); } .o6, .k-o6 { --c: var(--o6); } .o7, .k-o7 { --c: var(--o7); }
.pos, .k-pos { --c: var(--pos); } .neg, .k-neg { --c: var(--neg); }
.fl { fill: var(--c); }
.ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln.dash { stroke-dasharray: 0.1 6; stroke-width: 2.6; }
.ar { fill: var(--c); fill-opacity: 0.1; stroke: none; }
.dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.dot.off, .cursor.off { display: none; }
.xh { stroke: var(--text-3); stroke-width: 1; }
.seglabel { fill: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.seglabel.dk { fill: #0b0b0b; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.sw.line { width: 18px; height: 3px; border-radius: 2px; }
.sw.line.dash { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 7px); }
.seg .legend { margin-top: 12px; }

/* Carte de chaleur : 9 niveaux d'une seule teinte, du fond vers le clair */
.hm0 { --hm: #17263c; } .hm1 { --hm: #0e3d7e; } .hm2 { --hm: #0f4a96; } .hm3 { --hm: #1757ac; } .hm4 { --hm: #1b64be; }
.hm5 { --hm: #2370cd; } .hm6 { --hm: #338ced; } .hm7 { --hm: #6aabf1; } .hm8 { --hm: #9dc8f7; }
.hm0, .hm1, .hm2, .hm3, .hm4, .hm5, .hm6, .hm7, .hm8 { background: var(--hm); fill: var(--hm); color: #fff; }
.hm6, .hm7, .hm8 { color: #0b0b0b; }
rect.hmna { fill: var(--surface-2); }
td.hmna { background: transparent; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.scalebar { display: inline-flex; border-radius: 4px; overflow: hidden; }
.scalebar i { display: block; width: 18px; height: 10px; background: var(--hm); }

/* Infobulle dessinée en SVG */
.tiplayer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }
.tip { opacity: 0; visibility: hidden; }
.tip.measure { visibility: hidden; }
.tip.on { opacity: 1; visibility: visible; transition: opacity 0.08s; }
.tip-bg { fill: #0a0b0e; stroke: var(--line-2); stroke-width: 1; }
.tip-t { fill: var(--text-2); font-size: 12px; }
.tip-v { fill: var(--text); font-size: 13.5px; font-weight: 700; }
.tip-l { fill: var(--text-2); font-size: 12px; }
.tip-k { stroke: var(--c); stroke-width: 3; stroke-linecap: round; }
.tip-k.dash { stroke-dasharray: 0.1 5; stroke-width: 3.4; }

/* ───── Listes ───── */
.feed { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 70px 64px 120px 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed code { color: var(--text-2); }
.fkind { color: var(--text-3); font-size: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ───── Alertes ───── */
.alert { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line-2); border-left-width: 4px; border-radius: 10px; background: var(--surface-2); }
.alert.critical { border-left-color: var(--bad); }
.alert.warning { border-left-color: var(--warn); }
.alert.info { border-left-color: var(--accent); }
.alert h4 { margin: 0; font-size: 15px; }
.alert .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 13px; align-items: center; }
.alert .nums { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; }
.alert .nums b { font-variant-numeric: tabular-nums; }
.alert .why { font-size: 13.5px; color: var(--text); }
.alert .hintline { font-size: 13.5px; color: var(--text-2); }
.alert.done { opacity: 0.72; }

/* ───── Fenêtre de dialogue ───── */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; padding: 20px; width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog h3 { font-size: 17px; margin-bottom: 12px; }
dialog .field { margin-bottom: 12px; font-size: 13px; }
dialog input[type='text'] { width: 100%; }
dialog .row { justify-content: flex-end; margin-top: 8px; }
.formerror { color: var(--bad-t); font-size: 13.5px; margin: 8px 0; }

/* ───── Connexion ───── */
.loginpage { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.loginwrap { width: min(420px, 100%); }
.logincard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; }
.logincard h1 { font-size: 22px; margin-top: 6px; }
.logincard .help { margin: 4px 0 6px; }
.logincard input { width: 100%; }
.logincard .brand { padding-left: 0; }

/* ───── Écrans étroits ───── */
@media (max-width: 1180px) {
  .span-4, .span-3 { grid-column: span 6; }
  .span-8 { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; width: min(280px, 86vw); box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  body.nav-open .sidebar { transform: none; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 60; }
  body.nav-open .backdrop { display: block; }
  .maincol { margin-left: 0; }
  .btn.menubtn { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .filterbar { padding: 12px 12px 0; }
  main { padding: 0 12px 48px; }
  .pagehead h1 { font-size: 22px; }
}
@media (max-width: 760px) {
  .span-3, .span-4, .span-6, .span-8 { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile.hero { grid-column: 1 / -1; }
  .tile.hero .tvalue { font-size: 48px; }
  .tvalue { font-size: 26px; }
  .card { padding: 14px 14px 16px; }
  .feed li { grid-template-columns: 60px 56px 1fr; }
  .feed li .ftext { grid-column: 1 / -1; }
  .feed li .fkind { display: none; }
  .livebar { font-size: 12.5px; gap: 2px 12px; }
  .livebar .lb b { font-size: 14px; }
  .topbar { min-height: var(--topbar-h); height: auto; padding-top: 6px; padding-bottom: 6px; }
  .seg { width: 100%; }
  .field.wide { flex-basis: 100%; }
  .simbar { font-size: 12px; letter-spacing: 0.02em; }
  .seg button { flex: 1 1 auto; padding: 6px 6px; }
  .filters { gap: 10px; }
  .field { flex: 1 1 140px; }
  .field select, .field input { width: 100%; }
  .inwrap input { width: 100%; }
  .headtools { width: 100%; justify-content: space-between; }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .bar, .fl { stroke: CanvasText; stroke-width: 1px; }
  .ln { stroke: CanvasText; }
}
