/* RAO Board
   Look: a Trello-style board in warm, low-blue colours. A sidebar for the boards (no pill tabs),
   parchment lists, off-white cards with coloured labels.
   Type: the system UI font. Icons: Phosphor (MIT), self-hosted in /assets/icons and drawn with CSS masks.
   Shape rule: cards 8px, lists 12px, buttons 6px, chips and labels 4px. */

:root {
  /* Warm, low-blue palette: umber board, parchment lists, off-white cards, terracotta accent. */
  color-scheme: light;
  --board-1: #5c4f44;
  --board-2: #3d342d;
  --appbar: rgba(24, 17, 12, 0.42);
  --on-board: #f4ece2;
  --on-board-2: rgba(244, 236, 226, 0.78);
  --glass: rgba(244, 236, 226, 0.14);
  --glass-2: rgba(244, 236, 226, 0.24);
  --list: #ece5dc;
  --card: #f9f6f1;
  --ink: #2e2924;
  --ink-2: #554c44;
  --muted: #7b7168;
  --line: rgba(70, 50, 30, 0.16);
  --hover: rgba(70, 50, 30, 0.06);
  --press: rgba(70, 50, 30, 0.12);
  --blue: #a9542e;          /* the accent (kept the old name so components need no changes) */
  --blue-hover: #8e4524;
  --focus: #c4873b;
  --good: #5d8a50;
  --shadow: 0 1px 1px rgba(60, 40, 20, 0.22), 0 0 1px rgba(60, 40, 20, 0.3);
  --shadow-raised: 0 8px 14px rgba(60, 40, 20, 0.2), 0 0 1px rgba(60, 40, 20, 0.3);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Helvetica Neue", sans-serif;
  --list-w: 288px;
  --side-w: 208px;
  --appbar-h: 52px;
  --tabbar-h: 0px;
  --gutter: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Label colours: softened and warmed so nothing glows. */
  --l-green: #a9c99b; --l-yellow: #e9cf7d; --l-orange: #ebb08a; --l-red: #e39d90; --l-purple: #c6b5d6;
  --l-blue: #adbfd1; --l-sky: #b3d0cb; --l-lime: #c8d592; --l-pink: #e2b2c6; --l-gray: #dcd3c8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--appbar-h) auto;
  font: 14px/20px var(--font); color: var(--ink);
  background: linear-gradient(160deg, var(--board-1) 0%, var(--board-2) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, label, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: 6px; background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
main:focus { outline: none; }
.spacer { flex: 1; }

/* ---------- icons (CSS masks, so they take the text colour) ---------- */

.i { display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.i-arrow-square-out { --i: url("/assets/icons/arrow-square-out.svg"); }
.i-arrows-clockwise { --i: url("/assets/icons/arrows-clockwise.svg"); }
.i-barbell { --i: url("/assets/icons/barbell.svg"); }
.i-sneaker { --i: url("/assets/icons/sneaker.svg"); }
.i-bicycle { --i: url("/assets/icons/bicycle.svg"); }
.i-waves { --i: url("/assets/icons/waves.svg"); }
.i-fire { --i: url("/assets/icons/fire.svg"); }
.i-snowflake { --i: url("/assets/icons/snowflake.svg"); }
.i-avocado { --i: url("/assets/icons/avocado.svg"); }
.i-bowl-food { --i: url("/assets/icons/bowl-food.svg"); }
.i-bread { --i: url("/assets/icons/bread.svg"); }
.i-carrot { --i: url("/assets/icons/carrot.svg"); }
.i-cheese { --i: url("/assets/icons/cheese.svg"); }
.i-coffee { --i: url("/assets/icons/coffee.svg"); }
.i-cookie { --i: url("/assets/icons/cookie.svg"); }
.i-egg { --i: url("/assets/icons/egg.svg"); }
.i-fish { --i: url("/assets/icons/fish.svg"); }
.i-hamburger { --i: url("/assets/icons/hamburger.svg"); }
.i-ice-cream { --i: url("/assets/icons/ice-cream.svg"); }
.i-martini { --i: url("/assets/icons/martini.svg"); }
.i-orange-slice { --i: url("/assets/icons/orange-slice.svg"); }
.i-pint-glass { --i: url("/assets/icons/pint-glass.svg"); }
.i-pizza { --i: url("/assets/icons/pizza.svg"); }
.i-bell { --i: url("/assets/icons/bell.svg"); }
.i-calendar-blank { --i: url("/assets/icons/calendar-blank.svg"); }
.i-chat-circle-text { --i: url("/assets/icons/chat-circle-text.svg"); }
.i-check-circle { --i: url("/assets/icons/check-circle.svg"); }
.i-check { --i: url("/assets/icons/check.svg"); }
.i-clipboard-text { --i: url("/assets/icons/clipboard-text.svg"); }
.i-clock { --i: url("/assets/icons/clock.svg"); }
.i-cloud-fog { --i: url("/assets/icons/cloud-fog.svg"); }
.i-cloud-lightning { --i: url("/assets/icons/cloud-lightning.svg"); }
.i-cloud-moon { --i: url("/assets/icons/cloud-moon.svg"); }
.i-cloud-rain { --i: url("/assets/icons/cloud-rain.svg"); }
.i-cloud-snow { --i: url("/assets/icons/cloud-snow.svg"); }
.i-cloud-sun { --i: url("/assets/icons/cloud-sun.svg"); }
.i-cloud { --i: url("/assets/icons/cloud.svg"); }
.i-copy { --i: url("/assets/icons/copy.svg"); }
.i-desktop { --i: url("/assets/icons/desktop.svg"); }
.i-dots-three { --i: url("/assets/icons/dots-three.svg"); }
.i-drop { --i: url("/assets/icons/drop.svg"); }
.i-envelope-simple { --i: url("/assets/icons/envelope-simple.svg"); }
.i-eye-slash { --i: url("/assets/icons/eye-slash.svg"); }
.i-eye { --i: url("/assets/icons/eye.svg"); }
.i-flag { --i: url("/assets/icons/flag.svg"); }
.i-fork-knife { --i: url("/assets/icons/fork-knife.svg"); }
.i-bed { --i: url("/assets/icons/bed.svg"); }
.i-house { --i: url("/assets/icons/house.svg"); }
.i-kanban { --i: url("/assets/icons/kanban.svg"); }
.i-laptop { --i: url("/assets/icons/laptop.svg"); }
.i-list-checks { --i: url("/assets/icons/list-checks.svg"); }
.i-magnifying-glass { --i: url("/assets/icons/magnifying-glass.svg"); }
.i-map-pin { --i: url("/assets/icons/map-pin.svg"); }
.i-moon { --i: url("/assets/icons/moon.svg"); }
.i-navigation-arrow { --i: url("/assets/icons/navigation-arrow.svg"); }
.i-newspaper { --i: url("/assets/icons/newspaper.svg"); }
.i-note { --i: url("/assets/icons/note.svg"); }
.i-paper-plane-right { --i: url("/assets/icons/paper-plane-right.svg"); }
.i-pencil-simple { --i: url("/assets/icons/pencil-simple.svg"); }
.i-plus { --i: url("/assets/icons/plus.svg"); }
.i-sign-out { --i: url("/assets/icons/sign-out.svg"); }
.i-sparkle { --i: url("/assets/icons/sparkle.svg"); }
.i-sun { --i: url("/assets/icons/sun.svg"); }
.i-terminal-window { --i: url("/assets/icons/terminal-window.svg"); }
.i-text-align-left { --i: url("/assets/icons/text-align-left.svg"); }
.i-trash { --i: url("/assets/icons/trash.svg"); }
.i-warning { --i: url("/assets/icons/warning.svg"); }
.i-wind { --i: url("/assets/icons/wind.svg"); }
.i-x { --i: url("/assets/icons/x.svg"); }
.i-arrow-left { --i: url("/assets/icons/arrow-left.svg"); }
.i-key { --i: url("/assets/icons/key.svg"); }
.i-lock-simple { --i: url("/assets/icons/lock-simple.svg"); }
.i-brain { --i: url("/assets/icons/brain.svg"); }
.i-graph { --i: url("/assets/icons/graph.svg"); }
.i-upload-simple { --i: url("/assets/icons/upload-simple.svg"); }
.i-file-text { --i: url("/assets/icons/file-text.svg"); }
.i-arrow-counter-clockwise { --i: url("/assets/icons/arrow-counter-clockwise.svg"); }
.i-chat-circle-dots { --i: url("/assets/icons/chat-circle-dots.svg"); }
.i-lightbulb { --i: url("/assets/icons/lightbulb.svg"); }
.i-books { --i: url("/assets/icons/books.svg"); }
.i-x-circle { --i: url("/assets/icons/x-circle.svg"); }
.i-wine { --i: url("/assets/icons/wine.svg"); }
.i-camera { --i: url("/assets/icons/camera.svg"); }
.i-caret-right { --i: url("/assets/icons/caret-right.svg"); }
.i-scales { --i: url("/assets/icons/scales.svg"); }
.i-caret-left { --i: url("/assets/icons/caret-left.svg"); }
.i-caret-up { --i: url("/assets/icons/caret-up.svg"); }
.i-caret-down { --i: url("/assets/icons/caret-down.svg"); }
.i-chart-bar { --i: url("/assets/icons/chart-bar.svg"); }
.i-heartbeat { --i: url("/assets/icons/heartbeat.svg"); }
.i-lightning { --i: url("/assets/icons/lightning.svg"); }
.i-wrench { --i: url("/assets/icons/wrench.svg"); }
.i-minus { --i: url("/assets/icons/minus.svg"); }
.i-image { --i: url("/assets/icons/image.svg"); }
.i-battery-high { --i: url("/assets/icons/battery-high.svg"); }
.i-moon-stars { --i: url("/assets/icons/moon-stars.svg"); }
.i-link-simple { --i: url("/assets/icons/link-simple.svg"); }
.i-push-pin { --i: url("/assets/icons/push-pin.svg"); }
.i-tag { --i: url("/assets/icons/tag.svg"); }
.i-rows { --i: url("/assets/icons/rows.svg"); }
.i-device-mobile { --i: url("/assets/icons/device-mobile.svg"); }
.i-hash { --i: url("/assets/icons/hash.svg"); }
.i-sliders-horizontal { --i: url("/assets/icons/sliders-horizontal.svg"); }
.i-square { --i: url("/assets/icons/square.svg"); }
.i-check-square { --i: url("/assets/icons/check-square.svg"); }
.i-note-pencil { --i: url("/assets/icons/note-pencil.svg"); }
.i-bell-ringing { --i: url("/assets/icons/bell-ringing.svg"); }
.i-calendar-dots { --i: url("/assets/icons/calendar-dots.svg"); }


/* ---------- sidebar (the boards) ---------- */

.side {
  grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 0; height: 100dvh; z-index: 25;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 0 16px;
  background: rgba(20, 14, 10, 0.4); color: var(--on-board); border-right: 1px solid rgba(244, 236, 226, 0.08);
}
.brand { display: flex; align-items: baseline; gap: 6px; padding: 8px 18px 16px; font-weight: 800; letter-spacing: 0.12em; font-size: 15px; color: var(--on-board); text-decoration: none; }
.brand-name { font-weight: 500; letter-spacing: 0.02em; color: var(--on-board-2); }
.brand-mobile { display: none; }
.side-list { display: flex; flex-direction: column; }
.side-item {
  appearance: none; border: 0; cursor: pointer; position: relative; width: 100%;
  display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 18px;
  background: transparent; color: var(--on-board-2); font-weight: 500; text-align: left;
}
.side-item .i { width: 18px; height: 18px; }
.side-item:hover { color: var(--on-board); background: rgba(244, 236, 226, 0.06); }
.side-item[aria-selected="true"] { color: var(--on-board); background: rgba(244, 236, 226, 0.1); font-weight: 600; }
.side-item[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: #e8b96a; }
.side-label { flex: 1; }
.side-count { font-size: 12px; font-weight: 700; color: #e8b96a; font-variant-numeric: tabular-nums; }
.side-note { margin-top: auto; padding: 0 18px; font-size: 12px; line-height: 17px; color: var(--on-board-2); }

/* ---------- app bar: weather and actions ---------- */

.appbar {
  grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 20; height: var(--appbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter);
  background: var(--appbar); color: var(--on-board);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
main { grid-column: 2; grid-row: 2; min-width: 0; }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.appbar-btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border-radius: 6px; background: transparent; color: var(--on-board); font-weight: 500;
}
.appbar-btn:hover { background: var(--glass); }
.appbar-icon { width: 32px; padding: 0; justify-content: center; }
.appbar-add { background: var(--blue); color: #fbf3ea; margin: 0 4px; }
.appbar-add:hover { background: var(--blue-hover); }
.appbar-btn:disabled { cursor: default; opacity: 0.8; }
.appbar-btn.is-busy .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.refresh-status { color: var(--on-board-2); font-size: 12px; white-space: nowrap; margin-right: 2px; }

/* ---------- board ---------- */

.view { display: flex; flex-direction: column; height: calc(100dvh - var(--appbar-h) - var(--tabbar-h) - env(safe-area-inset-bottom)); }
.view[hidden] { display: none; }
.board-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 12px var(--gutter) 10px; color: var(--on-board); background: rgba(0, 0, 0, 0.12);
}
.board-title { font-size: 18px; line-height: 32px; font-weight: 700; padding: 0 6px; border-radius: 6px; }
.board-sub { flex: 1 1 320px; min-width: 0; font-size: 14px; opacity: 0.92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar-btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  padding: 6px 12px; border-radius: 6px; background: var(--glass); color: var(--on-board); font-weight: 500;
}
.bar-btn:hover { background: var(--glass-2); }
.board-bar .chips { margin-left: 8px; }
.board-bar .chip { color: var(--on-board-2); }
.board-bar .chip:hover { color: var(--on-board); }
.board-bar .chip[aria-pressed="true"] { color: var(--on-board); border-bottom-color: #e8b96a; }
.search { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 32px; border-radius: 6px; background: var(--glass); color: var(--on-board); }
.search input { border: 0; background: transparent; color: var(--on-board); width: 200px; outline: none; }
.search input::placeholder { color: var(--on-board-2); }
.search:focus-within { background: var(--card); color: var(--ink); }
.search:focus-within input { color: var(--ink); }

.banner { margin: 12px var(--gutter) 0; padding: 10px 14px; border-radius: 8px; background: #f3e3bd; color: #6b4e12; font-weight: 500; box-shadow: var(--shadow); }

.lists {
  flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px var(--gutter) 16px; overflow-x: auto; overflow-y: hidden;
  scroll-padding: 0 var(--gutter);
}
.list-group { display: contents; }

.list {
  flex: none; width: var(--list-w); max-height: 100%;
  display: flex; flex-direction: column; background: var(--list); border-radius: 12px;
  box-shadow: var(--shadow); padding-bottom: 4px;
}
.list-wide { width: 360px; }
.list-news { width: 320px; }
.list.is-over { outline: 2px solid var(--focus); outline-offset: -2px; background: #f2e6d6; }
.list-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 12px; min-height: 40px; }
.list-head-stack { flex-wrap: wrap; }
.list-head-stack .chips { width: 100%; }
.list-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.list-title .i { color: var(--ink-2); }
.list-count { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; line-height: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-count:empty { display: none; }
.list-meta { font-size: 12px; color: var(--muted); }
.list-note { padding: 0 12px 6px; font-size: 12px; color: var(--muted); }
.list-act { appearance: none; border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: transparent; color: var(--ink-2); }
.list-act:hover { background: var(--press); }
.list-act.is-on { color: var(--blue); }
.list-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 4px; display: flex; flex-direction: column; gap: 8px; }
.list-foot { padding: 4px 8px 4px; }
.foot-meta { font-size: 12px; color: var(--muted); padding: 2px 4px 6px; }
.foot-actions { display: flex; gap: 4px; }
.add-card {
  appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 500; text-decoration: none; text-align: left;
}
.add-card:hover { background: var(--press); color: var(--ink); }
.add-card-icon { width: auto; flex: none; }
.list-toggle { padding: 0 2px; }
.link-btn { appearance: none; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px; border-radius: 4px; }
.link-btn:hover { color: var(--ink); background: var(--hover); }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- cards ---------- */

.tcard { position: relative; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); color: var(--ink); }
.tcard-main {
  appearance: none; border: 0; background: transparent; text-align: left; width: 100%;
  display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 8px; color: inherit; text-decoration: none; border-radius: 8px;
}
button.tcard-main, a.tcard-main { cursor: pointer; }
button.tcard-main:hover, a.tcard-main:hover { background: #f3eee7; }
.tcard:has(> button.tcard-main:hover, > a.tcard-main:hover) { box-shadow: 0 0 0 2px var(--focus); }
.tcard-title { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.tcard-title-news { font-weight: 500; }
.tcard-kicker { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tcard-text { font-size: 12px; line-height: 16px; color: var(--ink-2); overflow-wrap: anywhere; }
.tcard-text strong, .tcard-quote strong { font-weight: 600; color: var(--ink); }
.tcard-quote { font-size: 12px; line-height: 16px; color: var(--ink-2); background: var(--list); border-radius: 4px; padding: 4px 8px; overflow-wrap: anywhere; }
.tcard-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; display: grid; gap: 8px; justify-items: start; }
.tcard-status, .tcard-warn { padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.tcard-warn { color: #9a3a26; }
.tcard-actions { display: flex; gap: 6px; padding: 0 12px 10px; }
.tcard-tools { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.tcard:hover .tcard-tools, .tcard:focus-within .tcard-tools { opacity: 1; }
.tool {
  appearance: none; border: 0; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center;
  background: var(--card); color: var(--muted); box-shadow: 0 0 0 1px var(--line); text-decoration: none;
}
.tool:hover { color: var(--ink); background: #f1ebe3; }
@media (hover: none) {
  .tcard-tools { opacity: 1; }
  .tcard:has(> .tcard-tools) > .tcard-main { padding-right: 40px; }
  .tcard:has(> .tcard-tools > .tool + .tool) > .tcard-main { padding-right: 70px; }
  .tcard:has(> .tcard-tools > .tool + .tool + .tool) > .tcard-main { padding-right: 100px; }
}
.tcard-pinned { box-shadow: var(--shadow), inset 3px 0 0 var(--blue); }
.tcard[draggable="true"] { cursor: grab; }
.tcard.is-dragging { opacity: 0.5; transform: rotate(3deg); box-shadow: var(--shadow-raised); }
.tcard.is-done .tcard-title { color: var(--muted); text-decoration: line-through; }
.tcard-total { padding: 8px 12px; display: grid; gap: 2px; background: #efe2d2; }
.tcard-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; }
.tcard-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.tcard-row label { cursor: pointer; flex: 1; }
.tcard-row.is-done label { color: var(--muted); text-decoration: line-through; }
.tcard-row .tool { flex: none; }
.tcard-row .grocery-add { flex: 1; width: auto; height: auto; padding-left: 0; cursor: text; font-size: 14px; }
.tcard-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.stat-name { color: var(--ink-2); font-size: 13px; }
.stat-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-val small { font-size: 12px; font-weight: 500; color: var(--muted); }
.prose { padding: 8px 12px; white-space: pre-wrap; font-size: 13px; color: var(--ink-2); }

/* Completion circle (Trello-style), shown on hover or when done */
.tcard-check { display: flex; align-items: flex-start; }
.tcard-check .tcard-main { padding-left: 4px; }
.check-btn {
  appearance: none; flex: none; cursor: pointer; margin: 10px 0 0 10px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #a59a8e; background: var(--card); display: grid; place-items: center; color: transparent; padding: 0;
}
.check-btn .i { width: 12px; height: 12px; }
.check-btn:hover { border-color: var(--blue); color: var(--blue); }
.check-btn.is-on { background: var(--good); border-color: var(--good); color: #fbf3ea; }

/* labels and badges */
.labels { display: flex; flex-wrap: wrap; gap: 4px; }
.label { display: inline-block; max-width: 100%; padding: 0 8px; border-radius: 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink); background: var(--l-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-green { background: var(--l-green); } .label-yellow { background: var(--l-yellow); } .label-orange { background: var(--l-orange); }
.label-red { background: var(--l-red); } .label-purple { background: var(--l-purple); } .label-blue { background: var(--l-blue); }
.label-sky { background: var(--l-sky); } .label-lime { background: var(--l-lime); } .label-pink { background: var(--l-pink); } .label-gray { background: var(--l-gray); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; color: var(--ink-2); border-radius: 3px; }
.badge .i { width: 14px; height: 14px; }
.badge.is-done { background: var(--good); color: #fbf3ea; padding: 0 4px; }
.badge.is-live { background: var(--l-green); color: var(--ink); padding: 0 6px; font-weight: 600; }

/* chips */
/* Filters read as plain words; the chosen one is underlined. */
.chips { display: flex; flex-wrap: nowrap; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; border: 0; cursor: pointer; white-space: nowrap; padding: 4px 0 3px; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 18px; border-bottom: 2px solid transparent;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.chip-count { margin-left: 6px; opacity: 0.75; }

/* buttons */
.btn { appearance: none; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 4px; font-weight: 500; line-height: 20px; white-space: nowrap; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-blue { background: var(--blue); color: #fbf3ea; }
.btn-blue:hover { background: var(--blue-hover); }
.btn-ghost { background: var(--press); color: var(--ink); }
.btn-ghost:hover { background: rgba(70, 50, 30, 0.2); }
.btn-danger { background: #f2d9d1; color: #8e3622; }
.btn-danger:hover { background: #ebc7bb; }
.btn-sm { padding: 2px 8px; font-size: 12px; }
.btn-sm .i { width: 14px; height: 14px; }
.icon-btn { appearance: none; border: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--press); }

/* composer (add a card) */
.composer { display: grid; gap: 8px; }
.composer textarea, .composer input, .composer select {
  width: 100%; border: 0; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); padding: 8px 12px; resize: none; color: var(--ink);
}
.composer textarea:focus, .composer input:focus, .composer select:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-row input, .composer-row select { flex: 1; min-width: 0; height: 34px; padding: 4px 8px; }
.composer textarea::placeholder { color: var(--muted); }

/* weather */
.wx-now { padding: 12px; display: grid; gap: 10px; }
.wx-top { display: flex; align-items: center; gap: 10px; }

.wx-temp { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -0.02em; }
.wx-desc { min-width: 0; }
.wx-text { font-weight: 600; }
.wx-feels { font-size: 12px; color: var(--ink-2); }
.wx-outlook { padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-weight: 500; color: #216e4e; }
.wx-outlook.is-wet { color: #0055cc; }
.wx-hours { padding: 4px 12px; }
.wx-hour { display: grid; grid-template-columns: 44px 20px 36px 36px 1fr; align-items: center; gap: 6px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.wx-hour + .wx-hour { border-top: 1px solid var(--line); }
.wx-h-time { color: var(--ink-2); font-size: 13px; }
.wx-h-temp { font-weight: 600; }
.wx-h-rain { font-size: 12px; color: var(--muted); text-align: right; }
.wx-h-rain.is-wet { color: var(--blue); font-weight: 600; }
.wx-bar { height: 4px; border-radius: 2px; background: var(--list); overflow: hidden; }
.wx-bar span { display: block; height: 100%; background: var(--l-blue); }
.wx-src { padding: 0 4px; }

/* chat */
.chat-log { gap: 8px; }
.msg { max-width: 88%; display: grid; gap: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 20px; padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.msg-user { align-self: flex-end; }
.msg-user .msg-text { background: #6e5442; color: #fbf3ea; }
.msg-user .msg-time { text-align: right; }
.msg-claude { align-self: flex-start; }
.msg-claude .msg-text { background: var(--card); color: var(--ink); }
.msg.is-error .msg-text { color: #9a3a26; }
.msg-time { font-size: 11px; color: var(--muted); padding: 0 4px; }
.msg-logged { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--good); padding: 0 4px; }
.is-pending .msg-text { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--blue); animation: spin 0.8s linear infinite; flex: none; }
.chat-form textarea { min-height: 56px; }

/* forms in cards */
.log-form { padding: 10px 12px 12px; display: grid; gap: 10px; }
.field { display: grid; gap: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; padding: 6px 8px; border-radius: 4px; border: 1px solid #a59a8e; background: var(--card); color: var(--ink); min-height: 34px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.help { font-size: 12px; color: var(--muted); }
.form-error { color: #9a3a26; font-weight: 500; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.pairs { display: grid; padding: 4px 12px; }
.pairs > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.pairs > div + div { border-top: 1px solid var(--line); }
.pairs dt { color: var(--ink-2); }
.pairs dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* skeleton */
.skeleton { height: 120px; background: linear-gradient(90deg, var(--card), #efe8de, var(--card)); }

/* training */
.list-day.is-today { box-shadow: var(--shadow), inset 0 3px 0 var(--blue); }

/* ---------- weather strip (top bar) ---------- */

.wx-strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 0 8px; font-size: 13px; color: var(--on-board); }
.wx-strip::-webkit-scrollbar { display: none; }
.wx-place { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; background: transparent; color: var(--on-board); font-weight: 600; white-space: nowrap; }
.wx-place:hover { background: var(--glass); }
.wx-place.is-on .i { color: #e8b96a; }
.wx-now { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding-right: 10px; border-right: 1px solid var(--glass-2); }
.wx-now .i { width: 20px; height: 20px; color: #e8b96a; }
.wx-now strong { font-size: 16px; }
.wx-now-text { color: var(--on-board-2); }
.wx-strip .wx-hours { display: flex; gap: 16px; padding: 0; }
.wx-strip .wx-hour { display: inline-flex; align-items: center; gap: 5px; padding: 0; white-space: nowrap; font-variant-numeric: tabular-nums; border: 0; }
.wx-strip .wx-hour .i { width: 14px; height: 14px; color: var(--on-board-2); }
.wx-strip .wx-h-time { color: var(--on-board-2); font-size: 12px; }
.wx-strip .wx-h-temp { font-weight: 600; }
.wx-strip .wx-h-rain { font-size: 11px; color: #e9cf9a; }
.wx-strip .wx-hour.is-wet .wx-h-temp { color: #e9cf9a; }
.wx-err { color: var(--on-board-2); }

/* ---------- home header: summary line and top stories ---------- */

.board-bar-home { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; min-width: 0; }
.board-bar-home > * { min-width: 0; max-width: 100%; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 0 6px; font-size: 14px; color: var(--on-board-2); }
.sum-link {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 2px 0; font: inherit; color: var(--on-board);
  text-decoration: underline; text-decoration-color: rgba(244, 236, 226, 0.35); text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.sum-link:hover { text-decoration-color: currentColor; }
.sum-link strong { font-weight: 700; }
.sum-link.is-alert strong { color: #f3a487; }
.sum-link.is-warn strong { color: #e8b96a; }
.sum-sep { color: var(--on-board-2); }
.ticker { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; padding: 6px 0 2px; border-top: 1px solid var(--glass); }
.ticker-label { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #e8b96a; }
.ticker-window { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; width: max-content; gap: 32px; animation: ticker 90s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.ticker-item a { color: var(--on-board); text-decoration: none; font-weight: 500; }
.ticker-item a:hover { text-decoration: underline; }
.ticker-time { font-size: 12px; color: var(--on-board-2); }
@media (prefers-reduced-motion: reduce) {
  .ticker-window { overflow-x: auto; }
  .ticker-track { animation: none; }
}

/* subscriptions card in News */
.subs { padding: 10px 12px; display: grid; gap: 8px; }
.subs .tcard-kicker { display: flex; align-items: center; gap: 6px; }
.subs-list { display: grid; gap: 6px; }
.subs-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.subs-name { font-weight: 600; text-decoration: none; }
.subs-name:hover { text-decoration: underline; }

/* ---------- detail panel (drawer) ---------- */

.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(580px, 100vw); max-width: 100vw;
  padding: 0; border: 0; border-radius: 12px 0 0 12px; background: var(--list); color: var(--ink);
  box-shadow: -12px 0 40px rgba(30, 20, 10, 0.35); overscroll-behavior: contain;
}
.drawer[open] { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: slide-in 0.22s var(--ease); }
  @keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; line-height: 24px; overflow-wrap: anywhere; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: grid; align-content: start; gap: 10px; }
.drawer-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-foot .composer { width: 100%; }
.drawer-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 6px; }
.muted-p { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.mail-head { display: grid; gap: 4px; }
.mail-from { font-size: 14px; overflow-wrap: anywhere; }
.mail-when { font-size: 12px; color: var(--muted); }
.mail-summary { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: #efe2d2; color: var(--ink-2); font-size: 13px; }
.mail-summary .i { margin-top: 2px; color: var(--blue); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 14px; line-height: 21px; }
.sess-head { display: grid; gap: 6px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.transcript .msg { max-width: 92%; }
.transcript .msg-text { font-size: 13.5px; line-height: 20px; }
.drawer-composer textarea { min-height: 64px; }
.cap-preview { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 13px; color: var(--ink-2); }
.cap-preview .i { color: var(--blue); }
.capture-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- dismiss: why? ---------- */

.why-head { display: grid; gap: 8px; }
.why-item {
  font-size: 13px; line-height: 18px; color: var(--ink-2); background: var(--card); border-radius: 6px; padding: 8px 10px; box-shadow: var(--shadow);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.why-reasons { display: grid; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.why-reason {
  appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: transparent; text-align: left; color: var(--ink); font-weight: 500;
}
.why-reason + .why-reason { border-top: 1px solid var(--line); }
.why-reason:hover { background: #f3eee7; }
.why-reason[aria-checked="true"] { background: #f3e3d3; box-shadow: inset 3px 0 0 var(--blue); }
.why-reason:focus-visible { outline-offset: -2px; }
.why-key {
  flex: none; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums;
}
.why-reason[aria-checked="true"] .why-key { background: var(--blue); color: #fbf3ea; box-shadow: none; }
.opt { font-weight: 400; color: var(--muted); }
.why .editor-actions .help { max-width: 170px; line-height: 16px; }

/* ---------- brain ---------- */

.ask {
  flex: 1 1 340px; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 3px 0 12px;
  border-radius: 8px; background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.ask .i { color: var(--blue); }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.ask input::placeholder { color: var(--muted); }
.ask:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.ask-go { appearance: none; border: 0; cursor: pointer; height: 30px; padding: 0 14px; border-radius: 6px; background: var(--blue); color: #fbf3ea; font-weight: 600; }
.ask-go:hover { background: var(--blue-hover); }
#view-brain .board-bar .bar-btn { margin-left: 0; }
.list-map { width: min(660px, calc(100vw - var(--side-w) - 2 * var(--gutter))); height: 100%; }
.map-wrap { flex: 1 1 auto; min-height: 300px; margin: 0 8px 4px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.map { display: block; font-family: var(--font); }
/* Arcade Line map: square nodes, ink hairlines, the picked topic in the signal colour with a hard shadow */
.map-link { stroke: var(--ink); stroke-width: 1; opacity: 0.35; }
.map-link.is-on { stroke: var(--signal); stroke-width: 2; opacity: 1; }
.map-twig { stroke: var(--ink); stroke-width: 1; opacity: 0.2; }
.map-twig.is-on { stroke: var(--signal); opacity: 0.8; }
.map-you { fill: #EFEBE1; stroke: var(--ink); stroke-width: 2; }
.map-harry { image-rendering: pixelated; pointer-events: none; }
.map-you-text { fill: var(--card); font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none; }
.map-empty { fill: var(--muted); font-size: 13px; }
.map-topic, .map-group { cursor: pointer; outline: none; }
.map-box { fill: var(--card); stroke: var(--edge); stroke-width: 1.5; }
.map-topic.is-on .map-box { fill: var(--signal); stroke: var(--ink); }
.map-shadow { fill: var(--ink); }
.map-topic:hover .map-box { stroke: var(--ink); stroke-width: 2.5; }
.map-count { fill: var(--ink); font-family: var(--mono); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; pointer-events: none; }
.map-topic.is-on .map-count { fill: var(--on-signal); }
.map-name { fill: var(--ink); font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: miter; }
.map-dot { fill: var(--muted); }
.map-group.is-on .map-dot { fill: var(--signal); }
.map-group text { fill: var(--ink-2); font-size: 12px; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: miter; }
.map-group:not(.is-on) { opacity: 0.72; }
.map-group:hover, .map-group:focus-visible { opacity: 1; }
.map-group:hover text, .map-group:focus-visible text { fill: var(--ink); text-decoration: underline; }
.map-topic:focus-visible .map-box { stroke: var(--focus); stroke-width: 3; }
.list-facts { width: 340px; }
.fact-group { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); scroll-margin-top: 4px; }
.fact-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--signal); }
.badge-btn { appearance: none; border: 0; background: none; cursor: pointer; padding: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.badge-btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.clamp-3, .clamp-4 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { -webkit-line-clamp: 3; }
.clamp-4 { -webkit-line-clamp: 4; }
.answer { font-size: 14.5px; line-height: 22px; }
.learned { display: grid; gap: 6px; }
.learned-topic { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.learned-list { display: grid; gap: 8px; padding-left: 16px; }
.learned-list li { font-size: 13px; line-height: 18px; color: var(--ink); display: grid; gap: 1px; }
.learned-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.learned-quote { font-size: 12px; color: var(--muted); font-style: italic; }
.source-text { font-size: 13px; line-height: 19px; }
.imp-panel { display: grid; gap: 14px; }
#imp-text { min-height: 200px; }
.imp-chats { display: grid; gap: 8px; }
.search-light { margin-left: 0; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.search-light input { color: var(--ink); width: 100%; }
.search-light input::placeholder { color: var(--muted); }
.imp-chat-list { max-height: 260px; overflow-y: auto; display: grid; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
.imp-chat-list li + li { border-top: 1px solid var(--line); }
.imp-chat-list .muted-p { padding: 10px 12px; }
.check.imp-chat { display: grid; grid-template-columns: 16px 1fr; gap: 2px 10px; padding: 8px 12px; width: 100%; }
.imp-chat input { grid-row: span 2; align-self: center; }
.imp-chat-title { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.imp-chat-meta { font-size: 12px; color: var(--muted); }
.ask-again .composer-row input { height: 36px; }

/* ---------- nutrition: food diary (MyFitnessPal / MacroFactor style) ---------- */

#view-nutrition .bar-btn + .bar-btn { margin-left: 0; }
.bar-btn-strong { background: #e8b96a; color: #2e2215; font-weight: 600; }
.bar-btn-strong:hover { background: #f0c98a; }
.list-diary { width: 420px; }
.day-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.day-nav-label { appearance: none; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); padding: 4px 6px; border-radius: 4px; min-width: 84px; }
.day-nav-label:hover { background: var(--hover); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }

.diary-sum { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding: 14px 14px 12px; }
.sum-ring { position: relative; width: 112px; height: 112px; }
.kcal-ring { width: 112px; height: 112px; display: block; }
.ring-track { fill: none; stroke: #e6dccf; stroke-width: 10; }
.ring-fill { fill: none; stroke: var(--blue); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.5s var(--ease); }
.ring-fill.is-over { stroke: #9a3a26; }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-text strong { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-text small { font-size: 11px; color: var(--muted); }
.diary-main { display: grid; gap: 8px; min-width: 0; }
.eq { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.eq-part { display: grid; line-height: 1.1; }
.eq-part strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.eq-part small { font-size: 11px; color: var(--muted); }
.eq-part.is-over strong { color: #9a3a26; }
.eq-op { color: var(--muted); padding-bottom: 12px; }
.sum-note { font-size: 12px; color: var(--ink-2); }
.mbars { display: grid; gap: 7px; }
.mbar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.mbar-name { font-weight: 600; }
.mbar-val { font-variant-numeric: tabular-nums; }
.mbar-val small { color: var(--muted); }
.mbar-track { position: relative; height: 6px; border-radius: 3px; background: #e6dccf; overflow: hidden; margin-top: 3px; }
.mbar-zone { position: absolute; top: 0; bottom: 0; background: rgba(93, 138, 80, 0.28); }
.mbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; transition: width 0.4s var(--ease); }
.mbar-fill.is-protein { background: var(--blue); }
.mbar-fill.is-carbs { background: #c99a3f; }
.mbar-fill.is-fat { background: #7d8f5a; }
.mbar-left { font-size: 11px; color: var(--muted); margin-top: 2px; }

.diary-add { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.add-way {
  appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-align: left; min-width: 0;
}
.add-way:hover { background: #fffdf9; box-shadow: var(--shadow-raised); }
.add-way .i { flex: none; width: 20px; height: 20px; color: var(--blue); }
.add-way span:last-child { display: grid; min-width: 0; }
.add-way strong { font-size: 13px; }
.add-way small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.meal-block { background: var(--card); border-radius: 8px; box-shadow: var(--shadow); }
.meal-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; min-height: 40px; }
.meal-head h3 { font-size: 14px; font-weight: 600; }
.meal-kcal { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: auto; padding-left: 4px; }
.meal-add { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); }
.meal-add .i { width: 16px; height: 16px; }
.food-list { border-top: 1px solid var(--line); }
.food-row { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.food-row + .food-row { border-top: 1px solid var(--line); }
.food-row-main { appearance: none; border: 0; background: none; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 12px; text-align: left; color: var(--ink); }
.food-row-main:hover { background: var(--hover); }
.food-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: var(--list); }
.food-row-text { flex: 1; min-width: 0; display: grid; }
.food-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.food-kcal { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.food-row .tool { opacity: 0; transition: opacity 0.15s; }
.food-row:hover .tool, .food-row:focus-within .tool { opacity: 1; }
@media (hover: none) { .food-row .tool { opacity: 1; } }
.legacy-day { display: grid; gap: 2px; padding: 8px 40px 8px 12px; background: #f3ead9; }

.trend-card { padding: 10px 10px 8px; }
.trend-chart { width: 100%; height: auto; display: block; }
.trend-chart .bar-on { fill: var(--good); }
.trend-chart .bar-over { fill: var(--signal); }
.trend-chart .bar-under { fill: #d8b77a; }
.trend-chart .goal-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.trend-day { font-size: 10px; fill: var(--muted); }
.trend-day.is-today { fill: var(--ink); font-weight: 700; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); padding: 4px 2px 0; }
.lg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.lg-on::before { background: var(--good); }
.lg-over::before { background: var(--signal); }
.lg-under::before { background: #d8b77a; }
.lg-goal::before { height: 2px; width: 10px; background: var(--ink); vertical-align: 2px; }
.weigh-card { display: grid; gap: 8px; padding: 10px 12px; list-style: none; }
.weigh-now { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; }
.weigh-now strong { font-size: 18px; }
.weigh-now small { color: var(--muted); }
.weigh-delta { width: 100%; font-size: 12px; color: #9a5a26; }
.weigh-delta.is-down { color: var(--good); }
.weigh-form { display: flex; align-items: center; gap: 6px; }
.weigh-form label { font-size: 13px; font-weight: 600; margin-right: 4px; }
.weigh-form input { width: 72px; }

.plan-meal { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.plan-meal .tcard-main { flex: 1; min-width: 0; }
.plan-meal.is-done .tcard-title { color: var(--muted); }
.btn-soft { background: #f1e3d6; color: var(--blue); }
.btn-soft:hover { background: #ead4c2; }
.plan-log { padding: 4px 10px; font-size: 12px; }
.plan-log .i { width: 14px; height: 14px; }

/* add-food dialog */
.editor.food-dialog { width: min(540px, calc(100vw - 24px)); }
.food-panel { display: grid; gap: 10px; }
.food-shot {
  appearance: none; border: 2px dashed var(--line); border-radius: 12px; background: var(--card); cursor: pointer; padding: 0;
  min-height: 180px; display: grid; place-items: center; overflow: hidden; color: var(--ink-2);
}
.food-shot:hover { border-color: var(--focus); }
.food-shot img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.food-shot-empty { display: grid; justify-items: center; gap: 8px; font-weight: 500; }
.food-shot-empty .i { width: 32px; height: 32px; color: var(--blue); }
.food-reading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); background: var(--card); border-radius: 8px; padding: 8px 12px; }
.food-items { display: grid; gap: 6px; }
.food-items:empty { display: none; }
.fitem { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 6px 6px 6px 10px; }
.fitem-main { flex: 1; min-width: 0; display: grid; }
.fitem-name { border: 0; background: transparent; font-weight: 600; font-size: 14px; padding: 2px 0; color: var(--ink); min-width: 0; border-radius: 4px; }
.fitem-name:focus { outline: 2px solid var(--focus); background: #fff; }
.fitem-sub { font-size: 11px; color: var(--muted); }
.stepper { display: flex; align-items: center; background: var(--list); border-radius: 6px; }
.stepper .icon-btn { width: 28px; height: 28px; }
.stepper-val { font-size: 12px; font-weight: 600; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.fitem-kcal { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; font-size: 14px; }
.food-fix { display: flex; gap: 6px; }
.food-fix input { flex: 1; min-width: 0; }
.food-actions { flex-wrap: wrap; }
.food-meal select { font-weight: 600; }
.food-total { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.field-row-4 { grid-template-columns: repeat(4, 1fr); }
.fe-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
@media (max-width: 760px) {
  .list-diary { width: calc(100vw - 40px); }
  .diary-sum { grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; }
  .sum-ring, .kcal-ring { width: 96px; height: 96px; }
  .ring-text strong { font-size: 19px; }
  .add-way { flex-direction: column; align-items: flex-start; gap: 4px; }
  .add-way small { display: none; }
  .field-row-4 { grid-template-columns: repeat(2, 1fr); }
  .food-shot { min-height: 140px; }
  .editor.food-dialog { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .food-actions .btn { flex: 1; }
  .food-dialog form { padding: 16px 16px calc(12px + env(safe-area-inset-bottom)); }
  .fitem { flex-wrap: wrap; row-gap: 4px; }
  .fitem-main { flex: 1 1 100%; }
  .fitem-kcal { margin-left: auto; }
}

/* ---------- training: today and readiness (TrainingPeaks / Garmin style) ---------- */

.list-today { width: 320px; }
.ready { padding: 12px; display: grid; gap: 6px; box-shadow: var(--shadow), inset 3px 0 0 var(--good); }
.ready-fair { box-shadow: var(--shadow), inset 3px 0 0 #c99a3f; }
.ready-poor { box-shadow: var(--shadow), inset 3px 0 0 #9a3a26; }
.ready-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.ready-head .i { color: var(--good); width: 20px; height: 20px; }
.ready-fair .ready-head .i { color: #c99a3f; }
.ready-poor .ready-head .i { color: #9a3a26; }
.ready-text { font-size: 12px; color: var(--ink-2); }
.ready-sig { display: grid; gap: 6px; margin-top: 4px; }
.sig { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; padding-left: 10px; position: relative; }
.sig::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.sig-fair::before { background: #c99a3f; }
.sig-poor::before { background: #9a3a26; }
.sig-name { font-size: 13px; }
.sig-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.sig-val small { font-weight: 500; color: var(--muted); }
.sig-note { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.fuel .tcard-kicker { display: inline-flex; align-items: center; gap: 4px; }
.fuel .tcard-kicker .i { width: 14px; height: 14px; }
.tcard.is-missed { box-shadow: var(--shadow), inset 3px 0 0 #c9776a; }

/* ---------- mid-size screens: the sidebar becomes a rail ---------- */

@media (max-width: 1179px) and (min-width: 761px) {
  :root { --side-w: 76px; }
  .brand { justify-content: center; padding: 8px 0 14px; }
  .brand-name, .side-note { display: none; }
  .side-item { flex-direction: column; gap: 4px; padding: 10px 2px; font-size: 11px; text-align: center; }
  .side-item .i { width: 20px; height: 20px; }
  .side-label { flex: none; }
  .side-count { position: absolute; top: 5px; left: calc(50% + 10px); font-size: 11px; }
}

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 8px; max-width: calc(100vw - 24px);
  background: #2e2924; color: #f4ece2; font-weight: 500; box-shadow: var(--shadow-raised);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-btn { appearance: none; border: 0; cursor: pointer; padding: 4px 12px; border-radius: 4px; background: rgba(244, 236, 226, 0.16); color: #f4ece2; font-weight: 600; }
.toast-btn:hover { background: rgba(244, 236, 226, 0.28); }

/* ---------- dialogs ---------- */

.editor {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 12px;
  background: var(--list); color: var(--ink); box-shadow: 0 12px 40px rgba(30, 20, 10, 0.4); overscroll-behavior: contain;
}
.editor-wide { width: min(780px, calc(100vw - 24px)); }
.editor-narrow { width: min(440px, calc(100vw - 24px)); }
.editor::backdrop, .drawer::backdrop { background: rgba(30, 20, 10, 0.5); }
.editor form { display: grid; gap: 14px; padding: 20px 24px; }
.editor h2 { font-size: 20px; font-weight: 600; }
.plan-fields { display: grid; gap: 16px; }
.plan-fields textarea { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.plan-group { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.plan-group legend { font-weight: 600; font-size: 15px; padding: 0 0 6px; }
.day-edit { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.target-edit { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.editor-actions { display: flex; align-items: center; gap: 8px; position: sticky; bottom: -20px; padding: 12px 0 4px; background: var(--list); }

/* ---------- login ---------- */

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(380px, 100%); background: var(--card); border-radius: 12px; box-shadow: var(--shadow-raised); padding: 32px 28px; }
.login h1 { font-size: 24px; font-weight: 700; }
.login-sub { margin-top: 4px; color: var(--muted); }
.login form { display: grid; gap: 14px; margin-top: 24px; }
.btn-primary { background: var(--blue); color: #fbf3ea; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-block { width: 100%; padding: 8px 12px; }

/* ---------- phones: lists one at a time, swipe sideways; tabs at the bottom ---------- */

@media (max-width: 760px) {
  :root { --tabbar-h: 60px; --appbar-h: 48px; --side-w: 0px; }
  body { grid-template-columns: minmax(0, 1fr); }
  .appbar, main { grid-column: 1; }
  .appbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #2f2822; }
  .side {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 30;
    grid-column: auto; grid-row: auto; flex-direction: row; padding: 0 0 env(safe-area-inset-bottom);
    background: #2a231e; border-right: 0; border-top: 1px solid rgba(244, 236, 226, 0.1);
  }
  .side .brand, .side-note { display: none; }
  .side-list { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
  .side-item { flex-direction: column; justify-content: center; gap: 3px; padding: 6px 0; font-size: 11px; text-align: center; }
  .side-item .i { width: 22px; height: 22px; }
  .side-item:hover { background: transparent; }
  .side-item[aria-selected="true"] { background: transparent; color: #f0c98a; }
  .side-item[aria-selected="true"]::before { left: 32%; right: 32%; top: 0; bottom: auto; width: auto; height: 3px; }
  .side-label { flex: none; }
  .side-count { position: absolute; top: 4px; left: calc(50% + 9px); font-size: 10px; }
  .brand-mobile { display: inline-flex; padding: 6px 4px; }
  .refresh-status, .appbar-btn-label { display: none; }
  .appbar { gap: 6px; padding: 0 8px; }
  .appbar-add { width: 32px; padding: 0; justify-content: center; margin: 0; }
  .wx-strip { gap: 6px; padding: 0 2px; }
  .wx-now-text { display: none; }
  .drawer { width: 100vw; border-radius: 0; }
  .summary { padding: 0; font-size: 13px; }
  .board-bar { padding: 8px 12px; gap: 6px 10px; }
  .board-title { font-size: 16px; padding: 0; }
  .board-sub { font-size: 13px; width: 100%; order: 3; }
  .board-bar .chips { margin-left: 0; width: 100%; order: 4; }
  .search { margin-left: 0; width: 100%; order: 5; }
  .search input { width: 100%; min-width: 0; }
  .lists { scroll-snap-type: x mandatory; gap: 10px; padding: 10px 12px 12px; }
  .list, .list-wide, .list-news, .list-map, .list-facts, .list-today { width: calc(100vw - 40px); scroll-snap-align: start; }
  .ask { order: 3; flex-basis: 100%; max-width: none; }
  #view-brain .board-bar .bar-btn { order: 2; margin-left: auto; }
  .day-edit { grid-template-columns: 1fr; }
  .target-edit { grid-template-columns: repeat(2, 1fr); }
}

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


/* ---------- notes: feed, board, calendar (after MindChuk) ---------- */

.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tagbar { width: 100%; order: 10; gap: 16px; }
.board-bar .tagbar .chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-sub { font-weight: 500; }
.tag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.found { margin: 8px var(--gutter) 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-board); }
.found .link-btn { color: var(--on-board-2); }
.found .link-btn:hover { color: var(--on-board); background: var(--glass); }

.list-feed { width: 520px; }
.list-lists { width: 300px; }
.list-cal { width: 440px; }
.feed-compose { padding: 0 8px 8px; }
.feed-compose textarea { min-height: 60px; }
.feed-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.feed-tools .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.feed-tools .link-btn .i { width: 14px; height: 14px; }
/* Places: the "Move to" picker on each Google list reads like a link button but keeps its arrow. */
select.place-move { appearance: auto; max-width: 100%; }
select.place-move option { background: var(--card); color: var(--ink); }
.feed-hint { margin-left: auto; font-size: 11px; color: var(--muted); }
.feed-day { display: flex; align-items: center; gap: 6px; padding: 6px 4px 0; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.feed-day .i { width: 14px; height: 14px; }
.feed-day:first-child { padding-top: 0; }
.feed-day.is-tag { text-transform: none; letter-spacing: 0; font-size: 13px; }
.list .cap-preview:empty { display: none; }
.note-card { padding: 8px 12px 6px; display: grid; gap: 6px; cursor: pointer; }
.note-card:hover { box-shadow: 0 0 0 2px var(--focus); }
.note-labels { padding-right: 60px; }
.note-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 6px; display: block; background: var(--list); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 20px; }
.note-link { display: inline-flex; align-items: baseline; gap: 4px; max-width: 100%; color: var(--blue); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.note-link .i { width: 13px; height: 13px; align-self: center; flex: none; }
.note-link:hover { color: var(--blue-hover); }
mark { background: #f1d48d; color: inherit; border-radius: 2px; padding: 0 1px; }
.note-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-meta .i { width: 12px; height: 12px; }
.note-pin { color: var(--blue); display: inline-flex; }
.note-list { display: grid; gap: 4px; }
.note-list-title { display: flex; align-items: center; gap: 6px; }
.note-list-title .i { color: var(--ink-2); }
.note-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note-items { display: grid; gap: 0; }
.note-item { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; font-size: 14px; line-height: 20px; cursor: pointer; overflow-wrap: anywhere; }
.note-item input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--good); cursor: pointer; }
.note-item.is-done span { color: var(--muted); text-decoration: line-through; }
.note-add-item { width: 100%; border: 0; border-bottom: 1px dashed var(--line); background: transparent; padding: 4px 0 4px 24px; font-size: 13px; color: var(--ink); outline: none; }
.note-add-item:focus { border-bottom: 1px solid var(--focus); }
.note-add-item::placeholder { color: var(--muted); }
.tool.is-on { color: var(--blue); }
.note-card .tcard-tools { background: var(--card); border-radius: 6px; }

/* calendar */
.cal-head { gap: 4px; }
.cal-title { justify-content: center; font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 4px 10px 8px; }
.cal-wd { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; padding-bottom: 2px; }
.cal-cell {
  appearance: none; border: 0; cursor: pointer; position: relative; aspect-ratio: 1 / 1; min-height: 44px; border-radius: 6px;
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); display: grid; grid-template-rows: auto 1fr; padding: 4px 5px; text-align: left;
}
.cal-cell:hover { box-shadow: 0 0 0 2px var(--focus); }
.cal-cell.is-out { background: transparent; box-shadow: none; color: var(--muted); }
.cal-cell.is-today .cal-num { background: var(--blue); color: #fbf3ea; }
.cal-cell.is-on { box-shadow: 0 0 0 2px var(--blue); }
.cal-num { font-size: 12px; font-weight: 600; line-height: 20px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; justify-self: start; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 3px; }
.cal-dots i { display: block; width: 7px; height: 7px; border-radius: 2px; }
.cal-due { display: inline-flex; color: var(--blue); }
.cal-due .i { width: 11px; height: 11px; }
.cal-count { position: absolute; top: 5px; right: 6px; font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* note editor */
.ne-items { display: grid; gap: 4px; }
.ne-item { display: flex; align-items: center; gap: 8px; }
.ne-item input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--good); }
.ne-item-text { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 4px; border: 1px solid transparent; background: var(--card); color: var(--ink); min-height: 32px; }
.ne-item-text:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
.ne-add-item input { width: 100%; padding: 6px 8px; border-radius: 4px; border: 1px dashed #a59a8e; background: transparent; color: var(--ink); min-height: 34px; }
.ne-add-item input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-style: solid; }
.ne-photo { display: grid; gap: 8px; }
.ne-photo img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; }
.ne-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-toggle {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 18px; color: #2e2924; opacity: 0.55; box-shadow: inset 0 0 0 1px rgba(46, 41, 36, 0.15);
}
.tag-toggle .i { width: 12px; height: 12px; }
.tag-toggle:hover { opacity: 0.8; }
.tag-toggle.is-on { opacity: 1; box-shadow: inset 0 0 0 2px rgba(46, 41, 36, 0.45); }
.tag-sub { font-weight: 400; }

/* tags dialog */
.tag-edit { margin: 0; padding: 12px 14px 14px; border: 0; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); display: grid; gap: 12px; }
.tag-edit legend { float: left; width: 100%; font-weight: 600; font-size: 15px; padding: 0; }
.tag-edit-actions { display: flex; align-items: center; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { appearance: none; border: 0; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(46, 41, 36, 0.15); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.tag-rows { display: grid; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.tag-rows > li + li { border-top: 1px solid var(--line); }
.tag-rows .muted-p { padding: 12px; }
.tag-row { appearance: none; border: 0; cursor: pointer; width: 100%; display: grid; grid-template-columns: auto 1fr auto 16px; align-items: center; gap: 12px; padding: 10px 12px; background: transparent; color: var(--ink); text-align: left; }
.tag-row:hover { background: var(--hover); }
.tag-row.is-sub { padding-left: 32px; }
.tag-row .label { max-width: 160px; }
.tag-row-kw { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-row-n { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag-row .i { color: var(--muted); width: 14px; height: 14px; }

/* add dialog */
.capture-head .chips { flex-wrap: wrap; row-gap: 4px; }
.cap-shot { min-height: 120px; }
.cap-help { font-size: 12px; color: var(--ink-2); }
.cap-help summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.cap-help ul { margin-top: 6px; display: grid; gap: 4px; padding-left: 2px; }
.cap-preview .labels { display: inline-flex; }
code { font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--press); border-radius: 3px; padding: 0 4px; }

/* settings */
.set-sec { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.set-sec h3 .i { color: var(--blue); }
.set-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; }
.set-row-top { align-items: start; }
.set-name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.set-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.set-text { font-size: 13px; color: var(--ink-2); }
.set-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
.steps { font-size: 13px; color: var(--ink-2); background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 12px; }
.steps summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.steps ol { list-style: decimal; padding-left: 20px; margin-top: 8px; display: grid; gap: 6px; }

/* compact cards */
:root[data-density="compact"] { --list-w: 264px; }
:root[data-density="compact"] .list-body { gap: 6px; }
:root[data-density="compact"] .tcard-main { padding-top: 5px; padding-bottom: 5px; }
:root[data-density="compact"] .tcard-title, :root[data-density="compact"] .note-text, :root[data-density="compact"] .note-item { font-size: 13px; line-height: 18px; }
:root[data-density="compact"] .note-card { padding: 6px 10px 4px; gap: 4px; }
:root[data-density="compact"] .note-photo { max-height: 160px; }

/* ---------- night: warm and dark, no blue ---------- */

:root[data-theme="night"] {
  color-scheme: dark;
  --board-1: #2a221c; --board-2: #17120e;
  --appbar: rgba(12, 8, 5, 0.55);
  --on-board: #eadfcf; --on-board-2: rgba(234, 223, 207, 0.68);
  --glass: rgba(234, 223, 207, 0.08); --glass-2: rgba(234, 223, 207, 0.16);
  --list: #2b241f; --card: #3a3029;
  --ink: #ece1d2; --ink-2: #cdbfae; --muted: #9d9081;
  --line: rgba(236, 225, 210, 0.12); --hover: rgba(236, 225, 210, 0.05); --press: rgba(236, 225, 210, 0.1);
  --blue: #c96d43; --blue-hover: #d88257; --focus: #c99550; --good: #7d9f6c;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.6);
  --shadow-raised: 0 8px 16px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.6);
  --l-green: #8ea883; --l-yellow: #c9b06a; --l-orange: #c99573; --l-red: #c08277; --l-purple: #a597b3;
  --l-blue: #92a2b0; --l-sky: #97afaa; --l-lime: #a9b37b; --l-pink: #bf96a7; --l-gray: #b4aa9e;
}
:root[data-theme="night"] .label, :root[data-theme="night"] .badge.is-soon, :root[data-theme="night"] .badge.is-live { color: #1d1814; }
:root[data-theme="night"] .list.is-over { background: #352c25; }
:root[data-theme="night"] button.tcard-main:hover, :root[data-theme="night"] .why-reason:hover { background: #41362e; }
:root[data-theme="night"] .tool:hover { background: #4a3e35; }
:root[data-theme="night"] .tcard-total, :root[data-theme="night"] .mail-summary, :root[data-theme="night"] .legacy-day { background: #332a23; }
:root[data-theme="night"] .why-reason[aria-checked="true"] { background: #45372c; }
:root[data-theme="night"] .btn-danger { background: #4a2a22; color: #f0b3a3; }
:root[data-theme="night"] .btn-danger:hover { background: #5a3228; }
:root[data-theme="night"] .btn-soft { background: #45342a; }
:root[data-theme="night"] .btn-ghost:hover { background: rgba(236, 225, 210, 0.18); }
:root[data-theme="night"] .banner { background: #4a3c22; color: #f0d79a; }
:root[data-theme="night"] .skeleton { background: linear-gradient(90deg, var(--card), #43382f, var(--card)); }
:root[data-theme="night"] .ring-track, :root[data-theme="night"] .mbar-track { stroke: #4a3f36; background: #4a3f36; }
:root[data-theme="night"] .add-way:hover { background: #41362e; }
:root[data-theme="night"] .fitem-name:focus { background: #2b241f; }
:root[data-theme="night"] .field input, :root[data-theme="night"] .field select, :root[data-theme="night"] .field textarea { border-color: #66594d; }
:root[data-theme="night"] .msg-user .msg-text { background: #5a4334; }
:root[data-theme="night"] mark { background: #7a6230; color: #fff3dc; }
:root[data-theme="night"] .tag-toggle, :root[data-theme="night"] .swatch { color: #1d1814; }
:root[data-theme="night"] .appbar, :root[data-theme="night"] .side { background-color: rgba(10, 7, 5, 0.5); }
:root[data-theme="night"] .toast { background: #ece1d2; color: #2b241f; }
:root[data-theme="night"] .toast-btn { background: rgba(43, 36, 31, 0.12); color: #2b241f; }
:root[data-theme="night"] .editor::backdrop, :root[data-theme="night"] .drawer::backdrop { background: rgba(0, 0, 0, 0.6); }

@media (max-width: 760px) {
  .side-list { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .list-feed, .list-lists, .list-cal { width: calc(100vw - 40px); scroll-snap-align: start; }
  .tagbar { order: 6; }
  #view-notes .board-bar .bar-btn { order: 2; margin-left: auto; }
  .cal-grid { gap: 3px; padding: 4px 6px 8px; }
  .cal-cell { min-height: 0; padding: 3px; }
  .cal-count { display: none; }
  .set-row { grid-template-columns: 1fr; gap: 6px; }
  .tag-row { grid-template-columns: auto 1fr 16px; }
  .tag-row-n { display: none; }
  #settings, #tags-dialog, #note-edit { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  #settings form, #tags-dialog form, #note-edit form { padding: 16px 16px calc(12px + env(safe-area-inset-bottom)); }
  :root[data-theme="night"] .appbar { background: #1f1915; }
  :root[data-theme="night"] .side { background: #1c1612; }
}

/* =====================================================================
   Arcade Line (25 Nov 2026): 70s arcade cabinets with AI-lab precision.
   A layer over everything above. Delete from here to the end to go back.
   Day: paper and ink. Night: CRT black and phosphor, amber for focus, no blue.
   Hairlines for structure, 3px rules for selection, 6px bars for emphasis.
   One signal colour, a red-orange-yellow stripe, square corners, one chamfer.
   Type: Archivo Expanded for display, Geist for text, Geist Mono for labels.
   ===================================================================== */

@font-face { font-family: "Archivo"; src: url("/assets/fonts/Archivo-Variable.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo", "Geist", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --signal: #F0501F; --tangerine: #F58A1F; --marigold: #F7B52C;
  --board-1: #EFEBE1; --board-2: #EFEBE1; --appbar: #EFEBE1;
  --on-board: #111110; --on-board-2: #5E5A52;
  --glass: rgba(17, 17, 16, 0.06); --glass-2: rgba(17, 17, 16, 0.12);
  --list: #E6E1D5; --card: #F7F4EC;
  --ink: #111110; --ink-2: #3A3832; --muted: #5E5A52;
  --line: rgba(17, 17, 16, 0.2); --hover: rgba(17, 17, 16, 0.05); --press: rgba(17, 17, 16, 0.1);
  --edge: #111110; --bar: #111110;
  --blue: #F0501F; --blue-hover: #FF6A36; --on-signal: #111110;
  --focus: #1F4FD1; --good: #3F7D4E;
  --shadow: none;
  --shadow-raised: 6px 6px 0 rgba(17, 17, 16, 0.9);
  --chamfer: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  --stripe: linear-gradient(var(--signal) 0 5px, transparent 5px 7px, var(--tangerine) 7px 12px, transparent 12px 14px, var(--marigold) 14px 19px);
  --scan: none;
}
:root[data-theme="night"] {
  --board-1: #0C0C0B; --board-2: #0C0C0B; --appbar: #0C0C0B;
  --on-board: #EEE8DA; --on-board-2: #A39D90;
  --glass: rgba(238, 232, 218, 0.07); --glass-2: rgba(238, 232, 218, 0.14);
  --list: #131312; --card: #1B1B19;
  --ink: #EEE8DA; --ink-2: #CFC9BC; --muted: #A39D90;
  --line: rgba(238, 232, 218, 0.16); --hover: rgba(238, 232, 218, 0.05); --press: rgba(238, 232, 218, 0.1);
  --edge: #4A4740; --bar: #CFC9BC;
  --signal: #FF5A26; --blue: #FF5A26; --blue-hover: #FF7446; --on-signal: #0C0C0B;
  --focus: #F7B52C; --good: #8DB36A;
  --shadow-raised: 6px 6px 0 rgba(0, 0, 0, 0.85), 0 0 0 1px #4A4740;
  --scan: repeating-linear-gradient(0deg, rgba(238, 232, 218, 0.05) 0 1px, transparent 1px 4px);
}

/* shape: square everywhere */
*, *::before, *::after { border-radius: 0 !important; }
body { background: var(--board-1); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
mark { background: var(--marigold); color: #111110; }
:root[data-theme="night"] mark { background: #F7B52C; color: #0C0C0B; }

/* chamfered things lose the cut while focused, so the focus ring is never clipped */
.btn-blue, .btn-primary, .appbar-add, .ask-go, .bar-btn-strong, .side-item[aria-selected="true"] { clip-path: var(--chamfer); }
.btn-blue:focus-visible, .btn-primary:focus-visible, .appbar-add:focus-visible, .ask-go:focus-visible, .bar-btn-strong:focus-visible, .side-item:focus-visible { clip-path: none; }

/* sidebar: an ink cabinet with the stripe under the name */
.side { background: #111110; color: #EFEBE1; border-right: 0; }
:root[data-theme="night"] .side { background: #0C0C0B; border-right: 1px solid #2A2926; }
.side .brand { position: relative; margin-bottom: 22px; padding: 14px 18px 12px; color: #EFEBE1; }
.side .brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: -16px; height: 19px; background: var(--stripe); }
.brand-mark { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: -0.03em; }
.brand-name { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: #BDB7AA; }
.side-item { margin: 0 10px; width: calc(100% - 20px); padding: 9px 12px; color: #BDB7AA; }
.side-item:hover { color: #EFEBE1; background: rgba(239, 235, 225, 0.07); }
.side-item[aria-selected="true"] { background: var(--signal); color: #111110; font-weight: 600; }
.side-item[aria-selected="true"]::before { display: none; }
.side-count { font-family: var(--mono); font-weight: 600; color: var(--marigold); }
.side-item[aria-selected="true"] .side-count { color: #111110; }
.side-note { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: #A39D90; }

/* app bar */
.appbar { background: var(--appbar); color: var(--on-board); border-bottom: 1px solid var(--edge); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-theme="night"] .appbar { background-color: #0C0C0B; background-image: var(--scan); }
.appbar-btn:hover { background: var(--glass-2); }
.appbar-add { background: var(--signal); color: var(--on-signal); font-weight: 600; padding: 0 16px 0 12px; }
.appbar-add:hover { background: var(--blue-hover); }
.refresh-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* view header: big expanded title over a heavy bar */
.board-bar { background: transparent; color: var(--on-board); border-bottom: 6px solid var(--bar); padding-bottom: 12px; }
.board-title { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 30px; line-height: 1.05; letter-spacing: -0.03em; text-transform: uppercase; padding: 0; }
.bar-btn { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 600; }
.bar-btn:hover { background: var(--ink); color: var(--board-1); }
.bar-btn-strong { background: var(--signal); color: var(--on-signal); box-shadow: none; padding-right: 16px; }
.bar-btn-strong:hover { background: var(--blue-hover); color: var(--on-signal); }
.chip { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; border-bottom-width: 3px; }
.chip[aria-pressed="true"], .board-bar .chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--signal); }
.chip-count { font-variant-numeric: tabular-nums; }
.search { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge); }
.search input { color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search:focus-within { background: var(--card); box-shadow: inset 0 0 0 1px var(--edge), inset 0 -3px 0 var(--focus); }
.summary { color: var(--on-board-2); }
.sum-link { color: var(--on-board); text-decoration-color: var(--line); }
.sum-link:hover { text-decoration-color: currentColor; }
.banner { background: var(--marigold); color: #111110; border: 1px solid #111110; box-shadow: none; }
:root[data-theme="night"] .banner { background: #F7B52C; color: #0C0C0B; }

/* lists: panels with hairline edges, mono caps titles */
.list { background: var(--list); border: 1px solid var(--edge); box-shadow: none; }
.list-head { border-bottom: 1px solid var(--edge); margin-bottom: 8px; }
.list-title { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.list-count, .note-meta, .msg-time, .cal-wd, .ticker-time, .ticker-label { font-family: var(--mono); letter-spacing: 0.04em; }
.list.is-over { outline: 3px solid var(--focus); outline-offset: -3px; }
.ht-from { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
:root[data-theme="night"] .list.is-over { background: #1F1F1C; }
.feed-day { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.feed-day::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 4px; }
.feed-day.is-tag { font-family: var(--font); font-weight: 600; letter-spacing: 0; font-size: 13px; color: var(--ink-2); }

/* cards: hairline edge, a hard shadow when you point at one */
.tcard { border: 1px solid var(--edge); box-shadow: none; }
button.tcard-main:hover, a.tcard-main:hover { background: var(--hover); }
.tcard:has(> button.tcard-main:hover, > a.tcard-main:hover), .note-card:hover { box-shadow: 4px 4px 0 var(--ink); }
:root[data-theme="night"] .tcard:has(> button.tcard-main:hover, > a.tcard-main:hover), :root[data-theme="night"] .note-card:hover { box-shadow: 4px 4px 0 var(--signal); }
.tcard-kicker { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.tcard-quote { background: var(--hover); }
.tool { box-shadow: 0 0 0 1px var(--edge); }
.tool:hover { background: var(--hover); color: var(--ink); }
:root[data-theme="night"] button.tcard-main:hover, :root[data-theme="night"] .why-reason:hover, :root[data-theme="night"] .add-way:hover { background: rgba(238, 232, 218, 0.05); }
:root[data-theme="night"] .tool:hover { background: #26261F; }
:root[data-theme="night"] .tcard-total, :root[data-theme="night"] .mail-summary, :root[data-theme="night"] .legacy-day { background: #22221F; }
:root[data-theme="night"] .why-reason[aria-checked="true"] { background: #2A2A25; }
:root[data-theme="night"] .skeleton { background: linear-gradient(90deg, var(--card), #2A2A25, var(--card)); }
:root[data-theme="night"] .ring-track, :root[data-theme="night"] .mbar-track { stroke: #33332E; background: #33332E; }
:root[data-theme="night"] .fitem-name:focus { background: #131312; }
.label { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 18px; color: #111110; }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; }
.badge.is-done { background: var(--ink); color: var(--board-1); }
/* Late = red corner flag, due today = yellow. The ink edge keeps yellow visible on paper. */
.tcard.has-flag::before {
  content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 14px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg, var(--flag) 0 calc(50% - 0.5px), var(--edge) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.tcard.is-late { --flag: var(--signal); }
.tcard.is-today { --flag: var(--marigold); }

/* buttons */
.btn { font-weight: 600; }
.btn-blue, .btn-primary { background: var(--signal); color: var(--on-signal); padding-right: 16px; }
.btn-blue:hover, .btn-primary:hover { background: var(--blue-hover); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:hover, :root[data-theme="night"] .btn-ghost:hover { background: var(--ink); color: var(--board-1); }
.btn-soft, :root[data-theme="night"] .btn-soft { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--signal); }
.btn-soft:hover { background: var(--hover); }
.btn-danger { background: transparent; color: #B3361A; box-shadow: inset 0 0 0 1.5px #B3361A; }
.btn-danger:hover { background: rgba(179, 54, 26, 0.08); }
:root[data-theme="night"] .btn-danger { background: transparent; color: #FF8A66; box-shadow: inset 0 0 0 1.5px #FF8A66; }
:root[data-theme="night"] .btn-danger:hover { background: rgba(255, 138, 102, 0.1); }
.link-btn:hover { background: var(--hover); }

/* fields: hairline boxes, a 3px focus rule along the bottom */
.field label, .field-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea, :root[data-theme="night"] .field input, :root[data-theme="night"] .field select, :root[data-theme="night"] .field textarea { border: 1px solid var(--edge); background: var(--card); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--edge); box-shadow: inset 0 -3px 0 var(--focus); }
.cap-preview { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }
.cap-preview .i { color: var(--signal); }

/* Brain */
.ask { box-shadow: inset 0 0 0 1px var(--edge); padding-left: 4px; }
.ask:focus-within { box-shadow: inset 0 0 0 1px var(--edge), inset 0 -3px 0 var(--focus); }
.ask > .i { display: none; }
.ask::before { content: ""; flex: none; width: 28px; height: 28px; background: #0C0C0B var(--px-astronaut) center / 24px 24px no-repeat; }
.ask-go { background: var(--signal); color: var(--on-signal); padding: 0 18px 0 14px; }
.ask-go:hover { background: var(--blue-hover); }
.map-wrap { box-shadow: inset 0 0 0 1px var(--edge); }
.map-wrap { background-color: var(--card); background-image: linear-gradient(var(--hover) 1px, transparent 1px), linear-gradient(90deg, var(--hover) 1px, transparent 1px); background-size: 24px 24px; }
.msg-user .msg-text, :root[data-theme="night"] .msg-user .msg-text { background: var(--ink); color: var(--board-1); }
.msg-claude .msg-text { box-shadow: inset 0 0 0 1px var(--edge); }


/* dialogs and the side panel: hard edges, hard shadow */
.editor { background: var(--list); box-shadow: var(--shadow-raised); border: 1px solid var(--ink); }
:root[data-theme="night"] .editor { border-color: #4A4740; }
.editor h2, .drawer-title { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 22px; line-height: 1.1; letter-spacing: -0.02em; text-transform: uppercase; }
.drawer { border-left: 1px solid var(--ink); box-shadow: -6px 0 0 rgba(17, 17, 16, 0.25); }
.editor::backdrop, .drawer::backdrop { background: rgba(17, 17, 16, 0.55); }
.editor-actions { background: var(--list); }
.toast { background: #111110; color: #EFEBE1; box-shadow: 4px 4px 0 var(--signal); }
.toast-btn { background: transparent; color: #EFEBE1; box-shadow: inset 0 0 0 1px rgba(239, 235, 225, 0.5); }
:root[data-theme="night"] .toast { background: #EEE8DA; color: #0C0C0B; box-shadow: 4px 4px 0 var(--signal); }
:root[data-theme="night"] .toast-btn { background: transparent; color: #0C0C0B; box-shadow: inset 0 0 0 1px rgba(12, 12, 11, 0.4); }

/* sign-in page */
.login { border: 1px solid var(--ink); box-shadow: var(--shadow-raised); }
.login h1 { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -0.03em; text-transform: uppercase; }
.login h1::before { content: ""; display: block; width: 64px; height: 64px; margin-bottom: 18px; background: #0C0C0B var(--px-rocket) center / 48px 48px no-repeat; }
.login::before { content: ""; display: block; height: 19px; margin: -32px -28px 24px; background: var(--stripe); }

/* mid-size screens: the rail */
@media (max-width: 1179px) and (min-width: 761px) {
  .side .brand { padding: 12px 0 10px; }
  .brand-mark { font-size: 22px; }
  .side-item { margin: 0 6px; width: calc(100% - 12px); padding: 10px 2px; }
}

/* phones: ink tab bar, amber rule on the open tab */
@media (max-width: 760px) {
  .appbar, :root[data-theme="night"] .appbar { background-color: var(--appbar); }
  .side, :root[data-theme="night"] .side { background: #111110; border-top: 1px solid #111110; }
  :root[data-theme="night"] .side { background: #0C0C0B; border-top-color: #4A4740; }
  .side-item { margin: 0; width: 100%; padding: 6px 0; }
  .side-item[aria-selected="true"] { background: transparent; color: var(--marigold); clip-path: none; box-shadow: inset 0 3px 0 var(--marigold); }
  .board-title { font-size: 26px; }
}

/* the pixel sprites (16 x 16, original drawings, the board's own colours) */
:root {
  --px-rocket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='7' y='0' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='6' y='1' width='4' height='1' fill='%23EEE8DA'/%3E%3Crect x='6' y='2' width='4' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='3' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='7' y='3' width='2' height='1' fill='%230C0C0B'/%3E%3Crect x='9' y='3' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='4' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='6' y='4' width='1' height='1' fill='%230C0C0B'/%3E%3Crect x='7' y='4' width='1' height='1' fill='%23F7B52C'/%3E%3Crect x='8' y='4' width='2' height='1' fill='%230C0C0B'/%3E%3Crect x='10' y='4' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='5' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='7' y='5' width='2' height='1' fill='%230C0C0B'/%3E%3Crect x='9' y='5' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='6' width='6' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='7' width='6' height='1' fill='%23EEE8DA'/%3E%3Crect x='4' y='8' width='1' height='1' fill='%23FF5A26'/%3E%3Crect x='5' y='8' width='6' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='8' width='1' height='1' fill='%23FF5A26'/%3E%3Crect x='3' y='9' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='5' y='9' width='6' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='9' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='3' y='10' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='6' y='10' width='4' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='10' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='3' y='11' width='1' height='1' fill='%23FF5A26'/%3E%3Crect x='6' y='11' width='4' height='1' fill='%23A39D90'/%3E%3Crect x='12' y='11' width='1' height='1' fill='%23FF5A26'/%3E%3Crect x='6' y='12' width='1' height='1' fill='%23F58A1F'/%3E%3Crect x='7' y='12' width='2' height='1' fill='%23F7B52C'/%3E%3Crect x='9' y='12' width='1' height='1' fill='%23F58A1F'/%3E%3Crect x='6' y='13' width='1' height='1' fill='%23F58A1F'/%3E%3Crect x='7' y='13' width='2' height='1' fill='%23F7B52C'/%3E%3Crect x='9' y='13' width='1' height='1' fill='%23F58A1F'/%3E%3Crect x='7' y='14' width='2' height='1' fill='%23F7B52C'/%3E%3Crect x='7' y='15' width='1' height='1' fill='%23F58A1F'/%3E%3C/svg%3E");
  --px-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='6' y='2' width='4' height='1' fill='%23EEE8DA'/%3E%3Crect x='4' y='3' width='8' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='4' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='4' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='7' y='4' width='5' height='1' fill='%23EEE8DA'/%3E%3Crect x='12' y='4' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='4' y='5' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='6' y='5' width='5' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='5' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='2' y='6' width='7' height='1' fill='%23EEE8DA'/%3E%3Crect x='9' y='6' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='10' y='6' width='3' height='1' fill='%23EEE8DA'/%3E%3Crect x='13' y='6' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='2' y='7' width='11' height='1' fill='%23EEE8DA'/%3E%3Crect x='13' y='7' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='2' y='8' width='3' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='8' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='7' y='8' width='5' height='1' fill='%23EEE8DA'/%3E%3Crect x='12' y='8' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='2' y='9' width='3' height='1' fill='%23EEE8DA'/%3E%3Crect x='5' y='9' width='2' height='1' fill='%23A39D90'/%3E%3Crect x='7' y='9' width='4' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='9' width='3' height='1' fill='%23A39D90'/%3E%3Crect x='3' y='10' width='7' height='1' fill='%23EEE8DA'/%3E%3Crect x='10' y='10' width='3' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='11' width='3' height='1' fill='%23EEE8DA'/%3E%3Crect x='7' y='11' width='5' height='1' fill='%23A39D90'/%3E%3Crect x='6' y='12' width='4' height='1' fill='%23A39D90'/%3E%3C/svg%3E");
  --px-astronaut: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Crect x='5' y='1' width='6' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='2' width='10' height='1' fill='%23EEE8DA'/%3E%3Crect x='2' y='3' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='4' y='3' width='8' height='1' fill='%23A39D90'/%3E%3Crect x='12' y='3' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='2' y='4' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='4' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='4' width='8' height='1' fill='%230C0C0B'/%3E%3Crect x='12' y='4' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='4' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='1' y='5' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='5' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='5' width='1' height='1' fill='%230C0C0B'/%3E%3Crect x='5' y='5' width='2' height='1' fill='%23F7B52C'/%3E%3Crect x='7' y='5' width='5' height='1' fill='%230C0C0B'/%3E%3Crect x='12' y='5' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='5' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='1' y='6' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='6' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='6' width='1' height='1' fill='%230C0C0B'/%3E%3Crect x='5' y='6' width='1' height='1' fill='%23F7B52C'/%3E%3Crect x='6' y='6' width='6' height='1' fill='%230C0C0B'/%3E%3Crect x='12' y='6' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='6' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='1' y='7' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='7' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='7' width='8' height='1' fill='%230C0C0B'/%3E%3Crect x='12' y='7' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='7' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='1' y='8' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='8' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='8' width='8' height='1' fill='%230C0C0B'/%3E%3Crect x='12' y='8' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='8' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='2' y='9' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='9' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='4' y='9' width='6' height='1' fill='%230C0C0B'/%3E%3Crect x='10' y='9' width='2' height='1' fill='%23F58A1F'/%3E%3Crect x='12' y='9' width='1' height='1' fill='%23A39D90'/%3E%3Crect x='13' y='9' width='1' height='1' fill='%23EEE8DA'/%3E%3Crect x='2' y='10' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='4' y='10' width='8' height='1' fill='%23A39D90'/%3E%3Crect x='12' y='10' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='3' y='11' width='10' height='1' fill='%23EEE8DA'/%3E%3Crect x='2' y='12' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='4' y='12' width='8' height='1' fill='%23EEE8DA'/%3E%3Crect x='12' y='12' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='1' y='13' width='4' height='1' fill='%23FF5A26'/%3E%3Crect x='5' y='13' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='7' y='13' width='2' height='1' fill='%23FF5A26'/%3E%3Crect x='9' y='13' width='2' height='1' fill='%23EEE8DA'/%3E%3Crect x='11' y='13' width='4' height='1' fill='%23FF5A26'/%3E%3Crect x='1' y='14' width='14' height='1' fill='%23FF5A26'/%3E%3C/svg%3E");
}

/* accents first drawn for the old dark board, made readable on paper */
.sum-link.is-alert strong { color: #B3361A; }
.sum-link.is-warn strong { color: #8A5A00; }
:root[data-theme="night"] .sum-link.is-alert strong { color: #FF7446; }
:root[data-theme="night"] .sum-link.is-warn strong { color: #F7B52C; }
.ticker-label { color: var(--ink); font-family: var(--mono); font-weight: 500; letter-spacing: 0.14em; }
.ticker-label .i { color: var(--signal); }
.wx-now .i, .wx-place.is-on .i { color: var(--tangerine); }

/* ---------- Home header: date and summary, markets, search ---------- */
.home-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 28px; row-gap: 6px; align-items: center;
  grid-template-areas: "title markets search" "summary markets search";
}
.home-head .board-title { grid-area: title; }
.home-head .summary { grid-area: summary; }
.home-head .markets { grid-area: markets; }
.home-head .search { grid-area: search; align-self: start; margin-left: 0; }
.sum-link .sum-hot { color: #8A5A00; }
:root[data-theme="night"] .sum-link .sum-hot { color: #F7B52C; }

/* calories: a block meter, one block per 1/16 of the day's goal */
.sum-kcal { display: inline-flex; align-items: center; gap: 8px; }
.kmeter { display: inline-grid; grid-template-columns: repeat(16, 5px); gap: 2px; }
.kmeter span { height: 11px; box-shadow: inset 0 0 0 1px var(--edge); }
.kmeter span.on { background: var(--signal); box-shadow: none; }
:root[data-theme="night"] .kmeter span { box-shadow: inset 0 0 0 1px #6F6A60; }
:root[data-theme="night"] .kmeter span.on { box-shadow: none; }

/* markets strip */
.markets { min-width: 0; align-self: stretch; display: flex; align-items: stretch; justify-content: flex-end; }
.mkt-list { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mkt-list::-webkit-scrollbar { display: none; }
.mkt-list > li { flex: none; display: flex; }
.mkt {
  display: grid; grid-template-columns: auto 44px; grid-template-areas: "name name" "price spark" "chg spark";
  column-gap: 10px; align-content: center; padding: 2px 14px; border-left: 1px solid var(--edge); color: var(--ink); text-decoration: none;
}
.mkt:hover { background: var(--hover); }
.mkt-name { grid-area: name; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mkt-price { grid-area: price; font-size: 15px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mkt-chg { grid-area: chg; font-family: var(--mono); font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.mkt.is-down .mkt-chg { color: #B3361A; }
:root[data-theme="night"] .mkt.is-down .mkt-chg { color: #FF7446; }
.mkt-spark { grid-area: spark; width: 44px; height: 22px; overflow: visible; color: var(--ink-2); }
.mkt.is-down .mkt-spark { color: var(--signal); }
.mkt-spark polyline { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mkt-edit { appearance: none; border: 0; border-left: 1px solid var(--edge); flex: none; width: 36px; display: grid; place-items: center; background: transparent; color: var(--ink-2); cursor: pointer; }
.mkt-edit:hover { background: var(--hover); color: var(--ink); }
.mkt-empty {
  appearance: none; align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
  border: 1px dashed var(--edge); background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.mkt-empty:hover { color: var(--ink); background: var(--hover); }
/* editor, in the side panel */
.mkt-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; }
.mkt-row-name { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--edge); background: transparent; color: var(--ink); font: inherit; font-size: 14px; padding: 4px 0; }
.mkt-row-name:focus { outline: none; box-shadow: inset 0 -3px 0 var(--focus); }
.mkt-row-sym { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.mkt-row-act { display: flex; gap: 2px; }
.mkt-row .tool:disabled { opacity: 0.35; cursor: default; }
.mkt-hit { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; }
.mkt-hit-text { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 13px; overflow-wrap: anywhere; }
.mkt-hit-text strong { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }
.mkt-hit-text small { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.mkt-hit-on { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* weather strip: icon on top, temperature, then the hour; icons coloured by the sky */
.wx-strip .wx-hours { gap: 14px; }
.wx-strip .wx-hour { display: inline-grid; grid-template-columns: auto; grid-template-rows: 16px 16px 12px; justify-items: center; align-items: center; gap: 0; min-width: 30px; line-height: 1; }
.wx-h-top { display: inline-flex; align-items: center; gap: 2px; }
.wx-strip .wx-hour .i { width: 16px; height: 16px; }
.wx-strip .wx-h-temp { font-size: 13px; font-weight: 600; }
.wx-strip .wx-h-time { font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; color: var(--muted); }
.wx-strip .wx-h-rain { font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: #2F6DB5; }
.wx-strip .wx-hour.is-wet .wx-h-temp { color: inherit; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-sun { color: #D98A00; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-sun { color: #E2700E; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-moon, :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-moon { color: #A87B12; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud, :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-fog { color: #6B7A8C; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-rain { color: #2F6DB5; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-snow { color: #5B93C7; }
:is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-lightning { color: #B3361A; }
:root[data-theme="night"] .wx-strip .wx-h-rain { color: #6FA8E8; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-sun { color: #F7B52C; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-sun { color: #F58A1F; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-moon { color: #F2DFA0; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-moon { color: #E6D08A; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud, :root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-fog { color: #AAB6C4; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-rain { color: #6FA8E8; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-snow { color: #BFDDF5; }
:root[data-theme="night"] :is(.wx-strip, .wx-top, .wx-hours) .i.i-cloud-lightning { color: #FF7446; }

/* narrower screens: drop the little lines so more prices fit; fade the edge when some are scrolled out of view */
@media (max-width: 1800px) {
  .mkt { grid-template-columns: auto; grid-template-areas: "name" "price" "chg"; padding: 2px 12px; }
  .mkt-spark { display: none; }
}
.mkt-list.is-clipped { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
@media (max-width: 760px) {
  .home-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "search" "summary" "markets"; row-gap: 8px; }
  .home-head .search { width: 100%; }
  .markets { justify-content: flex-start; }
  .mkt-list > li:first-child .mkt { border-left: 0; padding-left: 0; }
  .wx-strip .wx-hours { gap: 10px; }
}

/* ---------- Builds: one input line at the top, then the queue ---------- */
.build-add { flex: 1 1 100%; order: 10; display: flex; gap: 8px; }
.build-add input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 0; background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge); font: inherit; font-size: 15px;
}
.build-add input::placeholder { color: var(--muted); }
.build-add input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--edge), inset 0 -3px 0 var(--focus); }
.build-add .btn { height: 40px; white-space: nowrap; }
.label.is-auto { outline: 1px dashed currentColor; outline-offset: -1px; }
.build-card.is-building { box-shadow: inset 3px 0 0 var(--tangerine); }
.build-card.is-undone .tcard-title { color: var(--muted); }
/* what's tagged to a deal, in the card editor */
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.tagged-list { display: grid; gap: 6px; margin-top: 6px; }
.tagged-item {
  appearance: none; width: 100%; text-align: left; cursor: pointer; display: grid; gap: 4px; padding: 8px 10px;
  border: 1px solid var(--edge); background: var(--card); color: var(--ink); font: inherit;
}
.tagged-item:hover { box-shadow: 3px 3px 0 var(--ink); }
:root[data-theme="night"] .tagged-item:hover { box-shadow: 3px 3px 0 var(--signal); }
.tagged-text { font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.tagged-when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
@media (max-width: 760px) {
  .build-add { flex-wrap: wrap; }
  .build-add .btn { width: 100%; justify-content: center; }
  .side-item { font-size: 10px; min-width: 0; }
  .side-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- OneNote connector (Brain) ---------- */
.code-big { display: inline-block; padding: 10px 16px; border: 1px solid var(--edge); background: var(--card); color: var(--ink); font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: 0.2em; }
.steps { display: grid; gap: 8px; padding-left: 24px; font-size: 14px; line-height: 20px; list-style: decimal; }
.steps li::marker { font-family: var(--mono); font-weight: 600; color: var(--signal); }
.steps a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
#on-client { width: 100%; height: 38px; padding: 0 10px; border: 0; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge); font-family: var(--mono); font-size: 14px; }
#on-client:focus { outline: none; box-shadow: inset 0 0 0 1px var(--edge), inset 0 -3px 0 var(--focus); }

/* ---------- Drinks and Quick add: the menu as a till, one button per order ---------- */
.list-drinks { width: 360px; }
.drinks-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding: 5px 8px; }
.drinks-edit .i { width: 14px; height: 14px; }
.drinks-edit[aria-pressed="true"] { background: var(--ink); color: var(--board-1); }
.list-drinks .list-count { margin-left: 2px; }
.menu-hint { font-size: 12px; line-height: 16px; color: var(--ink-2); padding: 0 2px 8px; }
.menu-hint:empty { display: none; }

.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.menu-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mtile { position: relative; display: flex; min-width: 0; }
.mtile-main {
  appearance: none; flex: 1; min-width: 0; min-height: 100px; cursor: pointer; font: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px 8px;
  background: var(--card); color: var(--ink); border: 1px solid var(--edge);
  transition: transform 0.08s, box-shadow 0.08s;
}
.mtile-main:hover { box-shadow: 4px 4px 0 var(--ink); transform: translate(-1px, -1px); }
.mtile-main:active { box-shadow: none; transform: translate(2px, 2px); background: var(--press); }
:root[data-theme="night"] .mtile-main:hover { box-shadow: 4px 4px 0 var(--signal); }
.mtile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; margin-bottom: 4px; }
.mtile-top > .i:first-child { width: 22px; height: 22px; color: var(--signal); }
.mtile-top > .i + .i { width: 14px; height: 14px; color: var(--muted); }
.mtile-name { font-weight: 600; font-size: 13.5px; line-height: 17px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mtile-size { font-size: 11.5px; line-height: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile-kcal { margin-top: auto; padding-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile-p { color: var(--muted); }
.mtile-count { font-family: var(--mono); font-weight: 700; font-size: 12px; line-height: 22px; min-width: 26px; padding: 0 6px; text-align: center; background: var(--signal); color: var(--on-signal); }
.mtile.has-count .mtile-main { box-shadow: inset 0 3px 0 var(--signal); }
.mtile.has-count .mtile-main:hover { box-shadow: inset 0 3px 0 var(--signal), 4px 4px 0 var(--ink); }
:root[data-theme="night"] .mtile.has-count .mtile-main:hover { box-shadow: inset 0 3px 0 var(--signal), 4px 4px 0 var(--signal); }
.mtile.is-editing .mtile-main { border-style: dashed; }
.mtile-void, .mtile-pin {
  position: absolute; right: 5px; bottom: 5px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer;
  appearance: none; border: 1px solid var(--edge); background: var(--card); color: var(--ink);
}
.mtile-void:hover, .mtile-pin:hover { background: var(--ink); color: var(--board-1); }
.mtile-void .i, .mtile-pin .i { width: 14px; height: 14px; }
.mtile:has(.mtile-pin) .mtile-kcal, .mtile:has(.mtile-void) .mtile-kcal { padding-right: 28px; }
.mtile-move { position: absolute; right: 5px; bottom: 5px; display: flex; gap: 3px; }
.mtile-move button { appearance: none; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--edge); background: var(--card); color: var(--ink); }
.mtile-move button:hover:not(:disabled) { background: var(--ink); color: var(--board-1); }
.mtile-move button:disabled { cursor: default; color: var(--muted); border-color: var(--line); }
.mtile-move .i { width: 14px; height: 14px; }
.mtile:has(.mtile-move) .mtile-kcal { padding-right: 58px; }
.mtile-add .mtile-main { border-style: dashed; background: transparent; color: var(--ink-2); align-items: center; justify-content: center; text-align: center; gap: 6px; }
.mtile-add .mtile-main .i { width: 20px; height: 20px; }
.mtile-add .mtile-name { font-size: 13px; }
.mtile.is-hit .mtile-main { animation: mtile-hit 0.6s ease-out; }
@keyframes mtile-hit { from { background: var(--marigold); color: #111110; } to { background: var(--card); } }
@media (prefers-reduced-motion: reduce) {
  .mtile.is-hit .mtile-main { animation: none; }
  .mtile-main, .mtile-main:hover, .mtile-main:active { transform: none; transition: none; }
}

/* the day's tab, set like a till receipt */
.bar-tab { margin-top: 10px; padding: 10px 12px 12px; background: var(--card); border: 1px solid var(--edge); font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--ink); }
.bar-tab-title { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px dashed var(--line); }
.bar-tab-rows { display: grid; gap: 2px; }
.bar-tab-row { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.bar-tab-q { flex: none; min-width: 30px; color: var(--ink-2); }
.bar-tab-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-tab-row .lead { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.bar-tab-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--edge); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-tab-empty { color: var(--muted); font-family: var(--font); font-size: 12.5px; }

/* Quick add: tabs over the menu, the order below it, the typed numbers tucked away */
.fq-menu { display: grid; gap: 10px; }
.fq-tabs { margin-top: -2px; }
.fq-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fq-menu .menu-hint { padding: 0 2px; margin: -4px 0; }
.fq-empty { grid-column: 1 / -1; padding: 8px 2px; }
.fq-other { border-top: 1px solid var(--line); padding-top: 8px; }
.fq-other summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.fq-other summary::-webkit-details-marker { display: none; }
.fq-other summary::before { content: "+"; display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; font-size: 12px; line-height: 1; }
.fq-other[open] summary::before { content: "\2212"; }
.fq-other summary:hover { color: var(--ink); }
.fq-other[open] { display: grid; gap: 10px; }
.food-order-title { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }
.me-estimate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-reading { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--ink-2); flex: 1; min-width: 160px; }
.me-reading:empty { display: none; }
#menu-edit { width: min(500px, calc(100vw - 24px)); }

@media (max-width: 760px) {
  .list-drinks { width: calc(100vw - 40px); }
  .menu-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtile-main { min-height: 92px; }
}

/* ---------- Crew sprites ----------
   The user's own pixel art (public/sprites, served only after sign-in).
   Master Alfred runs things (Builds, dismissals), Harry is the smart one (Brain),
   Pika is fast and messy (hops while Claude does a quick job), the clapping monkey
   fills every empty list, and a dismissed card goes boom. */
:root {
  --sp-alfred: url("/assets/sprites/alfred.png");
  --sp-harry: url("/assets/sprites/harry.png");
  --sp-pika: url("/assets/sprites/pika.png");
  --sp-monkey: url("/assets/sprites/monkey-clap.png");
}
.sp-alfred, .tcard-empty.sp-alfred { --sprite: var(--sp-alfred); }
.sp-harry, .tcard-empty.sp-harry { --sprite: var(--sp-harry); }
.sp-pika, .tcard-empty.sp-pika { --sprite: var(--sp-pika); }
.sp-monkey, .tcard-empty.sp-monkey { --sprite: var(--sp-monkey); }

/* empty lists: the clapping monkey (Harry or Master Alfred where named) stands left of the text */
.tcard-empty { --sprite: var(--sp-monkey); grid-template-columns: 64px 1fr; align-items: center; column-gap: 12px; }
.tcard-empty > * { grid-column: 2; }
.tcard-empty::before { content: ""; grid-column: 1; grid-row: 1 / span 2; width: 64px; height: 76px; background: var(--sprite) center bottom / contain no-repeat; transform-origin: 50% 100%; animation: crew-clap 0.3s steps(1, end) 0.2s 6; }
.tcard-empty.sp-harry::before, .tcard-empty.sp-alfred::before { animation: none; }
@keyframes crew-clap { 50% { transform: scaleX(0.9) translateY(-2px); } }

/* Harry asks the Brain */
.ask::before { width: 24px; height: 32px; margin-left: 4px; background: var(--sp-harry) center bottom / contain no-repeat; }

/* Master Alfred: sidebar, Builds, and the "why dismiss" box */
.side-note::before { content: ""; display: block; width: 58px; height: 78px; margin-bottom: 10px; background: #EFEBE1 var(--sp-alfred) center bottom 4px / auto 68px no-repeat; clip-path: var(--chamfer); }
#builds-sub::before { content: ""; display: inline-block; width: 18px; height: 26px; margin-right: 8px; vertical-align: -7px; background: var(--sp-alfred) center bottom / contain no-repeat; }
.why-head { grid-template-columns: 1fr auto; column-gap: 16px; }
.why-head h2 { grid-column: 1; grid-row: 1; }
.why-head .why-item { grid-column: 1; grid-row: 2; }
.why-alfred { grid-column: 2; grid-row: 1 / span 2; align-self: end; width: 40px; height: 62px; background: var(--sp-alfred) center bottom / contain no-repeat; }

/* Pika hops while Claude does a quick job */
.pika-run { display: inline-block; flex: none; width: 30px; height: 28px; background: var(--sp-pika) center bottom / contain no-repeat; animation: pika-hop 0.32s steps(1, end) infinite; }
.btn .pika-run { width: 22px; height: 20px; margin-right: 6px; vertical-align: -4px; }
@keyframes pika-hop { 50% { transform: translateY(-4px); } }

/* Boom: a dismissed card blows up */
.boom { position: fixed; z-index: 1000; pointer-events: none; image-rendering: pixelated; animation: crew-boom 0.62s steps(5, end) forwards; }
@keyframes crew-boom { 0% { transform: scale(0.35); opacity: 1; } 45% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.tcard.is-booming { animation: crew-gone 0.3s steps(3, end) forwards; }
@keyframes crew-gone { to { opacity: 0; transform: scale(0.9); } }
/* Zap: pixel confetti when a task is ticked done */
.zap { position: fixed; z-index: 1000; width: 0; height: 0; pointer-events: none; }
.zap-px { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; background: var(--signal); animation: zap-fly 0.7s steps(7, end) forwards; }
.zap-px.is-b { background: var(--tangerine); }
.zap-px.is-c { background: var(--marigold); }
.zap-px.is-shot { left: -2px; top: -6px; width: 4px; height: 12px; }
@keyframes zap-fly {
  0% { transform: translate(0, 0) rotate(var(--rot)); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tcard-empty::before, .pika-run, .boom, .tcard.is-booming { animation: none; }
  .zap { display: none; }
}

/* ---------- Pages, not boards (26 Nov 2026) ----------
   Only today's tasks (Home) and the Projects pipeline stay as Trello-style lists of cards.
   Training, Nutrition, Brain and Builds are pages: sections on the paper, a heavy rule under
   each heading, rows split by hairlines, scrolling down instead of sideways. */
.page {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 36px 40px; align-content: start; align-items: start; padding: 22px var(--gutter) 56px;
}
.page .list, .page .list-group > .list { width: auto; max-height: none; background: transparent; border: 0; box-shadow: none; padding: 0; min-width: 0; }
.page .list-group { display: contents; }
.page .list-head { padding: 0 0 8px; min-height: 0; margin: 0; border-bottom: 2px solid var(--ink); }
.page .list-body { overflow: visible; padding: 0; gap: 0; }
.page .list-foot { padding: 8px 0 0; }
.page .list-body > .tcard, .page .list-body > li > .tcard { background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.page .list-body > .tcard:has(> button.tcard-main:hover, > a.tcard-main:hover) { box-shadow: none; }
.page .list-body > .tcard > .tcard-main { padding-left: 0; padding-right: 0; }
.page .list-body > .tcard-empty { border-bottom: 0; padding-left: 0; }
.page .list-body > .tcard-stat { padding-left: 0; padding-right: 0; }
.page .pairs { padding: 4px 0; }
.page .prose { padding: 8px 0; }
.page .add-card { padding-left: 0; }
.page .add-card:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.page .wide { grid-column: 1 / -1; }

/* Training */
.sec { grid-column: 1 / -1; min-width: 0; }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sec-title { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.sec-meta { font-size: 13px; color: var(--muted); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; }
.today-grid.no-wos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.today-col { min-width: 0; padding-top: 14px; display: grid; gap: 12px; align-content: start; }
.today-col + .today-col { border-left: 1px solid var(--line); padding-left: 32px; }
.sub-head { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.sub-head .i { width: 14px; height: 14px; }
.sub-meta { margin-left: auto; font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 12px; color: var(--muted); }
.quiet { font-size: 13px; color: var(--muted); }
.wo-list { display: grid; }
.wo { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.wo:last-child { border-bottom: 1px solid var(--line); }
.wo-time { display: grid; gap: 6px; justify-items: start; font-family: var(--mono); font-size: 13px; font-weight: 600; padding-top: 1px; font-variant-numeric: tabular-nums; }
.wo-ico { display: inline-flex; gap: 3px; color: var(--ink-2); }
.wo-ico .i { width: 18px; height: 18px; }
.wo-main { display: grid; gap: 4px; min-width: 0; }
.wo-title { font-size: 15px; font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.wo-stats { font-size: 13px; color: var(--ink-2); line-height: 18px; }
.wo-kcal { text-align: right; display: grid; line-height: 1.1; }
.wo-kcal strong { font-family: var(--display); font-stretch: 112%; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wo-kcal small { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.wo-total { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.burn { display: grid; gap: 6px; }
.burn-big { display: flex; align-items: baseline; gap: 2px; }
.burn-big strong { font-family: var(--display); font-stretch: 125%; font-size: 40px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.burn-big small { font-size: 14px; color: var(--muted); }
.burn-note { font-size: 13px; color: var(--ink-2); }
.page .burn-pairs { padding: 0; margin-top: 4px; border-top: 1px solid var(--line); }
.today-col .ready { border: 1px solid var(--edge); background: var(--card); }
.sess-list { display: grid; }
.sess { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sess .check-btn { margin: 1px 0 0; }
.check-btn.is-auto { cursor: default; }
.sess-main { display: grid; gap: 4px; min-width: 0; }
.sess-title { font-size: 14px; line-height: 19px; overflow-wrap: anywhere; }
.sess-text { font-size: 12px; line-height: 16px; color: var(--ink-2); overflow-wrap: anywhere; }
.sess.is-done .sess-title { color: var(--muted); text-decoration: line-through; }
.sess.is-missed { box-shadow: inset 3px 0 0 #c9776a; padding-left: 11px; }
.sess.is-compact { padding: 8px 0; border-bottom: 0; }
.sess.is-compact .labels .label { font-size: 9.5px; line-height: 15px; padding: 0 5px; }
.sess.is-compact .sess-title { font-size: 13px; line-height: 17px; }
.sess.is-compact.is-missed { padding-left: 11px; }
.fuel-row {
  appearance: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; width: 100%;
  display: grid; gap: 4px; padding: 12px; border: 1px solid var(--edge); background: var(--card);
}
.fuel-row:hover { box-shadow: 4px 4px 0 var(--ink); }
:root[data-theme="night"] .fuel-row:hover { box-shadow: 4px 4px 0 var(--signal); }
.fuel-title { font-size: 17px; font-weight: 600; }
.fuel-text { font-size: 12.5px; line-height: 17px; color: var(--ink-2); }
.wk-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wk-day { min-width: 0; padding: 12px 12px 14px; display: grid; gap: 6px; align-content: start; border-bottom: 1px solid var(--line); }
.wk-day + .wk-day { border-left: 1px solid var(--line); }
.wk-day:first-child { padding-left: 0; }
.wk-day.is-today { box-shadow: inset 0 4px 0 var(--signal); }
.wk-day.is-future .wk-name { color: var(--muted); }
.wk-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wk-name { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.wk-focus, .wk-rest { font-size: 12.5px; color: var(--muted); }
.wk-wos { display: grid; gap: 3px; padding-top: 6px; border-top: 1px dashed var(--line); }
.wk-wos li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.wk-wos .wo-ico { flex: none; }
.wk-wos .wo-ico .i { width: 14px; height: 14px; }
.wk-burn { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--muted); }
.sec-today .day-nav { align-self: center; }
.day-nav-label:disabled { cursor: default; color: var(--muted); background: none; }
.cal-dots i.is-plan { opacity: 0.4; }

/* Nutrition */
.page .list-diary { grid-column: span 2; }
.page .chat-log { max-height: min(640px, 70vh); overflow-y: auto; padding-top: 8px; }
.page .diary-sum { border: 1px solid var(--edge); background: var(--card); margin-top: 12px; }
.page .diary-add { margin-top: 12px; }

/* Brain */
.page .list-map { grid-column: span 2; height: auto; }
.page .map-wrap { height: clamp(440px, 64vh, 720px); margin: 12px 0 0; background-color: var(--card); }
.page .fact-group { padding-left: 0; }

/* Edits: one queue, read top to bottom */
.page-stack { grid-template-columns: minmax(0, 960px); }
/* Builds: a tile for each project */
.make-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; padding-top: 12px; }
.make-tile .tcard-main { min-height: 96px; }
/* One project's page */
.make-head { display: grid; gap: 10px; }
.make-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.make-title { font-family: var(--display); font-stretch: 112%; font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.make-add { order: 0; }

@media (max-width: 1360px) {
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .today-col:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 14px; }
  .wk-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wk-day:nth-child(5) { border-left: 0; padding-left: 0; }
}
@media (max-width: 900px) {
  .page .list-diary, .page .list-map { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .page { padding: 14px 14px 32px; gap: 28px; }
  .today-grid, .today-grid.no-wos { grid-template-columns: minmax(0, 1fr); }
  .today-col + .today-col, .today-col:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 14px; }
  .wk-row { grid-template-columns: minmax(0, 1fr); }
  .wk-day, .wk-day + .wk-day, .wk-day:first-child { border-left: 0; padding: 10px 0; }
  .wk-day.is-today { box-shadow: inset 4px 0 0 var(--signal); padding-left: 12px; }
  .page .map-wrap { height: 420px; }
}

/* ---------- Compact Home header and crew portraits (27 Nov 2026) ----------
   Search everything moved to the top bar (a magnifier that opens a field). Home's header is the date
   and a Less/More button, one line of reminders, email and sessions, then calories, markets and news,
   which Less folds away (remembered per device). Small crew spots show a head-and-shoulders portrait
   cut from the same picture, so a 24px figure is still recognisable. */
.appbar-search { flex: 0 1 340px; min-width: 0; display: flex; align-items: center; gap: 4px; }
.appbar-search[hidden] { display: none; }
.appbar-search .search { order: 0; flex: 1; min-width: 0; width: auto; height: 34px; margin: 0; }
.appbar-search .search input { width: 100%; min-width: 0; font-size: 15px; }
.is-searching #search-open { display: none; }

.home-head { grid-template-areas: "title markets fold" "summary markets fold"; }
.home-head .home-fold { grid-area: fold; align-self: start; }
.home-fold {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--edge); background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.home-fold:hover { background: var(--hover); color: var(--ink); }
.home-fold .i { width: 14px; height: 14px; }
.board-bar-home.is-folded :is(#markets, #ticker, .sum-more) { display: none !important; }

.sum-main, .sum-more { display: contents; }
.sum-link .sum-ico, .sum-short, .date-short { display: none; }
.ticker-label { gap: 0; }

/* portraits: --pt is the box; --iw is the picture's width and cx/cy/cw the square to show, in the picture's pixels */
.pt-alfred { --sprite: var(--sp-alfred); --iw: 148; --cw: 112; --cx: 34; --cy: 26; }
.pt-harry { --sprite: var(--sp-harry); --iw: 142; --cw: 104; --cx: 20; --cy: 4; }
.pt-pika { --sprite: var(--sp-pika); --iw: 273; --cw: 210; --cx: 22; --cy: 10; }
.pt-monkey { --sprite: var(--sp-monkey); --iw: 278; --cw: 160; --cx: 40; --cy: 0; }
.portrait, .side-note::before, #builds-sub::before, .ask::before {
  background-image: var(--sprite); background-repeat: no-repeat;
  background-size: calc(var(--pt, 32px) * var(--iw) / var(--cw)) auto;
  background-position: calc(var(--pt, 32px) * var(--cx) / var(--cw) * -1) calc(var(--pt, 32px) * var(--cy) / var(--cw) * -1);
}
.side-note::before { --pt: 56px; width: 56px; height: 56px; }
#builds-sub::before { --pt: 26px; width: 26px; height: 26px; vertical-align: -8px; }
.ask::before { --pt: 30px; width: 30px; height: 30px; margin-left: 2px; }
.why-alfred { --pt: 52px; width: 52px; height: 52px; background-color: #EFEBE1; clip-path: var(--chamfer); }
.pika-run { --pt: 28px; width: 28px; height: 28px; }
.btn .pika-run { --pt: 20px; width: 20px; height: 20px; vertical-align: -5px; }

@media (max-width: 760px) {
  .home-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title fold" "summary summary" "markets markets"; column-gap: 12px; row-gap: 8px; }
  .home-head .board-title { font-size: 22px; line-height: 28px; }
  .home-head .home-fold { align-self: center; height: 30px; }
  .date-long { display: none; }
  .date-short { display: inline; }
  .summary { display: grid; gap: 6px; padding: 0; font-size: 14px; }
  .sum-main { display: flex; align-items: baseline; gap: 18px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .sum-main::-webkit-scrollbar { display: none; }
  .sum-main > .sum-sep, .sum-more > .sum-sep { display: none; }
  .sum-more { display: flex; }
  .sum-link { flex: none; }
  .sum-long { display: none; }
  .sum-short { display: inline; }
  .sum-link .sum-ico { display: inline-block; width: 15px; height: 15px; margin-right: 5px; vertical-align: -2px; color: var(--ink-2); }
  .sum-link.is-alert .sum-ico { color: #B3361A; }
  :root[data-theme="night"] .sum-link.is-alert .sum-ico { color: #FF7446; }
  .wx-place-name { display: none; }
  .appbar-search { flex: 1 1 auto; }
  .appbar-search .search input { font-size: 16px; }
  .is-searching .appbar > .brand-mobile, .is-searching .wx-strip, .is-searching .appbar-end { display: none; }
}

/* importance on reminders and home tasks: low yellow, medium orange, high vermilion */
.tcard.lvl-1 { --lvl: var(--marigold); }
.tcard.lvl-2 { --lvl: var(--tangerine); }
.tcard.lvl-3 { --lvl: var(--signal); }
.tcard.has-lvl { border-left: 5px solid var(--lvl); }
.badge.is-lvl { background: var(--lvl); color: #111110; padding: 0 5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tool-lvl { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: -0.05em; }
.tool-lvl.is-on { color: var(--ink); }
