/* ===== Design tokens ===== */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --border: #ececec;
  --text: #191919;
  --text-2: #757575;
  --text-3: #a8a8a8;
  /* TickTick-style: icon rail + list sidebar in soft greys, one blue accent */
  --accent: #4772fa;
  --accent-soft: #ecf1ff;
  --accent-2: #191919;
  --highlight: #4772fa;
  --on-highlight: #ffffff;
  --btn: #4772fa;
  --on-btn: #ffffff;
  --bar: #f9f9f9;
  --rail: #f1f1f1;
  --on-bar: #191919;
  --on-bar-2: #757575;
  --hover: #efefef;
  --side-on: #e8ecf8;
  --ic-blue: #1f8cf5; --ic-yellow: #e6b800; --ic-red: #ef4d61; --ic-teal: #34a898; --ic-tan: #b39a62; --ic-green: #34a862;
  --danger: #e03e3e;
  --danger-soft: #fdecec;
  --warn: #c98a0c;
  --warn-soft: #fef4e2;
  --ok: #059669;
  --ok-soft: #e4f6ef;
  --shadow: none;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 280px;
  --rail-w: 56px;

  --chart-violet: #7c3aed; --chart-amber: #d97706; --chart-emerald: #059669; --chart-sky: #0284c7; --chart-rose: #e11d48;
  --chart-teal: #0d9488; --chart-orange: #c2410c;
  --chart-grid: #eceef4; --chart-axis: #8b92a6;
  --violet: #7c3aed; --violet-soft: #f1eaff;
  --amber: #d97706;  --amber-soft: #fff3df;
  --emerald: #059669; --emerald-soft: #e2f6ee;
  --sky: #0284c7;    --sky-soft: #e2f2fc;
  --rose: #e11d48;   --rose-soft: #fde8ee;
  --teal: #0d9488;   --teal-soft: #ddf4f1;
  --orange: #c2410c; --orange-soft: #fdeadf;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chart-violet: #8b5cf6; --chart-amber: #d97706; --chart-emerald: #059669; --chart-sky: #0284c7; --chart-rose: #f43f5e; --chart-teal: #0d9488; --chart-orange: #ea580c;
    --chart-grid: #242939; --chart-axis: #6f768b;
    --bg: #1f1f1f; --surface: #262626; --surface-2: #2b2b2b; --border: #303030; --bar: #232323; --rail: #1b1b1b;
    --text: #e3e3e3; --text-2: #9b9b9b; --text-3: #676767;
    --accent: #5b82fb; --accent-soft: #232c47; --accent-2: #e3e3e3; --btn: #4772fa; --on-btn: #ffffff;
    --highlight: #5b82fb; --on-highlight: #ffffff;
    --on-bar: #e3e3e3; --on-bar-2: #9b9b9b; --hover: #2c2c2c; --side-on: #333333;
    --ic-blue: #3b9bff; --ic-yellow: #ffd60a; --ic-red: #ff5a6e; --ic-teal: #4ccbb8; --ic-tan: #cdb98a; --ic-green: #52c97f;
    --danger: #f25f5c; --danger-soft: #3a1c22; --warn: #e5b54a; --warn-soft: #3a2e14;
    --ok: #34d399; --ok-soft: #12322a;
    --shadow: none;
    --violet: #a78bfa; --violet-soft: #2a2145; --amber: #fbbf24; --amber-soft: #3a2e14;
    --emerald: #34d399; --emerald-soft: #12322a; --sky: #38bdf8; --sky-soft: #10293a;
    --rose: #fb7185; --rose-soft: #3a1825; --teal: #2dd4bf; --teal-soft: #0f2f2c; --orange: #fb923c; --orange-soft: #3a2214;
  }
}
:root[data-theme="dark"] {
  --chart-violet: #8b5cf6; --chart-amber: #d97706; --chart-emerald: #059669; --chart-sky: #0284c7; --chart-rose: #f43f5e; --chart-teal: #0d9488; --chart-orange: #ea580c;
  --chart-grid: #242939; --chart-axis: #6f768b;
  --bg: #1f1f1f; --surface: #262626; --surface-2: #2b2b2b; --border: #303030; --bar: #232323; --rail: #1b1b1b;
  --text: #e3e3e3; --text-2: #9b9b9b; --text-3: #676767;
  --accent: #5b82fb; --accent-soft: #232c47; --accent-2: #e3e3e3; --btn: #4772fa; --on-btn: #ffffff;
  --highlight: #5b82fb; --on-highlight: #ffffff;
  --on-bar: #e3e3e3; --on-bar-2: #9b9b9b; --hover: #2c2c2c; --side-on: #333333;
  --ic-blue: #3b9bff; --ic-yellow: #ffd60a; --ic-red: #ff5a6e; --ic-teal: #4ccbb8; --ic-tan: #cdb98a; --ic-green: #52c97f;
  --danger: #f25f5c; --danger-soft: #3a1c22; --warn: #e5b54a; --warn-soft: #3a2e14;
  --ok: #34d399; --ok-soft: #12322a;
  --shadow: none;
  --violet: #a78bfa; --violet-soft: #2a2145; --amber: #fbbf24; --amber-soft: #3a2e14;
  --emerald: #34d399; --emerald-soft: #12322a; --sky: #38bdf8; --sky-soft: #10293a;
  --rose: #fb7185; --rose-soft: #3a1825; --teal: #2dd4bf; --teal-soft: #0f2f2c; --orange: #fb923c; --orange-soft: #3a2214;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px; line-height: 1.5; font-weight: 400;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-size: 26px; font-weight: 700; color: var(--accent-2); }
h2 { font-size: 16px; font-weight: 600; color: var(--accent-2); }
/* Tinted icons, like the coloured list icons in Things */
.ic-blue { color: var(--ic-blue); } .ic-yellow { color: var(--ic-yellow); } .ic-red { color: var(--ic-red); }
.ic-teal { color: var(--ic-teal); } .ic-tan { color: var(--ic-tan); } .ic-green { color: var(--ic-green); }
:is(svg.lucide, i[data-lucide]) { width: 18px; height: 18px; stroke-width: 1.5; flex-shrink: 0; }
i[data-lucide] { display: inline-block; vertical-align: middle; }  /* holds the icon's space until lucide swaps in the svg */
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ===== Layout ===== */
/* TickTick-style shell: icon rail | list sidebar | main pane */
.app { display: flex; min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-shrink: 0; z-index: 30; }
.rail {
  width: var(--rail-w); background: var(--rail); display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 0;
}
.rail-brand {
  width: 34px; height: 34px; border-radius: 99px; background: var(--accent); display: grid; place-items: center; margin-bottom: 10px;
}
.rail-brand .brand-mark { margin: 0 2px 0 0; border-color: var(--on-btn); }
.rail-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 8px;
  background: none; color: var(--text-3); cursor: pointer;
}
.rail-btn :is(svg.lucide, i[data-lucide]) { width: 21px; height: 21px; stroke-width: 1.75; }
.rail-btn:hover { color: var(--text); }
.rail-btn.on { color: var(--accent); }
.rail-spacer { flex: 1; }
.sidebar {
  width: var(--sidebar); background: var(--bar); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 14px 10px 28px;
}
.side-link {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 6px;
  color: var(--text); font-size: 14px; cursor: pointer;
}
.side-link :is(svg.lucide, i[data-lucide]) { color: var(--text-2); }
.side-link:hover { background: var(--hover); }
.side-link.on { background: var(--side-on); }
.side-link .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-label {
  display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 14px 10px 6px;
  border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3);
}
.side-label a { display: grid; color: inherit; } .side-label a:hover { color: var(--text); }
.side-label :is(svg.lucide, i[data-lucide]) { width: 15px; height: 15px; }
details[data-folder] > summary { list-style: none; cursor: pointer; }
details[data-folder] > summary::-webkit-details-marker { display: none; }
.folder > summary a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(svg.lucide, i[data-lucide]).twisty { width: 13px; height: 13px; transition: transform .15s; }
.folder .twisty { margin: 0 -6px 0 -8px; }
details:not([open]) > summary .twisty { transform: rotate(-90deg); }
.side-link.sub { padding-left: 32px; }
.side-link.sub :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; }
.side-link.sub .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link.sub .dot { width: 7px; height: 7px; border-radius: 99px; }
.side-link.sub .count { margin-left: 0; min-width: 16px; text-align: right; }
:root.nav-collapsed .sidebar { display: none; }

.menu { position: relative; }
.menu-pop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 220px; padding: 6px 0; z-index: 40;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); max-height: calc(100vh - 80px); overflow-y: auto;
}
.menu:hover > .menu-pop, .menu:focus-within > .menu-pop { display: block; }
.menu-up .menu-pop { top: auto; bottom: 0; left: 100%; }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 16px; border: 0; background: none;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop a.on { background: var(--hover); font-weight: 600; }
.menu-label {
  display: flex; justify-content: space-between; padding: 10px 16px 4px; margin-top: 4px; border-top: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
}
.menu-pop > .menu-label:first-child { margin-top: 0; border-top: 0; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.brand { display: inline-flex; align-items: flex-start; font-weight: 500; font-size: 20px; letter-spacing: -.01em; color: inherit; }
.brand-mark { width: 9px; height: 9px; margin: 1px 0 0 3px; border-top: 3px solid var(--highlight); border-right: 3px solid var(--highlight); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 14px 28px 10px 16px; background: var(--bg);
}
.capture {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--text-3);
}
.capture:focus-within { border-color: var(--accent); background: var(--bg); }
.capture input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; padding: 9px 0; }
.capture input::placeholder { color: var(--text-3); }
.capture { position: relative; }
.capture-hints {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; padding: 7px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 12px;
}
.capture-hints[hidden] { display: none; }
.capture-hints .badge { background: var(--accent-soft); color: var(--accent); }
.kbd { word-break: break-all; font-size: 11px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text-3); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.menu-btn { border: 0; background: none; }
.menu-btn:hover { background: var(--hover); }

.content { width: 100%; max-width: 1180px; padding: 10px 28px 60px; }
/* boards use all the room there is, so collapsing the sidebar widens them */
.content:has(.board) { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.eyebrow { font-size: 12px; font-weight: 400; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.split { grid-template-columns: 1.6fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid > *, .stack > * { min-width: 0; }

/* ===== Components ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.card-head > :is(svg.lucide, i[data-lucide]).faint { color: var(--accent); }
.card-head .link { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 400; }
.card-body { padding: 4px 20px 20px; }

.stat { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .stat-icon { display: none; }
.stat .value { font-size: 32px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--text-3); }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--btn); border-color: var(--btn); color: var(--on-btn); font-weight: 600; }
.btn-primary:hover { background: var(--btn); opacity: .85; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400;
  padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge :is(svg.lucide, i[data-lucide]) { width: 13px; height: 13px; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* area colour helpers */
.c-violet { --c: var(--violet); --c-soft: var(--violet-soft); }
.c-amber { --c: var(--amber); --c-soft: var(--amber-soft); }
.c-emerald { --c: var(--emerald); --c-soft: var(--emerald-soft); }
.c-sky { --c: var(--sky); --c-soft: var(--sky-soft); }
.c-rose { --c: var(--rose); --c-soft: var(--rose-soft); }
.c-teal { --c: var(--teal); --c-soft: var(--teal-soft); }
.c-orange { --c: var(--orange); --c-soft: var(--orange-soft); }
.dot.tint, .tint-bg { background: var(--c); }
.tint-soft { background: var(--c-soft); color: var(--c); }
.badge.area { background: var(--c-soft); color: var(--c); }

/* chips / filters */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 400; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
/* Several small filter groups share one line, with a thin divider between them */
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.toolbar-row > .chips + .chips { padding-left: 14px; border-left: 1px solid var(--border); }

/* task rows */
.tasks { list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 6px;
  border-top: 1px solid var(--border);
}
.tasks .task:first-child { border-top: 0; }
.check, .multi input[type="checkbox"] {
  appearance: none; width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid var(--text-3);
  margin: 3px 0 0; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; transition: .15s;
}
.check:hover, .multi input[type="checkbox"]:hover { border-color: var(--accent); }
.check:checked, .multi input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after, .multi input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--on-btn); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.task.done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 400; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; align-items: center; font-size: 12px; color: var(--text-3); }
.task-meta .sep { opacity: .5; }
.task-meta:not(:has(*)) { display: none; }
.task-side { display: flex; align-items: center; gap: 10px; }
/* TickTick shows dates and durations as plain coloured text at the row's end */
.task-side .badge { padding: 0; background: none; color: var(--text-3); }
.task-side .badge :is(svg.lucide, i[data-lucide]) { display: none; }
.task-side .badge.danger { color: var(--danger); } .task-side .badge.warn { color: var(--warn); }
.task:hover { background: var(--surface-2); }
/* the whole row opens the editor; the pencil makes that discoverable */
.task[data-view-url] { cursor: pointer; }
.task-title:hover { color: var(--accent); }
.task-edit { display: grid; place-items: center; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.task-edit :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.task:hover .task-edit, .task-edit:focus-visible { opacity: 1; }
.task-edit:hover { color: var(--accent); }
/* drag-to-reorder grip, shown on hover in reorderable lists */
.grip { display: none; color: var(--text-3); cursor: grab; opacity: 0; transition: opacity .15s; }
.grip :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
[data-reorder] .grip { display: inline-grid; place-items: center; }
[data-reorder] > :hover .grip { opacity: 1; }
.task .grip { margin: 2px -6px 0 -4px; }
td .grip { vertical-align: -2px; margin: 0 6px 0 -8px; }
[data-reorder] > .dragging { opacity: .45; }
@media (hover: none) { [data-reorder] .grip { display: none; } }

/* project board: columns of action cards */
.board-card { margin-bottom: 16px; }
.board { display: flex; gap: 12px; overflow-x: auto; padding: 4px 14px 14px; align-items: flex-start; }
.board-col {
  flex: 1 0 280px; max-width: 460px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-height: 320px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.board-col.drop-over { border-color: var(--accent); }
.board-col-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px 12px; font-size: 13px; font-weight: 600; }
.board-col-head :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.board-count { font-weight: 400; }
.col-tools { margin-left: auto; display: flex; opacity: 0; transition: opacity .15s; }
.col-tools .icon-btn { width: 24px; height: 24px; }
.board-col:hover .col-tools, .col-tools:focus-within { opacity: 1; }
.board-col .tasks { flex: 1; overflow-y: auto; padding: 0 8px; min-height: 44px; }
.board-col .task {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; padding: 8px 10px; gap: 8px; cursor: grab;
}
.board-col .tasks .task:first-child { border-top: 1px solid var(--border); }
.board-col .task.dragging { opacity: .45; }
.board-col .tasks:not(:has(.task))::after {
  content: "Drop actions here"; display: block; padding: 12px 0; text-align: center; font-size: 12px;
  color: var(--text-3); border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.board-add-card { display: flex; align-items: center; gap: 6px; padding: 8px 12px 10px; font-size: 13px; color: var(--text-3); }
.board-add-card:hover, .board-new-col:hover { color: var(--accent); }
.board-add-card :is(svg.lucide, i[data-lucide]), .board-new-col :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.board-new-col {
  flex: 0 0 180px; min-height: 0; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; font-size: 13px; color: var(--text-3); background: none; border-style: dashed;
}
.energy { display: inline-flex; gap: 2px; }
.energy i { width: 4px; height: 10px; border-radius: 2px; background: var(--border); }
.energy.low i:nth-child(-n+1), .energy.medium i:nth-child(-n+2), .energy.high i { background: var(--text-2); }

/* group headers */
.group + .group { margin-top: 18px; }
.card.group { background: none; border: 0; }
.card.group > .card-body { padding: 0; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-weight: 600; font-size: 13px; color: var(--text); }
.group-head :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; }
.group-head :is(svg.lucide, i[data-lucide]).twisty { width: 13px; height: 13px; margin: 0 -4px 0 -6px; color: var(--text-3); }
summary.group-head { border-radius: 6px; user-select: none; }
summary.group-head:hover { background: var(--hover); }
.group-head .faint { font-weight: 500; font-size: 12px; }

/* progress */
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); }

/* project cards */
.project-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--accent); }
.project-card h3 { font-size: 16px; font-weight: 400; line-height: 1.35; }
.project-card .outcome { font-size: 13px; color: var(--text-2); }
.project-card .next { font-size: 13px; padding: 9px 11px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; gap: 8px; }
.project-card .next :is(svg.lucide, i[data-lucide]) { width: 15px; height: 15px; color: var(--accent); margin-top: 2px; }
.project-card .foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.project-card.no-next .next { background: var(--danger-soft); color: var(--danger); }

/* area cards */
.area-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.area-card .top { display: flex; align-items: center; gap: 10px; }
.area-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.area-card .nums { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.area-card .nums b { color: var(--text); font-size: 15px; }

/* agenda */
.agenda-item { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); align-items: center; }
.agenda-item:first-child { border-top: 0; }
.agenda-date { width: 46px; text-align: center; flex-shrink: 0; }
.agenda-date .dow { font-size: 11px; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.agenda-date .num { font-size: 18px; font-weight: 700; line-height: 1.1; }
.agenda-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--c); }

/* hero banner */
.hero {
  padding: 22px 24px; border-radius: var(--radius); color: var(--on-bar); display: flex; justify-content: space-between; gap: 20px; align-items: center;
  background: var(--bar); border: 1px solid var(--border);
  box-shadow: none; margin-bottom: 18px; flex-wrap: wrap;
}
.hero h1 { font-size: 22px; }
.hero p { margin: 4px 0 0; opacity: .85; }
.hero .btn:not(.btn-primary) { background: var(--surface); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 400; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.table.fixed { table-layout: fixed; }
.table.fixed .w-repeat { width: 17%; } .table.fixed .w-next { width: 16%; }
.table.fixed .w-status { width: 13%; } .table.fixed .w-actions { width: 250px; }
.table .actions-col { text-align: right; white-space: nowrap; }

/* inbox / clarify */
.inbox-item { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); cursor: pointer; }
.inbox-item:first-child { border-top: 0; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.selected { background: var(--accent-soft); }
.inbox-item.dragging { opacity: .45; }
.ref-more { color: var(--accent); }
.ref-reader { max-width: 760px; }
.ref-reader .card-body { padding: 24px 28px 28px; }
.task-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.task-facts dt { color: var(--text-3, var(--text-2)); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.task-facts dd { margin: 2px 0 0; color: var(--text); }
.md { max-width: 68ch; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; white-space: pre-wrap; }
.md h2 { font-size: 21px; font-weight: 600; line-height: 1.3; margin: 1.3em 0 .5em; color: var(--text); }
.md h3 { font-size: 17px; font-weight: 600; line-height: 1.35; margin: 1.2em 0 .45em; color: var(--text); }
.md h4 { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 1.1em 0 .4em; color: var(--text-2); }
.md ul, .md ol { margin: 0 0 .85em; padding-left: 1.5em; }
.md ul ul, .md ul ol, .md ol ul, .md ol ol { margin: .2em 0 0; }
.md li { margin-bottom: .3em; }
.md a { color: var(--accent); text-decoration: underline; }
.md strong { font-weight: 600; }
.md blockquote { margin: 0 0 .85em; padding-left: 14px; border-left: 3px solid var(--border); color: var(--text-2); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.md pre { margin: 0 0 .85em; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); overflow-x: auto; }
.md pre code { padding: 0; background: none; overflow-wrap: normal; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 4px; }
.editor-bar button { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.editor-bar button:hover { background: var(--surface-2); color: var(--text); }
.editor-bar button:disabled { opacity: .35; cursor: default; background: none; }
.editor-bar button.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.editor-bar button :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; }
.editor-bar .sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border); }
.editor-bar .tabs { margin-left: auto; display: flex; gap: 2px; }
.editor-preview { min-height: 200px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.drag-hint { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 18px; font-size: 12px; border-bottom: 1px solid var(--border); }
.drag-hint :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.drag-hint + .inbox-item { border-top: 0; }
@media (hover: none) { .drag-hint { display: none; } }
/* while an inbox item is being dragged, outline where it can go */
.inbox-dragging [data-drop-outcome] { outline: 1.5px dashed var(--border); outline-offset: -2px; }
.inbox-dragging [data-drop-outcome].drop-over { outline-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.src-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex-shrink: 0; }
.clarify { position: sticky; top: 70px; }
.clarify .q { font-weight: 600; margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.clarify .q .step { width: 22px; height: 22px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice b { display: block; font-weight: 600; font-size: 13px; }
.choice span { font-size: 12px; color: var(--text-2); }
.choice :is(svg.lucide, i[data-lucide]) { margin-top: 2px; color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; outline: 0; width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }

/* week view */
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.day { padding: 14px; min-height: 260px; display: flex; flex-direction: column; gap: 8px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.day-head .num { font-size: 22px; font-weight: 700; }
.day-head .dow { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; }
.event { padding: 8px 10px; border-radius: 8px; background: var(--c-soft); border-left: 3px solid var(--c); font-size: 12.5px; }
.event b { display: block; font-weight: 600; color: var(--text); }
.event span { color: var(--text-2); }
.due-pill { font-size: 12px; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--border); color: var(--text-2); display: flex; gap: 6px; }
.due-pill :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-dow { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; text-align: center; padding-bottom: 2px; }
.month-day { min-height: 110px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface, var(--bg)); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.month-day.out { opacity: .45; }
.month-day.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.month-num { font-size: 13px; font-weight: 700; color: var(--text); align-self: flex-start; padding: 0 4px; border-radius: 6px; }
.month-num:hover { background: var(--accent-soft); }
.month-item { padding: 3px 6px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.month-item.due-pill :is(svg.lucide, i[data-lucide]) { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }
@media (max-width: 900px) {
  .nav { position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; }
  :root.nav-collapsed .sidebar { display: block; }
  .sidebar { width: min(var(--sidebar), calc(100vw - var(--rail-w) - 40px)); }
  .sidebar-backdrop.open { display: block; }
}
@media (max-width: 760px) {
  .month { gap: 3px; }
  .month-day { min-height: 64px; padding: 3px; border-radius: 6px; }
  .month-item { font-size: 0; padding: 0; height: 6px; border-radius: 3px; border-left-width: 0; }
  .month-item.due-pill { border: 0; background: var(--text-3); }
  .month-item.due-pill :is(svg.lucide, i[data-lucide]) { display: none; }
}

/* review */
.review-progress { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.review-step { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.review-step:first-child { border-top: 0; }
.review-step.done span { text-decoration: line-through; color: var(--text-3); }

/* milestones */
.milestones { list-style: none; margin: 0; padding: 0; position: relative; }
.milestones li { display: flex; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.milestones li::before { content: ""; position: absolute; left: 10px; top: 28px; bottom: -8px; width: 2px; background: var(--border); }
.milestones li:last-child::before { display: none; }
.ms-dot { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; border: 2px solid var(--border); background: var(--surface); z-index: 1; }
.ms-dot :is(svg.lucide, i[data-lucide]) { width: 13px; height: 13px; }
.milestones .done .ms-dot { background: var(--c); border-color: var(--c); color: #fff; }
.milestones .current .ms-dot { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
.milestones .current { font-weight: 600; }
.milestones .todo { color: var(--text-3); }

.alloc-row { margin-bottom: 14px; }
.alloc-row .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.alloc-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); }
.alloc-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--c); }
.alloc-bar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 2px; }

.area-hero { padding: 22px; display: flex; gap: 16px; align-items: center; margin-bottom: 18px; border-left: 4px solid var(--c); }
.area-hero .area-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--c); color: #fff; }
.area-hero .area-icon :is(svg.lucide, i[data-lucide]) { width: 26px; height: 26px; }

.someday-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.someday-item:first-child { border-top: 0; }
.someday-item .actions { margin-left: auto; opacity: 0; transition: .15s; display: flex; gap: 6px; }
.someday-item:hover .actions { opacity: 1; }

/* reminders */
.bell { position: relative; }
.bell-count {
  position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--rail);
}
.reminder { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.reminder:first-child { border-top: 0; }
.reminder .r-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--text-2); }
.reminder.overdue .r-icon { background: var(--danger-soft); color: var(--danger); }
.reminder.today .r-icon { background: var(--warn-soft); color: var(--warn); }
.reminder .r-main { flex: 1; min-width: 0; }
.reminder .r-actions { display: flex; gap: 6px; flex-shrink: 0; }
.reminder .r-actions form { display: inline; }
@media (max-width: 760px) { .reminder { flex-wrap: wrap; } .reminder .r-actions { width: 100%; justify-content: flex-end; } }

.paper { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--border); }
.paper:first-child { border-top: 0; }
.paper .r-actions form { display: inline; }
.paper-summary { margin-top: 8px; font-size: 13px; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 10px; }
@media (max-width: 760px) { .paper { flex-wrap: wrap; } }

pre.code {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; color: var(--text); white-space: pre-wrap; word-break: break-all;
}

/* insights */
.stat .value .unit { font-size: 15px; font-weight: 500; color: var(--text-2); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--text-2); }
.delta :is(svg.lucide, i[data-lucide]) { width: 14px; height: 14px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis-text { fill: var(--chart-axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .value-text { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:hover, .chart .hit:focus { fill: var(--text); fill-opacity: .05; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 8px 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.14);
  font-size: 12px; color: var(--text); opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip .tip-title { font-weight: 600; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tip .tip-row b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .tip-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.table-toggle { margin-top: 10px; }
.table-toggle summary { cursor: pointer; font-size: 12px; color: var(--text-3); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.health-group + .health-group { margin-top: 14px; }
.health-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.health-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--border); }
.health-item .faint { margin-left: auto; font-size: 12px; white-space: nowrap; }
.health-item .dot.tint { background: var(--c); }

/* teaching */
.row-next td { background: var(--accent-soft); }
.assessment + .assessment { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.grade-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.multi > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.multi label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); }

/* command palette & shortcuts */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(10, 12, 20, .45); }
.palette, .shortcuts {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0;
  box-shadow: 0 24px 60px rgba(0,0,0,.25); width: min(620px, calc(100vw - 32px));
}
.palette { margin-top: 12vh; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-search input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.palette-list .group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.palette-list .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-list .item.active { background: var(--accent-soft); color: var(--accent); }
.palette-list .item .hint { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.palette-list .item mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.palette-list .empty-row { padding: 18px 10px; color: var(--text-2); font-size: 13px; }
.palette-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.palette-foot .kbd { margin-right: 3px; }
.shortcuts { width: min(820px, calc(100vw - 32px)); }
.shortcuts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 26px; padding: 4px 18px 20px; }
.shortcuts h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 10px 0 8px; }
.shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; font-size: 13px; align-items: center; }
.shortcuts dt { white-space: nowrap; color: var(--text-3); font-size: 12px; } .shortcuts dd { margin: 0; }
.shortcuts .kbd { margin-right: 2px; }
.task.kbd-focus { background: var(--accent-soft); border-radius: var(--radius-sm); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 760px) { .shortcuts-grid { grid-template-columns: 1fr; } }

.clarify-item { padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 4px; }
.clarify-item a { font-size: 12px; word-break: break-all; }
.clarify-item #clarify-notes { font-size: 12px; white-space: pre-line; max-height: 140px; overflow-y: auto; }
.inbox-notes { font-size: 12px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-title { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; }
.mini-title :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; color: var(--text-3); }

/* bookmarklet capture window */
.quick { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.quick-card { width: 100%; max-width: 440px; padding: 22px; }
.bookmarklet { cursor: grab; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { padding: 0; margin-bottom: 22px; }
.auth .error { background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 6px; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-weight: 500;
  display: flex; gap: 8px; align-items: center; transition: .25s; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action { pointer-events: auto; padding-right: 8px; }
.toast-action {
  margin-left: 6px; padding: 4px 10px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
}
.toast-action:hover { background: var(--accent); color: #fff; }

/* ===== Time blocks: the "now" strip under the top bar ===== */
.main-bar { flex-wrap: wrap; }
.now-strip {
  flex-basis: 100%; display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 10px 8px 16px;
  border-radius: 10px; background: var(--c-soft); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  font-size: 13px; color: var(--text-2);
}
.now-strip.free { background: var(--surface-2); border-color: transparent; min-height: 40px; }
.now-strip:empty { visibility: hidden; }
.ns-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); animation: ns-pulse 2.4s ease-in-out infinite; }
.free .ns-dot { background: none; border: 2px solid var(--text-3); box-shadow: none; animation: none; }
@keyframes ns-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ns-dot { animation: none; } }
.ns-label { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ns-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.free .ns-eyebrow { color: var(--text-3); }
.ns-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ns-track { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 80px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ns-bar { flex: 1; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--c) 16%, transparent); }
.ns-bar span { display: block; height: 100%; border-radius: 3px; background: var(--c); transition: width .6s ease; }
.ns-left { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-left b { font-size: 16px; font-weight: 600; color: var(--c); }
.free .ns-left { flex: 1; }
.ns-next { white-space: nowrap; color: var(--text-3); }
.ns-cta { white-space: nowrap; padding: 6px 11px; border-radius: 7px; background: var(--c); color: #fff; font-weight: 500; text-decoration: none; }
.ns-cta:hover { filter: brightness(1.08); }
.free .ns-cta { background: none; color: var(--text-2); border: 1px solid var(--border); }
@media (max-width: 760px) {
  .now-strip { gap: 10px; padding-left: 12px; }
  .ns-next, .ns-track .ns-t { display: none; }
  .ns-name { max-width: 120px; }
  .ns-cta { padding: 5px 8px; }
}
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week-strip span { text-align: center; font-size: 11px; padding: 2px 0; border-radius: 4px; color: var(--text-3); background: var(--surface-2); }
.week-strip span.on { background: var(--c-soft); color: var(--c); font-weight: 500; }
.week-strip span.today { outline: 1px solid var(--c); }

/* hidden by filters */
.is-hidden { display: none !important; }
.is-gone, .over-limit { display: none !important; }

/* a completed row slides out of open lists */
.task { transition: opacity .3s, transform .3s; }
.task.leaving { opacity: 0; transform: translateX(16px); }
@media (prefers-reduced-motion: reduce) { .task { transition: none; } }

/* "Show 12 more" under long lists */
.show-more {
  display: block; margin: 4px 0 2px 36px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font: inherit; font-size: 13px; font-weight: 500;
}
.show-more:hover { color: var(--accent); }
.show-more[hidden] { display: none; }

/* phone: a round capture button, bottom right */
.capture-fab { display: none; }
@media (max-width: 760px) {
  .capture-fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 50%; border: 0; z-index: 40; cursor: pointer;
    background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  }
  .capture-fab :is(svg.lucide, i[data-lucide]) { width: 24px; height: 24px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .clarify { position: static; }
}
@media (max-width: 760px) {
  .main-bar { padding: 10px 16px 8px 8px; }
  .content { padding: 8px 16px 48px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .capture .kbd { display: none; }
  .task-side > :not(.due) { display: none; }
  .task-side { align-self: center; }
  .hide-sm { display: none; }
  .table.fixed { table-layout: auto; }
  .table.fixed col { width: auto !important; }
  .btn .label-lg { display: none; }
  .table th, .table td { padding: 10px 12px; }
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); }

/* ===== Time blocks: a block on one day ===== */
.capacity { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.capacity span { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); }
.capacity.over span { background: var(--danger); }
.plan-list, .plan-pick { list-style: none; margin: 0; padding: 0; }
.plan-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.plan-list li:first-child { border-top: 0; }
.plan-list li > a { flex: 1; min-width: 0; color: var(--text); }
.plan-list li.done > a { text-decoration: line-through; color: var(--text-3); }
.plan-pick li label { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.plan-pick .plan-title { flex: 1; min-width: 0; }
.plan-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 4px 0 2px; }
.move-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.move-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }

/* ===== Time blocks in the calendar week ===== */
.cal-block { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 9px;
  background: repeating-linear-gradient(135deg, var(--c-soft) 0 8px, color-mix(in srgb, var(--c-soft) 60%, transparent) 8px 16px);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.cal-block.skipped { background: none; border-style: dashed; opacity: .6; }
.cal-block.skipped b { text-decoration: line-through; }
.cal-block-head { display: flex; flex-direction: column; color: var(--text); text-decoration: none; font-size: 12.5px; }
.cal-block-head b { font-weight: 600; }
.cal-block-head span { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-cap { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-cap .capacity { flex: 1; height: 5px; background: color-mix(in srgb, var(--c) 15%, transparent); }
.cal-cap.over { color: var(--danger); }
.event.in-block { background: var(--surface); }

/* ===== Focus timer ===== */
.task-focus { display: contents; }
.task-focus button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.focus-bar {
  flex-basis: 100%; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 10px 8px 14px;
  border-radius: 10px; background: var(--surface); border: 1.5px solid var(--c); font-size: 13px; color: var(--text-2);
}
.focus-bar .ns-eyebrow { color: var(--c); }
.fb-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c-soft); color: var(--c); flex-shrink: 0; }
.fb-icon :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; }
.fb-clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fb-clock b { font-size: 18px; font-weight: 600; color: var(--text); }
.fb-bar { flex: 1; min-width: 60px; height: 6px; border-radius: 3px; background: var(--c-soft); overflow: hidden; }
.fb-bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c); transition: width .6s ease; }
.fb-bar.over span { background: var(--warn); }
.focus-bar form { display: flex; gap: 6px; }
@media (max-width: 760px) { .focus-bar { flex-wrap: wrap; gap: 10px; } .fb-bar { display: none; } }

/* quick date buttons under date fields */
.date-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.date-quick button {
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: none; cursor: pointer;
  color: var(--text-2); font: inherit; font-size: 12px;
}
.date-quick button:hover { color: var(--accent); border-color: var(--accent); }
.date-quick .clear { border-color: transparent; color: var(--text-3); }

/* phones: two stat tiles a row; Waiting For rows become stacked cards */
@media (max-width: 760px) {
  .grid.grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; gap: 2px; }
  .stat .value { font-size: 24px; }
  .waiting-table thead { display: none; }
  .waiting-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .waiting-table tbody tr:last-child { border-bottom: 0; }
  .waiting-table td { padding: 0; border: 0; }
  .waiting-table td:first-child { grid-column: 1 / -1; }
  .waiting-table .w-who { grid-column: 1; font-size: 13px; }
  .waiting-table .w-area { grid-column: 2; grid-row: 2; text-align: right; }
  .waiting-table .w-days { grid-column: 1; font-size: 12px; }
  .waiting-table .w-follow { grid-column: 2; grid-row: 3; text-align: right; }
  .waiting-table .w-actions { grid-column: 1 / -1; padding-top: 4px; }
  .waiting-table .grip { display: none; }
}

/* "Add action" line under project and area lists */
.quick-add {
  display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 6px 8px; border-radius: 6px; color: var(--text-3);
}
.quick-add :is(svg.lucide, i[data-lucide]) { width: 16px; height: 16px; flex-shrink: 0; }
.quick-add input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; padding: 4px 0; }
.quick-add input::placeholder { color: var(--text-3); }
.quick-add:focus-within { background: var(--surface-2); color: var(--accent); }

/* right-click menu on tasks */
.task-menu {
  position: fixed; z-index: 120; min-width: 230px; padding: 5px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
.task-menu[hidden] { display: none; }
.task-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.task-menu button :is(svg.lucide, i[data-lucide]) { width: 15px; height: 15px; color: var(--text-3); }
.task-menu button:hover, .task-menu button:focus-visible { background: var(--accent-soft); color: var(--accent); outline: 0; }
.task-menu button:hover :is(svg.lucide, i[data-lucide]), .task-menu button:focus-visible :is(svg.lucide, i[data-lucide]) { color: var(--accent); }
.task-menu button.danger, .task-menu button.danger :is(svg.lucide, i[data-lucide]) { color: var(--danger); }
.task-menu button.danger:hover { background: var(--danger-soft); }
.task-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
