/* Recommended structure: tokens → reset → layout (mobile first) → components → wide screens → preferences. */
:root{
  --bg:transparent;            /* let the page behind show through; don't paint a full-page colour */
  --ink:#14172e; --ink-2:#545a7c; --line:#dfe2f0; --card:#fff; --accent:#3b44f6; --accent-ink:#fff; --soft:#eef0ff;
  --r:14px; --gap:clamp(12px,3vw,20px);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){:root{--ink:#eceefc;--ink-2:#aeb2d3;--line:#2a2e52;--card:#171a35;--accent:#8a92ff;--accent-ink:#0b0c1c;--soft:#222650}}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-size:1rem;line-height:1.5;padding:var(--gap)}
/* mobile first: one column. Nothing below assumes a wide screen. */
.app{display:grid;gap:var(--gap);max-width:760px;margin:0 auto}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:var(--gap)}
.field{display:grid;gap:6px;margin-bottom:14px}.field:last-child{margin-bottom:0}
label{font-weight:650;display:flex;justify-content:space-between;gap:8px}
input[type=number]{width:100%;font:inherit;font-size:1.1rem;padding:12px 14px;min-height:48px;border:1px solid var(--line);border-radius:10px;background:transparent;color:inherit}
input[type=range]{width:100%;min-height:44px;accent-color:var(--accent)}      /* 44px+ touch targets */
.stepper{display:grid;grid-template-columns:48px 1fr 48px;gap:8px}
.stepper button,.btn{font:inherit;font-weight:650;min-height:48px;border:0;border-radius:10px;background:var(--soft);color:var(--ink);cursor:pointer}
.btn{width:100%;background:var(--accent);color:var(--accent-ink);margin-top:14px}
.stepper input{text-align:center}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}               /* never remove the focus ring */
.big{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.big span{font-size:clamp(2.2rem,9vw,3.4rem);font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.big small{color:var(--ink-2);font-size:1rem}
dl{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0 0}
dl div{background:var(--soft);border-radius:10px;padding:10px 12px}
dt{font-size:.85rem;color:var(--ink-2)}dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums}
.msg{min-height:1.4em;margin:8px 0 0;color:var(--ink-2);font-size:.9rem}
/* wide screens: only ADD a second column when there is room (a container, not the screen, decides) */
@media (min-width:640px){.app{grid-template-columns:1fr 1fr;align-items:start}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
