:root {
  --pulse-bg:#0a1120; --pulse-bg-elevated:#0f1a30; --pulse-surface:#131f38; --pulse-surface-alt:#182645;
  --pulse-border:#253458; --pulse-text:#eef1f8; --pulse-text-muted:#93a0c2;
  --pulse-accent:#3aa0ff; --pulse-accent-strong:#6cc0ff;
  --pulse-status-connected:#34d399; --pulse-status-warning:#f2b84b; --pulse-status-error:#ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--pulse-bg); color:var(--pulse-text); font:16px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
a { color:var(--pulse-accent-strong); }
nav { display:flex; gap:4px; padding:6px 12px; background:var(--pulse-bg-elevated); border-bottom:1px solid var(--pulse-border); position:sticky; top:0; z-index:5; }
nav a { padding:10px 12px; text-decoration:none; color:var(--pulse-accent-strong); border-radius:8px; min-height:44px; }
nav a.right { margin-left:auto; color:var(--pulse-text-muted); }
h1 { font-size:1.4rem; margin:14px 0; } h2 { font-size:1.15rem; margin-top:24px; }
h3 { font-size:1rem; margin:14px 0 4px; color:var(--pulse-text-muted); }
.card { background:var(--pulse-surface); border:1px solid var(--pulse-border); border-radius:14px; padding:14px; margin:12px 0; }
.big { text-align:center; } .num { font-size:2.8rem; font-weight:700; } .num small { font-size:1rem; font-weight:400; color:var(--pulse-text-muted); }
.muted { color:var(--pulse-text-muted); } .err { color:var(--pulse-status-error); }
.flash { background:var(--pulse-surface-alt); border:1px solid var(--pulse-accent); padding:10px 14px; border-radius:10px; }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.row b { width:70px; }
input, button { font:inherit; min-height:44px; padding:10px 12px; border:1px solid var(--pulse-border); border-radius:10px; background:var(--pulse-bg-elevated); color:var(--pulse-text); }
input:focus { outline:2px solid var(--pulse-accent); outline-offset:0; }
.row input:not([type=checkbox]) { flex:1 1 120px; min-width:0; }
button { background:var(--pulse-accent); color:#fff; border:0; cursor:pointer; font-weight:600; padding:10px 18px; }
button:hover { background:var(--pulse-accent-strong); }
button.del { background:transparent; color:var(--pulse-status-error); border:1px solid var(--pulse-border); min-height:36px; padding:4px 10px; font-weight:400; }
.chk { display:flex; align-items:center; gap:6px; min-height:44px; } .chk input { min-height:0; width:20px; height:20px; padding:0; accent-color:var(--pulse-accent); }
.timeline { list-style:none; margin:0; padding:0; background:var(--pulse-surface); border:1px solid var(--pulse-border); border-radius:14px; }
.timeline li { display:flex; gap:8px; align-items:center; padding:8px 12px; border-bottom:1px solid var(--pulse-border); }
.timeline li:last-child { border-bottom:0; }
.timeline .t { width:48px; color:var(--pulse-text-muted); } .timeline .k { width:56px; font-size:.75rem; text-transform:uppercase; color:var(--pulse-text-muted); }
.timeline .v { flex:1; } .timeline form { margin:0; }
.timeline li.reading .v { font-weight:600; }
.tag { display:inline-block; padding:0 7px; border-radius:10px; font-size:.7rem; font-weight:600; background:rgba(242,184,75,.18); color:var(--pulse-status-warning); border:1px solid var(--pulse-status-warning); vertical-align:middle; }
.cheatmark { color:var(--pulse-status-warning); font-style:normal; font-weight:600; }
.ranges a { display:inline-block; padding:10px 14px; margin:0 6px 6px 0; border:1px solid var(--pulse-border); border-radius:22px; text-decoration:none; color:var(--pulse-accent-strong); }
.ranges a.on { background:var(--pulse-surface-alt); border-color:var(--pulse-accent-strong); font-weight:600; }
#chart svg { width:100%; height:auto; background:var(--pulse-surface); border:1px solid var(--pulse-border); border-radius:14px; }
#chart text { fill:var(--pulse-text-muted); font-size:11px; }
.tip { position:fixed; z-index:10; max-width:300px; background:var(--pulse-surface-alt); border:1px solid var(--pulse-border); border-radius:10px; padding:8px 12px; box-shadow:0 6px 18px rgba(0,0,0,.5); font-size:.9rem; pointer-events:none; }
table.doctor { width:100%; border-collapse:collapse; font-size:.9rem; background:var(--pulse-surface); }
table.doctor th, table.doctor td { border:1px solid var(--pulse-border); padding:6px 8px; text-align:left; vertical-align:top; }
.chg { color:var(--pulse-status-warning); font-weight:600; font-size:.8rem; }
.doc pre { background:var(--pulse-bg-elevated); border:1px solid var(--pulse-border); padding:10px; overflow-x:auto; border-radius:10px; white-space:pre-wrap; word-break:break-all; }
.doc code { background:var(--pulse-bg-elevated); padding:1px 5px; border-radius:4px; word-break:break-all; }
.doc p.li { margin:2px 0 2px 12px; }
@media print {
  .noprint { display:none !important; }
  body { background:#fff; color:#000; font-size:11pt; } main { max-width:none; padding:0; }
  .muted { color:#333; }
  table.doctor { background:#fff; } table.doctor th, table.doctor td { border-color:#000; } tr { page-break-inside:avoid; }
  .chg, .cheatmark { color:#000; }
}
