:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #16191d;
  --muted: #5d6673;
  --accent: #2f5bd3;
  --accent-soft: #e6ecfb;
  --high: #1d8a4e;
  --high-soft: #e3f4ea;
  --medium: #b26a00;
  --medium-soft: #fbefdc;
  --low: #6b7280;
  --low-soft: #eef0f3;
  --danger: #c0352b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --border: #2a2f39;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --accent: #7d9cff;
    --accent-soft: #1f2a4a;
    --high: #4cc785;
    --high-soft: #15301f;
    --medium: #f0a84a;
    --medium-soft: #36280f;
    --low: #9aa3b2;
    --low-soft: #232832;
    --danger: #ff7a70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

header.top {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8a5cf6); color: #fff; font-size: 14px; font-weight: 700;
}
.brand small { color: var(--muted); font-weight: 500; }
nav.links { margin-left: auto; display: flex; gap: 4px; }
nav.links a {
  color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500;
}
nav.links a[aria-current="page"], nav.links a:hover { background: var(--surface-2); color: var(--text); }

.freshness { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--low); flex: none; }
.dot.ok { background: var(--high); }
.dot.warn { background: var(--medium); }

main { padding: 24px 0 64px; }
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.panel h2 { font-size: 15px; margin: 0 0 4px; }
.panel p.hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
aside.panel { position: sticky; top: 84px; }
@media (max-width: 860px) { aside.panel { position: static; } }

label { display: block; font-size: 13px; font-weight: 550; margin: 12px 0 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 label { margin-top: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-top: 18px; }

button {
  font: inherit; font-weight: 600; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  padding: 9px 16px;
}
button.primary { background: var(--accent); color: #fff; }
button.ghost { background: transparent; border-color: var(--border); color: var(--text); }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; margin-top: 18px; }

.summary { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; gap: 12px; flex-wrap: wrap; }
.summary h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.summary .meta { color: var(--muted); font-size: 13px; }

.empty {
  text-align: center; padding: 56px 24px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.results { display: grid; gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: 84px 1fr; gap: 18px;
  border-left: 4px solid var(--low);
}
.card.high { border-left-color: var(--high); }
.card.medium { border-left-color: var(--medium); }
@media (max-width: 560px) { .card { grid-template-columns: 1fr; } }

.gauge { display: grid; justify-items: center; gap: 6px; align-content: start; }
.ring {
  --p: 0; --c: var(--low);
  width: 72px; height: 72px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center;
}
.ring::before {
  content: ""; grid-area: 1 / 1; width: 56px; height: 56px; border-radius: 50%; background: var(--surface);
}
.ring span { grid-area: 1 / 1; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; z-index: 1; }
.gauge small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }

.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.high { background: var(--high-soft); color: var(--high); }
.badge.medium { background: var(--medium-soft); color: var(--medium); }
.badge.low { background: var(--low-soft); color: var(--low); }
.badge.kind { background: var(--accent-soft); color: var(--accent); }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chip {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); display: inline-flex; gap: 6px; align-items: center;
}
.chip b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.fact dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.foot code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

.notice {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px;
  background: var(--medium-soft); color: var(--text); border: 1px solid var(--border);
}
.notice.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }

.keybar { display: flex; gap: 8px; align-items: end; }
.keybar > div { flex: 1; }

.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 20px; text-align: center;
  color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.stat dt { font-size: 12px; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 20px; max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
