:root {
  --bg: #f4f6f8; --panel: #ffffff; --ink: #17212b; --muted: #5d6b78; --line: #dde3e9;
  --accent: #184e77; --accent-ink: #ffffff; --accent-soft: #e3eef7;
  --high: #b3261e; --high-soft: #fbe9e7; --medium: #9a5b00; --medium-soft: #fff4e0;
  --low: #35607f; --low-soft: #eaf2f8; --ok: #1e7b3a; --ok-soft: #e6f4ea;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161b; --panel: #1a2128; --ink: #e6ebf0; --muted: #9aa8b5; --line: #2c3640;
    --accent: #6fb1e3; --accent-ink: #0b1620; --accent-soft: #1d3346;
    --high: #ff8a80; --high-soft: #3a1d1b; --medium: #ffc76b; --medium-soft: #3a2c12;
    --low: #9cc7e6; --low-soft: #1b2a36; --ok: #7fd49a; --ok-soft: #173222; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.steps li { padding: 4px 12px; border-radius: 999px; color: var(--muted); font-size: 13px; border: 1px solid var(--line); }
.steps li.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps li.done { color: var(--ok); border-color: var(--ok); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 96px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, .btn { font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 16px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--high); border-color: var(--high); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=password], input[type=search], select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 0; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.high { background: var(--high-soft); color: var(--high); }
.badge.medium { background: var(--medium-soft); color: var(--medium); }
.badge.low, .badge.info { background: var(--low-soft); color: var(--low); }
.checks { list-style: none; padding: 0; margin: 12px 0; }
.checks li { padding: 4px 0; display: flex; gap: 8px; }
.checks .fix { color: var(--muted); font-size: 13px; }
.device h3 { margin: 0; font-size: 18px; }
.cat { margin-top: 20px; }
.cat h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.app { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.app:first-of-type { border-top: 0; }
.app .name { font-weight: 600; }
.app .pkg { font-size: 12px; color: var(--muted); word-break: break-all; }
.app .note { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.side { position: sticky; top: 16px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .side { position: static; } }
.impact { list-style: none; margin: 0; padding: 0; }
.impact li { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; }
.impact li.high { background: var(--high-soft); }
.impact li.medium { background: var(--medium-soft); }
.impact li.low, .impact li.info { background: var(--low-soft); }
.impact b { display: block; margin-bottom: 2px; }
.presets { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 8px; }
.preset { text-align: left; padding: 12px; }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.preset b { display: block; }
.footer-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 24px; display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
#toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; }
#toast .toast-close { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; padding: 0 2px; cursor: pointer; opacity: .8; }
#toast .toast-close:hover { opacity: 1; }
.log { list-style: none; padding: 0; }
.log li { padding: 6px 0; }
.empty { text-align: center; padding: 48px 16px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
label.field { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 600; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.feature { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.feature:first-of-type { border-top: 0; }
@media print { .top, .footer-bar, button { display: none !important; } body { background: #fff; } }
.footer-bar .unsaved { margin-right: auto; color: var(--medium); font-size: 14px; }
.panel.notice { border-color: var(--accent); margin-bottom: 16px; }
.filter-opts { margin: 0 0 8px 56px; }
.filter-opts select { max-width: 100%; }
.filter-opts textarea { font: inherit; font-weight: 400; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); resize: vertical; }
.filter-opts textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.engine-pick input[type=radio] { width: 20px; height: 20px; margin: 2px 12px 0 12px; accent-color: var(--accent); }
.engine-pick input[type=radio]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* The Station's back-office menu (office.js) */
.menu { display: flex; gap: 2px; flex-wrap: wrap; }
.menu:empty { display: none; }
.menu button { border: 0; background: none; padding: 6px 12px; color: var(--muted); font-weight: 600; }
.menu button.on { background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 24px; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }
h3.sub { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 4px; }
table.records { width: 100%; border-collapse: collapse; }
table.records th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.records td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.records tbody tr:hover { background: var(--accent-soft); }
textarea.notes { font: inherit; font-weight: 400; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); resize: vertical; }
