/* Sonic Carrom admin — "luxe carrom board": ink navy → walnut room light, brass used sparingly
   (primary action, focus ring, small marks), Queen red for danger, felt teal second voice. */
:root {
  --bg: #0A141D;
  --bg-warm: #1C140E;
  --panel: #0F1B25;
  --surface: #15222D;
  --surface-2: #1C2C39;
  --raised: #263A4A;
  --border: #34434F;
  --brass: #D9A84E;
  --brass-light: #F0CC85;
  --brass-deep: #B07E2C;
  --queen: #D2464F;
  --queen-text: #F08A90;
  --felt: #7FC3B4;
  --good: #7CC79A;
  --warn: #E6B35A;
  --text: #F4EDE1;
  --muted: #B9B2A6;
  --faint: rgba(244, 237, 225, 0.55);
  --on-brass: #22170B;
  --radius: 10px;
  --radius-sm: 6px;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --nav-w: 232px;
  --top-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.5 var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(120% 80% at 50% -10%, #12212E 0%, var(--bg) 55%, var(--bg-warm) 130%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: 0.01em; margin: 0; color: var(--text); }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 8px; }
a { color: var(--felt); }
a:hover { color: var(--brass-light); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.bad { color: var(--queen-text); }
.ok { color: var(--good); }
.fp-status { margin: 0 0 8px; font-size: 16px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; font-weight: 700; color: var(--faint); margin: 0 0 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* focus: brass ring everywhere, never removed */
:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 2px; border-radius: 4px; }
#main:focus, #main:focus-visible { outline: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brass); color: var(--on-brass); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------------- buttons & inputs ---------------- */
.btn {
  font: 600 14px/1 var(--sans); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--raised); border-color: #4A5966; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: progress; }
.btn-primary { background: linear-gradient(180deg, var(--brass-light), var(--brass) 45%, var(--brass-deep)); color: var(--on-brass); border-color: var(--brass-deep); }
.btn-primary:hover { background: linear-gradient(180deg, #F6DA9F, var(--brass-light) 40%, var(--brass)); border-color: var(--brass); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(210, 70, 79, .16); border-color: var(--queen); color: #FFD9DB; }
.btn-danger:hover { background: rgba(210, 70, 79, .3); border-color: #E05A63; }
.btn-sm { padding: 6px 10px; min-height: 30px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; min-height: 48px; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text); font-size: 20px; line-height: 1; width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
input, select, textarea {
  font: 14px/1.4 var(--sans); color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 36px; max-width: 100%;
}
textarea { width: 100%; resize: vertical; }
textarea.code-input { font-family: var(--mono); font-size: 13px; line-height: 1.5; min-height: 140px; tab-size: 2; }
input:hover, select:hover, textarea:hover { border-color: #4A5966; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--queen); box-shadow: 0 0 0 1px var(--queen); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--brass); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85) sepia(.3); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.field .hint { color: var(--faint); font-size: 12px; }
.field .err { color: var(--queen-text); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > .field { flex: 1 1 160px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { flex: 0 1 170px; }
.filters .field.grow { flex: 1 1 240px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 4px; }

/* ---------------- gate ---------------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: min(440px, 100%); text-align: center; padding: 40px 32px 28px;
  background: linear-gradient(180deg, var(--surface), var(--panel)); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(240, 204, 133, .08);
}
.gate-card h1 { font-size: 34px; margin-bottom: 10px; }
.gate-actions { margin: 22px 0 18px; }
.gate-bad { color: var(--queen-text); font-weight: 600; }
.brand-mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; border: 2px solid var(--brass); display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(217, 168, 78, .12); }
.brand-mark span { width: 40%; height: 40%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #E86A72, var(--queen) 60%, #8C2A31); }
.brand-mark.sm { width: 28px; height: 28px; margin: 0; border-width: 1.5px; box-shadow: none; }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; grid-template-rows: var(--top-h) 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: rgba(10, 20, 29, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-name { font-family: var(--serif); font-size: 20px; }
.brand-tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); border: 1px solid rgba(217, 168, 78, .4); border-radius: 4px; padding: 2px 6px; }
.topbar-spacer { flex: 1; }
.nav-toggle { display: none; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.range-icon { color: var(--brass); }
.range-custom { display: flex; align-items: center; gap: 6px; }
.range-host.dim { opacity: .5; }
.sidenav { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 16px 10px; border-right: 1px solid var(--border); background: rgba(15, 27, 37, .7); }
.sidenav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-left: 3px solid transparent; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); border-left-color: var(--brass); }
.nav-glyph { width: 18px; text-align: center; color: var(--faint); }
.nav-link[aria-current="page"] .nav-glyph { color: var(--brass); }
.nav-scrim { display: none; }
.main { padding: 24px 28px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--brass); }
.page-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page { display: grid; gap: 18px; }

/* ---------------- cards / tiles / grids ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 18px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card.inset { background: var(--surface-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-height: 96px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tile-brass::before { background: var(--brass); }
.tile-bad::before { background: var(--queen); }
.tile-good::before { background: var(--felt); }
.tile-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.tile-value { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums lining-nums; }
.tile-sub { font-size: 12px; color: var(--faint); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.trend-up { color: var(--good); } .trend-down { color: var(--queen-text); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------------- chips / banners / toasts ---------------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.chip-good { color: var(--good); border-color: rgba(124, 199, 154, .45); background: rgba(124, 199, 154, .1); }
.chip-bad { color: var(--queen-text); border-color: rgba(210, 70, 79, .55); background: rgba(210, 70, 79, .12); }
.chip-warn { color: var(--warn); border-color: rgba(230, 179, 90, .45); background: rgba(230, 179, 90, .1); }
.chip-muted { color: var(--muted); border-color: var(--border); background: transparent; }
.chip-felt { color: var(--felt); border-color: rgba(127, 195, 180, .45); background: rgba(127, 195, 180, .1); }
.chip-brass { color: var(--brass-light); border-color: rgba(217, 168, 78, .5); background: rgba(217, 168, 78, .1); }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; }
.banner-error { border-color: var(--queen); background: rgba(210, 70, 79, .1); }
.banner-warn { border-color: rgba(230, 179, 90, .6); background: rgba(230, 179, 90, .08); }
.banner-glyph { font-weight: 800; color: var(--queen-text); }
.banner-text { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--felt); border-radius: var(--radius-sm); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); animation: rise .18s ease-out; }
.toast-ok { border-left-color: var(--good); } .toast-error { border-left-color: var(--queen); } .toast-warn { border-left-color: var(--warn); }
.toast-glyph { font-weight: 800; }
.toast-msg { flex: 1; overflow-wrap: anywhere; font-size: 14px; }
.toast .icon-btn { width: 24px; height: 24px; font-size: 16px; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

/* ---------------- states ---------------- */
.skel, .skel-line { background: linear-gradient(90deg, var(--surface-2) 0%, var(--raised) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; }
.skel-rows { display: grid; gap: 10px; padding: 6px 0; }
.skel-line { height: 14px; }
.skel-line.big { height: 28px; margin-top: 10px; }
.skel-chart { height: 200px; }
.w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; } .w90 { width: 90%; }
.tile.skel { background: var(--surface); animation: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty.small { padding: 18px 8px; }
.empty-mark { font-size: 28px; color: var(--border); }
.noscript { padding: 20px; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid rgba(52, 67, 79, .6); vertical-align: top; }
table.data thead th { position: sticky; top: 0; background: var(--panel); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em; white-space: nowrap; }
table.data tbody th { font-weight: 600; }
table.data tbody tr:hover { background: rgba(38, 58, 74, .45); }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .num { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:focus-visible { outline: 2px solid var(--brass-light); outline-offset: -2px; }
table.data.compact th, table.data.compact td { padding: 5px 10px; font-size: 13px; }
.sort-btn { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sort-btn:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 2px; }
.sort-glyph { color: var(--faint); font-size: 11px; }
th[aria-sort="ascending"] .sort-glyph::after { content: "↑"; } th[aria-sort="descending"] .sort-glyph::after { content: "↓"; }
th[aria-sort="ascending"] .sort-glyph, th[aria-sort="descending"] .sort-glyph { font-size: 0; }
th[aria-sort="ascending"] .sort-glyph::after, th[aria-sort="descending"] .sort-glyph::after { font-size: 11px; color: var(--brass); }
.cell-main { display: block; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.trunc { display: inline-block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pager { display: flex; justify-content: center; margin-top: 10px; }
.ret-na { color: var(--faint); }
table.retention td.ret { font-weight: 700; }

/* ---------------- charts ---------------- */
.chart { margin: 0; }
.chart-stage { position: relative; }
.chart-svg { width: 100%; height: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .gridline { stroke: rgba(52, 67, 79, .55); stroke-width: 1; }
.chart .baseline { stroke: #4A5966; stroke-width: 1; }
.chart .axis, .donut .axis { fill: var(--faint); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart rect[tabindex]:focus { outline: none; }
.chart rect[tabindex]:focus-visible { stroke: var(--brass-light); stroke-width: 2; }
.chart-tip { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; background: #0B161F; border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); white-space: nowrap; }
.tip-title { color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.tip-row { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend-col { flex-direction: column; gap: 6px; }
.legend-col li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; color: var(--text); }
.chart-table { margin-top: 8px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--felt); width: max-content; }
.chart-table .table-wrap { margin-top: 8px; max-height: 260px; overflow: auto; }
.donut { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 0; }
.donut .legend-col { flex: 1; min-width: 160px; }
.donut-total { fill: var(--text); font: 24px var(--serif); }
.spark { vertical-align: middle; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.hbar-label > span:first-child { overflow-wrap: anywhere; }
.hbar-track { height: 8px; background: var(--panel); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.funnel-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 14px; flex-wrap: wrap; }
.funnel-step { display: inline-flex; gap: 10px; align-items: center; }
.funnel-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--brass); color: var(--brass-light); font: 12px var(--serif); }
.funnel-drop { margin-top: 3px; }

/* ---------------- drawer / dialog / tabs ---------------- */
.drawer-root { position: fixed; inset: 0; z-index: 60; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(4, 8, 12, .6); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .5; } }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { overflow-wrap: anywhere; }
.drawer-body { padding: 16px 20px 40px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(4, 8, 12, .7); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.dialog-wide { width: min(720px, 100%); }
.dialog-title { margin-bottom: 12px; }
.dialog-body { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tab { font: 600 14px var(--sans); color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brass); }
.tab-panel { padding-top: 14px; display: grid; gap: 14px; }
.tab-panel:focus-visible { outline-offset: 4px; }
pre.code { margin: 0; padding: 12px; background: #08111A; border: 1px solid var(--border); border-radius: var(--radius-sm); font: 12.5px/1.55 var(--mono); color: #D8D2C6; overflow: auto; max-height: 420px; white-space: pre; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-left: 1px solid var(--border); }
.timeline li { padding: 4px 0 6px 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.timeline li.last::before { background: var(--queen); }
.timeline .t { color: var(--faint); font-family: var(--mono); font-size: 12px; margin-right: 8px; }

/* notifications preview */
.phone { width: 300px; max-width: 100%; border: 1px solid var(--border); border-radius: 22px; padding: 14px; background: linear-gradient(180deg, #101C26, #0B1219); }
.notif { background: rgba(244, 237, 225, .08); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; }
.notif .brand-mark { width: 28px; height: 28px; margin: 0; grid-row: span 2; border-width: 1.5px; box-shadow: none; }
.notif-title { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.notif-body { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; grid-column: 2; }
.notif-app { font-size: 11px; color: var(--faint); }
.inbox-card { border: 1px solid var(--border); border-left: 3px solid var(--brass); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; }
.counter { font-size: 12px; color: var(--faint); text-align: right; }
.counter.over { color: var(--queen-text); }

/* config */
.cfg-key { display: grid; gap: 10px; }
.cfg-meta { font-size: 12px; color: var(--faint); }
.json-status { font-size: 12px; }
.json-status.ok { color: var(--good); } .json-status.bad { color: var(--queen-text); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; }
  .sidenav { position: fixed; z-index: 40; top: var(--top-h); left: 0; bottom: 0; width: 260px; height: auto; transform: translateX(-100%); transition: transform .2s ease; background: var(--panel); }
  .sidenav.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .nav-scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 30; background: rgba(4, 8, 12, .55); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .main { padding: 18px 14px 56px; }
  .user-email, .brand-tag { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 10px; }
  .shell { grid-template-rows: auto 1fr; }
  .range-host { order: 10; width: 100%; }
  .brand-name { font-size: 17px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-value { font-size: 26px; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 8px; }
  .filters .field { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .chip, .btn, .tile, .card { border: 1px solid CanvasText; }
  .nav-link[aria-current="page"] { outline: 2px solid Highlight; }
}
.drawer-body > *, .tabset, .tab-panel > *, .page > *, .card > * { min-width: 0; }
.cell-sub.trunc { display: block; max-width: 340px; }
@media (max-width: 560px) {
  .brand-name { display: none; }
  .sidenav { top: 0; z-index: 50; padding-top: 20px; }
  .nav-scrim { inset: 0; z-index: 45; }
}

/* testers: progress toward the Play closed-testing target (decorative; the tile text carries the numbers) */
.meter { height: 6px; margin-top: 8px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-deep), var(--brass-light)); border-radius: 3px; }
.tile-good .meter > span { background: var(--felt); }
@media (forced-colors: active) { .meter { border: 1px solid CanvasText; } .meter > span { background: Highlight; } }

.mock-banner{position:sticky;top:0;z-index:50;background:#7a1d24;color:#fff;padding:10px 16px;text-align:center;font-size:15px}
.mock-banner a{color:#ffd98a;font-weight:700}
.mock-banner[hidden]{display:none}
.mono-area { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.bot-page { display: flex !important; flex-direction: column; gap: 20px; }
.bot-page > * { width: 100%; }
