:root {
  --accent: #dc4c3e;
  --accent-hover: #c3392c;
  --bg: #ffffff;
  --side: #fcfaf8;
  --side-hover: #f2efed;
  --side-active: #ffefe5;
  --side-active-text: #a81f00;
  --text: #202020;
  --muted: #666666;
  --faint: #999999;
  --line: #f0f0f0;
  --line-strong: #e6e6e6;
  --field: #ffffff;
  --shadow: 0 8px 30px rgba(0, 0, 0, .16);
  --p1: #d1453b; --p1-bg: rgba(209, 69, 59, .1);
  --p2: #eb8909; --p2-bg: rgba(235, 137, 9, .1);
  --p3: #246fe0; --p3-bg: rgba(36, 111, 224, .1);
  --p4: #999999; --p4-bg: transparent;
  --overdue: #d1453b; --today: #058527; --tomorrow: #ad6200; --week: #692fc2;
  color-scheme: light;
}
/* Dark: chosen in Settings, or by the system when auto dark mode is on. The
   media query only covers pages without theme.js, such as the login page. */
:root[data-mode="dark"] {
  --bg: #1e1e1e; --side: #282828; --side-hover: #333333; --side-active: #3a2a26;
  --side-active-text: #ff9a85; --text: #e8e8e8; --muted: #aaaaaa; --faint: #808080;
  --line: #3d3d3d; --line-strong: #4d4d4d; --field: #262626; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  --p1: #ff7066; --p1-bg: rgba(255, 112, 102, .14); --p2: #ff9a14; --p2-bg: rgba(255, 154, 20, .14);
  --p3: #5297ff; --p3-bg: rgba(82, 151, 255, .14); --p4: #8a8a8a;
  --overdue: #ff7066; --today: #25b84c; --tomorrow: #ff9a14; --week: #a970ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --bg: #1e1e1e; --side: #282828; --side-hover: #333333; --side-active: #3a2a26;
    --side-active-text: #ff9a85; --text: #e8e8e8; --muted: #aaaaaa; --faint: #808080;
    --line: #3d3d3d; --line-strong: #4d4d4d; --field: #262626; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    --p1: #ff7066; --p1-bg: rgba(255, 112, 102, .14); --p2: #ff9a14; --p2-bg: rgba(255, 154, 20, .14);
    --p3: #5297ff; --p3-bg: rgba(82, 151, 255, .14); --p4: #8a8a8a;
    --overdue: #ff7066; --today: #25b84c; --tomorrow: #ff9a14; --week: #a970ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Noto Sans", Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* Icons are drawn with masks so they follow currentColor. */
.ico, .icon-btn::before, .plus::before, .i-search, #fab::before, .nav-item .ico {
  display: inline-block; width: 18px; height: 18px; background: currentColor; flex: none;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); padding: 0;
}
.icon-btn::before { content: ""; }
/* Buttons that carry their own icon element must not paint the mask square too. */
.icon-btn:has(> .ico)::before { display: none; }
.icon-btn:hover { background: var(--side-hover); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; }
#open-side { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>'); }
#close-side, .close-btn { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.4 5 5 6.4 10.6 12 5 17.6 6.4 19l5.6-5.6 5.6 5.6 1.4-1.4-5.6-5.6L19 6.4 17.6 5 12 10.6z"/></svg>'); }
#add-project, .plus { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z"/></svg>'); }

/* Layout */
#app { display: flex; height: 100%; }
#sidebar {
  width: 280px; flex: none; background: var(--side); padding: 12px 12px 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.add-task-side {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px;
  border-radius: 6px; color: var(--side-active-text); font-weight: 600;
}
.add-task-side .plus {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); display: inline-flex;
  align-items: center; justify-content: center;
}
.add-task-side .plus::before { content: ""; background: #fff; width: 16px; height: 16px; }
.add-task-side:hover { background: var(--side-hover); }
.search {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--muted);
  border: 0; background: none; width: 100%; text-align: left; min-height: 34px;
}
.search .name { flex: 1; }
.search kbd { opacity: 0; font-size: 11px; }
.search:hover kbd { opacity: 1; }
.search:focus-within, .search:hover { background: var(--side-hover); }
.i-search { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 3a7 7 0 0 1 5.6 11.2l4.6 4.6-1.4 1.4-4.6-4.6A7 7 0 1 1 10 3zm0 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10z"/></svg>'); }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--text);
  text-decoration: none; min-height: 34px;
}
.nav-item:hover { background: var(--side-hover); }
.nav-item.active { background: var(--side-active); color: var(--side-active-text); }
.nav-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { color: var(--faint); font-size: 12px; }
.nav-item .hash { width: 18px; text-align: center; font-weight: 600; flex: none; }
.side-section {
  display: flex; align-items: center; justify-content: space-between; margin: 16px 0 2px; padding: 0 8px;
  color: var(--muted); font-weight: 600; font-size: 13px;
}
.side-foot { margin-top: auto; padding-top: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.side-foot form { margin: 0; }
.link-btn { border: 0; background: none; color: var(--muted); padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.link-btn:hover { background: var(--side-hover); color: var(--text); }

#main { flex: 1; min-width: 0; overflow-y: auto; }
.top { height: 52px; display: flex; align-items: center; justify-content: flex-end; padding: 0 16px; gap: 8px; }
.top .only-mobile { margin-right: auto; }
#view { max-width: 820px; margin: 0 auto; padding: 0 40px 120px; }
.view-title { font-size: 24px; font-weight: 700; margin: 8px 0 4px; }
.view-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.group-title {
  font-weight: 700; font-size: 14px; padding: 18px 0 8px; border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: baseline; gap: 8px;
}
.group-title .muted { font-weight: 400; color: var(--muted); }
.group-title .reschedule { margin-left: auto; font-weight: 400; color: var(--accent); background: none; border: 0; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* Task rows */
.task {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 0 8px; border-bottom: 1px solid var(--line);
  position: relative; cursor: pointer;
}
.task.sub { padding-left: 30px; }
.check {
  --c: var(--p4); --b: var(--p4-bg);
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--c); background: var(--b);
  flex: none; margin-top: 2px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.check[data-p="1"] { --c: var(--p1); --b: var(--p1-bg); border-width: 2px; }
.check[data-p="2"] { --c: var(--p2); --b: var(--p2-bg); border-width: 2px; }
.check[data-p="3"] { --c: var(--p3); --b: var(--p3-bg); border-width: 2px; }
.check::after {
  content: ""; width: 10px; height: 10px; background: var(--c); opacity: 0; transition: opacity .12s;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m9.5 16.2-4.2-4.2-1.4 1.4 5.6 5.6 12-12-1.4-1.4z"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m9.5 16.2-4.2-4.2-1.4 1.4 5.6 5.6 12-12-1.4-1.4z"/></svg>') center/contain no-repeat;
}
.check:hover::after { opacity: 1; }
/* Completing: the circle fills with a small bounce, a line is drawn across
   the title from left to right, then the row slides out and folds shut. */
.check { transition: background-color .18s ease, transform .18s ease; }
.task.done .check { background: var(--c); animation: pop .22s cubic-bezier(.34, 1.56, .64, 1); }
.task.done .check::after { opacity: 1; background: #fff; }
.title .tt {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 58% / 0 1.5px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .2s cubic-bezier(.65, 0, .35, 1), color .2s ease;
}
.task.done .title .tt { background-size: 100% 1.5px; color: var(--faint); }
.task.done .meta, .task.done .desc { opacity: .55; transition: opacity .2s ease; }
@keyframes pop { 0% { transform: scale(.85); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
.task.leaving {
  height: 0 !important; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; border-bottom-color: transparent;
  transform: translateX(14px);
  transition: height .18s cubic-bezier(.4, 0, .2, 1) .03s, padding .18s cubic-bezier(.4, 0, .2, 1) .03s,
    opacity .14s ease, transform .16s ease, border-color .14s ease;
}
/* New and returning rows fade in instead of popping. */
.task.arrive { animation: arrive .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes arrive { from { opacity: 0; transform: translateY(-4px); } }
.task-body { flex: 1; min-width: 0; }
.title { word-wrap: break-word; }
.desc { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.meta .chip { display: inline-flex; align-items: center; gap: 3px; }
.meta button.chip { border: 0; background: none; padding: 1px 4px; margin: -1px -4px; border-radius: 4px; font: inherit; color: inherit; }
.meta button.chip:hover { background: var(--side-hover); }
.meta button.chip.due.overdue { color: var(--overdue); } .meta button.chip.due.today { color: var(--today); }
.meta button.chip.due.tomorrow { color: var(--tomorrow); } .meta button.chip.due.week { color: var(--week); }
.meta .chip .ico { width: 12px; height: 12px; }
.due.overdue { color: var(--overdue); }
.due.today { color: var(--today); }
.due.tomorrow { color: var(--tomorrow); }
.due.week { color: var(--week); }
.meta .project { margin-left: auto; color: var(--faint); }
.meta .label { color: var(--faint); }
.meta .tracked { color: var(--today); }
.task .actions { position: absolute; right: 0; top: 6px; display: none; gap: 2px; background: var(--bg); }
.task:hover .actions { display: flex; }
.i-cal { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2zm12 8H5v9h14zM5 6v2h14V6z"/></svg>'); }
.i-repeat { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7h10v3l4-4-4-4v3H5v6h2zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2z"/></svg>'); }
.i-clock { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 3v5.4l3.5 2.1-1 1.7L11 13.5V7z"/></svg>'); }
.i-play { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>'); }
.i-stop { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 6h12v12H6z"/></svg>'); }
.i-sub { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 3h2v8h9V8l4 4-4 4v-3H5z"/></svg>'); }
.i-inbox { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 3h14l2 9v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7zm1.6 2-1.4 7H9a3 3 0 0 0 6 0h3.8l-1.4-7zM5 14v5h14v-5h-2.4a5 5 0 0 1-9.2 0z"/></svg>'); }
.i-today { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2zm12 8H5v9h14zm-6 2v5h-2v-5z"/></svg>'); }
.i-upcoming { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2zm12 8H5v9h14zM7 12h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2zM7 16h2v2H7zm4 0h2v2h-2z"/></svg>'); }
.i-filter { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5h16v2l-6 6v6l-4-2v-4L4 7z"/></svg>'); }
.i-done { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm4.3 4.3 1.4 1.4-7.2 7.2-4.2-4.2 1.4-1.4 2.8 2.8z"/></svg>'); }
.nav-item[data-v="inbox"] .ico { color: #246fe0; }
.nav-item[data-v="today"] .ico { color: #058527; }
.nav-item[data-v="upcoming"] .ico { color: #692fc2; }
.nav-item[data-v="filters"] .ico { color: #eb8909; }
.nav-item[data-v="done"] .ico { color: var(--faint); }
.nav-item[data-v="activity"] .ico { color: #158fad; }
.i-flag { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 3h11l-1.5 4L16 11H7v10H5z"/></svg>'); }
.i-tag { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h9l9 9-9 9-9-9zm4.5 3a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>'); }
.i-nodate { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-5.3 3.3A8 8 0 0 0 18.7 16.7zm10.6 13.4A8 8 0 0 0 5.3 7.3z"/></svg>'); }
.i-trash { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 3h6l1 2h4v2H4V5h4zM6 9h12l-1 12H7z"/></svg>'); }
.i-undo { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 5 3 10l5 5v-4h7a3 3 0 0 1 0 6h-3v2h3a5 5 0 0 0 0-10H8z"/></svg>'); }
.i-edit { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 4l5 5L9 20H4v-5zm0 2.8L6 15.8V18h2.2l9-9z"/></svg>'); }
.i-plus { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z"/></svg>'); }
.i-activity { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 3l4 13 2.6-7H21v2h-4.1L13 21 9 8l-2.6 5H3v-2h2.4z"/></svg>'); }

/* Inline composer */
.add-row {
  display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 10px 0; border: 0;
  background: none; width: 100%; text-align: left;
}
.add-row .plus { width: 18px; height: 18px; color: var(--accent); }
.add-row .plus::before { content: ""; width: 18px; height: 18px; }
.add-row:hover { color: var(--accent); }
.composer {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px 8px; margin: 8px 0;
  background: var(--field);
}
.composer:focus-within { border-color: var(--faint); }
.q-wrap { position: relative; }
.composer input.q, .q-mirror {
  width: 100%; border: 0; outline: none; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.5; padding: 2px 0;
  letter-spacing: normal; word-spacing: normal;
}
.q-wrap > input { position: relative; background: none; z-index: 1; }
.dlg-main .q-wrap { flex: 1; min-width: 0; }
.q-mirror.t-title { position: absolute; }
.q-mirror { position: absolute; inset: 0; white-space: pre; overflow: hidden; color: transparent; pointer-events: none; }
.q-mirror mark { color: transparent; border-radius: 3px; padding: 1px 0; box-shadow: 0 0 0 2px var(--hl); background: var(--hl); }
/* Everything understood gets the same red tint, as in Todoist; urgent is stronger. */
.q-mirror mark { --hl: color-mix(in srgb, var(--accent) 18%, transparent); }
:root[data-mode="dark"] .q-mirror mark { --hl: color-mix(in srgb, var(--accent) 34%, transparent); }
.q-mirror mark.hl-urgent { --hl: color-mix(in srgb, var(--accent) 38%, transparent); }
:root[data-mode="dark"] .q-mirror mark.hl-urgent { --hl: color-mix(in srgb, var(--accent) 55%, transparent); }
.suggest {
  position: absolute; left: 0; top: 100%; z-index: 4; min-width: 220px; max-width: 100%; margin-top: 4px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px;
}
.sug { display: flex; gap: 6px; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; }
.sug.on, .sug:hover { background: var(--side-hover); }
.sug .sigil { color: var(--faint); width: 12px; }
.sug.new { color: var(--muted); font-size: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px; }
.tool {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 3px 8px; font-size: 12px; color: var(--muted); background: none; min-height: 28px;
}
.tool:hover { background: var(--side-hover); }
.tool .ico { width: 14px; height: 14px; }
.tool.set { color: var(--text); }
.tool.due.today { color: var(--today); } .tool.due.tomorrow { color: var(--tomorrow); }
.tool.due.week { color: var(--week); } .tool.due.overdue { color: var(--overdue); }
.tool.set.p1 { color: var(--p1); } .tool.set.p2 { color: var(--p2); } .tool.set.p3 { color: var(--p3); }
.tool .x { color: var(--faint); margin-left: 2px; font-size: 14px; line-height: 1; padding: 0 2px; }
.tool .x:hover { color: var(--text); }
.composer textarea {
  width: 100%; border: 0; outline: none; background: none; resize: none; font-size: 13px; color: var(--muted);
  padding: 2px 0; min-height: 22px;
}
.composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line);
  margin-top: 6px; padding-top: 8px;
}
.composer-foot select { border: 0; background: none; color: var(--muted); font-size: 13px; max-width: 50%; }
.btns { display: flex; gap: 8px; margin-left: auto; }
.btn {
  border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 600; font-size: 13px; background: var(--side-hover);
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.danger { background: none; color: var(--overdue); }
.hint { color: var(--faint); font-size: 12px; }

/* Popovers */
.popover {
  position: fixed; z-index: 30; width: 260px; max-height: min(420px, calc(100vh - 16px)); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.popover > input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px; background: var(--field); margin-bottom: 4px; }
.pop-head { font-weight: 700; padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 7px 8px;
  border-radius: 6px; text-align: left; cursor: pointer;
}
.pop-item:hover, .pop-item.on { background: var(--side-hover); }
.pop-item .name { flex: 1; }
.pop-item .aside { color: var(--faint); font-size: 12px; }
.pop-item input[type="checkbox"] { margin: 0; accent-color: var(--accent); }
.pop-item[data-d="today"] .ico { color: var(--today); }
.pop-item[data-d="tomorrow"] .ico { color: var(--tomorrow); }
.pop-item[data-d="weekend"] .ico { color: var(--p3); }
.pop-item[data-d="nextweek"] .ico { color: var(--week); }
.pop-item[data-d="none"] .ico { color: var(--faint); }
.pop-row { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.pop-row input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 6px; background: var(--field); }
.pop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; }
.pop-pill { border: 1px solid var(--line-strong); background: none; border-radius: 6px; padding: 6px 0; }
.pop-pill.on, .pop-pill:hover { background: var(--side-hover); }
.flag {
  width: 16px; height: 16px; background: var(--p4); flex: none;
  -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat;
}
.flag[data-p="1"] { background: var(--p1); } .flag[data-p="2"] { background: var(--p2); } .flag[data-p="3"] { background: var(--p3); }
.hint.pad { padding: 8px; }

/* Activity */
.segments { display: inline-flex; gap: 2px; background: var(--side-hover); border-radius: 8px; padding: 3px; margin-bottom: 4px; flex-wrap: wrap; }
.segments button { border: 0; background: none; border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.segments button.on { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.event { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.event .dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: var(--side-hover); color: var(--muted);
}
.event .dot .ico { width: 14px; height: 14px; }
.event.k-completed .dot { background: var(--p3-bg); color: var(--today); }
.event.k-deleted .dot, .event.k-project_deleted .dot { color: var(--overdue); }
.event.k-added .dot, .event.k-project_added .dot { color: var(--accent); }
.event-body { flex: 1; min-width: 0; }
.event .verb { color: var(--muted); }
.event .what { color: var(--text); font-weight: 600; text-decoration: none; }
.event a.what:hover { text-decoration: underline; }
.event .extra { color: var(--muted); font-size: 12px; margin-top: 2px; }
.event .when { color: var(--faint); font-size: 12px; text-align: right; display: flex; flex-direction: column; gap: 2px; flex: none; }
.btn.more { display: block; margin: 16px auto; }
.task-activity { margin-top: 18px; }
.task-activity summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.task-activity .event { padding: 6px 0; }
.field-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 5px 8px; background: var(--field); text-align: left;
}
.field-btn .ico { width: 14px; height: 14px; }
.field-btn.due.today { color: var(--today); } .field-btn.due.tomorrow { color: var(--tomorrow); }
.field-btn.due.week { color: var(--week); } .field-btn.due.overdue { color: var(--overdue); }

/* Task dialog */
dialog {
  border: 0; border-radius: 12px; padding: 0; background: var(--bg); color: var(--text); box-shadow: var(--shadow);
  width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.dlg-body { display: flex; min-height: 360px; }
.dlg-main { flex: 1; padding: 16px 20px 20px; min-width: 0; }
.dlg-side { width: 270px; flex: none; background: var(--side); padding: 14px 16px; border-bottom-right-radius: 12px; }
.dlg-main .t-title {
  width: 100%; border: 0; outline: none; background: none; font-size: 20px; font-weight: 700; line-height: 1.5; padding: 2px 0; resize: none;
}
.dlg-main .t-desc { width: 100%; border: 0; outline: none; background: none; resize: vertical; min-height: 70px; color: var(--muted); }
.field { border-bottom: 1px solid var(--line-strong); padding: 10px 0; }
.field:last-child { border-bottom: 0; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; background: var(--field);
}
.row2 { display: flex; gap: 6px; align-items: flex-start; }
.row2 > input { flex: 1; min-width: 0; }
.prio { display: flex; gap: 6px; }
.prio button {
  flex: 1; border: 1px solid var(--line-strong); background: var(--field); border-radius: 6px; padding: 5px 0;
  font-weight: 700; font-size: 12px;
}
.prio button[data-p="1"] { color: var(--p1); } .prio button[data-p="2"] { color: var(--p2); }
.prio button[data-p="3"] { color: var(--p3); } .prio button[data-p="4"] { color: var(--p4); }
.prio button.on { border-color: currentColor; background: var(--side-hover); }
.label-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.label-pill {
  display: inline-flex; align-items: center; gap: 4px; background: var(--side-hover); border-radius: 12px;
  padding: 1px 8px; font-size: 12px;
}
.label-pill button { border: 0; background: none; padding: 0; color: var(--faint); }
.subtasks { margin-top: 16px; }
.subtasks h3 { font-size: 13px; margin: 0 0 4px; color: var(--muted); }
.timer-box { display: flex; align-items: center; gap: 8px; }
.timer-box .total { font-variant-numeric: tabular-nums; }
.dlg-foot { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }

#timer-pill {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 16px; padding: 4px 6px 4px 12px;
  background: var(--side-active); color: var(--side-active-text); font-size: 13px; font-weight: 600; max-width: 60vw;
}
#timer-pill .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#timer-pill .time { font-variant-numeric: tabular-nums; }
#timer-pill button { border: 0; background: none; color: inherit; padding: 2px; display: inline-flex; }

#fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 56px; height: 56px;
  border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(220, 76, 62, .45);
  display: none; align-items: center; justify-content: center; z-index: 5;
  --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z"/></svg>');
}
#fab::before { content: ""; width: 26px; height: 26px; background: #fff; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2b2b2b; color: #fff;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; display: flex; gap: 14px; align-items: center; z-index: 20;
  box-shadow: var(--shadow);
}
#toast button { border: 0; background: none; color: #ff9a85; font-weight: 700; }

.settings { padding: 18px 22px; }
.settings h2 { margin: 0 0 12px; font-size: 18px; }
.settings .field input { font-family: ui-monospace, monospace; font-size: 12px; }
.settings p { color: var(--muted); font-size: 13px; margin: 6px 0; }

.login { display: flex; align-items: center; justify-content: center; background: var(--side); }
.login-box { width: min(340px, calc(100vw - 32px)); background: var(--bg); padding: 28px; border-radius: 12px; box-shadow: var(--shadow); text-align: center; }
.login-box h1 { margin: 8px 0 18px; font-size: 22px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-box input { border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; background: var(--field); font-weight: 400; color: var(--text); }
.login-box button { border: 0; border-radius: 6px; padding: 9px; background: var(--accent); color: #fff; font-weight: 700; }
.login-box .error { color: var(--overdue); font-size: 13px; }

.only-mobile { display: none; }
#scrim { display: none; }
@media (max-width: 760px) {
  .only-mobile { display: inline-flex; }
  #sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 10; width: 300px; max-width: 86vw; transform: translateX(-110%);
    transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.side-open #sidebar { transform: none; }
  body.side-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 9; }
  #view { padding: 0 16px 120px; }
  .top { justify-content: space-between; padding: 0 8px; }
  #fab { display: inline-flex; }
  .dlg-body { flex-direction: column; }
  .dlg-side { width: auto; border-radius: 0 0 12px 12px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .task .actions { display: none !important; }
  .meta .project { margin-left: 0; }
}

/* Selection, sub-task toggles, streaks, urgent */
/* Selected row: the tint reaches past the circle and the accent bar sits
   outside the row, so it never covers the priority circle. */
.task.sel { background: var(--side-hover); box-shadow: -10px 0 0 var(--side-hover); border-radius: 0 6px 6px 0; }
.task.sel::before { content: ""; position: absolute; left: -13px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--accent); }
.chev {
  display: inline-block; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); margin: 0 4px 1px 2px; transition: transform .15s;
}
.chev.open, .chip.subs.open .chev { transform: rotate(45deg); }
.meta .chip.subs { color: var(--muted); }
.meta .chip.urgent { color: var(--overdue); font-weight: 800; letter-spacing: -1px; }
.meta .chip.streak { color: #e8590c; font-weight: 600; }
.i-flame { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 2s1 3-1 6-4 4-4 8a6 6 0 0 0 12 0c0-3-2-5-2-5s0 3-2 3c0-4-3-6-3-12z"/></svg>'); }
.group-title.toggle-done {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
  align-items: center; padding-left: 0; color: var(--muted);
}

/* Goals */
.goal {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 1px 10px 1px 4px; background: none; font-size: 12px; color: var(--muted); vertical-align: middle;
}
.goal:hover { background: var(--side-hover); }
.goal .ring {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--today) var(--p), var(--line-strong) 0);
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 4.5px); mask: radial-gradient(circle, transparent 4px, #000 4.5px);
}
.goal.met { color: var(--today); border-color: var(--today); }
.goal .week { color: var(--faint); }

/* Dialog extras */
.check-field { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check-field input { width: auto; margin: 2px 0 0; accent-color: var(--accent); }
.check-field > span { margin: 0; display: flex; flex-direction: column; color: var(--text); font-size: 13px; font-weight: 600; }
.check-field small { color: var(--faint); font-weight: 400; font-size: 12px; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); flex: 1; }
label.inline input { width: 80px; }
dl.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 13px; }
dl.keys dt { text-align: right; }
dl.keys dd { margin: 0; color: var(--muted); }
kbd {
  font: 12px ui-monospace, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
  padding: 1px 6px; background: var(--side);
}

/* Todoist-style toolbar: every action is named until it holds a value. */
.tool .rep { display: inline-flex; margin-left: 4px; vertical-align: -2px; }
.tool .rep .ico { width: 12px; height: 12px; }
.tool.set.urgent { color: var(--overdue); }
.tool.set.prio .ico { color: inherit; }
.tool.proj { border: 0; color: var(--muted); padding-left: 4px; }
.tool.proj:hover { color: var(--text); }
.foot-left { min-width: 0; }
.foot-left .tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pop-field { display: flex; align-items: center; gap: 8px; padding: 6px 8px 2px; color: var(--muted); }
.pop-field select { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 6px; background: var(--field); color: var(--text); }
.i-alarm { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4a9 9 0 1 1 0 18 9 9 0 0 1 0-18zm0 2a7 7 0 1 0 0 14 7 7 0 0 0 0-14zm1 2v4.6l3 1.8-1 1.7-4-2.4V8zM5.3 1.9l1.3 1.5L2.9 6.6 1.6 5.1zm13.4 0 3.7 3.2-1.3 1.5-3.7-3.2z"/></svg>'); }
.i-hash { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 3 9.4 8h4l.6-5h2l-.6 5H19v2h-3.8l-.5 4H18v2h-3.5l-.6 5h-2l.6-5h-4l-.6 5H6l.6-5H3v-2h3.8l.5-4H4V8h3.5L8 3zm-.9 7-.5 4h4l.5-4z"/></svg>'); }

/* Command palette */
#palette { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; max-height: 70vh; display: none; flex-direction: column; overflow: hidden; }
#palette[open] { display: flex; }
.pal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-strong); color: var(--muted); }
.pal-head .ico { width: 20px; height: 20px; }
.pal-input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; color: var(--text); }
.pal-list { overflow-y: auto; padding: 4px 6px 8px; }
.pal-group { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 10px 4px; border-top: 1px solid var(--line); }
.pal-group:first-child { border-top: 0; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; }
.pal-item.on { background: var(--side-hover); }
.pal-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .aside { color: var(--faint); font-size: 12px; white-space: nowrap; }
.pal-item .due { font-size: 12px; white-space: nowrap; }
.pal-item > .ico { color: var(--muted); }
.check.mini { width: 16px; height: 16px; margin: 0; pointer-events: none; }
.i-sync { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4a8 8 0 0 1 7.4 5H22l-3.5 4L15 9h2.2A6 6 0 0 0 6.3 10.1L4.4 9.4A8 8 0 0 1 12 4zm-6.5 7 3.5 4H6.8a6 6 0 0 0 10.9 1l1.9.6A8 8 0 0 1 4.6 15H2z"/></svg>'); }
.i-help { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 11.5a1.3 1.3 0 1 1 0 2.6 1.3 1.3 0 0 1 0-2.6zM12 6a3.5 3.5 0 0 1 1.2 6.8c-.4.2-.2.7-.2 1.2h-2c0-1.3 0-2.4 1.4-3A1.5 1.5 0 1 0 10.5 9.5h-2A3.5 3.5 0 0 1 12 6z"/></svg>'); }

/* User menu */
.brand { border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 6px; color: var(--text); cursor: pointer; }
.brand:hover { background: var(--side-hover); }
.brand .chev { width: 6px; height: 6px; margin-left: 2px; }
.popover.menu { width: 280px; }
.popover .sep { border-top: 1px solid var(--line-strong); margin: 4px -6px; }
.pop-item.who .name { display: flex; flex-direction: column; }
.pop-item.who small { color: var(--muted); font-size: 12px; }
.popover form { margin: 0; }

/* Filters & Labels */
.fold-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-strong); margin-top: 20px; }
.fold-btn { display: flex; align-items: center; gap: 6px; border: 0; background: none; font-weight: 700; padding: 8px 0; color: var(--text); }
.fold-head .add-btn { color: var(--muted); }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--text);
  text-decoration: none;
}
.list-row:hover { background: var(--side-hover); }
.list-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .count { color: var(--faint); font-size: 12px; }
.list-row .warn { color: var(--overdue); font-weight: 700; }
.notice { border: 1px solid var(--p2); background: var(--p2-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 6px 0 10px; }
code.query { font: 12px ui-monospace, monospace; background: var(--side-hover); border-radius: 4px; padding: 1px 6px; }
.view-sub .link-btn { margin-left: 6px; }
.error { color: var(--overdue); font-size: 13px; }
.settings .field > span + input + .hint { margin-top: 6px; }

/* Upcoming week strip */
.week-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 8px; }
.week-head .month { font-weight: 600; }
.week-nav { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px; }
.chev-btn::before { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m9.4 6-1.4 1.4 4.6 4.6-4.6 4.6L9.4 18l6-6z"/></svg>'); }
.chev-btn.left::before { transform: rotate(180deg); }
.chev-btn:disabled { opacity: .35; cursor: default; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line-strong); margin-bottom: 4px; }
.wday { border: 0; background: none; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; border-radius: 6px; color: var(--text); }
.wday:hover:not(:disabled) { background: var(--side-hover); }
.wday .dname { font-size: 12px; color: var(--muted); }
.wday .dnum { font-weight: 600; min-width: 26px; padding: 1px 6px; border-radius: 6px; }
.wday.today .dnum { background: var(--accent); color: #fff; }
.wday.today .dname { color: var(--text); font-weight: 600; }
.wday.past { opacity: .45; cursor: default; }
.wday .dots { color: var(--faint); font-size: 10px; line-height: 1; height: 10px; letter-spacing: 1px; }

/* Settings */
#settings-dialog:has(.settings-wrap) { width: min(920px, calc(100vw - 32px)); }
.settings-wrap { display: flex; min-height: min(560px, calc(100vh - 80px)); }
.settings-nav { width: 220px; flex: none; background: var(--side); padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav h2 { font-size: 17px; margin: 0 8px 12px; }
.settings-nav .nav-item { border: 0; background: none; width: 100%; text-align: left; }
.settings-nav .nav-item.active { background: var(--side-active); }
.settings-page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line-strong); }
.settings-head h2 { margin: 0; font-size: 17px; }
.settings-body { padding: 16px 22px 22px; overflow-y: auto; }
.settings-body p { color: var(--muted); font-size: 13px; margin: 6px 0; }
.settings-body h3 { font-size: 14px; margin: 18px 0 10px; }
.switch-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.switch-row small { color: var(--muted); font-weight: 400; font-size: 12px; }
.switch { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; flex: none; margin: 1px 0 0; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.theme-card {
  position: relative; display: flex; height: 92px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
  background: #fff; padding: 0; text-align: left; color: #202020;
}
.theme-card.on { outline: 2px solid var(--tc); outline-offset: 1px; }
.theme-card .tc-side { width: 54px; background: color-mix(in srgb, var(--tc) 7%, #fff); display: flex; flex-direction: column; gap: 5px; padding: 10px 7px; }
.theme-card .tc-side i { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--tc) 22%, #fff); }
.theme-card .tc-side i:first-child { background: var(--tc); }
.theme-card .tc-main { flex: 1; padding: 9px 12px; display: flex; flex-direction: column; gap: 9px; }
.theme-card b { color: var(--tc); font-size: 13px; }
.theme-card .line { height: 6px; border-radius: 3px; background: #e6e6e6; }
.theme-card .line.short { width: 70%; }
.theme-card.dark { background: #1e1e1e; color: #e8e8e8; }
.theme-card.dark .tc-side { background: #282828; }
.theme-card.dark .tc-side i { background: #3a3a3a; }
.theme-card.dark .tc-side i:first-child { background: var(--tc); }
.theme-card.dark .line { background: #3a3a3a; }
.tc-check { position: absolute; top: 6px; right: 10px; color: var(--tc); font-weight: 700; }
@media (max-width: 760px) {
  .settings-wrap { flex-direction: column; }
  .settings-nav { width: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .settings-nav h2 { width: 100%; }
  .settings-nav .nav-item { width: auto; }
  .wday .dname { font-size: 11px; }
}
.i-palette { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.5 0 10 4 10 9 0 3.3-2.7 5-5 5h-1.6a1.5 1.5 0 0 0-1.1 2.5A2 2 0 0 1 12.8 22H12a10 10 0 0 1 0-20zm0 2a8 8 0 0 0 0 16h.6a3.5 3.5 0 0 1 2.8-6H17c1.4 0 3-1 3-3 0-3.8-3.6-7-8-7zM7.5 9a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm3-3.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm4 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z"/></svg>'); }
.i-goal { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 3a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6z"/></svg>'); }
.i-backup { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4a6 6 0 0 1 5.9 5A4.5 4.5 0 0 1 17.5 18H7a5 5 0 0 1-.9-9.9A6 6 0 0 1 12 4zm0 2a4 4 0 0 0-3.9 3.2l-.2.9-.9.1A3 3 0 0 0 7 16h10.5a2.5 2.5 0 0 0 .2-5h-1.5l-.2-1.2A4 4 0 0 0 12 6zm0 2.5 3.5 3.5h-2.5v3h-2v-3H8.5z"/></svg>'); }
.i-user { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9zm0 2a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zm0 8c4.4 0 8 2.2 8 5v3H4v-3c0-2.8 3.6-5 8-5zm0 2c-3.4 0-6 1.6-6 3v1h12v-1c0-1.4-2.6-3-6-3z"/></svg>'); }
.i-logout { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 3h8v2H5v14h8v2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm11 4 5 5-5 5-1.4-1.4 2.6-2.6H9v-2h8.2l-2.6-2.6z"/></svg>'); }

/* Motion: popovers, dialogs, the palette and the toast ease in. */
.popover { animation: pop-in .14s cubic-bezier(.2, .8, .2, 1); transform-origin: top left; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
dialog[open] { animation: dlg-in .18s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade-in .18s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }
#toast:not([hidden]) { animation: toast-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.composer { animation: arrive .2s cubic-bezier(.2, .8, .2, 1); }
.nav-item, .list-row, .pal-item, .pop-item, .tool, .btn, .wday, .icon-btn { transition: background-color .12s ease, color .12s ease; }
.task { transition: background-color .12s ease; }
.task:hover { background: color-mix(in srgb, var(--side-hover) 45%, transparent); }
.chev, .chip.subs .chev { transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* Backups */
.backup-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.backup-card .big { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--today) 18%, transparent); color: var(--today); font-weight: 800; flex: none; }
.backup-card.stale { border-color: var(--overdue); }
.backup-card.stale .big { background: var(--p1-bg); color: var(--overdue); }
.backup-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.backup-card small { color: var(--muted); font-size: 12px; }
.backup-card small.warn { color: var(--overdue); }
.backup-list { border-top: 1px solid var(--line); max-height: 260px; overflow-y: auto; }
.backup-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.backup-row .ok { color: var(--today); } .backup-row .bad { color: var(--overdue); font-weight: 700; }
.backup-row .when { width: 110px; font-variant-numeric: tabular-nums; }
.backup-row .why { flex: 1; min-width: 0; color: var(--muted); }
.backup-row .aside { color: var(--faint); font-size: 12px; white-space: nowrap; }
pre.cmd { font: 12px/1.6 ui-monospace, monospace; background: var(--side-hover); border-radius: 6px; padding: 8px 10px; overflow-x: auto; margin: 6px 0; }
.pop-item.warn-item { color: var(--overdue); }
@media (max-width: 760px) { .backup-card { flex-wrap: wrap; } .backup-row .when { width: 90px; } }

/* Task window: arrows, ⋯ menu, repeat options */
.dlg-tools { display: flex; align-items: center; gap: 2px; }
.chev-btn.up::before { transform: rotate(-90deg); }
.chev-btn.down::before { transform: rotate(90deg); }
.more-btn { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 10.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm6 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm6 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z"/></svg>'); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.pop-note { color: var(--muted); font-size: 12px; padding: 6px 8px; }
.pop-item.danger { color: var(--overdue); }
.repeat-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.repeat-opts .check-field > span { font-weight: 600; }
.sub-field { display: flex; flex-direction: column; gap: 4px; }
.sub-field small { color: var(--muted); font-size: 12px; font-weight: 600; }
.subtasks h3 { display: flex; align-items: baseline; gap: 6px; }
.subtasks h3 .muted { color: var(--faint); font-weight: 400; }
.subtasks h3 .link-btn { margin-left: auto; padding: 2px 6px; }
.pop-field.check { gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.pop-field.check input { accent-color: var(--accent); margin: 0; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.radio-row input { margin: 3px 0 0; accent-color: var(--accent); }
.radio-row > span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.radio-row small { color: var(--muted); font-weight: 400; font-size: 12px; }
.i-copy { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3h11a2 2 0 0 1 2 2v11h-2V5H8zM5 7h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2zm0 2v10h10V9zm4 2h2v2h2v2h-2v2H9v-2H7v-2h2z"/></svg>'); }
.i-link { --m: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.6 13.4a1 1 0 0 0 1.4 0l4.2-4.2a3 3 0 0 0-4.2-4.2l-1.5 1.4 1.4 1.4 1.5-1.4a1 1 0 0 1 1.4 1.4L10.6 12a1 1 0 0 0 0 1.4zm2.8-2.8a1 1 0 0 0-1.4 0l-4.2 4.2a3 3 0 0 0 4.2 4.2l1.5-1.4-1.4-1.4-1.5 1.4a1 1 0 0 1-1.4-1.4L13.4 12a1 1 0 0 0 0-1.4z"/></svg>'); }
/* Scrollbars follow the theme (Firefox drew a white one in dark dialogs). */
html, dialog, .pal-list, .popover, .settings-body, .backup-list { scrollbar-color: var(--line-strong) transparent; }

/* Activity: completed tasks as a struck-through pill, as in Todoist's log */
.event-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.done-pill {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 2px 9px 2px 6px; font-weight: 400 !important; color: var(--muted) !important;
}
.done-pill .struck {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: line-through;
  text-decoration-thickness: 1px; text-decoration-color: currentColor;
}
a.done-pill:hover { background: var(--side-hover); text-decoration: none !important; }
.check.mini.done { width: 15px; height: 15px; background: var(--c); border-color: var(--c); opacity: .75; }
.check.mini.done::after { opacity: 1; background: #fff; width: 9px; height: 9px; }
.event .when { flex-direction: row; align-items: center; gap: 10px; white-space: nowrap; }
@media (max-width: 760px) { .event .when { flex-direction: column; align-items: flex-end; gap: 2px; } }

/* Task window side panel: label, then value as icon + text (Todoist layout) */
.dlg-side { padding: 10px 18px 18px; }
.side-row { border-bottom: 1px solid var(--line-strong); padding: 10px 0 12px; }
.side-row:last-child { border-bottom: 0; }
.side-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none;
  padding: 2px 0; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; border-radius: 6px;
}
.side-row.empty .side-head { color: var(--text); padding: 6px 0; }
.side-row.empty .side-head:hover { color: var(--accent); }
.side-head .ico { width: 20px; height: 20px; color: var(--muted); }
.side-row:not(.empty) .side-head { pointer-events: none; }
.side-body { margin-top: 6px; }
.side-value {
  display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 5px 8px; margin-left: -8px;
  border-radius: 6px; color: var(--text); font-size: 14px; max-width: calc(100% + 8px); text-align: left;
}
.side-value:hover { background: var(--side-hover); }
.side-value > span:not(.ico):not(.flag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-value .ico, .side-value .flag { width: 18px; height: 18px; flex: none; }
.side-value.due.today { color: var(--today); } .side-value.due.tomorrow { color: var(--tomorrow); }
.side-value.due.week { color: var(--week); } .side-value.due.overdue { color: var(--overdue); }
.side-value.urgent { color: var(--overdue); }
.side-value .rep { display: inline-flex; margin-left: -4px; }
.side-value .rep .ico { width: 15px; height: 15px; }
.side-stack { display: flex; flex-direction: column; align-items: flex-start; }
.side-note { color: var(--faint); font-size: 12px; margin-top: 1px; }
.side-more { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 0; margin-top: 4px; }
.side-more:hover { color: var(--accent); }
.side-more .ico { width: 16px; height: 16px; }
.dlg-side .label-list { margin: 0; }
.label-pill .ico { width: 13px; height: 13px; color: var(--muted); }
.label-pill { padding: 2px 8px 2px 6px; }
.side-timer { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.timer-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.timer-btn:hover { background: var(--side-hover); }
.timer-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.timer-btn .ico { width: 18px; height: 18px; }
.desc-row { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); margin: 4px 0 0 2px; }
.desc-row > .ico { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.dlg-main .t-desc { min-height: 0; resize: none; overflow: hidden; padding: 2px 0; line-height: 1.5; }
.pop-field select { color: var(--text); }

/* The circle sits on the centre of the title's first line: rows use a fixed
   20px line (circle 18px, 1px above and below), the task window's 20px title
   a 30px line with a 20px circle 5px down from its 2px padding. Measured in
   Firefox: 0 px off in both places (was +0.9 and -6). */
.task .title { line-height: 20px; }
.task > .check { margin-top: 1px; }
.dlg-main .row2 { align-items: flex-start; gap: 10px; }
.dlg-main .row2 > .check { width: 20px; height: 20px; margin-top: 7px; }
.dlg-main .row2 > .check::after { width: 11px; height: 11px; }

/* Sidebar: notifications bell and hide/show (m) */
.side-tools { display: flex; align-items: center; gap: 2px; }
#bell { position: relative; }
#bell .dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--p2); box-shadow: 0 0 0 2px var(--side); }
#bell.active { color: var(--accent); background: var(--side-active); }
.only-desktop { display: inline-flex; }
#show-side { display: none; margin-right: auto; }
body.side-hidden #show-side { display: inline-flex; }
@media (min-width: 761px) {
  #sidebar { margin-left: 0; opacity: 1; visibility: visible; }
  body.side-ready #sidebar {
    transition: margin-left .35s cubic-bezier(.4, 0, .2, 1), opacity .25s ease, visibility 0s;
  }
  body.side-hidden #sidebar {
    margin-left: -280px; opacity: 0; visibility: hidden; pointer-events: none;
    transition-delay: 0s, 0s, .35s;
  }
}
@media (max-width: 760px) {
  .only-desktop, body.side-hidden #show-side { display: none !important; }
}

/* Notifications */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-btn.with-ico { display: inline-flex; align-items: center; gap: 6px; }
.link-btn.with-ico .ico { width: 18px; height: 18px; }
.seg-count { margin-left: 6px; font-size: 12px; color: var(--muted); }
.note { display: flex; gap: 14px; align-items: flex-start; padding: 14px 10px 14px 12px; border-bottom: 1px solid var(--line-strong); position: relative; }
.note.unread { background: color-mix(in srgb, var(--side-hover) 55%, transparent); }
.note.unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.note-ico { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--side-hover); color: var(--accent); }
.note-ico .ico { width: 20px; height: 20px; }
.note.k-goal .note-ico, .note.k-karma .note-ico { color: var(--today); }
.note.k-backup .note-ico { color: var(--overdue); }
.note.k-reminder .note-ico { color: var(--p3); }
.note-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; border: 0; background: none; text-align: left; padding: 0; color: var(--text); }
.note-text { color: var(--muted); font-size: 13px; }
.note-when { color: var(--faint); font-size: 12px; }
.note-read { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--muted); background: none; flex: none; margin-top: 8px; padding: 0; }
.note.unread .note-read { background: radial-gradient(circle, var(--text) 0 4px, transparent 4.5px); }

/* Productivity dialog */
#productivity-dialog { width: min(620px, calc(100vw - 32px)); }
.prod-body { padding: 14px 22px 22px; }
.prod-total { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.accent { color: var(--accent) !important; text-decoration: underline; background: none; border: 0; }
.segments.center { display: flex; width: max-content; margin: 16px auto 8px; }
.goal-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 16px; border-bottom: 1px solid var(--line-strong); }
.medal { width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; color: var(--muted); margin-bottom: 8px; }
.medal::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--today) var(--p), var(--line-strong) 0);
  -webkit-mask: radial-gradient(circle, transparent 37px, #000 38px); mask: radial-gradient(circle, transparent 37px, #000 38px); }
.medal .ico { width: 40px; height: 40px; }
.medal.met { color: var(--today); }
.goal-line { font-size: 15px; }
.streak { text-align: center; padding: 14px 0; border-bottom: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 4px; }
.hint.warn { color: var(--p2); }
.prod-body h3 { font-size: 14px; margin: 16px 0 10px; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 32px; align-items: center; gap: 8px; font-size: 12px; }
.bar-label { color: var(--muted); }
.bar-track { position: relative; display: flex; height: 12px; background: var(--side-hover); border-radius: 3px; overflow: visible; }
.bar-track .seg { height: 100%; }
.bar-track .seg:first-child { border-radius: 3px 0 0 3px; }
.goal-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; border-radius: 1px; }
.bar-count { font-weight: 700; text-align: right; }
.bar-row.met .bar-count { color: var(--today); }
.karma-head { display: flex; align-items: center; gap: 14px; padding: 8px 0 10px; }
.karma-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--p1-bg); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.karma-ico .ico { width: 28px; height: 28px; }
.karma-level { font-size: 20px; font-weight: 700; }
.karma-points { color: var(--muted); }
.karma-next { display: flex; flex-direction: column; gap: 6px; }
.karma-progress { height: 8px; border-radius: 4px; background: var(--side-hover); overflow: hidden; }
.karma-progress span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.spark { width: 100%; height: 76px; color: var(--accent); display: block; }
.karma-log { display: flex; flex-direction: column; }
.karma-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.karma-row .delta { width: 42px; font-weight: 700; color: var(--today); text-align: right; }
.karma-row .delta.neg { color: var(--overdue); }
.karma-row .why { flex: 1; }
.days-off { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 8px; font-size: 13px; cursor: pointer; }
.day-chip input { width: auto; margin: 0; accent-color: var(--accent); }

/* Settings v2: search, sections and controls */
.settings-nav { overflow-y: auto; max-height: calc(100vh - 80px); }
.set-search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 9px; margin: 0 2px 10px; color: var(--muted); background: var(--field); }
.set-search-box .ico { width: 18px; height: 18px; }
.set-search { border: 0; outline: none; background: none; flex: 1; min-width: 0; color: var(--text); }
.settings-body { display: flex; flex-direction: column; gap: 4px; }
.set-section { padding: 10px 0 14px; border-bottom: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 8px; }
.set-section:last-child { border-bottom: 0; }
.set-section h3 { margin: 4px 0 2px; font-size: 14px; }
.set-note { color: var(--muted); font-size: 13px; margin: 2px 0; }
.set-field { display: flex; flex-direction: column; gap: 5px; max-width: 420px; font-size: 13px; }
.set-field > span { font-weight: 600; }
.set-field small { color: var(--muted); font-size: 12px; }
.set-field select, .set-field input, .stack input, .token-form input {
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; background: var(--field); color: var(--text);
}
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.set-row > div { display: flex; flex-direction: column; gap: 2px; }
.set-row small { color: var(--muted); font-size: 12px; }
.switch-row.disabled { opacity: .55; }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.inline-check input { accent-color: var(--accent); }
.btn.danger-outline { background: none; border: 1px solid var(--overdue); color: var(--overdue); }
.btns.left { margin-left: 0; flex-wrap: wrap; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--today); margin: 0; font-size: 13px; }
.ok-line .ico { width: 18px; height: 18px; }
.set-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px ui-monospace, monospace;
  background: var(--side-hover); border-radius: 6px; padding: 8px 10px; }
.who-card { display: flex; align-items: center; gap: 14px; }
.who-card > div { display: flex; flex-direction: column; }
.who-card small { color: var(--muted); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 18px; }
.stat { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.stat-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--side-hover); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.stat-ico .ico { width: 22px; height: 22px; }
.device, .token-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.device > .ico, .token-row > .ico { color: var(--muted); }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grow small { color: var(--muted); font-size: 12px; }
.badge { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--today); border: 1px solid currentColor; border-radius: 10px; padding: 0 6px; }
.token-form { display: flex; gap: 8px; max-width: 520px; }
.token-form input { flex: 1; min-width: 0; }
.token-new { border: 1px solid var(--today); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.api-table { border-collapse: collapse; font-size: 12px; }
.api-table td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.api-table code { font: 12px ui-monospace, monospace; }
.api-table .m-get { color: var(--today); } .api-table .m-post { color: var(--p3); } .api-table .m-patch { color: var(--p2); } .api-table .m-delete { color: var(--overdue); }
.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.matrix th { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; }
.matrix th:first-child { text-align: left; }
.matrix td { border-top: 1px solid var(--line); padding: 8px 6px; text-align: center; }
.matrix td:first-child { text-align: left; }
.matrix td small { display: block; color: var(--muted); font-size: 12px; }
.matrix input { width: 16px; height: 16px; accent-color: var(--accent); }
.test-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.preview-note { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; min-width: 240px; }
.preview-note > div { display: flex; flex-direction: column; flex: 1; }
.preview-note small { color: var(--muted); }
.pn-ico { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.check-list { display: flex; flex-direction: column; gap: 4px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; }
.check-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.check-item .ico { color: var(--muted); }
.example { border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px; max-width: 320px; background: var(--side); }
.qa-list { border: 1px solid var(--line-strong); border-radius: 8px; max-width: 420px; overflow: hidden; }
.qa-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--field); cursor: grab; }
.qa-row:last-child { border-bottom: 0; }
.qa-row.off .name, .qa-row.off > .ico { opacity: .45; }
.qa-row.dragging { opacity: .4; }
.qa-row .name { flex: 1; }
.qa-toggle { width: 20px; height: 20px; border-radius: 50%; border: 0; color: #fff; font-weight: 700; line-height: 1; padding: 0; }
.qa-toggle.remove { background: var(--overdue); } .qa-toggle.add { background: var(--today); }
.qa-lock { width: 20px; text-align: center; font-size: 12px; }
.qa-move { display: flex; }
.qa-preview { pointer-events: none; max-width: 640px; }
.qa-preview .placeholder { color: var(--faint); font-weight: 600; font-size: 15px; padding: 2px 0; }
/* Theme cards with both sides */
.theme-card.v2 { display: flex; flex-direction: column; height: auto; padding: 0; background: var(--field); color: var(--text); }
.tc-preview { display: flex; height: 70px; }
.tc-half { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--tc-bg); border-left: 10px solid var(--tc-side); }
.tc-half.light { --tc-bg: #fff; --tc-side: #f5f5f5; --tc-text: #ddd; }
.tc-half.dark { --tc-bg: #1e1e1e; --tc-side: #282828; --tc-text: #3a3a3a; }
.tc-half .tc-bar { height: 6px; width: 60%; border-radius: 3px; background: var(--tc); }
.tc-half .tc-line { height: 5px; border-radius: 3px; background: var(--tc-text); opacity: .35; }
.tc-half .tc-line.short { width: 70%; }
.tc-name { display: flex; justify-content: space-between; padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--tc); border-top: 1px solid var(--line-strong); }
.theme-card.v2.on { outline: 2px solid var(--tc); }
.theme-card.v2 .tc-check { position: static; }
/* Goal celebration */
.confetti { position: fixed; left: 50%; top: 40%; width: 0; height: 0; z-index: 60; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: confetti 1.3s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 160px)) rotate(var(--r)); opacity: 0; }
}
@media (max-width: 760px) {
  .settings-nav { max-height: none; }
  .set-search-box { width: 100%; }
  .matrix th, .matrix td { padding: 6px 3px; }
  .token-form, .copy-row { flex-wrap: wrap; }
}
