:root {
  --bg: #f4f6f5; --card: #ffffff; --ink: #14201f; --muted: #5d6b69; --line: #dfe5e3;
  --accent: #127a6d; --accent-2: #c7782b; --ok: #1f8a4c; --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1514; --card: #172120; --ink: #e6eeec; --muted: #9aaaa7; --line: #263432;
    --accent: #3fb8a6; --accent-2: #e09a52; --ok: #52c47f; --bad: #f2867e;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1514; --card: #172120; --ink: #e6eeec; --muted: #9aaaa7; --line: #263432;
  --accent: #3fb8a6; --accent-2: #e09a52; --ok: #52c47f; --bad: #f2867e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.wrap.narrow { max-width: 560px; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
a { color: var(--accent); }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pill { font-size: .8rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.hero { display: flex; gap: 18px; align-items: center; }
.gauge { width: 56px; height: 120px; border: 2px solid var(--line); border-radius: 12px; position: relative; overflow: hidden; flex: none; }
.gauge-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--accent); transition: height .6s; }
.big { font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.stat { margin: 0; }
.label { color: var(--muted); font-size: .8rem; }
.value { font-size: 1.4rem; font-weight: 650; }
.value.small { font-size: 1rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
summary { cursor: pointer; font-weight: 600; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; align-items: end; margin: 8px 0; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
input { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; }
.btn { font: inherit; padding: 8px 14px; border-radius: 8px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
canvas { max-width: 100%; }
ol li { margin: 6px 0; }
