/* Bit. Black ground, one amber (effort in progress), one white (automatic). See docs/bit-ui-direction.md. */
:root {
  --ground: #0a0b0c;
  --surface: #121516;
  --raised: #1a1e20;
  --seam: #2a3033;
  --chalk: #eceae4;
  --ash: #a3a9a8;
  --dusk: #7a8284;
  --crest: #d9a441;
  --ember: #f0c27a;
  --frost: #e9eef0;
  --guards: #f0646a;
  --on-crest: #0a0b0c;
  --scrim: rgba(0, 0, 0, 0.6);

  --display: "Lexend", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --col: clamp(34rem, 42vw, 58rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* on big screens everything grows with the window (sizes are in rem), so the content is not a small strip beside the orb */
@media (min-width: 1100px) { html { font-size: clamp(16px, 0.5vw + 10px, 22px); } }
body {
  margin: 0; background: var(--ground); color: var(--chalk);
  font-family: var(--body); font-size: 1rem; line-height: 1.5; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--crest); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
/* the logo file carries the aura around the letters. The letters are 43% of its height and 66% of its width, so the box is sized
   from that (letters 2rem tall) and the margins pull the layout back to the letters alone: the aura bleeds out, the header does not grow */
.wordmark { display: block; height: 4.64rem; width: auto; margin: -1.36rem -0.76rem -1.28rem -0.76rem; pointer-events: none; }
.label { font-family: var(--display); font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dusk); }
.title { font-family: var(--display); font-weight: 300; font-size: 1.75rem; line-height: 1.2; letter-spacing: 0.01em; }
.big { font-family: var(--display); font-weight: 200; font-size: 3.5rem; line-height: 1; letter-spacing: -0.01em; }
.lead { font-size: 1.1875rem; line-height: 1.5; }
.muted { color: var(--ash); font-size: 0.9375rem; }
.quiet { color: var(--dusk); font-size: 0.875rem; }
.date { font-family: var(--display); font-weight: 300; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--ash); }
.amber { color: var(--crest); }
.stack > * + * { margin-top: var(--s5); }
.tight > * + * { margin-top: var(--s2); }
.rule { border-top: 1px solid var(--seam); padding-top: var(--s5); }
.rule-bottom { border-bottom: 1px solid var(--seam); padding-bottom: var(--s5); }

/* ---------- layout ---------- */
.shell { min-height: 100dvh; display: block; }
.orb-pane { position: relative; display: none; }
#orb { display: block; width: 100%; height: 100%; touch-action: pan-y; }
/* on phones the header sits above the orb, then the content; the column wrapper steps aside */
.shell { display: flex; flex-direction: column; }
.column { display: contents; }
.top { order: 0; display: flex; justify-content: space-between; align-items: center; min-height: 64px; padding: env(safe-area-inset-top) var(--s4) 0; }
.orb-pane { order: 1; }
main:focus, main:focus-visible { outline: none; } /* main is only where focus lands for a screen reader after a change of screen; it is not a control, so it never shows a ring (the global ring would box the whole page on first load) */
main { order: 2; outline: none; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 var(--s4) 120px; }

/* the orb's height follows the small viewport (svh), which stays put while a phone's address bar slides away as you scroll; dvh would resize the orb on every scroll step */
.shell[data-view="today"] .orb-pane, .shell[data-view="welcome"] .orb-pane, .shell[data-view="done"] .orb-pane { display: block; height: min(44vh, 380px); height: min(44svh, 380px); }
.shell[data-view="welcome"] .orb-pane, .shell[data-view="done"] .orb-pane { height: min(50vh, 440px); height: min(50svh, 440px); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(to top, var(--ground) 70%, transparent); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  min-height: 60px; font-family: var(--display); font-weight: 300; font-size: 0.6875rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dusk);
  border-top: 1px solid var(--seam); position: relative;
}
.tabs button[aria-current="page"] { color: var(--chalk); }
.tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 35%; right: 35%; top: -1px; height: 2px; background: var(--crest); }

@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: minmax(0, 1fr) var(--col); height: 100dvh; overflow: hidden; }
  .orb-pane { display: block !important; height: 100dvh !important; margin: 0 !important; position: sticky; top: 0; order: 0; }
  .shell[data-view="boot"] .orb-pane { opacity: 0; }
  .column { display: block; overflow-y: auto; width: 100%; padding: 0 var(--s6) var(--s8); height: 100dvh; margin: 0; }
  .top { min-height: 5.5rem; padding: 0; }
  main { padding: 0; max-width: none; }
  .tabs { position: fixed; left: auto; right: 0; bottom: 0; width: var(--col); display: flex; background: var(--ground); padding: 0 var(--s6) var(--s3); }
  .tabs button { flex: 1; border-top: 1px solid var(--seam); }
  .column { padding-bottom: 7.5rem; }
}

/* tablets held upright: more room, same single column, a larger orb and calmer line length */
@media (min-width: 700px) and (max-width: 999px) {
  main { max-width: 640px; padding-bottom: 140px; }
  .top { max-width: 640px; margin: 0 auto; width: 100%; }
  .shell[data-view="today"] .orb-pane, .shell[data-view="welcome"] .orb-pane, .shell[data-view="done"] .orb-pane { height: min(46vh, 480px); height: min(46svh, 480px); }
  .title { font-size: 2rem; }
  .orb-open { left: calc((100% - 640px) / 2); }
  .tabs { grid-template-columns: repeat(4, minmax(0, 160px)); justify-content: center; }
  .sheet { max-width: 640px; margin: auto; border-radius: 24px; max-height: 80dvh; }
}
/* wide screens: keep the two panes from stretching into emptiness */
/* short, wide screens (a tablet on its side): the tab bar must not cover the content */
@media (min-width: 1000px) and (max-height: 640px) {
  .top { min-height: 56px; }
  .column { padding-bottom: 96px; }
}

/* a phone on its side: the orb on the left at full height and the content on the right, as on a laptop,
   instead of a thin strip of orb above a long page. Notch and rounded-corner insets are respected. */
@media (min-width: 600px) and (max-width: 999px) and (max-height: 540px) and (orientation: landscape) {
  :root { --col: clamp(20rem, 56vw, 32rem); }
  .shell { display: grid; grid-template-columns: minmax(0, 1fr) var(--col); height: 100dvh; overflow: hidden; }
  .orb-pane { display: block !important; height: 100dvh !important; margin: 0 !important; position: sticky; top: 0; order: 0; padding-left: env(safe-area-inset-left); }
  .shell[data-view="boot"] .orb-pane { opacity: 0; }
  .column { display: block; overflow-y: auto; width: 100%; padding: 0 max(var(--s5), env(safe-area-inset-right)) 6rem var(--s5); height: 100dvh; margin: 0; }
  .top { min-height: 56px; padding: 0; max-width: none; margin: 0; width: auto; }
  main { padding: 0; max-width: none; }
  .tabs { left: auto; right: 0; width: var(--col); display: flex; background: var(--ground); padding: 0 max(var(--s5), env(safe-area-inset-right)) var(--s2) var(--s5); }
  .tabs button { flex: 1; min-height: 52px; }
  .orb-open { left: max(var(--s4), env(safe-area-inset-left)); }
  .sheet { margin: 0 0 0 auto; height: 100dvh; max-height: none; max-width: var(--col); border-radius: 0; padding: var(--s5); }
  .sheet[open] { animation: slide-in 0.2s ease-out; }
  @keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .toast { left: calc(100% - var(--col) / 2); bottom: 4.5rem; transform: translateX(-50%); }
}

/* ---------- how things respond ----------
   One small set of timings. Every control answers a touch the moment it lands (pressed), says what it is doing
   (busy, disabled), and moves only to show a change of state. Nothing loops, nothing bounces for its own sake. */
:root { --t-quick: 120ms; --t-calm: 220ms; --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }
.btn, .chip, .tabs button, .ten button, .scale span, .stepper button, .queue .ctl button, .floor-btn, .more, .name, .waiting-link, .n-ref, .orb-open {
  transition: transform var(--t-quick) var(--ease), background-color var(--t-calm) var(--ease), border-color var(--t-calm) var(--ease), color var(--t-calm) var(--ease), filter var(--t-calm) var(--ease), opacity var(--t-calm) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active:not(:disabled), .chip:active, .ten button:active, .stepper button:active, .queue .ctl button:active:not(:disabled) { transform: scale(0.96); }
.dial:active:not(:disabled) { transform: scale(0.93); }
.tabs button:active { color: var(--chalk); }
.waiting-link:active, .name:active, .floor-btn:active, .more:active { opacity: 0.6; }
.btn.solid:active:not(:disabled) { filter: brightness(0.92); }
.scale input:checked + span { transform: scale(1.04); }
/* a change of screen fades in; a change inside a screen does not */
main.arrive > * { animation: arrive var(--t-calm) var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sheet::backdrop { transition: background-color var(--t-calm); }
.toast:not([hidden]) { animation: rise var(--t-calm) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- buttons ---------- */
.btn {
  text-decoration: none; min-height: 48px; padding: 0 var(--s5); border-radius: 999px; border: 1px solid var(--seam); background: transparent; color: var(--chalk);
  font-weight: 600; letter-spacing: 0.01em; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
}
.btn:hover { border-color: var(--ash); }
.btn.solid { background: var(--crest); border-color: var(--crest); color: var(--on-crest); }
.btn.solid:hover { filter: brightness(1.08); }
.btn.text { border-color: transparent; color: var(--ash); font-weight: 500; padding: 0 var(--s3); text-decoration: underline; text-underline-offset: 4px; }
.btn.small { min-height: 44px; padding: 0 var(--s4); font-size: 0.9375rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* ---------- Today ---------- */
.counts { display: flex; gap: var(--s5); align-items: baseline; padding: var(--s2) 0 var(--s4); }
.counts .n { font-family: var(--display); font-weight: 200; font-size: 2.25rem; line-height: 1; }
.counts .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.counts .building .dot { background: var(--crest); }
.counts .keeping .dot { background: var(--frost); }

.bit { display: grid; grid-template-columns: 3.25rem 1fr auto; gap: var(--s3); align-items: center; padding: var(--s4) 0; border-top: 1px solid var(--seam); }
.dial {
  width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 1px solid var(--ash); display: grid; place-items: center; position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.dial::after { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--ash); opacity: 0.5; transition: all 0.2s; }
.dial:hover { border-color: var(--crest); }
.dial:hover::after { background: var(--crest); opacity: 1; }
.bit.done .dial { background: var(--crest); border-color: var(--crest); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45); }
.bit.done .dial::after { background: var(--on-crest); opacity: 1; width: 0.875rem; height: 0.875rem; }
.bit.done.floor .dial { background: transparent; border-color: var(--crest); box-shadow: none; }
.bit.done.floor .dial::after { background: var(--crest); width: 0.625rem; height: 0.625rem; }
/* the padding makes the tap area a full-size target; the negative margin keeps the rows as tight as before */
.bit .name { font-size: 1.125rem; font-weight: 500; line-height: 1.3; text-align: left; min-height: 28px; padding: 0.55rem 0; margin: -0.55rem 0; }
.bit .meta { color: var(--ash); font-size: 0.875rem; }
.bit .side { display: flex; flex-direction: column; align-items: flex-end; }
.bit .floor-btn { min-height: 44px; padding: 0 var(--s2); color: var(--ash); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 4px; }
.bit .more { min-height: 44px; padding: 0 var(--s2); color: var(--dusk); font-size: 0.875rem; }
.bit.press .dial { animation: press 0.3s ease-out; }
@keyframes press { 0% { transform: scale(1.12); } 55% { transform: scale(0.9); } 100% { transform: scale(1); } }
.bit.stacked { position: relative; }
.bit.stacked::before { content: ""; position: absolute; left: 1.59rem; top: -0.75rem; height: 1.5rem; border-left: 1px solid var(--seam); }
.then { color: var(--dusk); font-size: 0.75rem; letter-spacing: 0.1em; padding-left: 4rem; }

.closure { padding: var(--s6) 0 var(--s4); border-top: 1px solid var(--seam); }
.closure .lead { font-family: var(--display); font-weight: 300; font-size: 1.375rem; line-height: 1.35; }
.verse { margin-top: var(--s4); color: var(--ash); font-size: 1rem; line-height: 1.6; max-width: 44ch; }
.verse cite { display: block; margin-top: var(--s2); font-style: normal; font-family: var(--display); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dusk); }
.line { color: var(--ash); font-size: 1rem; }

.card { border-top: 1px solid var(--seam); padding-top: var(--s5); }
.card .msg { font-size: 1.1875rem; line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { min-height: 44px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--seam); color: var(--ash); }
.chip[aria-pressed="true"], .chip.on { border-color: var(--crest); color: var(--chalk); background: rgba(217, 164, 65, 0.1); }
/* setup: where you are, and that what you wrote is kept */
.progress { display: grid; gap: var(--s2); }
.bar { height: 2px; background: var(--seam); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--crest); border-radius: 2px; transition: width 400ms var(--ease, ease); }
.bar i.w1 { width: 16.67%; } .bar i.w2 { width: 33.33%; } .bar i.w3 { width: 50%; } .bar i.w4 { width: 66.67%; } .bar i.w5 { width: 83.33%; } .bar i.w6 { width: 100%; }
.saved { min-height: 1.25rem; font-size: 0.8125rem; color: var(--dusk); opacity: 0; transition: opacity 300ms ease; }
.saved.on { opacity: 1; }
.saved.on::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--crest); vertical-align: 1px; }
.chip.picked-item { display: inline-flex; align-items: center; gap: var(--s2); padding-right: var(--s2); }
.chip.picked-item .x { width: 32px; height: 32px; border-radius: 50%; color: var(--ash); font-size: 1.125rem; line-height: 1; }
.chip.picked-item .x:hover { color: var(--chalk); }
.tags .row { flex-wrap: nowrap; }
.tags .row input { flex: 1 1 auto; min-width: 0; }


.waiting-link { display: block; width: 100%; text-align: left; padding: var(--s4) 0; border-top: 1px solid var(--seam); color: var(--ash); min-height: 56px; }
.waiting-link span { color: var(--chalk); }

/* numbers that open the days behind them */
.n-ref { color: var(--crest); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; font-weight: 600; min-width: 24px; min-height: 28px; display: inline; padding: 0 1px; }

/* ---------- Record ---------- */
.trail { display: grid; grid-template-columns: 3.5rem repeat(7, 1fr); row-gap: 10px; align-items: center; justify-items: center; }
.trail .wk, .trail .dow { color: var(--dusk); font-family: var(--display); font-size: 0.6875rem; letter-spacing: 0.08em; }
.trail .wk { justify-self: start; }
.pt { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pt.usual { background: var(--crest); box-shadow: 0 0 10px rgba(217, 164, 65, 0.45); }
.pt.floor { border: 2px solid var(--crest); }
.pt.skipped { width: 4px; height: 4px; background: var(--seam); }
.pt.none { width: 2px; height: 2px; background: var(--seam); opacity: 0.6; }
.pt.off { width: 10px; height: 2px; border-radius: 1px; background: var(--dusk); }
.pt.today { border: 1px solid var(--chalk); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--dusk); font-size: 0.8125rem; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.seg-tabs { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ---------- Next ---------- */
.queue li { display: grid; grid-template-columns: 2rem 1fr auto; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--seam); align-items: start; }
.queue .pos { font-family: var(--display); font-weight: 200; font-size: 1.5rem; line-height: 1.2; color: var(--dusk); }
.queue .g { font-size: 1.0625rem; font-weight: 500; }
.queue .ctl { display: flex; flex-direction: column; }
.queue .ctl button { min-width: 44px; min-height: 44px; color: var(--ash); }
.days .g, .doing .g { min-height: 44px; text-align: left; font-size: 1.0625rem; font-weight: 500; }
.kind { font-family: var(--display); font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dusk); }

/* ---------- forms ---------- */
.field { display: block; }
.field > .label { display: block; margin-bottom: var(--s2); }
input[type="text"], input[type="email"], input[type="number"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; padding: var(--s3) var(--s4); border-radius: 12px; border: 1px solid var(--seam); background: var(--surface); color: var(--chalk);
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
textarea.short { min-height: 5.5rem; }
.yours > summary { cursor: pointer; color: var(--ash); min-height: 2.75rem; display: flex; align-items: center; font-size: 0.9375rem; }
.yours[open] > summary { color: var(--chalk); }
.yours > summary { list-style: none; }
.yours > summary::-webkit-details-marker { display: none; }
.yours > summary::before { content: "+"; display: inline-block; width: 1.5rem; color: var(--crest); font-size: 1.125rem; }
.yours[open] > summary::before { content: "2"; }
.yours > .field { margin-top: var(--s3); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--crest); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.stepper { display: flex; align-items: center; gap: var(--s3); }
.stepper .v { font-family: var(--display); font-weight: 200; font-size: 2.5rem; min-width: 3ch; text-align: center; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--seam); font-size: 1.25rem; }
.options { display: grid; gap: var(--s2); }
.option { display: block; position: relative; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option > span { display: block; padding: var(--s4); border: 1px solid var(--seam); border-radius: 14px; }
.option input:checked + span { border-color: var(--crest); background: rgba(217, 164, 65, 0.07); }
.option input:focus-visible + span { outline: 2px solid var(--crest); outline-offset: 3px; }
.option b { display: block; font-weight: 600; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale span { display: grid; place-items: center; min-height: 48px; border: 1px solid var(--seam); border-radius: 12px; font-weight: 600; }
.scale input:checked + span { background: var(--crest); border-color: var(--crest); color: var(--on-crest); }
.scale input:focus-visible + span { outline: 2px solid var(--crest); outline-offset: 2px; }
.ends { display: flex; justify-content: space-between; color: var(--dusk); font-size: 0.8125rem; margin-top: 4px; }
.ten { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.ten button { min-height: 44px; border: 1px solid var(--seam); border-radius: 10px; font-weight: 600; }
.ten button:hover { border-color: var(--crest); }
/* on a phone the eleven answers take two rows of big buttons (0 to 5, then 6 to 10), not one row of narrow ones */
@media (max-width: 479px) { .ten { grid-template-columns: repeat(6, 1fr); gap: 8px; } .ten button { min-height: 48px; } }
.err { color: var(--guards); }
.note-box { border-left: 2px solid var(--crest); padding-left: var(--s4); color: var(--ash); }

/* ---------- sheet and toast ---------- */
.sheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--chalk); max-height: 88dvh; overflow: auto; }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: up 0.2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 1000px) {
  .sheet { margin: 0 0 0 auto; height: 100dvh; max-height: none; max-width: var(--col); border-radius: 0; padding: var(--s6); }
  .sheet[open] { animation: in 0.2s ease-out; }
  @keyframes in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: var(--s3); margin-bottom: var(--s5); }
.sheet h2 { font-family: var(--display); font-weight: 300; font-size: 1.375rem; line-height: 1.25; }
.days li, .doing li { padding: var(--s3) 0; border-top: 1px solid var(--seam); }
.days .l { font-weight: 600; }
.days .d, .doing .d { color: var(--ash); font-size: 0.9375rem; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: var(--s4);
  background: var(--chalk); color: var(--ground); padding: var(--s1) var(--s1) var(--s1) var(--s5); border-radius: 999px; min-width: 220px; justify-content: space-between;
}
.toast button { min-height: 44px; padding: 0 var(--s5); font-weight: 700; color: var(--ground); text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1000px) { .toast { left: calc(100% - var(--col) / 2); bottom: 5.5rem; transform: translateX(-50%); } }

/* ---------- the orb preview ---------- */
.orb-preview { position: relative; height: min(26rem, 52dvh); border-radius: 16px; background: var(--ground); overflow: hidden; }
.orb-preview canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
input[type="range"] { width: 100%; accent-color: var(--crest); min-height: 2.75rem; }

/* ---------- watch your days ---------- */
.replay-date { font-family: var(--display); font-weight: 200; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; }
.replay-end { min-height: 6.5rem; animation: arrive 600ms var(--ease) both; }
.orb-preview.replay { height: min(30rem, 58dvh); }

/* ---------- help for sensitive goals ---------- */
.care { border: 1px solid var(--seam); border-radius: 16px; padding: var(--s5); background: var(--surface); }
.care > * + * { margin-top: var(--s4); }
.title.small { font-size: 1.25rem; }
/* a helpline number is the one link that matters most in a hard moment: a full-size target without changing the line */
.tel { color: var(--crest); font-weight: 600; text-underline-offset: 3px; display: inline-block; padding: 0.8rem 0.35rem; margin: -0.8rem -0.35rem; }

/* ---------- hints and small links ---------- */
.hint { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); border-left: 2px solid var(--crest); padding: var(--s2) 0 var(--s2) var(--s4); color: var(--ash); animation: arrive var(--t-calm) var(--ease) both; }
.hint p { font-size: 0.9375rem; }
.hint .btn { flex: none; white-space: nowrap; }
/* the quiet links under the counts sit side by side and wrap, so they take one row and not one each (the day's bit stays in view on a phone on its side) */
.quiet-links { display: flex; flex-wrap: wrap; column-gap: var(--s5); }
.quiet-links, .stack > .quiet-links { margin-top: 0; }
.quiet-link { display: block; min-height: 2.75rem; padding: 0; color: var(--dusk); font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 4px; transition: color var(--t-calm) var(--ease); }
.quiet-link:hover { color: var(--chalk); }

/* ---------- header: date and settings ---------- */
.top-right { display: flex; align-items: center; gap: var(--s2); }
.gear { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%; color: var(--ash); transition: color var(--t-calm) var(--ease), background-color var(--t-calm) var(--ease), transform var(--t-quick) var(--ease); }
.gear:hover { color: var(--chalk); background: var(--surface); }
.gear:active { transform: scale(0.92); }
.back { min-height: 2.75rem; padding: 0 var(--s3) 0 0; color: var(--ash); font-weight: 500; transition: color var(--t-calm) var(--ease), transform var(--t-quick) var(--ease); }
.back:hover { color: var(--chalk); }
.back:active { transform: translateX(-2px); }

/* ---------- account, sign-in ---------- */
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2) var(--s4); padding: var(--s4); border: 1px solid var(--seam); border-radius: 14px; background: var(--surface); counter-reset: c; }
.codes li { font-family: var(--display); font-weight: 300; font-size: 0.9375rem; letter-spacing: 0.04em; padding: var(--s1) 0; white-space: nowrap; }
.check { display: flex; gap: var(--s3); align-items: center; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--crest); flex: none; }
.split { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.note-box.tight > * + * { margin-top: var(--s3); }
#invite, #recovery { font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- system page ---------- */
.system-page { border: 1px solid var(--seam); border-radius: 16px; padding: var(--s5); background: var(--surface); }
.system-page li { padding: var(--s3) 0; border-top: 1px solid var(--seam); }
.system-page li:first-child { border-top: 0; }
.system-page ol { counter-reset: r; }
.orb-zoom { position: absolute; right: var(--s4); bottom: var(--s2); display: flex; gap: 2px; }
.orb-zoom button { width: 44px; height: 44px; color: var(--dusk); font-size: 1.25rem; line-height: 1; border-radius: 50%; }
.orb-zoom button:hover:not([aria-disabled="true"]) { color: var(--crest); }
.orb-zoom button[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.orb-open { position: absolute; left: var(--s4); bottom: var(--s2); color: var(--dusk); font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--seam); border-top-color: var(--crest); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .spin { animation: none; }
}
@media print {
  body { background: #fff; color: #000; }
  .orb-pane, .tabs, .top, .btn, .no-print, .toast { display: none !important; }
  .shell { display: block; height: auto; overflow: visible; }
  .column { overflow: visible; height: auto; padding: 0; max-width: none; }
  .system-page { border: 0; padding: 0; background: #fff; }
  .system-page li { border-top: 1px solid #ccc; }
  .label, .muted, .quiet { color: #444; }
}

/* ---------- using Bit on a new device, and the connection check ---------- */
.steps { list-style: decimal; display: grid; gap: var(--s4); padding-left: 1.3rem; color: var(--ash); }
.steps li { padding-left: var(--s1); line-height: 1.5; }
.steps b { color: var(--chalk); font-weight: 600; }
.check-page { max-width: 560px; margin: 0 auto; padding: var(--s6) var(--s4) 6rem; outline: none; }
