:root { --bg: #f2f4f7; --card: #fff; --ink: #191919; --muted: #666; --line: #dde2e7; --navy: #010547; --accent: #123f87; --red: #c81e1e; --ok: #12663a; --warn: #9a5b00; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; line-height: 1.15; }
.brand img { width: 32px; height: 32px; flex: none; }
.brand .bn { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.brand #brand { display: block; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; font-size: 13px; }
.stats span b { font-size: 15px; }
.me { font-size: 12px; opacity: .9; }
.sound { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 8px; padding: 5px 8px; cursor: pointer; }
.sound.on { background: #1b7f4b; border-color: #1b7f4b; }
.tabs { display: flex; gap: 2px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; z-index: 900; }
.tabs button { border: 0; background: transparent; padding: 12px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; font-size: 14px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs b { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }
.tabs b:empty { display: none; }
main { padding: 14px 16px 60px; max-width: 1400px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
label { display: block; font-weight: 600; margin: 8px 0; font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; }
input, select, textarea { font: inherit; padding: 8px 9px; border: 1px solid #c5ccd3; border-radius: 8px; background: #fff; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; }
label.check input { width: auto; display: inline; margin: 0; }
button { font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button.ghost { background: #fff; color: var(--accent); }
button.danger { background: var(--red); border-color: var(--red); }
button.okb { background: var(--ok); border-color: var(--ok); }
button:disabled { opacity: .5; cursor: default; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row label { margin: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.pill { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; background: #eef1f4; }
.pill.red { background: #fde8e8; color: var(--red); }
.pill.green { background: #e6f4ec; color: var(--ok); }
.pill.amber { background: #fff3dc; color: var(--warn); }
.pill.party { background: #1f2a44; color: #fff; }

/* alerts */
.alert { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 14px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.alert.open { border-color: var(--red); animation: pulse 1.2s infinite; background: #fff6f6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(200,30,30,.18); } }
.alert h4 { margin: 0 0 4px; font-size: 17px; }
.alert .acts { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.alert .acts a { text-align: center; }
a.btn { display: inline-block; text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); background: #fff; }
a.btn.call { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 16px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: #fff; border-radius: 12px; border: 1px dashed var(--line); }

/* result review */
.sub { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr); gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
@media (max-width: 800px) { .sub { grid-template-columns: 1fr; } }
.sub .photo img { width: 100%; max-height: 480px; object-fit: contain; background: #111; border-radius: 8px; cursor: zoom-in; }
.sub .photo .nophoto { padding: 40px; text-align: center; background: #fafafa; border: 1px dashed #ccc; border-radius: 8px; color: var(--muted); }
.sub h4 { margin: 0; font-size: 16px; }
.sub .flags { margin: 8px 0; padding: 0; list-style: none; }
.sub .flags li { color: var(--red); font-weight: 600; }
.sub .flags li.okf { color: var(--ok); }
.vt td input { width: 90px; text-align: right; font-size: 16px; padding: 6px; font-variant-numeric: tabular-nums; }
.vt td input.changed { border-color: var(--warn); background: #fff8e6; }
.chip { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sub .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

#map { height: calc(100vh - 190px); min-height: 420px; border-radius: 12px; border: 1px solid var(--line); }

.codebox { background: #fffbea; border: 1px solid #f2d27a; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.codebox code { font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12px; }
.mcard img, .mcard video { width: 100%; height: 200px; object-fit: contain; background: #111; border-radius: 8px; cursor: zoom-in; }
.mcard.hidden-item { opacity: .55; }
dialog#zoom { padding: 0; border: 0; max-width: 96vw; max-height: 96vh; background: #000; }
dialog#zoom img { max-width: 96vw; max-height: 90vh; display: block; }
dialog#zoom button { position: absolute; top: 8px; right: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #191919; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 2000; font-weight: 600; }
.cand-row { display: grid; grid-template-columns: 1.4fr 1.2fr .7fr 60px 60px 70px 70px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cand-row input[type=color] { padding: 0; height: 34px; width: 100%; }
.place-row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.place-row input { flex: 1; }
.card textarea { width: 100%; }
.cand-row input, .cand-row select { width: 100%; min-width: 0; }
.cand-row label.check { justify-content: center; margin: 0; }
.cand-row label.check input { width: auto; }

/* party staff logins: admin-only controls are not shown (the server refuses them anyway) */
.party-user .super-only { display: none !important; }
.notlisted { max-width: 560px; margin: 60px auto; background: #fff; border: 1px solid #e3e7e5; border-radius: 14px; padding: 24px; }

.sub .photo video { width: 100%; max-height: 320px; background: #000; border-radius: 8px; margin-top: 8px; display: block; }

.vt b.over { color: var(--red); }
.vt b.over::after { content: ' ⚠'; }

/* ---------- phones: compact header, tables become cards, setup rows stack ---------- */
@media (max-width: 639px) {
  .top { flex-direction: column; align-items: stretch; gap: 8px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; }
  .stats span b { font-size: 14px; }
  .me { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  input, select, textarea { font-size: 16px; }
  .tbl { border: 0; overflow: visible; }
  table.cardify, table.cardify tbody { display: block; background: transparent; }
  table.cardify thead { display: none; }
  table.cardify tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  table.cardify td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 4px 0; text-align: right; min-height: 28px; overflow-wrap: anywhere; }
  table.cardify td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  table.cardify td:first-child { font-weight: 700; font-size: 15px; justify-content: flex-start; text-align: left; }
  table.cardify td:first-child::before, table.cardify td[data-label=""]::before { display: none; }
  table.cardify td:empty { display: none; }
  .place-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .place-row input { grid-column: 1 / -1; }
}
.ph-only { display: none; }
@media (max-width: 639px) {
  /* candidate editor: name / party + short / colour, order, on ballot, save */
  .cand-row { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
  .cand-row.muted { display: none; }
  .cand-row [data-k="name"] { grid-column: 1 / -1; }
  .cand-row [data-k="party"] { grid-column: span 3; }
  .cand-row label.check { gap: 4px; font-size: 12px; }
  .ph-only { display: inline; }
}

/* flag stripe under the header, as on the public site */
.flag { height: 8px; background: linear-gradient(to bottom, #e00411 0 2px, #fff 2px 3px, #0025c1 3px 5px, #fff 5px 6px, #028419 6px 8px); }

/* IEC staff: the IEC check tab only. Party staff: they can read it, not edit it. */
.iec-user .tabs button:not([data-tab="iec"]), .iec-user .super-only:not(.edit-iec), .iec-user #sound { display: none !important; }
.party-user .edit-iec { display: none !important; }

/* second key: password page (login.js) */
.pwgate { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: var(--navy); overflow: auto; }
.pwcard { width: min(100%, 400px); background: #fff; border-radius: 16px; padding: 32px 24px 24px; display: grid; gap: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.pwcard picture img { display: block; width: 200px; height: auto; margin: 0 auto; }
.pwsub { margin: -4px 0 0; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pwcard h2 { margin: 8px 0 0; font-size: 20px; color: var(--navy); }
.pwcard p { margin: 0; }
.pwcard label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.pwcard input { min-height: 44px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.pwcard input[readonly] { background: #f2f4f7; color: var(--muted); }
.pwcard button { min-height: 48px; font-size: 16px; }
.pwerr { color: var(--red); font-weight: 700; }
.linkb { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; font-size: 12px; padding: 4px; cursor: pointer; min-height: 0; }

/* read-only desks (radio/TV, fact-checkers, observers): the IEC check, nothing to edit */
.monitor-user .edit-iec, .monitor-user [data-iec-del], .monitor-user [data-confirm] { display: none !important; }

.ours-hint { display: block; font-size: 12px; font-weight: 600; color: var(--muted); min-height: 16px; }
.ours-hint.same, #iecSum .same { color: var(--ok); }
.ours-hint.diff, #iecSum .diff { color: var(--red); }

/* MarbleCount team desks: everything except Logins and Setup */
.reviewer-user [data-tab="logins"], .reviewer-user [data-tab="setup"] { display: none !important; }

/* Logins tab */
.desk-group { margin-top: 16px; }
.desk-group h4 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
.tmp-pw { display: inline-block; font-size: 15px; font-weight: 700; padding: 4px 8px; background: #fff8e1; border: 1px solid #f0d58c; border-radius: 6px; letter-spacing: .02em; }
.pw-acts { margin-top: 6px; }
.danger-t { color: var(--red); border-color: var(--red); }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 12px; }
.linkish { background: none; border: 0; padding: 0 4px; min-height: 0; color: var(--accent); text-decoration: underline; font-size: 12px; cursor: pointer; }
.desk-group td b { overflow-wrap: anywhere; }

/* Add one agent: find the stream by place (stream-pick.js) */
.stream-pick { display: grid; gap: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.stream-pick p { margin: 0; }
.pick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .pick2 { grid-template-columns: 1fr; } }
.stream-name { min-height: 18px; margin-top: 4px; font-size: 13px; font-weight: 600; }
.stream-name.ok { color: var(--ok); }
.stream-name.bad { color: var(--red); }

.cc-offline { background: #fff4d6; color: #5c3d00; border-bottom: 1px solid #f0d58c; font-weight: 600; padding: 8px 16px; }

.alarm-off { display: block; width: 100%; border: 0; border-radius: 0; background: #b91c1c; color: #fff; font-weight: 800; font-size: 15px; padding: 12px 16px; text-align: left; cursor: pointer; animation: alarmblink 1.2s ease-in-out infinite; }
@keyframes alarmblink { 50% { background: #7f1d1d; } }
@media (prefers-reduced-motion: reduce) { .alarm-off { animation: none; } }
.safe-note { margin-top: 4px; color: var(--ok); font-weight: 800; }
a.linkb { color: #fff; text-decoration: underline; font-size: 12px; padding: 4px; }

.pick-hits { display: grid; gap: 4px; }
.pick-hits .hit { text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-weight: 600; min-height: 0; }
.pick-hits .hit:hover { border-color: var(--accent); }
#agentForm [name=station][readonly], #iecForm [name=code][readonly] { background: #f2f4f7; }

/* Results tab: our count */
.oc-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.oc-h h3 { margin: 0; }
.oc-lead { margin: 10px 0; font-size: 16px; }
.oc { width: 100%; border-collapse: collapse; }
.oc th, .oc td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.oc td:nth-child(2), .oc td:nth-child(3), .oc td:nth-child(4) { font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.oc-bar { display: inline-block; width: calc(100% - 52px); height: 10px; background: #eef0f4; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.oc-bar i { display: block; height: 100%; border-radius: 4px; }

/* ---------- results (results.js): progress, filters, compact list, side panel / bottom sheet (ui-design-standards §10) ---------- */
.res-progress { padding: 12px 14px; }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rp-big { font-size: 22px; font-variant-numeric: tabular-nums; }
.rp-pct { font-variant-numeric: tabular-nums; margin-left: 4px; }
.rp-bar { display: flex; gap: 2px; height: 8px; margin: 8px 0 6px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.rp-bar i { display: block; height: 100%; transition: width .25s ease-out; }
.rp-bar .done, .k.done { background: var(--accent); }
.rp-bar .wait, .k.wait { background: #9db4d9; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rp-legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: #eef1f4; border: 1px solid var(--line); vertical-align: -1px; }
.qm { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; line-height: 20px; flex: none; }
.qm:hover, .qm:focus-visible { color: var(--accent); border-color: var(--accent); }
.res-note { margin: 0 0 10px; padding: 8px 12px; background: #eef3fb; border-radius: 8px; font-size: 13px; }
.res-tools input[type=search] { flex: 1; min-width: 200px; max-width: 360px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 7px 12px; font-weight: 700; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--accent); color: #fff; }
.seg button b { font-variant-numeric: tabular-nums; margin-left: 4px; }
.seg button b:empty { display: none; }
.rwrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rtable { table-layout: auto; }
.rtable thead th { position: sticky; top: 45px; background: #fff; z-index: 2; white-space: nowrap; }
.rtable tbody tr { cursor: pointer; transition: background-color .15s ease-out; }
.rtable tbody tr:hover { background: #f5f8fc; }
.rtable tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rtable tbody tr.sel { background: #e8effa; }
.rtable td { padding: 8px 10px; vertical-align: middle; }
.rtable .c-name { max-width: 320px; }
.rtable .c-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtable .c-agent { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtable .c-total, .rtable .c-reg, .rtable .c-ago, .rtable .c-st { white-space: nowrap; }
.rtable .c-total b { font-size: 15px; }
.rtable .c-go { color: var(--muted); font-size: 18px; width: 24px; text-align: center; opacity: .45; transition: opacity .15s; }
.rtable tr:hover .c-go, .rtable tr.sel .c-go { opacity: 1; color: var(--accent); }
.fixed { font-size: 11px; font-weight: 700; color: var(--warn); background: #fff3dc; border-radius: 4px; padding: 0 4px; }
.ok-t { color: var(--ok); font-weight: 600; white-space: nowrap; }
.rtable tr.sk td { padding: 12px 10px; cursor: default; }
.rtable tr.sk i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, #eef1f4, #f7f9fb, #eef1f4); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.res-more { text-align: center; margin: 12px 0; }
.center { text-align: center; }
button.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-weight: 700; cursor: pointer; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: max(320px, min(40vw, 640px)); background: #fff; border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(1, 5, 71, .12); z-index: 1500; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease-out; }
.drawer.in { transform: none; }
.drawer .grab { display: none; }
body.drawer-open main { margin-right: max(320px, min(40vw, 640px)); }
.dr-head { display: flex; align-items: flex-start; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dr-t { flex: 1; min-width: 0; }
.dr-t h3 { margin: 0; font-size: 16px; }
button.ic { width: 36px; height: 36px; padding: 0; font-size: 18px; line-height: 1; flex: none; }
.dr-body { flex: 1; overflow-y: auto; padding: 12px 14px; overscroll-behavior: contain; }
.dr-banner { background: #fff3dc; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-weight: 600; }
.dr-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.dr-checks { list-style: none; padding: 0; margin: 10px 0; font-size: 13px; }
.dr-checks li { padding: 3px 0; display: flex; gap: 6px; }
.dr-checks li.crit { color: var(--red); font-weight: 700; }
.dr-checks li.warn { color: var(--warn); font-weight: 600; }
.dr-checks li.info { color: var(--muted); }
.dr-checks li.ok { color: var(--ok); font-weight: 600; }
.dr-ev img { width: 100%; max-height: 52vh; object-fit: contain; background: #111; border-radius: 8px; cursor: zoom-in; display: block; }
.dr-ev video { width: 100%; max-height: 240px; background: #000; border-radius: 8px; margin-top: 8px; display: block; }
.dr-ev .nophoto { padding: 24px; text-align: center; background: #fafafa; border: 1px dashed #ccc; border-radius: 8px; color: var(--muted); margin-bottom: 8px; }
.dr-hint { margin: 12px 0 0; padding: 8px 10px; background: #eef3fb; border-radius: 8px; font-size: 13px; }
.dr-votes { margin-top: 12px; }
.dr-votes td { padding: 6px 4px; vertical-align: middle; }
.dr-votes .tot td { border-top: 2px solid var(--ink); }
.dr-votes b.crit { color: var(--red); }
.dr-votes b.warn { color: var(--warn); }
.dr-votes .was { display: block; font-size: 11px; color: var(--warn); }
.dr-votes.editing input { border-color: var(--accent); }
.dr-foot { border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; }
.dr-foot textarea { width: 100%; }
.dr-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-only { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dr-foot p.muted { margin: 6px 0 0; }
.scrim { position: fixed; inset: 0; background: rgba(1, 5, 71, .35); z-index: 1400; }
.undo-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1600; }
body.drawer-open .undo-stack { right: calc(max(320px, min(40vw, 640px)) + 20px); }
.undo { display: flex; align-items: center; gap: 12px; background: #191919; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 13px; }
.undo .muted { color: #bbb; font-variant-numeric: tabular-nums; }
.undo .linkish { color: #9cc3ff; }
@media (prefers-reduced-motion: reduce) { .drawer, .rp-bar i, .rtable tbody tr { transition: none; } .rtable tr.sk i { animation: none; } }
@media (pointer: coarse) { .seg button, button.ic, .dr-acts button { min-height: 44px; } }
@media (max-width: 1100px) { .rtable .c-ev, .rtable th:nth-child(6) { display: none; } }
@media (max-width: 860px) { .rtable .c-agent, .rtable th:nth-child(2), .rtable .c-reg, .rtable th:nth-child(4) { display: none; } body.drawer-open main { margin-right: 0; } }
@media (max-width: 639px) {
  .rwrap { border: 0; background: transparent; }
  .rtable, .rtable tbody { display: block; background: transparent; }
  .rtable thead { display: none; }
  .rtable tbody tr { display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "name name name total" "st check . ago"; gap: 4px 8px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  .rtable td { border: 0; padding: 0; }
  .rtable .c-name { grid-area: name; max-width: none; min-width: 0; }
  .rtable .c-total { grid-area: total; }
  .rtable .c-st { grid-area: st; }
  .rtable .c-check { grid-area: check; }
  .rtable .c-ago { grid-area: ago; }
  .rtable .c-agent, .rtable .c-reg, .rtable .c-ev, .rtable .c-go { display: none; }
  .rtable tr.sk { display: block; }
  .res-tools input[type=search] { max-width: none; min-width: 100%; order: -1; }
  .seg { width: 100%; } .seg button { flex: 1; padding: 8px 4px; }
  .drawer { top: auto; left: 0; width: auto; max-height: 92vh; height: 92vh; border-left: 0; border-radius: 16px 16px 0 0; transform: translateY(100%); box-shadow: 0 -12px 32px rgba(1,5,71,.2); }
  .drawer .grab { display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
  .drawer .grab i { width: 40px; height: 4px; border-radius: 2px; background: #c5ccd3; }
  body.drawer-open main { margin-right: 0; }
  body.drawer-open .undo-stack { right: 12px; bottom: calc(92vh + 8px); }
  .undo-stack { right: 12px; left: 12px; bottom: 12px; }
}
.rp-go { margin-left: auto; }
.rtable .c-ev { white-space: nowrap; }
/* side panel open: the list keeps what is needed to pick the next one */
body.drawer-open .rtable .c-ev, body.drawer-open .rtable th:nth-child(6), body.drawer-open .rtable .c-reg, body.drawer-open .rtable th:nth-child(4) { display: none; }
@media (max-width: 1300px) { body.drawer-open .rtable .c-agent, body.drawer-open .rtable th:nth-child(2) { display: none; } }
/* fact-checkers: Results (approve) and the IEC check only */
.checker-user .tabs button:not([data-tab="results"]):not([data-tab="iec"]), .checker-user .super-only, .checker-user #sound, .checker-user #ourCount { display: none !important; }
.pill.pc { background: #e6f4ec; color: var(--ok); }
.dr-why { margin: 10px 0 4px; font-size: 13px; }
.dr-why input { width: 100%; margin-top: 4px; border-color: var(--accent); }
.dr-ev + .dr-hint { margin-top: 10px; }
.dr-ev img { max-height: 46vh; }
.dr-back { margin-left: auto; font-size: 13px; color: var(--muted); }
/* switch (Logins: "Fixes numbers") — rail 2x knob, 250 ms, real checkbox underneath */
.sw { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--ink); }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #c5ccd3; transition: background-color .25s ease-out; flex: none; }
.sw i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .25s ease-out; }
.sw input:checked + i { background: var(--ok); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw input:disabled + i { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .sw i, .sw i::after { transition: none; } }
.dr-lock { font-size: 14px; }
.dr-lock ol { margin: 6px 0 10px; padding-left: 20px; }
.dr-lock li { margin: 3px 0; }
.pill.vf { background: #e6f4ec; color: var(--ok); }
.lv { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12px; font-weight: 600; }
.lv select { padding: 3px 6px; font-size: 12px; }
.pill.test { background: #ece7f7; color: #5b3fa0; }
.pwcard .pwshow { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.pwcard .pwshow input { min-height: 0; width: 18px; height: 18px; padding: 0; }
/* new result banner (newresults.js) */
.cc-newres { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1700; display: flex; flex-direction: column; gap: 8px; width: min(94vw, 520px); }
.cc-newres-item { display: grid; gap: 2px; background: #fff; color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-left: 4px solid var(--ok);
  border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 28px rgba(1, 5, 71, .18); animation: nrIn .25s ease-out; transition: opacity .4s; font-size: 13px; }
.cc-newres-item b { font-size: 15px; }
.cc-newres-item.out { opacity: 0; }
@keyframes nrIn { from { transform: translateY(-8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cc-newres-item { animation: none; } }
.entry label { margin: 10px 0 4px; }
.entry .pick-hits { display: grid; gap: 4px; margin: 4px 0; }
.entry .hit { text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.entry .stream-name.ok { color: var(--ok); font-weight: 700; margin: 4px 0; }
.en-prev { max-width: 100%; max-height: 240px; border-radius: 8px; margin-top: 6px; background: #111; object-fit: contain; }
#entryBtn { margin-left: auto; }
.danger-zone { border: 1px solid var(--red); margin-top: 24px; }
.danger-zone h3 { color: var(--red); }
/* folded Setup cards (places, audit log): closed until asked */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: var(--muted); transition: transform .15s ease-out; display: inline-block; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h3 { margin: 0; display: inline; }
details.fold[open] > summary { margin-bottom: 10px; }

/* Logins tab: media houses (media.js) */
.media-houses { margin: 0 0 12px; padding-left: 18px; }
.media-houses li { margin: 2px 0; }
