:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --text: #1f1e1b;
  --text-2: #6b6a63;
  --text-3: #9b9a92;
  --border: rgba(0, 0, 0, 0.1);
  --info: #185fa5;
  --info-bg: #e6f1fb;
  --warn: #854f0b;
  --warn-bg: #faeeda;
  --good: #0f6e56;
  --bad: #a32d2d;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b18;
    --surface: #262521;
    --surface-2: #2f2e2a;
    --text: #f1efe8;
    --text-2: #b4b2a9;
    --text-3: #888780;
    --border: rgba(255, 255, 255, 0.12);
    --info: #85b7eb;
    --info-bg: #0c447c;
    --warn: #fac775;
    --warn-bg: #633806;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
h2 { font-size: 16px; font-weight: 500; margin: 0; }
h3 { font-size: 13px; font-weight: 500; margin: 0 0 8px; color: var(--text-2); }
.muted { color: var(--text-3); font-size: 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 0.5px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--info-bg);
  color: var(--info); display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 14px;
}
.brand-title { font-size: 16px; font-weight: 500; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
select, button {
  font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 8px;
  border: 0.5px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer;
}
button:hover, select:hover { background: var(--surface-2); }

.banner {
  margin: 16px 24px 0; padding: 10px 14px; border-radius: 8px;
  background: var(--warn-bg); color: var(--warn); font-size: 13px;
  display: flex; gap: 8px; align-items: center;
}
.banner[hidden] { display: none; }

.tabs {
  display: flex; gap: 4px; padding: 0 24px; border-bottom: 0.5px solid var(--border);
  background: var(--surface); position: sticky; top: 67px; z-index: 4;
}
.tab {
  border: none; background: none; border-radius: 0; padding: 12px 16px;
  font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent;
}
.tab:hover { background: var(--surface-2); }
.tab.active { color: var(--text); border-bottom-color: var(--info); }
main[hidden] { display: none; }

.audit-score-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.audit-score-num { font-size: 44px; font-weight: 500; line-height: 1; }
.audit-cat { background: var(--surface-2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.audit-cat-top { display: flex; align-items: center; gap: 12px; }
.audit-cat-bar { flex: 1.3; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.audit-cat-bar > div { height: 100%; }
.badge { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 5px; }
.badge.high, .badge.crit { background: #fcebeb; color: #a32d2d; }
.badge.med { background: #faeeda; color: #854f0b; }
.fix-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 0.5px solid var(--border); }
.reco-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.reco-list li { margin-bottom: 6px; }
.tag-win { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #e1f5ee; color: #0f6e56; }
.tag-weak { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #faeeda; color: #854f0b; }
.ov-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 4px; }
.ov-bar > div { height: 100%; }
.banner.ok { background: #e1f5ee; color: #0f6e56; }
@media (prefers-color-scheme: dark) { .banner.ok { background: #085041; color: #9fe1cb; } }
.rating { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.r-good { background: #e1f5ee; color: #0f6e56; }
.r-fair { background: #eaf3de; color: #3b6d11; }
.r-needs { background: #faeeda; color: #854f0b; }
.r-poor { background: #fae0d3; color: #993c1d; }
.r-critical { background: #fcebeb; color: #a32d2d; }
.r-nodata { background: var(--surface-2); color: var(--text-3); }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 0.5px solid var(--border); }
.dir-up { color: #0f6e56; }
.dir-down { color: #a32d2d; }
.heat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.heat-cell { aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: #1f1e1b; position: relative; }
.heat-cell .hh { font-weight: 500; font-size: 11px; }
.heat-cell.empty { background: var(--surface-2); color: var(--text-3); }
.heat-cell .star { position: absolute; top: 2px; right: 4px; font-size: 10px; }
.reco-card { padding: 8px 0; border-top: 0.5px solid var(--border); }
.reco-card:first-child { border-top: none; }
.reco-card .w { font-size: 13px; font-weight: 500; }
.wrap { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; max-width: 1200px; margin: 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.kpi .label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.kpi .value { font-size: 24px; font-weight: 500; }
.kpi .delta { font-size: 12px; margin-top: 4px; color: var(--text-3); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

.panel {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-box { position: relative; height: 280px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.break-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 0.5px solid var(--border); }
th { color: var(--text-3); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.status { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.status.active { background: var(--info-bg); color: var(--info); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 0; color: var(--text-3); font-size: 13px; text-align: center;
}
.empty .big { font-size: 26px; }
.foot {
  display: flex; justify-content: space-between; padding: 16px 24px;
  color: var(--text-3); font-size: 12px; border-top: 0.5px solid var(--border); margin-top: 8px;
}
