/* Admin theme: warm neutral surfaces, brand blue chrome, red active marker. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/sourcesans3/v19/nwpStKy2OAdR1K-IwhWudF-R3w8aZQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-base: #faf9f6;
  --surface-1: #fff;
  --surface-2: #f7f4ee;
  --surface-3: #f3f0ea;
  --border-subtle: #ece8e1;
  --border-default: #d9d4cc;
  --border-strong: #b5aea4;
  --text-primary: #2a2622;
  --text-secondary: #4a443d;
  --text-tertiary: #8a8279;
  --text-disabled: #b5aea4;
  --brand-blue: #1f4f82;
  --brand-blue-dark: #163a60;
  --brand-blue-soft: #eaf1f9;
  --brand-red: #d9333a;
  --brand-green: #1e7a45;
  --success: #1e7a45;
  --success-soft: #dff1e6;
  --warning: #b07a12;
  --warning-soft: #fbf1dc;
  --danger: #b3262c;
  --danger-soft: #f9e0e1;
  --priority-4: #8a8279;
  --font-sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-lg: 8px;
  --gutter: 24px;
  --max: 1440px;

  /* legacy names still used by a few views */
  --bg: var(--bg-base);
  --fg: var(--text-primary);
  --muted: var(--text-tertiary);
  --line: var(--border-default);
  --accent: var(--brand-blue);
  --ok: var(--success);
  --warn: var(--warning);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 16px/1.45 var(--font-sans); color: var(--text-primary); background: var(--bg-base); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--brand-blue-dark); text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--border-default); }
h3 { font-size: 17px; font-weight: 600; margin-top: 20px; }
code, pre, .mono, .num { font-variant-numeric: tabular-nums; }
code { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
pre { background: var(--surface-3); border: 1px solid var(--border-default); padding: 12px 14px; overflow: auto; border-radius: var(--radius); font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.muted { color: var(--text-tertiary); }
.error { color: var(--danger); }
.small { font-size: 13px; }
.wrap { word-break: break-all; }
.full { width: 100%; }
.push-right { margin-left: auto; }
.inline { display: inline; }
.inline-label { display: inline-block; margin-right: 10px; color: var(--text-tertiary); font-size: 14px; }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* ---- header ---- */
header.top { background: var(--brand-blue); color: #fff; position: relative; z-index: 30; }
.brand-row { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 20px; min-height: 96px; padding: 0 var(--gutter); }
.seal { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); position: relative; top: 22px; }
.seal img { width: 92px; height: 92px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text .name { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text .tagline { font-size: 15px; color: #c8d8ea; }
.search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; width: 380px; max-width: 40vw; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius-lg); color: #dbe6f2; }
.search:focus-within { background: rgba(255, 255, 255, 0.18); }
.search input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: #fff; font: inherit; font-size: 15px; padding: 0; }
.search input::placeholder { color: #c8d8ea; }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.whoami { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; white-space: nowrap; font-size: 15px; }
.whoami form button { background: none; border: none; color: #c8d8ea; font: inherit; font-size: 14px; padding: 0; cursor: pointer; }
.whoami form button:hover { color: #fff; text-decoration: underline; }
nav.modules { max-width: var(--max); margin: 0 auto; display: flex; align-items: stretch; gap: 2px; padding: 0 var(--gutter) 0 140px; overflow-x: auto; scrollbar-width: none; }
nav.modules a { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px; border-bottom: 3px solid transparent; color: #c8d8ea; font-size: 16px; font-weight: 600; white-space: nowrap; flex: none; border-radius: 6px 6px 0 0; }
nav.modules a:hover { color: #fff; text-decoration: none; }
nav.modules a.active { color: #fff; background: rgba(255, 255, 255, 0.08); border-bottom-color: var(--brand-red); }
nav.modules .count { font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--brand-red); color: #fff; }
nav.modules .count.warn { background: #f0c05a; color: #3d2f05; }
.live { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #dbe6f2; white-space: nowrap; }
.live.ok { background: rgba(255, 255, 255, 0.14); color: #d9f2e2; }
.live.warn { background: #f0c05a; color: #3d2f05; }
.live.danger { background: var(--brand-red); color: #fff; }

/* ---- page ---- */
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 44px var(--gutter) 32px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { font-size: 15px; color: var(--text-tertiary); margin: 2px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { height: 42px; padding: 0 16px; display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); color: var(--text-primary); font-size: 15px; font-weight: 600; }
.tabs a:hover { text-decoration: none; background: var(--surface-2); }
.tabs a.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }

/* ---- toolbar ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar form { display: contents; }
.toolbar .q { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; min-width: 260px; flex: 0 1 360px; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); }
.toolbar .q input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; padding: 0; font: inherit; font-size: 15px; height: auto; }
.toolbar select { height: 44px; max-width: 260px; }
.toolbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); color: var(--text-primary); font-size: 15px; white-space: nowrap; }
.chip.active { background: var(--brand-blue-soft); border-color: var(--brand-blue); color: var(--brand-blue); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); }
.chip .n { color: var(--text-tertiary); }

/* ---- cards & tables ---- */
.card { background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 20px 22px; }
.card.error { border-color: var(--danger); color: var(--danger); }
.card.ok { border-color: var(--success); }
.card.warn { border: 2px solid var(--warning); }
.card > h2:first-child { margin-top: 0; }
.table-card { background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
.table-card .scroll { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { height: 46px; padding: 0 14px; background: var(--surface-3); border-bottom: 1px solid var(--border-default); text-align: left; font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
td { padding: 0 14px; height: 48px; border-bottom: 1px solid var(--border-subtle); font-size: 15px; vertical-align: middle; }
tr:hover > td { background: var(--surface-2); }
tr.active > td:first-child { box-shadow: inset 4px 0 0 var(--brand-blue); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .name { font-weight: 600; }
.card table th { background: var(--surface-3); }
.card > .scroll { margin: 0 -22px; overflow-x: auto; }
.card > .scroll > table { min-width: 100%; }
.card > table { margin: 0 -22px; width: calc(100% + 44px); }
.empty { padding: 48px; text-align: center; color: var(--text-tertiary); }
.table-foot, .pagenav { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-top: 1px solid var(--border-default); background: var(--surface-3); font-size: 14px; color: var(--text-tertiary); flex-wrap: wrap; }
.pagenav a, .pagenav span:not(.muted):not(:first-child) { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--border-default); border-radius: var(--radius); background: #fff; color: var(--text-secondary); }
.pagenav a:hover { text-decoration: none; background: var(--surface-2); }
.pagenav > span.muted:first-child { flex: 1; border: none; background: none; padding: 0; }
.card .pagenav { margin: 12px -22px -20px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* status */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-disabled); margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--success); }
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-secondary); white-space: nowrap; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--brand-blue-soft); color: var(--brand-blue); }

/* ---- forms ---- */
label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 0; font-size: 14px; color: var(--text-tertiary); }
label.check, label:has(> input[type='checkbox']) { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; color: var(--text-primary); margin-top: 12px; }
input, select, textarea { height: 44px; padding: 0 12px; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); color: var(--text-primary); font: inherit; font-size: 15px; outline: none; }
textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px var(--brand-blue-soft); }
input[type='checkbox'] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-blue); cursor: pointer; height: 18px; padding: 0; }
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
[hidden] { display: none !important; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); color: var(--text-primary); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand-blue-dark); }
button.go { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
button.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.quiet { border-color: transparent; background: transparent; color: var(--text-tertiary); font-weight: 400; }
td button, td .btn { height: 34px; padding: 0 12px; font-size: 14px; }
.inline-form { display: inline; }
.inline button { height: 34px; padding: 0 12px; font-size: 14px; }
.actions-row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.actions-row.start { justify-content: flex-start; }
p > button.primary { margin-top: 4px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.grid > div > .card + .card { margin-top: 20px; }
.card.legacy { margin-bottom: 20px; }
/* Legacy logins list: fits the page width; long names, statuses and networks wrap instead of pushing the button off-screen. */
.legacy-table td { white-space: normal; vertical-align: middle; }
.legacy-table td.mono, .legacy-table td.num, .legacy-table td.actions-cell { white-space: nowrap; }
.legacy-table td .small { display: block; }
.legacy-table td .nowrap { white-space: nowrap; }
.legacy-table th:last-child, .legacy-table td:last-child { width: 1%; text-align: right; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.span-all { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 12px; min-height: 44px; align-items: center; border-bottom: 1px solid var(--border-subtle); font-size: 16px; }
.kv .k { font-size: 14px; color: var(--text-tertiary); }
.kv .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows > div { display: flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--border-subtle); font-size: 15px; }
.rows .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis button, .kpis a { display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%; height: 48px; padding: 0; background: transparent; border: none; border-bottom: 1px solid var(--border-subtle); border-radius: 0; color: var(--text-secondary); font-size: 16px; font-weight: 400; text-align: left; }
.kpis a:hover { color: var(--text-primary); background: transparent; text-decoration: none; }
.kpis .value { font-size: 20px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpis .value.ok { color: var(--success); }
.kpis .value.warn { color: var(--warning); }
.kpis .value.danger { color: var(--danger); }
.kpis .value.dim { color: var(--priority-4); }
.ping { position: relative; display: inline-block; width: 10px; height: 10px; }
.ping::before, .ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--success); }
.ping::after { animation: ping 1.6s infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-lg); background: #2a2622; color: #fff; font-size: 15px; }
.flash.error { background: var(--danger); }
.secret { border: 2px solid var(--warning); }
.secret code { display: block; padding: 14px; background: var(--surface-3); border-radius: var(--radius); font-size: 16px; word-break: break-all; color: var(--text-primary); }
.plan { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: 8px; }
.plan span { width: 5px; height: 14px; border-radius: 1px; background: var(--border-default); }
.plan span.on { background: var(--brand-green); }
.plan span.rx { background: var(--warning); }
details > summary { cursor: pointer; color: var(--brand-blue); font-weight: 600; margin: 8px 0; }

/* ---- sign-in and setup pages ---- */
.narrow { max-width: 420px; margin: 3rem auto; width: 100%; }
.narrow-wide { max-width: 560px; margin: 2rem auto; width: 100%; }
.narrow h1, .narrow-wide h1 { font-size: 24px; margin-bottom: 8px; }
.narrow .primary, .narrow-wide .primary { height: 50px; width: 100%; font-size: 17px; }
.qr { text-align: center; }
.qr img { background: #fff; padding: 8px; border: 1px solid var(--border-default); border-radius: var(--radius); }
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

@media (max-width: 900px) {
  :root { --gutter: 14px; }
  .brand-row { min-height: 72px; gap: 12px; }
  .seal { width: 56px; height: 56px; top: 0; box-shadow: none; }
  .seal img { width: 52px; height: 52px; }
  .brand-text .tagline, .whoami, .search .hint { display: none; }
  .brand-text .name { font-size: 20px; }
  .search { width: auto; max-width: none; flex: 1; }
  nav.modules { padding-left: var(--gutter); }
  main { padding-top: 20px; }
  h1 { font-size: 24px; }
}
.rows.plain { list-style: none; margin: 0; padding: 0; }
.rows.plain li { display: flex; gap: 12px; min-height: 40px; align-items: center; border-bottom: 1px solid var(--border-subtle); font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: pre; }
h2.mt { margin-top: 24px; }
h2 .ping { float: right; margin-top: 6px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 2rem auto 0; }
.login-brand img { width: 160px; height: 160px; border-radius: 50%; background: #fff; box-shadow: 0 20px 50px rgba(31, 79, 130, 0.25); margin-bottom: 10px; }
.login-brand span:first-of-type { font-size: 24px; font-weight: 700; }
.narrow { margin-top: 1rem; }
body:has(.login-brand) { background: linear-gradient(var(--brand-blue) 0, var(--brand-blue) 220px, var(--bg-base) 220px); }
.map { height: 360px; border: 1px solid var(--border-default); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
td, th { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 240px; max-width: 520px; }
details.json { display: inline-block; }
details.json summary { font-size: 14px; margin: 0; }
details.json pre { margin: 6px 0 10px; max-width: 520px; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
td .error { display: inline-block; max-width: 520px; white-space: normal; }
/* Tables that must fit the page: cells wrap, numbers and actions stay on one line. */
.fit-table td { white-space: normal; vertical-align: middle; }
.fit-table td.mono, .fit-table td.num, .fit-table td.actions-cell { white-space: nowrap; }
.fit-table td .badge { margin: 2px 0; }
.fit-table th:last-child, .fit-table td:last-child { width: 1%; text-align: right; }
/* Dispatcher detail: one block per network with its talkgroups as chips. */
.access-block { padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.access-block:last-child { border-bottom: 0; }
.access-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.access-block .chips { margin: 8px 0 0; line-height: 2; }
.fit-table td.actions-cell .btn, .fit-table td.actions-cell button { margin-left: 6px; }
dialog.confirm label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; }
dialog.confirm label input { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
dialog.confirm p.error { color: var(--danger); }
.fit-table td.nowrap { white-space: nowrap; }
.kv .v.warn { color: var(--warning); font-weight: 600; }
/* Audit log: the table fits the page and every recorded value is shown in full. */
.audit-table { table-layout: fixed; }
.audit-table th:nth-child(1) { width: 11%; }
.audit-table th:nth-child(2) { width: 13%; }
.audit-table th:nth-child(3) { width: 12%; }
.audit-table th:nth-child(4) { width: 14%; }
.audit-table th:nth-child(5) { width: 9%; }
.audit-table th:nth-child(6) { width: 7%; }
.audit-table th:nth-child(7) { width: 6%; }
.audit-table td { white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
.audit-table td.mono { white-space: normal; }
.audit-table td.details .error { display: block; max-width: none; margin-bottom: 6px; color: var(--danger); }
.audit-table td.details .small { margin-top: 4px; }
.audit-table td.details pre.json { margin: 2px 0 6px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; max-width: none; }
@media (max-width: 1100px) {
  .audit-table { table-layout: auto; }
}
main > * { min-width: 0; }
.grid > * { min-width: 0; }
.kv .v { white-space: normal; word-break: break-word; }
.icon { width: 18px; height: 18px; fill: currentColor; vertical-align: -4px; flex: none; }
.enc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.enc.on { color: var(--success); }
.enc.off { color: var(--warning); }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin-right: 6px; }
nav.modules a .icon { width: 18px; height: 18px; }
h2 .icon { width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px; color: var(--brand-blue); }
.btn .icon, button .icon { margin-right: 2px; }
.pagenav .icon { width: 18px; height: 18px; }
.toolbar .q .icon { width: 18px; height: 18px; color: var(--text-tertiary); }
.badge .icon { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }
.battery { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.battery .icon { width: 20px; height: 20px; }
.battery .shell { opacity: 0.3; }
.battery.ok { color: var(--success); }
.battery.mid { color: var(--warning); }
.battery.low { color: var(--danger); }
.battery .bolt { fill: #fff; }
.battery .pct { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.map-tools { margin: -4px 0 12px; }
.map-tools button { height: 34px; font-size: 14px; }
details.tech { margin-top: 20px; }
details.tech summary { color: var(--text-tertiary); font-weight: 400; font-size: 14px; }
details.advanced { margin-top: 16px; }
details.advanced > summary { display: inline-flex; align-items: center; gap: 4px; }
details.advanced[open] > summary { margin-bottom: 4px; }
.chooser-search { position: relative; }
.chooser-search .q { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); }
.chooser-search .q input { flex: 1; min-width: 0; border: none; outline: none; padding: 0; height: auto; font: inherit; font-size: 15px; background: transparent; }
.chooser-search .q .icon { width: 18px; height: 18px; color: var(--text-tertiary); }
.chooser-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--border-default); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(42, 38, 34, 0.18); max-height: 280px; overflow-y: auto; margin-top: 4px; }
.chooser-option { display: block; width: 100%; height: 42px; padding: 0 14px; border: none; border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: #fff; text-align: left; font-weight: 500; }
.chooser-option:hover, .chooser-option.active { background: var(--brand-blue-soft); color: var(--brand-blue); }
.chooser-none { padding: 12px 14px; color: var(--text-tertiary); font-size: 14px; }
.chooser-list { list-style: none; margin: 12px 0 0; padding: 0; }
.chooser-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius); background: #fff; margin-bottom: 6px; }
.chooser-item.dragging { opacity: 0.5; }
.chooser-item.over { border-color: var(--brand-blue); box-shadow: inset 0 3px 0 var(--brand-blue); }
.chooser-handle { cursor: grab; color: var(--text-disabled); letter-spacing: -2px; user-select: none; padding: 0 4px; }
.chooser-num { min-width: 24px; height: 24px; border-radius: 50%; background: var(--brand-blue); color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.chooser-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chooser-rx { margin: 0; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.chooser-btn { height: 32px; width: 32px; padding: 0; font-size: 12px; color: var(--text-secondary); }
.rows.events > div { min-height: 40px; font-size: 15px; }
.rows.events .ok { color: var(--success); }
.rows.events .warn { color: var(--warning); }
.rows.events .danger { color: var(--danger); }
.rows.events a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); }
.settings-section { margin-top: 14px; border-top: 1px solid var(--border-subtle); }
.settings-section > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary .icon { width: 18px; height: 18px; color: var(--text-tertiary); }
.settings-section > summary .count { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--text-tertiary); }
.settings-section label.unset { color: var(--text-tertiary); }
.settings-section label.unset input:not([type='checkbox']) { border-style: dashed; }
.settings-section textarea { font-size: 13px; }
.locked-list { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; }
.locked-list span { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.locked-list .icon { width: 18px; height: 18px; color: var(--success); }
.settings-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.settings-note form { margin: 0; }
dialog.confirm { border: none; border-radius: var(--radius-lg); padding: 24px 26px; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 24px 64px rgba(42, 38, 34, 0.3); color: var(--text-primary); }
dialog.confirm::backdrop { background: rgba(42, 38, 34, 0.55); }
dialog.confirm h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 20px; }
dialog.confirm h2 .icon { width: 24px; height: 24px; }
dialog.confirm p { margin: 0 0 8px; line-height: 1.5; }
dialog.confirm button.danger[type='submit'] { background: var(--danger); color: #fff; }
dialog.confirm.info h2 { color: var(--brand-blue); }
dialog.confirm .steps li { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
dialog.confirm .steps .badge { min-width: 64px; text-align: center; }
dialog.confirm button.danger[type='submit']:disabled { opacity: 0.45; cursor: not-allowed; }
.notice { padding: 14px 16px; border-radius: var(--radius); margin: 10px 0 14px; }
.notice.warn { background: var(--warning-soft); border: 1px solid var(--warning); }
.notice p { margin: 0 0 8px; }
.notice .icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.plain-list { list-style: none; padding: 0; margin: 6px 0 12px; }
.plain-list li { display: flex; align-items: center; gap: 8px; min-height: 30px; }
dialog.confirm button.primary[type='submit'] { background: var(--brand-blue); color: #fff; }
details.payload > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.payload > summary::-webkit-details-marker { display: none; }
details.payload > summary::before { content: 'B8'; color: var(--text-tertiary); font-size: 12px; }
details.payload[open] > summary::before { content: 'BE'; }
details.payload > pre.json { margin: 8px 0 4px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius); max-height: 360px; overflow: auto; white-space: pre; font-size: 12px; line-height: 1.45; }
.rows > div details.payload { display: block; }
