:root {
  --bg: #f6f3ec;
  --panel: #fffdf8;
  --ink: #213128;
  --muted: #65746b;
  --line: #dcd5c8;
  --accent: #315c46;
  --accent-2: #e7efe7;
  --danger: #8f3a2f;
  --warn: #c27b2c;
  --ok: #315c46;
  --shadow: 0 14px 40px rgba(33, 49, 40, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top right, #eef5ee, transparent 30%), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  padding: 2.25rem clamp(1rem, 4vw, 4rem);
  background: linear-gradient(135deg, #23372d, #eef2e8);
  color: white;
}
h1, h2, h3 { margin: 0 0 .5rem; }
h1 { max-width: 960px; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; }
h2 { font-size: 1.2rem; }
h3 { margin-top: 1.5rem; }
.subhead { color: rgba(255,255,255,.9); max-width: 900px; font-size: 1.05rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; opacity: .85; margin-bottom: .5rem; }
.status-pill { padding: .5rem .8rem; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; white-space: nowrap; background: rgba(255,255,255,.14); }
main { padding: 1.25rem clamp(1rem, 4vw, 4rem) 4rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card.thin { padding: .8rem 1rem; }
.authority { border-left: 5px solid var(--accent); }
.authority p { margin-bottom: 0; color: var(--muted); }
.hidden { display: none !important; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1050px) { .grid.two, .grid.three { grid-template-columns: 1fr; } .topbar { flex-direction: column; } }
.login-row { display: grid; grid-template-columns: minmax(240px, 520px) auto; gap: .75rem; align-items: center; max-width: 780px; }
@media (max-width: 720px) { .login-row { grid-template-columns: 1fr; } }
.login-form { max-width: 640px; display: grid; gap: .4rem; }
.login-form label { font-weight: 800; color: var(--accent); margin-top: .35rem; }
.login-form input { margin-bottom: .4rem; }
.login-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: .35rem; }
.login-actions button { min-width: 140px; }

input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; font: inherit; background: white; color: var(--ink); margin-bottom: .65rem; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
button { border: 0; background: var(--accent); color: white; border-radius: 999px; padding: .75rem 1rem; cursor: pointer; font-weight: 700; min-height: 2.6rem; }
button.secondary { background: #6a756d; }
button.danger { background: var(--danger); }
button.small { padding: .4rem .65rem; font-size: .78rem; min-height: 2rem; }
button:disabled { opacity: .55; cursor: wait; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: .85rem 0 1rem; }
.button-row button { white-space: nowrap; }
.session-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #eef3ea; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.tab { background: white; color: var(--accent); border: 1px solid var(--line); }
.tab.active { background: var(--accent); color: white; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 1050px) { .filters { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: .7rem; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.badge { display: inline-block; padding: .25rem .5rem; border-radius: 999px; background: var(--accent-2); color: var(--accent); font-size: .75rem; font-weight: 700; }
.badge.warn { background: #fff3dd; color: #8c5516; }
.badge.danger { background: #fff1ef; color: #8f3a2f; }
.score { font-weight: 800; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: .5rem; }
.clean-list { padding-left: 1.1rem; color: var(--muted); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.result { background: #17211b; color: #d8eadc; padding: 1rem; border-radius: 14px; overflow-x: auto; min-height: 4rem; }
code { background: #eef0ea; padding: .15rem .3rem; border-radius: 6px; }
.doctor { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: #fbfcf8; margin-top: 1rem; }
.doctor.ok { border-left: 5px solid var(--ok); }
.doctor.warn { border-left: 5px solid var(--warn); }
.doctor ul { margin-top: .5rem; color: var(--muted); }
.notice { border-radius: 14px; padding: .85rem 1rem; margin: .75rem 0 1rem; border: 1px solid var(--line); background: #f3f4ee; }
.notice.ok { border-left: 5px solid var(--ok); background: #eef5ee; }
.notice.warn { border-left: 5px solid var(--warn); background: #fff7e8; }
.notice.error { border-left: 5px solid var(--danger); background: #fff1ef; color: #5c1f18; }
.notice.info { border-left: 5px solid var(--accent); background: #eef3ea; }
.kv { margin: .25rem 0; }
.contact-line { margin-bottom: .5rem; }
pre { white-space: pre-wrap; }
.integrity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .integrity { grid-template-columns: 1fr; } }
.banner { border-radius: 18px; padding: 1rem 1.1rem; border: 1px solid var(--line); background: #f8fbf5; }
.banner.degraded { border-left: 6px solid var(--warn); background: #fff8e9; }
.banner.active { border-left: 6px solid var(--ok); background: #edf6ed; }
.lead-card { border: 1px solid var(--line); border-radius: 16px; padding: .9rem; background: white; }
.metrics { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:1rem; margin:1rem 0; }
.metric { border:1px solid var(--line); border-radius:16px; padding:1rem; background:#fbfcf8; }
.metric strong { display:block; font-size:1.7rem; color:var(--ink); }
.metric span { color:var(--muted); font-size:.9rem; }
.score-xl { font-size:3rem; font-weight:800; letter-spacing:-.04em; }
.empty-state { border:1px dashed var(--line); border-radius:16px; padding:1.25rem; background:#fbfcf8; }
.card.thin ul { margin-top:.5rem; padding-left:1.1rem; }
.card.thin li { margin:.25rem 0; }
@media (max-width: 900px) { .metrics { grid-template-columns:1fr 1fr; } }
@media (max-width: 600px) { .metrics { grid-template-columns:1fr; } }
