:root {
  --bg: #f4f6f8; --card: #ffffff; --text: #16202b; --muted: #5b6875; --line: #dde3e9;
  --accent: #0b6bcb; --accent-2: #19a974; --warn: #b35c00; --bad: #c62828;
  --radius: 14px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f151b; --card: #17202a; --text: #e8eef4; --muted: #9aa8b5; --line: #263341;
    --accent: #4da3ff; --accent-2: #3fcf95; --warn: #f0a24b; --bad: #ff6b6b; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { padding: 16px; }
.st { max-width: 620px; margin: 0 auto; display: grid; gap: 16px; }
.st-head h1 { font-size: 1.5rem; margin: 4px 0; }
.st-sub, .st-hint { color: var(--muted); margin: 0; font-size: 0.92rem; }
.st-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.st-card h2 { font-size: 1.1rem; margin: 0 0 8px; }
.st-gauge { position: relative; max-width: 320px; margin: 0 auto; }
.st-gauge svg { width: 100%; display: block; }
.st-arc-bg, .st-arc { fill: none; stroke-width: 14; stroke-linecap: round; }
.st-arc-bg { stroke: var(--line); }
.st-arc { stroke: var(--accent); stroke-dasharray: 0 100; transition: stroke-dasharray 0.2s linear; }
.st-arc.up { stroke: var(--accent-2); }
.st-gauge-value { position: absolute; left: 0; right: 0; top: 48%; text-align: center; }
.st-gauge-value span:first-child { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-unit { margin-left: 6px; color: var(--muted); }
.st-phase { text-align: center; color: var(--muted); margin-top: 4px; min-height: 1.4em; }
.st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.st-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.st-tile strong { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.st-label { font-size: 0.8rem; color: var(--muted); }
.st-start { width: 100%; padding: 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: 1.05rem; cursor: pointer; }
.st-start:disabled { opacity: 0.6; cursor: default; }
.st-error { color: var(--bad); margin: 10px 0 0; }
.st-verdict { font-weight: 600; margin: 0 0 12px; }
.st-verdict.ok { color: var(--accent-2); }
.st-verdict.warn { color: var(--warn); }
.st-verdict.bad { color: var(--bad); }
.st-facts { margin: 0; display: grid; gap: 8px; }
.st-facts div { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 12px; }
.st-facts dt { color: var(--muted); }
.st-facts dd { margin: 0; overflow-wrap: anywhere; }
.st-notes { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.st-notes li { margin: 4px 0; }
.st-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.st-link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.st-history { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.st-history button { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: none; color: inherit;
  font: inherit; font-size: 0.9rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.st-history .st-when { color: var(--muted); }
@media (max-width: 480px) {
  body { padding: 8px; }
  .st-card { padding: 14px; }
  .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-history button { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
