:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #edeae3;
  --text: #2b2d31;
  --muted: #7a7d85;
  --line: #e2ded4;
  --accent: #5f8f78;
  --accent-ink: #ffffff;
  --accent-soft: #e2ede6;
  --c-later: #a49bc4;
  --c-next: #7aa4c9;
  --c-now: #e3a35c;
  --c-done: #7fb08f;
  --warn: #b8792c;
  --warn-soft: #f6ead8;
  --shadow: 0 1px 2px rgba(40, 35, 20, .06), 0 2px 8px rgba(40, 35, 20, .05);
  --shadow-hover: 0 2px 4px rgba(40, 35, 20, .07), 0 6px 16px rgba(40, 35, 20, .08);
  --shadow-lift: 0 14px 34px rgba(40, 35, 20, .2), 0 3px 8px rgba(40, 35, 20, .08);
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --page-max: 1680px;
  color-scheme: light;
}
/* Dark theme: follows the system unless the person picked light or dark with the toggle
   (stored as <html data-theme="light|dark">). The two dark blocks must stay identical. */
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #212429;
  --surface-2: #1a1c20;
  --text: #e8e6e1;
  --muted: #8f939b;
  --line: #2f3338;
  --accent: #7fb69a;
  --accent-ink: #0f1512;
  --accent-soft: #223329;
  --warn: #e0a85f;
  --warn-soft: #3a2f20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .3);
  --shadow-lift: 0 14px 34px rgba(0, 0, 0, .55), 0 3px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #212429;
    --surface-2: #1a1c20;
    --text: #e8e6e1;
    --muted: #8f939b;
    --line: #2f3338;
    --accent: #7fb69a;
    --accent-ink: #0f1512;
    --accent-soft: #223329;
    --warn: #e0a85f;
    --warn-soft: #3a2f20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .3);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, .55), 0 3px 8px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 2px; max-width: var(--page-max); width: 100%; margin: 0 auto;
}
.brand { display: flex; gap: 10px; align-items: center; font-weight: 650; letter-spacing: -.01em; font-size: 17px; }
.logo { width: 26px; height: 26px; border-radius: 8px; }
.top-actions { display: flex; gap: 8px; }
.pill {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; display: inline-flex; gap: 8px; align-items: center; font-size: 14px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.pill:hover { box-shadow: var(--shadow); }
.pill:active { transform: scale(.96); }
.pill.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.pill.big { padding: 12px 22px; font-size: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .3s; }
.dot[data-s="synced"] { background: var(--c-done); }
.dot[data-s="syncing"] { background: var(--c-next); animation: pulse 1s ease-in-out infinite; }
.dot[data-s="offline"], .dot[data-s="error"] { background: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- quick add ---------- */
.intro { max-width: 720px; width: 100%; margin: 4px auto 12px; padding: 0 20px; }
.greeting { color: var(--muted); margin: 8px 2px 10px; font-size: 14px; min-height: 1.45em; }
.quick-add {
  display: flex; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s;
}
.quick-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.quick-add input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 8px 0; min-width: 0; }
.quick-add input::placeholder { color: var(--muted); }
.quick-hint {
  font-size: 12px; background: var(--accent-soft); color: var(--accent);
  padding: 3px 9px; border-radius: 999px; margin-right: 6px; white-space: nowrap;
  animation: pop .25s var(--ease);
}
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.add-btn {
  width: 38px; height: 38px; flex: none; border-radius: 12px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-size: 22px; line-height: 1;
  transition: transform .15s var(--ease);
}
.add-btn:active { transform: scale(.9); }

/* ---------- progress + energy filter ---------- */
.status-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.today-progress { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-fill {
  position: relative; height: 100%; width: var(--pct, 0%); min-width: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, var(--c-next), var(--c-done));
  transition: width .9s cubic-bezier(.3, 1.25, .5, 1), background .4s;
}
.today-progress.complete .progress-fill { background: linear-gradient(90deg, var(--c-done), #e8c468); }
.progress-fill.glow { animation: glow 1.2s ease-out; }
.progress-fill.glow::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: shimmer 1s .2s ease-out;
}
@keyframes glow { 30% { filter: brightness(1.35) saturate(1.2); } }
@keyframes shimmer { to { transform: translateX(100%); } }
.progress-label { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.energy-wrap { display: flex; align-items: center; gap: 8px; flex: none; }
.energy-label { font-size: 12.5px; color: var(--muted); }
.seg.mini { padding: 2px; border-radius: 10px; }
.seg.mini button { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; flex: none; }
.filter-note {
  display: block; width: fit-content; margin: 10px auto 0; border: 0; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 12.5px;
  animation: pop .25s var(--ease);
}

/* ---------- board ---------- */
.tabs { display: none; }
/* Columns are sized to the screen: 4 across on wide landscape screens,
   3 or 2 (scroll sideways for the rest) on narrower or squarer ones. */
.board {
  --cols: 4;
  user-select: none; -webkit-user-select: none;
  position: relative; flex: 1; min-height: 0;
  display: grid; grid-auto-flow: column; gap: 16px;
  grid-auto-columns: calc((100% - (var(--cols) - 1) * 16px) / var(--cols));
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: thin;
  max-width: var(--page-max); width: 100%; margin: 0 auto; padding: 4px 20px 20px;
}
.board .column { scroll-snap-align: start; }
body.dragging .board { scroll-snap-type: none; }
@media (min-width: 761px) and (max-width: 1199px), (min-width: 761px) and (max-aspect-ratio: 5/4) {
  .board { --cols: 3; }
}
@media (min-width: 761px) and (max-width: 979px), (min-width: 761px) and (max-aspect-ratio: 1/1) {
  .board { --cols: 2; }
}
/* When not every column fits, show the column tabs so the others are one tap (or drop) away. */
@media (min-width: 761px) and (max-width: 1199px), (min-width: 761px) and (max-aspect-ratio: 5/4) {
  .tabs { display: flex; gap: 8px; max-width: var(--page-max); width: 100%; margin: 0 auto; padding: 0 20px 10px; }
}
.column {
  --col: var(--muted);
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface-2); border-radius: 18px; padding: 12px 10px 6px;
  transition: background .25s, box-shadow .25s;
}
.column[data-col="later"], [data-tab="later"] { --col: var(--c-later); }
.column[data-col="next"], [data-tab="next"] { --col: var(--c-next); }
.column[data-col="now"], [data-tab="now"] { --col: var(--c-now); }
.column[data-col="done"], [data-tab="done"] { --col: var(--c-done); }
.column.drop-target { background: color-mix(in srgb, var(--col) 12%, var(--surface-2)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--col) 40%, transparent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 6px 10px; }
.col-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.col-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--col); flex: none; }
.col-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.column.over .col-count { color: var(--warn); font-weight: 600; }
.col-note { display: none; margin: -4px 6px 10px; font-size: 12.5px; color: var(--warn); }
.col-note.show { display: block; animation: pop .3s var(--ease); }
.col-note.cheer { color: var(--accent); font-weight: 500; }
.empty {
  margin: 0 2px 8px; font-size: 13px; color: var(--muted); text-align: center;
  padding: 18px 12px; border: 1.5px dashed var(--line); border-radius: 12px;
}
.column:has(.card) .empty { display: none; }
.col-list {
  /* Shrinks to fit its cards so "+ Add" sits right under the last one; scrolls once it's full. */
  position: relative; flex: 0 1 auto; min-height: 48px; overflow-y: auto;
  padding: 2px 2px 4px; margin: 0 -2px; scrollbar-width: thin; overscroll-behavior: contain;
}

/* ---------- cards ---------- */
.card {
  position: relative; display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius); padding: 11px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: grab;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .2s, transform .2s var(--ease), opacity .2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.pressing { transform: scale(.97); transition-duration: .26s; }
.card.placeholder { background: color-mix(in srgb, var(--col) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--col) 45%, transparent); }
.card.placeholder > * { visibility: hidden; }
.ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; box-shadow: var(--shadow-lift); }
body.dragging, body.dragging * { cursor: grabbing !important; }
.card-body { flex: 1; min-width: 0; }
.card-title { overflow-wrap: anywhere; }
.column[data-col="done"] .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.card-meta:empty { display: none; }
.chip {
  font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap;
}
.chip.today { background: var(--accent-soft); color: var(--accent); }
.chip.soon { background: color-mix(in srgb, var(--c-next) 16%, var(--surface)); color: color-mix(in srgb, var(--c-next) 70%, var(--text)); }
.chip.late { background: var(--warn-soft); color: var(--warn); }

.check {
  flex: none; width: 22px; height: 22px; border-radius: 50%; padding: 0; margin-top: 1px;
  border: 1.6px solid color-mix(in srgb, var(--col, var(--muted)) 75%, var(--line));
  background: transparent; display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .3s var(--ease) .05s; }
.check:hover { border-color: var(--c-done); background: color-mix(in srgb, var(--c-done) 15%, transparent); }
.card.completing .check, .column[data-col="done"] .check, .steps li.done .check { background: var(--c-done); border-color: var(--c-done); }
.card.completing .check svg, .column[data-col="done"] .check svg, .steps li.done .check svg { stroke-dashoffset: 0; }
.card.completing .check { transform: scale(1.2); }
.card.completing .card-title { opacity: .55; transition: opacity .3s; }

.ghost-btn {
  border: 0; background: transparent; color: var(--muted); text-align: left;
  padding: 8px 10px; border-radius: 10px; font-size: 14px; transition: background .15s, color .15s;
}
.ghost-btn:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); }
.inline-add { padding: 2px 0 6px; }
.inline-add input {
  width: 100%; border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px;
  background: var(--surface); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft);
}

.confetti { position: fixed; width: 7px; height: 9px; border-radius: 2px; z-index: 1100; pointer-events: none; }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 18, 14, .3); backdrop-filter: blur(2px); z-index: 50; }
.sheet {
  position: fixed; z-index: 60; left: 50%; top: 50%; translate: -50% -50%;
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 780px); overflow: auto;
  background: var(--surface); border-radius: 22px; padding: 22px 24px 18px; box-shadow: var(--shadow-lift);
  overscroll-behavior: contain;
}
.sheet-h { margin: 0 0 8px; font-size: 20px; letter-spacing: -.01em; }
.sheet-title {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; overflow: hidden;
  font-size: 21px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; padding: 0; margin-bottom: 14px;
}
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 9px; font-size: 13px; color: var(--muted);
  display: flex; gap: 6px; align-items: center; justify-content: center; transition: background .2s, color .2s, box-shadow .2s;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.field { margin-top: 20px; }
.field-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center;
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease);
}
.chip-btn:active { transform: scale(.95); }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip-btn.subtle { border-style: dashed; color: var(--muted); }
.date-chip { cursor: pointer; overflow: hidden; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 4px 0; animation: pop .25s var(--ease); }
.steps li input { flex: 1; border: 0; outline: 0; background: transparent; padding: 6px 0; min-width: 0; }
.steps li.done input { color: var(--muted); text-decoration: line-through; }
.steps .check { --col: var(--c-done); margin-top: 0; }
.steps .x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 8px; opacity: .6; }
.steps .x:hover { opacity: 1; background: var(--surface-2); }
.step-add { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.step-add .plus { width: 22px; text-align: center; color: var(--muted); font-size: 18px; }
.step-add input { flex: 1; border: 0; border-bottom: 1px dashed var(--line); outline: 0; background: transparent; padding: 7px 0; }
.step-add input:focus { border-bottom-color: var(--accent); }
.notes {
  width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--surface-2); resize: vertical; outline: 0;
}
.notes:focus { border-color: var(--accent); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 24px; }
.sheet-foot .row { display: flex; gap: 8px; }
.danger-link { border: 0; background: none; color: var(--muted); padding: 8px 4px; font-size: 14px; }
.danger-link:hover { color: var(--warn); }
.sync-form { display: flex; gap: 8px; margin-top: 14px; }
.sync-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--surface-2); outline: 0; font-size: 16px;
}
.sync-form input:focus { border-color: var(--accent); }
.sync-form.stacked { flex-direction: column; }
.sync-form .row { display: flex; gap: 8px; }
.form-msg { min-height: 1.4em; margin: 8px 2px 0; }

/* ---------- focus mode ---------- */
.focus {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; overflow: auto;
}
.focus-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; }
.focus-inner { display: flex; flex-direction: column; align-items: center; max-width: 720px; width: 100%; }
.focus-kicker { color: var(--muted); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.focus-title { font-size: clamp(26px, 5vw, 42px); line-height: 1.2; margin: 12px 0 14px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.focus-step {
  --col: var(--c-done);
  background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; gap: 14px; align-items: center;
  max-width: 480px; width: 100%; text-align: left; box-shadow: var(--shadow); margin-top: 18px;
}
.focus-step .check { width: 28px; height: 28px; margin: 0; }
.focus-inner > .ghost-btn { margin-top: 14px; }
.focus-inner > p.muted { margin: 16px 0 0; }
.focus-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.timer-start { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.chip-btn.pomo { border-color: color-mix(in srgb, #e07a5f 45%, var(--line)); }
.timer { --ring: var(--accent); margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .3s var(--ease); }
.timer.is-break { --ring: var(--c-next); }
.timer-phase { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.timer-ring { position: relative; width: 132px; height: 132px; }
.timer svg { width: 132px; height: 132px; rotate: -90deg; }
.timer circle { fill: none; stroke-width: 5; }
.timer .track { stroke: var(--surface-2); }
.timer .prog { stroke: var(--ring); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .4s; }
.timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.is-paused .timer-text { animation: pulse 1.6s ease-in-out infinite; }
.timer-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.focus { transition: background .6s; }
.focus.on-break { background: color-mix(in srgb, var(--c-next) 9%, var(--bg)); }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; left: 50%; translate: -50% 0; bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  pointer-events: auto; background: var(--text); color: var(--bg); border-radius: 14px; padding: 11px 16px;
  font-size: 14px; display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow-lift);
}
.toast button { border: 0; background: none; color: var(--c-done); font-weight: 700; padding: 0; }

/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  .top { padding: 10px 16px 0; }
  .intro { padding: 0 16px; margin-bottom: 10px; }
  .greeting { font-size: 13.5px; }
  .energy-label { display: none; }
  .status-row { gap: 12px; margin-top: 10px; }
  .tabs { display: flex; gap: 6px; padding: 0 16px 10px; }
  .tab {
    flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
    padding: 8px 4px; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
  }
  .tab-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
  .tab.active { background: var(--text); color: var(--bg); border-color: transparent; }
  .tab.active .tab-count { color: inherit; opacity: .7; }
  .tabs.drop-mode .tab { border-style: dashed; }
  .tab.drop-hover { transform: scale(1.08); background: color-mix(in srgb, var(--col) 22%, var(--surface)); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--col) 40%, transparent); }
  .board {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom)); scroll-padding: 0 16px; scrollbar-width: none;
  }
  .board::-webkit-scrollbar { display: none; }
  .column { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
  body.dragging .board { scroll-snap-type: none; }
  .card { padding: 13px 14px; }
  .check { width: 24px; height: 24px; }
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; translate: none; width: 100%;
    border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -10px auto 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- header icon buttons, account button ---------- */
.icon-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; background: transparent; border-radius: 50%; color: var(--muted);
  transition: background .2s, color .2s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--line); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme-btn .i-sun { display: none; }
#theme-btn.is-dark .i-sun { display: block; }
#theme-btn.is-dark .i-moon { display: none; }
#theme-btn svg { animation: spin-in .4s var(--ease); }
@keyframes spin-in { from { transform: rotate(-60deg) scale(.6); opacity: 0; } }

.pill.account { position: relative; }
.pill.account .i-person { width: 16px; height: 16px; margin: -2px 6px -3px -2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; vertical-align: middle; }
.pill.account:not(.signed-in) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); font-weight: 600; }
.pill.account:not(.signed-in) .dot { display: none; }
.pill.account.signed-in { padding: 4px 12px 4px 4px; }
.pill.account.signed-in .label:empty { display: none; }
.pill.account.signed-in:has(.label:empty) { padding-right: 4px; }
.pill.account.signed-in .dot { position: absolute; left: 22px; top: 22px; width: 10px; height: 10px; border: 2px solid var(--surface); }
.pill.account.signed-in .label { color: var(--muted); font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px;
}
.avatar.big { width: 46px; height: 46px; font-size: 19px; }

/* ---------- account sheet ---------- */
.auth-seg { margin: 16px 0 14px; }
.google-btn {
  width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer;
  background: #ffffff; color: #1f1f1f; border: 1px solid #747775;
  transition: background .15s, box-shadow .15s, transform .15s var(--ease);
}
.google-btn:hover { background: #f8f9fa; box-shadow: var(--shadow); }
.google-btn:active { transform: scale(.98); }
.google-btn:disabled { opacity: .6; cursor: progress; }
.google-btn svg { width: 20px; height: 20px; flex: none; }
:root[data-theme="dark"] .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
:root[data-theme="dark"] .google-btn:hover { background: #1c1c1e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  :root:not([data-theme="light"]) .google-btn:hover { background: #1c1c1e; }
}
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 2px; color: var(--muted); font-size: 12.5px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pill.wide { justify-content: center; width: 100%; padding: 11px 16px; font-size: 15px; }
.pill:disabled { opacity: .6; cursor: progress; }
.merge-note { margin: 4px 2px 0; color: var(--accent); }
.account-head { display: flex; align-items: center; gap: 14px; }
.account-name { font-size: 18px; font-weight: 650; }
.sync-state { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; font-weight: 500; }
.link-btn { border: 0; background: none; padding: 0; color: var(--warn); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ---------- account nudge ---------- */
.nudge {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 10px 10px 14px;
  background: var(--accent-soft); border-radius: 14px; font-size: 13.5px;
}
.nudge-text { flex: 1; min-width: 0; }
.nudge-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.nudge .pill { padding: 6px 12px; font-size: 13px; }
.nudge-x, .install-x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.nudge-x:hover, .install-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }

/* ---------- feedback sheet ---------- */
.feedback-text { margin-top: 14px; min-height: 120px; }
.field-input {
  width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--surface-2); outline: 0; font-size: 15px;
}
.field-input:focus { border-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- install banner (phones) ---------- */
.install-banner {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift);
  font-size: 13.5px; max-width: 520px; margin: 0 auto;
}
.install-banner p { margin: 0; flex: 1; min-width: 0; line-height: 1.4; }
.install-banner .pill { flex: none; }
.install-icon { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.i-share { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.has-install .toasts { bottom: calc(100px + env(safe-area-inset-bottom)); }

/* Smooth colour change when switching light/dark. */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .4s, color .4s, border-color .4s, box-shadow .4s, fill .4s, stroke .4s !important;
}

@media (max-width: 760px) {
  .top-actions { gap: 4px; }
  .icon-btn { width: 34px; height: 34px; }
  .pill.account.signed-in .label { display: none; }
  .pill.account.signed-in { padding-right: 4px; }
  .nudge { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .brand .brand-name { display: none; }
}

/* ---------- Privacy / Terms links ---------- */
.app-legal {
  display: flex; justify-content: center; gap: 8px; flex: none;
  padding: 0 20px calc(8px + env(safe-area-inset-bottom)); margin-top: -10px;
  font-size: 12px; color: var(--muted); opacity: .75;
}
.app-legal a { color: inherit; text-decoration: none; }
.app-legal a:hover, .app-legal a:focus-visible { color: var(--text); text-decoration: underline; }
.legal-note { margin: 10px 2px 0; font-size: 12px; color: var(--muted); }
.legal-note a, .sheet .muted a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 760px) {
  .board { padding-bottom: 12px; }
  .app-legal { margin-top: -4px; }
}

/* ---------- delete account ---------- */
.danger-zone { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.link-btn.quiet { color: var(--muted); font-weight: 500; font-size: 13px; text-decoration: none; }
.link-btn.quiet:hover, .link-btn.quiet:focus-visible { color: #c4554d; text-decoration: underline; }
.plain-list { margin: 4px 0 10px; padding-left: 20px; }
.plain-list li { margin-bottom: 4px; }
.sheet .pill[data-export] { margin: 6px 0 4px; }
.pill.danger { background: #c4554d; border-color: transparent; color: #fff; font-weight: 600; }
.pill.danger:disabled { opacity: .45; cursor: not-allowed; }
.pill.danger:not(:disabled):hover { background: #b14941; }

/* ---------- check your inbox ---------- */
.inbox-art { display: flex; justify-content: center; margin: 2px 0 8px; animation: float-in .5s var(--ease); }
.inbox-art svg { width: 56px; height: 56px; fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.inbox-art .ping { fill: var(--c-now); stroke: var(--surface); stroke-width: 3; animation: ping 2.4s ease-in-out infinite; transform-origin: 50px 16px; }
@keyframes ping { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.25); } }
@keyframes float-in { from { transform: translateY(8px) scale(.9); opacity: 0; } }
.sheet-h.center, .center { text-align: center; }
.email-strong { color: var(--text); word-break: break-all; }
.code-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.code-input {
  width: 100%; text-align: center; font-size: 28px; font-weight: 600; letter-spacing: .5em; padding: 12px 0 12px .5em;
  font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); outline: 0;
  transition: border-color .2s, box-shadow .2s;
}
.code-input::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); letter-spacing: .5em; }
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.resend-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; text-align: center; }
.resend-btn { font-variant-numeric: tabular-nums; min-width: 132px; justify-content: center; }
.resend-btn.cooling { color: var(--muted); cursor: default; }
.resend-btn.cooling:hover { box-shadow: none; }
/* Code box: smaller, normal-spaced placeholder; digits spread out once typing starts (fits up to 10). */
.code-input { letter-spacing: normal; padding-left: 0; font-size: 18px; font-weight: 500; }
.code-input.has-code { letter-spacing: .28em; padding-left: .28em; font-size: 26px; font-weight: 600; }
.code-input::placeholder { letter-spacing: normal; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
