:root { color-scheme: dark; --fg: #fff; --dim: #9aa0a6; --line: #2a2d31; --btn: #121417; --grid: #1c1f23; --ok: #34d27b; --raised: #ffc53d; --loud: #ff5c5c; --stale: #5f6368; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: var(--fg); }
.app { display: flex; flex-direction: column; min-height: 100%; max-width: 640px; margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { position: relative; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.status { display: inline-flex; align-items: center; color: var(--dim); font-size: 15px; }
.dot { width: 10px; height: 10px; border-radius: 5px; margin-right: 8px; background: var(--stale); }
.info { position: absolute; right: 0; width: 32px; height: 32px; border-radius: 16px; border: 1px solid var(--line); background: transparent;
  color: var(--dim); font-weight: 700; font-style: italic; cursor: pointer; }
.reading { flex: 1; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.numberRow { display: flex; align-items: flex-end; }
.number { font-size: clamp(88px, 34vw, 168px); line-height: 1; font-weight: 700; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.number.stale { color: var(--stale); }
.unit { color: var(--dim); font-size: clamp(22px, 8vw, 40px); font-weight: 600; margin: 0 0 0.35em 6px; }
.label { font-size: 20px; font-weight: 500; margin-top: 6px; min-height: 26px; }
.hint { color: var(--dim); font-size: 14px; line-height: 1.35; text-align: center; max-width: 320px; margin-top: 8px; }
.meter { width: 100%; }
.bar { position: relative; height: 14px; border-radius: 7px; background: var(--grid); overflow: hidden; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 7px; background: var(--ok); transition: width 0.12s linear; }
.max { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--fg); }
.scale { display: flex; justify-content: space-between; color: var(--stale); font-size: 11px; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.graph { display: block; width: 100%; height: 120px; border-bottom: 1px solid var(--line); }
.buttons { display: flex; justify-content: center; gap: 12px; padding-top: 14px; }
.buttons button, .round { min-height: 44px; min-width: 104px; padding: 0 20px; border-radius: 22px; border: 1px solid var(--line); background: var(--btn); font-size: 16px; cursor: pointer; }
.buttons button.on { border-color: var(--ok); color: var(--ok); }
.stats { display: flex; padding: 10px 0 6px; }
.stat { flex: 1; text-align: center; }
.statLabel { color: var(--dim); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.statValue { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet[hidden] { display: none; }
.card { max-width: 340px; text-align: center; }
.card h1 { font-size: 30px; margin: 0 0 8px; }
.card p { color: var(--dim); font-size: 17px; line-height: 1.4; margin: 0 0 22px; }
.primary { min-height: 52px; min-width: 180px; padding: 0 28px; border-radius: 26px; border: 0; background: var(--ok); color: #000; font-size: 19px; font-weight: 700; cursor: pointer; }
.small { color: var(--dim); font-size: 13px; }
.card .small { margin-top: 22px; font-size: 15px; }
a { color: var(--dim); }
dialog { max-width: 380px; width: calc(100% - 48px); background: #111316; color: var(--fg); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog h2 { margin: 0 0 4px; font-size: 24px; }
dialog p { color: var(--dim); font-size: 15px; line-height: 1.4; }
dialog a { color: #6aa8ff; }
dialog .primary { display: block; margin: 18px auto 0; }
.calRow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calText { flex: 1; }
.round { min-width: 44px; width: 44px; padding: 0; font-size: 22px; font-weight: 600; }
.round:disabled { opacity: 0.4; }
#calValue { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
