/* ==========================================================================
   Workspace components (tasks, projects, notes, people, review, palette, dark mode)
   ========================================================================== */
.text-ink { color: var(--ink) !important; }
.text-faint { color: var(--faint); }
.btn-ghost { --bs-btn-color: var(--muted); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--border-2); border: 0; padding: .25rem .5rem; }
.btn-xs { padding: .15rem .45rem; font-size: .72rem; border-radius: 6px; }
kbd { background: var(--ink); color: #fff; border-radius: 5px; padding: .1em .4em; font-size: .78em; font-family: var(--bs-body-font-family); }

/* Quick add */
.quick-add { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .5rem .4rem .9rem; box-shadow: var(--shadow-sm); }
.quick-add > i { color: var(--accent); font-size: 1.15rem; }
.quick-add .form-control { border: 0; box-shadow: none; padding: .45rem .25rem; font-size: 1rem; background: transparent; }
.quick-add:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Task rows */
.task-list { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border-2); transition: background .12s ease; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.task-row.compact { padding: .45rem .9rem; }
.task-row.done .task-title { color: var(--muted); text-decoration: line-through; }
.task-row.pri-urgent { box-shadow: inset 3px 0 0 var(--bad); }
.task-row.pri-high { box-shadow: inset 3px 0 0 var(--warn); }
.task-row.pri-low .task-title { color: var(--ink-2); }
.task-check { margin: 0; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; background: var(--surface); color: transparent; display: grid; place-items: center; font-size: .8rem; padding: 0; margin-top: .1rem; transition: all .15s ease; cursor: pointer; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.checked, .check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 500; color: var(--ink); }
.task-title:hover { color: var(--accent-ink); text-decoration: none; }
.task-meta { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; font-size: .76rem; color: var(--muted); margin-top: .2rem; }
.task-actions { opacity: 0; transition: opacity .12s ease; }
.task-row:hover .task-actions, .task-row:focus-within .task-actions { opacity: 1; }
.due-overdue { color: var(--bad); font-weight: 600; }
.due-today { color: var(--accent-ink); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--ink-2); font-size: .74rem; font-weight: 500; white-space: nowrap; }
a.chip:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: #c7d2fe; text-decoration: none; }
.chip-on { background: var(--accent-soft); color: var(--accent-ink); border-color: #c7d2fe; }
.chip-tag { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.chip-wait { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.chip-src { background: var(--info-soft); color: var(--info-ink); border-color: transparent; }

/* Views nav */
.view-nav { display: flex; flex-direction: column; padding: .4rem; }
.view-nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.view-nav a i { color: var(--faint); width: 18px; text-align: center; }
.view-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.view-nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.view-nav a.active i { color: var(--accent); }
.view-nav .count { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: .05rem .45rem; }
.view-nav .count.hot { background: var(--bad); color: #fff; }

/* Inbox triage */
.triage-row { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.triage-row:last-child { border-bottom: 0; }
.triage-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.triage-actions .btn span { margin-left: .3rem; }
@media (max-width: 767px) { .triage-actions .btn span { display: none; } }

/* Priority matrix */
.q-do { box-shadow: inset 0 3px 0 var(--bad), var(--shadow-sm); }
.q-plan { box-shadow: inset 0 3px 0 var(--step1), var(--shadow-sm); }
.q-delegate { box-shadow: inset 0 3px 0 var(--warn), var(--shadow-sm); }
.q-drop { box-shadow: inset 0 3px 0 var(--faint), var(--shadow-sm); }

/* Projects */
.project-card { display: block; color: inherit; }
.project-card:hover { text-decoration: none; color: inherit; }
.health { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.health::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.health-green { background: var(--ok-soft); color: var(--ok-ink); }
.health-amber { background: var(--warn-soft); color: var(--warn-ink); }
.health-red { background: var(--bad-soft); color: var(--bad-ink); }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; margin-bottom: 1rem; }
.board-col { background: var(--surface-2); border-radius: var(--radius); padding: .6rem; min-height: 12rem; }
.board-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); padding: .2rem .4rem .6rem; display: flex; justify-content: space-between; }
.board-card { background: var(--surface); border-radius: 10px; padding: .6rem .7rem; box-shadow: var(--shadow-sm); margin-bottom: .5rem; font-size: .88rem; }

/* Notes */
.note-card { display: block; color: inherit; }
.note-card:hover { text-decoration: none; color: inherit; }
.note-body { font-family: var(--bs-body-font-family); line-height: 1.6; font-size: .95rem; }

/* Energy picker */
.energy { display: inline-flex; gap: .25rem; }
.energy label { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.energy label.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.energy input { display: none; }

/* Weekly review */
.review-steps { display: flex; flex-wrap: wrap; gap: .4rem; }
.review-step { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem .35rem .4rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); font-size: .82rem; font-weight: 500; }
.review-step:hover { text-decoration: none; border-color: var(--accent-2); color: var(--accent-ink); }
.review-step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .72rem; font-weight: 700; color: var(--muted); }
.review-step.done { border-color: #bbf7d0; background: var(--ok-soft); color: var(--ok-ink); }
.review-step.done .n { background: var(--ok); color: #fff; }

/* Scorecard bars */
.bars { display: flex; align-items: flex-end; gap: .5rem; height: 160px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-stack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { width: 40%; border-radius: 4px 4px 0 0; min-height: 2px; opacity: .9; }
.bar-label { font-size: .65rem; color: var(--muted); margin-top: .3rem; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: .25rem; vertical-align: middle; }

/* Habits */
.habit-table th.today { background: var(--accent-soft); color: var(--accent-ink); }
.habit-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); padding: 0; }
.habit-dot.on { background: var(--ok); border-color: var(--ok); }
.habit-dot.off { opacity: .3; }
.habit-dot:hover { border-color: var(--ok); }

/* Focus mode */
.focus-wrap { min-height: calc(100vh - var(--topbar-h) - 6rem); display: grid; place-items: center; }
.focus-card { text-align: center; max-width: 640px; width: 100%; background: var(--surface); border-radius: 24px; padding: 3rem 2rem; box-shadow: var(--shadow-md); }
.focus-title { font-size: 2rem; margin: .5rem 0; }
.focus-timer { font-size: 4.5rem; font-weight: 700; letter-spacing: -.04em; margin: 1.5rem 0 .5rem; color: var(--ink); }
.focus-card.running .focus-timer { color: var(--accent); }
.focus-card.over .focus-timer { color: var(--ok); }

/* Command palette */
.palette-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; backdrop-filter: blur(2px); }
.palette-backdrop.open { display: flex; }
.palette { width: min(640px, 92vw); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); overflow: hidden; }
.palette input { width: 100%; border: 0; outline: 0; padding: 1rem 1.25rem; font-size: 1.05rem; background: transparent; color: var(--ink); }
.palette-list { max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--border-2); }
.palette-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; color: var(--ink); cursor: pointer; }
.palette-item i { color: var(--faint); width: 18px; text-align: center; }
.palette-item .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-left: auto; }
.palette-item .s { font-size: .78rem; color: var(--muted); }
.palette-item.active, .palette-item:hover { background: var(--accent-soft); text-decoration: none; }
.palette-hint { padding: .5rem 1.25rem; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--border-2); display: flex; gap: 1rem; }

/* Sidebar module (collapsible) */
.nav-module { margin-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: .75rem; }
.nav-module-toggle { display: flex; align-items: center; gap: .6rem; width: 100%; background: transparent; border: 0; color: #c9d2e3; font-weight: 600; font-size: .85rem; padding: .5rem .75rem; border-radius: 10px; text-align: left; }
.nav-module-toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-module-toggle i.chev { margin-left: auto; transition: transform .2s ease; font-size: .8rem; color: #8b97b1; }
.nav-module-toggle[aria-expanded="true"] i.chev { transform: rotate(90deg); }
.nav-module-toggle .count { font-size: .7rem; font-weight: 700; background: var(--bad); color: #fff; padding: .1rem .45rem; border-radius: 999px; }
.nav-module .snav { padding-left: 1.1rem; font-size: .86rem; }
.nav-module .nav-eyebrow { padding-left: 1.1rem; }

/* Microsoft sign-in */
.btn-ms { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; background: #fff; border: 1px solid var(--border); color: var(--ink); font-weight: 600; padding: .65rem; border-radius: var(--radius-sm); }
.btn-ms:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo span:nth-child(1) { background: #f25022; } .ms-logo span:nth-child(2) { background: #7fba00; } .ms-logo span:nth-child(3) { background: #00a4ef; } .ms-logo span:nth-child(4) { background: #ffb900; }

/* Dark mode */
:root[data-theme="dark"] {
  --ink: #e5e7eb; --ink-2: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
  --bg: #0f1420; --surface: #171d2d; --surface-2: #1d2436; --border: #2a3247; --border-2: #232b3d;
  --accent-soft: #1e1b4b; --accent-ink: #c7d2fe;
  --step1-soft: #1e3a8a; --step1-ink: #bfdbfe; --step2-soft: #134e4a; --step2-ink: #99f6e4; --step3-soft: #78350f; --step3-ink: #fde68a;
  --ok-soft: #14532d; --ok-ink: #bbf7d0; --warn-soft: #78350f; --warn-ink: #fde68a; --bad-soft: #7f1d1d; --bad-ink: #fecaca; --info-soft: #0c4a6e; --info-ink: #bae6fd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6);
  --bs-body-bg: var(--bg); --bs-body-color: var(--ink);
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .topbar { background: rgba(15, 20, 32, .85); }
:root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select, :root[data-theme="dark"] .quick-add, :root[data-theme="dark"] .check, :root[data-theme="dark"] .btn-outline-secondary, :root[data-theme="dark"] .btn-outline-primary { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .form-control::placeholder { color: var(--faint); }
:root[data-theme="dark"] .table thead th { background: var(--surface-2); }
:root[data-theme="dark"] .badge.bg-secondary { background: var(--surface-2) !important; color: var(--ink-2); }
:root[data-theme="dark"] .vmv { background: var(--accent-soft); }
:root[data-theme="dark"] .script-line { background: var(--step2-soft); color: var(--step2-ink); }
:root[data-theme="dark"] .dropdown-menu { background: var(--surface); border: 1px solid var(--border); }
:root[data-theme="dark"] .dropdown-item { color: var(--ink); }
:root[data-theme="dark"] .dropdown-item:hover { background: var(--surface-2); }
:root[data-theme="dark"] .modal-content { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .card.bg-light { background: var(--surface-2) !important; }
:root[data-theme="dark"] .list-group-item { color: var(--ink); }
:root[data-theme="dark"] .bg-light { background: var(--surface-2) !important; }
:root[data-theme="dark"] .date-block { background: var(--surface-2); }
:root[data-theme="dark"] code { background: var(--accent-soft); color: var(--accent-ink); }

/* Bell badge */
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }

/* AI */
.ai-card { background: linear-gradient(135deg, #f5f3ff, #eef2ff); border: 1px solid #ddd6fe; }
.ai-card .card-header { border-bottom-color: #ddd6fe; }
.ai-answer { font-size: .95rem; line-height: 1.6; }
:root[data-theme="dark"] .ai-card { background: linear-gradient(135deg, #1e1b4b, #171d2d); border-color: #3730a3; }

/* Accessibility */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 3000; background: var(--accent); color: #fff; padding: .5rem .8rem; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.btn:focus-visible, .check:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft); outline: 0; }

/* Capture page */
.capture-wrap { max-width: 560px; margin: 0 auto; }

/* Print: a clean daily plan */
@media print {
  .sidebar, .topbar, .flash, .quick-actions, .quick-add, .task-actions, .task-check, .palette-backdrop, .modal, form button, .principle, .ai-card, .skip-link { display: none !important; }
  .main { margin: 0; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .col-xl-8, .col-xl-4, .col-xl-7, .col-xl-5 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  .task-row { padding: .3rem .5rem; } .task-row::before { content: "☐ "; }
}

/* Organization roll-up, stat grid, audit */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat-grid .stat { display: block; }
.stat-grid .stat .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat-grid .stat .v { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin-top: .15rem; }
.stat-grid .stat .s { font-size: .76rem; color: var(--muted); }
.org-card { color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.org-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.org-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem .6rem; }
.org-metrics > div { display: flex; flex-direction: column; }
.org-metrics .k { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.org-metrics .v { font-weight: 700; font-size: 1.05rem; }
.audit-changes { max-width: 28rem; font-size: .78rem; }
.audit-changes div { white-space: normal; word-break: break-word; }

/* Sparklines */
.spark-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.5rem; }
.spark-grid-2 { grid-template-columns: repeat(2, 1fr); }
.spark-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .15rem; }
.spark-head .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.spark-head .v { font-weight: 700; font-size: 1.05rem; }
.spark-empty { font-size: .78rem; color: var(--faint); padding: .6rem 0; }
.badge.border-0 { cursor: pointer; }

/* Org chart tree */
.org-tree ul { list-style: none; margin: 0; padding-left: 1.6rem; position: relative; }
.org-tree ul.tree-root { padding-left: 0; }
.org-tree li { position: relative; }
.org-tree ul ul li::before { content: ""; position: absolute; left: -1rem; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.org-tree ul ul li:last-child::before { bottom: auto; height: 1.35rem; }
.org-tree ul ul li::after { content: ""; position: absolute; left: -1rem; top: 1.35rem; width: .8rem; border-top: 1px solid var(--border); }
.org-tree li.collapsed > ul { display: none; }
.tree-node { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: 10px; margin: .1rem 0; }
.tree-node:hover { background: var(--surface-2); }
.tree-node.hit { background: var(--accent-soft); box-shadow: inset 0 0 0 1px #c7d2fe; }
.tree-toggle { border: 0; background: transparent; color: var(--muted); width: 1.4rem; height: 1.4rem; display: grid; place-items: center; border-radius: 6px; padding: 0; }
.tree-toggle:hover { background: var(--surface-2); color: var(--ink); }
.tree-toggle i { transition: transform .15s ease; }
li.collapsed > .tree-node .tree-toggle i { transform: rotate(-90deg); }
.tree-toggle-spacer { width: 1.4rem; flex: 0 0 auto; }
.tree-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tree-name { font-weight: 600; color: var(--ink); }
.tree-title { font-size: .76rem; color: var(--muted); }
.tree-count { margin-left: auto; font-size: .76rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.tree-link { color: var(--muted); padding: 0 .25rem; }
.tree-link:hover { color: var(--accent); }

/* Leader view */
.leader-table th { white-space: nowrap; }
.leader-table th.sort-asc::after { content: " ▲"; font-size: .7em; }
.leader-table th.sort-desc::after { content: " ▼"; font-size: .7em; }
.leader-table td { white-space: nowrap; }
.leader-table td:last-child { white-space: normal; min-width: 12rem; }
.pre-wrap { white-space: pre-wrap; }
.meter { height: 8px; border-radius: 4px; background: var(--border-2); overflow: hidden; margin-top: 3px; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

/* ---- Task categories ------------------------------------------------------------------------ */
.cat-dot { display: inline-block; flex: 0 0 auto; width: .55rem; height: .55rem; border-radius: 50%; background: hsl(var(--h, 220) 65% 52%); }
.chip-cat { gap: .35rem; background: hsl(var(--h, 220) 80% 95%); color: hsl(var(--h, 220) 60% 28%); border-color: transparent; }
a.chip-cat:hover, .chip-cat.chip-on { background: hsl(var(--h, 220) 75% 88%); color: hsl(var(--h, 220) 65% 22%); border-color: hsl(var(--h, 220) 55% 70%); }
.task-actions .dropdown-menu { max-height: 75vh; overflow-y: auto; }
.cat-board { display: flex; align-items: flex-start; gap: .75rem; overflow-x: auto; padding-bottom: .75rem; }
.cat-col { flex: 0 0 290px; min-width: 0; display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid hsl(var(--h, 220) 65% 55%); border-radius: var(--radius); }
.cat-col.none { border-top-color: var(--faint); }
.cat-col.none .cat-dot { background: var(--faint); }
.cat-col.drop { background: hsl(var(--h, 220) 80% 96%); outline: 2px dashed hsl(var(--h, 220) 60% 55%); outline-offset: -2px; }
.cat-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .5rem .45rem .8rem; }
.cat-name { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-head .count { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--border-2); border-radius: 999px; padding: .05rem .45rem; }
.cat-items { flex: 1 1 auto; min-height: 3.25rem; padding: 0 .5rem; }
.cat-items .task-row { gap: .5rem; padding: .5rem .6rem; margin-bottom: .45rem; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow-sm); }
.cat-items .task-row[draggable="true"] { cursor: grab; }
.cat-items .task-row.dragging { opacity: .4; }
.cat-items .task-main { min-width: 0; }
.cat-items .task-title { overflow-wrap: anywhere; }
.cat-empty { padding: .9rem .5rem; text-align: center; font-size: .8rem; color: var(--faint); border: 1px dashed var(--border); border-radius: 10px; margin-bottom: .45rem; }
.cat-add { padding: .1rem .5rem .55rem; }
.cat-add .form-control { background: transparent; border-color: transparent; }
.cat-add .form-control:hover, .cat-add .form-control:focus { background: var(--surface); border-color: var(--border); }
.cat-col.cat-new { background: transparent; border: 1px dashed var(--border); padding: .75rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch span { display: block; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: hsl(var(--h) 65% 55%); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-2); }
:root[data-theme="dark"] .chip-cat { background: hsl(var(--h, 220) 40% 20%); color: hsl(var(--h, 220) 80% 84%); }
:root[data-theme="dark"] a.chip-cat:hover, :root[data-theme="dark"] .chip-cat.chip-on { background: hsl(var(--h, 220) 45% 28%); color: hsl(var(--h, 220) 85% 90%); border-color: hsl(var(--h, 220) 50% 45%); }
:root[data-theme="dark"] .cat-col.drop { background: hsl(var(--h, 220) 35% 16%); }
@media (max-width: 575.98px) { .cat-col { flex-basis: 84vw; } }
@media print { .cat-add, .cat-new, .cat-head .dropdown { display: none !important; } .cat-board { flex-wrap: wrap; } }

/* ---- Reply Desk (Mail) ---------------------------------------------------------------------- */
.rd-list { display: flex; flex-direction: column; }
.rd-head { padding: .45rem 1.1rem .3rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border-2); }
.rd-head.due { color: var(--bad-ink); background: var(--bad-soft); }
.rd-row { display: flex; align-items: flex-start; gap: .7rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border-2); }
.rd-row:last-child { border-bottom: 0; }
.rd-row:hover { background: var(--surface-2); }
.rd-check { margin-top: .2rem; flex: 0 0 auto; }
.rd-body { flex: 1 1 auto; min-width: 0; }
.rd-main { display: block; color: inherit; }
.rd-main:hover { text-decoration: none; }
.rd-main:hover .rd-subject { color: var(--accent-ink); text-decoration: underline; }
.rd-top { display: flex; justify-content: space-between; gap: .75rem; font-size: .8rem; color: var(--muted); }
.rd-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-when { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.rd-subject { display: block; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.rd-row.unread .rd-subject, .rd-row.unread .rd-who { font-weight: 700; color: var(--ink); }
.rd-why { display: block; font-size: .82rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.rd-tags .chip { white-space: normal; max-width: 100%; overflow-wrap: anywhere; border-radius: 12px; }
.chip-due { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; font-weight: 600; }
.rd-choices { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.rd-choice { padding: .12rem .55rem; font-size: .74rem; font-weight: 500; line-height: 1.5; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.rd-choice:hover { border-color: var(--accent-2); color: var(--accent-ink); background: var(--accent-soft); }
.rd-choice.suggested { border: 2px solid var(--accent-2); padding: calc(.12rem - 1px) calc(.55rem - 1px); }
.rd-choice.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rd-bulk { position: sticky; top: calc(var(--topbar-h) + .5rem); z-index: 5; border-color: var(--accent-2); box-shadow: var(--shadow-md); }
.rd-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.rd-mail { max-height: 34rem; overflow-y: auto; font-size: .92rem; }
.rd-why-box { background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--radius-sm); padding: .4rem .7rem; font-size: .88rem; }
.rd-msg-when { flex: 0 0 5.5rem; }
#rdInfo .rd-pre { font-size: .88rem; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .rd-choice { background: var(--surface); color: var(--ink-2); }
:root[data-theme="dark"] .rd-choice.on { color: #fff; }

/* ---- Plan my day ---- */
.plan-list .plan-row { display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; }
.plan-time { width: 4.2rem; text-align: right; font-size: .9rem; color: var(--ink-2, #475569); flex: none; }
.plan-time small { margin-left: 2px; font-size: .7rem; color: var(--muted, #94a3b8); }
.plan-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--accent, #4f46e5); flex: none; }
.plan-meeting .plan-bar { background: #0ea5e9; }
.plan-reply .plan-bar { background: #d97706; }
.plan-team .plan-bar, .plan-chase .plan-bar { background: #7c3aed; }
.plan-break .plan-bar, .plan-inbox .plan-bar { background: var(--border, #cbd5e1); }
.plan-break { color: var(--muted, #94a3b8); }
.plan-title { font-weight: 600; color: inherit; text-decoration: none; }
a.plan-title:hover { text-decoration: underline; }
.plan-past { opacity: .5; }

/* ---- Playbooks ---- */
.pb-num { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .8rem; font-weight: 700; color: #fff; background: var(--accent, #4f46e5); }
.pb-num.done { background: #16a34a; }
.pb-num.waiting { background: transparent; color: var(--muted, #94a3b8); border: 1px dashed var(--border, #cbd5e1); }
.pb-num.late { background: #dc2626; }

/* ---- Promise check-in page (opened from an email, no sign-in) ---- */
.checkin-body { background: var(--bg, #f1f5f9); min-height: 100vh; }
.checkin-wrap { max-width: 34rem; margin: 0 auto; padding: 2rem 1rem; }
.checkin-choices { display: grid; gap: .5rem; }
.checkin-choice { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border: 1px solid var(--border, #cbd5e1); border-radius: .6rem; cursor: pointer; }
.checkin-choice small { display: block; color: var(--muted, #64748b); font-weight: 400; }
.checkin-choice input { margin-top: .3rem; }
.checkin-choice:has(input:checked) { border-color: var(--accent, #4f46e5); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #4f46e5) 25%, transparent); }
.checkin-choice.checkin-blocked:has(input:checked) { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, .2); }
.checkin-choice.checkin-done:has(input:checked) { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, .2); }
.checkin-choice:focus-within { outline: 2px solid var(--accent, #4f46e5); outline-offset: 2px; }
@media print { .sidebar, .topbar, .d-print-none { display: none !important; } }

/* ---- This is GB: mission, vision, how we roll ---- */
.gb-onit { --gb: #f59e0b; --gb-ink: #92400e; --gb-bg: #fffbeb; }
.gb-findaway { --gb: #0ea5e9; --gb-ink: #075985; --gb-bg: #f0f9ff; }
.gb-sameteam { --gb: #10b981; --gb-ink: #065f46; --gb-bg: #ecfdf5; }
.gb-cue { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; font-size: .82rem; color: var(--muted); }
.gb-cue .gb-tag { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; letter-spacing: .04em; font-size: .72rem; color: var(--gb-ink); background: var(--gb-bg); border: 1px solid color-mix(in srgb, var(--gb) 45%, transparent); border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.gb-cue .gb-tag i { color: var(--gb); }
.gb-cue .gb-more { margin-left: auto; font-size: .75rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.gb-cue .gb-more:hover { text-decoration: underline; }
.gb-kicker { font-size: .72rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: #a5b4fc; }
.gb-hero { border-radius: var(--radius); padding: 2rem 2.25rem; color: #cbd5e1; background: radial-gradient(900px 500px at 20% 0%, #1e2a4f 0%, #0f172a 60%, #0b1120 100%); box-shadow: var(--shadow-md); }
.gb-hero .gb-label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin-top: 1.1rem; }
.gb-hero .gb-head { color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: .25rem 0 .6rem; }
.gb-hero p { margin: 0; max-width: 34rem; line-height: 1.55; }
.gb-value { border-top: 4px solid var(--gb); }
.gb-value .gb-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: .5rem; }
.gb-value .gb-name i { color: var(--gb); }
.gb-value .gb-tagline { color: var(--gb-ink); font-weight: 600; margin-bottom: .6rem; }
.gb-where { padding-left: 1.1rem; margin: 0; font-size: .86rem; }
.gb-where li { margin-bottom: .2rem; }
.gb-chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .04em; color: var(--gb-ink); background: var(--gb-bg); border: 1px solid color-mix(in srgb, var(--gb) 45%, transparent); border-radius: 999px; padding: .15rem .6rem; }
button.gb-chip { cursor: pointer; opacity: .75; }
button.gb-chip.on { opacity: 1; background: var(--gb); color: #fff; border-color: var(--gb); }
.gb-close { text-align: center; color: var(--muted); padding: 1rem 0 .5rem; }
.gb-close strong { display: block; font-size: 1.25rem; color: var(--ink, #0f172a); margin-top: .25rem; }
.principle.gb-today { border-left: 4px solid var(--gb); }
.principle.gb-today .gb-name { font-size: 1.05rem; }
.principle.gb-today .gb-name i { color: var(--gb); }
.principle.gb-today .gb-tagline { font-weight: 500; color: #c7d2fe; margin-left: .25rem; }
.principle.gb-today .quote a { color: #fff; font-style: normal; font-family: inherit; font-size: .8rem; }
.auth-side .step .gb-n { background: color-mix(in srgb, var(--gb) 85%, #000); font-size: .95rem; }
.checkin-wrap .gb-cue { justify-content: flex-start; }

/* ---- right-click menu on task rows ---- */
.task-menu { position: fixed; z-index: 1080; min-width: 15rem; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.22), 0 0 0 1px rgba(15,23,42,.06); padding: .35rem; }
.task-menu-title { font-size: .72rem; font-weight: 700; color: var(--muted); padding: .35rem .6rem .45rem; max-width: 20rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line, #e5e7eb); margin-bottom: .3rem; }
.task-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; text-align: left; padding: .45rem .6rem; border-radius: 8px; font-size: .9rem; color: inherit; }
.task-menu button i { width: 1.1rem; color: var(--muted); }
.task-menu button.text-danger i { color: inherit; }
.task-menu button:hover, .task-menu button:focus { background: var(--surface-2, #f1f5f9); outline: none; }
.task-menu-sep { height: 1px; background: var(--line, #e5e7eb); margin: .3rem .2rem; }
.task-row.tm-target { box-shadow: inset 0 0 0 2px var(--primary, #4f46e5); border-radius: 10px; }
.tm-cats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.tm-cat { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: .45rem .6rem; cursor: pointer; font-size: .9rem; }
.tm-cat:has(input:checked) { border-color: var(--primary, #4f46e5); background: #eef2ff; }
.tm-cat input { margin: 0; }
.tm-dot { width: .65rem; height: .65rem; border-radius: 50%; flex: 0 0 auto; }

/* ---- streaks, badges, points, quests ---- */
.gm-level { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.gm-bar { height: .55rem; border-radius: 999px; background: var(--surface-2, #eef2f7); }
.gm-bar .progress-bar { border-radius: 999px; background: var(--primary, #4f46e5); }
.gm-bar .progress-bar.bg-success { background: #10b981 !important; }
.gm-quest { height: .7rem; }
.gm-streak { font-size: 3.2rem; font-weight: 800; line-height: 1; color: #dc2626; }
.gm-pill { display: inline-flex; align-items: center; gap: .25rem; font-weight: 800; font-size: .95rem; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2, #f1f5f9); color: var(--muted); white-space: nowrap; }
.gm-pill.hot { background: #fee2e2; color: #b91c1c; }
.gm-medal { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.1rem; flex: 0 0 auto; }
.gb-name .gm-medal { width: 1.9rem; height: 1.9rem; font-size: .95rem; }
.gb-name .gm-medal i { color: inherit; }
.gm-none { background: var(--surface-2, #f1f5f9); color: #cbd5e1; }
.gm-bronze { background: #fde8d7; color: #b45309; box-shadow: inset 0 0 0 2px #d97706; }
.gm-silver { background: #eef2f6; color: #64748b; box-shadow: inset 0 0 0 2px #94a3b8; }
.gm-gold { background: #fef3c7; color: #b45309; box-shadow: inset 0 0 0 2px #f59e0b; }
.gm-save { border-left: 4px solid #f59e0b; background: #fffbeb; }
.gm-streakbar { border-left: 4px solid #dc2626; }
