/* Reset, page frame, header, data strip, footer and the shared parts every screen uses.
   All sizes come from the scale in tokens.css: --s1..--s6 spacing, --fs-* text, --d-* display, --ctl control height. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-md)/1.5 var(--f-body);
  padding-inline: var(--s4); padding-block: var(--s3) var(--s5);
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#app:focus, #mainH:focus, .sheet:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s2); top: -60px; z-index: 50; background: var(--go); color: var(--go-ink); border: 2px solid var(--ink); padding: 10px 14px; font-weight: 700; }
.skip:focus { top: var(--s2); }
.js-start { justify-self: start; }
.js-center { justify-self: center; }

.shell { max-width: var(--shell); margin-inline: auto; display: grid; gap: var(--s3); min-width: 0; }
.masthead, .site-foot { display: grid; gap: var(--s3); min-width: 0; }
#app { min-width: 0; }
/* figures that sit in columns use tabular digits so they line up (only these: in running text the font's own spacing reads better) */
.tm, .wamt, .capin input, .kv dd, .pl-amt, .pl-time, .lg-a, .lg-t, .amt, .log time, .pshares b, .rl-amt, .dtile b, .otop b { font-variant-numeric: tabular-nums; }

/* ---------- header: one row on wide screens; on phones brand + language on one row, the two links under it ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 0 var(--s4); flex-wrap: wrap; border-bottom: var(--heavy) solid var(--ink); padding-bottom: var(--s1); }
.brand { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.brand h1 { font: 900 var(--d-brand)/1 var(--f-display); letter-spacing: .01em; text-transform: uppercase; margin: 0; }
.tag { font: 500 var(--fs-label)/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.tools { display: flex; align-items: center; gap: var(--s4); }
.tools .seg { margin-right: auto; }
.tools .link { font-size: var(--fs-ui); padding: 0; }
@media (max-width: 479px) {
  .top { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--s4); }
  .tools { display: contents; }
  .brand { grid-column: 1 / 4; grid-row: 1; }
  .tools .seg { grid-column: 4; grid-row: 1; margin: 0; }
  .tools .link { grid-row: 2; }
}
.top .seg button { padding: 0 var(--s3); }

/* the data strip: one line under the header */
.demo { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--s3); font-size: var(--fs-sm); color: var(--ink-2); border-bottom: var(--hair) dashed var(--ink-2); padding-bottom: var(--s1); }
.demo b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* the visible label is the tag next to the name */
.demo span { flex: 0 1 auto; min-width: 0; }
.demo .link { font-size: var(--fs-sm); min-height: var(--ctl); padding: 0; }
.lede { margin: 0; color: var(--ink-2); font-size: var(--fs-md); max-width: 46ch; }
.shell:not(:has(#app > .ask)) .lede { display: none; }   /* the one-line pitch belongs on the first screen only */

/* ---------- footer: one line, then the legal links in a small grid ---------- */
.about { display: none; }
.foot { margin: var(--s3) 0 0; font: 500 var(--fs-label)/1.5 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); border-top: var(--rule) solid var(--ink); padding-top: var(--s3); }
.legal-row > .lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.legal-row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.legal-row a { display: flex; align-items: center; min-height: var(--ctl); min-width: var(--ctl); font: 500 var(--fs-xs) var(--f-mono); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.legal-row a:hover { color: var(--ink); }

/* ---------- type primitives ---------- */
.lab { font: 500 var(--fs-label)/1.3 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.lab.inh { color: inherit; }
.small { font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); margin: 0; }
.small.sim { font: 500 var(--fs-xs)/1.45 var(--f-mono); }
.sec { font: 500 var(--fs-label)/1.3 var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.page-h, .pay-h, .wk-h { font: var(--h); margin: 0; }

/* ---------- controls: square, at least 44px ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); border: var(--rule) solid var(--ink); border-radius: var(--radius); background: transparent; padding: 0 var(--s4); min-height: var(--ctl); font: 600 var(--fs-ui)/1.2 var(--f-body); cursor: pointer; color: var(--ink); text-align: center; white-space: nowrap; }
a.btn { text-decoration: none; }
.btn:hover { background: var(--surface); }
.btn.go { background: var(--go); color: var(--go-ink); border-color: var(--ink); }
.btn.go:hover { background: var(--go); box-shadow: inset 0 -3px 0 var(--go-ink); }
.btn.big { width: 100%; padding: var(--s2) var(--s4); min-height: var(--ctl-lg); font: 700 var(--fs-lg)/1.2 var(--f-body); white-space: normal; }
/* a small button for the one action at the end of a schedule row: still a 44px target */
.btn.sm { min-height: var(--ctl); padding: 0 var(--s2); min-width: 56px; font-size: var(--fs-sm); border-width: var(--hair); }
.btn.sm.pri { border-width: var(--rule); font-weight: 700; }
/* the one yellow action on a schedule: the row that is next */
.it.nx .ra .btn.sm { background: var(--go); color: var(--go-ink); border: var(--rule) solid var(--ink); }
.it.nx .ra .btn.sm:focus-visible { outline-color: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.link { display: inline-flex; align-items: center; min-height: var(--ctl); min-width: var(--ctl); border: 0; background: none; padding: 0; font: 600 var(--fs-ui) var(--f-body); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; color: var(--ink); text-align: left; }
.link.mute { color: var(--ink-2); font-weight: 500; }
.link:disabled { opacity: .55; cursor: default; }
.link:hover { text-decoration-thickness: 2px; }
/* a link inside a line of text keeps the line height; padding gives it a 44px tall target */
.small a, .small .link, .where a { display: inline; min-height: 0; min-width: 0; padding: 14px 4px; margin: -14px -4px; font-size: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.seg { display: inline-flex; border: var(--rule) solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-right: var(--hair) solid var(--ink); background: transparent; padding: 0 var(--s4); min-width: var(--ctl); min-height: var(--ctl); font: 500 var(--fs-sm) var(--f-mono); cursor: pointer; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* inside yellow panels the focus ring is dark, so it keeps 3:1 against the yellow in both themes */
.doneb :focus-visible, .next :focus-visible, .bopt[data-on="true"]:focus-within { outline-color: var(--go-ink); }
.btn.go:focus-visible { outline-color: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
