:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e8ef;
  --accent: #4f46e5;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
body::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--accent);
}
h1, h2, h3, p { margin: 0; }
button, select { font: inherit; color: inherit; }
code, pre, .file, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px 20px 28px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.brand { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 750; letter-spacing: -0.04em; flex: none;
}
h1 { font-size: 22px; letter-spacing: -0.03em; line-height: 1.15; }
.tagline { margin-top: 3px; color: var(--muted); font-size: 14px; }
.header-side { text-align: right; flex: none; }
.portfolio { color: var(--accent); font-weight: 650; text-decoration: none; font-size: 14px; }
.portfolio:hover { text-decoration: underline; }
.source-note { margin-top: 3px; color: #94a3b8; font-size: 12px; }
.banner, .hint, .section-lead, .note {
  color: #312e81; background: #eef2ff; border: 1px solid #e0e7ff; border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 10px 12px; font-size: 13.5px;
}
.banner { margin-top: 14px; }
.hint, .section-lead { margin: 12px 0 0; background: transparent; border: 0; border-left: 0; color: var(--muted); padding: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tab, .text-btn, .filter, .file, .host-jump {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.tab.active, .filter.active, .file.active, .host-jump.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.text-btn { margin-top: 8px; color: var(--accent); font-weight: 650; }
.kpis, .cards, .host-layout, .play-layout { display: grid; gap: 10px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat, .card, .snippet-card, .check, .live-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.stat { padding: 10px 12px; }
.stat-label, .section-label, .sev, .role-label {
  display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.section-label { margin: 16px 0 8px; }
.stat-value { display: block; margin-top: 2px; font-size: 20px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-value.ok, .score.ok, .delta.ok { color: var(--ok); }
.stat-value.warn, .score.warn { color: var(--warn); }
.stat-value.bad, .score.bad { color: var(--bad); }
.live-strip { margin-top: 12px; padding: 12px 14px; border-left: 4px solid var(--accent); }
.own-server code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
pre.example {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
  max-height: 220px;
}
.live-top, .card-kicker, .scoreline, .check-top, .detail-head, .snippet-bar, .filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.live-top h2, .detail-head h2 { font-size: 16px; }
.live-host, .org, .os, .lift, .note, .expect { color: var(--muted); font-size: 13px; }
.note { margin-top: 6px; background: transparent; border: 0; padding: 0; color: var(--muted); }
.host-card {
  display: block; width: 100%; text-align: left; padding: 12px 14px; cursor: pointer;
}
.host-card:hover { border-color: #c7d2fe; }
.host-card h3 { margin-top: 8px; font-size: 15px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.org { margin-top: 2px; }
.score { font-variant-numeric: tabular-nums; font-weight: 750; }
.score.before { color: var(--muted); font-size: 16px; }
.score.after { font-size: 28px; letter-spacing: -0.04em; }
.scoreline { margin-top: 8px; }
.arrow { color: #94a3b8; }
.delta { font-size: 12px; font-weight: 700; background: #ecfdf3; border-radius: 999px; padding: 2px 8px; }
.delta.bad { background: #fef2f2; color: var(--bad); }
.track { display: block; width: 100%; height: 8px; margin-top: 8px; }
.lift { margin-top: 8px; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 8px;
  font-size: 12px; font-weight: 700; line-height: 1.5; text-transform: lowercase;
}
.pill.ghost { background: #f1f5f9; color: #475569; text-transform: none; }
.pill.info { background: #eef2ff; color: var(--accent); text-transform: none; }
.pill.pass, .pill.ok { background: #ecfdf3; color: var(--ok); }
.pill.fail, .pill.bad { background: #fef2f2; color: var(--bad); }
.pill.warn { background: #fffbeb; color: var(--warn); }
.pill.unknown { background: #f1f5f9; color: #475569; }
.role { margin-left: auto; color: var(--muted); font-size: 12px; }
.host-layout { grid-template-columns: 220px minmax(0, 1fr); margin-top: 14px; align-items: start; }
.host-select-label { display: none; }
.host-select { display: none; width: 100%; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.host-nav { display: flex; flex-direction: column; gap: 6px; }
.host-jump { border-radius: 10px; text-align: left; }
.detail-head { justify-content: space-between; }
.links { display: flex; gap: 12px; flex-wrap: wrap; }
.links a { color: var(--accent); font-weight: 650; font-size: 13px; }
.story { margin: 8px 0; color: #334155; }
.cat { margin-top: 14px; }
.cat h3 { font-size: 13px; margin-bottom: 8px; }
.check { padding: 10px 12px; margin-top: 8px; }
.check.changed { border-left: 4px solid var(--accent); }
.check-top strong { font-size: 14px; }
.sev { letter-spacing: 0.04em; }
.expect, .rem, .roleline { margin-top: 4px; font-size: 13px; color: #334155; }
.roleline { color: var(--muted); }
.play-layout { grid-template-columns: 280px minmax(0, 1fr); margin-top: 12px; align-items: start; }
.file-list { display: flex; flex-direction: column; gap: 4px; max-height: 640px; overflow: auto; }
.file {
  border-radius: 8px; text-align: left; font-size: 12px; padding: 6px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.snippet-card { min-width: 0; }
.snippet-bar { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
pre {
  margin: 0; padding: 12px; overflow: auto; max-height: 640px; font-size: 12.5px; line-height: 1.5; white-space: pre;
}
.cmt { color: #64748b; }
.key { color: #4338ca; }
.val { color: #0f172a; }
.detail-card { padding: 14px; }
.gauge { width: 88px; height: 88px; flex: none; }
.gauge-label { font-size: 15px; font-weight: 750; fill: var(--ink); }
.pair { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.mini { font-size: 12px; color: var(--muted); }
.check p, .expect, .rem, .story, .live-host { overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 8px 0; }
footer { margin-top: 22px; color: #94a3b8; font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .host-layout, .play-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 12px 14px 24px; }
  .top { flex-direction: column; }
  .header-side { text-align: left; }
  .kpis, .cards { grid-template-columns: 1fr 1fr; }
  .score.after { font-size: 24px; }
  .host-nav { display: none; }
  .host-select, .host-select-label { display: block; }
  .host-select-label { margin-bottom: 4px; }
  pre { max-height: 420px; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
}
