:root {
  /* Surfaces — low → high elevation. --surface-card aliases --bg-elev for
     the app's card/month-card/backlog-section family (semantic name, same
     value) per the LifeLog design system's two-layer token convention. */
  --bg: #11141a;
  --bg-elev: #1a1f29;
  --bg-elev-2: #222836;
  --hover-bg: #2b3242;
  --surface-card: var(--bg-elev);
  --scrim: rgba(0,0,0,.55);
  --border: #2c3342;
  --border-strong: var(--hover-bg);
  --text: #e6e9ef;
  --text-dim: #9aa3b2;
  /* Decoration only: placeholders, glyphs (✕ › grips), done and disabled
     items. Anything you need to read is --text-dim (DESIGN.md §2). */
  --text-faint: #808999;
  /* Text placed on top of a solid color fill (badges, filled category
     dots) vs. on top of the accent fill specifically (primary buttons,
     active tabs/chips) — these can differ per theme when the accent is
     light (see theme-nord, theme-dracula below). */
  --text-on-fill: #ffffff;
  --text-on-accent: #ffffff;
  --accent: #5b8cff;
  --accent-hover: #6f9bff;
  --accent-soft: rgba(91,140,255,.14);
  /* The accent as a fill under --text-on-accent (primary buttons, active
     tabs and chips). Separate from --accent because the Default blue is
     too light for white text, and darkening --accent itself would sink
     every link and active label drawn in it on the dark surfaces. Themes
     whose accent already passes alias it straight back. */
  --accent-fill: #4a71cf;
  --accent-fill-hover: #3f63ba;
  --danger: #ec6b62;
  --danger-bg: rgba(226,85,75,.12);
  --danger-text: #ffcaca;
  --success: #4bd07a;
  --expense: var(--danger);
  --led-idle: var(--text-faint);
  --led-connected: var(--success);
  --led-local: var(--warning);
  --led-syncing: var(--accent);
  /* Priority (backlog stars) is a fixed amber identity color, not a
     theme-reactive status — it stays the same hue in every theme, same
     as the category color ramp. Only the Light theme deepens it, because
     this amber all but vanishes on white. */
  --priority: #e2b23b;
  --priority-hover: #f3ca6b;
  --warning: #e2b23b;
  /* Scrollbar thumb — an alias pair rather than per-theme values, since
     every theme already defines the two text tones it points at. */
  --scroll-thumb: var(--text-faint);
  --scroll-thumb-hover: var(--text-dim);
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  --nav-shadow: rgba(0,0,0,.35);
  --ease: cubic-bezier(.4,0,.2,1);
  /* Movement, for lists reconciled with animate:true (see reconcile.js).
     Slower and softer than --dur, which is for hover and press feedback:
     a row crossing a rule is telling you where it went, not acknowledging
     a tap. */
  --ll-move-dur: .3s;
  --ll-move-ease: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: .12s;
  --dur: .18s;
  /* Springs (0.222.0): a damped spring sampled into linear() stops, so a
     plain transition can overshoot and settle. Snappy for small things
     that answer a finger (~12% over); soft for sheets (~1.5%). Unlike the
     cubic-beziers above they need their own duration, so each comes with
     its -ms. Both are made by LifeLog's motion engine (src/motion.js, on
     keel's), critically damped with a mouse on a big screen; the
     fallbacks are the curves they used to be pasted as. */
  --spring-snappy: var(--ll-spring-control, linear(0, 0.05, 0.173, 0.336, 0.511, 0.678, 0.823, 0.94, 1.026, 1.083, 1.115, 1.126, 1.122, 1.108, 1.088, 1.066, 1.044, 1.025, 1.01, 0.998, 0.99, 0.986, 0.984, 0.984, 1));
  --spring-snappy-ms: var(--ll-spring-control-ms, .35s);
  --spring-soft: var(--ll-spring-sheet, linear(0, 0.021, 0.076, 0.152, 0.239, 0.332, 0.424, 0.512, 0.594, 0.668, 0.733, 0.79, 0.839, 0.879, 0.913, 0.94, 0.961, 0.978, 0.991, 1, 1.007, 1.011, 1.014, 1.015, 1));
  --spring-soft-ms: var(--ll-spring-sheet-ms, .4s);

  /* Scales (0.222.0, DESIGN.md §3–4). Font sizes and radii use these;
     spacing is still written as px, on the same steps, and moves onto
     the tokens as rules are touched. */
  --fs-3xs: 10px; --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px;
  --fs-read: 15px; --fs-lg: 16px; --fs-xl: 18px; --fs-title: 20px; --fs-2xl: 22px;
  --fs-stat: 26px; --fs-3xl: 30px;
  --fs-display-sm: 42px; --fs-display: 52px; --fs-display-lg: 64px;
  --space-2: 2px; --space-4: 4px; --space-6: 6px; --space-8: 8px;
  --space-10: 10px; --space-12: 12px; --space-14: 14px; --space-16: 16px;
  --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-48: 48px;
  --r-hair: 2px; --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: var(--radius);
  --r-card: 12px; --r-xl: 14px; --r-sheet: 18px; --r-pill: 999px;
  font-synthesis: none;
}

/* ---------- themes (Settings → Appearance → Theme) ---------- */
/* Default has no class — it's the :root palette above. Each alternate
   theme just overrides the same variable set, so every rule in this file
   that already reads var(--...) repaints automatically. Device-local. */
html.theme-light {
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --bg-elev-2: #eef0f4;
  --hover-bg: #e4e7ed;
  --surface-card: var(--bg-elev);
  --scrim: rgba(27,31,39,.35);
  --border: #d8dce3;
  --border-strong: var(--hover-bg);
  --text: #1b1f27;
  --text-dim: #545b6b;
  --text-faint: #707786;
  --text-on-fill: #ffffff;
  --text-on-accent: #ffffff;
  --accent: #3a66cc;
  --accent-hover: #2f55ad;
  --accent-soft: rgba(58,102,204,.10);
  --accent-fill: var(--accent);
  --accent-fill-hover: var(--accent-hover);
  /* The amber stars are 1.97:1 on white; this keeps the hue and reaches 3:1. */
  --priority: #b58e2f;
  --priority-hover: #9c7a28;
  --danger: #c23b32;
  --danger-bg: rgba(194,59,50,.08);
  --danger-text: #8a1f17;
  --success: #2e9e5b;
  --warning: #b3841f;
  --led-connected: var(--success);
  --led-local: var(--warning);
  --shadow: 0 8px 30px rgba(0,0,0,.12);
  --nav-shadow: rgba(0,0,0,.10);
}
html.theme-nord {
  --bg: #2e3440;
  --bg-elev: #3b4252;
  --bg-elev-2: #434c5e;
  --hover-bg: #4c566a;
  --surface-card: var(--bg-elev);
  --scrim: rgba(0,0,0,.5);
  --border: #4c566a;
  --border-strong: var(--hover-bg);
  --text: #eceff4;
  --text-dim: #d8dee9;
  --text-faint: #a5afc1;
  --text-on-fill: #ffffff;
  /* Nord's accent (Frost cyan) is light — dark text reads far better on
     it than white. */
  --text-on-accent: #22262f;
  --accent: #88c0d0;
  --accent-hover: #8fbcbb;
  --accent-soft: rgba(136,192,208,.14);
  --accent-fill: var(--accent);
  --accent-fill-hover: var(--accent-hover);
  /* Nord's Aurora red (#bf616a) is 2.46:1 on a card. Any red that passes
     on Nord's mid-grey surfaces comes out this light. */
  --danger: #ea9aa1;
  --danger-bg: rgba(191,97,106,.15);
  --danger-text: #f2c6ca;
  --success: #a3be8c;
  --warning: #ebcb8b;
  --led-connected: var(--success);
  --led-local: var(--warning);
  --shadow: 0 8px 30px rgba(0,0,0,.5);
  --nav-shadow: rgba(0,0,0,.4);
}
html.theme-dracula {
  --bg: #282a36;
  --bg-elev: #343746;
  --bg-elev-2: #44475a;
  --hover-bg: #565970;
  --surface-card: var(--bg-elev);
  --scrim: rgba(0,0,0,.6);
  --border: #44475a;
  --border-strong: var(--hover-bg);
  --text: #f8f8f2;
  --text-dim: #c1c4e0;
  --text-faint: #8d97bf;
  --text-on-fill: #ffffff;
  /* Dracula's accent (violet) is light — same reasoning as Nord above. */
  --text-on-accent: #21222c;
  --accent: #bd93f9;
  --accent-hover: #cfa9fb;
  --accent-soft: rgba(189,147,249,.16);
  --accent-fill: var(--accent);
  --accent-fill-hover: var(--accent-hover);
  --danger: #ff7575;
  --danger-bg: rgba(255,85,85,.15);
  --danger-text: #ffb3b3;
  --success: #50fa7b;
  --warning: #f1fa8c;
  --led-connected: var(--success);
  --led-local: var(--warning);
  --shadow: 0 8px 30px rgba(0,0,0,.5);
  --nav-shadow: rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

/* Keyboard-focus ring, app-wide — buttons/links/labelled controls had no
   custom focus style at all (only a handful of text inputs did), so
   keyboard navigation through the UI's many icon-only buttons had no
   visible landing indicator beyond whatever bare default the browser
   happened to draw. One rule covers every button/link/tabbable element;
   :focus-visible keeps it from showing on a plain mouse click. */
button:focus-visible, a:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Pressables, app-wide. Every browser draws its own highlight rect over a
   tapped control — a translucent blue-grey block that ignores the control's
   shape — and a press that lingers on one starts selecting its label instead
   of activating it. Four places had been fixed by hand (the tabs, the jump
   arrows, backlog rows, note cards); an audit across every view and modal
   found 105 more, which is to say all of them. One rule instead.
   `.tab` is in the list although its own rule already covers it, so the
   next pressable added near one inherits the right thing by default.
   Anything outside <button> is here because this app uses it as a button. */
button, [role="button"], summary,
.tab, .cat-chip, .chip-edit, .filter-label, .toggle-label {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
/* user-select inherits, and several of those labels wrap a real field. */
input, textarea, select { -webkit-user-select: auto; user-select: auto; }

/* Removing the highlight removes the only press feedback touch had: before
   this the app owned exactly one :active rule in ~2000 lines, so without a
   replacement every tap would go dead. Transient, so unlike a row's *state*
   it is fine on opacity (see NOTES.md on .ll-enter owning that property) —
   nothing animates for the length of a press.
   :disabled is excluded: a button that can't act shouldn't answer.
   The movement that goes with it — a sink and a spring back — is
   wirePressFeedback() in app.js (0.211.0); this dim is lighter since. */
button:active:not(:disabled), [role="button"]:active, summary:active,
.tab:active, .cat-chip:active, .chip-edit:active,
.filter-label:active, .toggle-label:active { opacity: .75; }
/* The highlight is inherited, so the list above only ever reached what it
   named: every row and card that takes a tap as a whole (entries, backlog
   and ledger rows, notes, collection cards) still drew the browser's blue
   box. Off at the root, it's off for anything added later too (0.210.0). */
html { -webkit-tap-highlight-color: transparent; }
/* Their press, in the place of that box: rows darken, cards give a little.
   Not while the press is on a control inside one — a ✓ Done or a list's
   tick answers for itself, and the row lighting up under it would read as
   the row having been tapped. `scale`, not transform: .ll-enter animates
   transform, and the two would fight. */
.entry, .backlog-item-rich, .recur-row { transition: background-color var(--dur-fast) var(--ease); }
.note-card, .coll-card { transition: border-color var(--dur-fast) var(--ease), scale var(--dur-fast) var(--ease); }
:is(.entry, .backlog-item-rich, .recur-row):active:not(:has(button:active, input:active, select:active, a:active)) {
  background: var(--hover-bg);
}
:is(.note-card, .coll-card):active:not(:has(button:active, input:active, select:active, a:active, .todo-row:active, .todo-compose:active)) {
  scale: .98;
}
@media (prefers-reduced-motion: reduce) {
  .note-card, .coll-card { transition: none; }
  :is(.note-card, .coll-card):active { scale: none; }
}
/* Animations turned off in Settings → Appearance: nothing moves at all,
   not even the fades reduced motion keeps. The engine's own moves check
   the same attribute (src/keel/motion.js). */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
:root[data-motion="off"] ::details-content { transition: none !important; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family, "Segoe UI", system-ui, -apple-system, sans-serif);
  font-size: var(--fs-md);
  /* The mode swipe and its animation translate #content sideways, which
     pushes it past the right edge and makes the *document* wider than the
     viewport. The page then becomes horizontally scrollable and the layout
     viewport grows — and the fixed bottom bar, sized to that viewport,
     grew and shifted with it. On a phone that reads as the nav bar jumping
     and sitting slightly off to one side for the length of the gesture.
     `clip` rather than `hidden` on purpose: hidden would make this a scroll
     container, and every sticky year/month header in the app sticks to the
     viewport through here. */
  overflow-x: clip;
}

::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- checkbox ---------- */
/* The native control is drawn by the OS — a grey Windows square here, a
   blue rounded iOS one there — and `accent-color` only ever repaints its
   fill; the box, the tick, the corner radius and the size stay whatever
   the machine feels like. This draws all of it from the same tokens as
   the rest of the app, so a checkbox belongs to its theme instead of to
   the platform. One size (16px) app-wide: the per-context width/height/
   accent-color declarations that used to vary between 15 and 16px are
   gone, and the full-width rules for text fields (.modal label input,
   .ovr input) now exclude checkboxes rather than being un-done by an
   !important further down. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto; width: 16px; height: 16px; margin: 0; padding: 0;
  display: inline-grid; place-content: center;
  background: var(--bg); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
/* The tick is a clipped block rather than a background image, so it can
   take var(--text-on-accent) — Nord and Dracula put dark ink on their
   light accent, and a baked-in white SVG would be invisible there. */
input[type="checkbox"]::before {
  content: ""; width: 10px; height: 10px;
  background: var(--text-on-accent);
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 85% 0, 38% 70%);
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease);
}
/* The display above outranks the UA stylesheet's [hidden] { display: none },
   which would otherwise expose the checkboxes that exist only to hold state
   for a button elsewhere in the form (#bPriority/#bBought/#bDropped behind
   the backlog modal's ★/✓/dropped toggles). Same companion rule the rest of
   this file already carries next to every other author display. */
input[type="checkbox"][hidden] { display: none; }
input[type="checkbox"]:hover:not(:disabled) { border-color: var(--accent); }
input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::before { transform: scale(1); }
/* Some but not all of a "select all" set is ticked: a bar, not a tick. */
input[type="checkbox"]:indeterminate::before {
  clip-path: inset(43% 13% 43% 13% round 1px); transform: scale(1);
}
input[type="checkbox"]:disabled { cursor: default; opacity: .45; }
/* The app-wide focus ring sets border-radius:4px on whatever it lands on, which would square the box off mid-focus; and 2px of offset crowds a
   control this small. */
input[type="checkbox"]:focus-visible { border-radius: var(--r-sm); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  input[type="checkbox"], input[type="checkbox"]::before { transition: none; }
}

/* ---------- scrollbars ---------- */
/* Gated on a real pointer: touch browsers draw a transient overlay bar
   that already gets out of the way, and asking for a width there would
   pin a permanent one into the layout instead. scrollbar-width/-color are
   inherited, so `html` covers every scroll container (Firefox); the
   ::-webkit- rules are unscoped and do the same for Chrome/Edge/Safari.
   The thumb is inset by a transparent border rather than sized down, so
   the hit target stays the full width of the track. */
@media (hover: hover) and (pointer: fine) {
  /* Chromium ignores every ::-webkit- rule below the moment scrollbar-width
     is anything but auto, so the standard property is handed only to the
     browsers that have nothing else — Firefox, which in turn has no
     ::-webkit-scrollbar to test for. */
  @supports not selector(::-webkit-scrollbar) {
    html { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
  }
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb); background-clip: padding-box;
    border: 3px solid transparent; border-radius: var(--r-pill);
  }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active {
    background: var(--scroll-thumb-hover); background-clip: padding-box;
  }
  ::-webkit-scrollbar-corner { background: transparent; }
  /* The page scrolls as the document, so its bar spans the whole window —
     up behind the sticky top bar and down behind the fixed bottom one.
     Inset the track by both (measured live in app.js; the bottom one is 0
     on desktop, where #topbarBottom is display:contents). `body`, not
     `html`: Chromium takes the page scrollbar's style from the body and
     ignores html::/:root:: here. Firefox has no track margin, so its bar
     still runs full height. */
  body::-webkit-scrollbar-track {
    margin-top: var(--topbar-h, 0px); margin-bottom: var(--bottombar-h, 0px);
  }
  /* The bar's column sits beside the bars, not under them, so the header
     and the tab bar stopped 12px short of the edge. Paint the ends of the
     column as the bars, their 1px borders included, so both read full width. */
  body::-webkit-scrollbar {
    background: linear-gradient(to bottom,
      var(--bg-elev) calc(var(--topbar-h, 0px) - 1px), var(--border) 0 var(--topbar-h, 0px),
      transparent 0 calc(100% - var(--bottombar-h, 0px)),
      var(--border) 0 calc(100% - var(--bottombar-h, 0px) + 1px), var(--bg-elev) 0);
  }
}

/* The Android app's page scrollbar (wireScrollThumb in app.js). Under the
   bars (30/40), the add button (35) and every sheet. */
.page-thumb {
  position: fixed; top: 0; inset-inline-end: 2px; width: 4px; border-radius: var(--r-pill);
  background: var(--scroll-thumb); opacity: 0; pointer-events: none; z-index: 25;
  transition: opacity .4s var(--ease);
}
.page-thumb.is-on { opacity: .8; transition-duration: .1s; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  /* extra bottom padding reserves real room for the sync status line under
     the logo (see .storage-status) so it never overlaps the filter bar. */
  padding: 12px 20px 28px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
/* Stretched to the row's height, like .settings-corner, so the sync line
   under the logo and the version under the cog hang from the same edge.
   Centred, the logo row is shorter than the cog's 44px buttons and the two
   labels sat 4-8px apart. */
.brand { display: flex; align-items: center; gap: 10px; order: 1; position: relative; align-self: stretch; }
.brand-mark { color: var(--accent); display: flex; }
.brand-mark svg { display: block; width: 20px; height: 20px; }
.brand h1 { font-size: var(--fs-xl); margin: 0; font-weight: 650; letter-spacing: .3px; }

/* groups the view tabs; on desktop it's transparent to the flex layout,
   on mobile it becomes the fixed bottom nav bar */
.topbar-bottom { display: contents; }

/* Mobile-only second bottom-bar row (see the mobile media queries below for
   its actual layout) — desktop never shows it regardless of the JS-toggled
   .is-active class, since Desktop already has multi-column layouts and
   visible sticky headers, so paging by year/category isn't needed there. */
.jump-nav { display: none; }

.views { display: flex; gap: 4px; order: 2; }
/* The phone's sliding indicator (see the mobile blocks). Out of the flow on
   every layout: on a computer it draws nothing, but app.js still sizes it to
   the active tab, and in the row it widened the tab bar by that tab's width,
   so the search box, and whether the tabs dropped to icons, changed with
   the tab you were on. */
.tab-underline { position: absolute; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: none; color: var(--text-dim);
  /* The extra at the bottom is the mode dots' row (.tab-modes), inside the
     pill; every tab gets it so the row stays one height. */
  padding: 8px 14px 12px; border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-md);
  font-weight: 550; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  /* A two-word name ("ציר זמן") broke onto a second line before the row
     counted as full, making the bar taller instead of dropping the tabs to
     icons (.is-tight). */
  white-space: nowrap;
}
/* Search-match count on a tab other than the one you're looking at — lets
   a search typed on one view surface that it also matches things in
   another, without switching to check. Never shown on the active tab
   (you're already looking at its own filtered count). */
.tab-match-badge {
  position: absolute; top: 2px; inset-inline-end: 2px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--accent-fill); color: var(--text-on-accent);
  font-size: var(--fs-3xs); font-weight: 700; line-height: 15px; text-align: center;
  pointer-events: none;
}
/* (hover: hover) keeps this off touchscreens — without it, tapping a tab
   on mobile could leave its hover background "stuck" showing (a known
   mobile Safari/Chrome quirk: touch doesn't fire the leave event a mouse
   would), leaving a highlighted box on a tab you'd already left. */
@media (hover: hover) {
  .tab:hover { background: var(--bg-elev-2); color: var(--text); }
}
.tab.active { background: var(--accent-fill); color: var(--text-on-accent); }
/* The display above outranks the UA stylesheet's [hidden] rule. */
.tab[hidden] { display: none; }
/* Shift held: each tab's number key (the 1-9 that switches to it) on its
   top-left corner, clear of the search badge on the right. */
.tab-key { display: none; }
html.show-tab-keys .tab-key {
  display: block; position: absolute; top: -6px; inset-inline-start: -4px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-xs);
  background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border);
  font-size: var(--fs-3xs); font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: var(--shadow); pointer-events: none;
}

/* Hovering a tab drops its modes out of it — the desktop half of the phone's
   press-and-hold fan, and the reason there is no switch above the content on
   either layout. No gap between the tab and the menu: the pointer has to be
   able to travel into it without crossing dead space. */
.tab-menu {
  position: absolute; top: 100%; left: 0; z-index: 40;
  display: flex; flex-direction: column; min-width: 100%;
  padding: 4px; border-radius: var(--r-lg);
  background: var(--bg-elev-2); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-4px);
  /* Opening only: a closing menu is removed, not faded (closeTabMenu). */
  transition: opacity .2s var(--ll-move-ease), transform .2s var(--ll-move-ease);
}
.tab-menu.is-open { opacity: 1; transform: none; }
.tab-menu-item {
  background: none; border: none; border-radius: var(--r-md); cursor: pointer;
  padding: 8px 12px; text-align: start; white-space: nowrap;
  color: var(--text-dim); font-size: var(--fs-sm); font-weight: 550;
  font-family: inherit;
}
.tab-menu-item {
  display: flex; align-items: center; gap: 10px;
}
.tab-menu-item:hover { background: var(--bg-elev-3, var(--bg)); color: var(--text); }
/* The mode's own glyph, matching the icons on the tabs themselves. Fixed
   width so the labels line up whatever the glyph's own advance is. */
.mode-ico {
  flex: 0 0 auto; width: 15px; display: grid; place-items: center;
  font-size: var(--fs-sm); line-height: 1; opacity: .85;
}
.mode-ico .ico { width: 14px; height: 14px; display: block; }
/* The mode you're in, said the same way the tab dots say it. */
.tab-menu-item.is-on { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .tab-menu { transition: none; opacity: 1; transform: none; }
}



/* One dot per mode under a tab that has them, the current one a pill. Both
   halves of the question the fan raised — that a tab has other modes at
   all, and which one it's in — answered without opening it. Out of the
   tab's flex column and absolutely positioned, because the tabs stretch to
   a shared height and centre their own contents: an extra row in flow on
   two tabs out of five would lift their icon and label out of line with the
   rest of the bar. On a computer the row sits inside the pill (0.273.0; it
   was phone-only, the hover menu being the desktop's answer, but the dots
   say where you are without hovering); the phone layout below moves it up
   under its taller tab. */
.tab-modes {
  display: flex;
  position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 4px;
  justify-content: center; align-items: center; gap: 4px;
  pointer-events: none;
}
.tab-mode-dot {
  width: 3px; height: 3px; border-radius: var(--r-pill);
  /* currentColor, so the row takes the tab's own accent when it's the active
     one and the faint grey when it isn't — an inactive tab still says which
     mode it's parked in, just more quietly. */
  background: currentColor; opacity: .3;
  transition: width var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.tab-mode-dot.is-on { width: 9px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .tab-mode-dot { transition: none; } }


/* The wrapper is what the topbar lays out; the input fills it. Block, not
   flex: as a flex item the input keeps its intrinsic min-width, which stops
   the wrapper shrinking and pushes the ⚙ onto a second row on a phone.
   On a computer it takes the room the row has left, up to 480px, and never
   drops under 160px: past that the tabs give up their labels (.is-tight,
   set by fitTopbar in app.js) rather than push the ⚙ off the right edge,
   which is what a zoomed-in window used to do. */
.search-wrap { position: relative; display: block; order: 3; margin-inline-start: auto; flex: 1 1 200px; min-width: 160px; max-width: 480px; }
.topbar.is-tight { gap: 12px; }
.topbar.is-tight .brand h1 { display: none; }
.topbar.is-tight .tab { gap: 0; padding-inline-start: 11px; padding-inline-end: 11px; font-size: 0; }
.search {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding-block: 8px; padding-inline: 12px 32px; border-radius: var(--r-md); width: 100%; font-size: var(--fs-sm);
}
.search:focus { outline: none; border-color: var(--accent); }
/* Chrome's own cancel button only exists while the field has focus, and
   can't be talked out of that from here — so it's dropped for one of ours
   that stays for as long as there's something to clear. */
.search::-webkit-search-cancel-button, .search::-webkit-search-decoration {
  -webkit-appearance: none; appearance: none;
}
.search-clear {
  position: absolute; inset-inline-end: 1px; top: 1px; bottom: 1px; width: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 0 8px 8px 0; padding: 0;
  color: var(--text-faint); font-size: var(--fs-xs); line-height: 1; cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.search-clear:hover { color: var(--text); }
.search-clear[hidden] { display: none; }

/* Settings lives in the header corner, separate from the Add FAB, so the
   two don't compete for attention as if they were equally weighted actions. */
/* Settings ⚙ sits at the far-right of the header; the version number rides
   directly under it — absolutely positioned (against .settings-corner) so its
   width never affects the header's flex layout, mirroring how the sync status
   line hangs under the logo on the left. The topbar's extra bottom padding
   reserves room for both. */
:root { --topbar-label-gap: 7px; }
.settings-corner { order: 5; position: relative; display: flex; align-items: center; gap: 6px; align-self: stretch; }
#viewOptionsBtn[hidden] { display: none; }
/* Activity (0.244.0): a ring that fills as the first job goes, and how
   many are going when it's more than one. Not knowing how far along, the
   ring is a quarter and pulses, like the sync light: a status. */
.activity-btn { display: grid; place-items: center; }
.activity-btn[hidden] { display: none; }
.activity-btn.is-busy .activity-idle, .activity-btn:not(.is-busy) > svg { display: none; }
.activity-btn svg, .activity-pill svg { width: 18px; height: 18px; fill: none; stroke-width: 2.4; display: block; transform: rotate(-90deg); flex: none; }
.activity-track { stroke: var(--text-faint); opacity: .5; }
.activity-ring {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: var(--activity-progress, 0) 100;
  transition: stroke-dasharray var(--dur) var(--ease);
}
.activity-btn.is-unknown .activity-ring, .activity-pill.is-unknown .activity-ring { stroke-dasharray: 25 100; animation: led-pulse 1.2s ease-in-out infinite; }
.activity-btn.is-failed .activity-ring, .activity-pill.is-failed .activity-ring { stroke: var(--danger); stroke-dasharray: 100 100; }
/* Phones only (see the mobile blocks): a floating pill across from the +. */
.activity-pill { display: none; }
body.modal-open .activity-pill { visibility: hidden; }
.activity-pill-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-pill.is-failed .activity-pill-text { color: var(--danger); }
.activity-pill-more { flex: none; color: var(--text-dim); }
.activity-pill-more:empty { display: none; }
.activity-count {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: var(--fs-3xs); font-weight: 700; color: var(--text); pointer-events: none;
}
.activity-btn.is-failed .activity-count { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .activity-ring { transition: none; }
  .activity-btn.is-unknown .activity-ring, .activity-pill.is-unknown .activity-ring { animation: none; }
}
.version-badge {
  position: absolute; top: 100%; inset-inline-end: 0; margin-top: var(--topbar-label-gap);
  font-size: var(--fs-2xs); color: var(--text-faint); white-space: nowrap; pointer-events: none;
}

/* Sync status sits directly under the logo — absolutely positioned (against
   .brand) so its text width, often much wider than "LifeLog", never affects
   the header's flex layout/wrapping like it did as a sized flex item. The
   topbar's extra bottom padding above reserves it real space instead of
   overlapping the filter bar underneath. */
.storage-status {
  position: absolute; top: 100%; inset-inline-start: 0; margin-top: var(--topbar-label-gap);
  font-size: var(--fs-2xs); color: var(--text-dim); display: flex; align-items: center; gap: 6px;
  max-width: 260px; white-space: nowrap; cursor: pointer;
}
.storage-status:hover { color: var(--text-dim); }
.storage-status .led { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.storage-status .stxt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.storage-status.connected .led { background: var(--led-connected); }
.storage-status.local .led { background: var(--led-local); }
.storage-status.syncing .led { background: var(--led-syncing); animation: led-pulse 1s ease-in-out infinite; }
.storage-status.pending .led { background: var(--led-local); animation: led-pulse 1.6s ease-in-out infinite; }
/* Persistent failure (e.g. GitHub rejected the token) — steady red, not the
   pulsing "will retry" look, since it won't fix itself without user action. */
.storage-status.error { color: var(--danger-text); }
.storage-status.error .led { background: var(--danger); }
@keyframes led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Brief highlight when an amount field's math expression auto-resolves. */
.math-eval-flash { animation: math-eval-flash .45s var(--ease); }
@keyframes math-eval-flash {
  0% { background: var(--accent-soft); border-color: var(--accent); }
  100% { background: none; }
}

/* Add floats free of the header/tabs entirely — a single fixed FAB in the
   bottom-right corner on every layout, so it's never crowded next to
   Settings or the view tabs. */
/* How much room the floating + needs above the bottom bar, so content can be
   scrolled clear of it instead of ending underneath. Kept as a token because
   three numbers have to agree: the 12px the button sits above the bar, its
   own 52px, and 12px so the last row isn't flush against it. .content's
   bottom padding on a phone is this plus the bar itself. */
:root { --fab-clear: 76px; }
/* One note printed (Export as PDF) is dark on white in every theme. */
:root { --print-ink: #111; --print-link: #1a4fb5; --print-shade: #f2f2f2; }
/* Where a header sticks under the top bar. --topbar-h is a fractional
   measurement (safe-area inset, 2.625x screens), and a sticky edge and the
   bar's edge round to device pixels separately, so a flush offset left a
   1px seam of scrolling content between them on phones. Tucking the header
   1px under the bar (z 20/40, above every sticky header) closes it; the
   bar's border still draws on top. */
:root { --sticky-top: calc(var(--topbar-h, 0px) - 1px); }
.fab-wrap { position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 35; }
/* .btn.fab: .btn comes later in this file and, at equal weight, was taking
   the radius, padding and font size back — a rounded square with a 13px +. */
.btn.fab {
  width: 52px; height: 52px; border-radius: 50%; padding: 0;
  font-size: var(--fs-stat); line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
/* The one popup-menu look, shared by the + button's menu and the recurring
   plan's More… — extracted rather than copied so a second menu can't drift
   into being a second style. Position is the caller's: these open from
   opposite corners of the screen. */
.menu-pop {
  min-width: 185px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
  z-index: 20;
}
.menu-pop[hidden] { display: none; }
/* Both menus open upward, so they rise into place — see .modal-overlay for
   how a `hidden` toggle gets to animate. Arrive with settle, leave faster. */
.menu-pop { transition: opacity .2s var(--ll-move-ease), translate .2s var(--ll-move-ease), display .2s allow-discrete; }
.menu-pop[hidden] {
  opacity: 0; translate: 0 4px; pointer-events: none;
  transition-duration: .12s; transition-timing-function: var(--ease);
}
@starting-style { .menu-pop { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .menu-pop { transition: none; } }
.menu-pop button {
  background: transparent; border: none; color: var(--text); text-align: start;
  padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-md);
  white-space: nowrap;
}
.menu-pop button:hover:not(:disabled) { background: var(--bg-elev-2); }
.menu-pop button[hidden] { display: none; }
.menu-pop-divider { border-top: 1px solid var(--border); margin: 4px 6px; }
/* The right-click menu (computer): opens at the pointer, over everything
   but a sheet. Items carry an icon; a submenu swaps the list in place. */
.ctx-menu { position: fixed; z-index: 70; min-width: 200px; max-height: calc(100vh - 16px); overflow-y: auto; }
.ctx-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: var(--fs-sm); }
.ctx-menu button .ico { width: 16px; height: 16px; color: var(--text-dim); }
.ctx-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ctx-menu button.is-danger, .ctx-menu button.is-danger .ico { color: var(--danger); }
.ctx-menu button.is-indent { padding-inline-start: 36px; }
.ctx-menu .ctx-gap { width: 16px; flex: 0 0 auto; }
.ctx-menu .ctx-more { margin-inline-start: auto; }
.ctx-menu .ctx-back { color: var(--text-dim); }
.ctx-menu .ctx-head { padding: 6px 12px 4px; font-size: var(--fs-xs); color: var(--text-dim); }

/* The app's own list for every <select> (src/select.js): a menu under the
   field on a computer, a sheet from the bottom on a phone. The field itself
   keeps its look above. The selected option carries the accent and a tick;
   the one under the pointer or the arrow keys gets the hover fill. */
.dd-layer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.dd-pop { position: fixed; pointer-events: auto; padding: var(--space-4); overflow: hidden; }
.dd-pop .dd-list { overflow-y: auto; overscroll-behavior: contain; max-height: inherit; outline: none; }
.dd-pop { animation: dd-in .16s var(--ll-move-ease); }
.dd-pop.is-up { animation-name: dd-in-up; }
@keyframes dd-in { from { opacity: 0; translate: 0 -4px; } }
@keyframes dd-in-up { from { opacity: 0; translate: 0 4px; } }
.dd-opt {
  display: flex; align-items: center; gap: var(--space-8); padding-block: var(--space-8); padding-inline: var(--space-6) var(--space-12);
  border-radius: var(--r-md); color: var(--text); font-size: var(--fs-sm); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.dd-opt .dd-text { overflow: hidden; text-overflow: ellipsis; }
.dd-tick { flex: 0 0 16px; width: 16px; height: 16px; display: flex; color: var(--accent); }
.dd-tick svg { width: 16px; height: 16px; }
.dd-opt.is-active { background: var(--bg-elev-2); }
.dd-opt[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.dd-opt[aria-disabled="true"] { color: var(--text-faint); cursor: default; }
.dd-opt.is-grouped { padding-inline-start: var(--space-14); }
.dd-group {
  padding: var(--space-8) var(--space-12) var(--space-4); font-size: var(--fs-2xs); font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em;
}
.dd-scrim {
  position: fixed; inset: 0; z-index: 80; background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center;
  animation: dd-fade .2s var(--ll-move-ease);
}
.dd-sheet {
  width: 100%; max-width: 560px; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow);
  padding: var(--space-8) var(--space-8) calc(var(--space-12) + var(--sab, 0px));
  animation: dd-rise .26s var(--ll-move-ease);
}
.dd-sheet::before {
  content: ""; align-self: center; width: 36px; height: 4px; border-radius: var(--r-pill);
  background: var(--border); margin: var(--space-2) 0 var(--space-8); flex: 0 0 auto;
}
.dd-title { padding: var(--space-2) var(--space-12) var(--space-8); font-size: var(--fs-md); font-weight: 600; color: var(--text-dim); }
.dd-sheet .dd-list { overflow-y: auto; overscroll-behavior: contain; outline: none; }
.dd-sheet .dd-opt { min-height: 48px; font-size: var(--fs-lg); padding-inline-start: var(--space-10); gap: var(--space-12); }
.dd-sheet .dd-opt.is-active:not(:focus-within) { background: transparent; }
.dd-sheet .dd-opt[aria-selected="true"] { background: var(--accent-soft); }
.dd-sheet .dd-tick, .dd-sheet .dd-tick svg { width: 18px; height: 18px; flex-basis: 18px; }
@keyframes dd-fade { from { opacity: 0; } }
@keyframes dd-rise { from { translate: 0 40px; opacity: .6; } }
/* Closing (select.js leave()): out faster than in, with ease, like the
   sheets and menus; the list is gone for the pointer at once. */
.dd-layer.is-leaving .dd-pop { animation: dd-out .1s var(--ease) forwards; pointer-events: none; }
.dd-layer.is-leaving .dd-pop.is-up { animation-name: dd-out-up; }
.dd-scrim.is-leaving { animation: dd-fade-out .16s var(--ease) forwards; pointer-events: none; }
.dd-scrim.is-leaving .dd-sheet { animation: dd-sink .16s var(--ease) forwards; }
@keyframes dd-out { to { opacity: 0; translate: 0 -4px; } }
@keyframes dd-out-up { to { opacity: 0; translate: 0 4px; } }
@keyframes dd-fade-out { to { opacity: 0; } }
@keyframes dd-sink { to { translate: 0 40px; } }
@media (prefers-reduced-motion: reduce) { .dd-pop, .dd-scrim, .dd-sheet, .dd-layer.is-leaving .dd-pop, .dd-scrim.is-leaving, .dd-scrim.is-leaving .dd-sheet { animation: none; } }

.add-menu { position: absolute; inset-inline-end: 0; bottom: calc(100% + 10px); }
/* One group per tab, the way the Ledger's two items used to sit apart: a
   small heading with the tab's name, then what you can add there. A rule
   above every group that has a visible one before it. */
.add-group { display: flex; flex-direction: column; }
.add-group[hidden] { display: none; }
.add-group:not([hidden]) ~ .add-group:not([hidden]) { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.add-head {
  margin: 0; padding: 6px 12px 2px; font-size: var(--fs-2xs); font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em;
}
.add-menu button { display: flex; align-items: center; gap: 10px; }
.add-ico { width: 1.25em; display: grid; place-items: center; color: var(--text-dim); flex: 0 0 auto; }
.add-ico .ico { width: 16px; height: 16px; display: block; }

/* Anchors a menu to the button that opens it. */
.menu-wrap { position: relative; display: inline-flex; }
/* The display above outranks the UA stylesheet's [hidden] rule. Without this
   #recMoreWrap — hidden while adding a recurring expense, since a plan that
   doesn't exist yet has nothing to pause or convert — stayed on screen as a
   More… button whose menu then refused to open, because setRecToolsOpen
   reads that same .hidden. A control that is present and dead reads as a bug.
   Same companion rule the rest of this file carries beside every author
   display. */
.menu-wrap[hidden] { display: none; }
/* Opens upward: this one lives in .modal-actions at the foot of a modal that
   scrolls, so downward would be off the end of it. */
.menu-wrap .menu-pop { position: absolute; inset-inline-start: 0; bottom: calc(100% + 8px); }

/* ---------- buttons ---------- */
.btn {
  background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-sm);
  font-weight: 550; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn:hover:not(:disabled) { background: var(--hover-bg); }
/* A .btn had no disabled look at all until the picker got one it can turn
   off (Open/Pick again, with nothing left in scope to draw). */
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--text-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-fill-hover); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-icon { padding: 8px 10px; font-size: var(--fs-read); line-height: 1; }
/* One small button. .btn-small looks the same; it only marks the ones
   that get a padded tap area (the list further down). */
.btn-sm, .btn-small { padding: 4px 8px; font-size: var(--fs-xs); }

/* ---------- icons ----------
   Lucide, through src/icons.js. An icon sits at 1.2em so it matches the
   text beside it; icon-only controls size it themselves below. .is-fill is
   the "on" state of a toggle drawn as its filled shape (favourite, priority,
   default mode). */
.ico { width: 1.2em; height: 1.2em; flex: 0 0 auto; display: inline-block; vertical-align: -0.25em; }
.ico.is-fill { fill: currentColor; }
h2 .ico { width: .85em; height: .85em; vertical-align: -0.1em; margin-inline-end: 2px; }
.tab-ico { display: block; }
.tab-ico .ico { width: 17px; height: 17px; display: block; }
.btn-icon .ico, .jump-btn .ico, .search-clear .ico, .recap-close .ico, .lock-key .ico { width: 18px; height: 18px; display: block; margin: auto; }
.empty-glyph .ico { width: 34px; height: 34px; }
.recur-badge .ico { width: 12px; height: 12px; vertical-align: -0.15em; }
.bulkp-glyph .ico, .activity-glyph .ico { width: 14px; height: 14px; display: block; margin: auto; }
.todo-grip .ico { width: 14px; height: 14px; display: block; }
.kind-ico .ico, .coll-mark .ico { width: 13px; height: 13px; vertical-align: -0.15em; }
.board-tool .ico { width: 18px; height: 18px; display: block; margin: auto; }
.activity-row.is-running .activity-glyph .ico { animation: ico-spin 1.2s linear infinite; }
@keyframes ico-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .activity-row.is-running .activity-glyph .ico { animation: none; } }

/* ---------- filter bar ---------- */
/* Inside #content and under the filters now (see #modeSlot in index.html),
   so the content's own padding places it and the bar keeps its own bottom
   margin as the gap to the list. */
.mode-slot[hidden] { display: none; }

/* No horizontal padding or background of its own — whichever parent it is in
   places it, and the rule under it is what separates it from the view rather
   than a full-bleed band. */
.filterbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 0 0 12px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
/* Both rows empty (To-do, where neither applies): the rule and its spacing
   would be a line under nothing. Driven from JS rather than :has(), which
   this codebase doesn't lean on anywhere else. */
.filterbar[hidden] { display: none; }
/* Standing outside #content, the padding #content was giving it comes from
   the slot instead — on the slot rather than the bar so the rule underneath
   stays inset with the content rather than running edge to edge. pan-y for
   the same reason #content has it: a swipe starting on the chips still drags
   the view behind them. Empty whenever the bar is inside #content (Notes),
   where its padding would be a band of nothing. */
.filter-slot { padding: 24px 20px 0; touch-action: pan-y; }
.filter-slot:empty { padding: 0; }
/* ...and #content stops supplying a top gap the slot has already left. */
.content.no-filters { padding-top: 0; }
.filter-group { display: flex; align-items: center; gap: 10px; }
/* The display above outranks the UA stylesheet's [hidden] rule, so hiding
   the category group (Notes mode, where a note has no category) needs this
   said explicitly — same as .add-menu and the rest below. */
.filter-group[hidden] { display: none; }
.filter-group > label { color: var(--text-dim); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; min-width: 90px; }
.filter-label { cursor: pointer; user-select: none; }
.filter-label:hover { color: var(--accent); }
select {
  background-color: var(--bg-elev); color: var(--text); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: var(--r-md); font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
/* The native arrow sat against the right border (on Android most of all).
   Drawn here instead, as two gradient halves of a chevron in a token
   colour so every theme gets it, with room kept for it on the right. The
   !important on padding-right is what keeps that room under the dozen
   selects that set their own padding. */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 4px 4px; background-repeat: no-repeat;
  padding-inline-end: 28px !important;
}
select:focus { outline: none; border-color: var(--accent); }

.cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cat-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 550;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  user-select: none; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.cat-chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.cat-chip.on { border-color: transparent; background: var(--accent-fill); color: var(--text-on-accent); }
.cat-chip.add-chip { padding: 4px 12px; font-weight: 700; color: var(--text-dim); min-width: 0 !important; }
.cat-chip.add-chip:hover { color: var(--text); border-color: var(--accent); }
/* A subcategory's chip (0.288.0), shown after its category's while that one
   is on: dashed and hugging its text, so it reads as part of the one before
   it rather than a category of its own. */
.cat-chip.is-sub { border-style: dashed; color: var(--text-dim); min-width: 0 !important; }
.cat-chip.is-sub .dot { width: 6px; height: 6px; }
.cat-chip.is-sub.on { border-style: solid; color: var(--text-on-accent); }

/* ---------- content ---------- */
/* pan-y hands horizontal gestures to JS (the swipe that switches mode —
   see attachSwipe in app.js) while leaving vertical scrolling entirely to
   the browser. Without it the browser claims the whole gesture and the
   swipe only ever fires by accident. */
/* min-height so the swipe surface is the page rather than just wherever the
   content happens to reach: on a short view (an empty To-do, a Discover
   card that fits in 300px) the handler is on .content, and without this a
   swipe in the lower half of the screen lands on nothing and does nothing.
   It adds no scrolling — 70vh is less than the viewport. */
.content { padding: 24px 20px 80px; max-width: 2400px; margin: 0 auto; touch-action: pan-y; min-height: 70vh; }

/* Replayed on view switches only (see fadeInOnViewChange in app.js) — a
   short fade + 6px rise, no bounce. Skipped under prefers-reduced-motion. */
@keyframes view-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-fade-in { animation: view-fade-in .22s var(--ll-move-ease) both; }
@media (prefers-reduced-motion: reduce) { .view-fade-in { animation: none; } }

/* The mode fan: press and hold a tab in the bottom bar and its other modes
   rise out of it, stacked upward so the first alternative is the shortest
   slide away. Only ever built on a phone layout (see openModeFan in
   app.js), so these aren't scoped to one — the force-mobile override and
   the real thing would otherwise need the same forty lines twice.
   column-reverse is what puts the first option nearest the tab while
   keeping DOM order the same as everywhere else the modes are listed. */
.mode-fan {
  /* Above .fab-wrap (35): the + button sits in the corner the rightmost
     tab's fan rises through, and behind it the last option was unreadable. */
  position: absolute; bottom: 100%; margin-bottom: 10px; z-index: 40;
  transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 8px;
  min-width: 108px; max-width: 46vw;
}
.mode-fan-item {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-elev-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 12px; font-size: var(--fs-xs); font-weight: 600; text-align: center;
  white-space: nowrap; overflow: hidden;
  /* The shadow is what lifts these off the page — without it they read as
     part of the bar rather than something raised out of it. */
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px) scale(.96);
  transition: opacity .1s var(--ease), transform .1s var(--ease),
              background .1s var(--ease), border-color .1s var(--ease), color .1s var(--ease);
}
/* Each one a beat after the one below it, so they read as rising out of the
   tab rather than appearing all at once. */
.mode-fan-item:nth-child(2) { transition-delay: .045s; }
.mode-fan-item:nth-child(3) { transition-delay: .09s; }
/* Opening rises with settle; closing (the rule above) drops out faster. */
.mode-fan.is-open .mode-fan-item {
  opacity: 1; transform: none;
  transition: opacity .16s var(--ease), transform .16s var(--ll-move-ease),
              background .1s var(--ease), border-color .1s var(--ease), color .1s var(--ease);
}
.mode-fan-item.is-armed {
  background: var(--accent-fill); border-color: var(--accent-fill); color: var(--text-on-accent);
}
@media (prefers-reduced-motion: reduce) {
  .mode-fan-item, .mode-fan.is-open .mode-fan-item { transition: none; transition-delay: 0s; opacity: 1; transform: none; }
}

/* Switching mode within a view (Timeline's Entries/Notes/To-do, the
   Backlog's three) slides in from the side it came from — same timing and
   easing as the view fade above, on the axis a swipe actually moves along,
   so the button and the gesture produce the same motion. */
/* --mode-enter-x is set by a swipe to the distance its travel ended at, so
   the incoming half picks up exactly where the outgoing half left the
   screen. A button press leaves it unset and gets the small default: there
   was no travel to continue. */
/* Swiping between modes (see "a pager" in app.js): pictures of the other
   modes, in a fixed layer lined up with #content and clipped to it — the
   one being swiped towards, and the one being left behind as it goes. Under
   the top bar, the tab bar and the add button. */
.mode-layer {
  position: fixed; top: 0; height: 100vh; overflow: hidden;
  pointer-events: none; z-index: 5;
}
.mode-layer > .content { position: absolute; left: 0; width: 100%; margin: 0; }
.mode-peek-label {
  position: absolute; left: 0; width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px;
  color: var(--text-dim); font-size: var(--fs-read); font-weight: 600;
}
.mode-peek-label[data-side="right"] { align-items: flex-start; padding-left: 28px; }
.mode-peek-label[data-side="left"] { align-items: flex-end; padding-right: 28px; }
.mode-peek-icon { font-size: var(--fs-3xl); line-height: 1; }
.mode-peek-icon .ico { width: 30px; height: 30px; display: block; }
@keyframes mode-slide-fwd { from { opacity: 0; transform: translateX(var(--mode-enter-x, 16px)); } to { opacity: 1; transform: none; } }
@keyframes mode-slide-back { from { opacity: 0; transform: translateX(calc(-1 * var(--mode-enter-x, 16px))); } to { opacity: 1; transform: none; } }
.mode-slide-fwd { animation: mode-slide-fwd .22s var(--ll-move-ease) both; }
.mode-slide-back { animation: mode-slide-back .22s var(--ll-move-ease) both; }
@media (prefers-reduced-motion: reduce) {
  .mode-slide-fwd, .mode-slide-back { animation: none; }
}

/* timeline */
.timeline-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.timeline-toolbar[hidden] { display: none; }
/* The one sort control, identical in all three views so they can't drift
   apart visually any more than they can behaviourally. Shaped like the bulk
   bar's move-select, which is the app's existing "pick one" control. */
/* The rate box and its lookup button. The input takes the room; the button
   is only as wide as its word, and min-width:0 is what stops a flex child
   from refusing to shrink below its content. */
/* The conversion line is a caption for the rate above it, but .hint's default
   margin is 10px top and 0 bottom — so it sat flush against the Category
   field and read as that field's caption instead, worst of all when the rate
   row is hidden and it lands directly under Amount. The gap below is the one
   that has to grow: the gap above is already the form's 12px field spacing
   and can't be shrunk from here, since an adjacent sibling's bottom margin
   collapses with this one's top. */
#finFxPreview { margin-bottom: 20px; }

.rate-row { display: flex; align-items: center; gap: 8px; }
.rate-row input { flex: 1 1 auto; min-width: 0; }
.rate-row .btn { flex: 0 0 auto; align-self: stretch; margin-top: 6px; }
/* A yearly plan's charge date: month and day, no year. */
.charge-on-row { display: flex; gap: 8px; }
.charge-on-row select { flex: 1 1 0; min-width: 0; }
.charge-on-row select[hidden] { display: none; }

.sort-select {
  background-color: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 8px; border-radius: var(--r-md); font: inherit; font-size: var(--fs-sm); cursor: pointer;
  max-width: 100%;
}
.sort-select:hover { color: var(--text); border-color: var(--text-faint); }
.year-block { margin-bottom: 32px; }
.year-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 0 0 14px;
  padding: 10px 0 14px; border-bottom: 1px solid var(--border);
}
.year-head h2 { font-size: var(--fs-2xl); margin: 0; font-weight: 700; }
.year-head .ycount { color: var(--text-dim); font-size: var(--fs-sm); }
.year-head .accs {
  margin-inline-start: auto; max-width: 100%; color: var(--text-dim); font-size: var(--fs-sm);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.year-head .accs .acc { background: var(--bg-elev-2); padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer; border: 1px solid transparent; max-width: 100%; overflow-wrap: break-word; }
.year-head .accs .acc:hover { border-color: var(--accent); color: var(--text); }

.month-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--month-min, 180px), var(--month-max, 1fr))); gap: 14px; align-items: start; }
.month-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.month-card h3 {
  margin: 0 0 10px; padding: 4px 0 10px; border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm); color: var(--text-dim); font-weight: 600; display:flex; justify-content:space-between;
}
.month-card h3 .mc { color: var(--text-dim); font-weight: 500; }
.month-card h3 .mc-left, .month-card h3 .mc-right { display: flex; align-items: center; gap: 6px; }
.month-add-btn {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-elev-2);
  color: var(--text-dim); font-size: var(--fs-sm); line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center; padding: 0; flex: 0 0 auto;
}
.month-add-btn:hover { color: var(--text); border-color: var(--accent); }
.month-total {
  display: flex; justify-content: space-between; margin-top: 8px; padding: 8px 8px 0;
  border-top: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim);
}
.month-total .famount { font-weight: 700; }
/* Where a month's money went, between its entries and its total. The rule
   above the block already separates it from the rows, so the total below
   drops its own and leans on weight instead — one divider per card, not two. */
.month-cats {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.month-cat { display: flex; align-items: center; gap: 8px; padding: 1px 8px; font-size: var(--fs-xs); color: var(--text-dim); }
.month-cat .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.month-cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-cat .famount { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
/* The Timeline's count sits where the Ledger's amount does, without the
   money colour — same column, same alignment, different unit. */
.month-cat-n { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.month-cats + .month-total { border-top: none; margin-top: 6px; }
/* The ordinary-spending figure, under the total and quieter than it: it is
   context for the number above, not a second number competing with it. */
/* Two fields on one line — amount and the currency it was paid in belong
   together and read as one number. The currency side is given just enough
   room for a code plus its symbol, and the pair stacks on a narrow phone
   rather than squeezing the amount down to nothing. */
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row > label { flex: 1 1 auto; min-width: 0; margin: 0; }
.field-row > label.field-narrow { flex: 0 0 8.5rem; }
/* Stacked on a narrow phone. The basis has to be reset with the direction:
   flex-basis follows the main axis, so the 8.5rem that is a *width* in a row
   silently becomes a 136px-tall currency field in a column. */
@media (max-width: 360px) {
  .field-row { flex-direction: column; align-items: stretch; gap: 0; }
  .field-row > label, .field-row > label.field-narrow { flex: 0 0 auto; margin-bottom: 12px; }
}

/* What you actually paid, beside what it came to. Quiet and monospaced-ish:
   it is provenance for the number next to it, not a second amount. */
.fx-paid {
  font-size: var(--fs-2xs); color: var(--text-dim); flex: 0 0 auto;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* A provisional figure came from a rate you called a guess, so it says so
   rather than sitting there looking settled. The mark is a suffix rather than
   a colour alone — colour is already doing category work in these rows.
   Always on the amount itself, never on its container: .month-total is a
   two-column flex row and an ::after there would become a third column.
   A recurring charge still on its plan's fallback rate is the same claim —
   this is roughly what it cost, not what it cost — so it carries the same
   mark rather than inventing a second vocabulary for the same doubt. */
.famount.is-provisional,
.rec-occ-amount.is-provisional,
.month-cat.is-provisional .famount,
.month-total.is-provisional .famount { font-style: italic; }
.famount.is-provisional::after,
.rec-occ-amount.is-provisional::after,
.month-cat.is-provisional .famount::after,
.month-total.is-provisional .famount::after { content: " ~"; opacity: .7; }

.month-total-ex {
  text-align: end; padding: 2px 8px 0; font-size: var(--fs-2xs); color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
/* A project's line in the breakdown looks exactly like a category's. Its dot
   carries the project's colour, and that is the whole distinction — an
   earlier version also brightened the name to --text-dim, which read as
   emphasis next to the --text-faint lines around it. */

/* The pill: consecutive expenses on the same project, wrapped once and named
   once. The three tints come in as variables set by fillProjectGroup, built
   the way this file already builds translucent brand colours — an alpha
   suffix on the hex (`color + "22"`, as the category chip does) rather than
   color-mix, which nothing else here relies on. */
.proj-group {
  margin: 6px 0; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--proj-edge, var(--border));
  background: var(--proj-tint, transparent);
}
.proj-group-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim);
  background: var(--proj-head, transparent);
}
.proj-group-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.proj-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-group-edit, .proj-group-add {
  appearance: none; background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--text-faint); padding: 0 2px; line-height: 1; flex: 0 0 auto;
}
.proj-group-edit:hover, .proj-group-add:hover { color: var(--accent); }
/* ✎ is 12px of glyph; a finger gets the pill's height and half the gap to the +. */
.proj-group-edit { position: relative; padding: 0 6px; }
.proj-group-edit::after { content: ""; position: absolute; inset: -15px -4px; }
/* Sized and ringed like a month card's +, since it does the same job one
   level down, but on the pill's own tint rather than the card's surface. */
.proj-group-add {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--proj-edge, var(--border));
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-size: var(--fs-sm); color: var(--text-dim);
}
.proj-group-add:hover { border-color: var(--accent); }
.proj-group-list { padding: 2px; }
/* Rows inside a pill drop their own hover plate — the pill is already a
   surface, and a second one on top of it reads as a box in a box. */
.proj-group-list .finance-entry:hover,
/* Recurring plans sit in the same pill (see renderRecurringCard) and need the
   same treatment: the pill is already a surface, and a second one on top of
   it reads as a box in a box. */
.proj-group-list .recur-row:hover { background: var(--proj-head, var(--bg-elev-2)); }
/* The pill provides the gap between its rows, which .recur-card sets for the
   ungrouped ones. */
.recur-card > .proj-group { margin-top: 4px; }

/* An import row that would fill gaps in something you already have, rather
   than add a new item. Marked apart from .is-dup: a duplicate is a row you
   are being offered the chance to skip, this one is a row you are being
   offered the chance to take. */
.picker-row.is-update { border-inline-start-color: var(--accent); }
.update-tag {
  font-size: var(--fs-2xs); color: var(--accent); background: var(--accent-soft);
  border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; flex: 0 0 auto;
  max-width: 45%; overflow: hidden; text-overflow: ellipsis;
}

/* A plan's logged-by-hand charges, offered where you'll see them: the sheet
   itself, rather than only under More…. */
.link-offer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 8px 12px; font-size: var(--fs-sm); color: var(--text);
  background: var(--accent-soft); border-radius: var(--r-md);
}
.link-offer[hidden] { display: none; }
.link-offer .btn { flex: 0 0 auto; }

/* Everything in a project, listed inside its own edit form. Sized like the
   month-card breakdown rather than like the expense rows, because this is a
   reference list you scan, not a list you act on row by row. */
.proj-expenses {
  max-height: 240px; overflow-y: auto; margin: 2px 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px;
}
.proj-expense {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px;
  font-size: var(--fs-xs); color: var(--text-dim); border-radius: var(--r-sm); cursor: pointer;
}
.proj-expense:hover { background: var(--bg-elev-2); color: var(--text); }
.proj-expense .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.proj-expense-date { font-variant-numeric: tabular-nums; color: var(--text-dim); flex: 0 0 auto; }
.proj-expense-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-expense .famount { font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* Which project a top expense belonged to, on the line under its bar —
   .bar-row's label column is a fixed 120px and ellipsised, so a tag appended
   inside it never shows. */
.top-proj {
  display: flex; align-items: center; gap: 6px;
  margin: -4px 0 8px; font-size: var(--fs-2xs); color: var(--text-dim);
}
.top-proj .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

/* Summary's Projects card: a bar per project. */
.proj-stat { cursor: pointer; border-radius: var(--r-md); padding: 2px 4px; margin: 0 -4px; }
.proj-stat:hover { background: var(--bg-elev-2); }
.proj-stat-meta { font-size: var(--fs-2xs); color: var(--text-dim); margin: -2px 0 8px; }
/* The to-do box sits above both panels: press it, type, Enter. It's the
   whole "add" affordance, so it's always open rather than hidden behind a
   button — a checklist you have to unlock before writing in is a checklist
   you stop using. */
/* Shaped like the panels below it rather than like a form field, so the
   three read as one stack: same card surface, same border, same radius. The
   card *is* the input — the field inside is borderless and transparent, and
   the whole box lights up on focus — which also makes it a much bigger
   target than a 14px-tall input on a phone. */
.todo-compose {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding-block: 6px; padding-inline: 14px 6px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.todo-compose:focus-within { border-color: var(--accent); background: var(--bg-elev-2); }
/* The affordance: says "start one here" without spending a line on a label. */
.todo-compose::before {
  content: "+"; flex: 0 0 auto; color: var(--text-faint);
  font-size: var(--fs-xl); line-height: 1; transition: color .15s var(--ease);
}
.todo-compose:focus-within::before { color: var(--accent); }
.todo-compose input {
  flex: 1 1 auto; min-width: 0; background: none; border: none; color: var(--text);
  padding: 12px 0; font-size: var(--fs-md); font-family: inherit;
}
.todo-compose input:focus { outline: none; }
.todo-compose input::placeholder { color: var(--text-faint); }
/* Quiet until there's something to add: an always-lit primary button on an
   empty box is an invitation to press something that does nothing. */
.todo-compose .btn { flex: 0 0 auto; transition: opacity .15s var(--ease); }
.todo-compose .btn:disabled { opacity: .35; cursor: default; }
/* A press anywhere but the checkbox and the ✕ can become the reorder
   long-press (attachLongPressReorder in notes.js), so nothing here may start
   a text selection under a held finger. Selecting the words is what tapping
   into the inline editor is for. */
.todo-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: var(--fs-sm);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.todo-row + .todo-row { border-top: 1px solid var(--border); }
.todo-check { flex: 0 0 auto; width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
/* Wraps rather than ellipses: a to-do is the whole instruction, and half of
   one is no use. */
.todo-text { flex: 1 1 auto; min-width: 0; cursor: text; overflow-wrap: break-word; }
.todo-row.is-done .todo-text { color: var(--text-faint); text-decoration: line-through; }
.todo-edit {
  flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); padding: 4px 8px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--r-sm); font-family: inherit;
}
.todo-del {
  flex: 0 0 auto; background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: var(--fs-sm); padding: 2px 4px; line-height: 1;
}
.todo-del:hover { color: var(--danger); }
/* Tasks (tasks.js). The tick is a ring that takes the priority's colour;
   ticked, it fills and shows a check. The words and the line of what's set
   under them are one button that opens the task. */
input.todo-check {
  width: 18px; height: 18px; border: 2px solid var(--text-dim); border-radius: 50%; background: transparent;
}
input.todo-check.is-p1 { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
input.todo-check.is-p2 { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
input.todo-check.is-p3 { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
input.todo-check::before { width: 9px; height: 9px; background: var(--bg); }
input.todo-check:checked { background: var(--text-dim); border-color: var(--text-dim); }
input.todo-check:focus-visible { border-radius: 50%; }
.todo-row.has-meta { align-items: flex-start; }
.todo-row.is-sub { padding-inline-start: var(--space-32); }
.todo-body {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2);
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-align: start; cursor: pointer;
}
.todo-body .todo-text { cursor: inherit; }
.todo-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-10);
  font-size: var(--fs-xs); color: var(--text-dim);
}
.todo-meta > span { display: inline-flex; align-items: center; gap: var(--space-4); }
.todo-meta .ico { width: 13px; height: 13px; }
.todo-meta .is-late { color: var(--danger); }
.todo-meta .is-today { color: var(--success); }
.todo-meta .dot { width: 8px; height: 8px; border-radius: 50%; }
.todo-row.is-done .todo-meta { color: var(--text-faint); }
.todo-fold {
  flex: 0 0 auto; background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-dim); line-height: 1; position: relative;
}
.todo-fold .ico { width: 16px; height: 16px; display: block; }
.todo-fold::after { content: ""; position: absolute; inset: -8px -4px; }
/* The panel's own category, beside its name in the heading. */
.month-card .mc-left .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
/* The finished ones, under a rule at the foot of their own panel rather than
   swept into a Done panel of their own. */
.todo-done-sep {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: var(--fs-2xs); font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
}
.todo-done-sep + .todo-row { border-top: none; }
/* A section of a task list (a Trello board's list): its name and open
   count over its rows; pressing it folds the section. */
.todo-section {
  display: flex; align-items: center; gap: var(--space-6); width: 100%;
  margin-top: var(--space-12); padding: var(--space-8) 0 var(--space-4);
  border: 0; border-top: 1px solid var(--border); background: none; border-radius: 0;
  color: var(--text-dim); font: inherit; font-size: var(--fs-xs); font-weight: 600; text-align: start; cursor: pointer;
}
.todo-section:first-child { margin-top: 0; border-top: none; }
.todo-section svg { width: 14px; height: 14px; flex-shrink: 0; }
.todo-section-n { color: var(--text-faint); font-weight: 500; }
.todo-section + .todo-row { border-top: none; }
div.todo-section { cursor: default; }
.note-card.is-reordering .todo-section { padding-inline-start: var(--space-4); }

/* While reordering: touch-action none so the drag is ours rather than the
   page's scroll, and no text selection to fight the gesture. */
.note-card.is-reordering, .month-card.is-reordering { border-color: var(--accent); }
.note-card.is-reordering .todo-compose { visibility: hidden; }
.note-card.is-reordering .todo-row.is-done, .note-card.is-reordering .todo-done-sep { pointer-events: none; opacity: .45; }
.todo-row.is-reorder {
  touch-action: none; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.todo-row.is-reorder .todo-text { cursor: inherit; }
/* What slideDisplaced (notes.js) hands the transform back to. Short: it has
   to finish before the finger reaches the next neighbour's midpoint, or the
   list is animating one swap while you are asking for the next. */
.todo-row.is-reorder { transition: transform .17s var(--ll-move-ease); }
.todo-row.is-settling { transition: transform .14s var(--ll-move-ease); }
@media (prefers-reduced-motion: reduce) { .todo-row.is-reorder { transition: none; } }
.todo-grip { flex: 0 0 auto; width: 16px; text-align: center; color: var(--text-faint); font-size: var(--fs-sm); }
.todo-row.is-dragging {
  transition: none; cursor: grabbing; background: var(--bg-elev-2);
  border-radius: var(--r-md); box-shadow: var(--shadow); opacity: .95;
}

/* A note is a panel rather than a row: it's a paragraph you wrote, not a
   title with metadata beside it, so it gets its own block and keeps the
   line breaks you typed (pre-wrap, with break-word so an unbroken URL can't
   push the card wider than its column). */
.note-card {
  padding: 8px 10px; border-radius: var(--r-md); cursor: pointer;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  margin-bottom: 6px;
  /* Same reason as .entry: without these a long-press is taken as "select
     text" and the bulk-select gesture never fires. Since 0.208.0 that goes
     for the note's words too — they're most of the card, and a hold on them
     is a hold on the note. Copying is in the note sheet, a tap away. */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* Bulk mode puts the box in a column of its own beside the note, spanning
   both rows. Placed explicitly rather than by flow: the box comes first in
   the DOM so the tab order is right, which auto-placement would read as
   "row 1, column 1" and push the text under it. */
.note-card.is-bulk {
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start;
}
.note-card.is-bulk > .bulk-check { grid-column: 1; grid-row: 1 / span 6; margin-top: 2px; }
/* Everything else in the second column, in order — a list or a quote has
   more parts than a plain note's stamp and text. */
.note-card.is-bulk > :not(.bulk-check) { grid-column: 2; }
.note-card:last-child { margin-bottom: 0; }
.note-card:hover { border-color: var(--accent); }
.note-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* After :hover, so a selected card stays marked while the pointer is over it. */
.note-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
/* flow-root holds the floated star inside the card now the stamp is last. */
.note-stamp { display: flow-root; font-size: var(--fs-2xs); color: var(--text-dim); margin-top: var(--space-6); }
.note-edited { font-style: italic; }
.note-text {
  margin: 0; font-size: var(--fs-sm); color: var(--text); line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.note-title { margin: 0 0 4px; font-size: var(--fs-md); font-weight: 650; color: var(--text); overflow-wrap: break-word; }

.entry {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-md);
  cursor: pointer; font-size: var(--fs-sm);
  /* Long-press enters bulk-select mode — without these, touch devices treat the
     hold as "select text" / show the native copy callout instead, and the
     custom gesture never gets a chance to fire. The title too since 0.210.0:
     it's most of the row, so a hold on it was mostly a blue text selection. */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.entry:hover { background: var(--bg-elev-2); }
.entry .bar { width: 3px; align-self: stretch; border-radius: var(--r-xs); min-height: 16px; }
.entry .etitle { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .ecat { font-size: var(--fs-2xs); color: var(--text-dim); }
.entry .erating { font-size: var(--fs-2xs); color: var(--accent); letter-spacing: 1px; }
.erating-short { display: none; }
/* A narrow month card (the default 180px column on a computer) gave a row's
   cover, category chip and five stars all the room and the title a letter.
   There the chip draws as its dot (the name is its tooltip), the stars as
   "★4", and the span chip and a book's author step aside (the sheet has
   both), so the title keeps the row. With big covers (0.294.0) the chip is a
   label on the cover and the author sits under the title, so neither needs
   to give way. */
.month-grid > .month-card { container-type: inline-size; }
@container (max-width: 280px) {
  .month-card .entry:not(.finance-entry) > .entry-cat { font-size: 0; gap: 0; padding: var(--space-4); }
  .month-card .entry:not(.finance-entry) .erating-full, .month-card .entry:not(.finance-entry) .espan, .month-card .entry:not(.finance-entry) .etitle:not(.author-below) .eauthor { display: none; }
  .month-card .entry:not(.finance-entry) .erating-short { display: inline; }
}
/* Multi-month span chip (e.g. "Jun–Aug") — a quiet, faint pill so it reads as
   metadata, next to but not competing with the category chip and rating. */
.entry .espan {
  flex-shrink: 0; font-size: var(--fs-2xs); color: var(--text-dim); background: var(--bg-elev-2);
  border: 1px solid var(--border); padding: 1px 8px; border-radius: var(--r-pill);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.bpriority { font-size: var(--fs-2xs); color: var(--priority); letter-spacing: 1px; flex-shrink: 0; display: inline-flex; }
.bpriority .ico { width: 12px; height: 12px; fill: currentColor; }
/* Either in the metadata line where the price would have been, or — in the
   two layouts that have no such line — beside the title. Green so it reads
   as its own fact next to the star's gold. */
.bl-bought { font-size: var(--fs-2xs); color: var(--success); flex-shrink: 0; white-space: nowrap; }
.bl-ea { font-size: var(--fs-2xs); color: var(--warning); flex-shrink: 0; white-space: nowrap; }
.bl-airing { font-size: var(--fs-2xs); color: var(--warning); flex-shrink: 0; white-space: nowrap; }
.bl-airing.is-done { color: var(--success); }
/* Where you stopped, kept from In progress (0.298.0): the metadata line's own
   colour there, dim beside a plain row's title. */
.bl-count { font-size: var(--fs-2xs); flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry > .bl-count { color: var(--text-dim); }
/* The Timeline's In progress card (0.218.0): a year block's heading over
   one card of rows, each the title with how long it's been going, a ↩ to put
   it back and a ✓ Done to log it. */
.progress-block, .recur-block { margin-bottom: 28px; }
.progress-block .year-head, .recur-block .year-head { position: static; }
.progress-block .year-head .month-add-btn, .recur-block .year-head .month-add-btn { margin-inline-start: auto; }
.progress-card { display: flex; flex-direction: column; gap: 2px; }
.progress-row { align-items: center; }
.progress-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.progress-text .etitle { flex: none; }
.progress-since { font-size: var(--fs-2xs); color: var(--text-dim); }
/* A show's run (0.280.0): after the days on a computer, on its own line
   under them on a phone (0.280.1). */
.progress-since .progress-airing { white-space: normal; }
.progress-since .progress-airing::before { content: " · "; color: var(--text-dim); }
@media (max-width: 720px) {
  html:not(.force-pc) .progress-since .progress-airing { display: block; }
  html:not(.force-pc) .progress-since .progress-airing::before { content: none; }
}
html.force-mobile .progress-since .progress-airing { display: block; }
html.force-mobile .progress-since .progress-airing::before { content: none; }
/* A book's author (0.267.0): under the title where the row has a second
   line, beside it as "Title · Author" where it doesn't. There the author
   gives way first: its shrink is so much larger that the title only starts
   to cut once the name is down to its min-width, which keeps a few letters
   of it rather than a bare "· …". */
.bl-author { font-size: var(--fs-xs); color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etitle.has-author { display: flex; gap: var(--space-4); min-width: 0; }
.etitle.has-author .etitle-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.etitle.has-author .eauthor { flex: 0 10000 auto; min-width: 4em; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }
.etitle.author-below { flex-direction: column; gap: 0; }
.etitle.author-below .eauthor { flex: none; min-width: 0; white-space: nowrap; font-size: var(--fs-xs); }
.progress-row .btn-sm { flex: 0 0 auto; }
/* The episode count (0.292.0): + on the In progress row, quieter than ✓
   like ▶ is; − count + in the item's sheet. */
.progress-up { color: var(--text-dim); padding-inline: var(--space-8); }
/* Its colour is the airing state (0.293.1): the same two as .bl-airing. */
.progress-count { font-variant-numeric: tabular-nums; }
.progress-count.is-going { color: var(--warning); }
.progress-count.is-done { color: var(--success); }
.progress-up:hover:not(:disabled) { color: var(--accent); }
.count-field { margin-bottom: var(--space-12); font-size: var(--fs-sm); color: var(--text-dim); }
.count-step { display: flex; align-items: center; gap: var(--space-8); margin-top: var(--space-6); }
.count-step .btn-sm { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.count-step input {
  width: 80px; text-align: center; background-color: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 10px 8px; border-radius: var(--r-md); font-size: var(--fs-md);
}
.count-field[hidden] { display: none; }
/* ▶ on a backlog row, before ✓: the quieter of the two. ✓ keeps the full
   text color since it's the row's main action, and both are square icon
   buttons of the same width (0.220.0). */
.bl-start { color: var(--text-dim); padding-inline: 8px; }
.bl-start:hover:not(:disabled) { color: var(--accent); }
.backlog-item-rich .bl-start { margin-inline-end: -2px; }
.bl-done { padding-inline: 8px; }
.bl-done:hover:not(:disabled) { color: var(--success); }
.entry .entry-cat {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  padding: 2px 8px; border-radius: var(--r-lg); font-size: var(--fs-2xs); font-weight: 600;
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry .entry-cat .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.entry .etn-cover { object-fit: cover; border-radius: var(--r-xs); flex-shrink: 0; }
/* Cover with the category chip under it (In progress with small covers,
   0.294.0). A fixed width keeps every title starting at the same x,
   whatever the chip says. */
.entry .etn-side { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); flex-shrink: 0; width: 64px; }
.entry .etn-side .entry-cat { max-width: 100%; padding: var(--space-2) var(--space-6); }
/* Big covers carry the chip as a label across their foot instead, so the
   row stays the cover's height. The opaque backing keeps the chip's tint
   reading the same over any art. */
.entry .etn-side.on-cover { position: relative; width: auto; }
.etn-side.on-cover .etn-label {
  position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; display: flex;
  background: var(--bg-elev); border-radius: 0 0 var(--r-xs) var(--r-xs); overflow: hidden;
}
.entry .etn-side.on-cover .entry-cat {
  display: block; flex: 1; min-width: 0; border-radius: 0; padding: var(--space-2);
  text-align: center; font-size: var(--fs-2xs);
}
.etn-side.on-cover .entry-cat .dot { display: none; }
/* Cover art on its way in (coverEl in app.js) fades up when it lands; its
   size class already holds the space, so nothing shifts. */
img.etn-cover, img.bl-cover { transition: opacity .25s var(--ease); }
img.cover-loading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { img.etn-cover, img.bl-cover { transition: none; } }
/* Shared cover-art size options (Settings → Appearance → Cover art) — applied
   alongside .etn-cover / .bl-cover, independently for Timeline and Backlog. */
.cover-sm { width: 22px; height: 30px; }
.cover-lg { width: 48px; height: 70px; }
/* Placeholder for entries/backlog items with no cover art (or a broken cover
   URL) — keeps every row the same height as its cover-bearing neighbors
   instead of shrinking to fit bare text. */
.cover-empty { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); font-size: var(--fs-xs); }
.cover-lg.cover-empty { font-size: var(--fs-title); }

/* finance */
.picker-row .fdate { font-size: var(--fs-2xs); color: var(--text-dim); width: 78px; flex: 0 0 auto; }
.finance-entry .famount { font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.famount.fnegative { color: var(--danger); }
.recur-badge { font-size: var(--fs-xs); color: var(--text-dim); flex: 0 0 auto; }
.recur-card { display: flex; flex-direction: column; gap: 2px; }
.recur-row { cursor: pointer; }
.recur-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.recur-text .etitle { flex: none; }
.recur-when { font-size: var(--fs-2xs); color: var(--text-dim); }
/* Stopped or superseded plans — still listed (and openable) so their
   history stays reachable, but visibly out of force. */
.recur-row.is-ended { opacity: .58; }
.recur-subhead { font-size: var(--fs-xs); color: var(--text-dim); margin: var(--space-8) 0 var(--space-2); padding: var(--space-8) var(--space-8) 0; border-top: 1px solid var(--border); }
.rec-occurrences { margin-top: 8px; }
.rec-occ-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rec-occ-head .hint { margin: 0; }
.rec-occ-head .link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer; font-size: var(--fs-xs); padding: 0;
}
.rec-occ-head .link-btn:hover { text-decoration: underline; }
/* Plan history: one row per template this bill has been through, current
   one highlighted. Only shown once a plan change has actually happened. */
.plan-trail { margin-top: 10px; }
.plan-trail[hidden] { display: none; }
.plan-trail .hint { margin: 0 0 4px; }
.plan-trail-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.plan-trail-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; font-size: var(--fs-sm); color: var(--text-dim); cursor: pointer;
}
.plan-trail-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.plan-trail-row:hover { background: var(--bg-elev-2); }
.plan-trail-row.is-current { color: var(--text); cursor: default; background: var(--accent-soft); }
.plan-trail-terms { font-variant-numeric: tabular-nums; flex: 0 0 auto; }
/* Pause ranges reuse the plan-trail list shell (same wrapper classes in
   index.html) — only the row's own accents differ. */
.pause-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; font-size: var(--fs-sm); color: var(--text-dim); cursor: pointer;
}
.pause-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.pause-row:hover { background: var(--bg-elev-2); }
.pause-row.is-live { color: var(--text); }
.pause-tag {
  font-size: var(--fs-2xs); color: var(--text-dim); flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 2px 8px;
}
.rec-occ-list { max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.rec-occ-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: var(--fs-sm); cursor: pointer; }
.rec-occ-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.rec-occ-row:hover { background: var(--bg-elev-2); }
.rec-occ-row.is-overridden .rec-occ-date { color: var(--accent); }
.rec-occ-row.is-skipped { opacity: 0.55; }
.rec-occ-row.is-skipped .rec-occ-amount { font-style: italic; }
.rec-occ-date { color: var(--text-dim); }
.rec-occ-amount { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--danger); }
.finance-entry.is-skipped { opacity: 0.5; }
.finance-entry.is-skipped .famount { text-decoration: line-through; }
.skipped-badge { font-size: var(--fs-2xs); color: var(--text-dim); font-style: italic; flex: 0 0 auto; }

/* ---------- the import review (laid out again in 2026-11) ----------
   Every import ends here. A computer gets three columns, filters | list |
   preview, in a window as big as the screen allows; under 1100px the
   filters become a sheet behind chips; a phone fills the screen and opens
   the preview over the list. The ids are the 0.255.0 ones, so every import
   and its tests still find their parts. */
#financePickerModal .picker-sheet {
  width: min(1480px, 100%); height: calc(100vh - var(--space-48)); max-height: none;
  padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; position: relative;
}
#financePickerModal .picker-sheet.is-compact { width: min(1000px, 100%); height: min(640px, calc(100vh - var(--space-48))); }
.picker-head { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-16) var(--space-20) var(--space-12); border-bottom: 1px solid var(--border); }
.picker-head-text { flex: 1 1 auto; min-width: 0; }
.picker-head h2 { margin: 0; font-size: var(--fs-title); }
.picker-head .hint { margin: var(--space-4) 0 0; max-width: 90ch; }
.picker-close { flex: 0 0 auto; color: var(--text-dim); }
.picker-close .ico { width: 18px; height: 18px; }
.picker-body { display: grid; grid-template-columns: 240px minmax(340px, 460px) minmax(0, 1fr); min-height: 0; position: relative; }
.picker-sheet.no-rail .picker-body { grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); }
.picker-sheet.no-rail .picker-rail, .picker-sheet.no-rail .picker-rail-scrim { display: none; }

/* filters */
.picker-rail { border-inline-end: 1px solid var(--border); overflow-y: auto; overscroll-behavior: contain; padding: var(--space-14) var(--space-12) var(--space-20); display: flex; flex-direction: column; gap: var(--space-20); min-height: 0; }
.picker-rail-top { display: none; align-items: center; justify-content: space-between; }
.picker-rail-top h3 { margin: 0; font-size: var(--fs-lg); }
.picker-rail-sec[hidden] { display: none; }
.picker-rail-h { margin: 0 var(--space-8) var(--space-6); font-size: var(--fs-2xs); font-weight: 650; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.picker-rail-scrim { display: none; }
.picker-filter { display: flex; flex-direction: column; gap: var(--space-2); }
.picker-filter-row {
  display: flex; align-items: center; gap: var(--space-8); width: 100%; min-height: 32px; padding: var(--space-6) var(--space-8);
  border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer;
}
.picker-filter-row:hover { background: var(--bg-elev-2); }
.picker-filter-row.on { background: var(--accent-soft); font-weight: 600; }
.picker-filter-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-filter-n, .picker-group-n { color: var(--text-dim); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.picker-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.picker-rail .toggle-label { padding: var(--space-6) var(--space-8); margin: 0; }
.picker-threshold { display: flex !important; align-items: center; flex-wrap: wrap; gap: var(--space-8); margin: 0 !important; padding: var(--space-6) var(--space-8); font-size: var(--fs-sm); color: var(--text); }
.picker-threshold input { width: 72px !important; margin: 0; text-align: end; }
.picker-threshold[hidden] { display: none !important; }

/* Years and months: each a row whose box takes the whole period in or out
   (on, part, off), months behind the year's chevron. */
.picker-buckets { display: flex; flex-direction: column; gap: var(--space-2); }
.picker-buckets[hidden] { display: none; }
.picker-year-head { display: flex; align-items: center; gap: var(--space-2); }
.picker-buckets .cat-chip {
  flex: 1 1 auto; display: flex; align-items: center; gap: var(--space-8); min-height: 32px; padding: var(--space-6) var(--space-8);
  border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 500; text-align: start;
}
.picker-buckets .cat-chip:hover { background: var(--bg-elev-2); }
.picker-buckets .cat-chip::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto; box-sizing: border-box; border-radius: var(--r-xs);
  border: 1.5px solid var(--text-faint); background: none;
}
.picker-buckets .cat-chip.on::before { background: var(--accent-fill); border-color: var(--accent-fill); }
.picker-buckets .cat-chip.part::before { border-color: var(--accent); background: linear-gradient(var(--accent), var(--accent)) center / 8px 2px no-repeat; }
.picker-buckets .cat-chip.on::after {
  content: ""; position: absolute; inset-inline-start: 14px; top: 50%; width: 4px; height: 8px; margin-top: -6px; border: solid var(--text-on-accent); border-width: 0 2px 2px 0; rotate: 45deg;
}
.picker-buckets .cat-chip { position: relative; }
.picker-buckets .cat-chip > span:first-child { flex: 1 1 auto; }
.bucket-count { color: var(--text-dim); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.picker-year-more { width: 32px; height: 32px; padding: 0; color: var(--text-dim); flex: 0 0 auto; }
.picker-year-more svg { width: 16px; height: 16px; transition: rotate var(--dur-fast) var(--ease); }
.picker-year.is-open .picker-year-more svg { rotate: 180deg; }
.picker-months { display: flex; flex-direction: column; gap: var(--space-2); padding-inline-start: var(--space-24); margin-inline-end: var(--space-32); }
.picker-months .cat-chip { font-size: var(--fs-xs); min-height: 28px; }
.picker-newcats { margin: 0; padding: var(--space-10) var(--space-6) var(--space-6); background: var(--accent-soft); border-radius: var(--r-card); }
.picker-newcats-eyebrow { margin: 0 var(--space-8) var(--space-6); font-size: var(--fs-2xs); font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.picker-newcats-list { display: flex; flex-direction: column; gap: var(--space-2); }

/* the list */
.picker-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-inline-end: 1px solid var(--border); }
.picker-tools { display: flex; gap: var(--space-8); align-items: center; padding: var(--space-12) var(--space-14) var(--space-6); }
.picker-search {
  flex: 1 1 auto; min-width: 0; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: var(--space-8) var(--space-12); border-radius: var(--r-md); font-size: var(--fs-sm); margin: 0;
}
.picker-search:focus { outline: none; border-color: var(--accent); }
.picker-search[hidden], .picker-tools select[hidden] { display: none; }
.picker-tools select { flex: 0 0 auto; max-width: 150px; margin: 0; }
.picker-chips { display: none; }
.picker-toolbar { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-4) var(--space-14) var(--space-6); font-size: var(--fs-xs); }
.picker-selcount { flex: 1 1 auto; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.picker-toolbar .link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: var(--fs-xs); padding: 0; }
.picker-toolbar .link-btn:hover { text-decoration: underline; }
.picker-catbar { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; padding: 0 var(--space-14) var(--space-8); font-size: var(--fs-sm); }
.picker-catbar select { flex: 1 1 140px; min-width: 0; max-width: 240px; margin: 0; }
.picker-catbar[hidden] { display: none; }
.picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--border); padding-bottom: var(--space-8); }
.picker-list:focus { outline: none; }
.picker-group {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: var(--space-8);
  padding-block: var(--space-8) var(--space-4); padding-inline: var(--space-16) var(--space-14); background: var(--bg-elev);
  font-size: var(--fs-2xs); font-weight: 650; color: var(--text-dim);
}
.modal label.picker-row {
  display: flex; align-items: center; gap: var(--space-8); margin: 0; padding-block: var(--space-8); padding-inline: var(--space-12) var(--space-14);
  border-inline-start: 3px solid transparent; font-size: var(--fs-sm); color: var(--text); cursor: pointer;
}
.modal label.picker-row:hover { background: var(--bg-elev-2); }
.modal label.picker-row.is-active { background: var(--accent-soft); border-inline-start-color: var(--accent); }
.picker-row .bar { width: 3px; align-self: stretch; border-radius: var(--r-hair); flex: 0 0 auto; }
.picker-row .etitle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.picker-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.picker-text .etitle { flex: none; }
.picker-snippet { font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-pics { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-2xs); color: var(--text-dim); flex: 0 0 auto; }
.picker-pics .ico { width: 13px; height: 13px; }
.picker-row .ecat { flex: 0 0 auto; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row.is-dup { opacity: .55; }
/* An update's values and the row's editor (0.258.0). */
.picker-row.is-update { flex-wrap: wrap; }
.picker-fills { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-14); padding-inline-start: var(--space-32); font-size: var(--fs-2xs); color: var(--text-dim); }
.picker-fill { display: inline-flex; gap: var(--space-4); min-width: 0; }
.picker-fill-val { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.picker-edit { width: 32px; height: 32px; padding: 0; margin-inline-start: auto; color: var(--text-dim); flex: 0 0 auto; }
.picker-edit svg { width: 14px; height: 14px; }
.picker-row.is-edited { border-inline-start-color: var(--accent); }
.picker-editor { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-10); margin: var(--space-4) var(--space-12); padding: var(--space-8) var(--space-10) var(--space-10); border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--bg-elev-2); }
.picker-editor-field { display: flex; flex-direction: column; gap: var(--space-4); margin: 0 !important; font-size: var(--fs-xs); color: var(--text-dim); min-width: 0; }
.picker-editor-field:first-child { grid-column: 1 / -1; }
.picker-editor-field input, .picker-editor-field select { width: 100%; margin: 0; min-width: 0; }
.picker-editor-when { display: flex; gap: var(--space-6); }
.picker-editor-when select { flex: 1 1 auto; }
.picker-editor-when input { flex: 0 0 84px; }
.picker-editor-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: var(--space-8); }
.dup-tag {
  font-size: var(--fs-2xs); color: var(--text-dim); flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--space-2) var(--space-8);
}

/* the preview */
.picker-preview { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-elev); }
.picker-preview-bar { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-10) var(--space-16); border-bottom: 1px solid var(--border); }
.picker-preview-bar .btn-icon.picker-preview-back { display: none; }
/* The preview has Edit; a pencil on every row only crowds the titles. */
.picker-sheet .picker-edit { display: none; }
.picker-rail .toggle-label .picker-filter-n { margin-inline-start: auto; }
.modal label.picker-include {
  display: inline-flex; align-items: center; gap: var(--space-8); margin: 0; min-height: 32px; padding-block: 0; padding-inline: var(--space-10) var(--space-12);
  border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--accent-soft); color: var(--text); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.picker-include { white-space: nowrap; }
.picker-include:has(input:disabled) { opacity: .5; }
#financePickerPreviewEdit { display: inline-flex; align-items: center; gap: var(--space-6); }
#financePickerPreviewEdit[hidden] { display: none; }
#financePickerPreviewEdit .ico { width: 14px; height: 14px; }
.picker-preview-bar .btn-icon { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; }
.picker-preview-bar .btn-icon .ico { width: 16px; height: 16px; }
.picker-pos { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.picker-preview-doc { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-24) var(--space-32) var(--space-32); }
.picker-preview-doc .picker-editor { margin: 0; max-width: 560px; }
.picker-doc { max-width: 720px; }
.picker-doc-cover { display: block; width: 120px; border-radius: var(--r-md); margin: 0 0 var(--space-16); box-shadow: var(--shadow); }
.picker-doc-title { margin: 0 0 var(--space-6); font-size: var(--fs-2xl); font-weight: 700; overflow-wrap: anywhere; }
.picker-doc-meta { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-14); align-items: center; margin-bottom: var(--space-16); font-size: var(--fs-xs); color: var(--text-dim); }
.picker-doc-meta > span { display: inline-flex; align-items: center; gap: var(--space-6); }
.picker-doc-meta .ico { width: 13px; height: 13px; }
.picker-doc-cat .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.picker-doc-note { margin: 0 0 var(--space-16); font-size: var(--fs-sm); color: var(--text-dim); }
.picker-doc-body { font-size: var(--fs-read); line-height: 1.6; }
.picker-doc-board { padding: var(--space-16); border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--border); }
.picker-doc-board .board-thumb-svg { display: block; width: 100%; height: auto; max-height: 520px; overflow: hidden; }
.picker-doc-body .md-img { max-width: 100%; max-height: 520px; width: auto; }
.picker-doc-fields { display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); gap: var(--space-10) var(--space-16); margin: 0; font-size: var(--fs-sm); max-width: 560px; }
.picker-doc-fields dt { color: var(--text-dim); }
.picker-doc-fields dd { margin: 0; overflow-wrap: anywhere; }
.picker-doc-fill { color: var(--accent); }
.picker-doc-empty { color: var(--text-dim); font-size: var(--fs-sm); margin: var(--space-32) 0; text-align: center; }

.picker-actions { display: flex; align-items: center; gap: var(--space-10); margin: 0; padding: var(--space-12) var(--space-20); border-top: 1px solid var(--border); }
.picker-count { flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); }
.picker-keys { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--text-dim); font-size: var(--fs-xs); margin-inline-end: var(--space-8); white-space: nowrap; }
.picker-keys kbd { font: inherit; font-size: var(--fs-2xs); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 0 var(--space-4); color: var(--text); background: var(--bg-elev-2); }
@media (prefers-reduced-motion: reduce) { .picker-year-more svg { transition: none; } }

/* Under 1100px: the filters move into a sheet over the list, opened from
   the chips (or the new-categories line) above it. */
@media (max-width: 1099px) {
  .picker-body, .picker-sheet.no-rail .picker-body { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.25fr); }
  .picker-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); padding: var(--space-4) var(--space-14) var(--space-8); }
  .picker-chips[hidden] { display: none; }
  .picker-chip { display: inline-flex; align-items: center; gap: var(--space-6); font: inherit; font-size: var(--fs-sm); }
  .picker-chip .ico { width: 14px; height: 14px; color: var(--text-dim); }
  .picker-chip.is-set { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
  .picker-newcats-line {
    flex: 1 1 100%; display: flex; align-items: center; gap: var(--space-8); padding: var(--space-10) var(--space-12);
    border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-elev-2); color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer;
  }
  .picker-newcats-dots { display: inline-flex; gap: var(--space-2); }
  .picker-newcats-choose { margin-inline-start: auto; color: var(--accent); font-weight: 600; }
  .picker-rail {
    position: absolute; z-index: 3; inset-inline-start: 0; top: 0; bottom: 0; width: min(340px, 100%); border-inline-end: 1px solid var(--border);
    background: var(--bg-elev); box-shadow: var(--shadow);
    translate: -105% 0; visibility: hidden; transition: translate .24s var(--ease), visibility 0s .24s;
  }
  .picker-rail-top { display: flex; position: sticky; top: calc(-1 * var(--space-14)); margin: calc(-1 * var(--space-14)) calc(-1 * var(--space-12)) 0; padding: var(--space-12) var(--space-16) var(--space-8); background: var(--bg-elev); z-index: 1; }
  .picker-sheet.rail-open .picker-rail { translate: 0 0; visibility: visible; transition: translate .3s var(--ll-move-ease); }
  .picker-sheet.rail-open .picker-rail-scrim { display: block; position: absolute; inset: 0; z-index: 2; background: var(--scrim); }
  .picker-keys { display: none; }
}
@media (max-width: 1099px) and (prefers-reduced-motion: reduce) {
  .picker-rail, .picker-sheet.rail-open .picker-rail { transition: none; }
}
/* A phone: the whole screen, one column, the preview sliding in over the
   list. Kept in step with the html.force-mobile copy below. */
@media (max-width: 720px) {
  html:not(.force-pc) #financePickerModal { padding: 0; align-items: stretch; }
  html:not(.force-pc) #financePickerModal .picker-sheet,
  html:not(.force-pc) #financePickerModal .picker-sheet.is-compact { width: 100%; height: 100%; border: 0; border-radius: 0; }
  html:not(.force-pc).native #financePickerModal .picker-sheet { padding-top: var(--sat); padding-bottom: var(--sab); }
  html:not(.force-pc) .picker-head { padding-block: var(--space-12) var(--space-8); padding-inline: var(--space-16) var(--space-8); border-bottom: 0; }
  html:not(.force-pc) .picker-head .hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-xs); }
  html:not(.force-pc) .picker-close { width: 44px; height: 44px; margin: calc(-1 * var(--space-6)) 0 0; }
  html:not(.force-pc) .picker-body, html:not(.force-pc) .picker-sheet.no-rail .picker-body { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .picker-main { border-inline-end: 0; }
  html:not(.force-pc) .picker-tools { padding: 0 var(--space-16) var(--space-8); }
  html:not(.force-pc) .picker-search { font-size: var(--fs-lg); min-height: 44px; }
  html:not(.force-pc) .picker-tools select { min-height: 44px; }
  html:not(.force-pc) .picker-chips { padding: 0 var(--space-16) var(--space-8); }
  html:not(.force-pc) .picker-chip { min-height: 44px; }
  html:not(.force-pc) .picker-toolbar, html:not(.force-pc) .picker-catbar { padding-inline-start: var(--space-16); padding-inline-end: var(--space-16); }
  html:not(.force-pc) .picker-toolbar .link-btn { min-height: 32px; }
  html:not(.force-pc) .modal label.picker-row { min-height: 56px; padding-block: var(--space-8); padding-inline: var(--space-14) var(--space-16); border-inline-start: 0; }
  html:not(.force-pc) .picker-row input[type=checkbox] { width: 20px; height: 20px; }
  html:not(.force-pc) .picker-row .ecat, html:not(.force-pc) .picker-row .fdate { display: none; }
  html:not(.force-pc) .picker-rail {
    top: auto; inset-inline-end: 0; width: auto; max-height: 78%; border: 0; border-top: 1px solid var(--border);
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; translate: 0 105%;
  }
  html:not(.force-pc) .picker-group { padding-inline-start: var(--space-16); padding-inline-end: var(--space-16); }
  html:not(.force-pc) .picker-editor { grid-template-columns: 1fr; }
  html:not(.force-pc) .picker-buckets .cat-chip, html:not(.force-pc) .picker-filter-row, html:not(.force-pc) .picker-rail .toggle-label, html:not(.force-pc) .picker-rail .picker-threshold { min-height: 44px; }
  html:not(.force-pc) button.todo-section { min-height: 44px; padding-top: var(--space-4); }
  html:not(.force-pc) .picker-year-more { width: 44px; height: 44px; }
  html:not(.force-pc) .picker-toolbar .link-btn, html:not(.force-pc) .picker-catbar select { min-height: 44px; }
  html:not(.force-pc) .modal label.picker-include { min-height: 44px; }
  html:not(.force-pc) .picker-preview {
    position: absolute; inset: 0; z-index: 4; translate: 100% 0; visibility: hidden;
    transition: translate .2s var(--ease), visibility 0s .2s;
  }
  html:not(.force-pc) .picker-sheet.preview-open .picker-preview { translate: 0 0; visibility: visible; transition: translate .3s var(--ll-move-ease); }
  html:not(.force-pc) .picker-preview-bar { padding: var(--space-4) var(--space-8); gap: var(--space-4); }
  html:not(.force-pc) .picker-preview-bar .btn-icon.picker-preview-back { display: grid; }
  html:not(.force-pc) .picker-preview-bar .btn-icon { width: 44px; height: 44px; border: 0; background: none; }
  html:not(.force-pc) #financePickerPreviewEdit { min-height: 40px; }
  html:not(.force-pc) .picker-edit-label, html:not(.force-pc) .picker-pos { display: none; }
  html:not(.force-pc) #financePickerPreviewEdit { min-width: 44px; justify-content: center; }
  html:not(.force-pc) .picker-preview-doc { padding: var(--space-12) var(--space-16) var(--space-24); }
  html:not(.force-pc) .picker-doc-title { font-size: var(--fs-title); }
  html:not(.force-pc) .picker-actions { padding: var(--space-10) var(--space-16) var(--space-12); }
  html:not(.force-pc) .picker-actions .btn { min-height: 44px; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  html:not(.force-pc) .picker-preview, html:not(.force-pc) .picker-sheet.preview-open .picker-preview { transition: none; }
}
html.force-mobile #financePickerModal { padding: 0; align-items: stretch; }
html.force-mobile #financePickerModal .picker-sheet,
html.force-mobile #financePickerModal .picker-sheet.is-compact { width: 100%; height: 100%; border: 0; border-radius: 0; }
html.force-mobile.native #financePickerModal .picker-sheet { padding-top: var(--sat); padding-bottom: var(--sab); }
html.force-mobile .picker-head { padding-block: var(--space-12) var(--space-8); padding-inline: var(--space-16) var(--space-8); border-bottom: 0; }
html.force-mobile .picker-head .hint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-xs); }
html.force-mobile .picker-close { width: 44px; height: 44px; margin: calc(-1 * var(--space-6)) 0 0; }
html.force-mobile .picker-body, html.force-mobile .picker-sheet.no-rail .picker-body { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .picker-main { border-inline-end: 0; }
html.force-mobile .picker-tools { padding: 0 var(--space-16) var(--space-8); }
html.force-mobile .picker-search { font-size: var(--fs-lg); min-height: 44px; }
html.force-mobile .picker-tools select { min-height: 44px; }
html.force-mobile .picker-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); padding: 0 var(--space-16) var(--space-8); }
html.force-mobile .picker-chips[hidden] { display: none; }
html.force-mobile .picker-chip { display: inline-flex; align-items: center; gap: var(--space-6); font: inherit; font-size: var(--fs-sm); min-height: 44px; }
html.force-mobile .picker-chip .ico { width: 14px; height: 14px; color: var(--text-dim); }
html.force-mobile .picker-chip.is-set { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
html.force-mobile .picker-newcats-line {
  flex: 1 1 100%; display: flex; align-items: center; gap: var(--space-8); padding: var(--space-10) var(--space-12);
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-elev-2); color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer;
}
html.force-mobile .picker-newcats-dots { display: inline-flex; gap: var(--space-2); }
html.force-mobile .picker-newcats-choose { margin-inline-start: auto; color: var(--accent); font-weight: 600; }
html.force-mobile .picker-rail {
  position: absolute; z-index: 3; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; top: auto; width: auto; max-height: 78%; border: 0; border-top: 1px solid var(--border);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--bg-elev); box-shadow: var(--shadow);
  translate: 0 105%; visibility: hidden; transition: translate .24s var(--ease), visibility 0s .24s;
}
html.force-mobile .picker-rail-top { display: flex; position: sticky; top: calc(-1 * var(--space-14)); margin: calc(-1 * var(--space-14)) calc(-1 * var(--space-12)) 0; padding: var(--space-12) var(--space-16) var(--space-8); background: var(--bg-elev); z-index: 1; }
html.force-mobile .picker-sheet.rail-open .picker-rail { translate: 0 0; visibility: visible; transition: translate .3s var(--ll-move-ease); }
html.force-mobile .picker-sheet.rail-open .picker-rail-scrim { display: block; position: absolute; inset: 0; z-index: 2; background: var(--scrim); }
html.force-mobile .picker-keys { display: none; }
html.force-mobile .picker-toolbar, html.force-mobile .picker-catbar { padding-inline-start: var(--space-16); padding-inline-end: var(--space-16); }
html.force-mobile .picker-toolbar .link-btn { min-height: 32px; }
html.force-mobile .modal label.picker-row { min-height: 56px; padding-block: var(--space-8); padding-inline: var(--space-14) var(--space-16); border-inline-start: 0; }
html.force-mobile .picker-row input[type=checkbox] { width: 20px; height: 20px; }
html.force-mobile .picker-row .ecat, html.force-mobile .picker-row .fdate { display: none; }
html.force-mobile .picker-group { padding-inline-start: var(--space-16); padding-inline-end: var(--space-16); }
html.force-mobile .picker-editor { grid-template-columns: 1fr; }
html.force-mobile .picker-buckets .cat-chip, html.force-mobile .picker-filter-row, html.force-mobile .picker-rail .toggle-label, html.force-mobile .picker-rail .picker-threshold { min-height: 44px; }
html.force-mobile button.todo-section { min-height: 44px; padding-top: var(--space-4); }
html.force-mobile .picker-year-more { width: 44px; height: 44px; }
html.force-mobile .picker-toolbar .link-btn, html.force-mobile .picker-catbar select { min-height: 44px; }
html.force-mobile .modal label.picker-include { min-height: 44px; }
html.force-mobile .picker-preview {
  position: absolute; inset: 0; z-index: 4; translate: 100% 0; visibility: hidden;
  transition: translate .2s var(--ease), visibility 0s .2s;
}
html.force-mobile .picker-sheet.preview-open .picker-preview { translate: 0 0; visibility: visible; transition: translate .3s var(--ll-move-ease); }
html.force-mobile .picker-preview-bar { padding: var(--space-4) var(--space-8); gap: var(--space-4); }
html.force-mobile .picker-preview-bar .btn-icon.picker-preview-back { display: grid; }
html.force-mobile .picker-preview-bar .btn-icon { width: 44px; height: 44px; border: 0; background: none; }
html.force-mobile #financePickerPreviewEdit { min-height: 40px; }
html.force-mobile .picker-edit-label, html.force-mobile .picker-pos { display: none; }
html.force-mobile #financePickerPreviewEdit { min-width: 44px; justify-content: center; }
html.force-mobile .picker-preview-doc { padding: var(--space-12) var(--space-16) var(--space-24); }
html.force-mobile .picker-doc-title { font-size: var(--fs-title); }
html.force-mobile .picker-actions { padding: var(--space-10) var(--space-16) var(--space-12); }
html.force-mobile .picker-actions .btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  html.force-mobile .picker-preview, html.force-mobile .picker-sheet.preview-open .picker-preview,
  html.force-mobile .picker-rail, html.force-mobile .picker-sheet.rail-open .picker-rail { transition: none; }
}
.bar-row.money { grid-template-columns: 120px 1fr 100px; }
/* A round target a finger can find, with negative margins so the chip
   doesn't grow, and a tinted circle on press: the glyph alone is 11px at
   60%, and the app-wide dim would have made it brighter, not darker. */
.chip-edit {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  margin-block: -4px; margin-inline: -1px -6px; border-radius: 50%; opacity: .6; font-size: var(--fs-2xs);
  transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip-edit:hover { opacity: 1; color: var(--accent); }
.chip-edit:active { opacity: 1; color: var(--accent); background: var(--accent-soft); }
/* The ✎ answers for itself; the chip it sits in stays as it is. */
.cat-chip:active:has(.chip-edit:active) { opacity: 1; }

/* Touch areas (0.219.0, DESIGN.md §9). These controls stay the size they
   look; an empty ::after widens what a finger can hit. Before this the
   month + was a 20px target repeated on every month, and the ✎ was 22px.
   - The + buttons sit alone in a header, so they get the full 44px.
   - A chip claims half the gap around it (chip rows use 8px × 10px), so
     neighbours never overlap: 26px tall becomes 34px. Growing past that
     would mean visibly bigger chips.
   - The ✎ claims the chip's full height and the gap beside it, and sits
     above the chip's own area so a tap on it is still an edit. */
.month-add-btn, .proj-group-add, .cat-chip { position: relative; }
.month-add-btn::after { content: ""; position: absolute; inset: -12px; }
.proj-group-add::after { content: ""; position: absolute; inset: -12px -4px; }
.cat-chip::after { content: ""; position: absolute; inset: -4px -5px; }
.chip-edit { position: relative; z-index: 1; }
.chip-edit::after { content: ""; position: absolute; inset: -6px -5px -6px -8px; }
/* The header's two icon buttons (31px tall, 6px apart) take the margin
   above them and the empty right-hand half of the sync line below, and the
   Years/Categories labels (16px of text that select or clear the whole
   group) take the height of the group beside them. */
/* Sheets (0.220.0), measured at 375px on the entry, backlog and finance
   sheets:
   - Cancel/Save and the rest of the action row: 10px apart with 16px clear
     above, so half the gap each side and 7px up and down, 31 → 45px tall.
   - Rating stars sit 4px apart, so they can't widen without looking
     bigger; they take the height of the field instead, 22 → 44px.
   - "Advanced" has 12px above it and the action row below: 24 → 36px.
   - The ★ / bought / ▶ toggles beside the title, 6px apart: 32 → 44px.
   - ▶ ✓ ↩ on a row reach the row's own edges and stop there, so they
     never take a tap from the row above or below. */
.modal-actions .btn, .rating-input .star, details.advanced > summary,
.priority-star, .bought-toggle, .started-toggle,
.bl-start, .bl-done, .progress-stop, .progress-up { position: relative; }
.modal-actions .btn::after { content: ""; position: absolute; inset: -7px -5px; }
.rating-input .star::after { content: ""; position: absolute; inset: -11px -2px; }
details.advanced > summary::after { content: ""; position: absolute; inset: -6px 0; }
.priority-star::after, .bought-toggle::after, .started-toggle::after { content: ""; position: absolute; inset: -6px -3px; }
.bl-start::after, .bl-done::after, .progress-stop::after { content: ""; position: absolute; inset: -5px -3px; }
/* The In progress row is 70px tall with ↩ ✓ in the middle: room for 44. */
.progress-row .progress-stop::after, .progress-row .bl-done::after, .progress-row .progress-up::after { content: ""; position: absolute; inset: -10px -3px; }
/* A cover row is ~83px tall with ▶ ✓ near its top: room to reach 44. */
.backlog-item-rich .bl-start::after, .backlog-item-rich .bl-done::after { inset: -6px -3px -13px; }
/* The Backlog's bar: Spin / Pick random, 12px from each other. */
.backlog-mode-bar .btn-sm { position: relative; }
.backlog-mode-bar .btn-sm::after { content: ""; position: absolute; inset: -5px -6px; }
/* Notes, Habits and Settings (0.222.0), measured the same way:
   - A list's ☐ and ✕ fill their 29px row and half the 9px gap beside them,
     never the text between them, which edits on a tap: 16 → 24×29, 19 → 27×29.
   - ☆ on a note card reaches the card's corner: 23×19 → 42×29.
   - A list's Add, "Delete finished", the export buttons and the Settings
     ✕ have room all round: up to 44 tall.
   - Switches and the tab-order arrows sit in rows ~22px apart, so half of
     that each way: 24/25 → 44/45 tall.
   - A habit's name (17px of text that opens it) takes the card's margin
     above and the quiet line below: 41 tall. Its Mark done goes 40 → 44.
   The habit grid's 16px day cells are left as they are: a calendar of
   hundreds of days can't give each one 44px. */
.todo-check, .todo-del, .note-card .note-fav, .todo-compose .btn, .note-card .btn-sm,
.btn-small, .settings-page-close, .modal-head .btn-icon, :is(.modal, .board-opts) input.switch, .tab-order-btn,
.habit-tick { position: relative; }
.todo-check::after { content: ""; position: absolute; inset: -7px -4px -6px -4px; }
.todo-del::after { content: ""; position: absolute; inset: -6px -4px -6px -4px; }
.note-card .note-fav::after { content: ""; position: absolute; inset: -12px -9px -8px -10px; }
.todo-compose .btn::after, .note-card .btn-sm::after { content: ""; position: absolute; inset: -10px -5px; }
.btn-small::after { content: ""; position: absolute; inset: -10px -2px; }
.settings-page-close::after, .modal-head .btn-icon::after { content: ""; position: absolute; inset: -7px -5px; }
/* (A pseudo-element doesn't render on an <input>; the switch grows by a transparent border instead, below.) */
.tab-order-btn::after { content: ""; position: absolute; inset: -10px -2px; }
/* Not an ::after: the name clips its overflow for the ellipsis, which would
   clip that too. Padding pulled back by the same margin grows the box. */
.habit-head .habit-name { padding: 12px 4px; margin: -12px -4px; }
.habit-tick::after { content: ""; position: absolute; inset: -2px; }
.settings-corner .btn-icon, .filter-label { position: relative; }
.settings-corner .btn-icon::after { content: ""; position: absolute; inset: -7px -3px; }
.filter-label::after { content: ""; position: absolute; inset: -14px 0; }

/* stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 800px){ html:not(.force-pc) .stats-grid { grid-template-columns: 1fr; } }
html.force-mobile .stats-grid { grid-template-columns: 1fr; }
.stats-grid + .card { margin-top: 20px; }
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.card h2 { margin: 0 0 14px; font-size: var(--fs-read); }
.bar-row { display: grid; grid-template-columns: 120px 1fr 46px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: var(--fs-sm); }
.bar-row .lbl { color: var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* A subcategory's bar under its category's (0.288.0). */
.bar-row.is-sub .lbl { padding-inline-start: var(--space-16); color: var(--text-dim); font-size: var(--fs-xs); }
.bar-row.is-sub .val { font-weight: 500; color: var(--text-dim); }
.bar-track { background: var(--bg-elev-2); border-radius: var(--r-sm); height: 16px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-sm); }
.bar-row .val { text-align: end; font-variant-numeric: tabular-nums; color: var(--text); font-weight:600; }
.bar-row .val .val-unique { display: none; }
.bar-row .val .val-unique-lbl { display: none; font-size: var(--fs-3xs); color: var(--accent); line-height: 1; }
.bar-row:hover .val .val-total { display: none; }
.bar-row:hover .val .val-unique { display: block; color: var(--accent); }
.bar-row:hover .val .val-unique-lbl { display: block; }
.bar-row:hover .val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.stat-big { display:flex; gap: 28px; flex-wrap: wrap; margin-bottom: 4px; }
.stat-big .item .n { font-size: var(--fs-stat); font-weight: 700; }
.stat-big .item .l { color: var(--text-dim); font-size: var(--fs-xs); }

/* heatmap */
.heatmap { overflow-x: auto; padding-bottom: 4px; }
.heatmap-row { display: grid; grid-template-columns: 38px repeat(12, 1fr); gap: 4px; margin-bottom: 4px; align-items: center; }
.heatmap-month-lbl { font-size: var(--fs-3xs); color: var(--text-faint); text-align: center; letter-spacing: .2px; }
.heatmap-year-lbl { font-size: var(--fs-2xs); color: var(--text-dim); }
.heatmap-cell { height: 18px; border-radius: var(--r-xs); background: var(--bg-elev-2); }
.heatmap-cell.is-clickable { cursor: pointer; }
.heatmap-cell.is-clickable:hover { opacity: .8; box-shadow: 0 0 0 2px var(--accent) inset; }
.heatmap-cell.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* year in review */
.yir-card { border-top: 3px solid var(--accent); }
.yir-years { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.yir-year-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 4px 12px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.yir-year-btn:hover:not(.active) { background: var(--bg-elev-2); color: var(--text); }
.yir-year-btn.active { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--text-on-accent); }
.yir-highlights { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }
.yir-highlights .item .n { font-size: var(--fs-2xl); font-weight: 700; }
.yir-highlights .item .l { color: var(--text-dim); font-size: var(--fs-2xs); }
.yir-section { margin-top: 16px; }
.yir-section h3 { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin: 0 0 8px; font-weight: 600; }
.yir-ach { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; font-size: var(--fs-sm); }
.yir-ach-bullet { color: var(--accent); font-size: var(--fs-3xs); flex-shrink: 0; }
.yir-rated { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; font-size: var(--fs-sm); }
.yir-rated-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.yir-rated-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yir-rated .erating { margin-inline-start: auto; flex-shrink: 0; font-size: var(--fs-2xs); color: var(--accent); letter-spacing: 1px; }

/* backlog */
/* One strip above the list: the layout switch on the left, and whatever
   belongs to the current layout (the dice button, or the waiting count) on
   the right. Wraps to two lines on a narrow phone rather than squeezing. */
.backlog-mode-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
/* The switch that used to hold the left-hand side moved onto the tab, so
   what's left is often the bar's only child — and space-between puts a lone
   child at the start. Whatever is alone here belongs on the right, where
   Discover's Refresh sits and where these all were when the switch was
   still holding the other end. */
.backlog-mode-bar > :only-child { margin-inline-start: auto; }
.backlog-mode-count { font-size: var(--fs-xs); color: var(--text-dim); }
/* Out today (0.226.0): the card above Next releases. Same rows as the list,
   with ▶ ✓ at the end. */
.out-card { margin-bottom: 14px; }
.out-card .btn-sm { flex: 0 0 auto; }

/* The once-a-day sheet: a wall of covers, name under each. */
.out-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 60vh; overflow-y: auto; }
.out-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 0; text-align: start;
  background: none; border: 0; color: var(--text); cursor: pointer; font: inherit;
}
.out-tile-cover { width: 100%; aspect-ratio: 2 / 3; height: auto; object-fit: cover; border-radius: var(--r-md); }
.out-tile-title { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.out-tile-cat { font-size: var(--fs-2xs); color: var(--text-dim); }
.out-tile-when { font-size: var(--fs-2xs); color: var(--accent); }
/* Sized to the count (0.259.0): one tile large and centred, two or three
   across, four or more as the grid above. */
.out-grid[data-n="1"] { grid-template-columns: minmax(0, 200px); justify-content: center; text-align: center; }
.out-grid[data-n="1"] .out-tile { align-items: center; text-align: center; }
.out-grid[data-n="1"] .out-tile-title { font-size: var(--fs-lg); }
.out-grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 160px)); justify-content: center; }
.out-grid[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.out-grid[data-n="2"] .out-tile-title, .out-grid[data-n="3"] .out-tile-title { font-size: var(--fs-md); }
.out-week-btn { display: inline-flex; align-items: center; gap: 6px; }
.out-week-count { font-size: var(--fs-2xs); font-weight: 700; background: var(--accent-fill); color: var(--text-on-accent); border-radius: var(--r-pill); padding: 0 6px; min-width: 18px; text-align: center; }

.seg {
  display: inline-flex; background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 2px; gap: 2px;
}
.seg-btn {
  appearance: none; background: none; border: 0; color: var(--text-dim);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 6px 12px;
  border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-card); color: var(--text); box-shadow: var(--shadow); }

/* next releases */
.up-section-sub { font-size: var(--fs-2xs); color: var(--text-dim); }
.up-cat-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.up-when { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: var(--fs-xs); }
.up-date { color: var(--accent); }
.up-countdown { color: var(--text-dim); }
.entry.up-row { display: flex; align-items: center; gap: 8px; }
.entry.up-row .bl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.backlog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.backlog-section {
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.backlog-section-head {
  display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.backlog-section-head .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
/* Dot + name, which yield width to the count but only down to a floor. A
   split count can name three asides, and left to shrink freely the name went
   to a single ellipsed letter to make room for them. Past the floor the
   header wraps and the count takes a line of its own; a name too long for a
   line even then still ellipses, as it always did. */
.backlog-section-title {
  display: flex; align-items: center; gap: 10px; min-width: 4em; overflow: hidden;
}
.backlog-section-name {
  font-size: var(--fs-lg); font-weight: 600; color: var(--text);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.backlog-section-count { margin-inline-start: auto; font-size: var(--fs-sm); color: var(--text-dim); font-weight: 600; white-space: nowrap; }
/* The "+N EA, +N unreleased" half of a split count — quieter than the number
   it qualifies, since it is the aside and not the headline. */
.bl-count-pending { margin-inline-start: 6px; font-size: var(--fs-2xs); font-weight: 500; color: var(--text-dim); }
.backlog-list { display: flex; flex-direction: column; gap: 2px; }
.backlog-item-rich {
  display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: var(--r-md); cursor: pointer;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.backlog-item-rich:hover { background: var(--bg-elev-2); }
.backlog-item-rich .bl-cover {
  object-fit: cover; border-radius: var(--r-xs); flex: 0 0 auto; margin-top: 1px;
}
.backlog-item-rich .bl-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px;
}
.backlog-item-rich .bl-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.backlog-item-rich .bl-title {
  flex: 0 1 auto; min-width: 0;
  font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.backlog-item-rich .bl-meta { font-size: var(--fs-2xs); color: var(--accent); }
.backlog-item-rich .bl-price:empty { display: none; }
.backlog-item-rich .bl-summary {
  font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.backlog-item-rich .ecat { align-self: flex-start; margin-top: 4px; flex-shrink: 0; }
.backlog-item-rich .btn-sm { align-self: flex-start; flex-shrink: 0; }

.backlog-priority-sep, .backlog-ea-sep, .backlog-upcoming-sep, .backlog-dropped-sep { border-top: 1px dashed var(--border); margin: 6px 2px; }
/* The Dropped band's separator is the bar you press to open it, so it is a
   button wearing the same dashed rule — drawn as the two ::before/::after
   halves either side of the label. */
.backlog-dropped-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 8px 2px; margin: 0 0 -4px;
  font: inherit; font-size: var(--fs-xs); color: var(--text-dim); cursor: pointer;
  /* Same three as every other pressable row in here: without them a tap
     draws the browser's blue highlight rect over the bar, and a press that
     lingers starts selecting the label text instead of opening the block. */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
/* Keyboard focus still needs a ring — :focus-visible doesn't match a tap. */
.backlog-dropped-toggle:focus { outline: none; }
.backlog-dropped-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.backlog-dropped-toggle::before, .backlog-dropped-toggle::after {
  content: ""; flex: 1 1 auto; border-top: 1px dashed var(--border);
}
.backlog-dropped-toggle:hover, .backlog-dropped-toggle:focus-visible { color: var(--text-dim); }
.backlog-dropped-toggle .bdt-label { flex: 0 0 auto; white-space: nowrap; }
/* filter, not opacity: .ll-enter animates opacity 0 -> 1, and a running CSS
   animation outranks a normal declaration, so a dropped row arriving into an
   opened block sat at full brightness for the whole 300ms and only then
   snapped to dim. A filter is untouched by that animation, so the row fades
   in already dimmed. */
/* The Covers layout (0.290.0, under View): each section a full-width wall
   of covers, the band rules, fold bars and month headings spanning it. The
   Backlog's lists and the Timeline's month cards both. */
.backlog-grid.is-covers, .month-grid.is-covers { grid-template-columns: 1fr; }
.backlog-list.bl-covers, .month-card.is-covers {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: var(--space-12) var(--space-10);
}
.backlog-list.bl-covers { padding-top: var(--space-4); }
.backlog-list.bl-covers > :not(.bl-tile), .month-card.is-covers > :not(.bl-tile) { grid-column: 1 / -1; }
/* The star in a tile's corner says it; a rule under the starred ones would
   leave a half-empty row of covers above it. */
.backlog-list.bl-covers > .backlog-priority-sep { display: none; }
/* Three across on any phone, 360px wide included. */
@media (max-width: 720px) {
  html:not(.force-pc) :is(.backlog-list.bl-covers, .month-card.is-covers) { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
html.force-mobile :is(.backlog-list.bl-covers, .month-card.is-covers) { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.bl-tile {
  display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.bl-tile-art { position: relative; }
.bl-tile-cover {
  display: block; width: 100%; aspect-ratio: 2 / 3; height: auto; object-fit: cover;
  border-radius: var(--r-md); background: var(--bg-elev-2);
}
.bl-tile-cover.cover-empty { display: flex; font-size: var(--fs-title); }
@media (hover: hover) {
  .bl-tile:hover .bl-tile-cover { outline: 2px solid var(--border-strong); outline-offset: 2px; }
}
.bl-tile-title {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text); line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* The Timeline's calendar (0.291.0): a month of days beside (desktop) or
   above (phone) the picked day's entries and the ones with no day set. */
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-16); align-items: start; }
.cal-main { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-12) var(--space-14); }
.cal-side { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.cal-head { display: flex; align-items: center; gap: var(--space-10); margin-bottom: var(--space-10); }
.cal-title { margin: 0; font-size: var(--fs-title); }
.cal-count { font-size: var(--fs-sm); color: var(--text-dim); }
.cal-nav { margin-inline-start: auto; display: flex; gap: var(--space-8); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-4); }
.cal-wd { font-size: var(--fs-2xs); color: var(--text-dim); text-align: center; padding: var(--space-4) 0; }
.cal-day {
  position: relative; min-height: 112px; padding: var(--space-24) var(--space-6) var(--space-6);
  border: 0; border-radius: var(--r-sm); background: var(--bg-elev-2); color: var(--text);
  font: inherit; text-align: start; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent;
}
.cal-day.is-out { background: none; cursor: default; }
/* Drawn over the cover, which would hide an inset shadow on the cell. */
.cal-day.is-today::after, .cal-day.is-picked::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cal-day.is-picked::after { box-shadow: inset 0 0 0 2px var(--text); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-n { position: absolute; top: var(--space-4); inset-inline-start: var(--space-6); font-size: var(--fs-2xs); color: var(--text-dim); }
.cal-cover, .cal-more { display: none; }
.cal-names { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.cal-name {
  display: flex; align-items: center; gap: var(--space-4); font-size: var(--fs-xs);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-name .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.cal-name.is-more { color: var(--text-dim); }
.cal-daycard h3, .cal-undated h3, .cal-tasks h3 { margin-bottom: var(--space-6); }
/* Open tasks on a day (0.317.0): on the desktop a line each, with a ring
   for a dot in the colour of its priority; on a phone, where the cell is a
   cover, one ring in its corner for the most urgent, with how many. */
.cal-ring { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; border: 1.5px solid var(--text-dim); }
.cal-ring.is-p1, .cal-task.is-p1 { border-color: var(--danger); }
.cal-ring.is-p2, .cal-task.is-p2 { border-color: var(--warning); }
.cal-ring.is-p3, .cal-task.is-p3 { border-color: var(--accent); }
.cal-name.is-task { color: var(--text-dim); }
/* Backlog releases on their day (0.320.0): a dashed line in the category's
   colour on the desktop, a dashed frame round the cell on a phone, where a
   day with nothing finished shows the release's cover faded. */
.cal-name.is-release { border: 1px dashed var(--rel); border-radius: var(--r-sm); padding: 0 var(--space-4); }
.cal-release-row { cursor: pointer; }
/* Google Calendar's events (0.320.0): a tinted line with the time on the
   desktop (a solid one for all day), in the calendar's own colour; a bar
   along the foot of a phone's cell. --ev falls back to the accent. */
.cal-name.is-event {
  gap: var(--space-4); padding: 0 var(--space-4); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ev, var(--accent)) 18%, transparent); color: var(--text);
}
.cal-name.is-event .cal-time { color: var(--text-dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cal-name.is-event .cal-ev-title { overflow: hidden; text-overflow: ellipsis; }
.cal-name.is-allday { background: var(--ev, var(--accent)); color: var(--text-on-fill); font-weight: 600; }
.cal-evbars { display: none; position: absolute; inset-inline: var(--space-2); bottom: var(--space-2); gap: var(--space-2); z-index: 1; }
.cal-evbar { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--ev, var(--accent)); box-shadow: 0 0 0 1px var(--bg); }
.cal-gcal-head { display: flex; align-items: baseline; gap: var(--space-8); }
.cal-gcal-at { margin-inline-start: auto; font-size: var(--fs-2xs); font-weight: 400; color: var(--text-dim); }
.cal-ev-row {
  display: flex; align-items: baseline; gap: var(--space-10); width: 100%; min-height: 44px; padding: var(--space-6) 0;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.cal-ev-row:first-of-type { border-top: 0; }
.cal-ev-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-ev-time { flex: 0 0 56px; font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; border-inline-start: 3px solid var(--ev, var(--accent)); padding-inline-start: var(--space-6); }
.cal-ev-name { min-width: 0; overflow-wrap: anywhere; }
.cal-gcal-sync { margin-top: var(--space-8); }
@media (hover: hover) { .cal-ev-row:hover { background: var(--hover-bg); } }
.gcal-from { margin: 0; font-size: var(--fs-2xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.gcal-when { margin: var(--space-4) 0 0; color: var(--text-dim); font-size: var(--fs-sm); }
.gcal-place { margin: var(--space-2) 0 0; font-size: var(--fs-sm); }
.gcal-text { margin: var(--space-10) 0 0; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow: auto; }
.gcal-actions { margin-top: var(--space-14); }
.gcal-cal { display: flex; align-items: center; gap: var(--space-8); }
.gcal-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--accent); }
.cal-task {
  display: none; position: absolute; top: var(--space-2); inset-inline-end: var(--space-2); z-index: 1;
  min-width: 14px; height: 14px; padding: 0 var(--space-2); border-radius: var(--r-pill);
  border: 2px solid var(--text-dim); background: var(--surface-card);
  font-size: var(--fs-3xs); line-height: 10px; text-align: center; color: var(--text); font-weight: 600;
}
.cal-empty { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); }
@media (hover: hover) { .cal-day:not(.is-out):hover { background: var(--hover-bg); } }
/* Phones: a cover per day instead of names, and the lists under the grid. */
@media (max-width: 720px) {
  html:not(.force-pc) .cal-body { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .cal-main { padding: var(--space-10); }
  html:not(.force-pc) .cal-day { min-height: 0; aspect-ratio: 3 / 4; padding: 0; }
  html:not(.force-pc) .cal-names { display: none; }
  html:not(.force-pc) .cal-task { display: block; }
  html:not(.force-pc) .cal-evbars { display: flex; }
  html:not(.force-pc) .cal-day.has-release { outline: 2px dashed var(--rel); outline-offset: -2px; }
  html:not(.force-pc) .cal-day .cal-cover.is-release { opacity: 0.5; }
  html:not(.force-pc) .cal-day .cal-cover { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
  html:not(.force-pc) .cal-day .cal-cover.cover-empty { display: flex; }
  html:not(.force-pc) .cal-day.has-cover .cal-n { color: var(--text-on-fill); text-shadow: 0 0 3px var(--bg); }
  html:not(.force-pc) .cal-more {
    display: block; position: absolute; inset-inline-end: var(--space-2); bottom: var(--space-2);
    font-size: var(--fs-3xs); padding: 0 var(--space-4); border-radius: var(--r-pill);
    background: var(--surface-card); color: var(--text);
  }
}
html.force-mobile .cal-body { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .cal-main { padding: var(--space-10); }
html.force-mobile .cal-day { min-height: 0; aspect-ratio: 3 / 4; padding: 0; }
html.force-mobile .cal-names { display: none; }
html.force-mobile .cal-task { display: block; }
html.force-mobile .cal-evbars { display: flex; }
html.force-mobile .cal-day.has-release { outline: 2px dashed var(--rel); outline-offset: -2px; }
html.force-mobile .cal-day .cal-cover.is-release { opacity: 0.5; }
html.force-mobile .cal-day .cal-cover { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
html.force-mobile .cal-day .cal-cover.cover-empty { display: flex; }
html.force-mobile .cal-day.has-cover .cal-n { color: var(--text-on-fill); text-shadow: 0 0 3px var(--bg); }
html.force-mobile .cal-more {
  display: block; position: absolute; inset-inline-end: var(--space-2); bottom: var(--space-2);
  font-size: var(--fs-3xs); padding: 0 var(--space-4); border-radius: var(--r-pill);
  background: var(--surface-card); color: var(--text);
}

/* A second line under the title: a release date, a rating, "In backlog". */
.bl-tile-caption { font-size: var(--fs-2xs); color: var(--text-dim); margin-top: calc(-1 * var(--space-4)); }
.bl-tile-caption.up-when { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
.bl-tile-caption.dsc-tag { align-self: flex-start; }
.bl-tile-caption.erating { color: var(--accent); letter-spacing: 1px; }
.bl-tile-marks {
  position: absolute; top: var(--space-4); inset-inline-end: var(--space-4);
  display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-4);
  border-radius: var(--r-pill); background: var(--surface-card); color: var(--text-dim);
}
.bl-tile-mark { display: inline-flex; }
.bl-tile-mark .ico { width: 12px; height: 12px; }
.bl-tile-mark.is-star { color: var(--priority); }
.bl-tile-mark.is-star .ico { fill: currentColor; }
/* Hover details (0.295.0): what the sheet would tell you, over the cover,
   on a computer only. Fixed black and white like the sheet's times strip,
   since it sits on the art, not the theme. */
.tile-info {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-8); border-radius: var(--r-md); pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .7) 55%, rgba(0, 0, 0, .35));
  color: #fff; opacity: 0; visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast);
}
.tile-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-6); font-size: var(--fs-2xs); line-height: 1.3; }
.tile-info-row:has(.bl-price:empty) { display: none; }
.tile-info-label { color: rgba(255, 255, 255, .75); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-info-row.is-price .tile-info-label { flex: 0 0 auto; }
.tile-info-value { font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) {
  .bl-tile:hover .tile-info { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ll-move-ease), visibility 0s; }
}
.bl-tile .bulk-check { position: absolute; top: var(--space-4); inset-inline-start: var(--space-4); margin: 0; }
.bl-tile.is-dropped { filter: opacity(.55); }
.bl-tile.is-dropped .bl-tile-title { text-decoration: line-through; }

.entry.is-dropped, .backlog-item-rich.is-dropped { filter: opacity(.55); }
.entry.is-dropped .etitle, .backlog-item-rich.is-dropped .bl-title { text-decoration: line-through; }

/* touch-action so a press-and-drag across a run of them paints a selection
   instead of scrolling the list (see bulkCheckbox in app.js). */
.bulk-check { touch-action: none; }
.backlog-section-head .bulk-check { margin-inline-end: 2px; }
.backlog-item-rich .bulk-check { margin-top: 4px; }
.bulk-bar {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 75;
  display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); max-width: calc(100vw - 32px);
}
.bulk-count { font-weight: 600; white-space: nowrap; }
/* A button, not a label: the count is the way into the full run breakdown. */
.bulk-progress {
  color: var(--text-dim); white-space: nowrap; font: inherit; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px 10px;
}
.bulk-progress:hover { color: var(--text); border-color: var(--text-faint); }
.bulk-progress:empty, .bulk-progress[hidden] { display: none; }

.bulkp-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.bulkp-row {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: var(--r-md); font-size: var(--fs-sm);
}
.bulkp-row:nth-child(odd) { background: var(--bg-elev-2); }
.bulkp-glyph { flex: 0 0 1em; text-align: center; color: var(--text-faint); }
.bulkp-row.is-done .bulkp-glyph { color: var(--success); }
.bulkp-row.is-skipped .bulkp-glyph { color: var(--warning); }
.bulkp-row.is-failed .bulkp-glyph { color: var(--danger); }
.bulkp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulkp-detail {
  flex: 0 1 auto; min-width: 0; color: var(--text-dim); font-size: var(--fs-xs);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%;
}
/* The Activity sheet's rows: what each job is, where it's got to, a bar
   while it runs and a Stop. */
.activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.activity-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); }
.activity-row:nth-child(odd) { background: var(--bg-elev-2); }
.activity-glyph { flex: 0 0 1em; text-align: center; color: var(--text-faint); font-size: var(--fs-sm); }
.activity-row.is-running .activity-glyph { color: var(--accent); }
.activity-row.is-done .activity-glyph { color: var(--success); }
.activity-row.is-failed .activity-glyph { color: var(--danger); }
.activity-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity-label { font-size: var(--fs-md); font-weight: 600; }
.activity-meta {
  font-size: var(--fs-xs); color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-row.is-failed .activity-meta { color: var(--danger); white-space: normal; }
.activity-bar { height: 4px; margin-top: 4px; background: var(--border); border-radius: var(--r-hair); overflow: hidden; }
.activity-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-hair); transition: width var(--dur) var(--ease); }
.activity-bar.is-unknown .activity-fill { width: 30%; animation: led-pulse 1.2s ease-in-out infinite; }
.activity-stop { flex: 0 0 auto; position: relative; }
.activity-stop::after { content: ""; position: absolute; inset: -11px -4px; }
.activity-row.is-unfinished .activity-glyph { color: var(--warning); font-weight: 700; }
.activity-dismiss { flex: 0 0 auto; position: relative; min-width: 36px; color: var(--text-dim); }
.activity-dismiss::after { content: ""; position: absolute; inset: -11px -4px; }
.activity-empty { color: var(--text-dim); font-size: var(--fs-sm); margin: 8px 0; }
@media (prefers-reduced-motion: reduce) {
  .activity-fill { transition: none; }
  .activity-bar.is-unknown .activity-fill { animation: none; }
}
/* Warning-coloured rather than a plain button: it names a problem, and the
   count is the point. Sits before the actions, since it changes what they
   will act on. */

.bulk-move-select {
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 6px 8px; border-radius: var(--r-md); font-size: var(--fs-xs);
}

.empty { text-align: center; color: var(--text-dim); padding: 60px 20px; }

/* First-run empty state (Timeline/Backlog/Finance with zero data): icon
   badge + title + body + primary CTA + hint. Distinct from the plain
   ".empty" one-liner above, which is used for "nothing matches your
   filters" — there's no useful add action to show there. */
.empty-state { text-align: center; max-width: 400px; margin: 40px auto; padding: 56px 20px; }
.empty-glyph {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-card); border: 1px solid var(--border); color: var(--accent); font-size: var(--fs-3xl);
}
.empty-state h2 { margin: 0 0 10px; font-size: var(--fs-title); font-weight: 650; color: var(--text); }
.empty-body { margin: 0 0 24px; font-size: var(--fs-md); line-height: 1.6; color: var(--text-dim); }
.empty-hint { margin: 20px 0 0; font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.5; }

/* ---------- Discover ---------- */
/* Rows here are things you don't own yet, so they lean on the backlog row's
   shape but say plainly which list they came from and offer one action. */
.dsc-source { font-size: var(--fs-2xs); font-weight: 500; color: var(--text-dim); text-transform: none; }
/* Which list a card shows, where a category has more than one (RAWG or
   IGDB, NYT or Hardcover). Small, in the head where the source name was;
   30px tall plus 7px each way is the 44px tap area. */
.dsc-switch { margin-inline-start: auto; text-transform: none; letter-spacing: normal; }
.dsc-switch .seg-btn { position: relative; min-height: 30px; padding: 0 var(--space-10); font-size: var(--fs-xs); line-height: 1; }
.dsc-switch .seg-btn::after { content: ""; position: absolute; inset: -7px 0; }
.dsc-row { cursor: pointer; }
.dsc-tag {
  flex: 0 0 auto; font-size: var(--fs-2xs); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1px 8px;
}
.dsc-add {
  flex: 0 0 auto; align-self: flex-start; padding: 2px 10px;
  font-size: var(--fs-md); line-height: 1.35; color: var(--text-dim);
}
.dsc-row:hover .dsc-add { color: var(--accent); border-color: var(--accent); }
.dsc-note { margin: 8px 2px; font-size: var(--fs-sm); color: var(--text-dim); }
.dsc-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Always the right-hand end, also when a narrow screen wraps it onto its own
   line, where space-between alone would start it at the left (0.224.0). */
.backlog-mode-bar > .dsc-bar-right { margin-inline-start: auto; }
.dsc-refresh { min-width: 32px; padding-inline: 8px; font-size: var(--fs-md); }
/* The same height as the sort menu beside them, not 5px short of it, also
   on a phone where the menu grows to 36px. */
.dsc-bar-right > .btn-sm { padding-block: 6px; align-self: stretch; display: inline-flex; align-items: center; }
.dsc-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); color: var(--text-dim); cursor: pointer; user-select: none;
}

/* ---------- modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
/* The sheet itself takes focus when it opens, so a reader announces it
   and Tab starts inside; it isn't a control, so no ring. */
.modal:focus, .modal:focus-visible { outline: none; }
body.modal-open { overflow: hidden; }
.modal {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px 24px; width: 420px; max-width: 100%; box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
}
/* Sheets fade in and rise, and fade out on the way down, instead of popping
   (0.209.0). Pure CSS so every open/close path — each module flips `hidden`
   on its own — gets it for free: `display` transitions discretely, keeping a
   closing sheet on screen for the fade, and @starting-style gives an opening
   one somewhere to come from. `hidden` itself still changes at once, so
   isAnyModalOpen() and everything else that reads it see the sheet closed
   the moment it's asked to close; pointer-events keeps the fading one from
   catching a tap meant for the page. Only translate, never scale: a scaled
   sheet would measure wrong to anything sizing itself on open (the wheel). */
.modal-overlay {
  transition: opacity .2s var(--ll-move-ease), display .2s allow-discrete;
}
.modal-overlay[hidden] {
  opacity: 0; pointer-events: none;
  transition-duration: .14s; transition-timing-function: var(--ease);
}
.modal-overlay > .modal { transition: translate .24s var(--ll-move-ease); }
.modal-overlay[hidden] > .modal { translate: 0 8px; transition-duration: .14s; transition-timing-function: var(--ease); }
@starting-style {
  .modal-overlay { opacity: 0; }
  .modal-overlay > .modal { translate: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-overlay > .modal { transition: none; }
}
.modal-cover { position: relative; margin: -24px -24px 16px; overflow: hidden; border-radius: 14px 14px 0 0; max-height: 180px; }
.modal-cover img { width: 100%; height: 180px; object-fit: cover; object-position: top; display: block; }
.modal-cover-links { position: absolute; inset-inline-end: 8px; top: 8px; display: flex; gap: 6px; }
/* No art: a block in the category's tint, its image mark in the middle. */
.modal-cover.is-blank { height: 180px; }
.modal-cover-blank { display: none; }
.modal-cover.is-blank .modal-cover-blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .6; }
.modal-cover-blank svg { width: 40px; height: 40px; }
/* Nothing to read over, so the times drop the fade and take the theme's text. */
.modal-cover.is-blank .game-times-wrap { background: none; }
.modal-cover.is-blank .game-times-wrap .game-times { color: var(--text); }
.modal-cover.is-blank .game-times-wrap .game-time-label { color: var(--text-dim); }
.modal-cover-links:empty { display: none; }
/* Review scores (0.282.1), the links' twins in the opposite corner. */
.modal-cover-scores { position: absolute; inset-inline-start: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 62%; }
.modal-cover-scores:empty { display: none; }
.cover-score { font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: center; }
.cover-link-btn {
  background: rgba(0, 0, 0, .65); color: #fff; font-size: var(--fs-2xs); font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill); text-decoration: none; line-height: 1.3;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.cover-link-btn:hover { background: rgba(0, 0, 0, .85); }
/* Inset, not the app-wide offset ring — .modal-cover clips anything that
   overflows its rounded corners, and these links sit right at its edge. */
.cover-link-btn:focus-visible { outline-offset: -2px; }
.modal-cover-meta { margin: -4px 0 16px; }
.modal-cover-meta .bl-meta { font-size: var(--fs-xs); color: var(--text-dim); }
.modal-cover-meta .bl-summary { font-size: var(--fs-sm); color: var(--text-dim); margin: 4px 0 0; }
.modal-cover-meta .bl-price:empty { display: none; }
/* How Long to Beat's three times (0.282.0): a strip along the cover's foot,
   over a fade so they read on any art — fixed black and white like the
   cover links, since it sits on the image, not the theme. The links and
   the scores sit in the top corners. With no cover it's a row of cells. */
.game-times-wrap { position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; padding: var(--space-24) var(--space-8) var(--space-8);
  background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, .45) 60%, transparent); }
.game-times-wrap[hidden], .game-times-row[hidden] { display: none; }
.game-times { display: flex; gap: var(--space-4); min-height: 44px; text-decoration: none; color: inherit; border-radius: var(--r-md); }
.game-time { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: var(--space-4) var(--space-6); text-align: center; line-height: 1.2; }
.game-time-label { font-size: var(--fs-2xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.game-time-value { font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.game-times-wrap .game-times { color: #fff; }
.game-times-wrap .game-time-label { color: rgba(255, 255, 255, .8); }
.game-times-wrap .game-times:focus-visible { outline-offset: -2px; }
.game-times-row { margin: var(--space-4) 0 var(--space-8); }
.game-times-row .game-time { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); }
.game-times-row .game-time-label { color: var(--text-dim); }
.game-times-row .game-time-value { color: var(--text); }
a.game-times:hover .game-time-value { text-decoration: underline; }
.game-reviews { margin: var(--space-4) 0 0; font-size: var(--fs-xs); color: var(--text-dim); }
.game-reviews a { color: var(--accent); text-decoration: none; display: inline-block; padding: var(--space-4) 0; }
.game-reviews a:hover { text-decoration: underline; }
/* ---------- Pick sheet (0.296.0) ---------- */
/* Title, the Backlog / My list switch and the close in one row; the switch
   wraps under the title rather than squeezing it on a narrow phone. */
.pick-head { gap: var(--space-8) var(--space-12); flex-wrap: wrap; }
.pick-head h2 { flex: 1 1 auto; }
.pick-head .btn-icon { order: 3; }
/* What a backlog draw is rolling on: category chips, then Starred and
   Bought, with the count at the end of the same wrap. It owns the sheet's
   top edge, under the head. */
.pick-scope {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6);
  margin: 0 0 var(--space-16); padding-bottom: var(--space-12); border-bottom: 1px solid var(--border);
}
.pick-scope[hidden] { display: none; }
.pick-scope-chips { display: contents; }
/* A button, not the filter bar's span — it needs the family the UA won't
   inherit for it, and the padding of a chip rather than a control. */
.pick-cat { font-family: inherit; padding: var(--space-4) var(--space-10); font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: var(--space-6); }
.pick-cat svg { width: 13px; height: 13px; }
/* Categories, then Starred and Bought, then length: each group a row of
   its own, since each asks a different question (0.296.1). */
.pick-scope-break { flex-basis: 100%; height: 0; }
.pick-scope-count { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--text-dim); }
/* The pick: a portrait cover beside what's known about it, as a row of the
   backlog is drawn, rather than a 2:3 cover cropped to a banner. */
.pick-card {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--space-16); align-items: start;
  --pick-cat: var(--accent);
}
.pick-card[hidden] { display: none; }
.pick-card.is-empty { grid-template-columns: minmax(0, 1fr); }
.pick-art {
  aspect-ratio: 2 / 3; border-radius: var(--r-md); overflow: hidden;
  background: color-mix(in srgb, var(--pick-cat) 28%, var(--bg-elev-2));
  border: 1px solid var(--border);
}
.pick-art[hidden] { display: none; }
.pick-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pick-art img[hidden] { display: none; }
.pick-body { min-width: 0; }
.pick-eyebrow {
  margin: 0; font-size: var(--fs-2xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim);
}
.pick-eyebrow:empty { display: none; }
.pick-title { margin: var(--space-4) 0 var(--space-6); font-size: var(--fs-title); line-height: 1.25; overflow-wrap: anywhere; }
/* The shuffle: each frame swaps the face, so the art and title fade a
   little to read as flicking past rather than as a page that keeps
   reloading. The landing settles in. */
.pick-card.is-shuffling .pick-art, .pick-card.is-shuffling .pick-title { opacity: .55; }
.pick-card.is-landed .pick-art { animation: pick-land var(--spring-snappy-ms) var(--spring-snappy); }
.pick-card.is-landed .pick-body { animation: pick-body-in .24s var(--ll-move-ease); }
@keyframes pick-land { from { scale: .94; } to { scale: 1; } }
@keyframes pick-body-in { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .pick-card.is-landed .pick-art, .pick-card.is-landed .pick-body { animation: none; }
}
/* "Pick" metadata block — same look as the edit-modal cover meta. */
.pick-meta { margin: 0; }
.pick-meta:empty { display: none; }
.pick-card.is-empty .pick-meta { font-size: var(--fs-sm); color: var(--text-dim); }
.pick-meta .bl-meta { font-size: var(--fs-xs); color: var(--text-dim); }
.pick-meta .bl-summary { font-size: var(--fs-sm); color: var(--text-dim); margin: var(--space-6) 0 0; }
.pick-meta .bl-price:empty { display: none; }
.pick-genres { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-8); }
.pick-genre { font-size: var(--fs-2xs); padding: var(--space-2) var(--space-8); border-radius: var(--r-pill); background: var(--bg-elev-2); color: var(--text-dim); }
.pick-note { font-size: var(--fs-xs); color: var(--text-dim); font-style: italic; margin: var(--space-8) 0 0; }
/* Source/store links as a row of their own, bordered to read against the
   card rather than over an image. */
.pick-links { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-12); }
.pick-links:empty { display: none; }
.pick-links .cover-link-btn { border: 1px solid var(--border); }
.pick-wheel[hidden] { display: none; }
.pick-actions .btn { display: inline-flex; align-items: center; gap: var(--space-6); }
.pick-actions .btn svg { width: 15px; height: 15px; }
.pick-actions .btn[hidden] { display: none; }
#pickRevealBtn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
/* A phone puts the switch on a row of its own under the title and close,
   split evenly so each half is a full-size target. */
@media (max-width: 720px) {
  html:not(.force-pc) .pick-head .btn-icon { order: 2; }
  html:not(.force-pc) .pick-source { order: 3; flex: 1 0 100%; }
  html:not(.force-pc) .pick-source .seg-btn { flex: 1; min-height: 40px; }
  html:not(.force-pc) .pick-card { grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-12); }
  html:not(.force-pc) .pick-card.is-empty { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .pick-title { font-size: var(--fs-xl); }
}
/* A computer gets the room (0.296.0, Daniel: "in browser we can better use
   the full screen"): a wide sheet in two columns, the cover or the wheel
   large on the left and the scope, the details and the buttons on the
   right. The card goes display: contents so its art and body land in those
   columns without a second copy of the markup. My list has only the wheel,
   so it stays one column. The class follows the app's own phone test
   (pickLayout in backlog.js), since a media query can't see force-pc. */
.pick-modal-wide {
  width: 920px; display: grid; grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto; column-gap: var(--space-32);
  grid-template-areas: "head head" "stage scope" "stage body" "stage actions";
}
.pick-modal-wide > .pick-head { grid-area: head; margin-bottom: var(--space-20); }
.pick-modal-wide > .pick-scope { grid-area: scope; align-self: start; }
.pick-modal-wide > .pick-card:not([hidden]) { display: contents; }
.pick-modal-wide .pick-art, .pick-modal-wide > .pick-wheel { grid-area: stage; align-self: start; }
.pick-modal-wide .pick-art { border-radius: var(--r-card); box-shadow: var(--shadow); }
.pick-modal-wide .pick-body { grid-area: body; }
.pick-modal-wide > .pick-card.is-empty .pick-body { grid-column: 1 / -1; }
.pick-modal-wide .pick-title { font-size: var(--fs-2xl); }
.pick-modal-wide .pick-meta .bl-meta { font-size: var(--fs-sm); }
.pick-modal-wide .pick-meta .bl-summary { font-size: var(--fs-md); line-height: 1.55; -webkit-line-clamp: unset; display: block; overflow: visible; }
.pick-modal-wide > .pick-actions { grid-area: actions; margin-top: var(--space-20); }
.pick-modal-wide > .pick-wheel .wheel-stage { max-width: 340px; margin-top: 0; }
.pick-modal-wide.is-own { width: 520px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "actions"; grid-template-rows: auto auto auto; }
.pick-modal-wide.is-own > .pick-wheel .wheel-stage { max-width: 380px; margin: 0 auto; }
html.force-mobile .pick-head .btn-icon { order: 2; }
html.force-mobile .pick-source { order: 3; flex: 1 0 100%; }
html.force-mobile .pick-source .seg-btn { flex: 1; min-height: 40px; }
html.force-mobile .pick-card { grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-12); }
html.force-mobile .pick-card.is-empty { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .pick-title { font-size: var(--fs-xl); }

/* ---------- random wheel ---------- */
/* Square stage: the canvas paints itself at whatever width the modal gives
   it (see canvasSize in wheel.js), with the pointer and the hub button
   layered over it rather than drawn into it — both need to stay upright
   while the wheel underneath turns. */
.wheel-stage { position: relative; width: 100%; max-width: 320px; margin: 4px auto 0; aspect-ratio: 1; }
.wheel-stage canvas {
  display: block; width: 100%; height: 100%;
  /* Lifts the ring off the modal — without it the wedges read as a flat
     sticker on the panel. */
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .45));
}
/* Overlaps the rim rather than floating above it, so it reads as pointing
   into the wheel. Accent-coloured: it is the one thing on the stage that
   says which slice counts. */
.wheel-pointer {
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 2;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 15px solid var(--accent);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55));
}
/* Sits in the ring's hole (see draw() in wheel.js) rather than on the point
   where every wedge meets. */
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 82px; height: 82px; border-radius: 50%; cursor: pointer;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-strong);
  font: inherit; font-size: var(--fs-sm); font-weight: 650; letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.wheel-hub:hover:not(:disabled) {
  background: var(--accent-fill); border-color: var(--accent-fill); color: var(--text-on-accent);
  transform: translate(-50%, -50%) scale(1.04);
}
.wheel-hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(.98); }
.wheel-hub:disabled { opacity: .5; cursor: default; }
.wheel-hint { margin: 0 0 var(--space-12); font-size: var(--fs-sm); text-align: center; }
.wheel-empty { margin: 14px 0 0; font-size: var(--fs-sm); text-align: center; }
/* The answer you opened the modal for, so it gets a panel of its own rather
   than a line of text under the wheel. */
.wheel-result {
  margin: 20px 0 0; padding: 12px 14px; text-align: center;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.wheel-result[hidden] { display: none; }
.wheel-result-eyebrow { display: block; font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.wheel-result-text { display: block; margin-top: 4px; font-size: var(--fs-title); font-weight: 700; color: var(--text); }
.wheel-edit { margin-top: 16px; }
.wheel-edit[hidden] { display: none; }

.modal-wide { width: 560px; }
.modal h2 { margin: 0 0 16px; font-size: var(--fs-xl); }
.modal-head { display:flex; align-items:center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal label { display: block; font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: 12px; }
.modal label input:not([type=checkbox]), .modal label select, .modal label textarea {
  display: block; width: 100%; margin-top: 6px; background-color: var(--bg);
  border: 1px solid var(--border); color: var(--text); padding: 10px 12px;
  border-radius: var(--r-md); font-size: var(--fs-md);
}
.modal label textarea { font-family: inherit; resize: vertical; }
.modal label input[type=color] {
  width: 64px; height: 40px; padding: 4px; cursor: pointer;
}
.modal .row { display: flex; gap: 12px; }
/* min-width:0 because a flex item defaults to min-width:auto, which refuses
   to shrink below its content's intrinsic width — and a native date input
   reports a wide one. Two of them side by side (start/stop, pause from/until)
   would otherwise overflow the modal on a narrow phone. */
.modal .row label { flex: 1; min-width: 0; }
/* Two date fields in a 285px-wide sheet are 137px each, and Chrome's date
   field cuts its own text at that ("01/01/202"), so a pair of dates goes
   one per row on a phone (0.273.0). */
@media (max-width: 480px) {
  .modal .row-dates { flex-direction: column; align-items: stretch; }
}
/* The entry's Finished and Started (0.281.0) stay side by side, as Daniel
   asked: less side padding and a closer calendar icon fit "10/24/2026"
   in the half-width a 390px phone leaves. */
.modal .row-dates-tight { gap: var(--space-8); }
.modal .row-dates-tight input[type=date] { padding-inline-start: var(--space-8); padding-inline-end: var(--space-6); }
.modal .row-dates-tight input[type=date]::-webkit-calendar-picker-indicator { margin-inline-start: 0; padding: 0; }
/* The text stays 16px (smaller makes iOS zoom in on focus), so on the
   narrowest phones the calendar icon gives way: a tap on the field opens
   the phone's picker anyway. */
@media (max-width: 380px) {
  .modal .row-dates-tight input[type=date]::-webkit-calendar-picker-indicator { display: none; }
}
/* A date box's text in the app's date format (src/datefield.js): the box's
   own text, in the device's language, is hidden and .date-face draws the
   same day over it. Typing on a computer brings the box's own fields back. */
.date-field { position: relative; display: block; min-width: 0; }
.date-field > input.has-face { width: 100%; }
.date-field:not(.is-typing) > input.has-face { color: transparent; }
.date-field:not(.is-typing) > input.has-face::-webkit-datetime-edit { opacity: 0; }
.date-field:not(.is-typing) > input.has-face::-webkit-date-and-time-value { opacity: 0; }
.date-face {
  position: absolute; inset: 0 32px 0 0; display: flex; align-items: center;
  pointer-events: none; color: var(--text); white-space: nowrap; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.date-field.is-typing > .date-face { visibility: hidden; }
.date-field > input.has-face:disabled ~ .date-face { color: var(--text-faint); }
/* Under a date known only to the month: makes the 1st a real day. */
.date-day1 {
  display: block; margin-top: var(--space-4); padding: 0; background: none; border: none;
  color: var(--accent); font: inherit; font-size: var(--fs-xs); cursor: pointer; text-align: start;
}
.date-day1[hidden] { display: none; }
.date-day1:hover { text-decoration: underline; }
@media (pointer: coarse) { .date-day1 { min-height: 44px; } }

kbd {
  display: inline-block; min-width: 20px; padding: 2px 6px; text-align: center;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: var(--r-sm); font-family: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim);
}
.shortcuts-list { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shortcuts-list > div { display: flex; align-items: center; gap: 12px; }
.shortcuts-list dt { flex: 0 0 auto; min-width: 44px; margin: 0; white-space: nowrap; }
.shortcuts-list > .shortcuts-head { margin-top: var(--space-8); font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); }
.shortcuts-list dd { margin: 0; color: var(--text-dim); font-size: var(--fs-md); }
/* Settings → Keyboard (src/keys.js): each key a keycap you click to change,
   with its own × to turn it off. */
.kb-keys { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-6); flex: 0 0 auto; }
.kb-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--bg-elev-2); }
.modal .kb-key, .modal .kb-x, .modal .kb-add, .modal .kb-reset {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px; margin: 0;
  background: none; border: 0; font: inherit; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.modal .kb-key { padding-block: 0; padding-inline: var(--space-10) var(--space-4); font-size: var(--fs-sm); font-weight: 600; color: var(--text); border-radius: var(--r-sm) 0 0 var(--r-sm); white-space: nowrap; }
.modal .kb-x { width: 26px; color: var(--text-dim); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.modal .kb-x .ico { width: 14px; height: 14px; }
.modal .kb-key:hover, .modal .kb-x:hover { background: var(--hover-bg); }
.modal .kb-x:hover { color: var(--danger); }
.modal .kb-key.listening { padding: 0 var(--space-10); color: var(--accent); font-weight: 550; border-radius: var(--r-sm); }
.kb-chip:has(.listening) { border-color: var(--accent); background: var(--accent-soft); }
.modal .kb-add { width: 32px; border: 1px dashed var(--border); border-radius: var(--r-sm); color: var(--text-dim); font-size: var(--fs-md); }
.modal .kb-add:hover, .modal .kb-reset:hover { background: var(--hover-bg); color: var(--text); }
.modal .kb-reset { width: 32px; border-radius: var(--r-sm); color: var(--text-dim); }
.modal .kb-reset .ico { width: 16px; height: 16px; }
.kb-none { padding: 0 var(--space-4); font-size: var(--fs-sm); font-style: italic; color: var(--text-dim); }
/* A dot by the name of anything that isn't at its default. */
.kb-changed .sitem-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-start: var(--space-8); border-radius: 50%; background: var(--accent); vertical-align: middle; }
.kb-caps { display: inline-flex; align-items: center; gap: var(--space-4); flex: 0 0 auto; color: var(--text-dim); font-size: var(--fs-sm); white-space: nowrap; }
.kb-tabs:empty { display: none; }
.kb-tabs > * + * { border-top: 1px solid var(--border); }
.modal .sgroup-card > .kb-tabs + * { border-top: 1px solid var(--border); }
.kb-foot { display: flex; justify-content: flex-end; margin-top: var(--space-4); }
#shortcutsChangeBtn { align-self: flex-start; margin-top: var(--space-8); }
@media (prefers-reduced-motion: reduce) { .modal .kb-key, .modal .kb-x, .modal .kb-add, .modal .kb-reset { transition: none; } }
.modal .row[hidden] { display: none; }
.modal label[hidden] { display: none; }
.rating-input { display: flex; gap: 4px; margin-top: 6px; }
.rating-input .star { background: none; border: none; cursor: pointer; padding: 0; font-size: var(--fs-2xl); line-height: 1; color: var(--text-faint); }
.rating-input .star.filled { color: var(--accent); }
/* Hover previews the rating it would set: every star up to the pointer
   lights, the ones after it dim even if filled. Hover-capable pointers
   only, so a tap on a phone doesn't leave a stuck preview. */
@media (hover: hover) {
  .rating-input:has(.star:hover) .star { color: var(--text-faint); }
  .rating-input:has(.star:hover) .star:hover,
  .rating-input:has(.star:hover) .star:has(~ .star:hover) { color: var(--accent-hover); }
}

.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
/* The search results page (0.251.0): over the tab while the box has text. */
html.is-searching #content, html.is-searching #filterSlot, html.is-searching .fab-wrap, html.is-searching .jump-nav { display: none; }
.search-results { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }
.search-head { padding: 8px 0 4px; }
.search-title { font-size: var(--fs-lg); font-weight: 600; margin: 0; }
.search-none { margin: 8px 0; }
.search-group { margin-top: 20px; }
.search-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.search-group-label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; }
.search-group-label .ico { width: 16px; height: 16px; }
.search-list { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.search-row {
  display: flex; width: 100%; text-align: start; background: none; border: 0; color: var(--text);
  align-items: center; padding: 10px 14px; min-height: 44px; cursor: pointer; font: inherit;
}
.search-row + .search-row, .search-more { border-top: 1px solid var(--border); }
.search-row:hover { background: var(--hover-bg); }
.search-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-row-title { font-size: var(--fs-md); font-weight: 600; overflow-wrap: anywhere; }
.search-row-snippet { font-size: var(--fs-sm); color: var(--text-dim); overflow-wrap: anywhere; }
.search-row-meta { font-size: var(--fs-xs); color: var(--text-faint); }
.search-row-cover { flex: 0 0 auto; width: 32px; height: 46px; object-fit: cover; border-radius: var(--r-xs); margin-inline-end: var(--space-12); background: var(--bg-elev-2); }
.search-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.search-tag {
  font-size: var(--fs-2xs); line-height: 1.5; padding: 0 var(--space-6); border-radius: var(--r-pill);
  background: var(--bg-elev-2); color: var(--text-dim); white-space: nowrap;
}
.search-tag.is-done { color: var(--success); }
.search-tag.is-accent { color: var(--accent); }
.search-tag.is-star, .search-tag.is-rating { color: var(--priority); }
.search-tag.is-warn { color: var(--warning); }
.search-row-marks { margin-inline-start: auto; padding-inline-start: var(--space-12); display: flex; gap: var(--space-8); flex: 0 0 auto; color: var(--text-dim); }
.search-mark { display: inline-flex; }
.search-mark .ico { width: 16px; height: 16px; }
.search-mark.is-star { color: var(--priority); }
.search-mark.is-star .ico { fill: currentColor; }
.search-row mark { background: var(--accent-soft); color: inherit; border-radius: var(--r-xs); }
.search-more { width: 100%; border-radius: 0; background: none; color: var(--text-dim); min-height: 40px; }
.search-filter-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: 760px; margin: 8px auto 0; padding: 6px 16px; font-size: var(--fs-sm); color: var(--text-dim);
}
.search-filter-note[hidden], .search-results[hidden] { display: none; }

/* The Shared with LifeLog sheet (0.250.0): what arrived, then two ways to keep it. */
.share-preview { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-dim); font-size: var(--fs-sm); margin: 0 0 12px; max-height: 7.5em; overflow: hidden; }
.share-choices { display: flex; gap: 10px; }
.share-choices .btn { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
/* A sheet with Delete and More… carries four buttons, and on a phone Save
   ran off the side (the recurring sheet first, at 360px; the entry and
   backlog sheets at 375px, 0.273.0). Tighter here rather than wrapping,
   which left Save alone on a line of its own. */
@media (max-width: 480px) {
  .modal-actions { gap: 6px; }
  .modal-actions .btn { padding-inline-start: 10px; padding-inline-end: 10px; }
}
.modal-actions .spacer { flex: 1; }
.modal-actions .link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer; font-size: var(--fs-sm); padding: 0;
}
.modal-actions .link-btn:hover { text-decoration: underline; }

.ac-wrap { position: relative; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ac-wrap input { flex: 1; margin-top: 0; width: auto; }
.sync-btn { flex: 0 0 auto; padding: 8px 10px; font-size: var(--fs-md); line-height: 1; }
/* Spins the 🔄 while a lookup is in flight, so the press registers instantly
   even when the API behind it takes a second. Only the glyph turns — the
   button's own box stays put, which is why the emoji is wrapped in a span
   (transforms don't apply to a bare inline text node). Pointer events stay on:
   the button is safe to press again, and a re-press just restarts the search. */
.sync-icon { display: inline-block; }
.sync-btn.busy { opacity: .7; }
.sync-btn.busy .sync-icon { animation: sync-spin 1s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .sync-btn.busy .sync-icon { animation: none; }
}
.priority-star { flex: 0 0 auto; padding: 8px 10px; font-size: var(--fs-md); line-height: 1; color: var(--text-dim); }
.priority-star.active { color: var(--priority); border-color: var(--priority); }
.priority-star:hover { color: var(--priority-hover); }
/* Same shape as the star it sits beside. */
.bought-toggle { flex: 0 0 auto; padding: 8px 10px; font-size: var(--fs-md); line-height: 1; color: var(--text-dim); }
.bought-toggle.active { color: var(--success); border-color: var(--success); }
.bought-toggle:hover { color: var(--success); }
/* ▶ In progress (0.218.0), beside ☆ and ✓ in the backlog sheet. */
.started-toggle { flex: 0 0 auto; padding: 8px 10px; font-size: var(--fs-sm); line-height: 1; color: var(--text-dim); }
.started-toggle.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.started-toggle:hover { color: var(--accent); }
.sync-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: var(--fs-xs); color: var(--accent); }
.sync-status[hidden] { display: none; }
.sync-status .link-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: var(--fs-xs); padding: 0;
}
.sync-status .link-btn:hover { color: var(--danger); }
.ac-list {
  position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow); z-index: 10; max-height: 180px; overflow-y: auto;
}
.ac-list[hidden] { display: none; }
.ac-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; cursor: pointer; font-size: var(--fs-sm);
}
.ac-item:hover { background: var(--bg-elev-2); }
.ac-item .ac-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item .ac-meta { color: var(--text-dim); font-size: var(--fs-xs); white-space: nowrap; }
.ac-item.ac-media { gap: 8px; }
.ac-item .ac-thumb { width: 32px; height: 46px; object-fit: cover; border-radius: var(--r-xs); flex: 0 0 auto; }
.ac-item .ac-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* Which API a match came from — the Sync button lists the category's primary
   and fallback sources in one list, and the choice sets the item's
   mediaSource. */
.ac-item .ac-source {
  flex: 0 0 auto; font-size: var(--fs-3xs); font-weight: 600; letter-spacing: .3px;
  color: var(--text-dim); background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 2px 6px; white-space: nowrap;
}
/* Open on a suggestion you already have (0.295.0); its hit area reaches
   44px tall without making the row any taller. */
.ac-item .ac-open { flex: 0 0 auto; position: relative; }
.ac-item .ac-open::after { content: ""; position: absolute; inset: -9px -4px; }
/* Placeholder for the source still being searched, replaced by its results. */
.ac-pending {
  padding: 8px 12px; font-size: var(--fs-xs); color: var(--text-dim); font-style: italic;
}
.ac-divider { border-top: 1px solid var(--border); margin: 2px 0; }

.conflict-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.conflict-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.conflict-info { display: flex; flex-direction: column; gap: 4px; }
.conflict-info strong { font-size: var(--fs-md); }

/* Settings (0.186.0): a list of pages beside the open page. On a phone the
   two take turns — see the mobile rules below and showPage() in settings.js.
   data-page on .settings-modal is the open page, "" for the list. */
.modal.settings-modal {
  width: 920px; height: 90vh; padding: 0; overflow: hidden;
  display: grid; grid-template-columns: 310px minmax(0, 1fr);
}
.settings-side {
  border-inline-end: 1px solid var(--border); padding: 20px 14px 20px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px;
}
.settings-side .modal-head { margin: 0 4px; }
.settings-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.settings-page-head { display: none; align-items: center; justify-content: space-between; padding: 12px 14px 0; }
/* A thumb's worth: 44px tall, reaching from the edge, with the chevron
   drawn big enough to read as the thing to press. */
.settings-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  margin-inline-start: -6px; padding-block: 6px; padding-inline: 6px 14px; border: 0; border-radius: var(--r-lg);
  background: none; color: var(--accent); font: inherit;
  font-size: var(--fs-lg); font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.settings-back-chev { font-size: var(--fs-3xl); line-height: 1; margin-top: -4px; }
.settings-back:active { background: var(--accent-soft); }
/* Back to the parent page, on a page inside another (a connection inside
   Connections). A phone has the same step in its header instead. */
.settings-crumb {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  margin-block: -8px 4px; margin-inline: -6px 0; padding-block: 2px; padding-inline: 4px 10px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--accent); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.settings-crumb .settings-back-chev { font-size: var(--fs-xl); margin-top: -2px; }
.settings-crumb:hover { background: var(--accent-soft); }
.settings-pages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px 36px; }
.settings-page { max-width: 620px; }
.settings-page[hidden] { display: none; }
.modal h2.settings-page-title { font-size: var(--fs-title); margin: 0 0 8px; }
.settings-page > .hint:first-of-type { margin-top: 0; }

.modal .settings-search {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-dim);
}
.modal .settings-search:focus-within { border-color: var(--accent); }
.settings-search .ico { width: 16px; height: 16px; flex-shrink: 0; }
#settingsSearch {
  flex: 1; min-width: 0; margin: 0; padding: 10px 0; border: 0; border-radius: 0;
  background: transparent; outline: none; box-shadow: none; color: var(--text);
}
.settings-home, .settings-results { display: flex; flex-direction: column; gap: 16px; }
.settings-home[hidden], .settings-results[hidden] { display: none; }
.sgroup { display: flex; flex-direction: column; gap: 6px; }
.sgroup[hidden], .srow[hidden] { display: none; }
.sgroup-label {
  padding: 0 6px; font-size: var(--fs-2xs); font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
}
.sgroup-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.srow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; background: none; border: 0; border-radius: 0;
  color: var(--text); font: inherit; text-align: start; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.srow + .srow { border-top: 1px solid var(--border); }
.srow:hover { background: var(--hover-bg); }
.srow.active { background: var(--accent-soft); }
.srow-ic {
  width: 32px; height: 32px; border-radius: var(--r-lg); display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.srow.active .srow-ic { background: var(--accent-fill); color: var(--text-on-accent); }
.srow-ic .ico { width: 18px; height: 18px; display: block; }
#viewOptionsBtn .ico { width: 15px; height: 15px; display: block; }
.srow-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.srow-title { font-size: var(--fs-md); font-weight: 600; }
.srow-title mark { background: var(--accent-soft); color: inherit; border-radius: var(--r-xs); }
.srow-status { font-size: var(--fs-xs); color: var(--text-dim); }
.srow-status:empty { display: none; }
.srow-status[data-tone="ok"] { color: var(--success); }
.srow-status[data-tone="warn"] { color: var(--warning); }
.srow-chev { color: var(--text-faint); font-size: var(--fs-xl); line-height: 1; }
.srow-result { grid-template-columns: minmax(0, 1fr) auto; }
.srow-empty { margin: 0; padding: 12px; font-size: var(--fs-sm); color: var(--text-dim); }
.settings-foot { margin: 2px 6px 0; font-size: var(--fs-xs); color: var(--text-dim); }
/* Only where there's a keyboard to press it on (0.301.0). The version it
   used to carry is on About. */
@media not ((hover: hover) and (pointer: fine)) { .settings-foot { display: none; } }
/* Where a search result lands: a brief tint, so the eye finds it. */
.search-hit { animation: search-hit 1.6s var(--ease); border-radius: var(--r-md); }
@keyframes search-hit {
  0%, 45% { background: var(--accent-soft); box-shadow: 0 0 0 6px var(--accent-soft); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) { .search-hit { animation: none; outline: 2px solid var(--accent); outline-offset: 4px; } }
.gh-fields[hidden] { display: none; }
.gh-fields.connected .gh-steps { display: none; }
#ghEditBtn { margin-bottom: 12px; }

/* Inside a page: the list's cards again, a row per setting — its label on
   the left and its control on the right. */
.settings-page [hidden], .view-options [hidden] { display: none !important; }
.settings-page > .sgroup, .settings-page > div > .sgroup, .view-options > .sgroup { margin-top: 20px; }
.settings-page > .page-lede { margin: 0 0 4px; }
.about-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.about-icon { width: 56px; height: 56px; border-radius: var(--r-md); flex: 0 0 auto; }
.about-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.about-name { font-size: var(--fs-xl); font-weight: 650; }
.about-version { font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.modal .sgroup-label { margin: 0; }
.sgroup > .sgroup-label:not(:first-child) { margin-top: 12px; }
.sgroup > .hint, .sgroup > .muted, .sgroup > .warn { margin: 2px 6px 0; }
.sgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-inline-end: 2px; }
.modal .sitem {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; margin: 0;
  padding: 10px 14px; background: none; border: 0; border-radius: 0;
  font: inherit; font-size: var(--fs-md); color: var(--text); text-align: start;
}
.modal .sgroup-card > * + * { border-top: 1px solid var(--border); }
.sitem-text { flex: 1 1 8em; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sitem-title { font-size: var(--fs-md); font-weight: 550; color: var(--text); }
.sitem-sub { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-dim); }
.sitem-sub:empty { display: none; }
/* A list under its board's switches (Settings › Trello). */
.sitem-nested .sitem-text { padding-inline-start: var(--space-24); }
#errLogList { display: contents; }
#errLogList .sitem-title { overflow-wrap: anywhere; font-weight: 450; }
.modal #errLogList > .sitem + .sitem { border-top: 1px solid var(--border); }
/* Settings → About → Test builds (0.299.0): a pull request per row, its
   Install / Open on the right. */
#testBuildsList { display: contents; }
.modal #testBuildsList > * + * { border-top: 1px solid var(--border); }
#testBuildsList .tb-row .sitem-title { overflow-wrap: anywhere; }
#testBuildsList .tb-row .btn-small { flex: 0 0 auto; position: relative; }
.sitem-sub.tb-warn { color: var(--warning); }
.data-folder-path { overflow-wrap: anywhere; }
/* Settings → Sync: room left in the data repo (2026-11). */
.space-bar { display: block; height: 4px; margin-top: var(--space-4); border-radius: var(--r-hair); background: var(--border); overflow: hidden; }
.space-fill { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.space-row.full .space-fill { background: var(--warning); }
#spaceParts .sitem-btns { align-self: center; }
.sitem-sub a { color: var(--accent); display: inline-block; padding: 12px 0; margin: -12px 0; }
/* A key's status beside its title (Settings → Media lookups). The words stay
   --text-dim; only the icon carries the colour. */
.key-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-8); }
.key-status { display: inline-flex; align-items: center; gap: var(--space-4); flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 450; color: var(--text-dim); white-space: nowrap; }
.key-status[hidden] { display: none; }
.key-ok .ico { color: var(--success); }
.key-bad .ico { color: var(--danger); }
.key-warn .ico, .key-down .ico { color: var(--warning); }
.key-checking .ico { animation: sync-spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .key-checking .ico { animation: none; }
}
.sitem-sub br { content: ""; display: block; margin-top: 4px; }
.modal .sitem select {
  flex: 0 1 auto; width: auto; max-width: 100%; margin: 0; padding: 8px 10px; font-size: var(--fs-sm);
}
.modal .sitem input[type=number] { flex: 0 0 96px; width: 96px; margin: 0; padding: 8px 10px; }
.modal .sitem.sitem-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.modal .sitem-stack > .sitem-text { flex: 0 0 auto; }
.modal .sitem.sitem-stack input:not([type=checkbox]) { margin: 0; }
.modal .sitem-stack > .hint, .modal .sitem-stack > .warn { margin: 0; }
.sitem-btns { display: flex; gap: 6px; flex-shrink: 0; }
.modal button.sitem { cursor: pointer; color: var(--accent); font-weight: 550; transition: background var(--dur-fast) var(--ease); }
.modal button.sitem:hover:not(:disabled) { background: var(--hover-bg); }
.modal button.sitem:disabled { opacity: .5; cursor: default; }
.sitem-go::after { content: "›"; margin-inline-start: auto; padding-inline-start: 8px; color: var(--text-faint); font-size: var(--fs-xl); line-height: 1; }
.modal button.sitem.sitem-danger { color: var(--danger); }
.history-card:empty { display: none; }
.sgroup-card > .history-row, .sgroup-card > .media-cat-row { padding: 10px 14px; border-bottom: 0; }
.sgroup-card > .media-cat-row { flex-direction: column; align-items: stretch; gap: 8px; }
.sgroup-card .media-cat-name { color: var(--text); font-size: var(--fs-md); font-weight: 550; }
.sgroup-card .media-cat-sels { display: flex; flex-direction: column; gap: 6px; }
.modal .media-cat-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-size: var(--fs-sm); color: var(--text-dim); }
.sgroup-card .media-cat-sel { flex: 0 1 auto; max-width: 70%; min-width: 0; padding: 8px 10px; font-size: var(--fs-sm); }
.sgroup-card > .muted { margin: 0; padding: 12px 14px; }
.modal a.sitem { text-decoration: none; }
.modal a.sitem .sitem-title { color: var(--accent); }
.modal .sitem:not(.sitem-stack) input[type=text] { flex: 0 1 55%; width: auto; min-width: 0; margin: 0; }
/* A menu that doesn't fit beside its label drops under it rather than being
   cut off: the label keeps at least 8em, and the menu asks for its whole
   width. */
.modal .sitem:not(.sitem-stack) { flex-wrap: wrap; }
.modal .sitem > select { margin-inline-start: auto; }
.modal #tabToggles .sitem { flex-wrap: nowrap; gap: 6px; }
.tab-order-btn { padding: 6px 8px; min-width: 30px; font-size: var(--fs-sm); }
.tab-order-btn:disabled { opacity: .3; cursor: default; }
.mode-default { color: var(--text-faint); }
.mode-default[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.tab-toggle-view .sitem-text, .tab-toggle-mode .sitem-text { flex-basis: 0; }
/* A switch, for on/off rows. The transparent border is its tap area, and
   it's 10px above and below but 4px at the sides, so the corner radius is
   given per axis (half the 24px track plus each border) to keep the
   visible track a true pill. One radius for both drew an oval. */
:is(.modal, .board-opts) input.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto;
  width: 40px; height: 24px; margin: -10px -4px; border: 10px solid transparent; border-inline-width: 4px;
  box-sizing: content-box; background-clip: padding-box; border-radius: calc(var(--r-card) + 4px) / calc(var(--r-card) + 10px); cursor: pointer;
  background-color: var(--border-strong); transition: background-color var(--dur-fast) var(--ease);
}
:is(.modal, .board-opts) input.switch::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  clip-path: none; transform: none; transition: transform var(--dur-fast) var(--ease);
}
:is(.modal, .board-opts) input.switch:checked { background-color: var(--accent); }
:is(.modal, .board-opts) input.switch:checked::before { transform: translateX(16px); }
:is(.modal, .board-opts) input.switch:disabled { cursor: default; }
/* The tap border stays transparent: the checkbox hover rule would paint it,
   a ring round the whole 48x44 tap area (and it sticks after a tap on a
   phone). The outline would trace that same box, so the keyboard ring is
   drawn round the track instead. */
:is(.modal, .board-opts) input.switch:hover:not(:disabled) { border-color: transparent; }
:is(.modal, .board-opts) input.switch:focus-visible { outline: none; }
:is(.modal, .board-opts) input.switch:focus-visible::after {
  content: ""; position: absolute; inset: -4px; border-radius: calc(var(--r-card) + 4px);
  box-shadow: 0 0 0 2px var(--accent); pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { :is(.modal, .board-opts) input.switch, :is(.modal, .board-opts) input.switch::before { transition: none; } }

/* A view's own options (the View button in the header). */
.modal.view-options { width: 520px; }
.view-options > .modal-head { margin-bottom: 0; }
.view-options > .sgroup:not([hidden]) ~ .sgroup { margin-top: 24px; }
/* The out-of-date notice: tinted rather than shouted, since nothing is
   broken — the device still saves and syncs, it's just behind. */
.version-skew {
  border: 1px solid var(--danger); border-radius: var(--radius);
  background: var(--danger-bg); padding: 12px 14px; margin-bottom: 14px;
}
.version-skew h3 { margin: 0 0 6px; font-size: var(--fs-md); color: var(--danger-text); }
.version-skew .hint { margin-top: 6px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* Every fold (the sheets' Advanced, Sync's advanced and error log, habit
   Insights, a place's hours) grows open and shuts instead of snapping.
   ::details-content and interpolate-size are Chromium-only for now: Android
   and desktop animate, iOS Safari opens at once as before. Built open
   (habit Insights after a re-render) doesn't animate: no @starting-style. */
details { interpolate-size: allow-keywords; }
details::details-content {
  block-size: 0; opacity: 0;
  /* Clipped while it grows; the margin keeps focus rings inside whole. */
  overflow: clip; overflow-clip-margin: 6px;
  transition: block-size .14s var(--ease), opacity .14s var(--ease), content-visibility .14s allow-discrete;
}
details[open]::details-content {
  block-size: auto; opacity: 1;
  transition-duration: .24s; transition-timing-function: var(--ll-move-ease);
}
@media (prefers-reduced-motion: reduce) {
  details::details-content { transition: none; }
}
/* Per-item "keep my own value" foldout at the bottom of the entry/backlog
   modals — collapsed by default, since pinning a field against sync is a
   rare, deliberate thing to reach for. */
.advanced { margin: 4px 0 16px; }
.advanced > summary {
  cursor: pointer; font-size: var(--fs-sm); color: var(--text-dim);
  padding: 4px 0; list-style-position: inside;
}
.advanced > summary:hover { color: var(--text); }
.advanced .hint { margin: 2px 0 10px; }
.ovr { margin-bottom: 12px; }
.ovr:last-child { margin-bottom: 0; }
.ovr-head {
  display: flex !important; align-items: center; gap: 8px;
  margin-bottom: 6px !important; color: var(--text-dim); font-size: var(--fs-sm);
}
.ovr input:not([type=checkbox]), .ovr select {
  display: block; width: 100%; background-color: var(--bg);
  border: 1px solid var(--border); color: var(--text); padding: 10px 12px;
  border-radius: var(--r-md); font-size: var(--fs-md);
}
/* An unticked field still shows what the sync last found, so you can see the
   value you'd be pinning before you tick it — greyed out to make clear it
   isn't yours yet and isn't being saved. */
.ovr input:disabled, .ovr select:disabled { color: var(--text-faint); opacity: 1; }
#fStartYear:disabled { color: var(--text-faint); opacity: .6; }
.ovr-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ovr-row input { flex: 1 1 60%; min-width: 0; }
.ovr-row select { flex: 1 1 40%; min-width: 0; }
.ovr .hint code { font-size: var(--fs-2xs); background: var(--bg-elev-2); padding: 1px 4px; border-radius: var(--r-xs); white-space: nowrap; }
/* The Steam App ID field while it's living in the Advanced panel rather than
   up in the form (see updateSyncBtnVisibility) — ruled off from the pins
   above it, which are a different kind of control. */
.advanced .steam-field {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.modal .gh-fields > * + *, .modal .gh-advanced > * + *, .modal .gh-advanced[open] > summary { border-top: 1px solid var(--border); }
.modal .gh-advanced > summary.sitem { list-style: none; cursor: pointer; color: var(--text-dim); font-weight: 450; }
.gh-advanced > summary::-webkit-details-marker { display: none; }
.gh-advanced > summary.sitem-go::after { transition: transform var(--dur-fast) var(--ease); }
.gh-advanced[open] > summary.sitem-go::after { transform: rotate(90deg); }
.modal .gh-advanced[open] > summary { border-top: 0; border-bottom: 1px solid var(--border); }
.gh-share .row { display: flex; gap: 8px; align-items: center; }
.gh-share input[readonly] {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--r-md); padding: 8px 10px; font-size: var(--fs-xs);
}
.gh-qr { display: flex; justify-content: center; margin: 4px 0 12px; }
/* Hidden when the link is local-only or too long to encode; same empty-row
   and stray-margin problem as .picker-buckets above. */
.gh-qr[hidden] { display: none; }
.gh-qr svg { background: #fff; padding: 10px; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.warn {
  margin: 0 0 10px; font-size: var(--fs-xs); color: var(--danger-text);
  background: var(--danger-bg); border: 1px solid var(--danger);
  border-radius: var(--r-md); padding: 8px 10px;
}
.toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-sm); color: var(--text); }
/* Every .toggle-label in the app is inside a modal, and `.modal label`
   (0,1,1) outranks `.toggle-label` (0,1,0) — so the flex row above never
   applied and the gap never happened: each checkbox sat jammed against its
   own text. Shipped that way until 0.169.0, when the Tabs switches made it
   obvious enough to notice. This is the same declaration, said loudly
   enough to win. */
.modal .toggle-label { display: flex; align-items: center; gap: 8px; }
/* And the companion, because that display (0,2,0) outranks `[hidden]`: the
   habit modal's backfill offer is a toggle that comes and goes. */
.modal .toggle-label[hidden] { display: none; }
/* The category sheet's "On its items" switches (0.267.0): one group under
   a label like the sheet's other fields, each row a full tap target. */
.cat-shows { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
.cat-shows legend { padding: 0; margin-bottom: var(--space-4); font-size: var(--fs-sm); color: var(--text-dim); }
.modal .cat-shows .toggle-label { min-height: 44px; margin: 0; font-size: var(--fs-md); }
/* A toggle on its own line (Been there, A collection): the row is the target. */
#placeVisited, #noteCatCollection { position: relative; }
#placeVisited::after, #noteCatCollection::after { content: ""; position: absolute; inset: -14px -8px -14px -12px; }
.modal .toggle-label:has(> #placeVisited), .modal .toggle-label:has(> #noteCatCollection) { min-height: 44px; }
.media-cat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
  flex-wrap: wrap;
}
.media-cat-row:last-child { border-bottom: none; }
.media-cat-name { color: var(--text-dim); }
.media-cat-sels { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.media-cat-sel {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 6px 8px; border-radius: var(--r-md); font-size: var(--fs-xs);
}
.history-row {
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.history-row:last-child { border-bottom: none; }
.history-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.history-row-head .btn-small { flex: 0 0 auto; }
/* The first button takes the slack, so the row's buttons sit together on
   the right rather than spreading out between each other. */
.history-row-head .btn-small:first-of-type { margin-inline-start: auto; }
.history-date { color: var(--text-dim); white-space: nowrap; font-size: var(--fs-xs); }
.history-msg {
  display: block; margin-top: 4px; color: var(--text-dim); font-size: var(--fs-xs);
  white-space: normal; overflow-wrap: break-word;
}
.history-badge { font-size: var(--fs-2xs); color: var(--text-dim); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; flex: 0 0 auto; }
.history-badge-ai { color: var(--text); border-color: var(--accent); }
.hint, .muted { color: var(--text-dim); font-size: var(--fs-xs); }
.muted code { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; color: var(--text-dim); font-size: var(--fs-xs); }
.muted strong { color: var(--text-dim); }
.muted br { content: ""; display: block; margin-top: 6px; }
.hint { margin: 10px 0 0; }
.muted { margin: 0 0 10px; }


/* The notice stack (0.267.1): toasts, the update notice and the phone's
   activity pill share one column at the bottom, so they stack rather than
   cover each other, and share the activity pill's look. It sits above the
   bulk bar, whose height app.js keeps in --bulkbar-h. */
.notice-stack {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 80;
  bottom: calc(22px + var(--bulkbar-h, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: calc(100vw - 32px); pointer-events: none;
}
.notice-stack > * { pointer-events: auto; max-width: 100%; }
.toast, .update-bar {
  align-items: center; gap: 10px; min-height: 44px;
  padding: 8px 16px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 550;
  background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
}
/* :not([hidden]) rather than a companion rule below: an author `display`
   outranks the UA's `[hidden] { display: none }`, and the toast is hidden by
   that attribute. Written so it cannot apply while hidden, instead of relying
   on source order to undo it — the trap test/browser/hiddenaudit.js exists for. */
.toast:not([hidden]) { display: flex; }
.toast:not([hidden]):has(.toast-action) { padding-block: 6px; padding-inline: 16px 6px; }
.toast-action, .update-bar .btn { border-radius: var(--r-pill); }
.toast[hidden] { display: none; }
/* Read out, never seen: the toast's words for screen readers (0.254.0). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* `translate`, not `transform`: transform is already centring it. */
.toast { transition: opacity .2s var(--ll-move-ease), translate .2s var(--ll-move-ease), display .2s allow-discrete; }
.toast[hidden] {
  opacity: 0; translate: 0 8px; pointer-events: none;
  transition-duration: .14s; transition-timing-function: var(--ease);
}
@starting-style { .toast { opacity: 0; translate: 0 10px; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Pull to refresh, in the Android app only (see wirePullToRefresh). The
   page comes down with the finger, and in the gap it opens an arrow drawn on
   the background — no bubble — comes down with it, winding up as it goes,
   then spins in place while the app syncs.

   --pull is registered so it can animate: the page and the arrow both read
   it, so settling to the hold position and back up is one movement for
   both. The page's `translate` exists only under html.pulling — any value
   but none makes #content a containing block for its fixed children — and
   it's `translate`, not `transform`, so it can't collide with the mode
   swipe moving the same content sideways. */
@property --pull { syntax: "<length>"; inherits: true; initial-value: 0px; }
html.pulling #content, html.pulling #filterSlot { translate: 0 var(--pull); }
html.pull-settling { transition: --pull .3s var(--ll-move-ease); }
.pull-icon {
  display: none; position: fixed; left: 50%; top: var(--topbar-h, 60px);
  width: 26px; height: 26px; margin-inline-start: -14px;
  z-index: 15; /* under the top bar, so it comes out from behind it */
  pointer-events: none; color: var(--text-dim);
  transform: translateY(calc(var(--pull) - 40px));
  opacity: var(--pull-progress, 1);
}
html.pulling .pull-icon { display: block; }
.pull-icon svg { display: block; width: 100%; height: 100%; transform: rotate(var(--pull-turn, 0deg)); }
.pull-icon circle { stroke-dasharray: calc(var(--pull-progress, 0) * 72) 100; }
html.pull-armed .pull-icon, html.pull-busy .pull-icon { color: var(--accent); opacity: 1; }
html.pull-busy .pull-icon svg { animation: pull-spin .75s linear infinite; }
html.pull-busy .pull-icon circle { stroke-dasharray: 64 100; }
@keyframes pull-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html.pull-busy .pull-icon svg { animation-duration: 2.4s; }
}
/* Edge to edge, in the Android app only (0.178.0). The app's page runs under
   the status bar and the gesture bar (viewport-fit=cover, written into the
   app's index.html at build time), so the top bar's own colour fills the
   status bar and its icons follow LifeLog's theme (syncSystemBars) rather
   than the phone's. Everything pinned to an edge then has to keep its
   content clear of those bars. Capacitor injects the real sizes as
   --safe-area-inset-*; env() is the fallback. The top bar grows a border in
   its own colour rather than more padding, so its layout inside is unchanged
   and --topbar-h (measured) still includes the whole of it. */
html.native {
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
html.native .topbar { border-top: var(--sat) solid var(--bg-elev); }
html.native .modal-overlay,
html.native .lock-screen { padding-top: calc(20px + var(--sat)); padding-bottom: calc(20px + var(--sab)); }
html.native .recap { padding-top: calc(56px + var(--sat)); padding-bottom: calc(64px + var(--sab)); }
html.native .recap-bar { top: calc(12px + var(--sat)); }
html.native .recap-close { top: calc(24px + var(--sat)); }
/* The WebView's own overscroll glow would answer the same pull. */
html.native, html.native body { overscroll-behavior-y: none; }
.toast-action {
  flex: 0 0 auto; background: none; border: 1px solid var(--accent); border-radius: var(--r-md);
  padding: 6px 12px; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.toast-action:hover { background: var(--accent-fill); color: var(--text-on-accent); }
/* Sits where a toast does but doesn't leave on its own: there is nothing to
   do about it except reload, and the whole point is that it waits until you
   do. Above the toast, since a transient message must not cover it. */
.update-bar:not([hidden]) { display: flex; padding-block: 6px; padding-inline: 16px 6px; white-space: nowrap; }
.update-bar[hidden], .update-bar [hidden] { display: none; }
/* A long notice ("Unreleased build 4f2c9a1 is ready") wraps inside the bar
   instead of pushing Update and × past the stack's edge, over the + button
   on a phone (2026-11-18). */
.update-bar #updateBarText { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.3; }
.update-bar:not([hidden]) { width: max-content; max-width: 100%; }
.update-bar .btn { flex: 0 0 auto; }
.toast.err { color: var(--danger); }

/* ---------- mobile ---------- */
/* html:not(.force-pc) lets Settings → Appearance → Force layout "PC" suppress
   these rules even on an actually-narrow screen. The same ruleset is repeated
   below, unscoped from @media, under html.force-mobile so "Force layout:
   Mobile" applies it regardless of the real viewport width (desktop browsers
   never re-derive their layout viewport from the <meta viewport> tag, so a
   class is the only thing that works in that direction). */
@media (max-width: 720px) {
  /* Above .fab-wrap (35). z-index: 20 makes .topbar a stacking context,
     and the mode fan rises out of the bottom bar inside it — through
     exactly the corner the + button floats in — so no value on the fan
     itself could lift it clear. They never overlap at rest. */
  html:not(.force-pc) .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px 28px; z-index: 40; }
  /* basis 0, not auto: flex wraps on hypothetical sizes before it shrinks
     anything, so a basis of "as wide as the input would like to be" puts the
     ⚙ on a second row the moment the field gets any wider — which the ✕'s
     own padding was enough to do. Taking whatever is left over instead is
     what the row wanted all along. */
  html:not(.force-pc) .search-wrap { order: 2; margin-inline-start: 0; width: auto; flex: 1 1 0; min-width: 0; max-width: none; }
  html:not(.force-pc) .brand h1 { display: none; }
  /* Thumb-sized on a phone, where the native one was smallest of all. */
  html:not(.force-pc) .search-clear { width: 34px; font-size: var(--fs-sm); }
  /* Fields on a phone (0.222.0): 44px to hit, and 16px text, below which
     iOS zooms the page on focus. The header buttons match the search. */
  html:not(.force-pc) .search { min-height: 44px; font-size: var(--fs-lg); }
  /* Sort stays compact (0.224.0): it was a 44px, 16px field, too big beside
     the buttons it sits with; iOS auto-zoom is stopped in app.js instead. */
  html:not(.force-pc) .sort-select { min-height: 36px; }
  html:not(.force-pc) .settings-corner .btn-icon { min-height: 44px; min-width: 44px; }
  html:not(.force-pc) .link-offer .btn { min-height: 44px; }
  html:not(.force-pc) .add-menu button { min-height: 44px; }
  html:not(.force-pc) .modal label input:not([type=checkbox]):not([type=color]), html:not(.force-pc) .modal label select { min-height: 44px; font-size: var(--fs-lg); }
  html:not(.force-pc) .modal label textarea { font-size: var(--fs-lg); }

  /* Persistent bottom nav — every view is one tap away instead of two
     (tap the collapsed pill, then tap the view). Matches the design
     system's mobile bottom-nav pattern: icon-over-label tabs, a thin
     divider between the Journal/Finance groups, no collapse step. */
  html:not(.force-pc) .topbar-bottom {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; z-index: 30;
    padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
    background: var(--bg-elev); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px var(--nav-shadow);
  }
  /* .views carries order:2 from its desktop role (positioning it among
     .brand/.search/#settingsBtn in the top header) — irrelevant here, but
     since #topbar-bottom is now itself a flex column, that leaks into
     this layout too. Pin both explicitly instead of relying on it: the
     jump-nav row sits above the tabs (order:0), tabs stay the bottom-most
     row, closest to the screen edge (order:1). */
  html:not(.force-pc) .views { flex: 1; display: flex; align-items: stretch; order: 1; }
  /* Suppresses the browser's default tap-highlight flash and any chance
     of a text selection starting under a fast tap or the start of a
     swipe — without this, pressing a tab could show a stray selection
     highlight and a beat of lag before it responded. */
  html:not(.force-pc) .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 12px 2px 12px; font-size: var(--fs-3xs); color: var(--text-dim);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  }
  /* The display above outranks the UA stylesheet's [hidden] rule, so a tab
     turned off in Settings needs this said explicitly — without it the tab
     kept its icon on the phone layout while being correctly gone on the
     desktop one, where nothing sets an author display on .tab. Same
     companion rule the rest of this file carries next to every other
     author display. */
  html:not(.force-pc) .tab[hidden] { display: none; }
  html:not(.force-pc) .tab-ico .ico { width: 22px; height: 22px; }
  html:not(.force-pc) .tab.active { color: var(--accent); background: none; }
  html:not(.force-pc) .views { position: relative; }
  /* Slides under whichever tab is active — tapping a tab or swiping the
     bar both animate it there, so a swipe reads as "the indicator moved
     to the next tab" rather than the view just silently changing behind
     it. Position/width are set from JS (updateTabUnderline in app.js),
     which measures the active tab's actual rendered box; being absolutely
     positioned takes it out of the flex layout entirely, so it can't
     affect the tabs' own spacing. */
  html:not(.force-pc) .tab-modes { bottom: 6px; }
  html:not(.force-pc) .tab-underline {
    position: absolute; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
    background: var(--accent); pointer-events: none;
    transition: left var(--dur) var(--ease), width var(--dur) var(--ease);
  }

  /* Second bottom-bar row — prev/next between the sticky year/category
     headers on Timeline/Ledger/Backlog, since a long list there otherwise
     means scrolling through everything to reach the next one. Collapsed
     (height: 0) on tabs that don't use it — Stats/Summary — rather than
     always reserving its space, so the bar goes back to its plain, older
     height there; the short transition (not a hard pop) plus everything
     anchored above the bar tracking --bottombar-h live (see wire() in
     app.js) is what keeps that height change from looking like a jump.
     touch-action: pan-y hands horizontal gestures to the swipe handler
     (see attachSwipe in app.js) instead of the browser's own edge-swipe
     navigation. */
  html:not(.force-pc) .jump-nav {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    height: 0; overflow: hidden; transition: height .18s var(--ease);
    touch-action: pan-y; order: 0; position: relative; padding: 0 14px;
    -webkit-tap-highlight-color: transparent;
  }
  html:not(.force-pc) .jump-nav.is-active { height: 42px; border-bottom: 1px solid var(--border); }
  html:not(.force-pc) .jump-btn {
    background: transparent; border: none; color: var(--text-dim);
    font-size: var(--fs-xs); padding: 4px 10px; border-radius: var(--r-sm); cursor: pointer;
    flex: 0 0 auto; min-width: 44px; align-self: stretch; z-index: 1; -webkit-tap-highlight-color: transparent;
  }
  @media (hover: hover) {
    html:not(.force-pc) .jump-btn:hover:not(:disabled) { background: var(--bg-elev-2); color: var(--text); }
  }
  html:not(.force-pc) .jump-btn:disabled { color: var(--text-faint); opacity: .4; cursor: default; }
  /* Inset — .jump-nav.is-active clamps to a fixed 42px height with
     overflow:hidden, which would otherwise clip the app-wide offset ring. */
  html:not(.force-pc) .jump-btn:focus-visible { outline-offset: -2px; }
  /* Always shows 3 slots — the current section centered between its
     neighbors — so a swipe reads as content sliding past rather than a
     label just changing. .jump-track holds however many slots are needed
     mid-slide (see jumpAnimateStep/jumpDragMove in app.js, which append or
     prepend one past whichever edge it's sliding toward) and animates via
     `transform: translateX()`; .jump-carousel clips that to the row's
     3-slot width so the extra slot stays hidden until it slides into view. */
  html:not(.force-pc) .jump-carousel { flex: 1; overflow: hidden; position: relative; height: 100%; }
  html:not(.force-pc) .jump-track { display: flex; height: 100%; transition: transform var(--dur) var(--ease); }
  /* The two dimmed neighbor slots are tappable too (see the delegated
     click handler in wire()), not just ◀/▶ — user-select/tap-highlight
     are suppressed on all three so a tap doesn't flash a selection
     highlight or (worse) let the browser start a text selection instead
     of registering as a tap, which is what produced the "weird lag". */
  html:not(.force-pc) .jump-item {
    /* A block, not a flex box: text-overflow only draws its … on a block,
       so a long name was cut mid-letter. */
    flex: 0 0 33.3334%; display: block; line-height: 41px; text-align: center;
    font-size: var(--fs-md); font-weight: 600; color: var(--text-dim); cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;
    /* Drawn at the active size and scaled down (12/14) when it isn't, so the
       swap animates on the compositor instead of re-laying out the bar. */
    transform: scale(.857);
    transition: color .18s var(--ease), transform .18s var(--ease);
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  }
  html:not(.force-pc) .jump-item.is-active { color: var(--accent); transform: none; cursor: default; }

  html:not(.force-pc) .fab-wrap { inset-inline-end: 16px; bottom: calc(var(--bottombar-h, 88px) + 12px); }
  html:not(.force-pc) .notice-stack {
    inset-inline-start: 16px; inset-inline-end: auto; transform: none; align-items: flex-start; max-width: calc(100vw - 108px);
    bottom: calc(var(--bottombar-h, 88px) + 20px + var(--bulkbar-h, 0px));
  }
  html:not(.force-pc) .activity-pill:not([hidden]) {
    display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100vw - 108px);
    padding-block: 8px; padding-inline: 12px 14px; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-xs); font-weight: 550;
    background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer;
  }
  html:not(.force-pc) .filter-slot { padding: 14px 14px 0; }
  html:not(.force-pc) .filter-slot:empty { padding: 0; }
  html:not(.force-pc) .content { padding-top: 14px; padding-inline-start: 14px; padding-inline-end: 14px; padding-bottom: calc(var(--bottombar-h, 88px) + var(--fab-clear)); }
  html:not(.force-pc) .content.no-filters { padding-top: 0; }
  html:not(.force-pc) .bulk-bar { bottom: var(--bottombar-h, 88px); flex-wrap: wrap; }
  html:not(.force-pc) .month-add-btn { width: 20px; height: 20px; font-size: var(--fs-md); }
  html:not(.force-pc) .proj-group-add { width: 20px; height: 20px; font-size: var(--fs-md); }
  /* Both gestures the bar carries are the app's: the sideways tab swipe and
     the upward slide through a mode fan. pan-y would hand the second one to
     the browser as a scroll. */
  html:not(.force-pc) .views { touch-action: none; }

  /* Timeline is a single column at this width, so the year/month you're
     scrolled into can stick under the topbar like a sticky list header. */
  html:not(.force-pc) .year-head { position: sticky; top: var(--sticky-top); z-index: 6; background: var(--bg); }
  /* A checklist card's own header is an h3 too; it isn't the month's. */
  html:not(.force-pc) .month-card h3:not(.note-list-head) {
    position: sticky; background: var(--bg-elev);
    /* stacks below the sticky year-head, whose height varies per year (achievement chips can wrap) */
    top: calc(var(--sticky-top) + var(--year-head-h, 46px) - 1px); z-index: 4;
  }

  /* Backlog is single-column here too (see .backlog-grid's auto-fit min
     width) — same sticky-category-header treatment as the timeline's
     month cards, one per section since there's no year level above it. */
  html:not(.force-pc) .backlog-section-head {
    position: sticky; top: var(--sticky-top); z-index: 4; background: var(--surface-card);
  }
}

/* Above .fab-wrap (35) — see the note in the phone block above. */
html.force-mobile .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px 28px; z-index: 40; }
html.force-mobile .search-wrap { order: 2; margin-inline-start: 0; width: auto; flex: 1 1 0; min-width: 0; max-width: none; }
html.force-mobile .brand h1 { display: none; }
html.force-mobile .search-clear { width: 34px; font-size: var(--fs-sm); }
/* Fields on a phone (0.222.0): 44px to hit, and 16px text, below which
   iOS zooms the page on focus. The header buttons match the search. */
html.force-mobile .search { min-height: 44px; font-size: var(--fs-lg); }
html.force-mobile .sort-select { min-height: 36px; }
html.force-mobile .settings-corner .btn-icon { min-height: 44px; min-width: 44px; }
html.force-mobile .link-offer .btn { min-height: 44px; }
html.force-mobile .add-menu button { min-height: 44px; }
html.force-mobile .modal label input:not([type=checkbox]):not([type=color]), html.force-mobile .modal label select { min-height: 44px; font-size: var(--fs-lg); }
html.force-mobile .modal label textarea { font-size: var(--fs-lg); }

html.force-mobile .topbar-bottom {
  display: flex; flex-direction: column; align-items: stretch;
  position: fixed; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; z-index: 30;
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  background: var(--bg-elev); border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px var(--nav-shadow);
}
/* See the matching comment in the @media block above — the jump-nav row
   sits above the tabs (order:0), tabs stay bottom-most (order:1). */
html.force-mobile .views { flex: 1; display: flex; align-items: stretch; order: 1; }
html.force-mobile .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 2px 12px; font-size: var(--fs-3xs); color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}
/* Same companion rule as the @media block above — see the note there. */
html.force-mobile .tab[hidden] { display: none; }
html.force-mobile .tab-ico .ico { width: 22px; height: 22px; }
html.force-mobile .tab.active { color: var(--accent); background: none; }
html.force-mobile .views { position: relative; }
html.force-mobile .tab-modes { bottom: 6px; }
html.force-mobile .tab-underline {
  position: absolute; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent); pointer-events: none;
  transition: left var(--dur) var(--ease), width var(--dur) var(--ease);
}

html.force-mobile .jump-nav {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 0; overflow: hidden; transition: height .18s var(--ease);
  touch-action: pan-y; order: 0; position: relative; padding: 0 14px;
  -webkit-tap-highlight-color: transparent;
}
html.force-mobile .jump-nav.is-active { height: 42px; border-bottom: 1px solid var(--border); }
html.force-mobile .jump-btn {
  background: transparent; border: none; color: var(--text-dim);
  font-size: var(--fs-xs); padding: 4px 10px; border-radius: var(--r-sm); cursor: pointer;
  flex: 0 0 auto; min-width: 44px; align-self: stretch; z-index: 1; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  html.force-mobile .jump-btn:hover:not(:disabled) { background: var(--bg-elev-2); color: var(--text); }
}
html.force-mobile .jump-btn:disabled { color: var(--text-faint); opacity: .4; cursor: default; }
html.force-mobile .jump-btn:focus-visible { outline-offset: -2px; }
html.force-mobile .jump-carousel { flex: 1; overflow: hidden; position: relative; height: 100%; }
html.force-mobile .jump-track { display: flex; height: 100%; transition: transform var(--dur) var(--ease); }
html.force-mobile .jump-item {
  /* A block, not a flex box: text-overflow only draws its … on a block,
     so a long name was cut mid-letter. */
  flex: 0 0 33.3334%; display: block; line-height: 41px; text-align: center;
  font-size: var(--fs-md); font-weight: 600; color: var(--text-dim); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;
  /* Drawn at the active size and scaled down (12/14) when it isn't, so the
     swap animates on the compositor instead of re-laying out the bar. */
  transform: scale(.857);
  transition: color .18s var(--ease), transform .18s var(--ease);
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}
html.force-mobile .jump-item.is-active { color: var(--accent); transform: none; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  html:not(.force-pc) .jump-nav, html:not(.force-pc) .jump-item,
  html.force-mobile .jump-nav, html.force-mobile .jump-item { transition: none; }
}

html.force-mobile .fab-wrap { inset-inline-end: 16px; bottom: calc(var(--bottombar-h, 88px) + 12px); }
html.force-mobile .notice-stack {
  inset-inline-start: 16px; inset-inline-end: auto; transform: none; align-items: flex-start; max-width: calc(100vw - 108px);
  bottom: calc(var(--bottombar-h, 88px) + 20px + var(--bulkbar-h, 0px));
}
html.force-mobile .activity-pill:not([hidden]) {
  display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100vw - 108px);
  padding-block: 8px; padding-inline: 12px 14px; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-xs); font-weight: 550;
  background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer;
}
html.force-mobile .filter-slot { padding: 14px 14px 0; }
html.force-mobile .filter-slot:empty { padding: 0; }
html.force-mobile .content { padding-top: 14px; padding-inline-start: 14px; padding-inline-end: 14px; padding-bottom: calc(var(--bottombar-h, 88px) + var(--fab-clear)); }
html.force-mobile .content.no-filters { padding-top: 0; }
html.force-mobile .bulk-bar { bottom: var(--bottombar-h, 88px); flex-wrap: wrap; }
html.force-mobile .month-add-btn { width: 20px; height: 20px; font-size: var(--fs-md); }
html.force-mobile .proj-group-add { width: 20px; height: 20px; font-size: var(--fs-md); }
html.force-mobile .views { touch-action: none; }

html.force-mobile .year-head { position: sticky; top: var(--sticky-top); z-index: 6; background: var(--bg); }
html.force-mobile .month-card h3:not(.note-list-head) {
  position: sticky; background: var(--bg-elev);
  top: calc(var(--sticky-top) + var(--year-head-h, 46px) - 1px); z-index: 4;
}
html.force-mobile .backlog-section-head {
  position: sticky; top: var(--sticky-top); z-index: 4; background: var(--surface-card);
}

/* Settings on a phone: the list and a page take turns, and View options
   rise from the bottom. Written twice, as the mobile rules above are — once
   under the breakpoint, once for "Always the phone layout". */
@media (max-width: 720px) {
  html:not(.force-pc) .modal.settings-modal { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .settings-modal:not([data-page=""]) .settings-side,
  html:not(.force-pc) .settings-modal[data-page=""] .settings-main { display: none; }
  html:not(.force-pc) .settings-side { border-inline-end: 0; }
  html:not(.force-pc) .settings-page-head { display: flex; }
  html:not(.force-pc) .settings-crumb { display: none; }
  html:not(.force-pc) .settings-pages { padding: 4px 20px 36px; }
  html:not(.force-pc) .modal-overlay.view-options-overlay { align-items: flex-end; padding: 20px 0 0; }
  html:not(.force-pc) .modal.view-options {
    width: 100%; max-height: 85vh; border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: calc(24px + var(--sab, 0px));
  }
  /* A bottom sheet comes up from the edge it sits on. */
  html:not(.force-pc) .view-options-overlay[hidden] > .modal { translate: 0 100%; }
  @starting-style { html:not(.force-pc) .view-options-overlay > .modal { translate: 0 100%; } }
}
html.force-mobile .modal.settings-modal { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .settings-modal:not([data-page=""]) .settings-side,
html.force-mobile .settings-modal[data-page=""] .settings-main { display: none; }
html.force-mobile .settings-side { border-inline-end: 0; }
html.force-mobile .settings-page-head { display: flex; }
html.force-mobile .settings-crumb { display: none; }
html.force-mobile .settings-pages { padding: 4px 20px 36px; }
html.force-mobile .modal-overlay.view-options-overlay { align-items: flex-end; padding: 20px 0 0; }
html.force-mobile .modal.view-options {
  width: 100%; max-height: 85vh; border-radius: 18px 18px 0 0; border-bottom: 0;
  padding-bottom: calc(24px + var(--sab, 0px));
}
html.force-mobile .view-options-overlay[hidden] > .modal { translate: 0 100%; }
@starting-style { html.force-mobile .view-options-overlay > .modal { translate: 0 100%; } }

/* ---------- app lock screen ---------- */
.lock-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.lock-screen[hidden] { display: none; }
/* The wrong-guess backoff (0.262.0): the keys stay drawn and go quiet. */
.lock-keypad.waiting { opacity: 0.4; pointer-events: none; }
.lock-box {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow); padding: 32px 28px; width: 320px; max-width: 100%;
  text-align: center;
}
.lock-icon { font-size: var(--fs-3xl); margin-bottom: 6px; display: flex; justify-content: center; }
.lock-icon .ico { width: 40px; height: 40px; }
.lock-box h2 { margin: 0 0 6px; font-size: var(--fs-xl); }
.lock-box .muted { margin: 0 0 20px; }
/* Shake feedback on a wrong PIN / failed biometric check (see showLockScreen
   in app.js, which toggles this class off-and-on to force a replay). */
@keyframes lock-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.lock-box.shake { animation: lock-shake .4s; }
@media (prefers-reduced-motion: reduce) { .lock-box.shake { animation: none; } }

.lock-pin-form { display: flex; flex-direction: column; gap: 8px; }
.lock-pin-form[hidden] { display: none; }
.lock-pin-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 6px; }
.lock-pin-dots span {
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  background: transparent; display: inline-block;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.lock-pin-dots span.filled { background: var(--accent); border-color: var(--accent); }
.lock-pin-row { display: flex; gap: 8px; }
.lock-pin-form input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: var(--r-md); font-size: var(--fs-lg); text-align: center; letter-spacing: 2px;
}
.lock-pin-form input:focus { outline: none; border-color: var(--accent); }
.lock-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.lock-key {
  height: 50px; border-radius: var(--r-card); border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text); font-size: var(--fs-title); font-family: var(--font-mono); cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.lock-key:hover { background: var(--hover-bg); }
.lock-divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
  color: var(--text-faint); font-size: var(--fs-xs); text-transform: uppercase;
}
.lock-divider[hidden] { display: none; }
.lock-divider::before, .lock-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.lock-bio-btn { width: 100%; }
.lock-error {
  margin: 14px 0 0; font-size: var(--fs-xs); color: var(--danger-text);
  background: var(--danger-bg); border: 1px solid var(--danger);
  border-radius: var(--r-md); padding: 8px 10px;
}
.lock-error[hidden] { display: none; }
.lock-reset-btn {
  display: block; margin: 16px auto 0; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: var(--fs-xs); text-decoration: underline;
}
.lock-reset-btn:hover { color: var(--accent); }


/* ---------- reconciled list movement ---------- */
/* A row arriving in a list. Moves are handled in JS (FLIP, see
   reconcile.js) because the distance isn't knowable from CSS; an arrival
   always travels the same short way, so it stays here. */
@keyframes ll-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.ll-enter { animation: ll-enter var(--ll-move-dur) var(--ll-move-ease); }

/* A row on its way out, already lifted out of the flow by reconcile.js so the
   list has closed up behind it. */
@keyframes ll-exit {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(4px) scale(.97); }
}
.ll-exit { animation: ll-exit .16s var(--ease) forwards; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .ll-enter, .ll-exit { animation: none; }
}


/* ---------- keeping layout off-screen cheap ---------- */
/* A month card that isn't on screen doesn't get laid out. This is what makes
   the forced layouts the app does on every render — the scroll anchor, the
   sticky-header measurement, the jump nav — cost the visible cards rather
   than all six hundred rows in the document.

   `auto` on contain-intrinsic-size means each card remembers the height it
   last rendered at, so the scrollbar doesn't jump once one has been seen; the
   300px is only the first guess for a card never yet painted. */
.month-card,
.backlog-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

/* The To-do row's "No category" chip: a hollow dot, since there is no colour
   to show — it stands for the absence of one. */
.cat-chip.is-general .dot {
  background: transparent !important;
  border: 1.5px solid var(--text-faint);
  box-sizing: border-box;
}

/* The Early Access tick sits in the release override's row beside the date
   and status, not on a line of its own — it is part of the same answer. */
.ovr-row .ovr-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-dim); white-space: nowrap;
}
/* Not the row's 60%-wide text input — a tickbox is its own size. */
.ovr-row .ovr-check input { margin: 0; flex: 0 0 auto; min-width: 0; width: auto; }
.ovr-row .ovr-check { flex: 0 0 auto; }
.ovr-row .ovr-check:has(input:disabled) { opacity: .5; }


/* ---------- year recap ---------- */
/* A full-screen player, above everything including the modals: while it runs
   it is the only thing on screen, which is the whole difference between a
   recap and the stats card it sits beside. */
.recap {
  position: fixed; inset: 0; z-index: 250;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px 64px;
  overflow: hidden;
}
.recap[hidden] { display: none; }

/* Story-style progress: one segment per slide, filled up to where you are.
   It tells you how much is left, which a page count alone doesn't. */
.recap-bar {
  position: absolute; top: 12px; inset-inline-start: 14px; inset-inline-end: 14px;
  display: flex; gap: 4px; height: 3px;
}
.recap-seg { flex: 1 1 0; background: var(--border); border-radius: var(--r-hair); }
.recap-seg.is-done { background: var(--accent); }

.recap-close {
  position: absolute; top: 24px; inset-inline-end: 14px; z-index: 2;
  background: none; border: none; color: var(--text-faint);
  font-size: var(--fs-title); line-height: 1; padding: 6px 8px; cursor: pointer;
}
.recap-close:hover { color: var(--text); }
.recap-close::after { content: ""; position: absolute; inset: -6px; }

/* Never taller than the screen (0.212.0): the stage and the slide shrink to
   the space between the progress bar and the count, and a slide's list,
   wall or bars takes what's left and scrolls — it used to be capped at a
   share of the viewport, so a long one ran off the bottom on a short phone. */
.recap-stage {
  width: 100%; max-width: 520px; z-index: 1;
  pointer-events: none;   /* the tap zones below own the tap */
  text-align: center;
  flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column;
}
.recap-stage a, .recap-stage button { pointer-events: auto; }

/* Left third goes back, the rest goes forward — the proportions are
   deliberate, since forward is what you do nine times out of ten and a
   half-and-half split makes a mistap as likely as a hit. */
.recap-zone {
  position: absolute; top: 0; bottom: 0;
  background: none; border: none; padding: 0; margin: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.recap-prev { inset-inline-start: 0; width: 33%; }
.recap-next { inset-inline-start: 33%; inset-inline-end: 0; }
.recap-zone:disabled { cursor: default; }

.recap-foot {
  position: absolute; bottom: 18px; inset-inline-start: 0; inset-inline-end: 0;
  text-align: center; color: var(--text-dim); font-size: var(--fs-2xs);
  pointer-events: none;
}

.recap-slide { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: 0 1 auto; min-height: 0; }
.recap-year { font-size: var(--fs-display-lg); font-weight: 800; letter-spacing: -2px; color: var(--accent); line-height: 1; }
.recap-value {
  font-size: var(--fs-display); font-weight: 800; letter-spacing: -1.5px; line-height: 1.05;
  color: var(--accent); overflow-wrap: anywhere;
}
.recap-headline { margin: 0; font-size: var(--fs-title); font-weight: 600; color: var(--text); }
.recap-sub { margin: 0; font-size: var(--fs-md); color: var(--text-dim); }
.recap-foot-note { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--text-dim); }

.recap-bars { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
/* The label and the count get equal columns, so the tracks sit in the
   middle of the slide under its centred headline — a 34% label column
   against a 22px count had pushed them well right of it. */
.recap-barrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; gap: 10px; }
.recap-barlabel {
  text-align: end; font-size: var(--fs-sm); color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recap-bartrack { height: 10px; background: var(--bg-elev-2); border-radius: var(--r-sm); overflow: hidden; }
.recap-barfill { display: block; height: 100%; border-radius: var(--r-sm); }
.recap-barn { font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; text-align: start; }

.recap-list { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.recap-listrow {
  display: flex; align-items: center; gap: 10px; text-align: start;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 10px 12px;
}
.recap-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.recap-listlabel { flex: 1 1 auto; min-width: 0; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-listnote { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--text-dim); }

/* Each slide arrives rather than swapping, so moving through feels like
   moving. Short, because you may be tapping through fifteen of them. */
@keyframes recap-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.recap-in { animation: recap-in var(--dur-fast, .18s) var(--ease, ease) both; }
@media (prefers-reduced-motion: reduce) { .recap-in { animation: none; } }

@media (max-width: 480px) {
  .recap-year { font-size: var(--fs-display); }
  .recap-value { font-size: var(--fs-display-sm); }
  .recap-barlabel { font-size: var(--fs-xs); }
}

.yir-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.yir-head h2 { margin: 0; }

/* The button that opens it: the end of the year picker's row, a pill the
   chips' own height, so it reads as "play this one". */
.recap-open-btn {
  background: var(--accent-fill); color: var(--text-on-accent); border: 1px solid var(--accent-fill);
  border-radius: var(--r-pill); padding: 4px 12px; font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; margin-inline-start: auto; white-space: nowrap;
}
.recap-open-btn:hover { background: var(--accent-fill-hover); }

/* Tab/mode switches in Settings → Tabs. The modes are indented under
   their tab because they are a detail of it, not a peer — and greyed rather
   than removed while the tab itself is off, so turning it back on shows you
   what its modes were left set to. */
.tab-toggles { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.modal .tab-toggle-modes .sitem + .sitem { border-top: 1px solid var(--border); }
.modal .tab-toggle-modes .sitem { min-height: 44px; padding-inline-start: 28px; }
.tab-toggle-modes .sitem-title { font-size: var(--fs-sm); font-weight: 450; color: var(--text-dim); }
.tab-toggle-modes .sitem:has(.switch:disabled) { opacity: .5; }

/* ---------- recap: the slides that show things rather than count them ---- */
/* A scrolling slide has to coexist with the player's own gestures. It takes
   pointer events so it can actually scroll (the stage above it doesn't), and
   `touch-action: pan-y` claims the vertical axis only — a horizontal swipe
   still bubbles to #recapScreen and moves to the next slide, which is how you
   get out of a long wall of covers on a phone. The left/right tap zones stay
   reachable in the margins beside it. */
.recap-wall, .recap-cards, .recap-list, .recap-bars {
  pointer-events: auto;
  touch-action: pan-y;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 0 1 auto; min-height: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
/* The wall scrolls, the grids inside it don't: a grid that was itself the
   scroller let its rows shrink to fit, and the covers stacked on each other.
   max-content rows keep each at its tile's own height. */
.recap-wall { margin-top: 10px; text-align: start; }
.recap-group {
  margin: 12px 0 6px; font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em;
}
.recap-group:first-child { margin-top: 0; }
.recap-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  grid-auto-rows: max-content;
  padding-bottom: 4px;
}

/* One thing you logged. Cover art fills it; without art the tile keeps the
   category's colour and carries the title, so a book you typed in by hand
   sits on the wall beside a game that came with a picture. */
.recap-tile {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-elev-2); border: 1px solid var(--border);
  display: flex; align-items: flex-end;
}
.recap-tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The name rides on a gradient over the art, and fills the tile when there
   is none — one element doing both jobs, so the grid stays even either way. */
.recap-tile-name {
  position: relative; z-index: 1; width: 100%; padding: 14px 6px 4px;
  font-size: var(--fs-3xs); line-height: 1.2; text-align: start; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Tinted from JS with the category's own colour plus an alpha suffix — the
   same trick .entry-cat uses, rather than color-mix, which nothing else in
   this file depends on. */
.recap-tile.is-empty { align-items: center; }
.recap-tile.is-empty .recap-tile-name {
  background: none; color: var(--text); text-align: center; padding: 6px 6px;
  -webkit-line-clamp: 4; font-size: var(--fs-3xs);
}

/* The notes themselves, newest first. Same shape the Notes tab uses: a stamp
   over the text, and the text keeping the line breaks you typed. */
.recap-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.recap-note {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 10px 12px; text-align: start;
}
.recap-note-date { font-size: var(--fs-2xs); color: var(--text-dim); margin-bottom: 4px; }
.recap-note-text {
  margin: 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}

/* A cover beside a title in the best-of list, where the plain dot was. The
   empty variant is the same box rather than a smaller mark, so five rows are
   five equal rows whether or not they happen to have pictures. */
.recap-listcover {
  width: 26px; height: 38px; object-fit: cover; border-radius: var(--r-xs);
  flex: 0 0 auto; background: var(--bg-elev-2); display: block;
}
.recap-listcover.is-empty { border: 1px solid var(--border); box-sizing: border-box; }

@media (max-width: 480px) {
  .recap-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
}

/* ---------- habits ---------- */
/* Left to do (0.300.0): what's still open today and this week, month and
   year, before any of the cards. Groups sit side by side where there's
   room, the way the cards do. */
.habit-left {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: var(--space-12) var(--space-14); margin: 0 0 var(--space-12);
}
.habit-left-head { display: flex; align-items: baseline; gap: var(--space-8); }
.habit-left-clear { font-size: var(--fs-md); color: var(--text); font-weight: 600; }
.habit-left-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  column-gap: var(--space-32);
}
.habit-left-group { margin-top: var(--space-10); }
.habit-left-title {
  display: flex; justify-content: space-between; gap: var(--space-8);
  font-size: var(--fs-xs); color: var(--text-dim); font-weight: 600;
}
.habit-left-row {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px;
  align-items: center; column-gap: var(--space-10); min-height: 48px;
}
.habit-left-name {
  min-width: 0; min-height: 44px; text-align: start; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text); font-size: var(--fs-md); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.habit-left-name:hover { color: var(--accent); }
.habit-left-left { font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.habit-left-do {
  width: 44px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; position: relative;
}
.habit-left-do::after { content: ""; position: absolute; inset: -5px 0; }
.habit-left-do:hover { border-color: var(--habit-colour, var(--accent)); }
.habit-left-do .ico { width: 16px; height: 16px; }
.habit-left-bar {
  grid-column: 2 / 4; height: 4px; margin-top: -6px; margin-bottom: var(--space-4); pointer-events: none;
  background: var(--bg-elev-2); border-radius: var(--r-hair); overflow: hidden;
}
.habit-left-bar > i { display: block; height: 100%; background: var(--habit-colour, var(--accent)); border-radius: var(--r-hair); }

/* A timed habit's quick adds, under its name. */
.habit-steps { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-6); margin-block: var(--space-8) 0; margin-inline: var(--space-20) 0; }
.habit-steps .btn { min-height: 36px; padding: var(--space-4) var(--space-10); font-size: var(--fs-sm); position: relative; }
.habit-steps .btn::after { content: ""; position: absolute; inset: -5px -3px; }
#habitAmountModal .habit-steps { margin: 0 0 var(--space-12); }
/* Goal, unit and period on one line: "3 times a week". */
#habitGoalHint, #habitAmountWhen { margin: 0 0 var(--space-12); }
.habit-goal-row > label.field-narrow { flex: 0 0 5rem; }
/* A weekly goal's weeks, one bar over each grid column. */
.habit-today-count { font-size: var(--fs-2xl); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.habit-today-label { font-size: var(--fs-sm); color: var(--text-dim); }

/* Smaller cards (0.210.0): the grid's cells had stretched to the card's
   width, which on a computer made one habit most of a screen tall, and the
   tick was a whole-width bar of its own. Now the cells stop at 16px, the
   tick sits beside the name, and cards share a row wherever two fit. */
.habit-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 12px; align-items: start;
}
.habit-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 12px 14px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px;
}
.habit-card > * { grid-column: 1 / -1; }
/* Under the grid, above Insights: the tick and, for a timed habit, its
   +15/+30/+1 h steps on the same row. */
/* Under the full-width grid, above Insights: the tick, or a timed habit's
   goal with its +15/+30/+1 h steps beside it on the same row. */
/* Wraps only when the goal's text is too long for one row ("1h15 of 3h this
   week" beside three steps on a phone); the button itself never shrinks
   below its text, which had spilled out of its border. */
.habit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); margin-block: var(--space-12) 0; margin-inline: var(--space-16) 0; }
.habit-actions > .habit-steps { margin: 0; flex-wrap: nowrap; gap: var(--space-8); }
.habit-actions > .habit-steps .btn { min-height: 40px; padding: var(--space-4) var(--space-12); }
.habit-actions > .habit-goal { min-width: 0; flex: 0 0 auto; }
.habit-head { display: flex; align-items: center; gap: 10px; }
.habit-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.habit-name {
  flex: 1 1 auto; min-width: 0; text-align: start;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text); font-size: var(--fs-read); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.habit-name:hover { color: var(--accent); }
.habit-streak { flex: 0 0 auto; font-size: var(--fs-sm); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.habit-sub {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-block: 4px 0; margin-inline: 20px 0; font-size: var(--fs-xs); color: var(--text-dim);
}
.habit-foot { position: relative; }
/* Insights' summary is the fold's first line; the numbers sit on its right
   end, over the fold, so opening Insights pushes nothing sideways. */
.habit-foot > .habit-sub-right {
  position: absolute; top: 10px; inset-inline-end: 0; min-height: 24px; display: flex; align-items: center;
  font-size: var(--fs-xs); color: var(--text-dim);
}

/* The one control you use every day: the only filled button on the card,
   and a thumb-sized target beside the name rather than a checkbox to aim at. */
.habit-tick {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 108px; min-height: 40px; margin: 0; padding: 8px 14px;
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  color: var(--text-dim); font-size: var(--fs-md); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.habit-tick:hover { border-color: var(--habit-colour, var(--accent)); color: var(--text); }
.habit-tick.is-done {
  background: var(--habit-colour, var(--accent));
  border-color: var(--habit-colour, var(--accent));
  color: #fff;
}
.habit-tick.is-slip { border-color: var(--danger); color: var(--danger); }
/* "Kept" says you did well; in a red habit's own colour it said danger. */
.habit-tick.habit-slip.is-done { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--text-on-accent); }
/* Filled: a kept day is an outline (below), so the slip is the solid one. */
.habit-cell.is-slip { background: var(--danger); }
/* A kept day nothing was logged on: the habit's colour as an outline (set inline). */
.habit-cell.is-kept { background: transparent; }
.habit-tick-mark { font-size: var(--fs-lg); line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
.habit-tick-mark .ico { width: 18px; height: 18px; }
.habit-tick-mark:empty { display: none; }
.habit-notdue { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); font-style: italic; }
/* Everything longer than the last ninety days, which is the only thing
   backfilling produces and the rest of the card never mentions. */
.habit-life { margin-block: 6px 0; margin-inline: 20px 0; font-size: var(--fs-xs); color: var(--text-dim); }

/* Insights (0.274.0): a fold under the grid. The facts are the Stats
   cards' big-number-over-label at the card's size; the months are bars in
   the habit's own colour. */
.habit-insights { margin-top: 10px; }
.habit-insights > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--text-dim); position: relative; padding: 4px 0;
}
.habit-insights > summary::-webkit-details-marker { display: none; }
.habit-insights > summary::after { content: ""; position: absolute; inset: -8px -10px; }
.habit-insights > summary:hover { color: var(--text); }
.habit-insights > summary .ico { width: 14px; height: 14px; }
.habit-facts { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 8px 0 0; }
.habit-fact { display: flex; flex-direction: column; min-width: 0; }
.habit-fact-big { font-size: var(--fs-lg); font-weight: 650; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.habit-fact-small { font-size: var(--fs-xs); color: var(--text-dim); }
.habit-months { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.habit-month { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 40px; }
.habit-month-bar { width: 100%; height: 48px; display: flex; align-items: flex-end; background: var(--bg-elev-2); border-radius: var(--r-sm); overflow: hidden; }
.habit-month-fill { width: 100%; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.habit-month-pct, .habit-month-label { font-size: var(--fs-3xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.habit-insights .hint { margin: 6px 0 0; }

/* Twelve weeks, a row per weekday. Tapping a cell fixes a day you forgot,
   which is the only way a tracker survives being away from your phone. */
/* The card's full width: the cells grow to fill it, so the grid isn't a
   block in one corner with empty card beside it. */
.habit-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.habit-grid-row { display: flex; align-items: center; gap: 4px; position: relative; }
/* Cells stay small and the columns spread across the card's width. */
.habit-grid-row { justify-content: space-between; }
/* A hairline between the days, drawn in the gap so it costs no height. */
.habit-grid-row + .habit-grid-row::before {
  content: ""; position: absolute; inset-inline-start: 16px; inset-inline-end: 0; top: -2.5px;
  height: 1px; background: var(--border); pointer-events: none;
}
/* Centred: right-aligned, the wide M and W sat left of S, T and F. */
.habit-grid-day {
  flex: 0 0 12px; font-size: var(--fs-3xs); color: var(--text-faint);
  text-align: center; line-height: 1;
}
.habit-cell {
  flex: 0 1 22px; aspect-ratio: 1; min-width: 0; padding: 0;
  background: var(--bg-elev-2); border: 1px solid transparent; border-radius: var(--r-xs);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.habit-cell:hover:not(:disabled) { border-color: var(--accent); }
/* A day the habit never asked for reads as absent, not as a miss — the whole
   point of a cadence. A future day is simply not there yet. */
.habit-cell.is-off { background: transparent; cursor: default; }
.habit-cell.is-future { background: transparent; opacity: .35; cursor: default; }
/* Held down: this is one end of a run, and the grid is waiting for the other.
   An outline in --text rather than --accent, because a kept cell is already
   filled with the habit's colour and an accent ring on it is invisible. */
/* Today's cell ringed outside its fill, so the ring shows on an empty cell,
   a filled one and an avoid habit's inset outline alike. */
.habit-cell.is-today { outline: 2px solid var(--text-dim); outline-offset: 1px; position: relative; z-index: 1; }
.habit-cell.is-anchor { outline: 2px solid var(--text); outline-offset: 1px; position: relative; z-index: 1; }
.habit-range-hint { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--accent); text-align: center; }

/* Walking the window back, for a habit you kept longer than the grid is
   wide. Only drawn when there is somewhere to walk to. */
.habit-grid-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; padding-inline-start: 16px; }
.habit-page {
  flex: 0 0 auto; width: 20px; height: 20px; padding: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-dim); font-size: var(--fs-xs); line-height: 1; cursor: pointer;
}
.habit-page:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.habit-page:disabled { opacity: .3; cursor: default; }
.habit-page-range {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-size: var(--fs-2xs); color: var(--text-dim); font-variant-numeric: tabular-nums;
}

.habit-archived { margin-top: 20px; }
.habit-archived .hint { margin: 0 0 6px; }
.habit-archived-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 6px 2px; cursor: pointer;
  color: var(--text-dim); font-size: var(--fs-sm); text-align: start;
}
.habit-archived-row:hover { color: var(--text); }
.habit-archived-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit-archived-when { flex: 0 0 auto; font-size: var(--fs-2xs); color: var(--text-dim); }

/* The day pickers in the habit modal: a row of small toggles rather than
   seven stacked label rows. */
.habit-days { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 4px; }
.habit-days .toggle-label { font-size: var(--fs-sm); }

/* Habit reminders, in the Habits view (0.184.0). On a card, a chip with
   the time; a time input lies invisibly over it so a tap opens the phone's
   own time picker. Above the cards, one line for all of them. */
/* Health Connect's reading on a habit (health.js), before the flame. */
.habit-health {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--border);
  color: var(--text-dim); font-size: var(--fs-xs); line-height: 1.6; font-variant-numeric: tabular-nums;
}
.habit-health .ico { width: 14px; height: 14px; color: var(--accent); }
.habit-health.is-met .ico { color: var(--success); }
.health-perm-ic { display: inline-flex; flex: 0 0 auto; color: var(--text-dim); }
.health-perm-ic .ico { width: 18px; height: 18px; }
.health-perm { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--warning); }
.health-perm.is-ok { color: var(--success); }
.health-dot { display: block; width: 12px; height: 12px; border-radius: 50%; }
#healthLinked .srow-status .ico { width: 14px; height: 14px; }
.habit-remind { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; flex: 0 0 auto; }
.habit-remind-face {
  position: relative; display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--border);
  color: var(--text-dim); font-size: var(--fs-xs); line-height: 1.6; cursor: pointer;
}
.habit-remind.is-set .habit-remind-face { color: var(--text); border-color: var(--accent); }
.habit-remind.is-paused .habit-remind-face { color: var(--text-faint); border-color: var(--border); }
.habit-remind-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
}
.habit-remind-clear {
  border: 0; background: none; color: var(--text-faint); font-size: var(--fs-xs);
  padding: 4px 6px; cursor: pointer;
}
.habit-remind-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 0 10px; font-size: var(--fs-sm); color: var(--text-dim);
}
.habit-remind-bar-text { flex: 1 1 auto; }
.habit-remind-warn { flex: 1 1 100%; margin: 0; color: var(--text); }
.habit-remind-warn .btn { margin-inline-start: 6px; }

/* A habit opened from the home-screen widget (0.184.0): a ring that fades,
   so the eye finds the card it asked for. */
.habit-card.habit-flash { animation: habit-flash 1.5s var(--ease); }
@keyframes habit-flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) { .habit-card.habit-flash { animation: none; outline: 2px solid var(--accent); } }

/* ---------- boards (src/boards.js) ---------- */
/* Excalidraw's hand-drawn face (vendor/Virgil-LICENSE.md, SIL OFL 1.1). */
@font-face {
  font-family: Virgil; src: url("vendor/Virgil.woff2") format("woff2"); font-display: swap;
}
.board-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.board-card {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: start;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.board-card:hover { border-color: var(--border-strong); }
.board-card { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.board-card .bulk-check { position: absolute; top: 8px; inset-inline-start: 8px; margin: 0; }
.board-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
/* Over the picture's corner, where a note card keeps its ☆. */
.board-card .board-fav {
  position: absolute; top: 6px; inset-inline-end: 6px; margin: 0; padding: 4px 6px;
  background: var(--bg-elev); border: 1px solid var(--border); font-size: var(--fs-md);
}
.board-card:active { transform: scale(.98); }
.board-thumb {
  aspect-ratio: 4 / 3; background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; padding: 10px; color: var(--text);
}
.board-thumb-svg { width: 100%; height: 100%; overflow: visible; }
.board-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; }
.board-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-when { font-size: var(--fs-xs); color: var(--text-dim); flex: 0 0 auto; }
/* The name on a line of its own; the category and time share the next. */
.board-meta:has(.board-cat) { flex-wrap: wrap; row-gap: 2px; }
.board-meta:has(.board-cat) .board-name { flex: 1 0 100%; }
.board-cat { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--fs-xs); color: var(--text-dim); overflow: hidden; white-space: nowrap; }
.board-cat .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.board-new {
  align-items: center; justify-content: center; gap: 6px; min-height: 150px;
  border-style: dashed; color: var(--text-dim); background: transparent;
}
.board-new-plus { font-size: var(--fs-3xl); line-height: 1; color: var(--accent); }
.board-new:hover { color: var(--text); border-color: var(--accent); }
.boards-loading { padding: 20px 4px; }

/* The editor is the whole screen: no scrim, no padding, its own layers. */
.modal-overlay.board-editor {
  display: block; padding: 0; background: var(--bg); z-index: 60;
  --board-safe-top: var(--sat, env(safe-area-inset-top, 0px));
  --board-safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
.modal-overlay.board-editor[hidden] { display: none; }
.board-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none; color: var(--text);
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1.2px);
  cursor: crosshair;
}
.board-svg[data-tool="select"] { cursor: default; }
.board-svg[data-tool="hand"], .board-svg.panning { cursor: grab; }
.board-svg[data-tool="text"] { cursor: text; }
.board-text { font-family: Virgil, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; white-space: pre; }
/* A picture still on its way, or one an import couldn't find. */
.board-pic-wait { fill: var(--bg-elev-2); stroke: var(--text-faint); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.board-pic-icon { color: var(--text-dim); }
.board-pic-label { fill: var(--text-dim); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.board-handle {
  fill: var(--bg-elev); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke;
}
.board-sel-group { stroke-dasharray: none; opacity: .6; }
.board-sel {
  fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.board-box {
  fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.board-text-input {
  position: absolute; z-index: 3; margin: 0; padding: 0; border: 0; outline: 1px dashed var(--accent);
  background: transparent; color: var(--text); resize: none; overflow: hidden; white-space: pre;
  font-family: Virgil, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-width: 40px;
}
.board-top {
  position: absolute; z-index: 3; /* over the zoom buttons, which its menu drops across */ top: calc(var(--board-safe-top) + 10px); inset-inline-start: 10px; inset-inline-end: 10px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.board-top > * { pointer-events: auto; }
.board-back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-block: 6px; padding-inline: 8px 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card);
  color: var(--accent); font: inherit; font-size: var(--fs-read); font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent;
}
.board-name-input {
  flex: 0 1 260px; min-width: 0; height: 44px; padding: 0 12px; box-sizing: border-box;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card);
  color: var(--text); font: inherit; font-weight: 600; box-shadow: var(--shadow);
}
.board-name-input:focus { outline: none; border-color: var(--accent); }
.board-top-btns { margin-inline-start: auto; display: flex; gap: 6px; position: relative; }
.board-top-btns .btn-icon {
  min-width: 44px; min-height: 44px; font-size: var(--fs-xl); background: var(--bg-elev); box-shadow: var(--shadow);
}
.board-top-btns .btn-icon:disabled { opacity: .4; }
.board-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); }
.board-menu .danger { color: var(--danger); }
.board-top-btns .board-zoom-btn { min-width: 58px; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.board-menu kbd { margin-inline-start: 12px; float: inline-end; color: var(--text-faint); font: inherit; font-size: var(--fs-xs); }
.board-bar {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--board-safe-bottom) + 12px); max-width: calc(100% - 20px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.board-bar > * { pointer-events: auto; }
/* Only what the tool can use; with nothing to offer it fades out (boards.js
   syncStyleBar keeps its last buttons until it has). */
.board-style { transition: opacity .2s var(--ll-move-ease), transform .2s var(--ll-move-ease); }
.board-style.is-off {
  opacity: 0; transform: translateY(6px) scale(.96); pointer-events: none;
  transition-duration: .14s; transition-timing-function: var(--ease);
}
@media (prefers-reduced-motion: reduce) { .board-style, .board-style.is-off { transform: none; } }
.board-tools, .board-style {
  display: flex; align-items: center; gap: 2px; padding: 4px; max-width: 100%; overflow-x: auto;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow);
  scrollbar-width: none;
}
.board-tool, .board-width, .board-swatch, .board-delete, .board-fill {
  flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: var(--r-lg); padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--text-dim);
  font: inherit; font-size: var(--fs-xl); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.board-tool:hover, .board-width:hover, .board-delete:hover, .board-fill:hover { background: var(--bg-elev-2); color: var(--text); }
.board-tool.on { background: var(--accent-soft); color: var(--accent); }
.board-tool { position: relative; }
.board-tool-key {
  position: absolute; inset-inline-end: 3px; bottom: 2px; font-size: var(--fs-3xs); font-weight: 600; line-height: 1;
  color: var(--text-faint); pointer-events: none;
}
.board-tool.on .board-tool-key { color: var(--accent); }
.board-swatch::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--swatch);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.board-swatch.on::before { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent); }
.board-width-dot { width: 18px; border-radius: var(--r-pill); background: currentColor; }
.board-width.on { background: var(--accent-soft); color: var(--accent); }
.board-delete { color: var(--danger); font-size: var(--fs-lg); }
.board-clip { color: var(--text-dim); }
.board-fill::before {
  content: ""; width: 18px; height: 18px; border-radius: var(--r-xs); border: 2px solid currentColor; box-sizing: border-box;
  background: repeating-linear-gradient(-45deg, currentColor 0 1.5px, transparent 1.5px 5px);
  opacity: .55;
}
.board-fill.on { background: var(--accent-soft); color: var(--accent); }
.board-fill.on::before { opacity: 1; }
.board-heads::before { content: none; }
.board-heads { font-size: var(--fs-lg); }
.board-dash::before { width: 20px; height: 0; border: 0; border-top: 3px dashed currentColor; border-radius: 0; background: none; }
.board-delete[hidden], .board-style > [hidden] { display: none; }
@media (max-width: 480px) {
  .board-tool { width: 34px; height: 40px; }
  .board-width, .board-swatch, .board-delete, .board-fill { width: 30px; height: 40px; }
  /* The name needs the room more than "Boards" does; the chevron says it. */
  .board-back-label { display: none; }
  .board-back { padding-block: 6px; padding-inline: 10px 12px; }
  .board-name-input { flex-basis: 140px; }
  .board-top-btns { gap: 4px; }
  .board-top-btns .btn-icon { min-width: 40px; }
  .board-top-btns .board-zoom-btn { min-width: 52px; }
}
.board-hist-boards { padding-inline-start: 14px; border-inline-start: 2px solid var(--border); margin-block: 0 6px; margin-inline: 14px 0; }
.board-hist-boards[hidden] { display: none; }
.board-hist-empty { padding: 8px 4px; }

/* ---------- notes: kinds, categories, the toolbar (0.195.0) ---------- */
/* Right-hand, as in every other view, even once it wraps under the kinds. */
.notes-toolbar .sort-select { margin-inline-start: auto; }
.notes-count { font-size: var(--fs-xs); color: var(--text-dim); }
.board-cat-select {
  flex: 0 0 auto; max-width: 220px; height: 44px; background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r-card); padding: 0 10px; font: inherit; font-size: var(--fs-sm); box-shadow: var(--shadow);
}
/* A phone's top bar has no room for it beside the name: it gets its own
   line under the name, as wide as its category needs. */
@media (max-width: 720px) {
  .board-cat-select { position: absolute; top: calc(100% + 6px); inset-inline-start: 52px; max-width: calc(100% - 52px); }
}
.board-thumb-inline { display: block; width: 100%; max-height: 180px; margin-top: 4px; border-radius: var(--r-md); background: var(--bg); overflow: hidden; }
.board-thumb-inline svg { display: block; width: 100%; height: auto; max-height: 180px; }
.cat-chip .coll-mark { margin-inline-end: 2px; opacity: .8; }
.notes-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
/* A type chip's glyph sits where a category chip's dot does. */
.kind-chip .kind-ico { width: 12px; text-align: center; font-size: var(--fs-2xs); line-height: 1; opacity: .75; }
.kind-chip.on .kind-ico { opacity: 1; }

.note-cat {
  display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 8px;
  color: var(--text-dim);
}
.note-cat .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* A quote reads as one: bigger, italic, inside its own marks. */
.note-card .note-quote {
  padding-block: 2px 0; padding-inline: 0 4px; font-size: var(--fs-read); font-style: italic; line-height: 1.5;
}
/* The marks sit in the line, the same size as the words (Daniel, 2026-11-06:
   a big hung opening mark read as offset from the text). */
.note-card .note-quote::before { content: "\201C"; color: var(--accent); opacity: .8; font-style: normal; }
.note-card .note-quote::after { content: "\201D"; color: var(--accent); opacity: .8; font-style: normal; }
.note-author { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--text-dim); }

/* A list is the To-do mode's panel (0.196.0): its header, the old rows,
   the done rule and the add line, on the panel's own surface. Only the
   header opens the note, so the rest of the card isn't a pointer. */
.note-card.is-list { cursor: default; padding: 10px 12px 12px; }
.note-card.is-list:hover { border-color: var(--border-strong); }
.note-list-head {
  margin: 0 0 4px; padding: 2px 0 10px; border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm); color: var(--text-dim); font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer;
}
.note-list-head:hover .note-list-title { color: var(--text); }
.note-list-head .mc { color: var(--text-dim); font-weight: 500; }
.note-list-head .mc-left, .note-list-head .mc-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.note-list-head .mc-left .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.note-list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The list's own tick and what's set on it (16 Nov 2026). */
.note-list-head .note-list-tick { flex: 0 0 auto; margin-block: 0; margin-inline: 0 var(--space-4); }
.note-list-head.is-done .note-list-title { text-decoration: line-through; }
.note-list-head.has-meta { border-bottom: 0; padding-bottom: 2px; }
.note-list-head-meta { margin: 0 0 4px; padding-block: 0 10px; padding-inline: calc(22px + var(--space-10)) 0; border-bottom: 1px solid var(--border); }
.note-card.is-bulk .note-list-title { font-weight: 650; white-space: normal; }
/* A list's items while selecting (bulkListPreview): read-only, so the press
   reaches the card and selects it. */
.note-list-rows.is-preview { pointer-events: none; }
.note-list-rows.is-preview .todo-check:disabled { opacity: 1; }
.note-list-rows.is-preview .todo-text { cursor: inherit; }
.note-list-rows > .dsc-note { margin: 6px 0 2px; }
.note-list-compose { margin: 10px 0 0; }
.note-card.is-list .todo-row { user-select: none; -webkit-user-select: none; }

/* ☆ on every card; lit when it's a favourite. */
.note-fav {
  float: inline-end; margin-block: -4px 0; margin-inline: 6px -4px; padding: 2px 6px; border: 0; background: transparent;
  color: var(--text-faint); font-size: var(--fs-read); line-height: 1; cursor: pointer; border-radius: var(--r-sm);
  -webkit-tap-highlight-color: transparent;
}
.note-fav:hover { color: var(--text); }
.note-fav.on { color: var(--priority); }

/* The checklist in the note sheet. */
/* The sheet's checklist (0.199.0): one panel of rows, like the list on its
   card, with the add line at its foot. No borders on the fields — the
   panel is the box. */
.note-list-editor {
  margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg); overflow: hidden;
}
.note-list-items:empty { display: none; }
.note-list-row { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); }
.note-list-row input[type="text"] { flex: 1; min-width: 0; margin: 0; }
.note-list-words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-list-words .todo-meta { padding: 0 var(--space-12) var(--space-10); cursor: pointer; }
.note-list-words.has-meta input[type="text"] { padding-bottom: var(--space-2); }
.note-list-row.is-sub { padding-inline-start: var(--space-24); }
.note-list-open { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text-faint); cursor: pointer; }
.note-list-open:hover { color: var(--text); }
.note-list-open svg { width: 18px; height: 18px; }
.note-list-row.is-done input[type="text"] { text-decoration: line-through; color: var(--text-faint); }
.note-list-new { display: flex; align-items: center; gap: 2px; padding-inline-start: 12px; color: var(--accent); font-size: var(--fs-xl); }
.note-list-del {
  flex: 0 0 auto; padding: 6px 8px; border: 0; background: transparent; border-radius: var(--r-sm);
  color: var(--text-faint); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.note-list-del:hover { color: var(--danger); }
.note-list-editor[hidden] { display: none; }
/* The checklist's fields sit outside a label, where the modal's input style
   doesn't reach, so they take it here. */
.note-list-editor input[type="text"] {
  display: block; width: 100%; box-sizing: border-box; background: transparent;
  border: 0; color: var(--text); padding: 12px 12px;
  font: inherit; font-size: var(--fs-md);
}
.note-list-editor input[type="text"]:focus { outline: none; }
.note-list-editor:focus-within { border-color: var(--accent); }
/* Favourites have no month to be a card of: the notes sit straight under
   their heading, full width. */
.note-favs .month-card { background: none; border: 0; padding: 0; }
.note-favs .month-grid { grid-template-columns: 1fr; }


/* ---------- note collections and reading a note (0.204.0) ---------- */
.coll-title .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.coll-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.coll-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-title); }
.coll-head .btn-primary { margin-inline-start: auto; }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.coll-card {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px; text-align: start;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card); color: var(--text);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.coll-card:hover { border-color: var(--accent); }
.coll-card { position: relative; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.coll-card .note-fav { position: absolute; top: 8px; inset-inline-end: 8px; margin: 0; float: none; }
.coll-card .coll-card-title { padding-inline-end: 24px; }
.coll-card .bulk-check { position: absolute; top: 12px; inset-inline-start: 12px; margin: 0; }
.coll-card.is-bulk { padding-inline-start: 40px; }
.coll-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.coll-card-title { font-weight: 650; font-size: var(--fs-read); overflow-wrap: anywhere; }
.coll-card-text {
  color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.45; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
}
.coll-card-meta { color: var(--text-dim); font-size: var(--fs-xs); margin-top: auto; }

.md { font-size: var(--fs-read); line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4, .md h5, .md h6, .md h7 { margin: 1.1em 0 .4em; line-height: 1.3; }
.md h2 { font-size: 1.3em; } .md h3 { font-size: 1.15em; } .md h4, .md h5, .md h6 { font-size: 1em; }
.md p { margin: 0 0 .8em; }
.md ul, .md ol { margin: 0 0 .8em; padding-inline-start: 1.4em; }
.md li { margin: .2em 0; }
.md li.md-task { list-style: none; margin-inline-start: -1.3em; }
.md .md-box { display: inline-block; width: 1.3em; color: var(--text-dim); }
.md li.md-task.is-done { color: var(--text-faint); text-decoration: line-through; }
.md code { font-family: "Consolas", "SF Mono", Menlo, monospace; font-size: .9em; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; }
.md pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; overflow-x: auto; margin: 0 0 .9em; }
.md pre code { background: none; border: 0; padding: 0; font-size: var(--fs-sm); }
.md blockquote { margin: 0 0 .9em; padding-block: 2px; padding-inline: 14px 0; border-inline-start: 3px solid var(--border); color: var(--text-dim); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md a { color: var(--accent); }
/* Links between notes (Nov 2026): [[Title]] in the accent with its kind's
   icon; one to a note that isn't there yet is dashed, and a tap makes it. */
.md a.md-wiki { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.md a.md-wiki .ico { width: .95em; height: .95em; vertical-align: -.12em; margin-inline-end: 3px; }
.md a.md-wiki.is-missing { color: var(--text-dim); border-bottom-style: dashed; border-bottom-color: var(--text-dim); }
/* Tables (Nov 2026): a frame of their own that scrolls sideways when wide. */
.md .md-table { overflow-x: auto; margin: 0 0 .9em; border: 1px solid var(--border); border-radius: var(--r-md); }
.md table { border-collapse: collapse; width: 100%; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.md th, .md td { padding: var(--space-8) var(--space-12); text-align: start; border-bottom: 1px solid var(--border); vertical-align: top; }
.md th { font-weight: 600; font-size: var(--fs-xs); color: var(--text-dim); background: var(--bg-elev-2); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md .md-al-right { text-align: end; }
.md .md-al-center { text-align: center; }
.note-md .md-table { margin-bottom: .5em; }
.note-md table { font-size: var(--fs-xs); }
.note-md th, .note-md td { padding: var(--space-4) var(--space-8); }
/* Images in notes (0.297.0): a picture LifeLog keeps is drawn at the
   column's width; anything it couldn't draw is a dashed line saying what it
   was, so a note imported from Obsidian shows where its picture went. */
.md .md-img { display: block; max-width: 100%; height: auto; margin: var(--space-8) 0; border-radius: var(--r-md); background: var(--bg); }
.md .md-img-missing { display: inline-block; padding: var(--space-2) var(--space-8); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); color: var(--text-dim); font-size: var(--fs-sm); }
/* A note card's (.note-card, after .md so these win): the card's Markdown at the card's size, not the reader's: the same type
   as the plain text it replaced, headings only a step up, and nothing
   trailing a margin off the bottom of the card. */
.note-md { white-space: normal; font-size: var(--fs-sm); line-height: 1.45; }
.note-md > :last-child { margin-bottom: 0; }
.note-md h2, .note-md h3, .note-md h4, .note-md h5, .note-md h6 { margin: .6em 0 .3em; font-size: var(--fs-md); }
.note-md p, .note-md ul, .note-md ol, .note-md blockquote, .note-md pre { margin-bottom: .5em; }
.note-md .md-img { max-height: 220px; width: auto; margin: var(--space-6) 0; }
/* The note sheet's row of the note's images, under the text. */
.note-images[hidden] { display: none; }
.note-images { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); margin: var(--space-12) 0 0; }
.note-image-thumbs { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.note-image-thumbs[hidden] { display: none; }
.note-image-thumb { position: relative; width: 64px; height: 64px; border-radius: var(--r-md); overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.note-image-thumb .md-img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.note-image-thumb .md-img-missing { font-size: var(--fs-3xs); padding: var(--space-4); border: 0; }
.note-image-del { position: absolute; top: var(--space-2); inset-inline-end: var(--space-2); width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--scrim); color: var(--text-on-fill); cursor: pointer; }
.note-image-del .ico { width: 14px; height: 14px; }
/* 44px to press on a phone: the thumb is 64, so the hit area reaches its middle. */
.note-image-del::after { content: ""; position: absolute; inset: -11px; }

/* ---------- a note, read or written (0.304.0) ----------
   One frame for both: the bar (close, Read / Edit, the ⋯ menu, Save), the
   page in a reading column, and on a saved note's editor a foot with its
   dates. Full screen on a phone. The category is a chip under the
   title and the dates sit at the foot: what a note is about comes first. */
.nv-overlay > .modal.nv {
  width: 760px; height: min(86vh, 860px); max-height: none; padding: 0;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
/* Read and Edit swap without the sheet leaving and coming back. */
.nv-overlay.nv-instant, .nv-overlay.nv-instant > .modal { transition: none; }
.nv-bar {
  display: flex; align-items: center; gap: var(--space-6); flex: 0 0 auto;
  padding: var(--space-10) var(--space-12); border-bottom: 1px solid var(--border);
}
.nv-bar .spacer { flex: 1; }
.nv-mode {
  display: inline-flex; padding: var(--space-2); gap: 2px; border-radius: var(--r-lg);
  background: var(--bg); border: 1px solid var(--border);
}
.nv-mode[hidden] { display: none; }
/* A new note's sheet says which kind it is; an open note's is for screen readers. */
.modal .nv-heading { margin-block: 0; margin-inline: var(--space-6) 0; font-size: var(--fs-read); font-weight: 600; }
.nv-fav.on { color: var(--priority); }
/* A new board: a blank board, as Home's scratch board, that opens the editor. */
.nv-board {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 360px; margin-top: var(--space-16);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg);
  color: var(--text-dim); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.nv-board:hover { border-color: var(--text-dim); }
.nv-board[hidden] { display: none; }
.nv-mode button {
  border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-sm);
  padding: var(--space-6) var(--space-12); border-radius: var(--r-md); cursor: pointer;
  display: inline-flex; gap: var(--space-6); align-items: center; -webkit-tap-highlight-color: transparent;
}
.nv-mode button:hover { color: var(--text); }
.nv-mode button .ico { width: 15px; height: 15px; }
.nv-mode button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; cursor: default; }
.nv-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-24) var(--space-32) var(--space-16); }
.nv-col { max-width: 640px; margin: 0 auto; }
.nv-title-label { display: block; margin: 0; }
.nv-title-label[hidden] { display: none; }
#noteModal .nv-title, #noteReader .nv-title, .nv-title {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 var(--space-8); padding: 0;
  border: 0; background: transparent; color: var(--text); font: inherit;
  font-size: var(--fs-2xl); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere;
}
#noteModal .nv-title:focus { outline: none; box-shadow: none; }
.nv-title::placeholder { color: var(--text-faint); font-weight: 600; }
/* The category: a chip, with the select laid over it so tapping it is the
   phone's own picker. */
#noteModal .nv-cat, .nv-cat {
  width: auto;
  position: relative; display: inline-flex; align-items: center; gap: var(--space-6); margin: 0;
  padding-block: var(--space-4); padding-inline: var(--space-8) var(--space-4); border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--text-dim); font-size: var(--fs-xs); cursor: pointer;
}
/* The task sheet's list switcher sits in the bar, centred on its buttons. */
#taskModal .nv-bar .nv-cat { display: inline-flex; margin: 0; }
#taskModal .nv-bar .nv-cat[hidden] { display: none; }
.nv-cat:hover, .nv-cat:focus-within { border-color: var(--border-strong); color: var(--text); }
.nv-cat .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--text-faint); }
#noteModal .nv-cat select, #taskModal .nv-cat select {
  appearance: none; display: inline; font-size: var(--fs-xs); background-position: calc(100% - 10px) calc(50% + 1px), calc(100% - 6px) calc(50% + 1px); padding-inline-end: 20px !important; -webkit-appearance: none; border: 0; background-color: transparent; color: inherit;
  font: inherit; padding: 0; margin: 0; width: auto; min-width: 0; min-height: 0; cursor: pointer;
}
#noteModal .nv-cat select:focus, #taskModal .nv-cat select:focus { outline: none; box-shadow: none; }
/* 44px tall to press on a phone, without moving the text under it, and the
   whole chip, dot included, opens the picker. The reach is the select's own
   padding: a box laid over it would take the tap,
   and tapping a label only focuses its select, it doesn't open it. */
#noteModal .nv-cat select, #taskModal .nv-cat select {
  --nv-cat-lead: calc(var(--space-8) + 8px + var(--space-6));
  position: relative; padding-block: 14px !important; padding-inline: var(--nv-cat-lead) 24px !important;
  margin-block: -14px; margin-inline: calc(-1 * var(--nv-cat-lead)) calc(-1 * var(--space-4));
}
.nv-cat-static { cursor: default; padding-inline-end: var(--space-10); }
.nv-cat-static[hidden] { display: none; }
.nv-text-label { display: block; margin: var(--space-16) 0 0; }
.nv-text-label[hidden] { display: none; }
/* The text, with its line numbers down the side when they're on. The
   textarea grows with what's in it, so the page scrolls rather than the
   field and the numbers never need to follow a second scroll. */
.nv-editor { --nv-fs: var(--fs-read); display: flex; align-items: flex-start; }
html.note-text-small .nv-editor { --nv-fs: var(--fs-md); }
html.note-text-large .nv-editor { --nv-fs: var(--fs-xl); }
#noteForm #nText {
  flex: 1; min-width: 0; min-height: 50vh; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--text); resize: none; overflow: hidden;
  font: inherit; font-size: var(--nv-fs); line-height: 1.6;
}
#noteForm #nText:focus { outline: none; box-shadow: none; }
.nv-gutter {
  display: none; flex: 0 0 auto; width: 2.6em; padding-inline-end: var(--space-10); box-sizing: border-box;
  text-align: end; color: var(--text-faint); font-size: var(--nv-fs); line-height: 1.6;
  font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none;
}
html.note-lines .nv-gutter { display: block; }
.nv-gutter > span { display: block; font-size: .82em; line-height: calc(1.6em / .82); overflow: hidden; }
.nv-gutter > span.on { color: var(--text-dim); }
/* The off-screen copy the numbers are measured from (notes.js lineHeights). */
.nv-measure { position: absolute; visibility: hidden; left: -9999px; top: 0; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }
.nv-measure > div { min-height: 1lh; }
#noteForm .note-list-editor { margin: var(--space-16) 0 0; }
.nv-hint { margin: var(--space-8) 0 0; font-size: var(--fs-xs); color: var(--text-dim); }
.nv-hint[hidden] { display: none; }
.nv-foot {
  display: flex; align-items: center; gap: var(--space-8); flex: 0 0 auto;
  padding: var(--space-10) var(--space-12); border-top: 1px solid var(--border);
}
.nv-foot[hidden] { display: none; }
#noteStampLine, .nv-stamp { margin: 0; color: var(--text-dim); font-size: var(--fs-xs); }
/* The ⋯ menu: Add image, the kind, Make entry and Delete — things done to a note
   now and then, kept out of the way of writing it. */
.nv-menu {
  position: absolute; top: calc(100% - 4px); inset-inline-end: 72px; z-index: 3; min-width: 200px; padding: var(--space-4);
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.nv-bar { position: relative; }
.nv-menu.nv-menu-end { inset-inline-end: var(--space-12); }
/* "Linked from" under a note (Nov 2026): the notes that link here, each
   with the line the link is on. */
.nv-links { margin-top: var(--space-32); padding-top: var(--space-16); border-top: 1px solid var(--border); }
.nv-links[hidden] { display: none; }
.nv-links-head { display: flex; align-items: center; gap: var(--space-6); margin: 0 0 var(--space-8); font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); }
.nv-links-head .ico { width: 14px; height: 14px; }
.nv-link-row { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); width: 100%; min-height: 44px; margin-bottom: var(--space-6); padding: var(--space-10) var(--space-12); border: 0; border-radius: var(--r-md); background: var(--bg-elev-2); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.nv-link-row:hover { background: var(--hover-bg); }
.nv-link-row b { font-size: var(--fs-md); font-weight: 600; }
.nv-link-row span { font-size: var(--fs-sm); color: var(--text-dim); }
.nv-link-row mark { background: none; color: var(--accent); }
/* Typing [[ (Nov 2026): the notes and boards to link to, under the caret. */
.link-pick { position: fixed; z-index: 90; width: 280px; max-width: calc(100vw - 16px); padding: var(--space-4); background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow); animation: dd-in .16s var(--ll-move-ease); }
.link-pick[hidden] { display: none; }
.link-pick.is-leaving { opacity: 0; transition: opacity .14s var(--ease); }
.link-pick hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0; }
.link-pick-row { display: flex; align-items: center; gap: var(--space-10); width: 100%; min-height: 40px; padding: 0 var(--space-10); border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-size: var(--fs-md); text-align: start; cursor: pointer; }
.link-pick-row.on, .link-pick-row:hover { background: var(--hover-bg); }
.link-pick-row .ico { width: 16px; height: 16px; flex: none; color: var(--text-dim); }
.link-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-pick-row small { color: var(--text-dim); font-size: var(--fs-2xs); }
@media (pointer: coarse) { .link-pick-row { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .link-pick { animation: none; } .link-pick.is-leaving { transition: none; } }
/* A new note's templates (Nov 2026), above the text until one is picked. */
.nv-tpl { margin: 0 0 var(--space-16); }
.nv-tpl[hidden] { display: none; }
.nv-tpl-head { margin: 0 0 var(--space-8); font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); }
.nv-tpl-row { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.tpl-chip { display: inline-flex; align-items: center; gap: var(--space-6); min-height: 36px; padding: 0 var(--space-12); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-elev-2); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.tpl-chip:hover { background: var(--hover-bg); }
.tpl-chip .ico { width: 15px; height: 15px; color: var(--text-dim); }
@media (pointer: coarse) { .tpl-chip { min-height: 44px; } }
/* Export as PDF (Nov 2026): the print dialog gets the note on its own, in
   ink on paper whatever the theme. */
@media print {
  html.printing-note body > *:not(#noteReader) { display: none !important; }
  html.printing-note, html.printing-note body { background: #fff !important; }
  html.printing-note #noteReader { position: static !important; inset: auto; background: none !important; display: block !important; }
  html.printing-note #noteReader .modal { position: static !important; max-width: none !important; width: auto !important; height: auto !important; max-height: none !important; box-shadow: none !important; border: 0 !important; background: #fff !important; transform: none !important; animation: none !important; }
  html.printing-note #noteReader .nv-bar, html.printing-note #noteReader .nv-foot, html.printing-note #noteReaderLinks { display: none !important; }
  html.printing-note #noteReader .nv-scroll { overflow: visible !important; height: auto !important; }
  html.printing-note #noteReader * { color: var(--print-ink) !important; }
  html.printing-note #noteReader .md a { color: var(--print-link) !important; }
  html.printing-note #noteReader .md pre, html.printing-note #noteReader .md code, html.printing-note #noteReader .md th { background: var(--print-shade) !important; }
}
.nv-menu[hidden] { display: none; }
.nv-menu-label { margin: 0; padding: var(--space-6) var(--space-10) var(--space-2); font-size: var(--fs-2xs); color: var(--text-dim); }
.nv-menu-label[hidden], .nv-menu hr[hidden], .nv-menu button[hidden] { display: none; }
.nv-menu hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) var(--space-2); }
.nv-menu button {
  display: flex; width: 100%; gap: var(--space-10); align-items: center; justify-content: flex-start;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 400;
  padding: var(--space-10); border-radius: var(--r-md); text-align: start; cursor: pointer; flex: none;
}
.nv-menu button:hover { background: var(--accent-soft); }
.nv-menu button .ico { width: 16px; height: 16px; color: var(--text-dim); }
.nv-menu .nv-menu-danger, .nv-menu .nv-menu-danger .ico { color: var(--danger); }
/* Reading. */
#noteReader .md { margin-top: var(--space-20); }
html.note-text-small #noteReader .md { font-size: var(--fs-md); }
html.note-text-large #noteReader .md { font-size: var(--fs-xl); }
/* The checklist's rows in the sheet: a handle to drag by (0.304.0). */
.note-list-grip {
  flex: 0 0 auto; align-self: stretch; display: flex; align-items: center; padding-block: 0; padding-inline: var(--space-10) var(--space-4);
  border: 0; background: transparent; color: var(--text-faint); cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.note-list-grip .ico { width: 16px; height: 16px; }
.note-list-grip:hover, .note-list-grip:focus-visible { color: var(--text-dim); }
.note-list-row.is-dragging {
  position: relative; z-index: 2; background: var(--bg-elev); border: 1px solid var(--accent);
  border-radius: var(--r-md); box-shadow: var(--shadow);
}
.note-list-row.is-dragging .note-list-grip { color: var(--accent); cursor: grabbing; }
.note-list-items.is-sorting { user-select: none; -webkit-user-select: none; }
@media (max-width: 720px) {
  .nv-overlay { padding: 0; align-items: stretch; }
  .nv-overlay > .modal.nv { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .nv-scroll { padding: var(--space-16) var(--space-16) var(--space-12); }
  .nv-mode-label { display: none; }
  .nv-mode button { padding: var(--space-8) var(--space-12); }
  .nv-menu { inset-inline-end: var(--space-12); }
  .nv-editor, html.note-text-small .nv-editor { --nv-fs: var(--fs-lg); }
  html.note-text-large .nv-editor { --nv-fs: var(--fs-xl); }
  .nv-gutter { width: 2em; }
  #noteForm #nText { min-height: 55vh; }
  html.native .nv-overlay { padding: 0; }
  html.native .nv-overlay > .modal.nv { padding-top: var(--sat); padding-bottom: var(--sab); }
}
html.force-mobile .nv-overlay { padding: 0; align-items: stretch; }
html.force-mobile .nv-overlay > .modal.nv { width: 100%; height: 100%; border: 0; border-radius: 0; }
html.force-mobile .nv-scroll { padding: var(--space-16) var(--space-16) var(--space-12); }
html.force-mobile .nv-mode-label { display: none; }
html.force-mobile .nv-mode button { padding: var(--space-8) var(--space-12); }
html.force-mobile .nv-menu { inset-inline-end: var(--space-12); }
html.force-mobile .nv-editor, html.note-text-small.force-mobile .nv-editor { --nv-fs: var(--fs-lg); }
html.note-text-large.force-mobile .nv-editor { --nv-fs: var(--fs-xl); }
html.force-mobile .nv-gutter { width: 2em; }
html.force-mobile #noteForm #nText { min-height: 55vh; }
html.native.force-mobile .nv-overlay { padding: 0; }
html.native.force-mobile .nv-overlay > .modal.nv { padding-top: var(--sat); padding-bottom: var(--sab); }
@media (max-width: 720px) {
  .coll-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .coll-card { padding: 12px; }
}

/* What's new: CHANGELOG.md in the reader's type, with each version's
   heading set apart so a long page scans by release. */
.changelog-box { padding: 12px 14px 14px; }
.changelog { margin-bottom: 12px; }
.changelog h3 { font-size: var(--fs-lg); padding-top: 14px; border-top: 1px solid var(--border); }
.changelog > h3:first-child { border-top: none; padding-top: 0; }
.changelog h4 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: .2em; }

/* The review links are a line of text on a computer; on a phone each one
   gets a full-height tap target. */
@media (max-width: 720px) {
  html:not(.force-pc) .game-reviews a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
}

/* ---------- Home (0.306.0, src/home.js) ----------
   One page of what's on now, built from floors (.home-floor): rows that split
   their width evenly between their sections (--n of them), wrapping inside
   the floor when the window is too narrow for each to get 380px, and one
   under the other on a phone. On a computer a section is dragged by its
   heading (.can-arrange): it outlines on hover, leaves a dashed slot where
   it would land, and a copy (.home-ghost) follows the pointer. */
.home { display: flex; flex-direction: column; gap: var(--space-24); padding: var(--space-8) 0 var(--space-48); }
.home-date { margin: 0; font-size: var(--fs-2xl); font-weight: 700; color: var(--text); }
.home-sec { min-width: 0; position: relative; }
.home-sec-head { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-10); }
.home-sec-head h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-dim); }
.home-sec-head h2 .ico { width: 16px; height: 16px; }
.home-more {
  margin-inline-start: auto; position: relative; border: 0; background: none; padding: 0;
  font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--accent); cursor: pointer;
}
.home-more::after { content: ""; position: absolute; inset: -14px -8px; }
.home-empty { margin: 0; padding: var(--space-14) var(--space-16); color: var(--text-dim); font-size: var(--fs-sm);
  background: var(--surface-card); border: 1px dashed var(--border); border-radius: var(--r-card); }
.home-floor {
  --n: 1;
  display: grid; gap: var(--space-24); align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(max(min(380px, 100%), calc((100% - (var(--n) - 1) * var(--space-24)) / var(--n))), 1fr));
}
.home.can-arrange { min-height: 70vh; }
.home-floor.is-shared .home-pins { grid-template-columns: minmax(0, 1fr); }
@media (hover: hover) {
  .home.can-arrange .home-sec-head { cursor: grab; }
  .home.can-arrange .home-sec:hover::before {
    content: ""; position: absolute; inset: calc(-1 * var(--space-10)); pointer-events: none;
    border: 1.5px solid var(--accent); border-radius: var(--r-card);
  }
}
.home-sec.is-pushed::before { content: ""; position: absolute; inset: calc(-1 * var(--space-10)); pointer-events: none;
  border: 1.5px dashed var(--warning); border-radius: var(--r-card); }
html.home-dragging, html.home-dragging * { cursor: grabbing !important; user-select: none; }
html.home-dragging .home.can-arrange .home-sec:not(.is-pushed):hover::before { content: none; }
.home-sec.is-slot { min-height: 160px; border: 2px dashed var(--accent); border-radius: var(--r-card); background: var(--accent-soft); }
.home-sec.is-slot > * { visibility: hidden; }
.home-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; max-height: 280px; overflow: hidden;
  padding: var(--space-10); background: var(--bg); border: 1.5px solid var(--accent); border-radius: var(--r-card);
  box-shadow: var(--shadow); opacity: .94;
}
.home-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }

/* A scroller clips at its padding box, and a cover's hover and focus
   outline sit 4px outside it, so the strip pads 6px all round and takes
   the same back in margin to stay lined up with the heading. */
.home-strip { display: flex; gap: var(--space-14); overflow-x: auto; padding: var(--space-6) var(--space-6) calc(var(--space-4) + var(--space-6)); margin: calc(-1 * var(--space-6)); }
.home-tile { flex: 0 0 132px; }
.home-tile-count {
  position: absolute; inset-inline-start: var(--space-6); bottom: var(--space-6); padding: 2px var(--space-8); border-radius: var(--r-pill);
  background: var(--surface-card); color: var(--text); font-size: var(--fs-2xs); font-weight: 600; font-variant-numeric: tabular-nums;
}
.home-tile-since { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-xs); color: var(--text-dim); }
.home-tile-since .dot, .home-row-sub .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

.home-day { margin: 0; padding: var(--space-10) var(--space-14) 2px; font-size: var(--fs-2xs); font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.home-row + .home-day { border-top: 1px solid var(--border); margin-top: var(--space-4); }
.home-row {
  display: flex; align-items: center; gap: var(--space-10); width: 100%; min-height: 48px; padding: var(--space-6) var(--space-14);
  border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.home-row:disabled { cursor: default; }
@media (hover: hover) { .home-row:not(:disabled):hover { background: var(--hover-bg); } }
.home-row-ico { width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--bg); color: var(--text-dim); flex: 0 0 auto; }
.home-row-ico .ico { width: 16px; height: 16px; }
.home-up-ev .home-row-ico { color: var(--ev, var(--accent)); }
.home-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-row-title { font-weight: 600; font-size: var(--fs-md); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-row-sub { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-xs); color: var(--text-dim); min-width: 0; }
.home-row-end { font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-row-end.is-money { color: var(--text); font-weight: 600; }
.home-row-end.is-late { color: var(--danger); }
/* A task: its tick in the icon's place, the rest a button that opens it. */
.home-row.is-task { cursor: default; padding-block: 0; padding-inline: var(--space-14) 0; gap: 0; }
.home-row-tick { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; }
.home-row-tick input.todo-check { position: relative; }
.home-row-tick input.todo-check::after { content: ""; position: absolute; inset: -13px -10px; }
.home-row-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-10); min-height: 48px;
  padding-block: var(--space-6); padding-inline: var(--space-10) var(--space-14); border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
@media (hover: hover) { .home-row.is-task:hover { background: var(--hover-bg); } }

.home-pad {
  display: block; width: 100%; min-height: 240px; resize: none; overflow: hidden; border: 0; outline: none; background: transparent;
  padding: var(--space-14) var(--space-16); color: var(--text); font: inherit; font-size: var(--fs-read); line-height: 1.6;
}
.home-pad::placeholder { color: var(--text-dim); }
.home-card:has(.home-pad:focus-visible) { border-color: var(--accent); }
.home-pad-foot { display: flex; align-items: center; gap: var(--space-8); min-height: 52px; padding: var(--space-4) var(--space-14); border-top: 1px solid var(--border); color: var(--text-dim); font-size: var(--fs-xs); }
.home-pad-foot .spacer { flex: 1; }

.home-ledger-top { padding: var(--space-14) var(--space-14) var(--space-12); display: flex; flex-direction: column; gap: 2px; }
.home-ledger-top p { margin: 0; }
.home-ledger-label { font-size: var(--fs-xs); color: var(--text-dim); }
.home-ledger-total { font-size: var(--fs-stat); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.home-ledger-vs { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-sm); color: var(--text); margin-top: var(--space-2); }
.home-ledger-vs .ico { width: 16px; height: 16px; color: var(--success); flex: 0 0 auto; }
.home-ledger-vs.is-up .ico { color: var(--expense); }
.home-ledger-of { font-size: var(--fs-xs); color: var(--text-dim); }
.home-ledger-bar { display: flex; gap: 2px; height: 8px; margin-top: var(--space-12); border-radius: var(--r-pill); overflow: hidden; }
.home-ledger-bar span { flex: 1 1 0; min-width: 4px; }
.home-ledger-cats { list-style: none; margin: var(--space-8) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.home-ledger-cats li { display: flex; align-items: center; gap: var(--space-8); font-size: var(--fs-sm); color: var(--text); }
.home-ledger-cats .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.home-ledger-cat { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ledger-amt { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.home-ledger-top + .home-day { border-top: 1px solid var(--border); padding-top: var(--space-10); }
.home-ledger-none { padding: 0 var(--space-14) var(--space-12); }
.home-invest-none { padding: var(--space-14) var(--space-14) var(--space-4); }
.home-invest-gain { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-sm); margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.home-invest-gain .ico { width: 16px; height: 16px; flex: 0 0 auto; }
.home-ledger-top + .home-invest-row { border-top: 1px solid var(--border); }
.home-invest-row .invest-spark { flex: 0 0 auto; width: 64px; height: 24px; }
.home-invest-end { display: flex; flex-direction: column; align-items: flex-end; min-width: 72px; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.home-invest-end b { font-size: var(--fs-sm); color: var(--text); }
.home-invest-hit { margin-inline-start: var(--space-8); padding: 0 var(--space-6); border-radius: var(--r-pill); background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); font-style: normal; font-size: var(--fs-xs); font-weight: 600; }
.home-invest-closed { font-size: var(--fs-xs); color: var(--text-dim); }

/* Note / Board (src/home.js modeSwitch), at the start of the scratchpad's
   foot; "Saved" moved up into the head in its place. */
.home-pad-state { margin-inline-start: auto; font-size: var(--fs-xs); color: var(--text-dim); }
.home-pad-foot .btn { white-space: nowrap; }
.home-pad-mode .seg-btn { position: relative; display: inline-flex; align-items: center; gap: var(--space-4); min-height: 30px; padding: 0 var(--space-10); font-size: var(--fs-xs); line-height: 1; }
/* 30px tall plus 7px each way: the 44px tap area inside the 52px foot. */
.home-pad-mode .seg-btn::after { content: ""; position: absolute; inset: -7px 0; }
.home-pad-mode .seg-btn .ico { width: 14px; height: 14px; }
.home-board {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 240px;
  padding: var(--space-14); border: 0; background: var(--bg); color: var(--text); font: inherit; cursor: pointer;
}
.home-board .board-thumb-svg { width: 100%; height: 100%; }
.home-board-empty { color: var(--text-dim); font-size: var(--fs-sm); }
.home-card:has(.home-board:focus-visible) { border-color: var(--accent); }

.home-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-12); align-items: start; }
.home-pins .note-card { margin-bottom: 0; }

.home-sec-row .sitem-title .ico { width: 16px; height: 16px; color: var(--text-dim); }

@media (max-width: 720px) {
  html:not(.force-pc) .home-floor { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .home-tile { flex-basis: 112px; }
  html:not(.force-pc) .home-pins { grid-template-columns: minmax(0, 1fr); }
  html:not(.force-pc) .home-pad { font-size: var(--fs-lg); }
}
html.force-mobile .home-floor { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .home-tile { flex-basis: 112px; }
html.force-mobile .home-pins { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .home-pad { font-size: var(--fs-lg); }

/* Home's Calendar (0.321.0): a small month with a mark per thing on a day
   (a bar per event, a dot per entry finished, a dashed ring per release, a
   ring per task) and the picked day's list under it. Alone on a wide floor
   it turns into the Timeline's calendar: names in the days, the list beside. */
.home-calendar { container-type: inline-size; }
.home-cal-main { padding: var(--space-10) var(--space-10) var(--space-8); }
.home-cal-head { display: flex; align-items: center; gap: var(--space-4); padding: 0 0 var(--space-4) var(--space-4); }
.home-cal-title { margin: 0; flex: 1; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.home-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.home-cal-wd { text-align: center; padding: var(--space-4) 0; font-size: var(--fs-2xs); font-weight: 600; color: var(--text-dim); }
.home-cal-wd-long { display: none; }
.home-cal-day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  min-height: 48px; padding: var(--space-4) 0; border: 0; border-radius: var(--r-md); background: none;
  color: var(--text); font: inherit; cursor: pointer; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
.home-cal-day.is-out { visibility: hidden; }
.home-cal-day.is-picked { box-shadow: inset 0 0 0 2px var(--text); }
.home-cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .home-cal-day:not(.is-out):hover { background: var(--hover-bg); } }
.home-cal-n { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.home-cal-day.is-past .home-cal-n { color: var(--text-dim); }
.home-cal-day.is-today .home-cal-n { background: var(--accent-fill); color: var(--text-on-fill); font-weight: 700; }
.home-cal-marks { display: flex; align-items: center; gap: var(--space-2); height: 6px; }
.home-cal-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--mk, var(--text-dim)); flex: 0 0 auto; }
.home-cal-mark.is-event { width: 10px; height: 4px; border-radius: var(--r-pill); background: var(--mk, var(--accent)); }
.home-cal-mark.is-release { background: none; border: 1.5px dashed var(--mk, var(--text-dim)); }
.home-cal-mark.is-task { background: none; border: 1.5px solid var(--text-dim); }
.home-cal-mark.is-task.is-p1 { border-color: var(--danger); }
.home-cal-mark.is-task.is-p2 { border-color: var(--warning); }
.home-cal-mark.is-task.is-p3 { border-color: var(--accent); }
.home-cal-names { display: none; }
.home-cal-list { border-top: 1px solid var(--border); padding-bottom: var(--space-4); }
.home-cal-time {
  flex: 0 0 56px; align-self: stretch; display: flex; align-items: center; padding-inline-start: var(--space-8);
  border-inline-start: 3px solid var(--ev, var(--accent)); font-size: var(--fs-sm); color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.home-cal-none { padding: var(--space-6) var(--space-14) var(--space-10); }
.home-cal-sync { margin: var(--space-4) var(--space-14) var(--space-10); }
@container (min-width: 760px) {
  .home-cal { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
  .home-cal-list { border-top: 0; border-inline-start: 1px solid var(--border); }
  .home-cal-wd-short { display: none; }
  .home-cal-wd-long { display: inline; }
  .home-cal-grid { gap: var(--space-4); }
  .home-cal-day { align-items: stretch; min-height: 88px; padding: var(--space-4) var(--space-6) var(--space-6); background: var(--bg-elev-2); border-radius: var(--r-sm); }
  .home-cal-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
  .home-cal-day.is-picked { box-shadow: inset 0 0 0 2px var(--text); }
  .home-cal-n { width: auto; height: auto; place-items: start; border-radius: 0; font-size: var(--fs-2xs); color: var(--text-dim); }
  .home-cal-day.is-today .home-cal-n { background: none; color: var(--accent); }
  .home-cal-marks { display: none; }
  .home-cal-names { display: flex; }
}

/* Home's Pick for tonight (0.321.0): the pick's cover beside its title,
   meta line and Start / Another, then chips for what it picks from. */
.home-pick-row { display: flex; gap: var(--space-14); padding: var(--space-14); }
.home-pick-cover { flex: 0 0 96px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--r-md); }
.home-pick-cover .bl-tile-cover { width: 96px; border-radius: var(--r-md); }
.home-pick-cover:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.home-pick-title {
  display: flex; align-items: center; gap: var(--space-6); padding: 0; border: 0; background: none; cursor: pointer; text-align: start;
  font: inherit; font-size: var(--fs-lg); font-weight: 700; color: var(--text);
}
.home-pick-star { width: 16px; height: 16px; color: var(--warning); fill: currentColor; flex: 0 0 auto; }
.home-pick-text .home-row-sub { margin: 0; }
.home-pick-meta { font-size: var(--fs-xs); color: var(--text-dim); }
.home-pick-since { margin: var(--space-2) 0 0; font-size: var(--fs-sm); color: var(--text-dim); }
.home-pick-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: auto; padding-top: var(--space-10); }
.home-pick-none { padding: var(--space-14); }
.home-pick-cats { display: flex; flex-wrap: wrap; gap: var(--space-6); padding: 0 var(--space-14) var(--space-14); }

/* Home's Year so far (0.321.0): the Ledger card's top, a bar per category,
   and three small facts along the foot. */
.home-ledger-vs.is-down .ico { color: var(--text-dim); }
.home-year-bars { display: flex; flex-direction: column; gap: var(--space-6); padding: 0 var(--space-14) var(--space-12); }
.home-year-bar { display: grid; grid-template-columns: minmax(0, 88px) 1fr 32px; align-items: center; gap: var(--space-8); font-size: var(--fs-xs); color: var(--text-dim); }
.home-year-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-year-track { height: 8px; border-radius: var(--r-pill); background: var(--bg-elev-2); overflow: hidden; }
.home-year-fill { display: block; height: 100%; border-radius: var(--r-pill); }
.home-year-n { text-align: end; color: var(--text); font-variant-numeric: tabular-nums; }
.home-year-none { padding: 0 var(--space-14) var(--space-12); }
.home-year-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.home-year-fact { display: flex; flex-direction: column; gap: 2px; padding: var(--space-10) var(--space-14); min-width: 0; }
.home-year-fact + .home-year-fact { border-inline-start: 1px solid var(--border); }
.home-year-fact b { font-size: var(--fs-md); color: var(--text); font-variant-numeric: tabular-nums; }
.home-year-fact span { font-size: var(--fs-2xs); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Ledger: spotted bills, category memory, pace (0.309.0) ---------- */
.bill-suggest {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-14);
  margin: 0 0 var(--space-12); padding: var(--space-14) var(--space-16);
  border: 1px dashed var(--border-strong); border-radius: var(--r-card);
  background: var(--accent-soft);
}
.bill-suggest-ico {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--bg-elev); color: var(--accent);
}
.bill-suggest-ico .ico { width: 18px; height: 18px; }
.bill-suggest-text { flex: 1 1 240px; min-width: 0; }
.bill-suggest-text b { display: block; color: var(--text); font-size: var(--fs-md); }
.bill-suggest-text > span { color: var(--text-dim); font-size: var(--fs-sm); }
.bill-suggest-dates { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-8); }
.bill-suggest-dates span {
  padding: var(--space-2) var(--space-8); border-radius: var(--r-pill);
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-dim); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums;
}
.bill-suggest-btns { display: flex; gap: var(--space-8); margin-inline-start: auto; }

.cat-memory-hint:not([hidden]) { display: flex; align-items: center; gap: var(--space-6); margin: var(--space-6) 0 0; }
.cat-memory-hint .ico { width: 13px; height: 13px; flex: 0 0 auto; color: var(--accent); }

.pace-card h2 { display: flex; align-items: center; gap: var(--space-8); }
.pace-card h2 .pace-day { margin-inline-start: auto; color: var(--text-dim); font-size: var(--fs-xs); font-weight: 500; }
.pace-legend { display: flex; flex-wrap: wrap; gap: var(--space-16); margin: 0 0 var(--space-6); color: var(--text-dim); font-size: var(--fs-xs); }
.pace-key::before { content: ""; display: inline-block; width: 14px; height: 8px; margin-inline-end: var(--space-6); border-radius: var(--r-pill); vertical-align: middle; background: var(--text-dim); }
.pace-key-proj::before { opacity: .3; }
.pace-key-usual::before { width: 2px; height: 12px; background: var(--text); }
.pace-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "name say" "bar bar";
  align-items: center; gap: var(--space-6) var(--space-14); padding: var(--space-10) 0;
}
.pace-name { grid-area: name; display: flex; align-items: center; gap: var(--space-6); max-width: 45vw; color: var(--text); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pace-name .dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.pace-say { grid-area: say; text-align: end; color: var(--text-dim); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pace-row.is-over .pace-say { color: var(--text); font-weight: 600; }
.pace-say .ico { width: 14px; height: 14px; margin-inline-end: var(--space-4); vertical-align: -2px; color: var(--warning); }
.pace-bar { grid-area: bar; position: relative; height: 10px; border-radius: var(--r-pill); background: var(--border); }
.pace-bar > span { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; border-radius: var(--r-pill); }
.pace-bar .pace-proj { opacity: .3; }
.pace-bar .pace-usual { top: -4px; bottom: -4px; width: 2px; background: var(--text); }

@media (max-width: 720px) {
  .bill-suggest-btns { margin-inline-start: 0; width: 100%; }
  .bill-suggest-btns .btn { flex: 1; min-height: 44px; }
  .pace-say { white-space: normal; }
}
html.force-mobile .bill-suggest-btns { margin-inline-start: 0; width: 100%; }
html.force-mobile .bill-suggest-btns .btn { flex: 1; min-height: 44px; }
html.force-mobile .pace-say { white-space: normal; }

/* ---------- the Ledger's Investments mode (invest.js) ---------- */
.invest { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--space-20); align-items: start; }
.invest > .card { margin: 0; }
.invest-setup { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-16); flex-wrap: wrap; }
.invest-setup-text { flex: 1 1 260px; min-width: 0; }
.invest-setup-text b { display: block; color: var(--text); font-size: var(--fs-md); }
.invest-setup-text span { color: var(--text-dim); font-size: var(--fs-sm); }
.invest-head { display: flex; align-items: baseline; gap: var(--space-10); flex-wrap: wrap; }
.invest-sym { font-size: var(--fs-2xl); font-weight: 700; color: var(--text); }
.invest-name { color: var(--text-dim); font-size: var(--fs-sm); min-width: 0; }
.invest-edit { margin-inline-start: auto; align-self: center; }
.invest-price { display: flex; align-items: baseline; gap: var(--space-12); margin-top: var(--space-6); flex-wrap: wrap; }
.invest-price b { font-size: var(--fs-stat); color: var(--text); font-variant-numeric: tabular-nums; }
.invest-up { color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; }
.invest-down { color: var(--danger-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.invest-meta { color: var(--text-dim); font-size: var(--fs-xs); margin-top: var(--space-4); }
.invest-note { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-top: var(--space-10); font-size: var(--fs-sm); color: var(--text-dim); }
.invest-target { padding: var(--space-2) var(--space-8); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); white-space: nowrap; }
.invest-target.is-hit { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.invest-note-text { overflow-wrap: anywhere; }
.invest-chart { position: relative; height: 300px; margin: var(--space-32) 0 var(--space-4); user-select: none; -webkit-user-select: none; }
.invest-chart svg { position: absolute; top: 0; left: 0; width: calc(100% - 52px); height: calc(100% - 22px); overflow: visible; cursor: crosshair; }
.invest-chart-empty { display: grid; place-items: center; height: 160px; margin: var(--space-16) 0; color: var(--text-dim); font-size: var(--fs-sm); text-align: center; border: 1px dashed var(--border); border-radius: var(--r-md); padding: var(--space-16); }
.invest-problem { margin: var(--space-8) 0 0; color: var(--text-dim); font-size: var(--fs-xs); }
.invest-grid line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.invest-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.invest-line.up { stroke: var(--success); }
.invest-line.down { stroke: var(--danger-text); }
.invest-area.up { fill: color-mix(in srgb, var(--success) 14%, transparent); }
.invest-area.down { fill: color-mix(in srgb, var(--danger-text) 14%, transparent); }
.invest-cross { stroke: var(--text-dim); stroke-width: 1; vector-effect: non-scaling-stroke; }
.invest-targetline { stroke: var(--warning); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.invest-pinline { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.invest-yl { position: absolute; right: 0; transform: translateY(-50%); font-size: var(--fs-2xs); color: var(--text-dim); font-variant-numeric: tabular-nums; pointer-events: none; }
.invest-xl { position: absolute; bottom: 0; transform: translateX(-50%); font-size: var(--fs-2xs); color: var(--text-dim); white-space: nowrap; pointer-events: none; }
.invest-tlabel { position: absolute; left: var(--space-6); transform: translateY(-50%); font-size: var(--fs-2xs); font-weight: 600; color: var(--warning); background: var(--surface-card); padding: 1px var(--space-6); border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); pointer-events: none; }
.invest-flag { position: absolute; top: -2px; transform: translate(-50%, -100%); width: 20px; height: 20px; border-radius: 50%; background: var(--accent-fill); color: var(--text-on-accent); font-size: var(--fs-2xs); font-weight: 700; display: grid; place-items: center; }
.invest-pindot, .invest-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface-card); transform: translate(-50%, -50%); pointer-events: none; }
.invest-pindot { background: var(--accent); }
.invest-dot { background: var(--text); }
.invest-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--bg-elev-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: var(--space-6) var(--space-10); font-size: var(--fs-xs); color: var(--text-dim); white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; z-index: 2; display: flex; flex-direction: column; gap: var(--space-2); }
.invest-tip[hidden], .invest-dot[hidden], .invest-results[hidden] { display: none; }
.invest-tip.below { transform: translate(-50%, 12px); }
.invest-tip b { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.invest-pin-btn { margin-top: var(--space-6); gap: var(--space-6); }
.invest-pin-btn .ico { width: 14px; height: 14px; }
.invest-pins { margin-top: var(--space-16); border-top: 1px solid var(--border); padding-top: var(--space-12); }
.invest-pins h3 { display: flex; align-items: center; gap: var(--space-8); margin: 0 0 var(--space-8); font-size: var(--fs-md); color: var(--text); }
.invest-pins h3 .ico { width: 16px; height: 16px; color: var(--accent); }
.invest-pins h3 .btn { margin-inline-start: auto; }
.invest-pins-empty { margin: 0; color: var(--text-dim); font-size: var(--fs-sm); }
.invest-pin { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: var(--space-10); width: 100%; padding: var(--space-6) var(--space-4); margin: 0 calc(-1 * var(--space-4)); min-height: 44px; background: none; border: 0; border-radius: var(--r-md); color: inherit; font: inherit; text-align: start; cursor: pointer; box-sizing: content-box; }
.invest-pin:hover { background: var(--hover-bg); }
.invest-pin.is-now { cursor: default; }
.invest-pin.is-now:hover { background: none; }
.invest-pin-n { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-fill); color: var(--text-on-accent); font-size: var(--fs-2xs); font-weight: 700; display: grid; place-items: center; }
.invest-pin-n.is-now { background: var(--bg-elev-2); color: var(--text-dim); border: 1px solid var(--border-strong); box-sizing: border-box; }
.invest-pin-n .ico { width: 12px; height: 12px; }
.invest-pin-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invest-pin-l b { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.invest-pin-l span { color: var(--text-dim); font-size: var(--fs-xs); margin-inline-start: var(--space-6); }
.invest-pin-v { color: var(--text); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.invest-gap { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-inline-start: 10px; padding-block: var(--space-2); padding-inline: var(--space-20) 0; border-inline-start: 2px solid var(--border); font-size: var(--fs-xs); color: var(--text-dim); min-height: 26px; }
.invest-total { display: flex; justify-content: space-between; gap: var(--space-12); margin-top: var(--space-8); padding-top: var(--space-10); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-dim); }
.invest-list h2 { display: flex; align-items: center; gap: var(--space-8); }
.invest-list h2 .btn { margin-inline-start: auto; }
.invest-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px auto; align-items: center; gap: var(--space-12); width: 100%; padding: var(--space-10); margin: 0 calc(-1 * var(--space-10)); border: 0; border-radius: var(--r-md); min-height: 52px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; box-sizing: content-box; }
.invest-row + .invest-row { border-top: 1px solid var(--border); border-radius: 0; }
.invest-row:hover { background: var(--hover-bg); }
.invest-row.sel { background: var(--accent-soft); border-radius: var(--r-md); border-top-color: transparent; }
.invest-row.sel + .invest-row { border-top-color: transparent; }
.invest-row-t { min-width: 0; }
.invest-row-t b { display: block; color: var(--text); font-size: var(--fs-md); }
.invest-row-t b i { font-style: normal; font-size: var(--fs-2xs); font-weight: 600; color: var(--warning); margin-inline-start: var(--space-6); }
.invest-row-t b i.is-hit { color: var(--success); }
.invest-row-t > span { display: block; color: var(--text-dim); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invest-spark { width: 84px; height: 30px; overflow: visible; }
.invest-row-p { text-align: end; font-variant-numeric: tabular-nums; }
.invest-row-p b { display: block; color: var(--text); font-size: var(--fs-sm); }
.invest-row-p span { font-size: var(--fs-xs); }
.invest-foot { color: var(--text-dim); font-size: var(--fs-xs); margin: var(--space-12) 0 0; }
.invest-results { display: flex; flex-direction: column; margin: calc(-1 * var(--space-6)) 0 var(--space-12); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.invest-result { display: flex; align-items: baseline; gap: var(--space-10); padding: var(--space-10) var(--space-12); min-height: 44px; box-sizing: border-box; background: none; border: 0; border-top: 1px solid var(--border); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.invest-result:first-child { border-top: 0; }
.invest-results-status { margin: 0; padding: var(--space-10) var(--space-12); font-size: var(--fs-xs); color: var(--text-dim); }
.invest-results-status + .invest-result { border-top: 1px solid var(--border); }
.invest-result:hover, .invest-result:focus-visible { background: var(--hover-bg); }
.invest-result b { color: var(--text); font-size: var(--fs-sm); min-width: 56px; }
.invest-result span { color: var(--text-dim); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invest-tip-cmp { color: var(--text-dim); }
/* The held day, under the chart: its close, Pin this day, a buy on it. */
.invest-held { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin-top: var(--space-8); padding: var(--space-8) var(--space-10); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-elev-2); }
.invest-held[hidden] { display: none; }
.invest-held-t { display: flex; align-items: baseline; gap: var(--space-8); flex: 1 1 200px; min-width: 0; font-size: var(--fs-xs); color: var(--text-dim); }
.invest-held-t b { color: var(--text); font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.invest-held .invest-pin-btn { margin-top: 0; }
.invest-held .btn, .invest-compare-btn { display: inline-flex; align-items: center; gap: var(--space-6); }
.invest-buy .invest-pin-l span { display: block; margin-inline-start: 0; overflow: hidden; text-overflow: ellipsis; }
#investBuyTotal { margin: calc(-1 * var(--space-4)) 0 var(--space-12); }
.invest-held-x { margin-inline-start: auto; }
.invest-anchor { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.invest-dot.is-anchor { background: var(--accent); }
.invest-avgline { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.invest-tlabel.is-avg { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.invest-tlabel.is-right { left: auto; right: 60px; }
.invest-buymark { position: absolute; width: 0; height: 0; border-inline-start: 5px solid transparent; border-inline-end: 5px solid transparent; border-bottom: 7px solid var(--accent); transform: translate(-50%, 6px); pointer-events: none; }
.invest-buymark.is-sell { border-bottom: 0; border-top: 7px solid var(--warning); transform: translate(-50%, -13px); }
/* Holding: four numbers, then the buys. */
.invest-hold { margin-top: var(--space-16); border-top: 1px solid var(--border); padding-top: var(--space-12); }
.invest-hold h3 { display: flex; align-items: center; gap: var(--space-8); margin: 0 0 var(--space-8); font-size: var(--fs-md); color: var(--text); }
.invest-hold h3 .ico { width: 16px; height: 16px; color: var(--accent); }
.invest-hold h3 .btn { margin-inline-start: auto; }
.invest-hold-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8); margin-bottom: var(--space-8); }
.invest-stat { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-8) var(--space-10); background: var(--bg-elev-2); border-radius: var(--r-md); min-width: 0; }
.invest-stat span { color: var(--text-dim); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .4px; }
.invest-stat b { color: var(--text); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.invest-hold-note { margin: 0 0 var(--space-8); color: var(--text-dim); font-size: var(--fs-xs); }
/* The S&P 500 (SPY) beside a ticker: a faint line, its move at the end, and
   the same-money line under Holding and the You hold total. */
.invest-benchline { fill: none; stroke: var(--text-faint); stroke-width: 1.5; stroke-dasharray: 1 3; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .9; }
.invest-benchlabel { position: absolute; right: 60px; transform: translateY(-50%); font-size: var(--fs-2xs); font-weight: 600; color: var(--text-dim); background: var(--surface-card); padding: 1px var(--space-6); border-radius: var(--r-pill); border: 1px solid var(--border-strong); pointer-events: none; white-space: nowrap; }
.invest-tip-bench { color: var(--text-faint); }
.invest-bench { display: flex; align-items: flex-start; gap: var(--space-6); margin: 0 0 var(--space-12); color: var(--text-dim); font-size: var(--fs-xs); }
.invest-bench svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.invest-bench b { font-weight: 600; }
.invest-bench-sum { margin-top: calc(-1 * var(--space-4)); }
.invest-target-dir { margin-bottom: var(--space-12); }
.invest-bench-btn { margin-inline-start: auto; align-self: center; }
.invest-bench-btn + .invest-edit { margin-inline-start: 0; }
.invest-bench-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.invest-buy { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--space-10); width: 100%; padding: var(--space-6) var(--space-4); margin: 0 calc(-1 * var(--space-4)); min-height: 44px; background: none; border: 0; border-radius: var(--r-md); color: inherit; font: inherit; text-align: start; cursor: pointer; box-sizing: content-box; }
.invest-buy:hover { background: var(--hover-bg); }
.invest-buy-k { justify-self: start; padding: 1px var(--space-6); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.invest-buy.is-sell .invest-buy-k { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
/* Compare any two pins. */
.invest-pins h3 .invest-compare-btn { margin-inline-start: auto; gap: var(--space-6); }
.invest-pins h3 .invest-compare-btn + .btn { margin-inline-start: 0; }
.invest-compare-btn .ico { width: 14px; height: 14px; color: inherit; }
.invest-compare-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.invest-compare { display: flex; flex-direction: column; gap: var(--space-2); margin: 0 0 var(--space-8); padding: var(--space-8) var(--space-12); border-radius: var(--r-md); background: var(--accent-soft); font-size: var(--fs-sm); color: var(--text-dim); }
.invest-compare-h { color: var(--text); font-weight: 600; }
.invest-compare-v b { font-size: var(--fs-md); }
.invest-pin.is-picked, .invest-pin.is-picked:hover { background: var(--accent-soft); }
.invest-pin.is-now.is-picked { cursor: pointer; }
/* Everything held, at the top of Watching. */
.invest-sum { display: flex; align-items: baseline; gap: var(--space-10); flex-wrap: wrap; margin: 0 0 var(--space-10); padding-bottom: var(--space-10); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-dim); }
.invest-sum b { color: var(--text); font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
/* Dividends, a year and all in, under Holding and You hold. */
.invest-returns { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-12); margin: 0 0 var(--space-8); color: var(--text-dim); font-size: var(--fs-xs); }
.invest-return b { font-weight: 600; font-variant-numeric: tabular-nums; }
.invest-return b:not([class]) { color: var(--text); }
.invest-sum-returns { margin-bottom: var(--space-10); }
/* What everything held was worth, beside what was put in. */
.invest-worth { margin: 0 0 var(--space-12); padding-bottom: var(--space-12); border-bottom: 1px solid var(--border); }
.invest-worth-h { display: flex; align-items: baseline; gap: var(--space-8); flex-wrap: wrap; font-size: var(--fs-sm); }
.invest-worth-h b { color: var(--text); }
.invest-worth-key { display: inline-flex; align-items: center; gap: var(--space-6); margin-inline-start: auto; color: var(--text-dim); font-size: var(--fs-2xs); }
.invest-worth-key i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--success); }
.invest-worth-key i.down { border-top-color: var(--danger-text); }
.invest-worth-key i.is-put { border-top: 2px dashed var(--accent); margin-inline-start: var(--space-6); }
.invest-worth-chart { position: relative; height: 120px; margin: var(--space-8) 0 var(--space-4); user-select: none; -webkit-user-select: none; }
.invest-worth-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; cursor: crosshair; }
.invest-putline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.invest-worth-foot { display: flex; justify-content: space-between; gap: var(--space-8); color: var(--text-dim); font-size: var(--fs-2xs); }
.invest-worth-foot b { font-weight: 600; }
/* The buy sheet. */
.invest-buy-kind { margin-bottom: var(--space-12); }
.invest-buy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); }
/* Tickers as chips over the chart: a phone's way to switch. */
.invest-strip { display: none; }
.invest-chip { display: inline-flex; align-items: baseline; gap: var(--space-6); flex: none; min-height: 36px; padding: var(--space-6) var(--space-12); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface-card); color: var(--text-dim); font: inherit; font-size: var(--fs-sm); cursor: pointer; box-sizing: border-box; }
.invest-chip b { color: var(--text); }
.invest-chip span { font-size: var(--fs-xs); }
.invest-chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.invest-chip-add { align-items: center; padding: var(--space-6) var(--space-10); }
.invest-chip-add .ico { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .invest { grid-template-columns: 1fr; gap: var(--space-12); }
  .invest-chart { height: 260px; margin-top: var(--space-24); }
  .invest-strip { display: flex; gap: var(--space-8); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-16)); padding: 0 var(--space-16); }
  .invest-strip::-webkit-scrollbar { display: none; }
  .invest-hold-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #rangeFilterGroup > label { display: none; }
  #rangeFilter { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }
}
html.force-mobile .invest { grid-template-columns: 1fr; gap: var(--space-12); }
html.force-mobile .invest-chart { height: 260px; margin-top: var(--space-24); }
html.force-mobile .invest-strip { display: flex; gap: var(--space-8); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-16)); padding: 0 var(--space-16); }
html.force-mobile .invest-hold-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.force-mobile #rangeFilterGroup > label { display: none; }
html.force-mobile #rangeFilter { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; }

/* Settings → Connections → Waypage reading: a review row's three answers. */
.wp-review-btns { display: flex; flex-wrap: wrap; gap: var(--space-8); }

/* ---------- a task (tasks.js) ----------
   The note sheet's frame, smaller on a computer: the title with its tick,
   a description, rows for category, date and priority, then subtasks. */
@media (min-width: 721px) {
  html:not(.force-mobile) .nv-overlay > .modal.nv.task-sheet { width: 600px; height: auto; max-height: min(86vh, 860px); }
}
.task-head { display: flex; align-items: flex-start; gap: var(--space-12); }
.task-head .todo-check { width: 24px; height: 24px; margin-top: var(--space-4); position: relative; }
.task-head .todo-check::after { content: ""; position: absolute; inset: -10px; }
.task-head input.todo-check { width: 24px; height: 24px; }
.task-head input.todo-check::before { width: 12px; height: 12px; }
#taskModal .task-title { flex: 1; min-width: 0; margin: 0; resize: none; overflow: hidden; }
#taskModal .task-title:focus { outline: none; box-shadow: none; }
#taskModal .task-note {
  display: block; width: 100%; box-sizing: border-box; margin: var(--space-8) 0 var(--space-16); padding-block: 0; padding-inline: calc(24px + var(--space-12)) 0;
  border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-read); line-height: 1.5;
  resize: none; overflow: hidden; min-height: 0;
}
#taskModal .task-note:focus { outline: none; box-shadow: none; color: var(--text); }
#taskModal .task-note::placeholder { color: var(--text-dim); }
.task-fields, .task-date-opts {
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); overflow: visible;
}
.modal label.task-field, .task-field {
  display: flex; align-items: center; gap: var(--space-12); width: 100%; box-sizing: border-box; margin: 0;
  min-height: 48px; padding: 0 var(--space-14); background: none; color: var(--text);
  font: inherit; font-size: var(--fs-md); text-align: start; cursor: pointer;
}
/* .modal label.task-field outranks the [hidden] rule further down. */
.modal label.task-field[hidden] { display: none; }
.task-field[hidden] + .task-field { border-top: none; }
.task-field + .task-field, .task-field + .task-repeat-custom, .task-repeat-custom + .task-field,
.task-from-done + .task-field, .task-repeat-custom + .task-from-done, .task-field + .task-from-done { border-top: 1px solid var(--border); }
button.task-field { border: 0; }
.task-field > .ico { width: 18px; height: 18px; color: var(--text-dim); }
.task-field-label { flex: 1; }
.task-field .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.task-field .dot[hidden] { display: none; }
.task-field-value { color: var(--text-dim); font-size: var(--fs-sm); text-align: end; }
.task-field-value.is-today { color: var(--success); }
.task-field-value.is-late { color: var(--danger); }
.modal label.task-field select, .modal label.task-field input:not([type=checkbox]), .task-field select, .task-field input {
  display: block; width: auto; min-width: 0; max-width: 60%; margin: 0; padding: var(--space-6) var(--space-4);
  border: 0; background-color: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-sm); text-align: end;
}
.task-field select { text-align-last: right; padding-inline-end: 20px; }
.task-field select:focus, .task-field input:focus { outline: none; box-shadow: none; color: var(--text); }
.task-field:focus-within, .task-field:hover { background: var(--accent-soft); }
.task-field:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
.task-field:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
.task-field input:disabled, .task-field select:disabled { opacity: .45; }
.task-subs-wrap { margin-top: var(--space-20); }
.task-subs-wrap[hidden] { display: none; }
.task-subs-head { margin: 0 0 var(--space-8); font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); }
.task-subs { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); }
.task-subs[hidden] { display: none; }
.task-subs .todo-row { padding-block: var(--space-8); padding-inline: 0 var(--space-10); font-size: var(--fs-md); }
.task-subs .note-list-grip { align-self: stretch; }
.task-sub-new { margin-top: var(--space-8); }
.task-sub-new input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-md); padding: var(--space-10) var(--space-6); }
.task-sub-new input:focus { outline: none; box-shadow: none; }

/* The Date sheet: what's set, quick picks, the month, then the rest. */
.modal.task-date { width: 380px; padding: var(--space-14) 0 var(--space-12); }
.task-date-now {
  display: flex; align-items: center; gap: var(--space-8); margin: 0 var(--space-14) var(--space-6); padding: var(--space-10) var(--space-12);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); font-size: var(--fs-md);
}
.task-date-now .ico { width: 16px; height: 16px; color: var(--text-dim); }
.task-date-now.is-today .ico { color: var(--success); }
.task-quick { display: flex; flex-direction: column; padding: 0 var(--space-6); }
.task-quick-btn {
  display: flex; align-items: center; gap: var(--space-12); min-height: 44px; padding: 0 var(--space-10);
  border: 0; border-radius: var(--r-md); background: none; color: var(--text); font: inherit; font-size: var(--fs-md); cursor: pointer; text-align: start;
}
.task-quick-btn:hover, .task-quick-btn.on { background: var(--accent-soft); }
.task-quick-btn .ico { width: 18px; height: 18px; }
.task-quick-btn.is-today .ico { color: var(--success); }
.task-quick-btn.is-tomorrow .ico { color: var(--warning); }
.task-quick-btn.is-next .ico { color: var(--accent); }
.task-quick-btn.is-none .ico { color: var(--text-dim); }
.task-quick-label { flex: 1; }
.task-quick-day { color: var(--text-dim); font-size: var(--fs-sm); }
.task-cal { padding: var(--space-6) var(--space-14) var(--space-4); border-top: 1px solid var(--border); margin-top: var(--space-6); }
.task-cal-head { display: flex; align-items: center; gap: var(--space-4); font-size: var(--fs-sm); font-weight: 600; }
.task-cal-head .spacer { flex: 1; }
.task-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: var(--space-2); text-align: center; }
.task-cal-wd { font-size: var(--fs-2xs); color: var(--text-dim); padding: var(--space-4) 0; }
.task-cal-day {
  position: relative; width: 36px; height: 36px; margin: auto; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.task-cal-day:hover { background: var(--accent-soft); }
.task-cal-day.is-past { color: var(--text-dim); }
.task-cal-day.is-today { color: var(--success); font-weight: 700; }
.task-cal-day.is-deadline { box-shadow: inset 0 0 0 1.5px var(--danger); }
.task-cal-day.on { background: var(--accent-fill); color: var(--text-on-fill); font-weight: 700; }
.task-cal-day.has-tasks::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-inline-start: -2px;
  border-radius: 50%; background: currentColor; opacity: .7;
}
.task-date-opts { margin: var(--space-8) var(--space-14) 0; }
.task-repeat-custom { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-14); font-size: var(--fs-sm); color: var(--text-dim); }
.task-repeat-custom[hidden] { display: none; }
.task-repeat-custom label { display: flex; align-items: center; gap: var(--space-8); margin: 0; }
.task-repeat-custom input { width: 72px; }
.task-repeat-custom select { width: auto; }
.task-from-done { padding: var(--space-10) var(--space-14); margin: 0; font-size: var(--fs-sm); }
.task-from-done[hidden] { display: none; }
.modal.task-date .modal-actions { padding: var(--space-12) var(--space-14) 0; }
@media (max-width: 720px) {
  .modal.task-date { width: 100%; }
  .task-field select, .task-field input, .task-sub-new input, .task-repeat-custom input { font-size: var(--fs-lg); }
  #taskModal .task-note { font-size: var(--fs-lg); }
}
html.force-mobile .modal.task-date { width: 100%; }
html.force-mobile .task-field select, html.force-mobile .task-field input, html.force-mobile .task-sub-new input,
html.force-mobile .task-repeat-custom input { font-size: var(--fs-lg); }
html.force-mobile #taskModal .task-note { font-size: var(--fs-lg); }

/* ---------- Tags (Nov 2026; src/tags.js) ----------
   Quiet outlined pills, no colour of their own: a category is the coloured
   dot, a tag is a word in a ring, so the two never read as one thing. */
.tag-pills { display: inline-flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; vertical-align: middle; margin-inline-start: var(--space-8); }
.tag-pill {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px 7px; border: 1px solid var(--border);
  border-radius: var(--r-pill); background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-2xs);
  line-height: 1.3; white-space: nowrap; max-width: 16em; overflow: hidden; text-overflow: ellipsis;
}
button.tag-pill { cursor: pointer; position: relative; -webkit-tap-highlight-color: transparent; }
button.tag-pill::after { content: ""; position: absolute; inset: -8px -2px; }
button.tag-pill:hover { border-color: var(--border-strong); color: var(--text); }
.tag-pill.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.todo-meta .tag-pills { margin-inline-start: 0; }
.note-list-head .tag-pills { margin-inline-start: var(--space-4); flex-wrap: nowrap; overflow: hidden; font-weight: 500; }
/* A list that syncs with Trello (Nov 2026, trello.js): bare and the star's
   size beside it (2026-11-22); while it syncs a two-armed ring turns round it. */
.note-trello {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  padding: 2px 4px; border: 0; background: transparent; color: var(--text-faint); font-family: inherit;
  font-size: var(--fs-read); line-height: 1; cursor: pointer; border-radius: var(--r-sm); -webkit-tap-highlight-color: transparent;
}
.note-trello:hover { color: var(--text); }
.note-trello::after { content: ""; position: absolute; inset: -12px -4px; }
.note-trello-ring {
  position: absolute; inset: 50% auto auto 50%; width: 1.75em; height: 1.75em; margin: -0.875em 0 0 -0.875em;
  border: 1.5px solid transparent; border-radius: 50%; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.note-trello.is-syncing { color: var(--accent); }
.note-trello.is-syncing .note-trello-ring {
  opacity: 1; border-top-color: var(--accent); border-bottom-color: var(--accent);
  animation: ico-spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .note-trello.is-syncing .note-trello-ring { animation: none; } }
/* The star sits at the card's top right since tags (Daniel, 2026-11-15);
   floated, so the first line runs beside it. In a list's header it's a
   button in the row. */
.note-card > .note-fav { margin-block: -4px 0; margin-inline: 6px -6px; }
.note-list-head .note-fav { float: none; margin: 0; padding: 2px 4px; }
.board-meta .tag-pills { margin-inline-start: 0; flex: 1 0 100%; }
.nv-tags { margin: var(--space-6) 0 0; }
.nv-tags .tag-pills { margin-inline-start: 0; }
.nv-tags .tag-pill { font-size: var(--fs-xs); padding: 3px 9px; }

/* The tag field: pills with ×, then a box to type in, then suggestions. */
.tag-field { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); min-width: 0; cursor: text; }
.tag-field-ico { display: flex; color: var(--text-dim); }
.tag-field-ico .ico { width: 15px; height: 15px; }
.tag-field-pills { display: contents; }
.tag-field .tag-pill { font-size: var(--fs-xs); padding-block: 3px; padding-inline: 9px 4px; color: var(--text); }
.tag-pill-x {
  display: inline-flex; align-items: center; justify-content: center; position: relative; width: 18px; height: 18px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--text-dim); cursor: pointer;
}
.tag-pill-x::after { content: ""; position: absolute; inset: -12px -6px; }
.tag-pill-x:hover { color: var(--text); background: var(--bg-elev-2); }
.tag-pill-x .ico { width: 12px; height: 12px; }
.modal .tag-field-input, .tag-field-input {
  flex: 1 1 90px; min-width: 90px; width: auto; margin: 0; padding: var(--space-6) var(--space-2); border: 0; background: none;
  color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; min-height: 32px;
}
.modal .tag-field-input:focus, .tag-field-input:focus { outline: none; box-shadow: none; }
.tag-field-input::placeholder { color: var(--text-dim); }
.tag-suggest {
  position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 5; min-width: 220px; max-width: 100%; padding: var(--space-4);
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.tag-suggest[hidden] { display: none; }
.tag-suggest-row {
  display: flex; justify-content: space-between; gap: var(--space-16); align-items: center; min-height: 36px; padding: 0 var(--space-10);
  border-radius: var(--r-sm); font-size: var(--fs-sm); color: var(--text); cursor: pointer;
}
.tag-suggest-row:hover, .tag-suggest-row.is-hi { background: var(--accent-soft); }
.tag-suggest-n { color: var(--text-dim); font-size: var(--fs-xs); }
#nTags { margin: var(--space-8) 0 0; }
/* In the task sheet the field is the row's value, after its label. */
.task-field.task-tags { cursor: text; flex-wrap: nowrap; padding-top: var(--space-6); padding-bottom: var(--space-6); }
.task-field.task-tags .task-field-label { flex: 0 0 auto; }
.task-field.task-tags .tag-field { flex: 1; justify-content: flex-end; }
.task-field.task-tags .tag-field-ico { display: none; }
.task-field.task-tags .tag-field-input { flex: 0 1 70px; min-width: 60px; max-width: none; text-align: end; color: var(--text); padding: var(--space-6) 0; }
.task-field.task-tags .tag-suggest { inset-inline-start: auto; inset-inline-end: 0; }
/* "+" with no tags; with some, the pills sit at the right and the box
   only opens on a tap on the row (16 Nov 2026). */
.task-field.task-tags .tag-field-input::placeholder { color: var(--text-dim); font-size: var(--fs-read); }
.task-field.task-tags .tag-field.has-tags .tag-field-input:not(:focus) { flex: 0 0 0; min-width: 0; width: 0; padding: 0; opacity: 0; }
/* The note sheet's box (16 Nov 2026): category, author and source for a
   quote, a list's date and priority, and tags, above the words. */
.note-fields { margin: var(--space-12) 0 var(--space-16); }
.task-field[hidden], .modal .note-fields label.task-field[hidden] { display: none; }
.modal .note-fields label.task-field input[type="text"] { flex: 1; max-width: 65%; color: var(--text); }
#noteModal .note-desc {
  display: block; width: 100%; box-sizing: border-box; margin: var(--space-4) 0 0; padding: 0;
  border: 0; background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-read); line-height: 1.5;
  resize: none; overflow: hidden; min-height: 0;
}
#noteModal .note-desc:focus { outline: none; box-shadow: none; color: var(--text); }
.note-desc[hidden], #noteModal .note-desc[hidden] { display: none; }
.note-subs-head { margin: var(--space-20) 0 var(--space-6); font-weight: 600; color: var(--text-dim); font-size: var(--fs-sm); }
.note-subs-head[hidden] { display: none; }
/* The category sheet: the count by the title, Tags for new notes as a boxed field. */
.note-cat-head { display: flex; align-items: baseline; gap: var(--space-10); flex-wrap: wrap; }
.note-cat-uses { font-size: var(--fs-sm); font-weight: 400; color: var(--text-dim); }
.note-cat-uses[hidden] { display: none; }
.note-cat-tags { margin: var(--space-12) 0 var(--space-4); }
.note-cat-tags-label { display: block; margin-bottom: var(--space-6); font-size: var(--fs-sm); color: var(--text-dim); }
#noteCatTags, #tagSheetField { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--space-4) var(--space-8); background: var(--bg); }
#noteCatTags:focus-within, #tagSheetField:focus-within { border-color: var(--accent); }
/* The tag chips' counts, after the name. */
.tag-chip-n { margin-inline-start: var(--space-4); font-size: var(--fs-2xs); color: var(--text-dim); }
.cat-chip.on .tag-chip-n { color: inherit; opacity: .8; }
/* All tags. */
.tags-sheet { max-width: 460px; }
.tags-sheet h2 { display: flex; align-items: center; gap: var(--space-8); }
.tags-sheet h2 .ico { width: 18px; height: 18px; }
.modal .tags-find, .tags-find, .modal .tags-rename, .tags-rename {
  display: block; width: 100%; box-sizing: border-box; margin: var(--space-8) 0 var(--space-6); background-color: var(--bg);
  border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: var(--r-md); font: inherit; font-size: var(--fs-md);
}
.tags-find:focus, .tags-rename:focus { outline: none; border-color: var(--accent); }
.tags-list { max-height: min(60vh, 520px); overflow: auto; margin: 0 calc(-1 * var(--space-4)); }
.tags-row { display: flex; align-items: center; gap: var(--space-4); min-height: 52px; padding: 0 var(--space-4); }
.tags-row + .tags-row { border-top: 1px solid var(--border); }
.tags-name {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--space-8) var(--space-4);
  border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; border-radius: var(--r-sm);
}
.tags-name:hover .tags-name-text { color: var(--accent); }
.tags-name-text { font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tags-count { font-size: var(--fs-xs); color: var(--text-dim); }
.tags-row.is-renaming { background: var(--bg); }
.tags-row .tags-rename { flex: 1; min-width: 0; margin: var(--space-6) 0; }
.tags-warn { margin: 0; padding: 0 var(--space-8) var(--space-10); font-size: var(--fs-xs); color: var(--warning); background: var(--bg); }
.tags-warn[hidden] { display: none; }
.tags-empty { padding: var(--space-12) var(--space-4); }
/* A board's tags: its button in the editor's top bar, and the sheet over the editor. */
.board-tags-btn { position: relative; flex: 0 0 auto; }
.board-tags-n { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: var(--r-pill);
  background: var(--accent-fill); color: var(--text-on-accent); font-size: var(--fs-3xs); line-height: 14px; text-align: center; }
.board-tags-n:empty { display: none; }
.modal-overlay.tag-sheet { z-index: 70; }
/* The suggestions hang below the field, past a short sheet's edge. */
.tag-sheet .modal, #noteCatModal .modal { overflow: visible; }
/* A phone's top bar has no room for it beside the name: there it's in ⋯. */
@media (max-width: 720px) { .board-tags-btn { display: none; } }
/* Where the Tags button shows, ⋯ doesn't repeat it (Nov 2026). */
@media (min-width: 721px) { .board-menu .board-tags-item { display: none; } }
.board-tags-btn { min-width: 44px; min-height: 44px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); }

/* Right to left (2026-11-16, groundwork for Hebrew): the sides above are
   logical (inline-start/end), so the layout mirrors with <html dir="rtl">.
   What stays on screen sides on purpose: charts (time runs left to
   right), the mode strip and its peek (app.js places them in px), the
   drag ghost on Home and a tab's drop-down (placed from the left in JS).
   Arrows that mean back, forward, undo or redo turn; the switch's knob
   and a mode's slide-in go the other way. test/rtl.test.js keeps new
   physical sides out. */
:root[dir="rtl"] svg.ico:is([data-ico="chevron-left"], [data-ico="chevron-right"], [data-ico="undo-2"], [data-ico="redo-2"], [data-ico="log-in"], [data-ico="log-out"]) { transform: scaleX(-1); }
:root[dir="rtl"] :is(.modal, .board-opts) input.switch:checked::before { transform: translateX(-16px); }
:root[dir="rtl"] .space-fill { transform-origin: right; }
@media (prefers-reduced-motion: no-preference) {
  :root[dir="rtl"] .mode-slide-fwd { animation-name: mode-slide-back; }
  :root[dir="rtl"] .mode-slide-back { animation-name: mode-slide-fwd; }
}
:root[dir="rtl"] .invest-chart { direction: ltr; }
:root[dir="rtl"] .habit-left-do { direction: ltr; }
/* A board is a drawing in x and y: its text is anchored at its left edge in any language, as Excalidraw does. */
:root[dir="rtl"] :is(.board-text, .board-text-input) { direction: ltr; }
:root[dir="rtl"] select:not([multiple]) { background-position: 12px calc(50% + 1px), 16px calc(50% + 1px); }
/* A title in another script cut short with an ellipsis: on its own its
   direction is the page's, so an English title lost its start and kept
   its end ("…ad 20 pages"). plaintext lets each one run in its own
   direction, so it's cut at its end, and right keeps the column aligned. */
:root[dir="rtl"] :is(.activity-pill-text, .storage-status .stxt, .dd-opt .dd-text, .month-cat-name, .proj-group-name, .proj-expense-name, .entry .etitle, .bl-author, .etitle-text, .eauthor, .entry .entry-cat, .picker-filter-name, .picker-row .etitle, .picker-snippet, .picker-row .ecat, .picker-fill-val, .bar-row .lbl, .yir-rated-title, .backlog-section-name, .backlog-item-rich .bl-title, .cal-name, .tile-info-label, .bulkp-name, .bulkp-detail, .activity-meta, .game-time-label, .ac-item .ac-title, .recap-listlabel, .habit-left-name, .habit-name, .habit-archived-name, .board-name, .note-list-title, .home-row-title, .home-ledger-cat, .pace-name, .tag-pill, .tags-name-text, .item > .n, .acc, .bl-summary) { unicode-bidi: plaintext; text-align: right; }
/* What's typed runs in its own direction: an English note keeps its full stop at its end. */
:root[dir="rtl"] :is(textarea, input:not([type]), input[type="text"], input[type="search"]) { unicode-bidi: plaintext; }

/* ---------- boards: options, guides, links, locks, crop (Nov 2026) ---------- */
/* The grid in place of the dots, the same 24px step snapping uses. */
.board-svg.board-grid {
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px), linear-gradient(to bottom, var(--border) 1px, transparent 1px);
}
.board-guide { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; fill: none; }
.board-link-badge { color: var(--accent); cursor: pointer; }
.board-link-badge rect { fill: var(--bg-elev); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.board-link-badge.is-missing { color: var(--text-faint); }
.board-link-badge.is-missing rect { stroke: var(--text-faint); stroke-dasharray: 3 3; }
.board-lock-badge { color: var(--text-dim); pointer-events: none; }
.board-lock-badge circle { fill: var(--bg-elev-2); stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.board-crop-handle { fill: var(--bg-elev); stroke-width: 2; }
.board-sel-btn.on { background: var(--accent-soft); color: var(--accent); }
.board-sel-btn[hidden], #boardCropReset[hidden] { display: none; }
.board-opts { display: flex; flex-direction: column; padding: var(--space-4) 0; }
.board-opts-head { margin: var(--space-4) var(--space-12); font-size: var(--fs-2xs); font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.board-opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); min-height: 44px;
  padding: 0 var(--space-12); border-radius: var(--r-md); font-size: var(--fs-md); color: var(--text); cursor: pointer;
}
.board-opt span { white-space: nowrap; }
.board-opt:hover { background: var(--bg-elev-2); }
/* Link to…: over the board, just above its bars. */
.board-link-pick {
  position: absolute; z-index: 4; inset-inline: 0; margin-inline: auto; width: min(360px, calc(100% - 20px));
  bottom: calc(var(--board-safe-bottom) + 130px); display: flex; flex-direction: column; gap: var(--space-4);
}
.board-link-pick[hidden] { display: none; }
.board-link-query {
  height: 40px; padding: 0 var(--space-10); border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs-md);
}
.board-link-list { max-height: min(320px, 45vh); overflow-y: auto; }
.board-link-off .ico { color: var(--danger); }
.link-pick-empty { margin: var(--space-8) var(--space-10); color: var(--text-dim); font-size: var(--fs-sm); }
@media (pointer: coarse) { .board-link-query { height: 44px; } }

/* The Home calendar's big covers (Nov 2026): a cover per day, the number
   over it, as the Timeline's calendar on a phone. */
.home-cal.is-covers .home-cal-day { aspect-ratio: 3 / 4; min-height: 0; padding: 0; justify-content: flex-start; }
.home-cal.is-covers .home-cal-names, .home-cal.is-covers .home-cal-marks { display: none; }
.home-cal-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: inherit; }
.home-cal-cover.cover-empty { display: flex; align-items: center; justify-content: center; }
.home-cal-cover.is-release { opacity: .5; }
.home-cal-day.has-cover .home-cal-n { position: relative; margin-top: var(--space-2); color: var(--text-on-fill); text-shadow: 0 0 3px var(--bg); }
.home-cal-day.is-today.has-cover .home-cal-n { text-shadow: none; }
.home-cal-more {
  position: absolute; inset-inline-end: var(--space-2); bottom: var(--space-2); padding: 0 var(--space-4); border-radius: var(--r-pill);
  font-size: var(--fs-3xs); background: var(--surface-card); color: var(--text);
}

/* ---------- boards: cards, players and Home panels (Nov 2026) ---------- */
.board-live {
  box-sizing: border-box; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow);
  color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: var(--fs-md); line-height: 1.45;
}
.board-live-head {
  flex: none; display: flex; align-items: center; gap: var(--space-6); min-height: 32px; padding: 0 var(--space-6) 0 var(--space-12);
  color: var(--text-dim); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; cursor: grab;
}
.board-live-head .ico { width: 14px; height: 14px; flex: none; }
.board-live-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-live-open {
  display: inline-flex; align-items: center; gap: var(--space-4); min-height: 28px; padding: 0 var(--space-8); border: 0; border-radius: var(--r-sm);
  background: none; color: var(--accent); font: inherit; font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0; text-transform: none; cursor: pointer;
}
.board-live-open:hover { background: var(--hover-bg); }
.board-live-open .ico { width: 12px; height: 12px; }
.board-live-body { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--space-12) var(--space-12); cursor: auto; user-select: text; -webkit-user-select: text; }
.board-live-gone { color: var(--text-dim); font-size: var(--fs-sm); margin: 0; }
.board-card-title { margin: 0 0 var(--space-6); font-size: var(--fs-read); }
.board-card-md > :first-child { margin-top: 0; }
.board-card-md > :last-child { margin-bottom: 0; }
.board-card-quote { margin: 0 0 var(--space-6); font-style: italic; font-size: var(--fs-read); }
.board-card-by, .board-card-from { margin: 0; color: var(--text-dim); font-size: var(--fs-xs); }
.board-card-desc { margin: var(--space-4) 0; color: var(--text-dim); font-size: var(--fs-sm); }
.board-card-edit {
  box-sizing: border-box; width: 100%; height: 100%; min-height: 80px; resize: none; padding: var(--space-8);
  border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit;
}
.board-task { display: flex; align-items: center; gap: var(--space-8); min-height: 32px; }
.board-task.is-sub { padding-inline-start: var(--space-24); }
.board-task.is-done .board-task-text { color: var(--text-dim); text-decoration: line-through; }
.board-tick {
  flex: none; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--text-dim); background: none; color: var(--text-on-accent); cursor: pointer;
}
.board-tick.on { background: var(--accent-fill); border-color: var(--accent-fill); }
.board-tick .ico { width: 12px; height: 12px; }
.board-player { padding: 0; display: flex; }
.board-player iframe, .note-player iframe { flex: 1; width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
.board-play {
  flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4);
  padding: var(--space-12); border: 0; background: var(--bg-elev-2); color: var(--text); font: inherit; cursor: pointer; text-align: center;
}
.board-play:hover { background: var(--hover-bg); }
.board-play-btn { width: 56px; height: 40px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--accent-fill); color: var(--text-on-accent); margin-bottom: var(--space-4); }
.board-play-btn .ico { width: 20px; height: 20px; }
.board-play-site { font-weight: 600; }
.board-play-url { max-width: 100%; color: var(--text-dim); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-play-note { color: var(--text-faint); font-size: var(--fs-2xs); }
.board-panel { padding: 0 var(--space-8) var(--space-8); }
.board-panel > .home-sec { margin: 0; }
/* Where HTML can't go (thumbnails, PNG, SVG): a box with the name. */
.board-still rect { fill: var(--bg-elev); stroke: var(--border-strong); stroke-width: 1.5; }
.board-still text { fill: currentColor; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* A note's player: tap to load, at the site's own shape. */
.note-player { display: flex; width: 100%; max-width: 560px; aspect-ratio: var(--ratio, 1.8); margin: var(--space-12) 0; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
/* On a phone the tools that add something sit behind one "+". */
.board-add-more { display: none; }
.board-add-menu { position: absolute; z-index: 4; inset-inline-end: 10px; bottom: calc(var(--board-safe-bottom) + 120px); }
.board-add-menu button { display: flex; align-items: center; gap: var(--space-10); min-height: 44px; }
.board-add-menu .ico { width: 18px; height: 18px; color: var(--text-dim); }
@media (max-width: 480px) {
  .board-tool-add { display: none; }
  .board-add-more { display: grid; }
}

/* ---------- the pinned window (pin.js, computer app) ----------
   The window itself goes small and on top; the page underneath is hidden,
   not taken down, so a sheet opened from here (a task, a release) still
   opens over it. */
body.is-pinned > :is(.topbar, .fab-wrap, .filter-slot, .search-filter-note, .search-results, .content) { display: none; }
.pin-view { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--bg); }
.pin-view[hidden] { display: none; }
.pin-head { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-10); border-bottom: 1px solid var(--border); }
.pin-tabs { flex: 1; min-width: 0; }
.pin-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6); min-height: 36px; padding: 0 var(--space-8); }
.pin-tab .ico { width: 16px; height: 16px; flex: none; }
/* Names only once there's room for all four. */
.pin-tab-label { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 460px) { .pin-tab-label { display: none; } }
.pin-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-10); }
.pin-body .home-pins { grid-template-columns: 1fr; }
.pin-add { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-8) var(--space-10) var(--space-10); border-top: 1px solid var(--border); background: var(--bg-elev); }
.pin-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); }
.pin-kind { min-height: 32px; }
.pin-list { margin-inline-start: auto; max-width: 50%; min-height: 32px; font-size: var(--fs-sm); }
.pin-add-row { display: flex; gap: var(--space-8); }
.pin-input {
  flex: 1; min-width: 0; min-height: 40px; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 0 var(--space-12); border-radius: var(--r-md); font: inherit; font-size: var(--fs-sm);
}
.pin-input:focus { outline: none; border-color: var(--accent); }
.pin-go { min-width: 40px; min-height: 40px; }
.pin-tab.active { color: var(--accent); }
