/* Layout: one note-width column. Days stack as sections with sticky headers; each line shows its raw
   shorthand, with times, dates and markers tinted so a day reads at a glance. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --fg: #16181d;
  --muted: #676e7e;
  --faint: #a2a8b4;
  --rule: #e1e4ea;
  --accent: #2b58d4;
  --accent-soft: #e8eefc;
  --now: #e5484d;
  --done: #1c9656;
  --danger: #d6423d;
  --warn: #e09a1c;
  --on-color: #ffffff;
  --hl-purple: #e6d9ff; --hl-pink: #ffd6e8; --hl-orange: #ffdcae; --hl-mint: #c8f0dc; --hl-blue: #d2e4ff;
  --toast-bg: #1e2128;
  --toast-fg: #f2f3f6;
  --toast-link: #a3b8ff;
  --shadow: 0 10px 30px rgb(22 27 45 / .16), 0 2px 6px rgb(22 27 45 / .08);
  /* Apple's system font (SF Pro), as in Notes; large sizes get its display cut automatically. */
  --ui: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --bar: 52px;
  --find: #ffe17a;
  /* Motion (Emil Kowalski's curves): ease-out for things responding to a touch, drawer for sheets. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --step: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #16181d; --fg: #e8eaef; --muted: #979daa; --faint: #5f6572; --rule: #2a2e37;
    --accent: #8ba6ff; --accent-soft: #1d2645; --now: #ff5f5a; --done: #45c485; --danger: #ff6a63; --warn: #f0b440; --find: #6b5413; --on-color: #0f1115; --hl-purple: #4b3d7a; --hl-pink: #6e3050; --hl-orange: #6e4816; --hl-mint: #1d5a42; --hl-blue: #24466f;
    --toast-bg: #e8eaef; --toast-fg: #16181d; --toast-link: #2b58d4; --shadow: 0 10px 30px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #16181d; --fg: #e8eaef; --muted: #979daa; --faint: #5f6572; --rule: #2a2e37;
  --accent: #8ba6ff; --accent-soft: #1d2645; --now: #ff5f5a; --done: #45c485; --danger: #ff6a63; --warn: #f0b440; --find: #6b5413; --on-color: #0f1115; --hl-purple: #4b3d7a; --hl-pink: #6e3050; --hl-orange: #6e4816; --hl-mint: #1d5a42; --hl-blue: #24466f;
  --toast-bg: #e8eaef; --toast-fg: #16181d; --toast-link: #2b58d4; --shadow: 0 10px 30px rgb(0 0 0 / .5);
  color-scheme: dark;
}

[hidden] { display: none !important; }
/* Feel like an app, not a page: no tap flash, no page bounce, no double-tap zoom delay. */
html { font-size: 17px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
/* iPhone and iPad (the only browsers with touch callouts): text follows Settings → Display & Brightness →
   Text Size, as in Notes. Sizes below are in rem, relative to it; bars and buttons stay put. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}
body {
  margin: 0;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.4 var(--ui);
  touch-action: manipulation;
}
/* Buttons are controls: no text selection or callout on a long press, and they give way a little when pressed. */
button { font: inherit; color: inherit; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fab, .mini, .act, .primary, .pill, .done-btn { transition: transform 160ms var(--ease-out); }
.fab:active, .mini:active, .act:active, .primary:active, .pill:active, .done-btn:active { transform: scale(0.97); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-more { stroke-width: 3; }

/* ---- Top bar (Templates and Archive only) ---- */
body.sub { --top: var(--bar); }
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  margin-inline: -16px; padding-inline: 8px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.bar-in { display: flex; align-items: center; gap: 2px; max-width: 696px; height: var(--bar); margin: 0 auto; }
.bar h1 { flex: 1; min-width: 0; margin: 0; font: 700 1.3rem/1 var(--ui); letter-spacing: -.01em; }
.ib {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: none; color: var(--accent); cursor: pointer;
}
.ib:active { background: var(--accent-soft); }
.ib.sm { width: 32px; height: 28px; color: var(--faint); }
.search { display: flex; align-items: center; gap: 10px; max-width: 680px; margin: 4px auto 8px; }
.search input { flex: 1; width: 100%; box-sizing: border-box; }
#q-count { flex: none; }
#q-count:empty { display: none; }
.done-btn { flex: none; padding: 8px 2px; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
/* On the planner the search bar stays at the top while results scroll under it. */
body.finding .search {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  max-width: none; margin: 0 -16px; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
body.finding .dh { position: static; }
::highlight(find) { background-color: var(--find); color: var(--fg); }
/* The line a search result led to glows for a moment. */
.ln.flash { animation: flash 1.6s var(--ease-out); }
@keyframes flash { from, 30% { background-color: var(--find); } to { background-color: transparent; } }

/* ---- Menu button: bottom right, like Notes' compose button ---- */
.fab {
  position: fixed; z-index: 8;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--accent);
  box-shadow: var(--shadow); cursor: pointer;
}
.fab .dot { position: absolute; top: 5px; right: 5px; width: 10px; height: 10px; border: 2px solid var(--surface); border-radius: 50%; background: var(--warn); }
.fab .dot.bad { background: var(--danger); }
body.editing .fab, body.dragging .fab { display: none; }
/* Small round buttons left of the menu: search, then collapse/expand all. */
.mini {
  position: fixed; z-index: 8; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--accent);
  box-shadow: var(--shadow); cursor: pointer;
}
.mini .ic { width: 20px; height: 20px; stroke-width: 2; }
.fold { right: calc(74px + env(safe-area-inset-right, 0px)); }
.find { right: calc(122px + env(safe-area-inset-right, 0px)); }
body.sub .fold { right: calc(16px + env(safe-area-inset-right, 0px)); }
body.editing .mini, body.dragging .mini, body.finding .mini, body.selecting .mini, body.selecting .fab { display: none; }

/* ---- Days ---- */
main { display: flex; flex-direction: column; gap: 2px; max-width: 680px; margin: 0 auto; padding-bottom: 45dvh; }
.day { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--top, 0px)); }
.dh {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top, 0px)); z-index: 3;
  display: flex; align-items: center; gap: 6px; margin-inline: -8px; padding: 6px 8px 2px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.dt {
  display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; min-height: 28px;
  padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.dt .ic { width: 13px; height: 13px; flex: none; color: var(--faint); stroke-width: 2.6; transform: rotate(90deg); transition: transform 150ms var(--ease-out); }
.day.folded .dt .ic { transform: none; }
.dt h2 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 1.24rem/1.2 var(--ui); letter-spacing: -.01em; }
.chip {
  flex: none; padding: 3px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font: 650 .6rem/1 var(--ui); letter-spacing: .06em; text-transform: uppercase;
}
.chip.past { background: var(--rule); color: var(--muted); }
.cnt { color: var(--faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.chip:empty, .cnt:empty, .pill:empty { display: none; }
.pill {
  flex: none; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--surface); font: 600 .7rem/1 var(--ui); cursor: pointer;
}
.day.folded > :not(.dh) { display: none; }
.day.today .dt h2 { color: var(--accent); }
.end { min-height: 12px; cursor: text; }   /* tap below a day's last line to add one */
.day.empty .end { min-height: 26px; }
.day.empty .end::before { content: "Tap to add a line"; color: var(--faint); font-size: .88rem; line-height: 26px; }
.fl { margin-top: 6px; border-top: 1px dashed var(--rule); }
.fl-h { padding: 10px 0 2px; color: var(--faint); font: 650 .65rem/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; }
p.empty { margin: 0; padding: 40px 8px; color: var(--muted); text-align: center; }
.act.add-tpl { justify-content: center; color: var(--accent); }
.welcome { display: flex; flex-direction: column; gap: 10px; max-width: 460px; margin: 12vh auto 0; }
.welcome h2 { margin: 0; font: 700 1.4rem/1.2 var(--ui); text-wrap: balance; }
.welcome p { margin: 0 0 8px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.welcome .act { justify-content: center; color: var(--accent); background: var(--surface); border: 1px solid var(--rule); }

/* ---- Lines ---- */
.ln {
  position: relative; display: flex; align-items: flex-start; gap: 6px;
  margin-inline: -8px; padding: 1px 8px 1px calc(8px + var(--i, 0) * var(--step));
  font-size: max(16px, .94rem);   /* lines are typed in: under 16px, iOS zooms in on focus */
  border-radius: 8px; cursor: text; touch-action: pan-y;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.tx { flex: 1; min-width: 0; min-height: 1.32em; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.ln.ed { background-color: var(--accent-soft); -webkit-user-select: text; user-select: text; }
.ln.bul::before {
  content: ""; position: absolute; top: .66em; left: calc(8px + var(--i) * var(--step) - 14px);
  width: 7px; height: 1.6px; border-radius: 1px; background: var(--faint);
}
/* Headers ("Work:") and lines with sub-items read as headings, like Notes' collapsible sections. */
.ln.head .tx, .ln.par .tx { font-weight: 600; }
/* A blank line is a paragraph gap, not a full line, until it's tapped. */
.ln.blank:not(.ed), .ln.blank:not(.ed) .tx { min-height: 8px; line-height: 8px; }
.ln.done .tx { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.ln.done .s-t, .ln.done .s-d, .ln.done a { color: inherit; }
.s-t, .s-d { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.s-m { color: var(--faint); }
.s-q { color: var(--muted); }
.tx a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; word-break: break-all; }
.fd {
  display: flex; align-items: center; gap: 2px; flex: none; height: 21px; padding: 0 4px 0 6px;
  border: 0; border-radius: 6px; background: none; color: var(--faint); font: 550 .76rem/1 var(--ui);
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.fd .ic { width: 14px; height: 14px; stroke-width: 2.4; transform: rotate(90deg); transition: transform 150ms var(--ease-out); }
.ln.folded .fd { background: var(--rule); color: var(--muted); }
.ln.folded .fd .ic { transform: none; }
.ln.mir { cursor: text; }
/* Select mode: selected lines are tinted, with a bar on their left edge. */
body.selecting .ln { cursor: pointer; }
.ln.sel { background-color: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.ln.sel + .ln.sel { border-top-left-radius: 0; border-top-right-radius: 0; }   /* selected neighbours read as one block */
.ln.sel:has(+ .ln.sel) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* Text styles and highlights inside a line. A highlight hugs the text like a marker. */
.fb { font-weight: 700; }
.fi { font-style: italic; }
.fu { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fs { text-decoration: line-through; text-decoration-thickness: 1px; }
.fu.fs { text-decoration-line: underline line-through; }
.tx mark { padding: 1px 2px; margin: 0 -2px; border-radius: 4px; background: var(--hl); color: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
[data-c="purple"], [data-hl="purple"] { --hl: var(--hl-purple); }
[data-c="pink"], [data-hl="pink"] { --hl: var(--hl-pink); }
[data-c="orange"], [data-hl="orange"] { --hl: var(--hl-orange); }
[data-c="mint"], [data-hl="mint"] { --hl: var(--hl-mint); }
[data-c="blue"], [data-hl="blue"] { --hl: var(--hl-blue); }
.tx mark .s-t, .tx mark .s-d { color: inherit; }
.ln.done mark { background: none; }

/* "Now": a red rule above the next timed line, or under the last line of today. */
.ln.nowb, .ls.nowend { background-image: linear-gradient(var(--now), var(--now)); background-repeat: no-repeat; background-size: 100% 2px; }
.ln.nowb { background-position: 0 0; }
.ls.nowend { position: relative; padding-bottom: 10px; background-position: 0 100%; }
.ln.nowb::after, .ls.nowend::after {
  content: attr(data-now); position: absolute; right: 0; padding: 2px 6px; border-radius: 5px;
  background: var(--now); color: var(--on-color); font: 650 .65rem/1.2 var(--ui); font-variant-numeric: tabular-nums;
}
.ln.nowb::after { top: -9px; }
.ls > .ln.nowb:first-child { margin-top: 10px; }   /* keep the time label clear of the day header */
.ls.nowend::after { bottom: -7px; }

/* ---- Swipe and drag ---- */
.ln.swiping { overflow: hidden; isolation: isolate; }
.ln.settle > .tx, .ln.settle > .fd { transition: transform 200ms var(--ease-out); }
.ln.settle > .sw { transition: width 200ms var(--ease-out); }
/* The strip a swipe opens: Done under the line as it slides right, or the Tomorrow and Delete buttons
   coming in over its right end, which share the strip until a long swipe gives it all to Delete. */
.sw {
  position: absolute; top: 0; bottom: 0; z-index: -1; display: flex; overflow: hidden;
  color: var(--muted); font: 650 .76rem/1 var(--ui); white-space: nowrap; pointer-events: none;
}
.sw.r { left: 0; align-items: center; }
.sw.r span { padding-left: 14px; }
.sw.go.r { background: var(--done); color: var(--on-color); }
.sw.l { right: 0; z-index: 1; border-radius: 8px; }
.sa {
  flex: 1 1 0; min-width: 0; padding: 0 6px; overflow: hidden; border: 0; color: var(--on-color); font: inherit;
  cursor: pointer; pointer-events: auto; transition: flex-grow 150ms var(--ease-out);
}
.sa.next { background: var(--accent); }
.sa.del { background: var(--danger); }
.sw.go .sa.next { flex-grow: 0; padding: 0; }
body.dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
.ln.lift { opacity: .3; }
.ghost { position: fixed; top: 0; z-index: 20; box-sizing: border-box; margin: 0; background: var(--surface); box-shadow: var(--shadow); pointer-events: none; }
.ghost[data-more]::after {
  content: attr(data-more); position: absolute; top: 6px; right: 8px; padding: 3px 7px; border-radius: 999px;
  background: var(--accent); color: var(--on-color); font: 650 12px/1 var(--ui);
}
.dropbar { position: fixed; z-index: 19; height: 2px; border-radius: 2px; background: var(--accent); pointer-events: none; }

/* ---- Toolbar above the keyboard ---- */
.kb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 2px;
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.kb-row { display: flex; justify-content: center; gap: 1px; flex: 0 1 420px; min-width: 0; }
/* Buttons narrow a little when the row wouldn't fit the screen. */
.kb .ib { flex: 0 1 36px; width: auto; min-width: 0; color: var(--fg); }
.kb .sw-c { display: grid; place-items: center; flex: 0 1 36px; min-width: 0; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.kb .sw-c::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--hl); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.kb .sw-c.on::before { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fg); }
.kb .aa, .kb .st { font: 600 17px/1 var(--ui); }
.kb .aa { letter-spacing: -.02em; }
.kb .st.on { background: var(--accent-soft); color: var(--accent); }
.kb .st b, .kb .st i, .kb .st u, .kb .st s { font-weight: inherit; }
.kb .st b { font-weight: 800; }
.kb .ib.on { color: var(--done); }

/* ---- Select mode bar ---- */
.selbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 2px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform 300ms var(--ease-drawer);
}
@starting-style { .selbar { transform: translateY(100%); } }
.selbar-h, .selbar-row { max-width: 520px; margin: 0 auto; }
.selbar-h { display: flex; align-items: center; justify-content: space-between; padding-left: 4px; color: var(--muted); font-size: 14px; }
.selbar-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sb {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 2px;
  border: 0; border-radius: 12px; background: none; color: var(--accent); font: 600 12px/1.1 var(--ui); cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.sb:active:not(:disabled) { background: var(--accent-soft); transform: scale(0.97); }
.sb:disabled { opacity: .35; cursor: default; }
.sb.danger { color: var(--danger); }
body.dragging .selbar { display: none; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100% - 32px); box-sizing: border-box;
  padding: 10px 12px 10px 16px; border-radius: 12px; transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow); font-size: 15px;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translate(-50%, 8px); } }
.toast.out { opacity: 0; transform: translate(-50%, 4px); transition-duration: 150ms; pointer-events: none; }
.toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { flex: none; padding: 4px; border: 0; background: none; color: var(--toast-link); font-weight: 650; cursor: pointer; }
body.editing .toast { bottom: 64px; }
body.sub .toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
body.selecting .toast { bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }

/* ---- Sheets ---- */
.sheet {
  width: min(560px, 100%); max-width: 100%; max-height: min(86dvh, 760px); box-sizing: border-box;
  margin: auto auto 0; padding: 0; border: 0; border-radius: 16px 16px 0 0;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
}
.sheet[open] { display: flex; flex-direction: column; transition: transform 300ms var(--ease-drawer), opacity 200ms var(--ease-out); }
.sheet::backdrop { background: rgb(10 12 18 / .4); transition: opacity 300ms var(--ease-drawer); }
/* A phone sheet rises from the bottom edge; on a wide screen it's a centered card that settles in. */
@starting-style { .sheet[open] { transform: translateY(100%); } .sheet[open]::backdrop { opacity: 0; } }
@media (min-width: 720px) {
  .sheet { margin: auto; border-radius: 16px; }
  @starting-style { .sheet[open] { transform: scale(0.96); opacity: 0; } }
}
.sh-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 6px 18px; }
.sh-h h3 { margin: 0; font: 650 1.12rem/1.2 var(--ui); }
.sh-h .ib { color: var(--muted); }
.sh-b { display: flex; flex-direction: column; gap: 8px; overflow: auto; overscroll-behavior: contain; padding: 4px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.act {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px;
  padding: 0 16px; border: 0; border-radius: 12px; background: var(--bg); font-size: .94rem; text-align: left; cursor: pointer;
}
.act.danger { color: var(--danger); }
.act .ic { color: var(--accent); }
.hint { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.note { margin: 4px 2px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: .76rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea {
  min-width: 0; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg); color: var(--fg); font: max(16px, .94rem) var(--ui);   /* under 16px, iOS zooms in on focus */
}
textarea { min-height: 38dvh; resize: vertical; line-height: 1.4; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.note.err { color: var(--danger); }
.fill-rows { display: flex; flex-direction: column; gap: 6px; }
.fill-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.fill-row > span:first-child { font-variant-numeric: tabular-nums; }
.fill-row select { width: 58%; }
.primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; margin-top: 4px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--on-color); font-size: .94rem; font-weight: 650; cursor: pointer;
}
.primary .hint { color: inherit; opacity: .75; font-weight: 500; }
.primary:disabled { opacity: .45; cursor: default; }

/* Reduced motion: no movement, but fades stay, since they help follow what changed. */
@media (prefers-reduced-motion: reduce) {
  .dt .ic, .fd .ic, .ln.settle > .tx, .ln.settle > .fd, .ln.settle > .sw, .sa { transition: none; }
  .fab:active, .mini:active, .act:active, .primary:active, .pill:active, .done-btn:active, .sb:active:not(:disabled) { transform: none; }
  @starting-style { .sheet[open] { transform: none; opacity: 0; } .toast { transform: translateX(-50%); } .selbar { transform: none; } }
  .toast.out { transform: translateX(-50%); }
}
