:root { color-scheme: light; --page:#f9f9f7; --surface:#fff; --ink:#17221b; --muted:#4c5a50; --line:#a0aaa3; --control:#6b7a70; --focus:#12685e; }
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {color-scheme:dark;--page:#101612;--surface:#1b241e;--ink:#f3f6f4;--muted:#c0cbc3;--line:#4a5c50;--control:#7f9486;--focus:#a7edcb;} }
:root[data-theme="dark"] {color-scheme:dark;--page:#101612;--surface:#1b241e;--ink:#f3f6f4;--muted:#c0cbc3;--line:#4a5c50;--control:#7f9486;--focus:#a7edcb;}
* {box-sizing:border-box;} body {margin:0;padding:16px;background:var(--page);color:var(--ink);font:1rem/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;}
header {max-width:960px;margin:0 auto;display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:12px;} a {color:inherit;text-underline-offset:3px;display:inline-flex;align-items:center;min-height:44px;} header span {color:var(--muted);align-self:center;}
main {max-width:960px;margin:24px auto 96px;} h1 {font-size:1.8rem;line-height:1.2;margin:0 0 4px;} h2 {font-size:1.15rem;margin:0 0 14px;} p {color:var(--muted);margin:8px 0 16px;} .lede {margin:0 0 20px;}
label, .label {display:block;font-weight:600;margin-bottom:7px;} button,select,input {font:inherit;} select,button {min-height:44px;border:1px solid var(--control);border-radius:7px;padding:8px 12px;background:var(--surface);color:var(--ink);max-width:100%;} select {width:100%;} button {cursor:pointer;}
.setting-row + .setting-row, .setting-row + details, details > .setting-row {margin-top:20px;} .setting-row p {margin:6px 0 0;font-size:.92rem;}
.range {display:flex;align-items:center;gap:16px;} input[type="range"] {width:100%;height:44px;accent-color:var(--focus);} output {min-width:2ch;font-variant-numeric:tabular-nums;} :focus-visible {outline:3px solid var(--focus);outline-offset:3px;}
[hidden] {display:none !important;}

/* Cards: one column on phones; from 820px they flow in two columns (top to bottom, then the next column), so a short card
   never leaves a hole beside a tall one. The Your data card spans both. */
.cards {display:block;}
.card {background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:20px;margin:0 0 16px;break-inside:avoid;}
.card > p:first-of-type {margin-top:0;}
@media (min-width:820px) {.cards {columns:2;column-gap:20px;} .card {margin-bottom:20px;} .card.wide {column-span:all;}}
@media (max-width:400px) {body {padding:12px;} main {margin-top:20px;} .card {padding:16px;}}

/* Three-way choice: one tap instead of open-then-pick. The radio stays in the page (keyboard and screen reader use it);
   the label text is the visible button, and a check mark marks the chosen one so color is not the only cue. */
fieldset.seg {border:0;padding:0;margin:0;min-width:0;} fieldset.seg legend {font-weight:600;padding:0;margin-bottom:7px;}
.seg-options {display:flex;flex-wrap:wrap;gap:8px;}
.seg-options label {position:relative;display:flex;margin:0;font-weight:400;flex:1 1 6.5rem;}
.seg-options input {position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer;}
.seg-options span {flex:1;display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 12px;border:1px solid var(--control);border-radius:7px;background:var(--surface);text-align:center;}
.seg-options input:checked + span {background:var(--ink);color:var(--surface);border-color:var(--ink);font-weight:600;}
.seg-options input:checked + span::before {content:"\2713";}
.seg-options input:focus-visible + span {outline:3px solid var(--focus);outline-offset:3px;}

/* Rarely changed display options stay folded away. */
details.more {margin-top:20px;border-top:1px solid var(--line);padding-top:4px;}
details.more summary {display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:600;}
details.more > p {margin-bottom:0;}

.data-line {display:flex;justify-content:space-between;gap:12px;color:var(--ink);max-width:24rem;} .data-line strong {font-variant-numeric:tabular-nums;} .actions {display:flex;flex-wrap:wrap;gap:12px;} #erase-saved {border-color:#b3261e;} :root[data-theme="dark"] #erase-saved {border-color:#f2b8b5;}
@media (prefers-color-scheme:dark) {:root:not([data-theme="light"]) #erase-saved {border-color:#f2b8b5;}}

/* The "saved" message floats at the bottom so it is seen wherever you are on the page. */
.status {position:fixed;left:50%;bottom:16px;transform:translateX(-50%);margin:0;max-width:calc(100vw - 32px);padding:10px 16px;border-radius:999px;background:var(--ink);color:var(--surface);box-shadow:0 2px 10px rgba(0,0,0,.25);z-index:5;text-align:center;}
.status:empty {display:none;}
@media (forced-colors:active) {.seg-options input:checked + span {outline:2px solid Highlight;} .status {border:1px solid CanvasText;}}

/* In the popup on the events page (?embed=1): the popup has its own title and close button. */
html.embedded body {padding:12px 16px;} html.embedded header, html.embedded h1 {display:none;} html.embedded main {margin:0 auto 72px;}

/* Zoom: minus, the current level, plus, and a way back to 100%. */
.zoom-controls {display:flex;flex-wrap:wrap;align-items:center;gap:8px;} .zoom-controls output {min-width:4.5ch;text-align:center;font-weight:600;font-variant-numeric:tabular-nums;}
.zoom-controls #zoom-out, .zoom-controls #zoom-in {min-width:44px;font-size:1.25rem;line-height:1;padding:8px 14px;}
