/* SCC Attendance — two looks in one sheet:
   • Count + sign-in: large print for ushers (Atkinson Hyperlegible, 20px base,
     dark borders, status in words + icon, never colour alone).
   • Past / Reports / Settings: denser admin pages (Inter, 14px, tabular numbers). */

@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --navy: #163A63;
  --navy-2: #1F4F86;
  --navy-soft: #E6EDF5;
  --gold: #F2D27A;
  --paper: #F7F5F0;
  --ink: #1B1F24;
  --ink-2: #3E4652;
  --line: #D9D4C7;
  --box: #6B7380;
  --ok: #1F6B3A;  --ok-bg: #E4F2E8;
  --warn: #8A3A12; --warn-bg: #FCEBDD;
  --note: #5A4210; --note-bg: #FBF1D9;
  --danger: #B4501F;

  --a-bg: #F4F5F7;
  --a-ink: #161B22;
  --a-ink-2: #555E6B;
  --a-line: #DDE1E7;
  --a-line-2: #E6E9EE;
  --a-field: #C9CED6;
  --a-head: #F7F8FA;
  --up: #1F7A45;
  --down: #B4501F;

  --serif-ui: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans-ui: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabbar-h: 0px;
  --rail-w: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* iOS blurs the page's background colour into the area behind the status bar
   (clock, battery). Navy here makes that blur match the header rather than
   showing the light page colour. */
html { background: var(--navy); }
body { font-family: var(--serif-ui); color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* ── SIGN IN ─────────────────────────────────────────────────────────────── */
/* Same scale as the Count screen: 17px text, 52px fields and button. */
#login-screen { min-height: 100vh; display: flex; justify-content: center; padding: 44px 20px 28px; background: var(--paper); }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 8px; }
.login-mark { width: 60px; height: 60px; border-radius: 16px; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.login-mark svg { width: 30px; height: 30px; }
.login-logo h1 { margin: 0; font-size: 26px; line-height: 1.15; color: var(--navy); }
.login-logo p { margin: 0; font-size: 17px; color: var(--ink-2); }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 17px; font-weight: 700; }
.login-field input { height: 52px; padding: 0 14px; font-size: 19px; font-weight: 400; background: #fff; border: 2px solid var(--box); border-radius: 10px; min-width: 0; }
/* 16px+ font on inputs stops iOS Safari from zooming the page on focus */
.login-field input:focus { outline: 3px solid var(--navy); outline-offset: 2px; border-color: var(--navy); }
.login-pw { display: flex; gap: 8px; }
.login-pw input { flex: 1; }
.login-show { flex: none; width: 80px; height: 52px; font-size: 16px; font-weight: 700; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 10px; }
.login-remember { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 17px; cursor: pointer; }
.login-remember input { width: 24px; height: 24px; margin: 0; accent-color: var(--navy); flex: none; }
.login-btn { height: 54px; font-size: 19px; font-weight: 700; color: #fff; background: var(--navy); border: none; border-radius: 12px; }
.login-btn:disabled { opacity: .7; cursor: progress; }
.login-error { min-height: 22px; font-size: 16px; font-weight: 700; color: var(--warn); text-align: center; }
.login-help { margin: 6px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); text-align: center; }

/* ── APP SHELL ───────────────────────────────────────────────────────────── */
#app { min-height: 100vh; }
body.has-tabs:not(.on-count) { background: var(--a-bg); }
body.has-tabs { --tabbar-h: 68px; }
.view { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }

#tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--a-line); padding-bottom: env(safe-area-inset-bottom, 0px); font-family: var(--sans-ui); }
#tabbar .rail-brand { display: none; }
#tabbar .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar-h); border: none; background: transparent; color: var(--a-ink-2); font-size: 12px; font-weight: 600; }
#tabbar .tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#tabbar .tab[aria-current="page"] { color: var(--navy); font-weight: 700; }
#tabbar .tab[aria-current="page"] svg { stroke-width: 2.4; }

@media (min-width: 1024px) {
  body.has-tabs { --tabbar-h: 0px; --rail-w: 220px; }
  .view { margin-left: var(--rail-w); }
  #tabbar { top: 0; right: auto; width: var(--rail-w); display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; background: var(--navy); border: none; }
  #tabbar .rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; color: #fff; font-size: 16px; font-weight: 700; }
  #tabbar .tab { flex-direction: row; justify-content: flex-start; gap: 10px; height: 44px; padding: 0 12px; border-radius: 8px; color: #D6E0EC; font-size: 15px; font-weight: 500; }
  #tabbar .tab svg { width: 18px; height: 18px; }
  #tabbar .tab[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
}

#offline-banner { position: sticky; top: 0; z-index: 60; display: none; padding: 8px 14px; background: var(--warn); color: #fff; font-family: var(--sans-ui); font-size: 14px; font-weight: 600; text-align: center; }
#offline-banner.show { display: block; }
body.on-count #offline-banner { display: none; } /* the count footer says it in words */

#error-toast { position: fixed; z-index: 1000; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%); max-width: 90vw; padding: 12px 18px; border-radius: 10px; background: var(--warn); color: #fff; font-size: 16px; font-weight: 700; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ── COUNT ───────────────────────────────────────────────────────────────── */
/* 17px base: still large print, with room to breathe. Number boxes stay at
   least 48px tall so they are easy to tap. */
.count-view { display: flex; flex-direction: column; font-size: 17px; background: var(--paper); }
.count-view > * { width: 100%; max-width: 600px; margin-left: auto; margin-right: auto; }
.count-top { position: sticky; top: 0; z-index: 20; }
/* Admins on a phone also have the tab bar pinned, so let their header scroll away. */
@media (max-width: 1023px) { body.has-tabs .count-top { position: static; } }
.count-header { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 12px 6px 16px; background: var(--navy); color: #fff; }
.count-brand { flex: 1; font-size: 16px; font-weight: 700; }
.count-role { padding: 3px 10px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.16); border-radius: 999px; }
.count-signout { min-height: 40px; padding: 0 12px; font-size: 15px; font-weight: 700; color: var(--navy); background: #fff; border: none; border-radius: 9px; }
.count-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; background: #fff; border-bottom: 2px solid var(--line); }
.count-date { margin: 0; font-size: 1.3em; line-height: 1.15; }
.count-past { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; font-size: .85em; font-weight: 700; color: var(--note); background: var(--note-bg); border-radius: 9px; }
.count-past button { min-height: 38px; padding: 0 10px; font-size: 15px; font-weight: 700; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 9px; }
.count-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; }
.att-svc { min-height: 58px; padding: 6px 4px; border-radius: 12px; background: #fff; color: var(--navy); border: 2px solid var(--box); line-height: 1.1; }
.att-svc b { display: block; font-size: 1.25em; }
.att-svc small { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 2px; font-size: .8em; font-weight: 700; }
.att-svc small svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.att-svc[aria-pressed="true"] { background: var(--navy); color: #fff; border: 3px solid var(--navy); }

.count-body { flex: 1; padding: 12px 14px; }
.count-hint { margin: 0 0 12px; font-size: .9em; line-height: 1.4; color: var(--ink-2); }
.count-empty { margin: 8px 0; font-size: 1em; line-height: 1.45; color: var(--ink-2); }
#att-counts { display: flex; flex-direction: column; gap: 12px; }
.att-section { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.att-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.att-head h2 { margin: 0; font-size: 1.1em; }
.att-head span { font-size: .85em; font-weight: 700; color: var(--ink-2); }
.att-copied { margin: 0; padding: 6px 10px; font-size: .8em; line-height: 1.35; color: var(--note); background: var(--note-bg); border-radius: 9px; }
.att-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.att-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.att-cell-label { font-size: .85em; font-weight: 700; color: var(--ink-2); }
.att-input { width: 100%; height: 1.95em; padding: 0; font-family: inherit; font-size: 1.45em; font-weight: 700; text-align: center; color: var(--ink); background: #fff; border: 2px solid var(--box); border-radius: 10px; }
.att-input:focus { outline: 3px solid var(--navy); outline-offset: 2px; border-color: var(--navy); }
.att-input.att-error { border-color: var(--danger); background: #FDF1EA; }
.att-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; }
.att-row { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid #ECE8DF; }
.att-head + .att-row, .att-copied + .att-row { border-top: none; padding-top: 0; }
.att-row-label { font-size: 1em; font-weight: 700; }
.att-stage { padding: 7px; text-align: center; font-size: .8em; font-weight: 700; letter-spacing: .08em; color: var(--navy); background: var(--navy-soft); border-radius: 9px; }
.att-map { display: grid; grid-template-columns: 4.4em repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; }
.att-map .att-col { font-size: .85em; font-weight: 700; color: var(--ink-2); text-align: center; }
.att-map .att-map-row { font-size: .95em; font-weight: 700; }
.att-facing { margin: 0; font-size: .8em; color: var(--ink-2); text-align: center; }

.count-footer { position: sticky; bottom: var(--tabbar-h); z-index: 20; display: flex; flex-direction: column; gap: 6px; padding: 8px 14px 10px; background: #fff; border-top: 2px solid var(--line); }
@media (min-width: 1024px) { .count-footer { bottom: 0; } }
.count-status { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 10px; font-size: .85em; font-weight: 700; border-radius: 9px; color: var(--ok); background: var(--ok-bg); }
.count-status svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.count-status.saving { color: var(--ink-2); background: #F1EFEA; }
.count-status.bad { color: var(--warn); background: var(--warn-bg); }
.count-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.count-total { padding: 6px 12px; font-size: .8em; font-weight: 700; color: var(--navy); background: var(--navy-soft); border-radius: 10px; }
.count-total.main { color: #fff; background: var(--navy); }
.count-total b { display: block; font-size: 1.8em; line-height: 1.1; }

/* ── ADMIN PAGES ─────────────────────────────────────────────────────────── */
.admin-view { background: var(--a-bg); color: var(--a-ink); font-family: var(--sans-ui); font-size: 14px; font-variant-numeric: tabular-nums; }
.admin-view :focus-visible, .modal :focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.page { max-width: 1120px; margin: 0 auto; padding: 24px clamp(12px, 3vw, 36px) 40px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 2px 0 0; }
.muted { color: var(--a-ink-2); }
.small { font-size: 13px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel.flush { padding: 0; gap: 0; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head p { margin: 2px 0 0; }
.panel-title { margin: 0; font-size: 16px; font-weight: 700; }
.panel-foot { display: flex; justify-content: center; padding: 12px; }
.sub-title { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; font-family: var(--sans-ui); font-size: 14px; font-weight: 600; border-radius: 8px; border: 1px solid var(--a-field); background: #fff; color: var(--navy); text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.export { background: #1D6B43; border-color: #1D6B43; color: #fff; }
.btn.export svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.danger { color: var(--down); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link, .link-row a { padding: 0; border: none; background: none; color: var(--navy-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.link-row { display: flex; flex-wrap: wrap; gap: 14px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--a-field); border-radius: 8px; }
.seg button { min-height: 34px; padding: 0 14px; border: none; border-radius: 6px; background: transparent; color: #2B3440; font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--navy); color: #fff; }
.seg.small { background: #F0F2F5; border-color: transparent; }
.seg.small button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.rep-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rep-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--a-ink-2); font-size: 13px; }
.rep-pick select, .rep-pick input, .inline-field select, .field input, .field select, .field textarea { min-height: 38px; padding: 0 10px; font-family: var(--sans-ui); font-size: 16px; color: var(--a-ink); background: #fff; border: 1px solid var(--a-field); border-radius: 8px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--a-ink-2); font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; }
.kpi .k-label { font-size: 12px; font-weight: 600; color: var(--a-ink-2); }
.kpi .k-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.kpi .k-delta { font-size: 12px; font-weight: 600; }
.kpi .k-delta.up { color: var(--up); }
.kpi .k-delta.down { color: var(--down); }
.kpi .k-delta.flat, .kpi .k-ly { color: var(--a-ink-2); font-weight: 500; font-size: 12px; }
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .k-value { font-size: 22px; }
}

.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; }
.chart-box.donut { width: 150px; height: 150px; flex: none; }
.donut-row { display: flex; align-items: center; gap: 18px; }
@media (max-width: 520px) { .chart-box.donut { width: 120px; height: 120px; } .donut-row { gap: 12px; } }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.legend-row { display: grid; grid-template-columns: 12px 1fr auto 3em; gap: 8px; align-items: center; }
.legend-row i, .keys i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend-row .pct { text-align: right; color: var(--a-ink-2); }
.keys { display: flex; gap: 12px; font-size: 12px; color: var(--a-ink-2); }
.keys span { display: inline-flex; align-items: center; gap: 5px; }
.keys i { width: 10px; height: 10px; border-radius: 2px; }

.svc-bar { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.svc-bar + .svc-bar { margin-top: 14px; }
.svc-bar-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; }
.svc-track { display: flex; gap: 2px; height: 18px; }
.svc-track span:first-child { background: var(--navy); border-radius: 3px 0 0 3px; }
.svc-track span:last-child { background: #C9A84C; border-radius: 0 3px 3px 0; }

.room { display: grid; grid-template-columns: 9em minmax(0, 1fr) 3em; gap: 10px; align-items: center; font-size: 13px; }
.room + .room { margin-top: 9px; }
.room-bar { height: 12px; border-radius: 3px; background: var(--navy); }
.room b { text-align: right; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-top: 1px solid var(--a-line-2); white-space: nowrap; }
.table thead th { border-top: none; background: var(--a-head); color: var(--a-ink-2); font-size: 12px; font-weight: 600; }
.table .num { text-align: right; }
.table tr.total th, .table tr.total td { border-top: 2px solid var(--a-field); font-weight: 700; }
.table .wrap { white-space: normal; }
.table td.actions { text-align: right; }
@media (max-width: 600px) { .table .hide-sm { display: none; } }
.table .empty { padding: 18px 10px; color: var(--a-ink-2); text-align: center; white-space: normal; }
.table a, .table .link { color: var(--navy-2); font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }
.badge { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 600; border-radius: 999px; color: #2B3440; background: #EEF0F3; }
.badge.admin { color: var(--navy); background: #E3EAF3; }
.badge.off { color: var(--a-ink-2); background: transparent; border: 1px dashed #8C95A3; }
.badge.note { color: #6B4A0E; background: var(--note-bg); border-radius: 4px; }
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter span { width: 80px; height: 6px; border-radius: 3px; background: #EEF0F3; overflow: hidden; }
.meter span i { display: block; height: 100%; background: var(--navy); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 7px 12px; font-size: 13px; font-weight: 600; color: #2B3440; background: #fff; border: 1px solid var(--a-field); border-radius: 999px; text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tile { padding: 12px 14px; background: var(--a-head); border-radius: 8px; }
.tile .t-label { font-size: 12px; font-weight: 600; color: var(--a-ink-2); }
.tile .t-value { font-size: 16px; font-weight: 700; }
.tile .t-sub { font-size: 12px; color: var(--a-ink-2); }
.tile .t-sub.ok { color: var(--up); font-weight: 600; }
.tile .t-sub.bad { color: var(--down); font-weight: 600; }
.recips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--a-field); border-radius: 8px; }
.recip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; font-size: 13px; background: #E3EAF3; border-radius: 999px; }
.recip button { width: 26px; height: 26px; padding: 0; border: none; background: transparent; font-size: 16px; line-height: 1; border-radius: 50%; }
.recips input { flex: 1 1 200px; min-width: 0; min-height: 32px; border: none; outline: none; font-family: var(--sans-ui); font-size: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field-label { font-size: 13px; font-weight: 600; }
.field textarea { min-height: 70px; padding: 8px 10px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
details.more { border-top: 1px solid var(--a-line-2); padding-top: 4px; }
details.more summary { min-height: 40px; display: flex; align-items: center; font-weight: 600; color: var(--navy-2); cursor: pointer; }
.msg { min-height: 18px; font-size: 13px; font-weight: 600; }
.msg.ok { color: var(--up); }
.msg.bad { color: var(--down); }

.switch-label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.slider { position: absolute; inset: 0; background: #8C95A3; border-radius: 13px; transition: .2s; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--navy); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* ── MODALS ──────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); }
.modal { width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 22px; background: #fff; border-radius: 14px; font-family: var(--sans-ui); font-size: 14px; color: var(--a-ink); }
.modal.wide { max-width: 560px; }
.modal-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.modal-actions .spacer { flex: 1; }
.alert { padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 8px; }
.cat-editor { max-height: 260px; overflow-y: auto; border: 1px solid var(--a-field); border-radius: 8px; }
.cat-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--a-line-2); font-size: 13px; }
.cat-item:first-child { border-top: none; }
.cat-item.off { color: var(--a-ink-2); background: var(--a-head); }
.cat-name { flex: 1; min-width: 0; }
.cat-role { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--a-ink-2); letter-spacing: .3px; }
.cat-item select { max-width: 150px; min-height: 30px; padding: 0 6px; font-size: 16px; border: 1px solid var(--a-field); border-radius: 6px; }
.cat-item .mv { min-width: 30px; min-height: 30px; padding: 0; border: 1px solid var(--a-field); border-radius: 6px; background: #fff; color: var(--a-ink-2); font-size: 11px; }
.cat-item .mv:disabled { opacity: .3; cursor: default; }
