/* Range organiser dashboard (docs/plans/v5-org-ux.md 3.1). Light page, ink text; the event colour
   only decorates (3.2): --accent, --accent-ink and --accent-strong are set by js/brand.js. */
@font-face { font-family: "Gambarino"; src: url("/fonts/Gambarino-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/InterTight.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FBF9F4; --bg-2: #F3EFE6; --surface: #FFFFFF; --line: #E7E2D8; --line-2: #D6CFC2;
  --ink: #16130F; --ink-2: #5C5650; --ink-3: #6E675F;
  --accent: #EF8F84; --accent-ink: #16130F; --accent-strong: #A8483D; --accent-tint: rgba(239, 143, 132, .14); --accent-ui: #A8483D;
  --ok: #1D6E46; --ok-fill: #DDF1E5; --ok-flash: #2FA36B;
  --warn: #7A4E00; --warn-fill: #FBEBC4; --warn-line: #E0B54A;
  --danger: #B42318; --danger-fill: #FDE4E1; --danger-line: #E7837A;
  --butter: #F6D96A; --sky: #A9CFE7;
  --radius: 10px; --radius-s: 6px;
  --body: 15px; --target: 36px;
  --side: 248px;
  font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
:where(svg) { width: 18px; height: 18px; flex: none; vertical-align: middle; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: var(--body); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.live { --body: 17px; --target: 48px; }
@media (max-width: 899px) { :root { --body: 16px; --target: 44px; } body.live { --body: 17px; --target: 48px; } }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.title { font-family: "Gambarino", Georgia, serif; font-size: 34px; line-height: 1.1; letter-spacing: -.005em; }
.h2 { font-family: "Gambarino", Georgia, serif; font-size: 22px; line-height: 1.2; }
.h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-strong); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Focus: a 2 px --accent-strong ring with a 2 px offset everywhere, never removed (3.6). */
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
.door :focus-visible, .wallp :focus-visible { outline-color: #FBF9F4; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 8px; }

/* ---- shell ------------------------------------------------------------------------------- */
.band { height: 4px; background: var(--accent); position: fixed; inset: 0 0 auto 0; z-index: 30; }
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; padding-top: 4px; background: linear-gradient(to right, var(--bg-2) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
#main:focus { outline: none; }
.shell.collapsed { --side: 64px; }
.side { position: sticky; top: 4px; height: calc(100vh - 4px); overflow-y: auto; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px 12px; gap: 2px; }
.event-head { display: flex; gap: 10px; align-items: center; padding: 4px 6px 12px; min-height: 52px; }
.logo-box { height: 40px; width: 40px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.logo-box.dark { background: var(--ink); border-color: var(--ink); }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-box .initial { font-family: "Gambarino", serif; font-size: 20px; }
.event-name { font-weight: 650; line-height: 1.2; }
.event-meta { font-size: 13px; color: var(--ink-2); }
.event-switch { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s); padding: 6px 8px; min-height: 36px; }
.nav-group { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 14px 10px 4px; }
.nav a, .nav button.navlink { display: flex; align-items: center; gap: 10px; padding: 7px 10px; min-height: var(--target); border-radius: 8px; color: var(--ink); text-decoration: none; border: 0; background: none; width: 100%; text-align: left; }
.nav a:hover, .nav button.navlink:hover { background: rgba(22, 19, 15, .05); }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 650; }
.nav svg { flex: none; width: 18px; height: 18px; }
.nav .badge { margin-left: auto; }
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; background: var(--ink); color: #fff; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; display: grid; gap: 6px; font-size: 13.5px; }
.side-foot .who { word-break: break-all; font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: none; padding: 4px 10px; min-height: 32px; min-width: 44px; font-weight: 600; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.collapsed .side .label, .collapsed .side .nav-group, .collapsed .side .event-text, .collapsed .side-foot, .collapsed .side .badge { display: none; }
.main { min-width: 0; padding: 22px 32px 120px; }
.topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.livebar { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot.on { background: #D92D20; box-shadow: 0 0 0 0 rgba(217, 45, 32, .5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, .45); } 70% { box-shadow: 0 0 0 8px rgba(217, 45, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0); } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: var(--target); }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 12px; background: #B9B1A5; position: relative; margin: 0; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent-ui); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }

/* Phone: top bar plus bottom tabs (1.2). */
.topbar, .tabbar { display: none; }
@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: 4px; z-index: 20; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
  .topbar .event-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .logo-box { width: 34px; height: 34px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 12px; color: var(--ink-2); text-decoration: none; border: 0; background: none; position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--accent-strong); font-weight: 700; }
  .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .main { padding: 16px 16px 110px; }
  .title { font-size: 28px; }
  .shell { background: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles.big { grid-template-columns: 1fr; }
  .tile { min-height: 96px; padding: 12px; }
  .tile .val { font-size: 28px; }
  .livebar { padding: 8px 16px 0 !important; }
  .livebar .liveflag { display: none; }
  .soon { padding: 12px 16px 0 !important; }
}
.iconbtn { display: inline-grid; place-items: center; width: var(--target); height: var(--target); min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid transparent; background: none; color: inherit; }
.iconbtn:hover { background: rgba(22, 19, 15, .06); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- controls ---------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--target); padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent-btn, var(--accent)); color: var(--accent-btn-ink, var(--accent-ink)); border-color: transparent; }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.warnstyle { box-shadow: inset 0 0 0 2px var(--warn-line); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: var(--surface); }
.btn.danger.fill { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: none; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 14px; }
@media (max-width: 899px) { .btn.small { min-height: 44px; } }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 24px; }
.field { display: grid; gap: 5px; }
.field > label, .label { font-weight: 600; font-size: 14px; }
.hint { font-size: 13px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: var(--target); border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 7px 10px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.ferr { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.counter { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.counter.over { color: var(--danger); font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; min-height: var(--target); }
.radio input { margin: 3px 0 0; accent-color: var(--accent-ui); width: 18px; height: 18px; flex: none; }
.radio:has(input:checked) { border-color: var(--accent-ui); box-shadow: 0 0 0 1px var(--accent-ui); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; min-height: 32px; }
.check input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent-ui); flex: none; }
.stack { display: grid; gap: 14px; }
.stack.s { gap: 8px; }
.stack > *, .page > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }

/* ---- surfaces ---------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card.flat { padding: 0; overflow: hidden; }
.card h2 { margin-bottom: 10px; }
.empty { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 28px 20px; text-align: center; display: grid; gap: 12px; justify-items: center; color: var(--ink-2); background: var(--surface); }
.empty .big { font-size: 17px; color: var(--ink); font-weight: 600; max-width: 52ch; }
.empty > svg { width: 32px; height: 32px; color: var(--ok); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner.info { background: #EAF3FA; border-color: var(--sky); }
.banner.warn { background: var(--warn-fill); border-color: var(--warn-line); color: #3D2800; }
.banner.danger { background: var(--danger-fill); border-color: var(--danger-line); color: #5A0F09; }
.banner.ok { background: var(--ok-fill); border-color: #9FD3B5; }
.banner .grow { flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.ok { background: var(--ok-fill); border-color: #9FD3B5; color: var(--ok); }
.chip.warn { background: var(--warn-fill); border-color: var(--warn-line); color: var(--warn); }
.chip.danger { background: var(--danger-fill); border-color: var(--danger-line); color: var(--danger); }
.chip.info { background: #EAF3FA; border-color: var(--sky); color: #1F4E6E; }
.chip.butter { background: #FDF3C8; border-color: var(--butter); color: #4A3B00; }
.chip.ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 14px; min-height: var(--target); font-weight: 600; }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs .n { font-variant-numeric: tabular-nums; opacity: .8; margin-left: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
details > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }

/* ---- tables: real tables, cards on a narrow page (3.6, 3.7) -------------------------------- */
.page { container-type: inline-size; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); }
table.list th { text-align: left; font-size: 13px; font-weight: 650; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FDFCF9; }
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #FBF8F2; }
table.list .r { text-align: right; }
@container (max-width: 640px) {
  table.list.cards thead { display: none; }
  table.list.cards, table.list.cards tbody, table.list.cards tr, table.list.cards td { display: block; width: 100%; }
  table.list.cards tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  table.list.cards td { border: 0; padding: 2px 0; display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 10px; }
  table.list.cards td::before { content: attr(data-label); color: var(--ink-2); font-size: 13px; }
  table.list.cards td[data-label=""]::before { content: none; }
  table.list.cards td[data-label=""] { display: block; }
  table.list.cards td.lead { font-weight: 650; display: block; font-size: 16px; }
  table.list.cards td.lead::before { content: none; }
}

/* ---- tiles (Overzicht) --------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 112px; display: grid; align-content: start; gap: 4px; text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--ink-3); }
.tile .lbl { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.tile .val { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .ctx { font-size: 13px; color: var(--ink-2); }
.tile.big .val { font-size: 64px; letter-spacing: -.02em; }
.tile.big { min-height: 168px; }
.tiles.big { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.info-i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 0; background: none; color: var(--ink-2); padding: 0; position: relative; }
.info-i svg { width: 16px; height: 16px; }
.tip { position: absolute; z-index: 40; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 260px; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 400; line-height: 1.35; text-align: left; }
.stale { opacity: .6; }
.stale-note { font-size: 13px; color: var(--warn); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.funnel { display: grid; gap: 10px; }
.funnel-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 15px; }
.funnel-steps b { font-size: 22px; font-variant-numeric: tabular-nums; }
.funnel-steps .arrow { color: var(--ink-3); }
.fbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--bg-2); }
.fbar span { display: block; height: 100%; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.quick .btn { flex: none; }
.checklist { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checklist a, .checklist span.step { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; color: var(--ink); }
.checklist svg { width: 18px; height: 18px; }
.checklist .done svg { color: var(--ok); }
.progress { height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent-ui); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 12px "Inter Tight", sans-serif; fill: var(--ink-2); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.skel { background: linear-gradient(90deg, #EFEAE1 0%, #F7F3EC 50%, #EFEAE1 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---- toasts, dialogs, sheets --------------------------------------------------------------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 899px) { .toasts { bottom: auto; top: 64px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 10px 10px 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast .grow { flex: 1; }
.toast .btn { min-height: 36px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.toast .iconbtn { color: #fff; min-width: 36px; min-height: 36px; width: 36px; height: 36px; }
.toast.err { background: #5A0F09; }
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog.dlg::backdrop { background: rgba(22, 19, 15, .45); }
dialog.dlg.wide { width: min(760px, calc(100vw - 32px)); }
.dlg-body { padding: 22px 22px 8px; display: grid; gap: 12px; overflow-y: auto; max-height: calc(100vh - 140px); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; flex-wrap: wrap; }
@media (max-width: 899px) {
  dialog.dlg.sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.dlg.sheet .dlg-body { max-height: calc(100dvh - 90px); }
  .dlg-actions .btn { flex: 1; }
}
.drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); background: var(--surface); z-index: 50; box-shadow: -20px 0 60px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px; overflow-y: auto; display: grid; gap: 16px; flex: 1; align-content: start; }
.dangerzone { border: 1px solid var(--danger-line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.menu { position: absolute; z-index: 45; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .16); padding: 6px; min-width: 220px; display: grid; }
.menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; min-height: 40px; display: flex; gap: 8px; align-items: center; }
.menu button:hover, .menu button:focus-visible { background: var(--bg-2); }
.menu button.danger { color: var(--danger); }
.menu svg { width: 16px; height: 16px; }
.savebar { position: sticky; bottom: 0; z-index: 15; margin: 16px -4px 0; padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.savebar .grow { flex: 1; }
.savebar .btn { border-color: rgba(255, 255, 255, .4); background: transparent; color: #fff; }
.savebar .btn.primary { background: var(--accent-btn, var(--accent)); color: var(--accent-btn-ink, var(--accent-ink)); border-color: transparent; }
.savebar.err { background: #5A0F09; }
@media (max-width: 899px) { .savebar { bottom: 64px; } }

/* ---- avatars, people ---------------------------------------------------------------------- */
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line); display: inline-grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.l { width: 72px; height: 72px; font-size: 22px; }
.person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.person .nm { font-weight: 600; }
.person .sub { font-size: 13px; color: var(--ink-2); }

/* ---- split panes (Chats, Helpdesk) --------------------------------------------------------- */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 560px; overflow: hidden; }
.split.three { grid-template-columns: 300px minmax(0, 1fr) 260px; }
.split > * { min-width: 0; }
.pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pane:last-child { border-right: 0; }
.pane-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pane-body { overflow-y: auto; flex: 1; max-height: 640px; }
.listrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; min-height: 52px; }
.listrow:hover { background: #FBF8F2; }
.listrow[aria-current="true"] { background: var(--accent-tint); }
.listrow .grow { flex: 1; min-width: 0; }
.listrow .one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; color: var(--ink-2); }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); margin-top: 7px; flex: none; }
.msgs { padding: 14px; display: grid; gap: 10px; align-content: start; }
.msg { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--bg); max-width: 640px; position: relative; }
.msg.org { background: #FDF3C8; }
.msg.mine { background: #EAF3FA; justify-self: end; }
.msg .meta { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.msg .removed { font-style: italic; color: var(--ink-2); }
.msg .more { position: absolute; top: 2px; right: 2px; }
.composer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 6px; }
@media (max-width: 899px) {
  .split, .split.three { grid-template-columns: 1fr; min-height: 0; }
  .split .pane { border-right: 0; }
  .split[data-view="list"] > .pane:not(:first-child) { display: none; }
  .split[data-view="thread"] > .pane:first-child, .split[data-view="thread"] > .pane.side3 { display: none; }
  .pane-body { max-height: none; }
}

/* ---- import ------------------------------------------------------------------------------ */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; list-style: none; padding: 0; }
.stepper li { display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.stepper li[aria-current="step"] { background: var(--ink); color: #fff; }
.stepper li.done { background: var(--ok-fill); color: var(--ok); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 36px 20px; text-align: center; display: grid; gap: 12px; justify-items: center; background: var(--surface); }
.drop.over { border-color: var(--accent-strong); background: var(--accent-tint); }
.maprow { display: grid; grid-template-columns: minmax(0, 1.1fr) 24px minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .maprow { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; } .maprow .arrow { display: none; } }
.removed-block { border: 2px solid var(--danger); background: var(--danger-fill); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 6px; color: #5A0F09; }
.diffrow { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 16px; }
.diffrow b { font-variant-numeric: tabular-nums; }
.issue { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.issue svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.issue.err svg { color: var(--danger); }
.issue.wrn svg { color: var(--warn); }

/* ---- tables board ------------------------------------------------------------------------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 250px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 70vh; }
.col.over { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--accent-tint); }
.col-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.col-head .grow { flex: 1; min-width: 0; }
.col-body { padding: 8px; display: grid; gap: 6px; overflow-y: auto; align-content: start; min-height: 60px; }
.gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px 6px 10px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.gcard[draggable="true"] { cursor: grab; }
.gcard.dragging { opacity: .4; }
.gcard .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 2px solid var(--ok); }
.in-dot.in { background: var(--ok); }

/* ---- matches -------------------------------------------------------------------------------- */
.mguest { border-bottom: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 8px; }
.slots { display: grid; gap: 6px; }
.slot { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.slot .rank { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slot .reason { font-size: 13.5px; color: var(--ink-2); }
.slot.empty-slot { background: none; border: 1px dashed var(--line-2); }

/* ---- moderation ----------------------------------------------------------------------------- */
.mod { display: grid; gap: 8px; }
.blur { filter: blur(6px); user-select: none; }
.quote { padding: 8px 12px; border-left: 3px solid var(--line-2); background: var(--bg); border-radius: 0 8px 8px 0; }

/* ---- phone previews ----------------------------------------------------------------------- */
.phone { width: 300px; max-width: 100%; border-radius: 36px; background: #1B1814; padding: 12px; color: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.phone-screen { border-radius: 26px; background: linear-gradient(160deg, #3A3530, #1E1A16); min-height: 380px; padding: 40px 12px 16px; display: grid; gap: 10px; align-content: start; }
.phone-screen.light { background: var(--bg); color: var(--ink); }
.phone-clock { text-align: center; font-size: 46px; font-weight: 300; letter-spacing: -.02em; }
.notif { background: rgba(255, 255, 255, .86); color: var(--ink); border-radius: 16px; padding: 10px 12px; display: grid; grid-template-columns: 30px 1fr; gap: 8px 10px; }
.notif .app { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.notif .t { font-weight: 700; font-size: 13.5px; display: flex; justify-content: space-between; gap: 6px; }
.notif .b { font-size: 13.5px; grid-column: 2; line-height: 1.35; overflow-wrap: anywhere; }
.pinned-card { border-radius: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; }
.pinned-card .band2 { height: 4px; border-radius: 2px; margin: -2px 0 8px; background: var(--accent); }
.mailprev { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.mailprev .mh { padding: 14px 16px; color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.mailprev .mb { padding: 16px; display: grid; gap: 10px; font-size: 14px; white-space: pre-wrap; }
.mailprev .fixed { color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 10px; white-space: normal; }
.storebtn { display: inline-block; background: var(--ink); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; margin-right: 6px; }

/* ---- reach / report --------------------------------------------------------------------- */
.segbar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--bg-2); }
.segbar span { height: 100%; }
.reach-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; font-size: 14px; }
.reach-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.reach-legend b { font-variant-numeric: tabular-nums; }
.tree { display: grid; gap: 4px; font-size: 14px; padding-left: 4px; }
.tree div { display: flex; gap: 8px; }
.tree b { min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .composer-grid { grid-template-columns: 1fr; } }
.sticky-send { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; z-index: 5; }
@media (max-width: 899px) { .sticky-send { bottom: 57px; } }

/* ---- settings ---------------------------------------------------------------------------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.subnav { position: sticky; top: 20px; display: grid; gap: 2px; }
.subnav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; min-height: var(--target); display: flex; align-items: center; }
.subnav a[aria-current="true"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 650; }
.subnav-select { display: none; }
@media (max-width: 899px) { .settings { grid-template-columns: 1fr; } .subnav { display: none; } .subnav-select { display: block; } }
.setrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setrow:last-child { border-bottom: 0; }
.setrow .desc { font-size: 14px; color: var(--ink-2); grid-column: 1; }
.setrow .def { font-size: 13px; color: var(--ink-2); grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .copygrid { grid-template-columns: 1fr; } }
.swatch { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-2); padding: 0; }
.verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.verdict { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.verdict .sample { border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; }
.verdict .sample .s1 { font-size: 14px; }
.verdict .sample .s2 { font-size: 22px; font-weight: 700; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); position: relative; overflow: hidden; }
.pv-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pv-accent); }
.history-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg-2); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* ---- login ------------------------------------------------------------------------------ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: min(420px, 100%); display: grid; gap: 18px; }
.login-brand { text-align: center; font-weight: 800; letter-spacing: .22em; font-size: 14px; }
.login-brand span { font-weight: 500; letter-spacing: .04em; color: var(--ink-2); }
.cells { display: flex; gap: 8px; justify-content: space-between; }
.cells input { width: 100%; max-width: 52px; height: 58px; text-align: center; font-size: 26px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-variant-numeric: tabular-nums; }
.cells.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .cells.shake { animation: none; } }

/* ---- door: dark, full screen, phone first (2.4) ------------------------------------------- */
body.doormode .side, body.doormode .topbar, body.doormode .tabbar, body.doormode .band { display: none; }
body.doormode .shell { grid-template-columns: 1fr; padding-top: 0; }
body.doormode .main { padding: 0; }
body.doormode { background: #0E0C0A; }
.door { --d-bg: #0E0C0A; --d-2: #1C1915; --d-3: #2A2620; --d-ink: #FBF9F4; --d-mu: #B8B0A4; background: var(--d-bg); color: var(--d-ink); min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.door a { color: #F5C6BF; }
.door-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; position: sticky; top: 0; background: var(--d-bg); z-index: 5; }
.door-head .grow { flex: 1; min-width: 0; }
.door-head .count { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.door .iconbtn { color: var(--d-ink); }
.door .iconbtn:hover { background: rgba(255, 255, 255, .08); }
.door .btn { background: var(--d-2); color: var(--d-ink); border-color: #4A443B; }
.door .btn.primary { background: #FBF9F4; color: #16130F; border-color: #FBF9F4; }
.door .btn.okbtn { background: var(--ok-flash); border-color: var(--ok-flash); color: #06210F; }
.door .input { background: var(--d-2); border-color: #4A443B; color: var(--d-ink); }
.door .muted, .door .hint { color: var(--d-mu); }
.door .card { background: var(--d-2); border-color: #3A352D; color: var(--d-ink); }
.door .chip { background: var(--d-3); border-color: #4A443B; color: var(--d-ink); }
.door .chip.ok { background: #12301F; border-color: #2F7A4F; color: #9BE3B7; }
.door .chip.warn { background: #3A2A06; border-color: #8A6512; color: #F6D27A; }
.door-progress { height: 6px; background: var(--d-3); }
.door-progress span { display: block; height: 100%; background: var(--ok-flash); }
.door-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; }
@media (min-width: 1000px) { .door-grid { grid-template-columns: minmax(0, 1fr) 380px; } .door-grid .door-log-side { display: block; border-left: 1px solid #2A2620; } }
.door-log-side { display: none; overflow-y: auto; max-height: calc(100vh - 60px); }
.door-main { display: grid; align-content: start; gap: 10px; padding: 0 10px 140px; }
.cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; display: grid; place-items: center; border: 3px solid transparent; }
@media (min-width: 700px) { .cam { aspect-ratio: 4 / 3; } }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .frame { position: absolute; width: 58%; aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none; }
.cam .camnote { position: absolute; inset: auto 12px 12px 12px; text-align: center; color: #fff; font-weight: 600; }
.cam .flash { position: absolute; inset: 0; background: var(--ok-flash); opacity: 0; pointer-events: none; }
.cam.ok-flash .flash { animation: okflash .3s ease-out; }
@keyframes okflash { 0% { opacity: .75; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cam.ok-flash .flash { animation: none; } .cam.ok-flash { border-color: var(--ok-flash); } }
.cam.paused video { filter: grayscale(1) brightness(.4); }
.result { display: flex; gap: 10px; align-items: center; min-height: 56px; padding: 8px 12px; border-radius: 12px; background: var(--d-2); font-size: 17px; }
.result.ok { background: #12301F; color: #C8F2D8; }
.result .grow { flex: 1; min-width: 0; }
.result svg { width: 24px; height: 24px; flex: none; }
.door-foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--d-bg); border-top: 1px solid #2A2620; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; z-index: 6; }
@media (min-width: 1000px) { .door-foot { right: 380px; } }
.seg { display: inline-flex; background: var(--d-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; color: var(--d-mu); padding: 8px 18px; min-height: 44px; border-radius: 9px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: #FBF9F4; color: #16130F; }
.door-foot .grow { flex: 1; }
.door .sheet-d { position: fixed; inset: auto 0 0 0; z-index: 70; background: var(--d-2); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); border-top: 6px solid var(--warn-line); }
@media (min-width: 700px) { .door .sheet-d { left: 50%; right: auto; bottom: 24px; transform: translateX(-50%); width: 520px; border-radius: 18px; } }
.door .sheet-d.red { border-top-color: #E5484D; }
.door .sheet-d .sh-title { font-size: 24px; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.door .sheet-d .sh-title svg { width: 30px; height: 30px; flex: none; }
.door .sheet-d.red .sh-title svg { color: #FF8A8E; }
.door .sheet-d.amber .sh-title svg { color: #F6D27A; }
.door .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 69; }
.door .offline { background: #3A2A06; color: #F6D27A; border-bottom: 1px solid #8A6512; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.door .offline svg { width: 22px; height: 22px; flex: none; }
.door .row-d { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #2A2620; min-height: 64px; }
.door .row-d .grow { flex: 1; min-width: 0; }
.door .row-d .sub { font-size: 13.5px; color: var(--d-mu); }
.door .row-d.undone .nm { text-decoration: line-through; color: var(--d-mu); }
.door .av { background: var(--d-3); border-color: #4A443B; color: var(--d-mu); }
.door .preflight { display: grid; gap: 10px; }
.door .preflight .item { display: flex; gap: 10px; align-items: flex-start; }
.door .preflight svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.door .pending { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: #3A2A06; color: #F6D27A; font-size: 12.5px; font-weight: 700; }
.door .bigqr { background: #fff; padding: 14px; border-radius: 14px; width: min(280px, 80vw); justify-self: center; }
.door .bigqr svg { display: block; width: 100%; height: auto; }

/* ---- live mode (1.3) ---------------------------------------------------------------------- */
body.live .tile .val { font-size: 40px; }
body.live .tile.big .val { font-size: 72px; }
svg.qr { width: 100%; height: auto; display: block; }
body.doormode .livebar, body.doormode .soon { display: none !important; }
@media (max-width: 899px) { [data-phone-back] { display: inline-grid !important; } }
[data-removed-names] { columns: 3 220px; column-gap: 24px; }
@media (max-width: 899px) { .sticky-send > a.btn { display: none; } .sticky-send .grow { flex-basis: 100%; } .sticky-send .grow .btn { width: 100%; } .sticky-send > .btn.primary { width: 100%; } }
