/* ───────────── tokens ─────────────
   Matched to the real app at app.trydroplist.com/demo: page/card colours,
   spacing and the "tint the accent at 10% for a pill, use it solid for a
   checkbox" technique. Dark mode is our own extension — the reference app
   doesn't have one — derived from the same accent hues. */
:root {
  color-scheme: light;
  --bg: oklch(100% 0 0);
  --board: oklch(98.2% 0.002 247.8);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(95.2% 0 0);
  --line: oklch(96.1% 0 0);
  --line-strong: oklch(92.8% 0.006 264.5);
  --text: oklch(27.8% 0.030 256.8);
  --text-2: oklch(37.3% 0.031 259.7);
  --muted: oklch(55.1% 0.023 264.4);
  --faint: oklch(71.4% 0.019 261.3);
  --hover: oklch(96.7% 0.003 264.5);
  --shadow-card: 0 2px 0 oklch(0% 0 0 / 0.05);
  --shadow-pop: 0 12px 32px -8px oklch(0% 0 0 / 0.18), 0 0 0 1px oklch(0% 0 0 / 0.06);
  --shadow-ghost: 0 18px 40px -10px oklch(0% 0 0 / 0.25), 0 0 0 1px oklch(0% 0 0 / 0.06);

  /* "Strawberry milk". One pastel per card colour: solid for checkboxes, and
     --tint of it mixed into the surface for pill backgrounds (color-mix, so dark
     mode re-tints against the dark surface for free). Pastels are too pale for
     text, so the few places that need a card colour as readable TEXT use the
     deeper --blue-ink / --accent-ink instead, and a tick drawn on a pastel fill
     is dark (--tick), not white. Card colour names (blue, orange, ...) are stored
     in saved data, so they keep their names and only their values change:
     blue = baby blue, orange = cream, pink = strawberry, green = mint,
     purple = lilac, brown = butter, gray = mauve. */
  --tint: 34%;
  --blue: oklch(85.0% 0.056 242.7);
  --orange: oklch(90.2% 0.061 72.6);
  --pink: oklch(78.6% 0.113 0.1);
  --green: oklch(87.6% 0.059 164.3);
  --purple: oklch(82.6% 0.081 306.2);
  --brown: oklch(90.0% 0.114 93.8);
  --gray: oklch(76.4% 0.042 348.2);
  --blue-ink: oklch(52.1% 0.102 242.8);
  --tick: oklch(28.1% 0.091 0.2);
  --selection: oklch(78.6% 0.113 0.1 / 0.4);
  --toast-action: var(--accent);

  --blue-fg: var(--blue);     --blue-bg: color-mix(in oklab, var(--blue) var(--tint), var(--surface));
  --orange-fg: var(--orange); --orange-bg: color-mix(in oklab, var(--orange) var(--tint), var(--surface));
  --pink-fg: var(--pink);     --pink-bg: color-mix(in oklab, var(--pink) var(--tint), var(--surface));
  --green-fg: var(--green);   --green-bg: color-mix(in oklab, var(--green) var(--tint), var(--surface));
  --purple-fg: var(--purple); --purple-bg: color-mix(in oklab, var(--purple) var(--tint), var(--surface));
  --brown-fg: var(--brown);   --brown-bg: color-mix(in oklab, var(--brown) var(--tint), var(--surface));
  --gray-fg: var(--gray);     --gray-bg: color-mix(in oklab, var(--gray) var(--tint), var(--surface));

  --tag-fg: var(--accent-ink);
  --tag-bg: color-mix(in oklab, var(--accent) var(--tint), var(--surface));

  --topbar-h: 60px;
  --radius-card: 20px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(20.7% 0.004 229.0);
  --board: oklch(17.7% 0.003 248.0);
  --surface: oklch(23.8% 0.004 229.0);
  --surface-2: oklch(27.8% 0.005 219.6);
  --line: oklch(100% 0 0 / 0.07);
  --line-strong: oklch(100% 0 0 / 0.13);
  --text: oklch(96.1% 0.003 264.5);
  --text-2: oklch(79.4% 0.010 258.3);
  --muted: oklch(60.4% 0.011 252.9);
  --faint: oklch(100% 0 0 / 0.24);
  --hover: oklch(100% 0 0 / 0.06);
  --shadow-card: 0 1px 2px oklch(0% 0 0 / 0.3), 0 0 0 1px oklch(100% 0 0 / 0.06);
  --shadow-pop: 0 16px 36px -8px oklch(0% 0 0 / 0.6), 0 0 0 1px oklch(100% 0 0 / 0.08);
  --shadow-ghost: 0 20px 44px -10px oklch(0% 0 0 / 0.7), 0 0 0 1px oklch(100% 0 0 / 0.1);

  --tint: 22%;
  --blue: oklch(87.9% 0.047 239.3);
  --orange: oklch(91.7% 0.050 72.0);
  --pink: oklch(82.8% 0.089 358.4);
  --green: oklch(89.7% 0.050 163.6);
  --purple: oklch(85.9% 0.066 307.1);
  --brown: oklch(91.7% 0.095 94.0);
  --gray: oklch(80.1% 0.036 350.2);
  --blue-ink: var(--blue);
  --tick: oklch(24.9% 0.079 359.7);
  --selection: oklch(82.8% 0.089 358.4 / 0.35);
  /* the toast is a light bubble in dark mode, so its action needs a deep colour, not a pastel */
  --toast-action: oklch(54.3% 0.166 2.0);

  --accent: oklch(82.8% 0.089 358.4);
  --accent-hover: oklch(79.6% 0.107 358.8);
  --accent-press: oklch(76.4% 0.126 359.3);
  --on-accent: oklch(24.9% 0.079 359.7);
  --accent-ink: oklch(87.7% 0.063 357.0);
  --focus: var(--accent);
  --wm-1: var(--pink); --wm-2: var(--orange); --wm-3: var(--blue); --wm-4: var(--purple);
  --wm-5: var(--green); --wm-6: var(--brown); --wm-7: var(--gray);

  --blue-fg: var(--blue);     --blue-bg: color-mix(in oklab, var(--blue) var(--tint), var(--surface));
  --orange-fg: var(--orange); --orange-bg: color-mix(in oklab, var(--orange) var(--tint), var(--surface));
  --pink-fg: var(--pink);     --pink-bg: color-mix(in oklab, var(--pink) var(--tint), var(--surface));
  --green-fg: var(--green);   --green-bg: color-mix(in oklab, var(--green) var(--tint), var(--surface));
  --purple-fg: var(--purple); --purple-bg: color-mix(in oklab, var(--purple) var(--tint), var(--surface));
  --brown-fg: var(--brown);   --brown-bg: color-mix(in oklab, var(--brown) var(--tint), var(--surface));
  --gray-fg: var(--gray);     --gray-bg: color-mix(in oklab, var(--gray) var(--tint), var(--surface));

  --tag-fg: var(--accent-ink);
  --tag-bg: color-mix(in oklab, var(--accent) var(--tint), var(--surface));
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}

/* ───────────── colour helpers ───────────── */
.c-blue   { --pill-bg: var(--blue-bg);   --pill-fg: var(--blue-fg); }
.c-orange { --pill-bg: var(--orange-bg); --pill-fg: var(--orange-fg); }
.c-pink   { --pill-bg: var(--pink-bg);   --pill-fg: var(--pink-fg); }
.c-green  { --pill-bg: var(--green-bg);  --pill-fg: var(--green-fg); }
.c-purple { --pill-bg: var(--purple-bg); --pill-fg: var(--purple-fg); }
.c-brown  { --pill-bg: var(--brown-bg);  --pill-fg: var(--brown-fg); }
.c-gray   { --pill-bg: var(--gray-bg);   --pill-fg: var(--gray-fg); }

/* ───────────── buttons ───────────── */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .15s, color .15s;
  flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:focus-visible, .btn:focus-visible, .seg button:focus-visible, .pill:focus-visible, .stack-name:focus-visible, .check:focus-visible, .ghost-btn:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.06);
  transition: background-color .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.96); background: var(--accent-press); }
.btn.secondary { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.secondary:hover { background: var(--hover); }
.btn.danger { background: oklch(62.6% 0.193 23.0); color: oklch(100% 0 0); }

.ghost-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px; text-align: left;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.ghost-btn:hover { background: var(--hover); color: var(--text); }
.ghost-btn svg { width: 14px; height: 14px; }

/* ───────────── top bar ───────────── */
.topbar {
  position: relative;
  z-index: 20;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar .right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.topbar .wordmark { font-size: 24px; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) var(--tint), var(--surface)); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s;
}
.demo-badge:hover { background: color-mix(in oklab, var(--accent) calc(var(--tint) + 10%), var(--surface)); }
.demo-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); flex: none; animation: demo-pulse 2s ease-in-out infinite; }
@keyframes demo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 720px) { .demo-badge .label { display: none; } }

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface-2);
}
.seg button {
  border: 0;
  height: 30px; padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: color .15s, background-color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px oklch(0% 0 0 / 0.08), 0 0 0 1px var(--line);
}

.search {
  position: relative;
  width: min(280px, 100%);
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit; font-size: 14px;
  outline: none;
  transition: border-color .15s, background-color .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--line-strong); background: var(--surface); }
.search > svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 500 11px/1 var(--font-sans);
  padding: 3px 6px; border-radius: 5px;
  color: var(--muted); background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  pointer-events: none;
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.search-toggle { display: none; }

.results {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  z-index: 40;
}
.results[hidden] { display: none; }
.results .label { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.results .tagcloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 10px 10px; }
.results .tagcloud button {
  border: 0; cursor: pointer;
  padding: 3px 9px; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  background: var(--tag-bg); color: var(--tag-fg);
}
.results .tagcloud button small { opacity: .6; margin-left: 3px; }
.result {
  display: block; width: 100%;
  padding: 9px 10px;
  border: 0; border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.result:hover, .result.active { background: var(--hover); }
.result .row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.result .where { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.result .snip { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result mark { background: var(--tag-bg); color: var(--tag-fg); border-radius: 3px; }
.results .empty { padding: 18px 10px; color: var(--muted); text-align: center; font-size: 13px; }

/* ───────────── main ───────────── */
.view {
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow: auto;
  background: var(--board);
}

/* ───────────── pills + cards ───────────── */
.pill {
  display: inline-flex; align-items: center;
  max-width: 100%;
  padding: 8px 14px;
  border: 0; border-radius: 12px;
  background: var(--pill-bg, var(--gray-bg));
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
button.pill { cursor: grab; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.pill-input {
  height: 34px; width: 180px; max-width: 100%;
  padding: 0 10px;
  border: 1.5px solid color-mix(in oklab, var(--pill-fg) 60%, var(--text)); border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 400 14px var(--font-sans);
  outline: none;
}

.card {
  position: relative;
  padding: 16px 16px 10px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.card-head {
  display: flex; align-items: center; gap: 6px;
  min-height: 26px;
  margin-bottom: 10px;
}
.card-head .spacer { flex: 1; }
.card-head .icon-btn, .card-head .chev-btn { opacity: 0; }
.card:hover .card-head .icon-btn, .card:focus-within .card-head .icon-btn, .card-head .icon-btn[aria-expanded="true"],
.card:hover .card-head .chev-btn, .card:focus-within .card-head .chev-btn, .card-head .chev-btn[aria-expanded="false"] { opacity: 1; }
@media (hover: none) { .card-head .icon-btn, .card-head .chev-btn { opacity: 1; } }
.card-meta { font-size: 12px; color: var(--muted); }

.card.flash { animation: flash 1.2s ease; }
@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 2px var(--accent), var(--shadow-card); }
  100% { box-shadow: var(--shadow-card); }
}

/* collapse chevron, shared by cards, sections and the today sidebar */
.chev-btn {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; flex: none;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--faint);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.chev-btn:hover { background: var(--hover); color: var(--muted); }
.chev-btn svg { width: 15px; height: 15px; transition: transform .18s ease; }
.chev-btn.sm { width: 18px; height: 18px; margin-top: 1px; }
.chev-btn.sm svg { width: 13px; height: 13px; }
.chev-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }

.card.collapsed > *:not(.card-head) { display: none; }
.card.archived { opacity: .55; }
.card.archived:hover { opacity: .85; }
.card-list.all-hidden::before {
  content: "all cards here are archived";
  display: grid; place-items: center;
  height: 60px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-card);
  color: var(--muted); font-size: 12.5px;
}
.pin-dot {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; flex: none;
  color: var(--accent-ink);
}
.pin-dot svg { width: 13px; height: 13px; }

/* full-screen note editor */
dialog.expand-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  height: 80vh;
  padding: 0;
  border: 0; border-radius: 20px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
dialog.expand-dialog::backdrop { background: oklch(0% 0 0 / 0.32); }
.expand-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; flex: none; }
.expand-editor { flex: 1; min-height: 0; padding: 0 20px 20px; font-size: 16px; line-height: 1.65; overflow-y: auto; }
.expand-editor .ed-mirror { min-height: 100%; }

/* ───────────── editor (textarea + highlighted mirror) ───────────── */
.ed { display: grid; position: relative; min-width: 0; }
.ed > * {
  grid-area: 1 / 1;
  margin: 0; padding: 0;
  font: inherit; line-height: inherit; letter-spacing: inherit;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.ed-mirror { color: var(--text); pointer-events: none; min-height: 1.45em; }
.ed textarea {
  display: block;
  width: 100%; height: 100%;
  border: 0; outline: none; resize: none; overflow: hidden;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
}
.ed textarea::placeholder { color: var(--faint); }
.ed textarea::selection { background: var(--selection); color: transparent; }
.tag { color: var(--tag-fg); background: var(--tag-bg); border-radius: 4px; box-shadow: 0 0 0 1.5px var(--tag-bg); }

.note-text { font-size: 16px; line-height: 1.5; color: var(--text-2); }
.note-text .ed-mirror { min-height: 4.5em; }

/* ───────────── checklist ───────────── */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 4px 4px 4px 2px;
  border-radius: 8px;
}
.item .grip {
  position: absolute; left: -18px; top: 5px;
  width: 16px; height: 22px;
  display: grid; place-items: center;
  color: var(--faint);
  cursor: grab;
  opacity: 0;
  touch-action: none;
  -webkit-touch-callout: none; user-select: none;
}
.item:hover .grip { opacity: 1; }
@media (hover: none) { .item .grip { opacity: .7; } }
.item .grip svg { width: 14px; height: 14px; }
.check {
  flex: none;
  position: relative;
  width: 22px; height: 22px;
  margin-top: 1px;
  padding: 0;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.check::after { content: ""; position: absolute; inset: -6px; } /* bigger hit area */
.check:hover { border-color: var(--pill-fg, var(--muted)); }
.check:active { transform: scale(.9); }
.check svg { width: 14px; height: 14px; margin: auto; color: var(--tick); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.check[aria-checked="true"] { background: var(--pill-fg, var(--accent)); border-color: var(--pill-fg, var(--accent)); }
.check[aria-checked="true"] svg { opacity: 1; transform: none; }
.item .ed { flex: 1; font-size: 16px; line-height: 1.5; }
.item.done .ed-mirror { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.item.done .ed textarea { caret-color: var(--muted); }
.item .from { flex: none; margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.item.item-hidden { display: none; }
.add-item { display: flex; padding-left: 2px; }
.add-item .ghost-btn { flex: 1; width: auto; padding: 6px 6px 6px 0; gap: 10px; color: var(--faint); font-size: 16px; }
.add-item .ghost-btn:hover { background: transparent; color: var(--muted); }
.add-item .ghost-btn .box { width: 22px; height: 22px; border: 2px dashed currentColor; border-radius: 6px; flex: none; }
/* the pinned "add new task" row sits above the list, like an always-open input */
.add-item:has(.add-task) { margin-bottom: 6px; }
/* "add section" is a small secondary link below the list, not a second input row */
.add-item-bottom { margin-top: 6px; }
.add-item-bottom .ghost-btn { flex: none; width: auto; padding: 4px 6px; font-size: 13px; gap: 6px; }
.add-item-bottom .ghost-btn svg { width: 14px; height: 14px; }
.list-progress { margin-left: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* section headings inside a checklist */
.item.heading { align-items: center; margin: 8px 0 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.item.heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.item.heading .heading-ed { font-weight: 700; font-size: 13px; letter-spacing: .01em; text-transform: uppercase; color: var(--muted); }
.item.heading .heading-ed textarea::placeholder { color: var(--faint); }
.section-count { flex: none; margin-top: 3px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ───────────── Today view ───────────── */
.today {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}
.today-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.today-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
}
.today-head h1 .muted { color: var(--muted); font-weight: 400; }
.today-head .nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.today-head .back-today {
  border: 0; cursor: pointer;
  height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--blue-bg); color: var(--blue-ink);
  font-weight: 600; font-size: 13px;
}
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.today-grid .card { padding: 20px 20px 16px; min-height: 420px; }
.today-grid .note-text { font-size: 16px; line-height: 1.6; }
.today-grid .note-text .ed-mirror { min-height: 340px; }
.today-grid .item .ed { font-size: 16px; }
.today-foot { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

.pinned-block { margin-top: 22px; }
.pinned-label {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: lowercase;
}
.pinned-label svg { width: 13px; height: 13px; color: var(--accent-ink); }
.pinned-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* empty state, shared by any view with nothing to show */
.view-empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px;
}
.view-empty .ve-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 50%; background: var(--surface-2); color: var(--faint); }
.view-empty .ve-icon svg { width: 20px; height: 20px; }
.view-empty h2 { margin: 0 0 8px; font: 700 17px var(--font-display); color: var(--text); }
.view-empty p { margin: 0; max-width: 360px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.view-empty .btn { margin-top: 18px; }
.empty-demo-link {
  display: inline-block; margin-top: 14px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.empty-demo-link:hover { color: var(--text); border-color: var(--line-strong); }
.col.empty-hint .empty-demo-link { margin-top: 12px; }

/* the same empty state, filling whatever board space is left instead of a fixed column width */
.col.empty-hint {
  flex: 1 1 auto;
  min-width: 300px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px 28px;
}
.col.empty-hint .ve-icon.sm { width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.col.empty-hint .ve-icon.sm svg { width: 17px; height: 17px; }
.col.empty-hint h2 { margin: 0 0 6px; font: 700 16px var(--font-display); color: var(--text); }
.col.empty-hint p { margin: 0 0 16px; max-width: 360px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ───────────── Desk view ───────────── */
.board {
  display: flex;
  align-items: stretch;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  overscroll-behavior-x: contain;
}
.col {
  flex: none;
  width: 350px;
  display: flex; flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.col:last-child { border-right: 0; }
.col-head {
  display: flex; align-items: center; gap: 4px;
  height: 56px;
  padding: 0 12px 0 16px;
  flex: none;
}
.stack-name, .col-title {
  min-width: 0;
  padding: 4px 6px;
  margin-left: -6px;
  border: 0; border-radius: 8px;
  background: transparent;
  font: 700 16px var(--font-display);
  color: var(--text);
  text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stack-name { cursor: grab; -webkit-touch-callout: none; user-select: none; }
.stack-name:hover { background: var(--hover); }
.col-head .count { display: none; } /* not shown in the reference app; kept computed in JS in case it's wanted later */
.col-head .chev-btn { opacity: 0; }
.col:hover .col-head .chev-btn, .col-head .chev-btn:focus-visible, .col-head .chev-btn[aria-expanded="false"] { opacity: 1; }
@media (hover: none) { .col-head .chev-btn { opacity: 1; } }
.col-head .spacer { flex: 1; }
.col-head .date { font-size: 12px; color: var(--muted); }
.stack-input {
  min-width: 0; flex: 1;
  height: 30px; padding: 0 6px; margin-left: -6px;
  border: 1.5px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: 700 16px var(--font-display);
  outline: none;
}
.col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 20px;
  overscroll-behavior-y: contain;
}
.card-list {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 60px;
}
.card-list:empty::before {
  content: "drop cards here";
  display: grid; place-items: center;
  height: 88px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-card);
  color: var(--muted); font-size: 13px;
}
.col-foot { display: flex; gap: 4px; margin-top: 8px; }
.col-foot .ghost-btn { width: auto; flex: 1; justify-content: center; }
.col.day { background: var(--board); }
.col.day .col-title { cursor: pointer; }
.col.day .col-title:hover { background: var(--hover); }
.col.day.collapsed { width: 48px; }
.col.day.collapsed .col-body, .col.day.collapsed .date { display: none; }
.col.day.collapsed .col-head { padding: 0 4px; justify-content: center; }
.col.day.collapsed .col-title { writing-mode: vertical-rl; padding: 8px 4px; }
.col.add { width: 260px; padding: 14px 12px; }
.col.add .ghost-btn { height: 44px; justify-content: center; border: 1.5px dashed var(--line-strong); border-radius: 14px; }

/* ───────────── Tags view ─────────────
   Unlike a Desk stack, a whole tag column IS the card: bordered, padded,
   flat 2px "sticker" shadow, sitting directly on the board background. */
.tags-board { padding: 20px 0 20px 20px; gap: 14px; align-items: flex-start; overflow-y: auto; }
.tag-col {
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-height: 100%;
}
.tag-col .col-head { height: auto; padding: 16px 16px 8px; }
.tag-col .col-body { padding: 0 16px 8px; }
.tag-title { font-style: normal; }
.tag-col.collapsed { width: 56px; }
.tag-col.collapsed .col-body { display: none; }
.tag-col.collapsed .col-head { padding: 8px 4px; justify-content: center; }
.tag-col.collapsed .tag-title { writing-mode: vertical-rl; padding: 8px 4px; }
.tag-entries { display: flex; flex-direction: column; }
.tag-entry {
  display: block; width: 100%;
  padding: 8px 0;
  border: 0; border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left; cursor: pointer;
  transition: opacity .12s ease;
}
.tag-entry:last-child { border-bottom: 0; }
.tag-entry:hover { opacity: .65; }
.tag-date { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; font-size: 11px; color: var(--muted); }
.tag-source { font-weight: 600; color: var(--faint); }
.tag-source::before { content: "\2022"; margin-right: 6px; }
.tag-snip { display: flex; align-items: flex-start; gap: 7px; font-size: 14px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.tag-snip .tag { box-shadow: none; }
/* a task's checked state, carried over read-only — same shape as the real checkbox, just inert */
.tag-check {
  flex: none; margin-top: 3px;
  width: 14px; height: 14px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  color: transparent;
}
.tag-check svg { width: 10px; height: 10px; }
.tag-snip.done { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.tag-snip.done .tag-check { background: var(--faint); border-color: var(--faint); color: var(--surface); }

/* ───────────── drag & drop ───────────── */
.placeholder { opacity: 1 !important; }
.card.placeholder, .col.placeholder, .item.placeholder { position: relative; }
.card.placeholder > *, .item.placeholder > *, .col.placeholder > * { visibility: hidden; }
.card.placeholder { background: transparent; box-shadow: none; }
.card.placeholder::after, .col.placeholder::after, .item.placeholder::after {
  content: ""; position: absolute; inset: 0;
  border: 1.5px dashed var(--line-strong);
  border-radius: inherit;
  background: var(--hover);
}
.col.placeholder::after { inset: 8px; border-radius: 14px; }
.ghost {
  position: fixed !important;
  top: 0; left: 0;
  margin: 0 !important;
  z-index: 100;
  pointer-events: none;
  box-shadow: var(--shadow-ghost) !important;
  transform-origin: 30% 20%;
  will-change: transform;
  opacity: .97;
}
.col.ghost { background: var(--board); border-radius: 14px; border: 0; overflow: hidden; }
.item.ghost { background: var(--surface); padding-left: 8px; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }

/* ───────────── popover menu ───────────── */
.menu {
  position: fixed;
  z-index: 60;
  min-width: 210px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 6px;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  animation: pop .12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu[hidden] { display: none; }
.menu .mi {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px; text-align: left;
  cursor: pointer;
}
.menu .mi:hover, .menu .mi:focus-visible { background: var(--hover); outline: none; }
.menu .mi svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu .mi.danger { color: oklch(62.6% 0.193 23.0); }
.menu .mi.danger svg { color: oklch(62.6% 0.193 23.0); }
.menu .mi .check-mark { margin-left: auto; color: var(--accent-ink); }
.menu hr { border: 0; height: 1px; margin: 5px 4px; background: var(--line); }
.menu .ml { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: lowercase; }
.menu .note { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); max-width: 260px; }
.swatches { display: flex; gap: 6px; padding: 4px 10px 8px; }
.swatch {
  width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 7px;
  background: var(--pill-bg);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pill-fg) 35%, transparent);
  cursor: pointer;
  display: grid; place-items: center;
}
.swatch::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pill-fg); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--pill-fg); }

/* ───────────── toast ───────────── */
.toasts {
  position: fixed; left: 50%; bottom: 20px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: 90;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 16px;
  border-radius: 12px;
  background: oklch(17.8% 0 0); color: oklch(100% 0 0);
  font-size: 13.5px;
  box-shadow: 0 10px 30px -8px oklch(0% 0 0 / 0.4);
  pointer-events: auto;
  animation: toast-in .2s ease-out;
  max-width: calc(100vw - 32px);
}
:root[data-theme="dark"] .toast { background: oklch(96.4% 0 0); color: oklch(17.8% 0 0); }
.toast button { border: 0; background: transparent; color: var(--toast-action); font-weight: 700; cursor: pointer; padding: 2px 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ───────────── dialog ───────────── */
dialog.confirm {
  width: min(380px, calc(100vw - 32px));
  padding: 22px;
  border: 0; border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop);
}
dialog.confirm::backdrop { background: oklch(0% 0 0 / 0.28); }
dialog.confirm h2 { margin: 0 0 6px; font: 700 18px var(--font-display); }
dialog.confirm p { margin: 0 0 20px; color: var(--text-2); }
dialog.confirm .actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ───────────── responsive ───────────── */
@media (max-width: 860px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-grid .card { min-height: 0; }
  .today-grid .note-text .ed-mirror { min-height: 220px; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 56px; --radius-card: 18px; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 8px 0 16px; gap: 8px; }
  .topbar .center { justify-self: center; }
  .topbar .search { display: none; }
  .search-toggle { display: inline-grid; }
  .topbar.searching .left, .topbar.searching .center { display: none; }
  .topbar.searching { grid-template-columns: 1fr auto; }
  .topbar.searching .search { display: block; width: 100%; }
  .topbar.searching .right { display: contents; }
  .topbar.searching .right > :not(.search) { display: none; }
  .topbar.searching .search-close { display: inline-grid; }
  .search kbd { display: none; }
  .results { position: fixed; top: calc(var(--topbar-h) + 6px); left: 8px; right: 8px; width: auto; }
  .seg button { padding: 0 10px; }
  .today { padding: 22px 16px 48px; }
  .today-head h1 { font-size: 20px; }
  .col { width: 84vw; max-width: 340px; scroll-snap-align: start; }
  .board { scroll-snap-type: x proximity; scroll-padding-left: 0; }
  .col.add { width: 60vw; }
  .tag-col { width: 84vw; max-width: 340px; scroll-snap-align: start; }
  .tags-board { scroll-snap-type: x proximity; }
  #collapse-all-btn { display: none; }
  .pinned-grid { grid-template-columns: 1fr; }
}
.search-close { display: none; }
@media (max-width: 380px) {
  .topbar .wordmark { font-size: 21px; }
  .seg button { padding: 0 8px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
