/* Listomania — a household ledger. Paper, ink, one vermilion. */

:root {
  --paper: #f2eee5;
  --paper-2: #e9e4d8;
  --sheet: #f8f5ef;
  --ink: #1c1a16;
  --ink-2: #47423a;
  --muted: #7b7467;
  --faint: #a8a092;
  --rule: #d6cfbf;
  --rule-2: #e2dccf;
  --accent: #c1401c;
  --accent-ink: #fff7f1;
  --accent-wash: rgba(193, 64, 28, .09);
  --scrim: rgba(28, 26, 22, .28);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --gut: 20px;
  --tabs-h: 56px;
  --cap-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --kb: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151412;
    --paper-2: #1d1b18;
    --sheet: #1c1a17;
    --ink: #ece6da;
    --ink-2: #c9c1b2;
    --muted: #918979;
    --faint: #686155;
    --rule: #34302a;
    --rule-2: #27241f;
    --accent: #e8643c;
    --accent-ink: #1b0d07;
    --accent-wash: rgba(232, 100, 60, .12);
    --scrim: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151412;
  --paper-2: #1d1b18;
  --sheet: #1c1a17;
  --ink: #ece6da;
  --ink-2: #c9c1b2;
  --muted: #918979;
  --faint: #686155;
  --rule: #34302a;
  --rule-2: #27241f;
  --accent: #e8643c;
  --accent-ink: #1b0d07;
  --accent-wash: rgba(232, 100, 60, .12);
  --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
code { font-family: var(--mono); font-size: .86em; }
b, strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── type ─────────────────────────────────────────────────────── */

.display {
  font: 400 46px/1 var(--serif);
  letter-spacing: -.01em;
  margin: 0;
}
.display em { font-style: italic; }
.kicker {
  margin: 8px 0 0;
  font: 400 11.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.wordmark {
  margin: 0;
  font: italic 400 22px/1 var(--serif);
  color: var(--ink);
}

.rule-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.rule-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); order: 1; }
.rule-label .count { order: 2; }

/* ── layout ───────────────────────────────────────────────────── */

#app { min-height: 100dvh; }
.rail { display: none; }
.col { padding: 0 var(--gut) calc(var(--tabs-h) + var(--cap-h) + var(--safe-b) + 48px); max-width: 720px; margin: 0 auto; }

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 0 6px;
}

/* bottom tabs: words, not icons */
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font: 500 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}
.tab sup { font-size: 10px; color: var(--accent); top: -.6em; }
.tab.on { color: var(--ink); }
.tab.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--ink); }

/* capture bar */
.capture {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabs-h) + var(--safe-b));
  z-index: 19;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 0 var(--gut);
}
body.typing .tabs { display: none; }
body.typing .capture { bottom: var(--kb); padding-bottom: 0; }
.cap-row { display: flex; align-items: center; gap: 10px; height: var(--cap-h); max-width: 720px; margin: 0 auto; }
.cap-plus { font: 300 26px/1 var(--sans); color: var(--accent); width: 18px; text-align: center; margin-top: -3px; }
#cap-in {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
}
#cap-in::placeholder { color: var(--faint); }
.cap-more { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.cap-more svg { width: 20px; height: 20px; }
.cap-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 0 0 28px;
  font: 400 11px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.cap-preview[hidden] { display: none; }
.cap-preview .dest { color: var(--ink); font-weight: 500; }
.cap-preview .dest.later { color: var(--accent); }

/* ── rows ─────────────────────────────────────────────────────── */

.rows { list-style: none; margin: 0; padding: 0; }
.row, .lrow, .logrow {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--rule-2);
}
.row-body { flex: 1; min-width: 0; cursor: pointer; }
.row-title { font-size: 17px; line-height: 1.3; font-weight: 450; overflow-wrap: anywhere; }
.row-step {
  margin-top: 3px;
  font: italic 400 16px/1.3 var(--serif);
  color: var(--ink-2);
}
.row-step::before { content: "→ "; font-style: normal; color: var(--faint); }
.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 6px;
  font: 400 11px/1.3 var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.row-meta:empty { display: none; }
.m-due.now { color: var(--ink); font-weight: 500; }
.m-due.late { color: var(--accent); font-weight: 500; }
.m-later { color: var(--accent); }
.onit { display: inline-flex; align-items: center; gap: 4px; }

/* checkbox: a square of ink */
.box {
  flex: none;
  width: 24px; height: 24px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink-2);
  border-radius: 3px;
  color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.box svg { width: 15px; height: 15px; }
.row.is-late .box { border-color: var(--accent); }
@media (hover: hover) { .box:hover { color: var(--faint); } }
.box.on, .row.is-leaving .box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.row.is-done .row-title, .row.is-leaving .row-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--ink-2);
  text-decoration-thickness: 1.5px;
}
.row.is-leaving { animation: leave .5s .18s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(14px); } }
.row.is-done .box[disabled] { opacity: .5; cursor: default; }

/* the "today" pin: a sun on the horizon */
.pin {
  flex: none;
  width: 36px; height: 36px;
  margin: -6px -8px 0 0;
  display: grid;
  place-items: center;
  color: var(--faint);
}
.pin svg { width: 22px; height: 22px; }
.pin .disc { fill: transparent; transition: fill .15s; }
.pin.on { color: var(--accent); }
.pin.on .disc { fill: var(--accent); }
@media (hover: hover) { .pin:hover { color: var(--ink-2); } .pin.on:hover { color: var(--accent); } }

/* person mark: initials in a small square */
.who {
  display: inline-grid;
  place-items: center;
  min-width: 20px; height: 18px;
  padding: 0 3px;
  border-radius: 2px;
  background: var(--c, var(--muted));
  color: #fff;
  font: 500 10px/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.who.big { min-width: 34px; height: 34px; font-size: 13px; border-radius: 3px; }
.who.blank { background: transparent; }

/* ── today ────────────────────────────────────────────────────── */

.notice {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--accent-wash);
  border-left: 3px solid var(--accent);
}
.notice p { margin: 0; font-size: 15px; }
.notice-actions { display: flex; gap: 8px; margin-top: 12px; }
.empty { padding: 44px 0 8px; }
.empty-big { margin: 0; font: italic 400 40px/1.05 var(--serif); }
.empty-sub { margin: 10px 0 0; color: var(--ink-2); max-width: 34em; }
.suggest { margin-top: 18px; border-top: 1px solid var(--rule-2); }
.done-group { opacity: .9; }
.textbtn {
  margin-top: 18px;
  font: 500 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
}
.textbtn.small { margin: 0; font-size: 11px; }
.textbtn.danger { color: var(--accent); }
.logrow .textbtn { align-self: center; }

/* ── list controls ────────────────────────────────────────────── */

.controls { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; flex: none; }
.seg button {
  padding: 8px 12px;
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg.small button { padding: 7px 10px; font-size: 10.5px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 8px 0; font-size: 15px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.labels { display: flex; gap: 6px; overflow-x: auto; margin: 12px calc(-1 * var(--gut)) 0; padding: 0 var(--gut) 2px; scrollbar-width: none; }
.labels::-webkit-scrollbar { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  background: transparent;
  white-space: nowrap;
}
.tag small { font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.tag.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag.on small { color: var(--paper); opacity: .7; }
.tag input[type="date"] { border: 0; padding: 0; background: transparent; font-size: 13px; width: 8.5em; }

/* ── later (the ledger) ───────────────────────────────────────── */

.period { margin-top: 30px; }
.period-head { display: flex; align-items: baseline; gap: 10px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.period-head .big { font: 400 32px/1 var(--serif); }
.period-head .small { font: 400 11px/1 var(--mono); letter-spacing: .1em; color: var(--muted); }
.ledger .lrow { align-items: center; }
.ldate { flex: none; width: 34px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.ld { font: 400 24px/1 var(--serif); }
.lm { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.lrow .pin { margin-top: 0; }

/* things coming straight back, folded away */
.soon { margin-top: 18px; }
.soon summary { list-style: none; cursor: pointer; }
.soon summary::-webkit-details-marker { display: none; }
.soon .rule-label { margin-top: 6px; }
.soon .rule-label::before { content: "+"; order: 3; font-size: 14px; color: var(--ink-2); }
.soon[open] .rule-label::before { content: "–"; }
.soon-names { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon[open] .soon-names { display: none; }
.compact { margin-top: 4px; }
.crow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule-2); cursor: pointer; }
.crow .row-title { font-size: 15px; }
.crow-when { flex: none; font: 400 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.later-empty { margin-top: 26px; }

/* ── log ──────────────────────────────────────────────────────── */

.logrow { align-items: center; padding: 11px 0; }
.logrow .row-title { font-size: 16px; }
.logrow .row-meta { margin-top: 3px; }

/* ── buttons ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font: 500 14px/1 var(--sans);
  text-decoration: none;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost.on { border-color: var(--ink); background: var(--paper-2); }
.pinbtn svg { width: 18px; height: 18px; }
.pinbtn .disc { fill: transparent; }
.pinbtn.on { color: var(--ink); border-color: var(--accent); background: var(--accent-wash); }
.pinbtn.on svg { color: var(--accent); }
.pinbtn.on .disc { fill: var(--accent); }
.iconbtn { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); flex: none; }
.iconbtn svg { width: 14px; height: 14px; }

/* ── sheet ────────────────────────────────────────────────────── */

.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity .2s; }
body.sheet-open .scrim { opacity: 1; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 41;
  max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px));
  display: flex;
  background: var(--sheet);
  border-top: 1px solid var(--rule);
  border-radius: 6px 6px 0 0;
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
body.sheet-open .sheet { transform: none; }
.sheet-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.sheet-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px var(--gut);
  border-bottom: 1px solid var(--rule-2);
}
.sheet-bar > :first-child { justify-self: start; margin: 0; }
.sheet-bar > :last-child { justify-self: end; }
.sheet-kind { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.sheet-scroll { overflow-y: auto; padding: 16px var(--gut) calc(28px + var(--safe-b)); overscroll-behavior: contain; }

.title-in {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font: 400 30px/1.12 var(--serif);
  padding: 0;
  overflow: hidden;
}
.title-in::placeholder { color: var(--faint); }
.where { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }
.where b { font-weight: 600; color: var(--ink); }
.where-later b { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.snooze { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.form { margin-top: 10px; }
.f {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
}
.f > :not(.f-label) { grid-column: 2; min-width: 0; }
.f-label {
  grid-row: 1;
  padding-top: 10px;
  font: 500 10.5px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}
.f input:not([type]), .f input[type="date"], .f input[type="number"], .f select, .f textarea, .stack input, .inline-form input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  font-size: 15px;
  outline: 0;
}
.f input:focus, .f select:focus, .f textarea:focus, .stack input:focus, .inline-form input:focus { border-color: var(--ink-2); }
.f textarea { resize: vertical; line-height: 1.4; }
.f select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline > span { font-size: 14px; color: var(--ink-2); }
.inline input[type="date"] { width: auto; flex: 1; max-width: 13em; }
.inline select, .inline .num { width: auto; }
.num { width: 4.5em !important; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.hint.strong { color: var(--ink-2); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.days { display: flex; gap: 5px; }
.day { width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 3px; font: 500 13px/1 var(--mono); color: var(--ink-2); }
.day.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.checklist .box { width: 20px; height: 20px; margin: 0; }
.checklist .box svg { width: 12px; height: 12px; }
.checklist input { border-color: transparent !important; background: transparent !important; padding-left: 0 !important; }
.checklist li:has(.box.on) input { color: var(--muted); text-decoration: line-through; }
.ck-add .plus { width: 20px; text-align: center; color: var(--accent); font-size: 20px; }
.history { list-style: none; margin: 0; padding: 6px 0 0; display: grid; gap: 6px; }
.history li { display: flex; align-items: center; gap: 10px; font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; }
.sheet-foot .textbtn { margin: 0; }
.sheet-foot .muted { font: 400 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; }

/* settings */
.set { padding-bottom: 6px; }
.set .rule-label { margin: 24px 0 12px; }
.set:first-child .rule-label { margin-top: 4px; }
.people { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; }
.people input { flex: 1; min-height: 36px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); outline: 0; }
.swatch { width: 26px; height: 26px; border-radius: 3px; background: var(--c); flex: none; }
.inline-form { display: flex; gap: 8px; }
.inline-form .btn { flex: none; }
.stack { display: grid; gap: 8px; margin-bottom: 10px; max-width: 360px; }
.explain { margin: 0; display: grid; grid-template-columns: 64px 1fr; gap: 8px 12px; font-size: 14px; color: var(--ink-2); }
.explain dt { font: 500 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.explain dd { margin: 0; }
.explain svg { display: inline; width: 16px; height: 16px; vertical-align: -3px; color: var(--accent); }
.explain .disc { fill: var(--accent); }
.examples { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.examples code { background: var(--paper-2); padding: 2px 6px; border-radius: 2px; }
.colophon { margin-top: 28px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }

/* ── gates (sign in, who's this) ──────────────────────────────── */

body.gated .gate {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18vh) var(--gut) 40px;
}
.gate .wordmark { margin-bottom: 36px; color: var(--accent); }
.gate .display { font-size: 52px; }
.gate .kicker { margin-bottom: 26px; text-transform: none; letter-spacing: 0; font: 400 15px/1.45 var(--sans); color: var(--ink-2); }
.gate .stack { max-width: none; }
.gate .stack input { min-height: 46px; font-size: 17px; }
.gate .stack .btn { height: 46px; }
.error { min-height: 1.2em; margin: 0; color: var(--accent); font-size: 14px; }
.who-list { display: grid; gap: 8px; margin-bottom: 20px; }
.who-pick { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 20px; text-align: left; }

/* ── toast ────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: var(--gut); right: var(--gut);
  bottom: calc(var(--tabs-h) + var(--cap-h) + var(--safe-b) + 14px);
  z-index: 60;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-size: 14.5px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: none; }
.toast .textbtn { margin: 0; color: var(--paper); text-decoration-color: var(--muted); flex: none; }
body.sheet-open .toast { bottom: calc(18px + var(--safe-b)); }

body.offline .top::after {
  content: "offline";
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  font: 500 10px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── desktop ──────────────────────────────────────────────────── */

@media (min-width: 960px) {
  :root { --gut: 40px; }
  #app { display: grid; grid-template-columns: 232px 1fr; }
  .rail {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 34px 24px 24px 32px;
    border-right: 1px solid var(--rule);
  }
  .rail .wordmark { font-size: 26px; margin-bottom: 40px; }
  .rail-nav { display: grid; gap: 2px; }
  .rail-nav .tab {
    justify-content: flex-start;
    padding: 9px 0;
    font: 400 18px/1 var(--sans);
    text-transform: none;
    letter-spacing: 0;
  }
  .rail-nav .tab sup { font: 500 11px/1 var(--mono); margin-left: 6px; top: -.4em; }
  .rail-nav .tab.on { font-weight: 600; }
  .rail-nav .tab.on::before { top: 50%; left: -16px; right: auto; width: 8px; height: 2px; background: var(--accent); }
  .rail-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
  .tabs, #me-slot { display: none; }

  .col { width: 100%; max-width: 780px; margin: 0; padding: 0 var(--gut) 80px; }
  .top { padding-top: 46px; }
  .display { font-size: 60px; }

  .capture {
    position: sticky;
    top: 0;
    bottom: auto;
    z-index: 15;
    margin: 18px calc(-1 * var(--gut)) 0;
    padding: 0 var(--gut);
    border-top: 0;
    border-bottom: 1px solid var(--rule);
  }
  .cap-row { border: 1px solid var(--rule); border-radius: 3px; padding: 0 8px 0 12px; height: 50px; margin: 10px 0; max-width: none; }
  .cap-row:focus-within { border-color: var(--ink-2); }
  .cap-preview { padding: 10px 0 0 30px; max-width: none; }
  body.typing .capture { bottom: auto; }
  body.typing .tabs { display: none; }

  .row-title { font-size: 16.5px; }
  .pin { opacity: 0; transition: opacity .12s; }
  .row:hover .pin, .lrow:hover .pin, .pin.on, .pin:focus-visible { opacity: 1; }

  .sheet {
    left: auto; top: 0; bottom: 0; right: 0;
    width: min(500px, 100vw);
    max-height: none;
    border-top: 0;
    border-left: 1px solid var(--rule);
    border-radius: 0;
    transform: translateX(100%);
  }
  .sheet-bar { padding: 14px 28px; }
  .sheet-scroll { padding: 20px 28px 40px; }
  .toast { bottom: 24px; left: auto; right: 32px; width: 420px; }
  body.sheet-open .toast { right: 532px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; }
