/* ===============================================================
   TÓIR — Black & Gold luxury design system
   Defined once: tokens + shared classes. Deep warm black, rich gold
   as the single accent, Cormorant headings, quiet grain + soft glow,
   near-black raised cards with low-opacity gold hairlines. Readability
   first: body text and the quote stay high-contrast.
=============================================================== */
:root {
  /* Warm near-black layering */
  --bg:   #0a0806;   /* page */
  --bg-1: #15110d;   /* cards / surfaces (slightly raised) */
  --bg-2: #1e1813;   /* hover / raised */
  --bg-3: #261f17;   /* inputs / highest */

  /* Text — warm, high-contrast */
  --ink:       #f2ece0;   /* primary near-white */
  --ink-soft:  #b7ab95;   /* secondary warm grey */
  --ink-faint: #8a7d68;   /* tertiary / faint labels */

  /* Rich warm gold — the single accent */
  --gold:        #d4af5f;
  --gold-2:      #a87f33;
  --gold-bright: #f0d28a;

  /* Gold hairlines */
  --hairline:   rgba(212, 175, 95, 0.16);
  --hairline-2: rgba(212, 175, 95, 0.34);
  --red:        #e0685c;   /* reserved: missed deadlines only */

  /* Cream-and-gold chrome (top bar + sidebar) — page content stays dark */
  --cream:      #ECE6DE;
  --cream-deep: #E3DACE;
  --gold-line:  rgba(154, 116, 40, 0.28);
  --bar-h:      112px;   /* top-bar height; layout + page-bg offsets track this */

  --radius-lg: 18px;
  --radius:    14px;
  --radius-sm: 10px;
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --t:         180ms;
  --shadow:    0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.45);

  /* Legacy aliases so existing class/JS refs stay on-palette */
  --accent: var(--gold); --accent-2: var(--gold); --accent-ink: var(--gold-bright);
  --purple: var(--gold); --purple-deep: var(--gold-2);
  --danger: var(--gold); --warn: var(--gold);
  --glass: var(--bg-1); --glass-2: var(--bg-2); --glass-hi: var(--bg-3);
  --stroke: var(--hairline); --stroke-hi: var(--hairline-2);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  letter-spacing: -0.006em;
  line-height: 1.55;
  min-height: 100%;
  background-color: var(--bg);
  color-scheme: dark;
}

/* ---------- Background: one warm glow + vignette into deep black ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 22% 14%, rgba(190, 142, 60, 0.16), transparent 60%),  /* one warm light source */
    radial-gradient(150% 120% at 50% 36%, transparent 32%, rgba(0, 0, 0, 0.7) 100%),  /* vignette */
    radial-gradient(160% 120% at 50% 0%, #120d08 0%, #0c0906 55%, #070504 100%);       /* warm near-black base */
}
/* Quiet film grain (subtle — never hurts readability) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px; opacity: 0.045; mix-blend-mode: soft-light;
}

/* ---------- Icons ---------- */
svg.lucide { width: 18px; height: 18px; stroke-width: 1.75; vertical-align: -0.18em; flex-shrink: 0; }
/* Icons never intercept pointer events — the button/link always receives the
   full click. Fixes icon buttons (e.g. to-do delete) needing multiple clicks:
   Lucide swaps the <i> placeholder for an <svg>, and if that swap lands between
   mousedown and mouseup on the icon, the click is lost. Routing the hit to the
   button makes every single click register. */
button .lucide, button [data-lucide], a .lucide, a [data-lucide],
.icon-btn .lucide, .icon-btn [data-lucide] { pointer-events: none; }
.nav-ic       { display: none !important; } /* nav is text-only */
.section-icon { width: 26px !important; height: 26px !important; color: var(--gold); }
.tag-ic       { width: 13px !important; height: 13px !important; }
.celtic-ic, .section-icon { display: inline-flex; align-items: center; justify-content: center; }
.celtic-ic svg, .section-icon svg, .home-ic svg { width: 100%; height: 100%; display: block; }

/* ---------- Chrome: cream-and-gold (top bar + sidebar ONLY) ----------
   The cream scheme is scoped to .topbar/.sidebar so it cascades to their
   children only. Page content keeps the global dark tokens, untouched —
   each page brings its own content background (Hussle = mountain, etc.). */
.topbar, .sidebar {
  --cream: #ECE6DE; --cream-deep: #E3DACE;
  --gold: #9A7428; --gold-bright: #B8923C;
  --ink: #1C1814; --ink-soft: #5A5249;
  --gold-line: rgba(154, 116, 40, 0.28);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  height: var(--bar-h); padding: 0 24px;
  background: var(--cream);
  border-bottom: 1px solid var(--gold-line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; }
.brand-logo-img { height: 102px; width: auto; display: block; }
.menu-toggle { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 4px; border-radius: 8px; }

/* Daily quote — Cormorant italic ink, gold letter-spaced small-caps author */
.topquote { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 12px; padding: 0 18px; overflow: hidden; }
.tq-text { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: 1.12rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tq-author { flex: 0 0 auto; font-size: 0.72rem; font-weight: 600; font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.16em; color: var(--gold); }
@media (max-width: 860px) { .topquote { display: none; } }

/* Cloud pill — gold outline, gold text on cream */
.storage-badge {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 0.74rem; font-weight: 600; color: var(--gold);
  background: transparent; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--gold);
}
.storage-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); }
.storage-badge.cloud .dot { background: var(--gold); box-shadow: 0 0 8px rgba(154, 116, 40, 0.5); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--bar-h)); }
.sidebar {
  width: 232px; flex-shrink: 0; padding: 22px 14px;
  display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid var(--gold-line);
  background: var(--cream);
}
.nav-item {
  position: relative;
  display: flex; align-items: center;
  background: none; border: none; color: var(--ink);
  font-family: "Cinzel", Georgia, serif; font-size: 1.02rem; font-weight: 600;
  text-align: left; padding: 9px 16px; border-radius: 8px;
  cursor: pointer; width: 100%; text-transform: uppercase; letter-spacing: 0.11em;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.nav-item:hover { background: var(--cream-deep); color: var(--ink); }
.nav-item.active { background: var(--cream-deep); color: var(--gold); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }

/* Subtle nav clustering (visual only) — dividers are gold hairlines */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gold-line); }
.nav-sub { margin-left: 16px; font-size: 0.9rem; color: var(--ink); }
.nav-sub:hover { color: var(--ink); }
.nav-sub.active { color: var(--gold); }
/* Softer-than-divider separation (e.g. below Crystallize) */
.nav-soft { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--gold-line); }

.content { flex: 1; padding: 52px 56px; position: relative; }
/* Per-page background (set via JS from each <section data-bg="…">). It fills
   ONLY the content viewport — right of the sidebar (232px), below the bar
   (63px) — and is fixed so it stays put on scroll, never touching the cream
   chrome. A soft scrim keeps content legible. Empty data-bg = no ::before,
   so those pages keep the default dark theme exactly as before. */
.content.has-bg::before {
  content: ""; position: fixed; top: var(--bar-h); left: 232px; right: 0; bottom: 0;
  z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(10, 8, 6, 0.22), rgba(10, 8, 6, 0.42)),
    var(--page-bg) center / cover no-repeat;
}
/* Health: balanced scrim (~45–55% black) so the cloud/light image stays visible
   and atmospheric, with the right side a touch darker (its brightest area). */
.content.has-bg:has(#section-habits:not(.hidden))::before {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.40) 0%, rgba(0, 0, 0, 0.46) 55%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.5)),
    var(--page-bg) center / cover no-repeat;
}
.section { position: relative; z-index: 1; max-width: 1060px; animation: fade 0.3s var(--ease) both; }
.section.hidden, .hidden { display: none !important; }
@keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------- Section headings ---------- */
.section-head { margin-bottom: 34px; }
.section-head-main { display: flex; align-items: center; gap: 14px; }
.section-head h2 {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500;
  font-size: clamp(2.2rem, 4.4vw, 3rem); letter-spacing: 0; line-height: 1.05;
  background: linear-gradient(180deg, #f4e0a8 0%, var(--gold) 58%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 10px rgba(190, 142, 60, 0.18));
}
.section-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, #181410 0%, #120e0a 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--hairline-2); box-shadow: var(--shadow); }
.home-card::before, .goodday-card::before, .subject-card::before, .intel-card::before { content: none; }

.item-row { display: flex; align-items: flex-start; gap: 14px; }
.item-row .grow { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.item-meta { font-size: 0.83rem; color: var(--ink-soft); margin-top: 4px; }

/* Small uppercase gold-grey labels */
.home-summary, .wb-trend-label, .quiz-label, .quiz-subject, .forge-soon, .hero-date, .wb-score-band {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 600;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 500; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink-soft);
  margin-right: 6px; margin-top: 8px;
}
.tag.done, .tag.soon { color: var(--gold-bright); border-color: rgba(212, 175, 95, 0.4); background: rgba(212, 175, 95, 0.12); }
.tag.overdue { color: var(--red); border-color: rgba(224, 104, 92, 0.5); background: rgba(224, 104, 92, 0.12); }
.overdue-text { color: var(--red); }
.done-text { text-decoration: line-through; color: var(--ink-faint); }

/* ---------- Buttons ---------- */
button.btn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-2));
  color: #1a1206; border: none;
  padding: 10px 17px; border-radius: var(--radius-sm); cursor: pointer;
  box-shadow: 0 6px 18px rgba(150, 110, 40, 0.3);
  transition: filter var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--bg-2); color: var(--gold-bright); border: 1px solid var(--hairline-2); box-shadow: none; font-weight: 500; }
.btn.secondary:hover { background: var(--bg-3); }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: saturate(0.6); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--ink-soft); cursor: pointer;
  padding: 10px; min-width: 42px; min-height: 42px;
  border-radius: 9px; transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.icon-btn:hover { background: var(--bg-2); color: var(--gold-bright); }
.icon-btn.danger:hover { background: rgba(224, 104, 92, 0.14); color: var(--red); }
.icon-btn.small .lucide { width: 15px; height: 15px; }

/* ---------- Inputs ---------- */
input, textarea, select {
  background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink);
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.92rem; font-family: inherit; width: 100%;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { resize: vertical; min-height: 70px; line-height: 1.55; }

select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='8'%3E%3Cpath%20d='M1%201.5%206%206.5%2011%201.5'%20stroke='%23d4af5f'%20stroke-width='1.7'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select option { background: #15110d; color: var(--ink); }
input[type="date"], input[type="datetime-local"], input[type="time"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(72%) sepia(38%) saturate(560%) hue-rotate(2deg); cursor: pointer; }

.add-form { background: var(--bg-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 26px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1; min-width: 150px; }
.form-row .grow2 { flex: 2; }

/* To-dos add/edit row: labelled date fields, repeat control, inline calendar */
.todo-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.todo-form-row .grow2 { flex: 1 1 180px; min-width: 150px; }
.datefield { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }
.datefield-label { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; font-variant: small-caps; color: var(--ink-soft); }
.datefield-inner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* One-tap Today / Tomorrow quick-set on the due-date field. */
.datefield-quick { background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink-soft); font: inherit; font-size: 0.78rem; font-weight: 600; padding: 7px 11px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.datefield-quick:hover { color: var(--ink); border-color: var(--gold); }
.datefield-quick.active { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); color: #1a1206; border-color: transparent; }
.datefield-trigger { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; font-size: 0.86rem; cursor: pointer; white-space: nowrap; transition: border-color var(--t) var(--ease); }
.datefield-trigger:hover { border-color: var(--gold); }
.datefield-trigger .lucide { color: var(--gold); }
.datefield-time { background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink); border-radius: var(--radius-sm); padding: 7px 9px; font: inherit; font-size: 0.84rem; color-scheme: dark; }
.datefield-clear { background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 5px; border-radius: 6px; display: inline-flex; }
.datefield-clear:hover { color: var(--gold-bright); background: var(--bg-2); }
.repeat-inner { display: flex; align-items: center; gap: 6px; }
.repeat-sel, .repeat-wday { width: auto; min-width: 0; background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; font-size: 0.85rem; }

.cal-pop { width: 256px; background: var(--bg-1); border: 1px solid var(--hairline-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; z-index: 9998; }
.cal-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-pop-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.08rem; font-weight: 600; color: var(--gold-bright); }
.cal-pop-nav { background: none; border: none; color: var(--ink-soft); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.cal-pop-nav:hover { color: var(--gold-bright); background: var(--bg-2); }
.cal-pop-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-pop-dow { text-align: center; font-size: 0.6rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; padding: 2px 0 4px; }
.cal-pop-day { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-width: 0; padding: 0; border: none; background: none; color: var(--ink); font: inherit; font-size: 0.82rem; line-height: 1; border-radius: 7px; cursor: pointer; overflow: hidden; transition: background var(--t) var(--ease); }
.cal-pop-day:hover { background: var(--bg-3); }
.cal-pop-day.empty { visibility: hidden; cursor: default; }
.cal-pop-day.today { box-shadow: inset 0 0 0 1px var(--hairline-2); color: var(--gold-bright); }
.cal-pop-day.sel { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); color: #1a1206; font-weight: 700; }
.todo-repeat-tag .lucide { color: var(--gold); }
.field { display: block; margin-bottom: 10px; font-size: 0.82rem; color: var(--ink-soft); }

.checkbox {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto;
  border: 1.5px solid var(--ink-faint); border-radius: 6px; background: transparent; cursor: pointer; position: relative;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.checkbox:hover { border-color: var(--gold); }
.checkbox:checked { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; }
.checkbox:checked::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #1a1206; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* To-do completion button — clear gold check circle (replaces the faint checkbox) */
.todo-complete {
  flex: 0 0 auto; width: 30px; height: 30px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.7px solid var(--gold-2); border-radius: 50%; background: transparent; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.todo-complete .lucide { width: 16px; height: 16px; color: var(--gold-bright); opacity: 0.45; transition: opacity var(--t) var(--ease); }
.todo-complete:hover { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; }
.todo-complete:hover .lucide { opacity: 1; color: #1a1206; }
.todo-complete.is-done { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; }
.todo-complete.is-done .lucide { opacity: 1; color: #1a1206; }

/* ---------- Health (Mood / Vitamins / Food & Weight / Drinking) ---------- */
.health-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 22px; border-bottom: 1px solid var(--hairline); }
.health-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--ink-soft); font: inherit; font-size: 0.92rem; font-weight: 600; padding: 9px 14px; cursor: pointer; border-radius: 8px 8px 0 0; transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease); }
.health-tab:hover { color: var(--ink); background: var(--bg-1); }
.health-tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.wb-checkin-sub { color: var(--ink-soft); font-size: 0.92rem; margin: -8px 0 18px; }
.health-ai-note { display: flex; align-items: flex-start; gap: 9px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }
.health-ai-note .lucide { color: var(--gold); flex: 0 0 auto; margin-top: 1px; }
.qn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.qn-field, .food-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.74rem; color: var(--ink-soft); }
.food-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.food-add .grow2 { flex: 1 1 180px; min-width: 140px; }
.food-num { width: 130px; }
.food-snap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.food-snap-btn { padding: 12px 20px; }
.food-entry { background: var(--bg-2); margin-top: 12px; }
.food-photo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.food-ai-note { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-faint); }
.food-ai-note .lucide { color: var(--gold); }
.food-macros { display: flex; flex-wrap: wrap; gap: 10px; }
.food-macros .food-num { width: 108px; }
.food-entry-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.food-entry-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 0.9rem; }
.food-entry-line:first-of-type { border-top: none; }
.bal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 4px; }
.bal-stat { background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 11px; padding: 14px 10px; text-align: center; }
.bal-val { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.7rem; color: var(--ink); line-height: 1; }
.bal-val.gold { color: var(--gold-bright); }
.bal-lab { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 600; margin-top: 6px; }
.bal-target { margin-top: 12px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }
.maint-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.maint-stat { background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px; text-align: center; }
.maint-val { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.1rem; color: var(--ink); line-height: 1; }
.maint-val.gold { color: var(--gold-bright); }
.maint-lab { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 600; margin-top: 7px; }
.proj-line { font-size: 0.92rem; color: var(--ink-soft); margin-top: 4px; }
.proj-big { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; font-weight: 600; color: var(--gold-bright); margin-top: 8px; line-height: 1.35; }
.vit-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.vit-row:first-of-type { border-top: none; }
@media (max-width: 560px) { .bal-grid, .maint-grid { grid-template-columns: 1fr; } }

/* ---------- Association colour-coding + filtering ---------- */
.color-swatches { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.color-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.sel { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(212, 175, 95, 0.35); }
.color-swatch.none { background: var(--bg-3); color: var(--ink-faint); box-shadow: inset 0 0 0 1px var(--hairline); }
.color-swatch.none .lucide { width: 13px; height: 13px; }
.goal-color-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
/* The single chosen colour on a SAVED item (collapsed) */
.color-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--hairline-2); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); flex: 0 0 auto; }
.color-dot.none { background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--hairline); }
.goal-title-row { display: flex; align-items: center; gap: 9px; }
.goal-color-lab { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 600; }
.assoc-color-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.assoc-color-card .grow { flex: 1 1 180px; }
.todo-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.todo-fchip { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-1); border: 1px solid var(--hairline); color: var(--ink-soft); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 0.84rem; font-weight: 500; cursor: pointer; transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.todo-fchip:hover { color: var(--ink); border-color: var(--hairline-2); }
.todo-fchip.active { color: var(--gold-bright); border-color: var(--gold); background: rgba(212, 175, 95, 0.1); }
.fdot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.tag.assoc-tag { gap: 6px; padding-left: 9px; }
.tag.assoc-tag .fdot { width: 8px; height: 8px; }
.empty { color: var(--ink-soft); font-style: italic; padding: 26px 0; }

/* ---------- Banner ---------- */
.banner {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-3); color: var(--ink); padding: 13px 18px; border-radius: 12px;
  border: 1px solid var(--hairline-2); box-shadow: var(--shadow); z-index: 50; max-width: 90%; font-weight: 500;
  animation: fade 0.2s var(--ease);
}
.banner .lucide { color: var(--gold); }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.home-card { margin-bottom: 0; }
.home-card.wide { grid-column: 1 / -1; }
.home-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.home-card-head h3 { margin: 0; flex: 1; font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.home-ic { width: 20px; height: 20px; color: var(--gold); }
.home-card.clickable { cursor: pointer; }
.home-card-arrow { color: var(--ink-faint); width: 18px; height: 18px; transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.home-card.clickable:hover .home-card-arrow { color: var(--gold); transform: translateX(2px); }
.home-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.home-row:first-child { border-top: none; padding-top: 2px; }
.home-row .grow { flex: 1; min-width: 0; }
.home-row .tag { margin-top: 0; }
.home-focus { margin: 2px 0 0; white-space: pre-wrap; color: var(--ink); font-size: 0.96rem; }
.home-muted { color: var(--ink-soft); margin: 2px 0 0; font-size: 0.9rem; }
.home-summary { margin-bottom: 8px; }
.home-toggle {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 7px;
  border: 1.5px solid var(--ink-faint); background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.home-toggle .lucide { width: 16px; height: 16px; }
.home-toggle:hover { border-color: var(--gold); }
.home-toggle.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; color: #1a1206; }
.home-wb { display: flex; align-items: baseline; gap: 10px; }
.home-wb-num { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.1rem; line-height: 1; color: var(--gold-bright); }
.home-wb-num.high, .home-wb-num.mid, .home-wb-num.low { color: var(--gold-bright); }

/* Staggered fade-rise on load */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.home-grid > * { animation: riseIn 0.4s var(--ease) both; }
.home-grid > *:nth-child(1) { animation-delay: 0.04s; }
.home-grid > *:nth-child(2) { animation-delay: 0.1s; }
.home-grid > *:nth-child(3) { animation-delay: 0.16s; }
.home-grid > *:nth-child(4) { animation-delay: 0.22s; }
.home-grid > *:nth-child(5) { animation-delay: 0.28s; }
.home-grid > *:nth-child(6) { animation-delay: 0.34s; }

/* ---------- Hero (if present) ---------- */
.home-hero { position: relative; text-align: center; padding: 40px 22px 32px; margin-bottom: 24px; }
.home-hero::before { content: ""; position: absolute; inset: -10px; z-index: -1; background: radial-gradient(50% 80% at 50% 46%, rgba(190, 142, 60, 0.12), transparent 72%); }
.hero-date { margin-bottom: 14px; }
.hero-rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 18px; }
.hero-rule::before, .hero-rule::after { content: ""; width: 56px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hero-rule::after { background: linear-gradient(90deg, var(--gold), transparent); }
.hero-diamond { width: 6px; height: 6px; transform: rotate(45deg); background: var(--gold); }
.hero-quote { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.36; color: var(--ink); max-width: 660px; margin: 0 auto; }
.hero-author { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.hero-author::before, .hero-author::after { content: ""; width: 24px; height: 1px; background: rgba(212, 175, 95, 0.5); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cal-head h3 { margin: 0; min-width: 190px; text-align: center; font-size: 1.2rem; font-weight: 600; font-family: "Cormorant Garamond", serif; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); padding: 4px 0; }
.cal-cell {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--bg-1); border: 1px solid var(--hairline); border-radius: 10px;
  min-height: 88px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.cal-cell:hover { background: var(--bg-2); border-color: var(--hairline-2); }
.cal-cell.other { opacity: 0.4; }
.cal-cell.today { border-color: var(--gold); }
.cal-daynum { position: relative; z-index: 1; font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cell.today .cal-daynum { color: var(--gold-bright); }
.cal-ev { font-size: 0.72rem; font-weight: 500; background: rgba(212, 175, 95, 0.16); color: var(--gold-bright); border-radius: 6px; padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Dated to-dos on the calendar: outlined chip with a check, click → To-dos */
.cal-todo { display: flex; align-items: center; gap: 4px; min-width: 0; background: transparent; border: 1px solid var(--hairline-2); cursor: pointer; }
.cal-todo:hover { background: rgba(212, 175, 95, 0.1); }
.cal-todo .lucide { flex: 0 0 auto; }
.cal-todo .cal-ev-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-todo.overdue { border-color: var(--red); color: var(--red); }

/* ---------- Eolas / subjects / quiz ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 8px; }
.subject-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 12px; }
.subject-head { display: flex; align-items: center; gap: 10px; }
.subject-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.subject-ic { width: 22px; height: 22px; color: var(--gold); flex: 0 0 auto; }
.subject-card .btn { align-self: flex-start; }
.eolas-sub { margin: 32px 0 14px; font-size: 1.3rem; font-weight: 500; font-family: "Cormorant Garamond", serif; color: var(--gold-bright); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.quiz-score { font-size: 0.84rem; color: var(--gold-bright); font-weight: 600; }
.quiz-card { padding: 26px; }
.quiz-subject { margin-bottom: 10px; color: var(--gold); }
.quiz-q { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.36; color: var(--ink); margin-bottom: 16px; }
.quiz-card textarea { margin-bottom: 12px; }
.quiz-block { margin-bottom: 14px; }
.quiz-label { margin-bottom: 4px; }
.quiz-block > div:last-child { font-size: 0.97rem; line-height: 1.55; color: var(--ink); }
.quiz-grade { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.quiz-grade .home-muted { margin-right: auto; }

/* ---------- Intelligence ---------- */
.intel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.intel-card { margin-bottom: 0; }
.intel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.intel-head h3 { margin: 0; flex: 1; font-size: 1.04rem; font-weight: 600; color: var(--ink); }
.intel-ic { width: 22px; height: 22px; color: var(--gold); flex: 0 0 auto; }
.intel-badge { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--gold-bright); border: 1px solid rgba(212, 175, 95, 0.4); background: rgba(212, 175, 95, 0.12); padding: 3px 9px; border-radius: 999px; }
.intel-add { border-style: dashed; display: flex; align-items: center; gap: 14px; }
.intel-group { margin-bottom: 36px; }
.intel-group:last-child { margin-bottom: 0; }
.intel-group-head { margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.intel-group-head h3 {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500;
  font-size: 1.55rem; letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.intel-group-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.intel-card.clickable { cursor: pointer; }
.intel-arrow { color: var(--ink-faint); width: 18px; height: 18px; transition: color var(--t) var(--ease), transform var(--t) var(--ease); }
.intel-card.clickable:hover .intel-arrow { color: var(--gold); transform: translateX(2px); }

/* Sales Work (inside Eolas) */
.sales-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 8px; }
.sales-stream { margin-bottom: 0; cursor: pointer; }
.sales-stream .item-title { font-size: 1.1rem; }
.sales-open { display: flex; align-items: center; gap: 3px; margin-top: 14px; color: var(--ink-faint); font-size: 0.82rem; font-weight: 500; }
.sales-stream:hover .sales-open, .sales-stream:hover .intel-arrow { color: var(--gold); }
.sales-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sales-sep { color: var(--ink-faint); }
.sales-current { color: var(--ink); font-weight: 600; }
.sales-project { margin-bottom: 10px; }
/* Drag-to-reorder projects within a category — generous grip hit area */
.proj-grip { display: inline-flex; align-items: center; justify-content: center; cursor: grab; color: var(--ink-faint); flex: 0 0 auto; min-width: 30px; min-height: 34px; margin: -6px 2px -6px -4px; padding: 0 4px; border-radius: 6px; touch-action: none; }
.proj-grip:active { cursor: grabbing; }
.proj-grip:hover { color: var(--gold); background: var(--bg-3); }
.proj-grip .lucide { width: 18px; height: 18px; }
.sales-project.proj-draggable .item-row { align-items: center; }
.clickable-text { cursor: pointer; }
@media (max-width: 760px) { .sales-grid { grid-template-columns: 1fr; } }
.sales-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sales-fire-row { margin: 10px 0 20px; }
.hussle-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
/* Category = distinct section header; its projects sit in a nested, indented body. */
.hussle-cat { margin: 0 0 24px; }
.hussle-cat-head { display: flex; align-items: center; justify-content: flex-start; gap: 9px; margin: 0 0 10px; padding: 4px 4px 9px; border-bottom: 1px solid var(--gold-line); cursor: pointer; }
/* Collapsible Arena — same chevron toggle/animation as the Health cards */
.hussle-cat-head.open .wb-collapse-chevron { transform: rotate(180deg); }
.hussle-cat-body.wb-collapsed { display: none; }
.hussle-cat-head .sales-stream-head { margin: 0; }
.hussle-cat-actions { display: flex; gap: 2px; flex: 0 0 auto; margin-left: auto; }
/* Nested body holding the category's projects — indented under a gold rail. */
.hussle-cat-body { margin: 0 0 0 9px; padding: 2px 0 4px 16px; border-left: 2px solid var(--gold-line); }
/* Projects read as lighter items WITHIN the category, not equal-weight blocks. */
.hussle-cat-body .sales-project { margin-bottom: 8px; background: var(--bg-2); box-shadow: none; }
.hussle-cat-body .sales-project .item-title { font-size: 0.95rem; }
.hussle-cat-body .sales-add-row { margin-top: 4px; }
/* Drag-to-reorder whole folders — generous grip hit area */
.cat-grip { display: inline-flex; align-items: center; justify-content: center; cursor: grab; color: var(--ink-faint); flex: 0 0 auto; min-width: 32px; min-height: 32px; margin-left: -4px; border-radius: 6px; touch-action: none; }
.cat-grip:active { cursor: grabbing; }
.cat-grip:hover { color: var(--gold); background: var(--bg-3); }
.cat-grip .lucide { width: 20px; height: 20px; }
/* Shared pointer-reorder cues (projects + folders): lift + gold drop line */
.reorder-lift { opacity: 0.5; }
body.reordering { cursor: grabbing; user-select: none; }
.reorder-above { box-shadow: inset 0 3px 0 var(--gold); border-radius: 4px; }
.reorder-below { box-shadow: inset 0 -3px 0 var(--gold); border-radius: 4px; }
.hussle-cat-edit { margin: 24px 0 12px; }
.hussle-cat-edit-row { display: flex; align-items: center; gap: 8px; }
.hussle-cat-edit-row .grow2 { flex: 1 1 auto; min-width: 0; }
.hussle-hidden-head { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 28px 0 10px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.hussle-hidden-row { display: flex; align-items: center; gap: 10px; opacity: 0.78; }
.hussle-folder-ic { width: 19px !important; height: 19px !important; color: var(--gold); margin-right: 9px; vertical-align: -0.14em; }
.proj-move-sel { width: auto; min-width: 0; max-width: 190px; flex: 0 0 auto; font-size: 0.8rem; padding: 6px 10px; }

/* ---- Project Attachments ---- */
.attach-card { margin-bottom: 22px; }
.attach-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 4px; }
.attach-add .grow2 { flex: 1 1 200px; min-width: 140px; }
.attach-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.attach-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--gold-bright); text-decoration: none; font-size: 0.92rem; }
.attach-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-link .lucide { color: var(--gold); flex: 0 0 auto; }
.attach-link:hover span { text-decoration: underline; }
.attach-files-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 0.8rem; color: var(--ink-faint); line-height: 1.5; }
.attach-files-note .lucide { color: var(--gold); flex: 0 0 auto; margin-top: 1px; }
.attach-subhead { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin: 16px 0 2px; }

/* Add-task creator: subtle warm DRAFT tint over the dark theme (reads as
   "not committed yet"); kept low-opacity so all text stays readable. */
.todo-creator {
  background: linear-gradient(180deg, rgba(212, 175, 95, 0.08), rgba(212, 175, 95, 0.035)), var(--bg-1);
  border-color: var(--hairline-2);
  padding: 13px 16px; margin-bottom: 20px;
}
.todo-creator .todo-form-row { gap: 10px; }
/* Name on its own full-width line at the top */
.todo-name-row { margin-bottom: 10px; }
.todo-name-row input { width: 100%; box-sizing: border-box; }
/* "Link to" dropdown — compact, works in both the form row and on a task row */
.todo-link-sel { width: auto; max-width: 240px; font-size: 0.82rem; padding: 7px 10px; }
.todo-creator .todo-notes-wrap { margin-top: 10px; }
/* Attachments fold in tightly (no big gap as a separate panel) */
.todo-creator .attach-embed { margin-top: 10px; padding-top: 10px; }
/* Tasks — slim top bar (Add task + Filters dropdown) */
.todo-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
/* Today / Upcoming segmented toggle (pill), sits in the top bar next to Add task / Filters. */
.todo-view-toggle { display: inline-flex; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px; gap: 2px; }
.todo-view-seg { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); padding: 6px 15px; border-radius: 999px; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.todo-view-seg:hover { color: var(--ink); }
.todo-view-seg.active { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); color: #1a1206; }
.todo-view-count { font-size: 0.74rem; font-weight: 700; opacity: 0.8; }
.todo-view-seg.active .todo-view-count { opacity: 1; }

/* Tasks — compact card: bold gold title leads, quiet meta beneath, tight spacing. */
.todo-card { padding: 12px 16px; margin-bottom: 8px; }
.todo-card .item-row { gap: 12px; }
/* Today list: position number badge (gold-on-black) + drag-reorder affordance. */
.todo-num { flex: 0 0 auto; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: rgba(212, 175, 95, 0.14); border: 1px solid var(--hairline-2); color: var(--gold-bright); font-size: 0.76rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 3px; }
.todo-draggable { cursor: grab; }
.todo-draggable:active { cursor: grabbing; }
/* Custom pointer drag: the dragged card stays fully solid, lifts, and follows the
   cursor while the other cards slide to open a real card-sized gap. */
.todo-card.todo-dragging { position: relative; z-index: 30; cursor: grabbing; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); border-color: var(--gold-line); will-change: transform; }
body.todo-drag-active { cursor: grabbing; user-select: none; -webkit-user-select: none; }
/* While a drag is active, don't let .card:hover lift cards (translateY(-2px)) — that
   bob fought the drag transforms and made neighbouring cards/text jump as the drag
   passed over them. (Inline drag transforms still win on the cards being shifted.) */
body.todo-drag-active .todo-card:hover { transform: none; }
.todo-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.24rem; font-weight: 600; line-height: 1.2; color: var(--gold-bright); }
.todo-title.overdue-text { color: var(--red); }
/* Subtle, right-aligned row actions (edit / delete) — brighten on hover. */
.todo-rowbtn { opacity: 0.4; transition: opacity var(--t) var(--ease); }
.todo-card:hover .todo-rowbtn { opacity: 0.85; }
.todo-rowbtn:hover { opacity: 1; }

/* Collapsed pull-down creator */
.todo-creator-collapsed { margin-bottom: 22px; }
.todo-creator-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.todo-creator-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-bright); }
.todo-creator-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }

/* ---------- Routine Tasks board (To-dos two-column layout) ---------- */
.todos-layout { display: flex; gap: 24px; align-items: flex-start; }
.todos-main { flex: 1 1 auto; min-width: 0; }
.todos-side { flex: 0 0 320px; width: 320px; }
@media (max-width: 900px) { .todos-layout { flex-direction: column; } .todos-side { flex: none; width: 100%; order: -1; } }
.routine-board { position: relative; }
.routine-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.routine-head .item-title { display: flex; align-items: center; gap: 7px; }
.routine-head .item-title .lucide { color: var(--gold); }
.routine-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 4px; }
.routine-add .grow2 { flex: 1 1 140px; min-width: 110px; }
.routine-wday { width: auto; }
.routine-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.routine-row:first-of-type { border-top: none; }
.routine-name { font-size: 0.9rem; color: var(--ink); }
.routine-count { font-size: 0.74rem; color: var(--ink-soft); margin-top: 2px; }
.routine-count.soon { color: var(--gold-bright); }
.routine-count.overdue { color: var(--red); }
.routine-complete { text-align: center; color: var(--gold-bright); font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.1rem; padding: 6px 4px; }
.routine-collapsed { padding: 18px 16px; }
.routine-add-corner { position: absolute; top: 10px; right: 10px; }
.routine-time { width: auto; }
/* Bottom bar holding the gold + — left-aligned so it sits under the tick column. */
.routine-foot { display: flex; justify-content: flex-start; align-items: center; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.routine-add-fab {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-bright); color: #1a1206; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-2));
  box-shadow: 0 0 10px rgba(212, 175, 95, 0.55), 0 0 22px rgba(212, 175, 95, 0.28);
  animation: routineFabGlow 2.4s ease-in-out infinite;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.routine-add-fab .lucide { width: 21px; height: 21px; }
.routine-add-fab:hover { transform: translateY(-1px); box-shadow: 0 0 16px rgba(212, 175, 95, 0.75), 0 0 32px rgba(212, 175, 95, 0.45); }
.routine-add-fab.open { background: var(--bg-2); color: var(--gold-bright); border-color: var(--hairline-2); box-shadow: none; animation: none; }
@keyframes routineFabGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(212, 175, 95, 0.40), 0 0 18px rgba(212, 175, 95, 0.18); }
  50%      { box-shadow: 0 0 16px rgba(212, 175, 95, 0.70), 0 0 30px rgba(212, 175, 95, 0.40); }
}
.todo-complete.sm { width: 24px; height: 24px; min-width: 24px; }
.todo-complete.sm .lucide { width: 13px; height: 13px; }
.icon-btn.sm { min-width: 32px; min-height: 32px; padding: 7px; }
.routine-done { padding: 12px 16px; }
.routine-done .done-check.sm { width: 16px; height: 16px; color: var(--gold); }
.routine-done-title { font-size: 0.88rem; color: var(--ink); }
.routine-done-meta { font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px; }
.routine-streak { font-size: 0.74rem; font-weight: 600; color: var(--gold-bright); background: rgba(212, 175, 95, 0.1); border: 1px solid var(--hairline-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; flex: 0 0 auto; }
/* Attachments folded INTO the creator as a tight, compact sub-section (no box) */
.attach-embed { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.attach-embed-head { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); }
.attach-embed-head .lucide { color: var(--gold); }
.attach-embed .attach-subhead { margin: 9px 0 0; }
.attach-embed .attach-add { margin: 6px 0 0; }
.attach-embed .attach-row { padding: 6px 0; }
.attach-embed .attach-files-bar { margin: 7px 0 0; }
.attach-files-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.attach-hint { font-size: 0.78rem; color: var(--ink-faint); }
/* Collapsible Attachments dropdown (PROJECT view) */
.attach-toggle { width: 100%; display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; padding: 2px 0; font-family: inherit; color: var(--gold-bright); font-size: 0.95rem; font-weight: 600; }
.attach-toggle .tag-ic, .attach-toggle .lucide { color: var(--gold); }
.attach-toggle-title { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; font-weight: 600; }
.attach-count { font-size: 0.7rem; font-weight: 700; color: var(--gold-bright); background: rgba(212, 175, 95, 0.12); border: 1px solid var(--hairline-2); border-radius: 999px; padding: 2px 9px; }
.attach-chevron { margin-left: auto; display: inline-flex; transition: transform var(--t) var(--ease); }
.attach-chevron .lucide { color: var(--gold); }
.attach-toggle.open .attach-chevron { transform: rotate(180deg); }
/* Readable, labelled project links — label is the headline, URL the clickable line */
.attach-row-rich { align-items: flex-start; }
.attach-rich-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.attach-rich-label { font-size: 1.02rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.attach-rich-url { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--gold-bright); text-decoration: none; font-size: 0.82rem; }
.attach-rich-url .lucide { color: var(--gold); flex: 0 0 auto; width: 14px; height: 14px; }
.attach-rich-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-rich-url:hover span { text-decoration: underline; }
.attach-size { color: var(--ink-faint); font-size: 0.78rem; margin-left: 8px; flex: 0 0 auto; }
.attach-file-row .attach-link { color: var(--ink); }
.attach-file-row .attach-link:hover span { text-decoration: none; color: var(--gold-bright); }
.attach-summary { margin: 2px 0 10px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.attach-summary-head { display: flex; align-items: center; gap: 7px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 6px; }
.attach-summary-head .lucide { color: var(--gold); }
.attach-summary-body { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }
.todo-attach-tag .lucide { color: var(--gold); }
.todo-notes-tag .lucide { color: var(--gold); }
/* Per-to-do notes box (compact in the creator, a touch taller in edit) */
.todo-notes-wrap { margin-top: 10px; }
.todo-notes-input { width: 100%; min-height: 42px; resize: vertical; font-size: 0.9rem; line-height: 1.5; }
/* Clickable attachments on a committed to-do row */
.todo-attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.todo-attach-item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; color: var(--gold-bright); text-decoration: none; }
.todo-attach-item .lucide { color: var(--gold); flex: 0 0 auto; }
.todo-attach-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.todo-attach-item:hover { border-color: var(--gold); }
a.todo-attach-item:hover > span { text-decoration: underline; }
.todo-attach-item.file { color: var(--ink); }
.attach-mini-btn { background: none; border: none; color: var(--ink-soft); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; flex: 0 0 auto; }
.attach-mini-btn:hover { color: var(--gold-bright); background: var(--bg-3); }
.attach-mini-btn .lucide { width: 15px; height: 15px; }

/* PDF preview overlay */
.pdf-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pdf-modal { width: min(960px, 100%); height: min(88vh, 100%); background: var(--bg-1); border: 1px solid var(--hairline-2); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.pdf-modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
.pdf-modal-title { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-frame { flex: 1; width: 100%; border: none; background: #fff; }
.sales-stream-head { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 1.35rem; color: var(--gold-bright); margin: 24px 0 12px; }
.sales-add-row { margin: 6px 0 6px; }
/* EarthNotes link on a lead — gold pin in the grid, view button in the detail. */
.srec-en-pin .lucide { color: var(--gold); }
.srec-en-pin:hover .lucide { color: var(--gold-bright); }
.srec-en-label { display: flex; flex-direction: column; gap: 5px; }
.srec-en-view { margin-top: 8px; align-self: flex-start; }
.srec-en-view .lucide { color: var(--gold); }
/* Read-only derived field (e.g. Last contacted) */
.srec-readonly { padding: 9px 2px; color: var(--ink-soft); font-size: 0.92rem; }
/* Lead's own company number (separate from contacts), near the top */
.srec-company-block { margin: 10px 0 2px; }
.srec-company-view { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srec-company-view > .tag-ic { color: var(--gold); }
.srec-company-num { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-bright); text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.srec-company-num .tag-ic { color: var(--gold); width: 14px; height: 14px; }
.srec-company-num:hover { text-decoration: underline; }
.srec-company-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srec-company-edit input { flex: 1 1 150px; min-width: 120px; }
/* Opt-in follow-up */
.srec-fu-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; }
.srec-fu-cap { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); }
.srec-fu-val { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.srec-fu-val.overdue { color: var(--red); }
/* Project type bar */
.proj-type-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.proj-type-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); }
.proj-type-sel { width: auto; }
.proj-type-hint { font-size: 0.78rem; color: var(--ink-faint); }
/* EarthNotes collapse/edit block */
.srec-en-block { display: flex; flex-direction: column; gap: 6px; }
.srec-en-block > span { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-soft); }
.srec-en-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srec-en-row input { flex: 1; min-width: 160px; }
/* ---- Single-lead: primary summary, contacts list, contact view ---- */
.srec-primary-line { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 0.86rem; color: var(--ink-soft); }
.srec-primary-line .tag-ic { color: var(--gold); width: 15px; height: 15px; }
.srec-target-via { color: var(--ink-faint); font-size: 0.78rem; }
.srec-primary-name { font-weight: 600; color: var(--ink); }
.srec-primary-phone { color: var(--gold-bright); text-decoration: none; }
.srec-primary-phone:hover { text-decoration: underline; }
.srec-contacts { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.srec-contacts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.srec-contacts-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srec-contacts-head .item-title { display: flex; align-items: center; gap: 7px; }
.srec-contacts-head .item-title .lucide { color: var(--gold); }
/* Up to ~5 rows visible, then scroll for the rest. */
.srec-contacts-list { max-height: 264px; overflow-y: auto; }
.srec-contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--hairline); cursor: pointer; }
.srec-contact-row:first-child { border-top: none; }
.srec-contact-row:hover { background: var(--bg-2); }
.srec-contact-name { font-size: 0.94rem; color: var(--ink); font-weight: 500; }
.srec-contact-phone { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-bright); text-decoration: none; font-size: 0.84rem; flex: 0 0 auto; }
.srec-contact-phone .tag-ic { color: var(--gold); width: 14px; height: 14px; }
.srec-contact-phone:hover { text-decoration: underline; }
.srec-contact-go .lucide { color: var(--ink-faint); width: 18px; height: 18px; }
.srec-star .lucide { color: var(--ink-faint); width: 17px; height: 17px; transition: color var(--t) var(--ease); }
.srec-star:hover .lucide { color: var(--gold); }
.srec-star.on .lucide { color: var(--gold); fill: var(--gold); }
.srec-star-btn.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); color: #1a1206; border-color: transparent; }
.srec-star-btn.on .lucide { color: #1a1206; fill: #1a1206; }
.srec-contact-title { display: flex; align-items: center; gap: 8px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.3rem; font-weight: 600; color: var(--gold-bright); }
.srec-contact-title .tag-ic { color: var(--gold); }
/* Rolled-up activity timeline — compact + scrollable */
.srec-timeline { max-height: 240px; overflow-y: auto; padding-right: 4px; }
/* ---- Lead LIST (one row per lead) ---- */
.lead-list-card { padding: 4px 16px; }
.lead-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-top: 1px solid var(--hairline); cursor: pointer; }
.lead-row:first-child { border-top: none; }
.lead-row:hover { background: var(--bg-2); }
/* Fixed status column → titles line up regardless of the badge label width. */
.lead-status-col { flex: 0 0 116px; display: flex; align-items: center; }
.lead-status-col .srec-status { white-space: nowrap; }
/* Title fills the middle so the metadata cluster is pinned to a consistent right edge. */
.lead-main { flex: 1 1 auto; min-width: 0; }
/* Metadata as one clean row with fixed sub-columns → aligned down every row. */
.lead-meta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.lead-pin-slot { flex: 0 0 auto; width: 24px; display: inline-flex; align-items: center; justify-content: center; }
.lead-name { font-size: 1.02rem; font-weight: 600; color: var(--ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-primary { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 0.82rem; color: var(--ink-soft); }
.lead-primary .tag-ic { color: var(--gold); width: 13px; height: 13px; }
.lead-primary.muted { color: var(--ink-faint); font-style: italic; }
.lead-primary-name { font-weight: 600; color: var(--ink-soft); }
.lead-primary-phone { color: var(--gold-bright); text-decoration: none; }
.lead-primary-phone:hover { text-decoration: underline; }
.lead-count, .lead-last { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--ink-soft); flex: 0 0 auto; }
.lead-count { min-width: 42px; }   /* icon + up to two digits, so counts line up */
.lead-last { min-width: 84px; }    /* icon + date, so dates + trailing icons line up */
.lead-count .tag-ic, .lead-last .tag-ic { color: var(--gold); width: 14px; height: 14px; }
.lead-go { flex: 0 0 auto; display: inline-flex; align-items: center; }
.lead-go .lucide { color: var(--ink-faint); width: 18px; height: 18px; }
/* Per-row delete: subtle, small icon, comfortable ~34px tap zone; red on hover */
.lead-del { flex: 0 0 auto; min-width: 34px; min-height: 34px; padding: 8px; }
.lead-del .lucide { color: var(--ink-faint); width: 15px; height: 15px; }
.lead-del:hover .lucide { color: var(--red); }
/* Inline edit rows (rename + delete tucked into the pencil) */
.proj-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-edit-row .grow2 { flex: 1 1 140px; min-width: 0; }
.proj-edit-del .lucide, .cat-edit-del .lucide { color: var(--red); }
.proj-edit-del:hover, .cat-edit-del:hover { border-color: var(--red); color: var(--red); }
/* ---- In-lead Next / Previous nav ---- */
.lead-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.lead-nav-right { display: flex; align-items: center; gap: 10px; }
.lead-nav-pos { font-size: 0.8rem; color: var(--ink-faint); white-space: nowrap; }
/* Fire choice modal — stacked full-width options */
.modal-actions-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.modal-actions-stack .btn { width: 100%; }
/* Cockpit contact picker */
.focus-contact-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.focus-contact-row .focus-info-label { flex: 0 0 auto; }
.focus-contact-sel { flex: 1; min-width: 0; }
.goal-row { display: flex; align-items: center; gap: 14px; }
.goal-field { display: flex; flex-direction: column; gap: 5px; margin-left: auto; align-items: flex-end; }
.goal-field > span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.goal-input { width: 100px; text-align: right; }

/* Themed modal (dark-gold) — replaces native prompt/confirm */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fade 0.15s var(--ease);
}
.modal {
  width: 100%; max-width: 380px; background: linear-gradient(180deg, #181410 0%, #120e0a 100%);
  border: 1px solid var(--hairline-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 18px;
}
.modal-msg { color: var(--ink); font-size: 0.98rem; line-height: 1.5; white-space: pre-line; }
.modal-input { margin-top: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Sales records (CRM worksheet) */
.sales-rec-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sales-record { margin-bottom: 14px; }
.srec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.srec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.srec-field { display: flex; flex-direction: column; gap: 5px; }
.srec-field > span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.srec-notes-wrap { margin-top: 14px; }
.srec-notes { min-height: 56px; }
.srec-status { border: none; cursor: pointer; font: inherit; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em; padding: 6px 14px; border-radius: 999px; transition: filter var(--t) var(--ease); }
.srec-status:hover { filter: brightness(1.12); }
/* Unified stage look — Not Contacted / Stage 1 / 2 / 3 all share ONE clean gold
   treatment (told apart by their text label, not colour; no heat-gradient). */
.srec-status.st-new,
.srec-status.st-1,
.srec-status.st-2,
.srec-status.st-3 { background: rgba(212, 175, 95, 0.16); color: var(--gold-bright); }
.srec-status.st-dead { background: var(--bg-2); color: var(--ink-faint); text-decoration: line-through; }
@media (max-width: 620px) { .srec-grid { grid-template-columns: 1fr; } }

/* Sales records — spreadsheet/grid view */
.srec-table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--bg-1); }
.srec-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.srec-table th { text-align: left; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.srec-table td { padding: 11px 14px; border-bottom: 1px solid var(--hairline); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.srec-table tbody tr:last-child td { border-bottom: none; }
.srec-row { cursor: pointer; transition: background var(--t) var(--ease); }
.srec-row:hover { background: var(--bg-2); }
.srec-status-cell { padding-top: 7px; padding-bottom: 7px; }
.srec-status-sm { font-size: 0.7rem; padding: 4px 10px; }
.srec-act-cell { white-space: nowrap; }
.srec-act-count { font-size: 0.78rem; color: var(--ink-soft); margin-left: 2px; vertical-align: middle; }
.srec-th { cursor: pointer; user-select: none; transition: color var(--t) var(--ease); }
.srec-th:hover { color: var(--ink-soft); }
.srec-th.sorted { color: var(--gold-bright); }

/* Grid filters */
.sales-filters { margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { border: 1px solid var(--hairline); background: var(--bg-2); color: var(--ink-soft); font: inherit; font-size: 0.76rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; opacity: 0.5; transition: opacity var(--t) var(--ease), background var(--t) var(--ease); }
.filter-chip.on { opacity: 1; }
/* Match the pills: all active non-Dead stage chips share the same gold treatment. */
.filter-chip.on.st-new,
.filter-chip.on.st-1,
.filter-chip.on.st-2,
.filter-chip.on.st-3 { background: rgba(212, 175, 95, 0.16); color: var(--gold-bright); border-color: transparent; }
.filter-chip.on.st-dead { background: var(--bg-2); color: var(--ink-soft); border-color: var(--hairline); text-decoration: line-through; }
.filter-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-region { width: auto; max-width: 200px; }

/* Activity log + quick note (detail view) */
.act-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.act-head { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; margin-bottom: 10px; }
.act-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-add .act-type { width: auto; flex: 0 0 auto; max-width: 110px; }
.act-add input { flex: 1; min-width: 150px; }
.act-log { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.act-entry { border-left: 2px solid var(--hairline-2); padding-left: 12px; }
.act-meta { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold); font-weight: 600; }
.act-text { color: var(--ink); font-size: 0.92rem; margin-top: 3px; line-height: 1.5; white-space: pre-wrap; }

/* Sales — call-through focus mode */
.sales-rec-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Project toolbar dropdowns (Filters ▾ / More ⋯) */
.dropdown { position: relative; display: inline-flex; }
.dropdown-trigger { display: inline-flex; align-items: center; gap: 6px; }
.dropdown-trigger.has-active { border-color: var(--gold); color: var(--gold-bright); }
.dropdown-caret { width: 14px; height: 14px; opacity: 0.75; }
.dropdown-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #1a1206; font-size: 0.7rem; font-weight: 700; }
.dropdown-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 240px; max-width: min(320px, 90vw);
  background: linear-gradient(180deg, #181410 0%, #120e0a 100%);
  border: 1px solid var(--gold-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px;
  animation: fade 0.12s var(--ease); text-align: left;
}
.dropdown-panel.hidden { display: none; }
.dropdown-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-top: 2px; }
.dropdown-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.filters-panel .filter-region { width: 100%; max-width: none; }
.filters-panel .filter-chips { gap: 6px; }
.more-panel { min-width: 200px; }
.dropdown-item { width: 100%; justify-content: flex-start; }
/* Tasks Filters dropdown: selected category + colour dots */
.dropdown-item.on { color: var(--gold-bright); border-color: var(--gold); }
.todo-filter-panel { min-width: 220px; }
.todo-filter-item .fdot { margin-right: 2px; }
.fdot-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-2); }

/* Lead-list bulk SELECT mode */
.sales-select-count { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; font-weight: 600; color: var(--gold-bright); }
.lead-check { background: none; border: none; padding: 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--ink-faint); transition: color var(--t) var(--ease); }
.lead-check .lucide { width: 20px; height: 20px; }
.lead-check.on { color: var(--gold-bright); }
.lead-row.selected { background: rgba(212, 175, 95, 0.09); }
/* Destructive "Delete selected" button — restrained red that fits the dark theme. */
.danger-btn { background: linear-gradient(180deg, #a83a28, #7a2717); color: #f5ede2; box-shadow: 0 6px 18px rgba(140, 44, 28, 0.32); border: none; }
.danger-btn:hover { filter: brightness(1.08); }
.danger-btn i, .danger-btn .lucide { width: 15px; height: 15px; }
.proj-notes-card { margin-bottom: 16px; }
.proj-notes { min-height: 90px; width: 100%; }
.proj-notes-dot { padding: 1px 7px; font-size: 0.55rem; line-height: 1; color: var(--gold-bright); }
.proj-notes-body { margin-top: 12px; }
.proj-notes-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.proj-notes-status { font-size: 0.82rem; color: var(--gold-bright); font-weight: 600; }
.proj-target-card { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.proj-target-field { display: flex; flex-direction: column; gap: 5px; }
.proj-target-field > span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.proj-target-input { width: 90px; }
.proj-target-count { margin-left: auto; color: var(--ink-soft); font-size: 0.86rem; font-weight: 600; }

/* Home Hussle card */
.hussle-row { display: flex; align-items: center; gap: 12px; }
.hussle-name { font-weight: 600; color: var(--ink); }
.hussle-prog-text { font-size: 0.8rem; color: var(--ink-soft); margin-top: 3px; }
.hussle-prog-text.dormant { color: var(--ink-faint); }
.hussle-bar { height: 6px; border-radius: 999px; background: var(--bg-3); margin-top: 6px; overflow: hidden; max-width: 220px; }
.hussle-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold-bright)); border-radius: 999px; transition: width var(--t) var(--ease); }
.hussle-bar-fill.done { background: var(--gold-bright); }
.focus-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.focus-progress { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.focus-order { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sales-focus { padding: 28px; }
.focus-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.focus-name { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 1.9rem; color: var(--ink); line-height: 1.1; }
.focus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px; margin-bottom: 22px; }
.focus-info { display: flex; flex-direction: column; gap: 3px; }
.focus-info-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; }
.focus-info-val { color: var(--ink); font-size: 1rem; }
a.focus-info-val { color: var(--gold-bright); text-decoration: none; }
a.focus-info-val:hover { text-decoration: underline; }
.focus-notewrap { display: flex; flex-direction: column; gap: 8px; }
.focus-notewrap .act-type { width: auto; max-width: 120px; }
.focus-note { min-height: 80px; }
.focus-actions { display: flex; gap: 12px; margin-top: 18px; }
.focus-next { padding: 12px 26px; font-size: 1rem; }
.focus-done { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; color: var(--gold-bright); font-weight: 600; }
.fire-btn { padding: 12px 28px; font-size: 1rem; }
.fire-skip-note { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 0.82rem; color: var(--red); }
.fire-skip-note .tag-ic { color: var(--red); width: 14px; height: 14px; }
.fire-status-line { margin: 14px 0 2px; min-height: 20px; }
.fire-oncall { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-bright); font-weight: 600; font-size: 0.9rem; }
.fire-lag { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }
.focus-recent { margin-top: 18px; }
.focus-recent .act-entry { margin-top: 10px; }
@media (max-width: 620px) { .focus-grid { grid-template-columns: 1fr; } .focus-order { margin-left: 0; } }
.placeholder-ic { width: 28px; height: 28px; color: var(--gold); flex: 0 0 auto; }

/* ---------- Goals / to-dos extras ---------- */
.goal-tasks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.goal-tasks-head { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.goal-tasks .home-row { padding: 7px 0; }
/* Tasks — ONE quiet meta line: small muted text, subtle icons, no chunky pills. */
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 3px; font-size: 0.76rem; color: var(--ink-faint); }
.todo-meta .tag { background: none; border: none; padding: 0; margin: 0; border-radius: 0; font-size: 0.76rem; font-weight: 500; color: var(--ink-soft); gap: 4px; }
.todo-meta .tag .tag-ic { color: var(--gold); opacity: 0.85; }
.todo-meta .tag.overdue { color: var(--red); }
.todo-meta .tag.overdue .tag-ic { color: var(--red); opacity: 1; }
.todo-meta .tag.soon { color: var(--gold-bright); }
/* Inline association re-link, kept but shrunk to a subtle control (not a pill). */
.todo-meta .todo-link-sel { font-size: 0.76rem; padding: 2px 6px; max-width: 160px; background: none; border: 1px solid var(--gold-line); border-radius: 6px; color: var(--ink-soft); }
.todo-meta .todo-link-sel:hover { border-color: var(--gold); color: var(--ink); }
.todo-goal-sel { width: auto; max-width: 220px; margin-top: 8px; font-size: 0.8rem; padding: 6px 10px; }

/* ---------- Crystallize ---------- */
.crys-intro { max-width: 640px; margin: -6px 0 22px; color: var(--ink-soft); font-size: 0.96rem; line-height: 1.62; }
.forge-input { min-height: 96px; font-size: 0.96rem; line-height: 1.55; }
.forge-capture-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.forge-quip { flex: 1; min-width: 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.05rem; color: var(--gold-bright); text-shadow: none; }
/* Daily rotating Crystallize quote (replaces the old empty-state line) */
.crys-quote {
  max-width: 620px; margin: 30px auto; text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 1.5rem; line-height: 1.5;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.forge-text { font-size: 1.0rem; line-height: 1.55; white-space: pre-wrap; color: var(--ink); }
.forge-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.forge-soon { font-weight: 600; }
.forge-card.forged { border-color: var(--hairline-2); }
.forge-card.forged .forge-text { opacity: 0.62; }
.forge-review { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.forge-review-head { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.forge-sugg { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--hairline); }
.forge-sugg:first-of-type { border-top: none; }
.forge-sugg-date, .forge-sugg-goal { width: auto; flex: 0 0 auto; max-width: 150px; font-size: 0.8rem; padding: 6px 9px; }
.forge-manual { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

/* ---------- Wellbeing ---------- */
.wb-daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wb-dayname { font-weight: 600; font-size: 1.0rem; color: var(--ink); }
.wb-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.wb-row:first-of-type { border-top: none; }
.wb-label { flex: 1; min-width: 0; }
.wb-label b { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.wb-label span { display: block; font-size: 0.76rem; color: var(--ink-faint); }
.wb-seg { display: inline-flex; background: var(--bg-3); border-radius: 9px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.wb-seg button { border: none; background: none; color: var(--ink-soft); font: inherit; font-size: 0.8rem; font-weight: 500; padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.wb-seg button:hover { color: var(--ink); }
.wb-seg button.sel-good { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); color: #1a1206; }
.wb-seg button.sel-ok   { background: rgba(212, 175, 95, 0.32); color: var(--gold-bright); }
.wb-seg button.sel-poor { background: rgba(212, 175, 95, 0.14); color: var(--gold-bright); }
.wb-score-card { text-align: center; padding: 28px 24px; }
.wb-score-num { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 3.2rem; line-height: 1; color: var(--gold-bright); }
.wb-score-num.high, .wb-score-num.mid, .wb-score-num.low { color: var(--gold-bright); }
.wb-score-band { margin-top: 8px; }
.wb-msg-head { font-size: 1.05rem; font-weight: 600; margin-top: 18px; color: var(--ink); }
.wb-msg-body { color: var(--ink-soft); margin: 8px auto 0; max-width: 580px; line-height: 1.6; }
.wb-safety { display: flex; gap: 14px; align-items: flex-start; border-color: var(--hairline-2); background: var(--bg-2); }
.wb-safety .lucide { color: var(--gold); width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; }
.wb-trend-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
/* Collapsible Health card header (same toggle/animation as the attachments dropdown) */
.wb-collapse-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.wb-collapse-right { display: inline-flex; align-items: center; gap: 10px; }
.wb-collapse-chevron { display: inline-flex; transition: transform var(--t) var(--ease); }
.wb-collapse-chevron .lucide { color: var(--gold); width: 18px; height: 18px; }
.wb-collapse-head.open .wb-collapse-chevron { transform: rotate(180deg); }
.wb-card-body { margin-top: 14px; }
.wb-card-body.wb-collapsed { display: none; }
.wb-trend { display: flex; align-items: flex-end; gap: 5px; height: 72px; }
.wb-bar { flex: 1; border-radius: 4px 4px 2px 2px; min-height: 3px; background: var(--bg-3); transition: height var(--t) var(--ease); }
.wb-bar.high, .wb-bar.mood { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); }
.wb-bar.mid { background: rgba(212, 175, 95, 0.55); }
.wb-bar.low { background: rgba(212, 175, 95, 0.3); }
.wb-bar.empty { background: rgba(255, 255, 255, 0.04); }
.wb-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wb-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-2); border: 1px solid var(--hairline); color: var(--ink-soft); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.82rem; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.wb-chip:hover { background: var(--bg-3); color: var(--gold-bright); }
.wb-disclaimer { font-size: 0.76rem; color: var(--ink-faint); text-align: center; margin: 18px auto 0; max-width: 560px; line-height: 1.5; }
.streak { font-size: 0.84rem; font-weight: 600; color: var(--gold-bright); display: inline-flex; align-items: center; gap: 5px; }
.streak .lucide { color: var(--gold-bright); }

.goodday-card { display: flex; align-items: center; gap: 18px; }
.goodday-count { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 1.8rem; min-width: 64px; text-align: center; color: var(--gold-bright); }
.mood-row { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
.mood-cap { width: 46px; flex: 0 0 auto; font-size: 0.8rem; color: var(--ink-soft); }
.mood-readout { flex: 0 0 auto; min-width: 52px; text-align: right; }
.mood-val { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 1.35rem; color: var(--gold-bright); }
.mood-max { font-size: 0.72rem; color: var(--ink-faint); }
.mood-note { min-height: 52px; }
.mood-slider { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; padding: 0; border: none; border-radius: 999px; background: var(--bg-3); outline: none; cursor: pointer; }
.mood-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border: none; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); cursor: pointer; }
.mood-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: none; cursor: pointer; }
.mood-slider:focus { box-shadow: 0 0 0 3px rgba(212, 175, 95, 0.25); }
.wb-done-card { text-align: center; }
.wb-done-btn { width: 100%; padding: 14px; font-size: 1rem; }
.wb-logged-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--gold-bright); font-weight: 600; font-size: 0.92rem; margin: 8px 0 4px; }
.wb-logged-badge .lucide { color: var(--gold-bright); }
.wb-logged-score { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.wb-logged-card .wb-score-num { font-size: 2.6rem; }

/* ---------- Sleep times input + analysis ---------- */
.wb-sleep-detail { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.wb-sleep-head { display: flex; align-items: center; gap: 7px; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.wb-sleep-head .lucide { color: var(--gold); }
.wb-sleep-opt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 600; border: 1px solid var(--hairline); border-radius: 999px; padding: 1px 8px; }
.wb-sleep-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.wb-sleep-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 0.74rem; color: var(--ink-soft); }
.wb-time, .wb-num { background: var(--bg-3); border: 1px solid var(--hairline); color: var(--ink); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 0.9rem; color-scheme: dark; }
.wb-time { min-width: 130px; }
.wb-num { width: 84px; }
.wb-sleep-readout { margin-top: 12px; font-size: 0.9rem; color: var(--ink-soft); }
.wb-sleep-dur b { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; font-weight: 600; margin-right: 8px; }
.wb-sleep-dur b.in-target { color: var(--gold-bright); }
.wb-sleep-dur b.off-target { color: var(--ink); }

.wb-sleep-last { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 4px 0 6px; }
.wb-sleep-bignum { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 2.4rem; line-height: 1; }
.wb-sleep-bignum.in-target { color: var(--gold-bright); }
.wb-sleep-bignum.off-target { color: var(--ink); }
.wb-sleep-sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.wb-sleep-baseline { font-size: 0.82rem; color: var(--ink-soft); text-align: right; max-width: 180px; }
.wb-reg-badge { font-size: 0.74rem; font-weight: 600; border-radius: 999px; padding: 3px 11px; border: 1px solid var(--hairline-2); }
.wb-reg-badge.high { color: #1a1206; background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; }
.wb-reg-badge.mid { color: var(--gold-bright); background: rgba(212, 175, 95, 0.18); }
.wb-reg-badge.low { color: var(--gold-bright); background: rgba(212, 175, 95, 0.08); }
.wb-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 4px; }
.wb-stat { background: var(--bg-2); border: 1px solid var(--hairline); border-radius: 11px; padding: 12px 10px; text-align: center; }
.wb-stat-val { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 1.3rem; color: var(--gold-bright); line-height: 1.1; }
.wb-stat-lab { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); font-weight: 600; margin-top: 5px; }
.wb-sleep-msg { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.wb-sleep-msg .wb-msg-head { margin-top: 0; text-align: left; }
.wb-sleep-msg .wb-msg-body { margin-left: 0; text-align: left; max-width: none; }
.wb-sleep-action { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.88rem; font-weight: 500; color: var(--gold-bright); }
.wb-sleep-action .lucide { color: var(--gold); flex: 0 0 auto; }
@media (max-width: 560px) { .wb-stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Per-pillar history rows ---------- */
.pill-hist-row { padding: 14px 0; border-top: 1px solid var(--hairline); }
.pill-hist-row:first-of-type { border-top: none; padding-top: 4px; }
.pill-hist-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.pill-hist-top b { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.pill-hist-meta { display: inline-flex; align-items: center; gap: 9px; }
.pill-spark { height: 44px; gap: 4px; }
.pill-trend { width: 18px; height: 18px; }
.pill-trend.up { color: var(--gold-bright); }
.pill-trend.down, .pill-trend.flat { color: var(--ink-faint); }
.pill-streak { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; }
.pill-streak.good { color: #1a1206; background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); }
.pill-streak.poor { color: var(--gold-bright); background: rgba(212, 175, 95, 0.1); border: 1px solid var(--hairline-2); }
.pill-hist-foot { margin-top: 8px; font-size: 0.74rem; color: var(--ink-soft); }

/* ---------- Cross-pillar patterns ---------- */
.corr-row { padding: 16px 0; border-top: 1px solid var(--hairline); }
.corr-row:first-of-type { border-top: none; padding-top: 4px; }
.corr-tag { display: inline-block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; margin-bottom: 9px; }
.corr-tag.watch { color: var(--gold-bright); background: rgba(212, 175, 95, 0.1); border: 1px solid var(--hairline-2); }
.corr-tag.lift { color: #1a1206; background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); }
.corr-summary { font-size: 1.02rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.corr-detail { margin-top: 6px; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }
.corr-row .wb-sleep-action { margin-top: 10px; }
.corr-note { font-size: 0.74rem; color: var(--ink-faint); line-height: 1.5; margin: 14px 0 0; font-style: italic; }

/* ---------- Eolas notes / links ---------- */
.topic-links { list-style: none; padding: 0; margin: 14px 0 0; }
.topic-links li { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 0.9rem; }
.topic-links a { color: var(--gold-bright); text-decoration: none; word-break: break-all; }
.topic-links a:hover { text-decoration: underline; }
.topic-links .lucide { color: var(--ink-faint); }

/* ---------- DONE ---------- */
.done-check { color: var(--gold-bright); width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.done-card .item-meta { margin-top: 4px; }

/* ---------- DOCUMENTS ---------- */
.docs-topbar { margin-bottom: 18px; }
.docs-addfolder { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.docs-addfolder input { flex: 1 1 220px; min-width: 160px; }
/* A folder = a clear header with its documents listed beneath it. */
.docs-folder-block { margin-bottom: 26px; }
.docs-folder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline-2); }
.docs-folder-head > input { flex: 1 1 200px; min-width: 160px; }
.docs-folder-title { display: flex; align-items: center; gap: 9px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--gold-bright); min-width: 0; }
.docs-folder-title .tag-ic { color: var(--gold); }
.docs-folder-count { font-size: 0.68rem; font-weight: 700; color: var(--gold-bright); background: rgba(212, 175, 95, 0.12); border: 1px solid var(--hairline-2); border-radius: 999px; padding: 1px 8px; }
.docs-folder-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.docs-newdoc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.docs-newdoc input { flex: 1 1 240px; min-width: 160px; }
.docs-list { display: flex; flex-direction: column; }
.docs-entry { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--hairline); }
.docs-entry:first-child { border-top: none; }
.docs-entry > input { flex: 1 1 200px; min-width: 150px; }
.docs-entry-open { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; background: none; border: none; padding: 4px 0; text-align: left; cursor: pointer; }
.docs-entry-ic { color: var(--gold); width: 17px; height: 17px; flex: 0 0 auto; }
.docs-entry-title { font-size: 1.02rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-entry-open:hover .docs-entry-title { color: var(--gold-bright); }
.docs-entry-meta { flex: 0 0 auto; font-size: 0.76rem; color: var(--ink-faint); white-space: nowrap; }
.docs-rowbtn { opacity: 0.45; transition: opacity var(--t) var(--ease); }
.docs-entry:hover .docs-rowbtn { opacity: 0.9; }
.docs-rowbtn:hover { opacity: 1; }

/* ---------- DOCUMENT EDITOR (TipTap) ---------- */
.doced-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.doced-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doced-titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.doced-title { flex: 1 1 auto; min-width: 0; background: transparent; border: none; border-bottom: 1px solid transparent; border-radius: 0; padding: 4px 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 2rem; font-weight: 700; color: var(--gold-bright); }
.doced-title:focus { outline: none; border-bottom-color: var(--hairline-2); }
/* Prominent save-state pill sitting beside the Save button. A dot (currentColor)
   makes the state readable at a glance: grey = Saved, gold = Saving, amber =
   Unsaved changes, red = Save failed. */
.doced-status { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: rgba(212, 175, 95, 0.05); white-space: nowrap; }
.doced-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.doced-status.saved { color: var(--ink-faint); }
.doced-status.saving { color: var(--gold); }
.doced-status.unsaved { color: #d8a24a; border-color: rgba(216, 162, 74, 0.5); background: rgba(216, 162, 74, 0.1); }
.doced-status.error { color: #e0655b; border-color: rgba(217, 83, 79, 0.6); background: rgba(217, 83, 79, 0.14); }
/* Primary Save button (gold). Dims while a save is in flight. */
.doced-save { flex: 0 0 auto; }
.doced-save:disabled { opacity: 0.6; cursor: default; }
.doced-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin-bottom: 14px; background: linear-gradient(180deg, #181410 0%, #120e0a 100%); border: 1px solid var(--hairline); border-radius: var(--radius); }
.doced-grp { display: flex; align-items: center; gap: 4px; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--hairline); }
.doced-grp:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.doced-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 7px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--ink-soft); cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.doced-btn svg { width: 16px; height: 16px; }
.doced-btn.txt { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.doced-btn:hover { background: rgba(212, 175, 95, 0.1); color: var(--ink); }
.doced-btn.on { background: rgba(212, 175, 95, 0.16); border-color: var(--hairline-2); color: var(--gold-bright); }
.doced-font { height: 32px; padding: 0 8px; min-width: 96px; }
/* The writing surface: comfortable measure, calm line-height, Cormorant. */
.doced-page { background: linear-gradient(180deg, #181410 0%, #120e0a 100%); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 40px 32px; min-height: 60vh; }
.doced-surface .ProseMirror { max-width: 46rem; margin: 0 auto; min-height: 55vh; outline: none; font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.28rem; line-height: 1.75; color: var(--ink); }
.doced-surface .ProseMirror:focus { outline: none; }
.doced-surface .ProseMirror > * + * { margin-top: 0.85em; }
.doced-surface .ProseMirror p { margin: 0; }
.doced-surface .ProseMirror h1 { font-size: 2.1rem; font-weight: 700; color: var(--gold-bright); line-height: 1.2; }
.doced-surface .ProseMirror h2 { font-size: 1.7rem; font-weight: 700; color: var(--gold-bright); line-height: 1.25; }
.doced-surface .ProseMirror h3 { font-size: 1.4rem; font-weight: 600; color: var(--gold); line-height: 1.3; }
.doced-surface .ProseMirror ul, .doced-surface .ProseMirror ol { padding-left: 1.5em; margin: 0; }
.doced-surface .ProseMirror li { margin: 0.2em 0; }
.doced-surface .ProseMirror li > p { margin: 0; }
.doced-surface .ProseMirror u { text-decoration: underline; }
.doced-surface .ProseMirror p.is-editor-empty:first-child::before { content: "Start writing…"; float: left; height: 0; pointer-events: none; color: var(--ink-faint); }

/* ---------- CLEAN PRINT (document only, no app chrome) ---------- */
#doc-print { display: none; }
@media print {
  body.printing-doc > *:not(#doc-print) { display: none !important; }
  body.printing-doc #doc-print { display: block !important; color: #000; background: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.6; padding: 0; }
  body.printing-doc #doc-print .doc-print-title { font-family: Georgia, serif; font-size: 20pt; margin: 0 0 16pt; }
  body.printing-doc #doc-print h1 { font-size: 18pt; } body.printing-doc #doc-print h2 { font-size: 15pt; } body.printing-doc #doc-print h3 { font-size: 13pt; }
  body.printing-doc #doc-print ul, body.printing-doc #doc-print ol { margin-left: 22pt; }
  body.printing-doc #doc-print p { margin: 0 0 8pt; }
}

/* ---------- SETTINGS ---------- */
.settings-card { padding: 4px 22px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 2px; border-top: 1px solid var(--hairline); }
.setting-row:first-child { border-top: none; }
.setting-info { min-width: 0; }
.setting-label { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.28rem; font-weight: 600; color: var(--gold-bright); line-height: 1.2; }
.setting-desc { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; max-width: 560px; }
.setting-control { flex: 0 0 auto; }
/* On/off toggle switch */
.setting-switch { position: relative; width: 50px; height: 28px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--hairline-2); cursor: pointer; padding: 0; transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.setting-switch .setting-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-soft); transition: transform var(--t) var(--ease), background var(--t) var(--ease); }
.setting-switch.on { background: linear-gradient(180deg, var(--gold-bright), var(--gold-2)); border-color: transparent; }
.setting-switch.on .setting-knob { transform: translateX(22px); background: #1a1206; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--bar-h); left: 0; bottom: 0; z-index: 30; width: 244px;
    background: var(--cream); transform: translateX(-101%); transition: transform 0.25s var(--ease);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .content { padding: 30px 20px; }
  .content.has-bg::before { left: 0; } /* sidebar is an overlay on phone — bg spans full width */
  .home-grid, .subject-grid, .intel-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 58px; border-radius: 8px; }
}
@media (max-width: 620px) {
  .wb-row { flex-wrap: wrap; }
  .wb-seg { width: 100%; justify-content: space-between; }
  .forge-sugg { flex-wrap: wrap; }
  .forge-sugg-date, .forge-sugg-goal { max-width: none; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Twilio browser dialer ---------- */
/* CALL button on the lead's call-target line. */
.srec-call-btn { margin-left: auto; }
.srec-call-btn i { width: 15px; height: 15px; }

/* Floating in-call panel (fixed, bottom-centre). */
.dialer-panel {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 240; animation: fade 0.15s var(--ease);
}
.dialer-panel.hidden { display: none; }
.dialer-card {
  min-width: 300px; max-width: 92vw; text-align: center;
  background: linear-gradient(180deg, #181410 0%, #120e0a 100%);
  border: 1px solid var(--gold-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px 18px;
  cursor: move; touch-action: none;   /* draggable by the body */
}
.dialer-panel.dragging { user-select: none; animation: none; }
.dialer-panel.dragging .dialer-card { cursor: grabbing; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); }
.dialer-card button { cursor: pointer; }   /* controls keep their own cursor */
.dialer-who {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem; font-weight: 600; color: var(--gold-bright); line-height: 1.2;
}
.dialer-num { font-size: 0.84rem; color: var(--ink-soft); margin-top: 2px; }
.dialer-status {
  font-size: 0.98rem; color: var(--ink); margin: 12px 0 15px;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.dialer-actions { display: flex; gap: 10px; justify-content: center; }
.dialer-mute.on { background: var(--bg-3); color: var(--gold-bright); }
.dialer-hang i { width: 16px; height: 16px; }

/* Phone numbers rendered as dial-through-Twilio buttons (no tel: link). Styled to
   look like subtle gold tappable text, matching the old number links. */
.phone-dial {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 600; color: var(--gold-bright); cursor: pointer;
}
.phone-dial .pd-num { text-decoration: underline dotted; text-decoration-color: var(--gold-line); text-underline-offset: 3px; }
.phone-dial:hover .pd-num { text-decoration-style: solid; text-decoration-color: var(--gold); }
.phone-dial .tag-ic { color: var(--gold); width: 14px; height: 14px; }
.phone-dial.pd-company { font-size: 0.92rem; }
.phone-dial.pd-contact { font-size: 0.84rem; flex: 0 0 auto; }

/* Fire power-dialer: real Hang up + dial-through phone in the focus grid. */
.fire-hang { padding: 12px 28px; font-size: 1rem; }
.fire-mute-btn { margin-left: auto; }
.fire-mute-btn.muted { opacity: 0.7; }
.fire-mute-btn i { width: 15px; height: 15px; }
.focus-phone-dial { font-weight: 600; }
.fire-countdown { color: var(--gold-bright); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Optional alternate ("other") number line on a lead. */
.srec-alt-block { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; font-size: 0.86rem; color: var(--ink-soft); flex-wrap: wrap; }
.srec-alt-block .tag-ic { color: var(--gold); width: 15px; height: 15px; }
.srec-alt-cap { color: var(--ink-faint); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.srec-alt-block input { max-width: 200px; }
