/* ============================================================
   Dump — GTD brain dump for ADHD brains
   Design language: warm paper, amber accent, DM Serif Display
   ============================================================ */

:root {
  /* Surfaces (light) */
  --bg: #FAFAF8;
  --paper: #FFFFFF;
  --muted: #F4EFE9;
  --ink: #1C1917;
  --ink-soft: #78716C;
  --ink-faint: #A8A29E;
  --line: rgba(28, 25, 23, 0.10);
  --line-strong: rgba(28, 25, 23, 0.25);

  /* Brand roles — each colour has exactly one job */
  --action: #FF6B35;        /* primary buttons, CTAs, active borders — bg only, never white text (v2) */
  --on-action: #1C1917;     /* v2: text colour on --action fills (6.17:1) — same in dark */
  --action-hover: #E85D2A;  /* v2: hover/pressed fill; ink text still passes (5.02:1) */
  --action-deep: #C2410C;   /* accessible Action for text/links on light (AA) */
  --nudge: #F5A623;         /* Nudge tip/suggestion boxes ONLY */
  --nudge-bg: #FEF3E2;
  --nudge-text: #92400E;
  --focus: #7B61FF;         /* v2: ui only (borders, badges, edges) — never holds white text */
  --focus-deep: #5B3FD9;    /* violet text + violet surfaces that carry light text */
  --focus-wash: #EFEBFF;    /* v2: soft violet fill for chips, with --focus-deep text */
  --cap: #4E6E96;           /* Capture / input only (Today dump bar) */
  --cap-deep: #3C5A80;
  --cap-wash: #EEF2F7;
  --done: #0F9D63;          /* completion + success only (v2: darkened from #16C47F, 3:1 ✓) */
  --done-deep: #0A6E44;
  --destructive: #C13539;   /* toss / delete only (v2: darkened from #E5484D, 5.47:1 as text) */

  /* Back-compat aliases — the app's dominant colour is Action */
  --accent: var(--action);
  --accent-deep: var(--action-deep);
  --priority: var(--destructive);

  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(28,25,23,0.05), 0 6px 18px -8px rgba(28,25,23,0.14);
  --cream: #FFFDF6;
  --soft-05: rgba(60,50,30,0.05);
  --soft-06: rgba(60,50,30,0.06);
  --soft-07: rgba(60,50,30,0.07);
  --amber: var(--nudge);
  --pomo-break: var(--done-deep);
  --pomo-long: #0074d9;
}

/* ============================================================
   Dark mode — surfaces flip; brand roles keep their meaning,
   with lighter "deep" variants so role text stays legible.
   ============================================================ */
[data-theme="dark"] {
  --bg: #1C1917;
  --paper: #262220;
  --muted: #2E2925;
  --ink: #FAFAF8;
  --ink-soft: #A8A29E;
  --ink-faint: #8A837D;     /* v2: lightened from #6B6360 — still disabled/decorative only */
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.20);

  --action-deep: #FF8A5C;   /* lighter Action for text/links on dark */
  --focus-deep: #A78BFF;
  --focus-wash: #2C2540;    /* v2: dark violet wash */
  --destructive: #F07B7E;   /* v2: light value too dark to read on dark surfaces */
  --cap: #7BA2D0;
  --cap-deep: #9CBCE4;
  --cap-wash: rgba(123,162,208,0.14);
  --done-deep: #3DDC97;
  --nudge-bg: rgba(245, 166, 35, 0.14);
  --nudge-text: #F3C77A;

  --cream: #2E2925;
  --soft-05: rgba(255,255,255,0.05);
  --soft-06: rgba(255,255,255,0.07);
  --soft-07: rgba(255,255,255,0.09);
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 22px -10px rgba(0,0,0,0.65);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body, #root { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: var(--sans); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
::selection { background: rgba(255, 107, 53, 0.28); }

/* ---------- App frame ---------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  z-index: 30;
}
.main {
  margin-left: 220px;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 10px 20px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(217, 140, 10, 0.35);
}
.brand-mark::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cream);
}
.brand-name {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.01em;
  margin: 0;
  font-weight: 400;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  appearance: none;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background 0.13s ease, color 0.13s ease;
}
.nav-item svg { flex: 0 0 auto; }
.nav-item:hover { background: var(--soft-05); color: var(--ink); }
.nav-item.active {
  background: var(--muted);
  color: var(--ink);
  font-weight: 600;
}
.nav-item.active svg { color: var(--ink); }
.nav-badge {
  margin-left: auto;
  font-size: 12px; /* v2: raised from 11.5px */
  font-weight: 600;
  color: var(--ink-soft); /* v2: readable metadata never uses ink-faint */
  background: var(--soft-06);
  border-radius: 99px;
  padding: 1px 7px;
}
.nav-item.active .nav-badge { background: var(--line); color: var(--ink-soft); }
.nav-badge.muted { background: var(--line); color: var(--ink-soft); }
.nav-item.active .nav-badge.muted { background: var(--line); color: var(--ink-soft); }
.sidebar-foot { margin-top: auto; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- Section scaffolding ---------- */
.section {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 28px 80px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 31px;
  line-height: 1.15;
  margin: 0;
}
.section-sub {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 4px 0 26px;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.08s ease;
}
.btn:hover { border-color: var(--ink-faint); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-action); /* v2: ink on orange — white-on-orange fails AA */
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(194,65,12,0.3);
}
.btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: transparent; background: var(--soft-05); color: var(--ink); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-danger-ghost { color: var(--priority); }
.btn-danger-ghost:hover { background: rgba(193,53,57,0.07); color: var(--priority); }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.spinner.dark { border-color: rgba(60,50,30,0.2); border-top-color: var(--ink-soft); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Capture ---------- */
.dump-box {
  width: 100%;
  min-height: 150px;
  resize: none;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 18px 19px;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dump-box::placeholder { color: var(--ink-soft); }
.dump-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.14), var(--shadow);
}
.dump-box[readonly] { opacity: 0.65; }

/* Capture box in-corner tools (paperclip / mic) */
.dump-wrap { position: relative; }
.dump-wrap .dump-box { padding-bottom: 48px; }
.dump-tools {
  position: absolute;
  left: 14px; right: 14px; bottom: 11px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.cap-tool { position: relative; display: inline-flex; pointer-events: auto; }
.cap-tool-btn {
  appearance: none;
  border: none;
  background: transparent;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}
.cap-tool-btn:hover { background: rgba(255,107,53,0.09); color: var(--accent-deep); }
.cap-tool-soon:hover { background: var(--soft-06); color: var(--ink-soft); }
.cap-tip {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 11px;
  border-radius: 9px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.45;
  width: max-content;
  max-width: min(230px, 72vw);
  text-align: left;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
  box-shadow: 0 8px 24px -10px rgba(28,25,23,0.55);
}
.cap-tip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--ink);
}
.cap-tool:hover .cap-tip { opacity: 1; }

/* Add-a-file dialog */
.cap-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28,25,23,0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 600;
  animation: capmodal-fade 0.16s ease;
}
@keyframes capmodal-fade { from { opacity: 0; } to { opacity: 1; } }
.cap-modal {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 24px 60px -18px rgba(28,25,23,0.5);
  width: 100%;
  max-width: 420px;
  padding: 22px 22px 24px;
  animation: capmodal-pop 0.18s ease;
}
@keyframes capmodal-pop { from { transform: translateY(8px); } to { transform: none; } }
.cap-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.cap-modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: var(--ink);
}
.cap-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 7px;
}
.cap-modal-close:hover { color: var(--ink); background: var(--soft-06); }
.cap-modal-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cap-modal .dropzone { margin-bottom: 0; }

.quick-field { margin-bottom: 14px; }
.quick-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 2px 6px;
  letter-spacing: 0.01em;
}
.quick-field .dump-box { min-height: 64px; font-size: 15.5px; padding: 13px 15px; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}
.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.13s ease, color 0.13s ease, background 0.13s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); background: rgba(255,107,53,0.06); }

.capture-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cost-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
}

/* Quick mode toggle */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.switch {
  width: 34px; height: 20px;
  border-radius: 99px;
  background: var(--line-strong);
  position: relative;
  transition: background 0.15s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform 0.15s ease;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }

/* ---------- Banner = Nudge box (signature amber tip) ---------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--nudge);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 14px;
  color: var(--nudge-text);
  margin-bottom: 20px;
  text-wrap: pretty;
}
.banner svg { flex: 0 0 auto; margin-top: 1px; color: var(--nudge); }
.banner-close {
  appearance: none; border: none; background: none;
  margin-left: auto;
  color: var(--nudge);
  cursor: pointer;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
}
.banner-close:hover { color: #7a5a10; }

/* ---------- Filter pills / view toggle ---------- */
.board-controls {
  margin-bottom: 16px;
}

/* Level 1 — Now / Later segmented toggle */
.view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--soft-05);
  border-radius: 12px;
}
.vt-tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color 0.13s ease, background 0.13s ease;
}
.vt-tab:hover { color: var(--ink); }
.vt-tab.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(28,25,23,0.10);
}
.vt-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  background: var(--line);
  border-radius: 99px;
  padding: 1px 8px;
  line-height: 1.5;
}
.vt-count.on { color: #fff; background: var(--accent); }

/* Collapsible filter: a single Filter button, expands to the pill row */
.filter-toggle {
  appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 99px;
  padding: 5px 13px; cursor: pointer;
  transition: color 0.13s ease, border-color 0.13s ease, background 0.13s ease;
}
.filter-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.filter-toggle.open { color: var(--ink); background: var(--soft-05); border-color: transparent; }
.filter-toggle.has-active { color: var(--accent-deep); border-color: var(--accent); }
.filter-toggle svg { color: currentColor; }
.filter-active-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-deep);
  background: rgba(255,107,53,0.12); border-radius: 99px; padding: 3px 6px 3px 11px;
}
.fac-clear {
  appearance: none; border: none; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; color: var(--accent-deep);
  padding: 1px; border-radius: 50%; line-height: 0;
}
.fac-clear:hover { background: rgba(255,107,53,0.22); }

/* Level 2 — filter the current list */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-right: 2px;
}
.filter-bar .fpill {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  color: var(--ink);
}
.filter-bar .fpill:hover { border-color: var(--ink); }
.fcount {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  background: var(--line);
  border-radius: 99px;
  padding: 0 6px;
  margin-left: 6px;
  line-height: 1.55;
}
.fpill.quick .fcount { color: var(--accent-deep); background: rgba(255,107,53,0.16); }
.fpill.active .fcount { color: var(--ink); background: rgba(255,255,255,0.85); }
.fpill.quick.active .fcount { color: var(--accent-deep); background: #fff; }
.filter-sep {
  width: 1px;
  align-self: stretch;
  background: var(--line-strong);
  margin: 3px 3px;
}

/* Category dropdown (secondary) */
.cat-filter { position: relative; }
.cat-btn {
  appearance: none;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.cat-btn.active {
  border-style: solid;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.cat-chev { stroke: currentColor; }
.cat-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 168px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: cat-pop 0.14s ease;
}
@keyframes cat-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cat-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.cat-item:hover { background: var(--cream); }
.cat-item.on { color: var(--accent-deep); font-weight: 600; background: rgba(255,107,53,0.08); }

.fpill {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s ease;
}
.fpill:hover { border-color: var(--ink-faint); color: var(--ink); }
.fpill.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Task cards ---------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }

.task-card {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 15px 16px 11px;
  position: relative;
  transition: box-shadow 0.15s ease;
  overflow: visible;
}
/* Clip only while the card is animating OUT (max-height collapse needs it).
   'entering' is opacity/translate only and the class persists after the run,
   so clipping on it would permanently re-hide overflow — keep it visible. */
.task-card.leaving { overflow: hidden; }
.task-card.leaving {
  animation: task-out 0.45s ease forwards;
}
@keyframes task-out {
  0%   { opacity: 1; transform: translateX(0); max-height: 200px; }
  55%  { opacity: 0; transform: translateX(48px); max-height: 200px; }
  100% { opacity: 0; transform: translateX(48px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: -12px; }
}
.task-card.entering { animation: task-in 0.35s ease; }
@keyframes task-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.task-row { display: flex; align-items: flex-start; gap: 13px; }

.task-check {
  appearance: none;
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: border-color 0.14s ease, background 0.18s ease, color 0.18s ease;
  padding: 0;
}
.task-check:hover { border-color: var(--done); }
/* High priority: amber wash on the whole card (Option A) */
.task-card.high { background: var(--nudge-bg); }
.task-check.checked {
  background: var(--done);
  border-color: var(--done);
  color: #fff;
  animation: check-pop 0.25s ease;
}@keyframes check-pop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.task-body { flex: 1; min-width: 0; }
.task-text {
  font-size: 16.5px;
  line-height: 1.42;
  margin: 0 26px 7px 0;
  text-wrap: pretty;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.cat-pill {
  font-size: 12px; /* v2: raised from 11.5px */
  font-weight: 600;
  border-radius: 99px;
  padding: 2px 9px;
  letter-spacing: 0.01em;
}
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft); /* v2 */
}
.cat-tag svg { color: var(--ink-faint); flex: 0 0 auto; }
/* High-priority red flag marker (icon only) */
.flag-mark { display: inline-flex; align-items: center; color: var(--priority); line-height: 0; }
.flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--priority);
  background: rgba(193,53,57,0.09);
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
}
.due-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--soft-05);
  border-radius: 99px;
  padding: 2px 9px;
}
.due-chip.overdue { color: var(--priority); background: rgba(193,53,57,0.08); }
.src-tag { font-size: 11px; color: var(--ink-soft); }
.unblocks-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--cap-deep);
  background: var(--cap-wash);
  border-radius: 99px;
  padding: 2px 9px;
}

.qw-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-deep);
  background: rgba(255,107,53,0.13);
  border-radius: 99px;
  padding: 2px 9px;
}
.fpill.quick { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-deep); border-color: rgba(255,107,53,0.5); }
.fpill.quick.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.big-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--soft-07);
  border: 1px dashed var(--line-strong);
  border-radius: 99px;
  padding: 1px 9px;
}
.card-actions .breakdown-cta { color: var(--accent-deep); font-weight: 600; }
.card-actions .breakdown-cta:hover { background: rgba(255,107,53,0.1); color: var(--accent-deep); }
.steps-box li.start-here { font-weight: 500; }
.start-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--focus-deep);
  margin-right: 7px;
}
.focus-progress {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--focus-deep);
  background: rgba(123,97,255,0.12);
  border-radius: 99px;
  padding: 2px 10px;
}
.focus-progress.all-done { color: var(--done-deep); background: rgba(15,157,99,0.12); }

.star-btn {
  appearance: none;
  border: none;
  background: none;
  position: absolute;
  top: 11px; right: 10px;
  padding: 5px;
  cursor: pointer;
  color: var(--line-strong);
  border-radius: 8px;
  transition: color 0.13s ease, transform 0.1s ease;
}
.star-btn:hover { color: var(--accent); }
.star-btn.on { color: var(--accent); }
.star-btn.on:active { transform: scale(0.9); }

.card-actions {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
  margin-left: 37px;
}
.card-actions .btn-ghost { padding: 4px 9px; font-size: 12.5px; font-weight: 500; border-radius: 7px; }

/* Break-down steps (AI-generated → Focus violet) */
.steps-box {
  margin: 10px 0 4px 37px;
  background: rgba(123,97,255,0.07);
  border: 1px solid rgba(123,97,255,0.24);
  border-radius: 10px;
  padding: 11px 14px;
}
.steps-box ol { margin: 0; padding-left: 19px; display: flex; flex-direction: column; gap: 5px; }
.steps-box li { font-size: 14px; }
.steps-box .step-min { color: var(--ink-soft); font-size: 12px; margin-left: 6px; }

/* Inline editor */
.edit-panel {
  margin: 10px 0 4px 37px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.edit-panel input[type="text"], .edit-panel textarea, .edit-panel input[type="date"], .edit-panel input[type="number"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
}
.edit-panel input:focus, .edit-panel textarea:focus { border-color: var(--accent); }
.edit-panel textarea { resize: vertical; min-height: 56px; }
.edit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edit-row label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper);
}
.seg button {
  appearance: none; border: none; background: transparent;
  padding: 6px 13px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer;
  border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--ink); color: var(--bg); }
.seg button.active.hi { background: var(--priority); }

/* ---------- Empty states ---------- */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-soft);
}
.empty .empty-art {
  width: 54px; height: 54px;
  border-radius: 16px;
  background: rgba(255,107,53,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-deep);
  margin-bottom: 14px;
}
.empty p { margin: 0; font-size: 14.5px; text-wrap: pretty; }
.empty .empty-title { font-family: var(--serif); font-size: 19px; color: var(--ink-soft); margin-bottom: 4px; }

/* ---------- Today digest ---------- */
.digest-card {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 19px 21px;
  margin-bottom: 18px;
}
.digest-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.digest-card h3 svg { color: var(--accent-deep); }
.digest-intro { font-size: 15.5px; line-height: 1.6; margin: 0; text-wrap: pretty; }
.digest-intro em { color: var(--ink-soft); }

/* Today's Focus — promoted, focus-mode violet wash */
.focus-card {
  background: linear-gradient(135deg, #F1EDFF, #FCFBFF);
  border: 1px solid rgba(123,97,255,0.40);
  box-shadow: 0 1px 2px rgba(91,63,217,0.08), 0 10px 24px -12px rgba(91,63,217,0.30);
}
.focus-card h3 { color: var(--focus-deep); }
.focus-card .task-card { border: 1px solid rgba(123,97,255,0.16); }

/* ---------- Sunday sweep ---------- */
.sweep-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 94vw);
  background: var(--bg);
  border-radius: 16px;
  box-shadow: 0 24px 70px -20px rgba(28,28,26,0.45);
  z-index: 71;
  animation: fade-in 0.18s ease;
  overflow: hidden;
}
.sweep-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 20px 13px;
}
.sweep-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}
.sweep-head h2 svg { color: var(--accent-deep); }
.sweep-count { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sweep-prog { height: 3px; background: var(--line); }
.sweep-prog span { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }
.sweep-body { padding: 18px 20px 20px; }
.sweep-kind {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 9px;
}
.sweep-card {
  background: var(--paper);
  border-radius: 13px;
  box-shadow: var(--shadow);
  padding: 16px 17px;
  margin-bottom: 14px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sweep-card.sweep-out { opacity: 0; transform: translateX(34px); }
.sweep-task-text { font-size: 17px; line-height: 1.4; margin: 0 0 8px; text-wrap: pretty; }
.sweep-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sweep-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 13px;
  text-align: left;
}
.sweep-btn-label { font-size: 14px; font-weight: 600; }
.sweep-btn-hint { font-size: 11.5px; color: var(--ink-soft); font-weight: 400; }
.sweep-btn.danger .sweep-btn-label { color: var(--priority); }
.sweep-btn.danger:hover { border-color: rgba(193,53,57,0.45); }
.sweep-hint { font-size: 12.5px; color: var(--ink-soft); margin: 0; text-wrap: pretty; }
.sweep-done-title {
  font-family: var(--serif);
  font-size: 19px;
  margin: 4px 0 8px;
  line-height: 1.35;
  text-wrap: pretty;
}
.sweep-finish-actions { display: flex; gap: 9px; margin-top: 16px; }

@media (max-width: 767px) {
  .sweep-modal {
    top: auto;
    left: 0; right: 0; bottom: 0;
    transform: none;
    width: 100%;
    border-radius: 18px 18px 0 0;
    animation: sheet-up 0.25s ease;
  }
  .sweep-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.timeline { display: flex; flex-direction: column; }
.tl-event {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  align-items: baseline;
}
.tl-event:last-child { border-bottom: none; }
.tl-time {
  flex: 0 0 62px;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.inbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.inbox-line strong { color: var(--ink); font-weight: 600; }
.linklike {
  appearance: none; border: none; background: none;
  color: var(--accent-deep);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--priority); }
.linklike:disabled { opacity: 0.5; cursor: default; }

/* ---------- Not now shelf ---------- */
.shelf-group { margin-bottom: 30px; }
.shelf-group .done-day { display: flex; align-items: center; gap: 8px; }
.shelf-group .done-day svg { color: var(--ink-faint); }
.shelf-count {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--soft-06);
  border-radius: 99px;
  padding: 1px 8px;
}
.shelf-hint { font-size: 12.5px; color: var(--ink-soft); margin: -4px 0 10px; }
.shelf-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: var(--paper);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 12px 15px;
  margin-bottom: 8px;
}
.shelf-item.binned { opacity: 0.72; background: var(--cream); box-shadow: none; border: 1px solid var(--line); }
.shelf-text { flex: 1; min-width: 0; }
.shelf-text p { margin: 0 0 6px; font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.shelf-item.binned .shelf-text p { color: var(--ink-soft); }
.shelf-actions { display: flex; gap: 12px; flex: 0 0 auto; padding-top: 2px; flex-wrap: wrap; justify-content: flex-end; }
.shelf-actions .linklike { font-size: 12.5px; }

/* Quick wins row (Today) */
.qw-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.qw-row:last-child { border-bottom: none; }
.qw-row .task-check { width: 22px; height: 22px; margin: 0; }
.qw-row .qw-text { flex: 1; min-width: 0; font-size: 14.5px; }
.qw-row.qw-leaving { animation: qw-out 0.4s ease forwards; }
@keyframes qw-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Done archive ---------- */
.done-group { margin-bottom: 26px; }
.done-day {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 9px;
}
.done-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--paper);
  border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14.5px;
}
.done-item .done-text { text-decoration: line-through; color: var(--ink-soft); flex: 1; min-width: 0; }
.done-check { color: var(--done); flex: 0 0 auto; display: inline-flex; }

/* ---------- Connect ---------- */
.connect-grid { display: flex; flex-direction: column; gap: 13px; }
.connect-card {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 17px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.connect-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.connect-body { flex: 1; min-width: 0; }
.connect-body h3 { margin: 0 0 2px; font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.connect-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-soft); text-wrap: pretty; }
.connect-status {
  font-size: 11px; font-weight: 600;
  color: var(--done-deep);
  background: rgba(15,157,99,0.1);
  border-radius: 99px;
  padding: 2px 8px;
}
.connect-status.soon { color: var(--ink-faint); background: var(--soft-06); }
.connect-account { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.connect-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 11px;
  padding: 22px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 10px;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: rgba(255,107,53,0.05);
  color: var(--accent-deep);
}

/* Suggestion cards */
.suggestion-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  margin-top: 10px;
  animation: sug-in 0.35s ease;
}
@keyframes sug-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}
.sug-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.sug-text { font-size: 14.5px; margin: 0 0 9px; text-wrap: pretty; }
.sug-snippet {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
  margin: -4px 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug-actions { display: flex; gap: 8px; }

/* Paste modal for WhatsApp scan */
.paste-box { margin-top: 10px; }
.paste-box textarea {
  width: 100%;
  min-height: 100px;
  font-family: var(--sans);
  font-size: 13.5px;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 13px;
  resize: vertical;
  outline: none;
}
.paste-box textarea:focus { border-color: var(--accent); }

/* ---------- Settings panel ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,28,26,0.28);
  z-index: 60;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.settings-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 92vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px -18px rgba(60,50,30,0.3);
  z-index: 61;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.22s ease;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.settings-head h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; margin: 0; }
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.set-group label.set-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.set-hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.set-row { display: flex; gap: 8px; }
.set-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
}
.set-row input:focus { border-color: var(--accent); }

.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 14px;
}
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.cat-row .x {
  appearance: none; border: none; background: none;
  margin-left: auto;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
  padding: 0 3px;
  line-height: 1;
}
.cat-row .x:hover { color: var(--priority); }

.usage-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: flex;
  gap: 22px;
}
.usage-box strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.icon-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 7px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.13s ease, background 0.13s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--soft-06); }

.mobile-gear { display: none; }
.mobile-bin { display: none; }

/* ---------- Simulated OAuth modal ---------- */
.auth-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(384px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px -20px rgba(28,28,26,0.45);
  z-index: 81;
  padding: 22px 26px 20px;
  font-family: var(--sans);
  animation: fade-in 0.18s ease;
}
.auth-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}
.auth-title { font-size: 19px; font-weight: 500; margin: 0 0 4px; color: #202124; line-height: 1.3; }
.auth-sub { font-size: 14px; color: #5f6368; margin: 0 0 18px; }
.auth-account {
  appearance: none;
  width: calc(100% + 52px);
  margin: 0 -26px;
  background: none;
  border: none;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
}
.auth-account:hover { background: #f7f8f8; }
.auth-account.alt { border-bottom: 1px solid #eee; }
.auth-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex: 0 0 auto;
}
.auth-avatar.ghost { background: transparent; border: 1px dashed #bbb; color: #5f6368; }
.auth-acc-text { display: flex; flex-direction: column; min-width: 0; }
.auth-acc-name { font-size: 14px; font-weight: 500; color: #202124; }
.auth-acc-email { font-size: 12.5px; color: #5f6368; }
.auth-fine { font-size: 11.5px; color: #5f6368; line-height: 1.5; margin: 14px 0 0; }
.auth-perms { margin: 14px 0 18px; padding-left: 20px; font-size: 13.5px; color: #3c4043; display: flex; flex-direction: column; gap: 6px; }
.auth-actions { display: flex; justify-content: flex-end; gap: 9px; }
.auth-allow { background: #007a5a; border-color: #007a5a; color: #fff; font-weight: 600; }
.auth-allow:hover { background: #00654a; border-color: #00654a; }
.auth-signing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 0 18px;
}
.auth-signing p { margin: 0; font-size: 14px; color: #3c4043; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  width: max-content;
  max-width: 92vw;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  border-radius: 11px;
  padding: 11px 17px;
  font-size: 14px;
  box-shadow: 0 8px 24px -8px rgba(28,28,26,0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease;
  text-wrap: pretty;
  max-width: 92vw;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast .linklike { color: var(--accent); }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .mobile-gear {
    display: inline-flex;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    z-index: 40;
    background: rgba(250,250,245,0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 99px;
  }
  .mobile-bin {
    display: inline-flex;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: 58px;
    z-index: 40;
    background: rgba(250,250,245,0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 99px;
  }
  .mobile-bin-dot {
    position: absolute;
    top: 7px; right: 8px;
    width: 7px; height: 7px;
    border-radius: 99px;
    background: var(--accent);
  }
  .section { padding: 26px 18px calc(96px + env(safe-area-inset-bottom)); }
  .section-title { font-size: 27px; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: rgba(250,250,245,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
  }
  .tab-item {
    appearance: none;
    border: none;
    background: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0 4px;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    min-height: 48px;
  }
  .tab-item.active { color: var(--accent-deep); }

  .settings-panel {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 86vh;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    animation: sheet-up 0.25s ease;
  }
  @keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
  .settings-body { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }

  .toast-stack { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .capture-actions { flex-wrap: wrap; }
  .capture-actions .btn-primary { width: 100%; order: -1; }
  .cost-note { margin-left: 0; }
}

/* ---------- Clarify stage (GTD) ---------- */
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { opacity: 0.85; }

.fpill-divider {
  width: 1px;
  align-self: stretch;
  margin: 2px 3px;
  background: var(--line-strong);
}

.suggested-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.clarify-stage { max-width: 560px; }

.clarify-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.clarify-count { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.clarify-dots { display: inline-flex; gap: 6px; }
.cdot {
  width: 8px; height: 8px; border-radius: 99px;
  background: var(--line-strong);
  transition: background 0.2s ease, transform 0.2s ease;
}
.cdot.done { background: var(--focus); }
.cdot.active { background: var(--focus); transform: scale(1.35); box-shadow: 0 0 0 3px rgba(123,97,255,0.20); }

.ai-badge {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 99px;
  background: var(--focus-wash);
  color: var(--focus-deep); /* v2: raw violet never carries text */
}

/* Card mode */
.clarify-card {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  animation: clarify-in 0.34s ease;
}
.clarify-card.leaving { animation: clarify-out 0.3s ease forwards; }
@keyframes clarify-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes clarify-out { to { opacity: 0; transform: translateX(40px); } }

.clarify-raw {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 12px;
}
.clarify-raw span { color: var(--ink); text-transform: none; font-weight: 500; letter-spacing: 0; }

.clarify-firstanswer {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-style: italic;
  padding-left: 11px;
  border-left: 2px solid var(--line-strong);
}

.clarify-q {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: rgba(123,97,255,0.08);
  border: 1px solid rgba(123,97,255,0.26);
  border-radius: 13px;
  padding: 13px 14px;
  margin-bottom: 14px;
}
.clarify-q p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.45;
  font-family: var(--serif);
  color: var(--ink);
  padding-top: 2px;
  text-wrap: pretty;
}

.clarify-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 58px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.clarify-input::placeholder { color: var(--ink-soft); }
.clarify-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,0.14); }

.clarify-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

/* Chat mode */
.clarify-chat {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  animation: clarify-in 0.34s ease;
}
.clarify-chat.leaving { animation: clarify-out 0.3s ease forwards; }

.chat-thread { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; align-items: flex-end; gap: 9px; max-width: 100%; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg .bubble {
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 80%;
  text-wrap: pretty;
}
.chat-msg.ai .bubble {
  background: var(--cream);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: var(--ink);
}
.chat-msg.user .bubble {
  background: var(--ink);
  color: var(--bg);
  border-bottom-right-radius: 5px;
}
.chat-msg .bubble.result { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.result-item { display: flex; flex-direction: column; gap: 6px; }
.result-item + .result-item { padding-top: 8px; border-top: 1px dashed var(--line); }

.bucket-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--focus-deep);
  background: rgba(123,97,255,0.13);
  border-radius: 99px;
  padding: 3px 9px;
}
.result-title { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.result-next { margin: 0; font-size: 13px; color: var(--ink-soft); }
.chat-result-actions { display: flex; gap: 8px; margin-top: 2px; }
.chat-edit {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
}

.bubble.typing { display: inline-flex; gap: 4px; align-items: center; }
.bubble.typing span {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--ink-faint);
  animation: typing-bounce 1.1s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.chat-compose textarea {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 10px 13px;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-compose textarea::placeholder { color: var(--ink-soft); }
.chat-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,0.14); }

@media (prefers-reduced-motion: reduce) {
  .clarify-card, .clarify-chat { animation: none; }
  .clarify-card.leaving, .clarify-chat.leaving { animation: none; opacity: 0; }
  .bubble.typing span { animation: none; }
}

/* ============================================================
   Pomodoro focus timer
   ============================================================ */
.pomodoro-active .sidebar,
.pomodoro-active .tabbar,
.pomodoro-active .mobile-gear,
.pomodoro-active .mobile-bin { display: none; }

/* Task-card Focus button + tomato chip */
.card-actions .focus-btn { color: var(--accent-deep); }
.card-actions .focus-btn:hover { border-color: var(--accent); background: rgba(255,107,53,0.08); }
.chip.pomo-chip {
  appearance: none;
  cursor: default;
  /* v2: focus-wash fill, focus-deep text */
  border: none;
  background: var(--focus-wash);
  color: var(--focus-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  letter-spacing: 0.01em;
}
.chip.pomo-chip:hover { background: var(--focus-wash); color: var(--focus-deep); }

.focus-nudge .nudge-text {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
  text-wrap: pretty;
}

/* Full-screen modal */
.pomo-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: pomo-fade 0.25s ease;
}
/* v2: full-screen tones deepened so white text passes AA */
.pomo-modal.tone-work  { background: linear-gradient(155deg, #6A4DF0 0%, #5B3FD9 100%); }
.pomo-modal.tone-break { background: linear-gradient(155deg, #348063 0%, #2A6950 100%); }
.pomo-modal.tone-long  { background: linear-gradient(155deg, #0E6DBF 0%, #0061b6 100%); }
@keyframes pomo-fade { from { opacity: 0; } to { opacity: 1; } }

.pomo-screen {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pomo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin-bottom: 14px;
}
.pomo-eyebrow svg { stroke: currentColor; }

.pomo-task {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.18;
  margin: 0 0 8px;
  text-wrap: balance;
  max-width: 460px;
}
.pomo-complete-sub { margin: 2px 0 0; font-size: 16px; color: rgba(255,255,255,0.85); }
.pomo-question { margin: 22px 0 18px; font-size: 18px; font-weight: 600; }

/* Circular timer */
.pomo-ring-wrap { position: relative; width: 300px; height: 300px; margin: 24px 0 30px; }
.pomo-ring { display: block; }
.pomo-ring-track { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 12; }
.pomo-ring-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s linear;
}
.pomo-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pomo-clock { font-size: 64px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pomo-clock-sub { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.8); margin-top: 4px; }

/* Actions */
.pomo-actions { display: flex; align-items: center; gap: 12px; }
.pomo-actions-stack { flex-direction: column; width: 100%; max-width: 320px; }
.pomo-actions-stack .btn { width: 100%; justify-content: center; }
.pomo-btn-solid {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff;
  color: var(--ink);
  border: none;
  font-weight: 600;
  padding: 12px 22px;
}
.pomo-btn-solid:hover { background: #fff; opacity: 0.92; }
.pomo-btn-solid svg { stroke: currentColor; }
.pomo-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.45);
  padding: 12px 20px;
}
.pomo-btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }

.pomo-foot { margin-top: 20px; font-size: 13px; color: rgba(255,255,255,0.72); }

.pomo-skip { position: absolute; left: 24px; bottom: 28px; font-size: 13px; padding: 8px 14px; }
.pomo-dismiss {
  position: absolute;
  top: 22px; right: 22px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 99px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  cursor: pointer;
}
.pomo-dismiss:hover { background: rgba(255,255,255,0.28); }
.pomo-dismiss svg { stroke: currentColor; }

/* Floating break pill */
.break-pill {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border: none;
  border-radius: 99px;
  background: var(--pomo-break);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 6px 20px -6px rgba(0,0,0,0.4);
  animation: pill-rise 0.3s ease;
}
.break-pill.long { background: var(--pomo-long); }
.break-pill:hover { filter: brightness(1.05); }
.break-pill-dot {
  width: 9px; height: 9px; border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.6);
  animation: pill-pulse 2s infinite;
}
@keyframes pill-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pill-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

@media (min-width: 880px) {
  .break-pill { bottom: 22px; }
}

/* Settings number inputs */
.set-num { width: 72px; text-align: center; }
.set-inline-label { font-size: 13.5px; color: var(--ink); min-width: 96px; }
.set-hint-inline { font-size: 12.5px; color: var(--ink-soft); }

@media (max-width: 560px) {
  .pomo-ring-wrap { width: 240px; height: 240px; }
  .pomo-ring { width: 240px; height: 240px; }
  .pomo-clock { font-size: 52px; }
  .pomo-task { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .pomo-modal, .break-pill { animation: none; }
  .pomo-ring-fill { transition: none; }
  .break-pill-dot { animation: none; }
}

/* ============================================================
   Calendar
   ============================================================ */
:root {
  --cal-event: #5b7bb0;
  --cal-appt: var(--accent-deep);
  --cal-action: #3d8b5f;
  --cal-info: #8a6fb0;
}

.cal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.cal-view-tabs { gap: 20px; border-bottom: none; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  appearance: none;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 9px;
  color: var(--ink-soft);
  cursor: pointer;
}
.cal-nav-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.cal-nav-btn svg { stroke: currentColor; }
.cal-heading { font-weight: 600; font-size: 15px; min-width: 132px; text-align: center; }
.cal-today { margin-left: 4px; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.cal-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.cal-leg .dot { width: 9px; height: 9px; border-radius: 99px; }
.cal-leg.is-event .dot { background: var(--cal-event); }
.cal-leg.is-appt .dot { background: var(--cal-appt); }
.cal-leg.is-action .dot { background: var(--cal-action); }
.cal-leg.is-info .dot { background: var(--cal-info); }

/* item chips */
.cal-section { max-width: 1120px; }
.cal-item {
  appearance: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  border-left: 3px solid var(--line-strong);
  background: var(--cream);
  border-radius: 6px;
  padding: 5px 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.3;
}
.cal-item:hover { background: #fff; box-shadow: var(--shadow); }
.cal-item.is-event { border-left-color: var(--cal-event); }
.cal-item.is-appt { border-left-color: var(--cal-appt); }
.cal-item.is-action { border-left-color: var(--cal-action); }
.cal-item.is-info { border-left-color: var(--cal-info); }
.cal-item-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-soft); flex: 0 0 auto; }
.cal-item-time.muted { color: var(--ink-soft); font-weight: 500; }
.cal-item-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Week view: readable blocks — title leads, time beneath, soft tinted fill */
.cal-item.block {
  display: block;
  align-items: stretch;
  border-left-width: 3px;
  border-radius: 5px 7px 7px 5px;
  padding: 6px 9px 7px;
  line-height: 1.25;
}
.cal-item.block .cal-item-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: -0.005em;
}
.cal-item.block .cal-item-time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
}
.cal-item.block.is-event { background: rgba(91,123,176,0.10); }
.cal-item.block.is-event .cal-item-time { color: var(--cal-event); }
.cal-item.block.is-appt { background: rgba(255,107,53,0.12); }
.cal-item.block.is-appt .cal-item-time { color: var(--cal-appt); }
.cal-item.block.is-action { background: rgba(61,139,95,0.11); }
.cal-item.block.is-action .cal-item-time { color: var(--cal-action); }
.cal-item.block.is-info { background: rgba(138,111,176,0.12); }
.cal-item.block.is-info .cal-item-time { color: var(--cal-info); }
.cal-item.block:hover { box-shadow: var(--shadow); filter: brightness(0.98); }

/* Month view: tight one-line chip with a leading colour dot */
.cal-item.compact { padding: 2px 6px 2px 5px; font-size: 11.5px; border-radius: 4px; border-left: none; background: transparent; gap: 5px; align-items: center; }
.cal-item.compact:hover { background: var(--cream); box-shadow: none; }
.cal-item-dot { display: none; }
.cal-item.compact .cal-item-dot { display: block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 99px; background: var(--line-strong); }
.cal-item.compact.is-event .cal-item-dot { background: var(--cal-event); }
.cal-item.compact.is-appt .cal-item-dot { background: var(--cal-appt); }
.cal-item.compact.is-action .cal-item-dot { background: var(--cal-action); }
.cal-item.compact.is-info .cal-item-dot { background: var(--cal-info); }
.cal-item.compact .cal-item-time { font-size: 11px; font-weight: 600; }

/* week view */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.cal-week-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  min-height: 200px;
}
.cal-week-col.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,107,53,0.16); }
.cal-week-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.cal-dow { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.cal-dnum { font-size: 16px; font-weight: 600; }
.cal-week-col.today .cal-dnum { color: var(--accent-deep); }
.cal-week-body { display: flex; flex-direction: column; gap: 5px; }
.cal-empty { color: var(--line-strong); font-size: 13px; padding: 4px 2px; }

/* month view */
.cal-month-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 6px; }
.cal-month-dow span { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding-left: 4px; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }
.cal-cell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-cell.other { background: transparent; border-color: transparent; }
.cal-cell.other .cal-cell-num { color: var(--line-strong); }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,107,53,0.16); }
.cal-cell-num { font-size: 13px; font-weight: 600; color: var(--ink-soft); padding-left: 2px; }
.cal-cell.today .cal-cell-num { color: var(--accent-deep); }
.cal-cell-items { display: flex; flex-direction: column; gap: 3px; }
.cal-more { appearance: none; border: none; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 600; text-align: left; padding: 1px 4px; cursor: pointer; }
.cal-more:hover { color: var(--ink); }

/* detail popover */
.cal-detail-scrim { position: fixed; inset: 0; z-index: 120; background: rgba(28,28,26,0.28); }
.cal-detail {
  position: fixed;
  z-index: 121;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 20px 50px -16px rgba(60,50,30,0.4);
  animation: cat-pop 0.16s ease;
}
.cal-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-detail-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; }
.cal-detail-tag svg { stroke: currentColor; }
.cal-detail-tag.is-event { color: var(--cal-event); background: rgba(91,123,176,0.12); }
.cal-detail-tag.is-appt { color: var(--cal-appt); background: rgba(255,107,53,0.14); }
.cal-detail-tag.is-action { color: var(--cal-action); background: rgba(61,139,95,0.12); }
.cal-detail-tag.is-info { color: var(--cal-info); background: rgba(138,111,176,0.13); }
.cal-detail-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; line-height: 1.3; text-wrap: pretty; }
.cal-detail-meta { margin: 0; font-size: 14px; color: var(--ink-soft); }
.cal-detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.cal-detail-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }

/* small segmented control (schedule type) */
.seg.seg-sm button { padding: 6px 11px; font-size: 12.5px; }

/* ---------- Dark-mode overrides for hardcoded-light spots ---------- */
[data-theme="dark"] .focus-card {
  background: linear-gradient(135deg, rgba(123,97,255,0.18), rgba(123,97,255,0.05));
}
[data-theme="dark"] .cal-item:hover { background: var(--paper); }
[data-theme="dark"] .fpill.active .fcount { color: var(--bg); background: rgba(0,0,0,0.22); }
[data-theme="dark"] .fpill.quick.active .fcount { color: var(--action-deep); background: var(--bg); }
[data-theme="dark"] .switch::after { box-shadow: 0 1px 2px rgba(0,0,0,0.5); }

@media (max-width: 760px) {
  .cal-week { grid-template-columns: repeat(7, minmax(116px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .cal-cell { min-height: 76px; }
  .cal-detail { top: auto; bottom: 0; transform: translateX(-50%); left: 50%; width: 100%; border-radius: 18px 18px 0 0; }
}

/* ============================================================
   Tooltips, info icons, one-time hints + project next-action
   (inline GTD teaching)
   ============================================================ */
.tooltip-wrap { position: relative; display: inline-flex; align-items: center; }
.tooltip-text {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 11px;
  border-radius: 9px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  font-style: normal;
  width: max-content;
  max-width: min(244px, 72vw);
  white-space: normal;
  text-align: left;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
  box-shadow: 0 8px 24px -10px rgba(28,25,23,0.55);
}
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tooltip-wrap:hover .tooltip-text,
.tooltip-text.tooltip-open { opacity: 1; }
/* Near the top of the content the upward tooltip gets clipped — flip section-sub tooltips below. */
.section-sub .tooltip-text { bottom: auto; top: calc(100% + 9px); }
.section-sub .tooltip-text::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }

.info-icon {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--ink-soft);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  margin-left: 6px;
  flex: 0 0 auto;
  vertical-align: middle;
  outline: none;
  transition: background 0.13s ease;
}
.info-icon:hover, .info-icon:focus-visible { background: var(--ink); }
.section-sub .info-icon, .done-day .info-icon, .digest-card h3 .info-icon,
.pomo-chip .info-icon, .fpill .info-icon { vertical-align: middle; }
/* On the violet Focus heading the muted grey badge would vanish — tint it. */
.focus-card h3 .info-icon { background: rgba(123,97,255,0.45); }

.context-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--nudge);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--nudge-text);
  text-wrap: pretty;
}
.context-hint > svg { flex: 0 0 auto; margin-top: 1px; color: var(--nudge); }
.context-hint-body { flex: 1; }
.context-hint-dismiss {
  appearance: none;
  background: none;
  border: none;
  color: var(--nudge);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
}
.context-hint-dismiss:hover { color: #7a5a10; }

.project-next {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 8px 0 2px;
  padding-left: 1px;
  text-wrap: pretty;
}
.project-next strong { color: var(--ink); font-weight: 600; }
.project-next.empty { color: var(--ink-soft); font-style: italic; }

/* ============================================================
   Project card — outcome, one-next-action, tickable steps
   ============================================================ */
.project-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 9px 0 4px;
}

/* Outcome statement ("done when…") */
.project-outcome {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  font-style: italic;
  cursor: text;
  text-wrap: pretty;
}
.project-outcome::before {
  content: "Done when: ";
  font-style: normal;
  font-weight: 600;
  color: var(--ink-soft);
}
.outcome-prompt { align-self: flex-start; font-size: 13px; font-weight: 500; color: var(--accent-deep); }
.outcome-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.outcome-edit input {
  flex: 1 1 220px; min-width: 0;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--cream); border: 1px solid var(--line-strong);
  border-radius: 9px; padding: 8px 11px; outline: none;
}
.outcome-edit input:focus { border-color: var(--accent); }

/* Q1B — slim "next step" input row (replaces the old empty box) */
.next-step-row { display: flex; align-items: center; gap: 8px; }
.next-step-row .step-input { flex: 1 1 auto; min-width: 0; }
.ai-suggest {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 9px;
  color: #6d5ae0;
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.ai-suggest:hover { background: rgba(109,90,224,0.08); border-color: rgba(109,90,224,0.5); }
.ai-suggest:disabled { cursor: default; opacity: 0.7; }
.ai-suggest.off { color: var(--ink-faint); opacity: 0.6; cursor: default; }
.project-upcoming { margin-top: 2px; }

/* The single current next action */
.project-now {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  background: rgba(123,97,255,0.07);
  border: 1px solid rgba(123,97,255,0.24);
  border-radius: 10px;
  padding: 10px 12px;
}
.project-now .now-label {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; text-transform: none;
  color: var(--done); background: rgba(63,157,98,0.13);
  border-radius: 5px; padding: 3px 7px; margin-top: 1px;
}
.project-now .now-text { flex: 1; font-size: 15px; line-height: 1.42; color: var(--ink); text-wrap: pretty; cursor: text; }
/* Inline step edit + delete (project subtasks) */
.step-edit-input { flex: 1 1 auto !important; min-width: 0; padding: 6px 9px !important; font-size: 14px !important; }
.step-upcoming li .up-text { flex: 1; cursor: text; }
.step-del {
  flex: 0 0 auto;
  appearance: none; border: none; background: transparent;
  color: var(--ink-soft); font-size: 17px; line-height: 1;
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0.35; transition: opacity 0.13s ease, color 0.13s ease, background 0.13s ease;
}
.project-now:hover .step-del, .step-upcoming li:hover .step-del { opacity: 1; }
.step-del:hover { color: #c0392b; background: rgba(192,57,43,0.09); }
.project-now.empty, .project-now.done-all {
  background: transparent; border: 1px dashed var(--line-strong); padding: 9px 12px;
}
.project-now.empty .now-text, .project-now.done-all .now-text { color: var(--ink-soft); font-size: 13.5px; }

/* Round step checkbox (mirrors .task-check, smaller) */
.step-check {
  appearance: none; flex: 0 0 auto;
  width: 22px; height: 22px; margin-top: 0; padding: 0;
  border-radius: 50%; border: 2px solid var(--line-strong); background: transparent;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: transparent; transition: border-color 0.14s ease, background 0.18s ease, color 0.18s ease;
}
.step-check:hover { border-color: var(--done); }
.step-check.checked { background: var(--done); border-color: var(--done); color: #fff; }
.step-check.sm { width: 18px; height: 18px; }

/* Upcoming (committed) steps from a full plan */
.step-upcoming { list-style: none; margin: 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: 7px; }
.step-upcoming li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); }
.step-upcoming .step-min { color: var(--ink-soft); font-size: 12px; margin-left: 6px; }

/* AI / manual next-step suggestion (focus violet) */
.project-suggest {
  background: rgba(123,97,255,0.06);
  border: 1px solid rgba(123,97,255,0.22);
  border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; color: var(--ink);
  display: flex; flex-direction: column; gap: 8px;
}
.project-suggest.loading { flex-direction: row; align-items: center; gap: 9px; color: var(--ink-soft); }
.project-suggest.need-ai { color: var(--ink-soft); }
.suggest-text { margin: 0; font-size: 14.5px; line-height: 1.4; text-wrap: pretty; }
.suggest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.step-input {
  flex: 1 1 220px; min-width: 0;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--cream); border: 1px solid var(--accent);
  border-radius: 9px; padding: 8px 11px; outline: none;
}

/* "Plan it all" caveat (amber — a gentle warning it's speculative) */
.plan-caveat {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--nudge);
  border-radius: 9px; padding: 10px 12px;
  font-size: 13px; color: var(--nudge-text);
  display: flex; flex-direction: column; gap: 8px;
}
.plan-caveat p { margin: 0; line-height: 1.45; text-wrap: pretty; }

/* Completed steps, collapsed */
.project-done { display: flex; flex-direction: column; gap: 7px; }
.steps-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-soft); }
.steps-toggle .tw-chev { display: inline-flex; transition: transform 0.15s ease; }
.steps-toggle.open .tw-chev { transform: rotate(90deg); }
.step-done-list { list-style: none; margin: 0; padding: 0 0 0 2px; display: flex; flex-direction: column; gap: 7px; }
.step-done-list li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.step-done-list .done-text { text-decoration: line-through; color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) {
  .steps-toggle .tw-chev { transition: none; }
}
