:root {
  --bg: #f5f6f4; --surface: #ffffff; --surface2: #f0f2ef; --ink: #1b2420; --muted: #66716b; --line: #dfe3df;
  --accent: #0f6e5c; --accent-ink: #ffffff; --accent-soft: #e2f1ec;
  --pass: #1f7a4d; --pass-bg: #e3f3ea; --warn: #9a6200; --warn-bg: #fdf1d8; --fail: #b3261e; --fail-bg: #fbe4e2; --na: #6b7280; --na-bg: #eef0f1;
  --bar: #0f6e5c; --bar2: #b9c7c1; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513; --surface: #181d1a; --surface2: #1f2622; --ink: #e7ece9; --muted: #95a29b; --line: #2b332f;
    --accent: #4cc3a5; --accent-ink: #0b1210; --accent-soft: #173029;
    --pass: #5fd39a; --pass-bg: #163225; --warn: #f0b552; --warn-bg: #352812; --fail: #ff8a80; --fail-bg: #3a1a18; --na: #9aa3ad; --na-bg: #232a2e;
    --bar: #4cc3a5; --bar2: #3a4641; --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
h2 { font-size: 18px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 10px; } h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; } code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.topbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; gap: 10px; align-items: center; } .brand b { display: block; font-size: 15px; } .brand small { color: var(--muted); font-size: 12px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.controls label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 3px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-height: 32px; }
textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
#mat { width: 130px; }
.btn { font: inherit; font-weight: 550; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); border-radius: 7px; padding: 6px 12px; min-height: 32px; cursor: pointer; }
.btn:hover { filter: brightness(.97); } .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; } .btn.sm { min-height: 26px; padding: 3px 9px; font-size: 12px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; background: none; border: 0; padding: 11px 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.status { margin: 12px 20px 0; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.status.err { background: var(--fail-bg); color: var(--fail); }
main { padding: 18px 20px 60px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; } .tab.on { display: block; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; color: var(--muted); } .kpi-value { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
tr.flag td { background: color-mix(in srgb, var(--warn-bg) 60%, transparent); }
.pill { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.pill.pass { background: var(--pass-bg); color: var(--pass); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.fail { background: var(--fail-bg); color: var(--fail); } .pill.na { background: var(--na-bg); color: var(--na); }
.ev { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: var(--surface2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-right: 3px; cursor: help; white-space: nowrap; }
.score-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { transform: rotate(-90deg); } .ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .lbl b { font-size: 34px; line-height: 1; } .ring .lbl span { font-size: 12px; color: var(--muted); }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; flex: 1; }
.area-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); cursor: pointer; }
.area-tile .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .area-tile .nm { font-weight: 600; font-size: 13px; }
.area-tile .sc { font-weight: 700; font-variant-numeric: tabular-nums; } .area-tile .asc { font-size: 11px; color: var(--muted); }
.meter { height: 6px; background: var(--surface2); border-radius: 99px; margin-top: 7px; overflow: hidden; } .meter > i { display: block; height: 100%; border-radius: 99px; }
.findings li { margin-bottom: 8px; } .findings { padding-left: 0; list-style: none; margin: 0; }
.finding { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); } .finding:last-child { border: 0; }
.finding .t { font-weight: 600; } .finding .d { color: var(--muted); font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 6px; } .barrow { display: grid; grid-template-columns: 110px 1fr 100px; gap: 8px; align-items: center; font-size: 13px; }
.barrow .track { height: 14px; background: var(--surface2); border-radius: 4px; overflow: hidden; } .barrow .track i { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.barrow .v { text-align: right; font-variant-numeric: tabular-nums; }
.area-block { margin-bottom: 14px; } .area-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.field input, .field select { width: 100%; }
.copyrow { display: flex; gap: 8px; align-items: center; background: var(--surface2); border-radius: 7px; padding: 6px 8px; margin: 6px 0 12px; } .copyrow code { flex: 1; overflow-wrap: anywhere; }
.memo { max-width: 860px; line-height: 1.6; } .memo h1 { font-size: 22px; } .memo h2 { font-size: 18px; margin-top: 22px; } .memo h3 { margin-top: 16px; }
.memo table { margin: 10px 0; } .memo code { background: var(--surface2); padding: 0 4px; border-radius: 4px; }
.dim { display: grid; grid-template-columns: 1fr 50px; gap: 6px 12px; align-items: center; margin-bottom: 10px; }
.dim .meter { grid-column: 1 / -1; margin-top: 0; }
.issues li { margin-bottom: 4px; font-size: 13px; }
.panel .panel-wrap { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr 1fr; } .topbar { padding: 12px 16px; } main { padding: 14px 16px 40px; } .barrow { grid-template-columns: 80px 1fr 80px; } }
@media print {
  .topbar, .tabs, .status, .noprint { display: none !important; }
  body { background: #fff; color: #000; } .tab { display: none !important; } .tab.print-on { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
[hidden] { display: none !important; }
input[type=checkbox] { min-height: 0; padding: 0; vertical-align: -2px; margin: 0 6px 0 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
