/* Layout: one phone-width column (quick-add on top, time-bucketed list below);
   on wide screens a left rail holds categories. Boldness lives in the quick-add bar. */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --ink: #16203a;
  --muted: #5d6781;
  --line: #d9deea;
  --accent: #2f4bd8;
  --accent-ink: #ffffff;
  --mark: #ffd34d;
  --late: #c8322b;
  --ok: #1f8a5b;
  --shadow: 0 1px 2px rgba(22,32,58,.06), 0 8px 24px rgba(22,32,58,.08);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1424; --surface: #182035; --ink: #e8ecf7; --muted: #9aa4bf;
    --line: #2a3450; --accent: #7d93ff; --accent-ink: #0f1424; --mark: #f2c53d;
    --late: #ff7a70; --ok: #4cc98f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1424; --surface: #182035; --ink: #e8ecf7; --muted: #9aa4bf;
  --line: #2a3450; --accent: #7d93ff; --accent-ink: #0f1424; --mark: #f2c53d;
  --late: #ff7a70; --ok: #4cc98f; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.app { max-width: 980px; margin: 0 auto; padding: 20px 16px 120px; display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 820px) { .app { grid-template-columns: 210px 1fr; padding-top: 36px; } }

/* rail */
.rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.app > * { min-width: 0; }
.brand { font: 800 34px/1 var(--display); letter-spacing: -.03em; display: flex; align-items: baseline; gap: 6px; }
.brand span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mark); transform: translateY(-4px); }
.today-line { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
@media (min-width: 820px) { .cats { flex-direction: column; overflow: visible; } }
.cat-btn { display: flex; align-items: center; gap: 8px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
@media (min-width: 820px) { .cat-btn { border-radius: 10px; justify-content: flex-start; } }
.cat-btn .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 6px; }
.cat-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat-btn[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, var(--muted)); }
.rail-note { display: none; color: var(--muted); font-size: 13px; }
@media (min-width: 820px) { .rail-note { display: block; } }

/* quick add */
.main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.quick { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; transition: border-color .15s; }
.quick:focus-within { border-color: var(--accent); }
.quick-row { display: flex; gap: 10px; align-items: center; }
.quick input { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 20px/1.3 var(--display); letter-spacing: -.01em; padding: 6px 4px; outline: none; }
.quick input::placeholder { color: var(--muted); font-weight: 500; }
.add-btn { flex: none; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 12px; padding: 10px 16px; }
.add-btn:disabled { opacity: .4; cursor: default; }
.parse { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.pchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); animation: pop .18s ease-out; }
.pchip.cat { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); }
.pchip.pri { background: color-mix(in srgb, var(--late) 14%, transparent); color: var(--late); }
.pchip.bell { background: var(--mark); color: #2a2000; }
.hint { color: var(--muted); font-size: 13px; }
.hint kbd { font: inherit; font-weight: 700; color: var(--ink); background: var(--bg); border-radius: 5px; padding: 1px 5px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 10px; }
.suggest button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 3px 9px; font-size: 13px; color: var(--muted); }
.suggest button:hover { color: var(--ink); border-color: var(--muted); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* list */
.section { display: flex; flex-direction: column; gap: 8px; }
.section h2 { margin: 0; font: 700 13px/1 var(--body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.section h2 .count { font-variant-numeric: tabular-nums; background: var(--line); color: var(--ink); border-radius: 999px; padding: 2px 7px; letter-spacing: 0; }
.section.overdue h2 { color: var(--late); }
.section.overdue h2 .count { background: var(--late); color: var(--surface); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 14px; padding: 12px 14px; border-left: 4px solid var(--c, var(--line)); transition: opacity .25s, transform .25s; }
.item.done { opacity: .55; }
.item.done .title { text-decoration: line-through; text-decoration-thickness: 2px; }
.swipe.leaving .item { opacity: 0; transform: translateX(16px); }

/* swipe: the task slides over a coloured action underneath */
.swipe { position: relative; border-radius: 14px; overflow: hidden; touch-action: pan-y; }
.swipe.collapsing { transition: height .2s ease-in, margin .2s ease-in; margin-top: -6px; }
.swipe-bg { position: absolute; inset: 0; display: none; align-items: center; justify-content: space-between; padding: 0 18px; font-weight: 700; color: #fff; }
.swipe-bg span { display: inline-flex; align-items: center; gap: 8px; opacity: .55; transition: opacity .12s, transform .12s; }
.swipe-bg svg { width: 18px; height: 18px; }
.swipe[data-dir] .swipe-bg { display: flex; }
.swipe[data-dir="edit"] .swipe-bg { background: var(--accent); color: var(--accent-ink); }
.swipe[data-dir="del"] .swipe-bg { background: var(--late); }
.swipe[data-dir="edit"] .sw-del, .swipe[data-dir="del"] .sw-edit { visibility: hidden; }
.swipe.armed .swipe-bg span { opacity: 1; transform: scale(1.08); }
.swipe.swiping .item { user-select: none; -webkit-user-select: none; transition: none; }
.scrim.confirm-scrim { z-index: 25; align-items: center; padding: 16px; }
.sheet.confirm { max-width: 360px; border-radius: 20px; gap: 10px; }
.sheet.confirm p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.confirm-actions { justify-content: flex-end; padding-top: 6px; }
.btn.delete { background: var(--late); border-color: var(--late); color: #fff; }
.est-total { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0; text-transform: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.est-own { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.field .est-own input[type] { width: 120px; flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 10px; }
.cat-manage { color: var(--muted); border-style: dashed; }
.cat-manage svg { width: 14px; height: 14px; }
.sheet-note { margin: 0; color: var(--muted); font-size: 14px; }
.sheet .err { margin: 0; color: var(--late); font-weight: 700; font-size: 14px; }
.sheet .err[hidden] { display: none; }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-list > li:not(.empty) { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 8px 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.cat-list .empty { color: var(--muted); font-size: 14px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-row .dot { width: 12px; height: 12px; }
.cat-name { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font-weight: 700; }
.cat-name:hover, .cat-name:focus { border-color: var(--line); background: var(--bg); }
.cat-row .n { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.icon-btn.danger { color: var(--late); width: 36px; height: 36px; }
.icon-btn.danger svg { width: 18px; height: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 22px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: 0 0 0 2px var(--surface) inset; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch.pick { position: relative; cursor: pointer; background: conic-gradient(#e0533d, #ffd34d, #2f8f6b, #1c9bb0, #3d6be0, #b8489c, #e0533d); }
.swatch.pick::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.swatch.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; z-index: 1; }
.swatch.pick.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch.pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.cat-add { display: flex; gap: 8px; }
.cat-add input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.note-line { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-style: italic; min-width: 0; }
.note-line svg { flex: none; }
.links { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; }
.links[hidden] { display: none; }
.link-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 13px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 999px; padding: 3px 10px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-chip svg { width: 13px; height: 13px; flex: none; }
.field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical; font: inherit; color: inherit; min-height: 70px; }
.tools { display: flex; align-items: center; gap: 2px; }
.tool { border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; padding: 0; }
.tool svg { width: 18px; height: 18px; }
.tool:hover { color: var(--ink); background: var(--bg); }
.grip { cursor: grab; touch-action: none; }
.flag { padding: 0 6px; }
.swipe.lifted { z-index: 5; overflow: visible; }
.swipe.lifted .item { box-shadow: var(--shadow), 0 12px 30px rgba(10,14,28,.25); transform: scale(1.02); }
.swipe.lifted { transition: none; }
.dragging .grip { cursor: grabbing; }
.dragging { user-select: none; -webkit-user-select: none; }
.section.zone { display: none; }
.dragging .section.zone { display: flex; }
.dragging .section .empty { border: 2px dashed var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.drop-line { position: fixed; height: 3px; background: var(--accent); border-radius: 3px; z-index: 6; pointer-events: none; }
.drop-line[hidden] { display: none; }
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 6px 0 12px; }
.searchbar svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; outline: none; }
.searchbar input::-webkit-search-cancel-button { display: none; }
.searchbar:focus-within { border-color: var(--accent); }
.searchbar button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; }
.searchbar button[hidden] { display: none; }
.menu { position: fixed; z-index: 15; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 230px; display: flex; flex-direction: column; animation: pop .12s ease-out; }
.menu[hidden] { display: none; }
.menu-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px 4px; }
.menu button { border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; display: flex; justify-content: space-between; gap: 14px; font-weight: 700; }
.menu button small { color: var(--muted); font-weight: 400; }
.menu button:hover, .menu button:focus-visible { background: var(--bg); outline: none; }
.row.brand-btns { flex-wrap: nowrap; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile b { font: 800 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--ink); font-weight: 700; }
.tile small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.chart { display: flex; flex-direction: column; gap: 6px; }
.chart-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.bars { height: 130px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; align-items: end; border-bottom: 1px solid var(--line); }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline-offset: 0; }
.bar i { display: block; width: 70%; max-width: 18px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.bar.now i { background: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.bar:hover i, .bar:focus-visible i { opacity: .8; }
.bar:hover::after, .bar:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 8px; white-space: nowrap; z-index: 2; pointer-events: none; }
.bar:first-child:hover::after, .bar:first-child:focus-visible::after, .bar:nth-child(2):hover::after { left: 0; transform: none; }
.bar:last-child:hover::after, .bar:last-child:focus-visible::after, .bar:nth-last-child(2):hover::after { left: auto; right: 0; transform: none; }
.ticks { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; font-size: 11px; color: var(--muted); text-align: center; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.toast.morning .ring { background: var(--mark); animation: none; }
.toast.morning ul { grid-column: 2; margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.toast.morning li span { opacity: .7; font-size: 12px; }
.toast.morning li.late { color: color-mix(in srgb, var(--late) 60%, var(--bg)); }
.swipe-hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.toast.snack { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; }
.toast.snack span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.snack button { flex: none; border: 0; background: var(--mark); color: #2a2000; border-radius: 10px; padding: 6px 14px; font-weight: 700; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; display: grid; place-items: center; padding: 0; }
.check svg { width: 14px; height: 14px; opacity: 0; }
.item.done .check { background: var(--ok); border-color: var(--ok); }
.item.done .check svg { opacity: 1; }
.check:hover svg { opacity: .5; }
.body { min-width: 0; text-align: left; background: none; border: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.title { font-weight: 700; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.meta .late { color: var(--late); font-weight: 700; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.flag { color: var(--late); font-weight: 800; font-family: var(--display); }
.bell-ic { width: 13px; height: 13px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.done-toggle { align-self: flex-start; border: 0; background: none; color: var(--muted); font-size: 14px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(10,14,28,.45); display: none; align-items: flex-end; justify-content: center; z-index: 20; }
.scrim.open { display: flex; }
@media (min-width: 620px) { .scrim { align-items: center; } }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 14px; max-height: 92%; overflow-y: auto; animation: rise .2s ease-out; }
@media (min-width: 620px) { .sheet { border-radius: 20px; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0; font: 700 22px/1.2 var(--display); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lab { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field select { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sheet-actions { display: flex; gap: 10px; justify-content: space-between; padding-top: 4px; }
.btn { border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 10px 16px; font-weight: 700; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--late); border-color: transparent; padding-left: 4px; }

/* reminder toasts */
.toasts { position: fixed; right: 16px; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; z-index: 30; pointer-events: none; }
@media (min-width: 620px) { .toasts { left: auto; align-items: flex-end; } }
.toast { pointer-events: auto; width: 100%; max-width: 380px; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; animation: rise .25s ease-out; }
.toast .ring { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--mark); display: grid; place-items: center; color: #2a2000; animation: wiggle 1s ease-in-out 2; }
.toast strong { font-family: var(--display); font-size: 17px; }
.toast small { opacity: .75; }
.toast .acts { grid-column: 2; display: flex; gap: 8px; margin-top: 8px; }
.toast .acts button { border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent); background: transparent; color: var(--bg); border-radius: 10px; padding: 5px 12px; font-size: 14px; font-weight: 700; }
.toast .acts button.go { background: var(--mark); color: #2a2000; border-color: var(--mark); }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }


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

/* ---- added for the app ---- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--ink); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); border: 0; background: none; padding: 0; }
.badge[hidden] { display: none; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge[data-state="idle"] i { background: var(--ok); }
.badge[data-state="syncing"] i { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.badge[data-state="reconnect"] i, .badge[data-state="needs-key"] i { background: var(--mark); }
.badge[data-state="error"] i { background: var(--late); }
@keyframes pulse { 50% { opacity: .3; } }

.mic { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: var(--ink); }
.mic svg { width: 20px; height: 20px; }
.mic[aria-pressed="true"] { background: var(--late); border-color: var(--late); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.mic[hidden] { display: none; }
.banner { background: color-mix(in srgb, var(--mark) 35%, var(--surface)); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner[hidden] { display: none; }
.banner button { border: 0; background: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 0; }

.set-group { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-group h4 { margin: 0; font: 700 15px/1.2 var(--display); }
.set-group p { margin: 0; color: var(--muted); font-size: 14px; }
.set-group .err { color: var(--late); font-weight: 700; }
.code { font: 700 18px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.restore-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.restore-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.btn.small { padding: 6px 12px; font-size: 14px; }

/* compact: one line per task, less chrome, everything tighter */
.meta .m-note { display: none; }
[data-density="compact"] .app { gap: 10px; padding: 10px 10px 80px; }
@media (min-width: 820px) { [data-density="compact"] .app { padding-top: 18px; gap: 18px; grid-template-columns: 180px 1fr; } }
[data-density="compact"] .rail { gap: 10px; }
[data-density="compact"] .brand { font-size: 24px; }
[data-density="compact"] .brand span { width: 7px; height: 7px; transform: translateY(-3px); }
[data-density="compact"] .today-line { font-size: 12px; margin-top: 2px; }
[data-density="compact"] .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
[data-density="compact"] .icon-btn svg { width: 17px; height: 17px; }
[data-density="compact"] .cats { gap: 5px; }
[data-density="compact"] .cat-btn { padding: 3px 9px; font-size: 12px; gap: 6px; }
[data-density="compact"] .cat-btn .dot { width: 7px; height: 7px; }
[data-density="compact"] .main { gap: 10px; }
[data-density="compact"] .banner { padding: 6px 10px; font-size: 13px; }
[data-density="compact"] .quick { padding: 6px 6px 6px 10px; gap: 6px; border-radius: 12px; border-width: 1px; box-shadow: none; border-color: var(--line); }
[data-density="compact"] .quick:focus-within { border-color: var(--accent); }
[data-density="compact"] .quick-row { gap: 6px; }
[data-density="compact"] .quick input { font-size: 16px; padding: 2px; }
[data-density="compact"] .mic { width: 34px; height: 34px; border-radius: 10px; }
[data-density="compact"] .mic svg { width: 17px; height: 17px; }
[data-density="compact"] .add-btn { padding: 7px 12px; border-radius: 10px; font-size: 14px; }
[data-density="compact"] .parse { min-height: 0; gap: 4px; }
[data-density="compact"] .pchip { font-size: 12px; padding: 2px 8px; }
/* The hint and the quick inserts only while typing. */
[data-density="compact"] .quick:not(:focus-within) .suggest,
[data-density="compact"] .quick:not(:focus-within) .parse:has(> .hint) { display: none; }
[data-density="compact"] .suggest { padding-top: 6px; gap: 4px; }
[data-density="compact"] .suggest button { padding: 1px 7px; font-size: 12px; }
[data-density="compact"] .searchbar { border-radius: 10px; padding: 0 4px 0 10px; }
[data-density="compact"] .searchbar input { padding: 6px 0; font-size: 14px; }
[data-density="compact"] .searchbar svg { width: 15px; height: 15px; }
[data-density="compact"] .searchbar button { width: 28px; height: 28px; font-size: 18px; }
[data-density="compact"] #sections > div { gap: 12px !important; }
[data-density="compact"] .section { gap: 4px; }
[data-density="compact"] .section h2 { font-size: 11px; gap: 6px; }
[data-density="compact"] .section h2 .count { padding: 1px 6px; }
[data-density="compact"] .list { gap: 2px; }
[data-density="compact"] .swipe { border-radius: 8px; }
[data-density="compact"] .swipe.collapsing { margin-top: -2px; }
[data-density="compact"] .item { padding: 3px 4px 3px 8px; gap: 8px; border-radius: 8px; border-left-width: 3px; font-size: 14px; min-height: 36px; }
[data-density="compact"] .check { width: 20px; height: 20px; border-width: 2px; }
[data-density="compact"] .check svg { width: 11px; height: 11px; }
[data-density="compact"] .body { flex-direction: row; flex-wrap: nowrap; align-items: baseline; gap: 10px; overflow: hidden; }
[data-density="compact"] .title { flex: 0 1 auto; max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
[data-density="compact"] .meta { flex: 0 1 auto; max-width: 46%; -webkit-mask-image: linear-gradient(to left, transparent, #000 14px); mask-image: linear-gradient(to left, transparent, #000 14px); padding-right: 10px; flex-wrap: nowrap; gap: 8px; font-size: 12px; white-space: nowrap; overflow: hidden; min-width: 0; }
[data-density="compact"] .meta .t { display: none; }
[data-density="compact"] .meta .m-note { display: inline-flex; }
[data-density="compact"] .meta .bell-ic { width: 12px; height: 12px; }
[data-density="compact"] .note-line, [data-density="compact"] .item > .links { display: none; }
[data-density="compact"] .tool { width: 26px; height: 26px; border-radius: 8px; }
[data-density="compact"] .tool svg { width: 15px; height: 15px; }
[data-density="compact"] .flag { padding: 0 4px; }
[data-density="compact"] .empty { font-size: 13px; padding: 2px; }
[data-density="compact"] .done-toggle { font-size: 13px; padding: 0; }
[data-density="compact"] .swipe-hint { font-size: 12px; }
[data-density="compact"] .sheet { gap: 10px; padding: 16px 14px 18px; }
[data-density="compact"] .seg button { padding: 4px 10px; font-size: 13px; }
