/* ================================================================
   LifeOS Design System
   ----------------------------------------------------------------
   Breakpoint convention (use only these values in @media queries):
     sm — max-width: 600px    (phone narrow)
     md — max-width: 900px    (phone/tablet → desktop boundary; primary)
     lg — max-width: 1200px   (desktop layout adjustments)
     xl — max-width: 1500px   (wide-desktop fine-tuning)
   The CSS @media spec doesn't accept custom-property values inside
   queries, so keep these as literal numbers. Don't introduce new
   one-off breakpoints without a clear visual reason.
   ================================================================ */
*,*::before,*::after{box-sizing:border-box;margin: 0;padding: 0;}

:root {
  /* ─── LifeOS Pacific palette (Phase 6, 2026-04-26) ─────────────────────
     Modern editorial dark theme. Atlantic Teal primary + Warm Amber accent
     for "earned/complete" actions. Replaces the legacy 3-theme system
     (cyan/green/purple/school still selectable one release for back-compat). */
  --bg:       #0A0F12;
  --surface:  #121A1F;
  --card:     #172025;
  --card-2:   #1C262C;
  --border:   rgba(255,255,255,0.07);
  --border-2: rgba(255,255,255,0.12);
  /* Header chrome background; predates Pacific palette but kept for visual
     continuity. Used by .app-header in css/topbar.css. */
  --header-bg: rgba(8,15,30,.92);

  /* Accent — Atlantic Teal */
  --accent:       #1F8A9C;
  --accent-dim:   rgba(31,138,156,0.14);
  --accent-glow:  rgba(31,138,156,0.10);
  --accent-hover: #25A0B5;
  --accent-active:#187181;

  /* Warm — for "earned/complete" CTAs. Sparingly. */
  --warm:         #D4A574;
  --warm-dim:     rgba(212,165,116,0.14);
  --gold:         #D4A574;
  --gold-dim:     rgba(212,165,116,0.14);

  /* Status (kept consistent — don't theme these) */
  --success:    #0fba79;
  --success-dim:rgba(15,186,121,.13);
  --danger:     #f03f3f;
  --danger-dim: rgba(240,63,63,.13);
  --warning:    #D4A574;

  /* Text */
  --text:       #E5EAEC;
  --text-muted: #8C9BA1;
  --text-dim:   #788591;  /* WCAG AA on charcoal (was #566267, 3.9:1) */

  /* Links — accent */
  --link:       #1F8A9C;
  --link-hover: #25A0B5;
  --link-dim:   rgba(31,138,156,0.14);

  /* Life Area colors — slightly desaturated to fit the editorial mood */
  --c-career:   #5b6ef5;
  --c-growth:   #0fba79;
  --c-family:   #f43f73;
  --c-marriage: #d946ef;
  --c-health:   #22c55e;
  --c-travel:   #0ea5e9;
  --c-finance:  #D4A574;
  --c-spirit:   #a855f7;

  /* Per-area dim tints (≈14% alpha) — used for section background washes,
     tile accents, and stripe glows. :root is the source-of-truth boundary
     where rgba primitives are permitted; every consumer reads via var(--*). */
  --c-finance-dim:   rgba(244,182,40,0.14);
  --c-marriage-dim:  rgba(217,70,239,0.14);
  --c-travel-dim:    rgba(14,165,233,0.14);
  --c-health-dim:    rgba(34,197,94,0.14);
  --c-career-dim:    rgba(91,110,245,0.14);
  --c-growth-dim:    rgba(15,186,121,0.14);
  --c-family-dim:    rgba(244,63,115,0.14);
  --c-spirit-dim:    rgba(168,85,247,0.14);

  /* Background ambient glows — subtle teal wash */
  --bg-glow-1: rgba(31,138,156,0.04);
  --bg-glow-2: rgba(212,165,116,0.02);
  --email-bg: #131c21;
  --email-text: #d8e0ec;

  /* Layout — Pacific bumps the radius scale (less boxy, more refined). */
  --sidebar-w:  240px;
  --header-h:   60px;
  --radius:     14px;
  --radius-sm:  10px;
  --radius-xs:  6px;
  /* Pay Down (2026-05-09): semantic alias for medium-radius surfaces — KPI
     cards, account rows, modals — that previously used `var(--r-md, 8px)`
     fallbacks. Resolves to --radius-sm so the existing fallbacks keep
     working until they're cleaned up separately. */
  --r-md:       var(--radius-sm);
  --shadow:     0 1px 3px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.22);
  --shadow-lg:  0 4px 12px rgba(0,0,0,0.4), 0 24px 64px rgba(0,0,0,0.35);

  /* Type scale — prefer these over hardcoded px in inline styles.
     Keep ≤ 8 tiers; resist expanding. */
  --fs-xxs:    10px;  /* micro labels, tags */
  --fs-xs:     11px;  /* meta, timestamps, badges */
  --fs-sm:     12px;  /* secondary text, stats */
  --fs-md:     13px;  /* default body in cards, help text */
  --fs-base:   14px;  /* primary body */
  --fs-lg:     16px;  /* emphasized body */
  --fs-xl:     18px;  /* subsection titles */
  --fs-2xl:    22px;  /* section / modal titles */
  --fs-display:32px;  /* hero numbers */

  /* Spacing scale — 4px base. Use var(--sp-N) in inline styles. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;

  /* Line heights */
  --lh-tight:   1.4;   /* labels, one-liners */
  --lh-normal:  1.55;  /* default body, forms */
  --lh-relaxed: 1.7;   /* narrative, help blocks */
}

/* ═══════════════════════ Themes ═══════════════════════ */

/* Pacific is the new default (defined in :root above). The block below
   exists so an explicit data-theme="pacific" still resolves correctly. */
[data-theme="pacific"] {
  /* Inherits from :root — explicit selector for clarity. */
}

[data-theme="cyan"] {
  --bg: #000000; --surface: #060a0f; --card: #0c1218; --card-2: #111a22;
  --border: #1a2530; --border-2: #223040;
  --accent: #2DC6F2; --accent-dim: rgba(45,198,242,.14); --accent-glow: rgba(45,198,242,.08);
  --accent-hover: #5dd6f5; --accent-active: #1aafdb;
  --gold: #f4b942; --gold-dim: rgba(244,185,66,.14);
  --success: #0fba79; --success-dim: rgba(15,186,121,.13);
  --danger: #f03f3f; --danger-dim: rgba(240,63,63,.13); --warning: #f4b942;
  --text: #e4edf4; --text-muted: #8aa0b8; --text-dim: #506878;
  --link: #2DC6F2; --link-hover: #6dd9f7; --link-dim: rgba(45,198,242,.14);
  --bg-glow-1: rgba(45,198,242,.06); --bg-glow-2: rgba(45,198,242,.03);
  --email-bg: #0f1a22; --email-text: #c8dce8;
}

[data-theme="green"] {
  --bg: #000000; --surface: #04080404; --card: #0a120c; --card-2: #111c14;
  --border: #1a2c1e; --border-2: #264030;
  --accent: #5ac53a; --accent-dim: rgba(90,197,58,.14); --accent-glow: rgba(90,197,58,.08);
  --accent-hover: #72d456; --accent-active: #48a82e;
  --gold: #f4b942; --gold-dim: rgba(244,185,66,.14);
  --success: #5ac53a; --success-dim: rgba(90,197,58,.13);
  --danger: #f03f3f; --danger-dim: rgba(240,63,63,.13); --warning: #f4b942;
  --text: #e4f0e6; --text-muted: #88b894; --text-dim: #507860;
  --link: #5ac53a; --link-hover: #7dd663; --link-dim: rgba(90,197,58,.14);
  --bg-glow-1: rgba(90,197,58,.06); --bg-glow-2: rgba(90,197,58,.03);
  --email-bg: #0c1610; --email-text: #c8e0cc;
}

[data-theme="purple"] {
  --bg: #000000; --surface: #070614; --card: #0e0d1e; --card-2: #16142a;
  --border: #222040; --border-2: #302d55;
  --accent: #7B71D4; --accent-dim: rgba(123,113,212,.14); --accent-glow: rgba(123,113,212,.08);
  --accent-hover: #948be0; --accent-active: #6358b8;
  --accent-deep: #524A9D;
  --gold: #f4b942; --gold-dim: rgba(244,185,66,.14);
  --success: #0fba79; --success-dim: rgba(15,186,121,.13);
  --danger: #f03f3f; --danger-dim: rgba(240,63,63,.13); --warning: #f4b942;
  --text: #e6e4f4; --text-muted: #9894c4; --text-dim: #686490;
  --link: #7B71D4; --link-hover: #9f97e0; --link-dim: rgba(123,113,212,.14);
  --bg-glow-1: rgba(123,113,212,.06); --bg-glow-2: rgba(82,74,157,.03);
  --email-bg: #12101e; --email-text: #d0cce4;
}
[data-theme="school"] {
  --bg: #000000; --surface: #060808; --card: #0c1210; --card-2: #141e1a;
  --border: #1e2e26; --border-2: #2a3e32;
  --gold: #f4b942; --gold-dim: rgba(244,185,66,.14);
  --success: #0fba79; --success-dim: rgba(15,186,121,.13);
  --danger: #f03f3f; --danger-dim: rgba(240,63,63,.13); --warning: #f4b942;
  --text: #e4f0e6; --text-muted: #88b894; --text-dim: #507860;
  --bg-glow-1: rgba(90,197,58,.06); --bg-glow-2: rgba(42,100,38,.03);
  --email-bg: #0a100c; --email-text: #c8dccb;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at top left, var(--bg-glow-1), transparent 50%),
    radial-gradient(ellipse at bottom right, var(--bg-glow-2), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: var(--lh-normal);
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Kill pull-to-refresh bounce and rubber-band scroll on iOS/Android so the
     whole app-shell doesn't drift away when the user scrolls a list. Inner
     scroll containers (content-area, modal-body) keep their own overscroll. */
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}
/* Prevent the root HTML from dragging with 2-finger or trackpad overscroll. */
html { overscroll-behavior: none; }

/* Hyperlinks — bright green for high contrast */
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

/* Typography baseline — all scale-aligned */
h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.4px; }
h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.2px; }
h3 { font-size: var(--fs-lg); font-weight: 700; }
h4 { font-size: var(--fs-base); font-weight: 700; }
p  { line-height: var(--lh-relaxed); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .22s cubic-bezier(.4, 0, .2, 1);
  overflow: visible;           /* so the edge toggle can stick out */
  position: relative;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .capture-btn span,
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .nav-icon { margin: 0; }
/* Sidebar scroll shouldn't clip the edge toggle. */
.sidebar-nav { overflow-y: auto; overflow-x: visible; }

/* Edge-pinned toggle — floating pill on the sidebar's right edge. Always
   visible whether the sidebar is open or collapsed, so the expand/collapse
   affordance is obvious. Chevron flips via CSS when .collapsed is set. */
.sidebar-toggle-edge {
  position: absolute;
  top: 72px;
  right: -14px;
  z-index: 20;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: color .15s, border-color .15s, background .15s, transform .2s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.sidebar-toggle-edge:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--card);
  transform: scale(1.08);
}
.sidebar-toggle-edge svg { transition: transform .22s cubic-bezier(.4, 0, .2, 1); }
.sidebar.collapsed .sidebar-toggle-edge svg { transform: rotate(180deg); }

/* Hover-to-peek (desktop only): when collapsed, briefly expand the sidebar
   on hover so the user can see labels without committing to expand. */
@media (hover: hover) and (pointer: fine) {
  .sidebar.collapsed:hover {
    width: var(--sidebar-w);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .25);
  }
  .sidebar.collapsed:hover .nav-label,
  .sidebar.collapsed:hover .capture-btn span,
  .sidebar.collapsed:hover .logo-text { display: inline; }
  .sidebar.collapsed:hover .sidebar-section-label,
  .sidebar.collapsed:hover .nav-section-label { display: block; }
  .sidebar.collapsed:hover .nav-item { justify-content: flex-start; }
  .sidebar.collapsed:hover .nav-icon { margin-right: var(--sp-3); }
}

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.5px; flex: 1; }
.logo-icon-svg { flex-shrink: 0; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: var(--fs-lg); padding: var(--sp-1); border-radius: var(--radius-xs); transition: color .15s; flex-shrink: 0; }
.sidebar-toggle:hover { color: var(--text); }

/* Compass: priority-walkthrough trigger next to the logo. Pulses when items
   are waiting; still clickable at 0 items (you can always re-scan). */
.compass-btn { position: relative; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 50%; cursor: pointer; flex-shrink: 0; padding: 0; transition: color .15s, border-color .15s, transform .08s ease; -webkit-tap-highlight-color: transparent; }
.compass-btn:hover { color: var(--accent); border-color: var(--accent); }
.compass-btn:active { transform: scale(0.94); }
.compass-btn.has-items { color: var(--accent); border-color: var(--accent); animation: compass-pulse 2.4s ease-in-out infinite; }
.compass-icon { display: block; }
.compass-btn.has-items .compass-icon { animation: compass-spin 18s linear infinite; transform-origin: center; }
.compass-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; line-height: 1; border: 2px solid var(--surface); }

@keyframes compass-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}
@keyframes compass-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--sp-2) 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section-label, .nav-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
}
.nav-item:hover { color: var(--text); background: var(--accent-glow); text-decoration: none; }
.nav-item.active { color: var(--accent); background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.phase2, .nav-item-dim { opacity: .55; }
.nav-icon { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-label { flex: 1; }
.nav-badge { background: var(--danger, #f43f73); color: #fff; border-radius: 10px; padding: 1px var(--sp-2); font-size: var(--fs-xxs); font-weight: 700; min-width: 16px; text-align: center; }

/* Left-edge urgency bar for nav items. Thin vertical stripe flush to the
   left side of the nav-item. A `data-state` attribute drives the color
   and animation:
     idle     → hidden
     ok       → green, slow calm glow (the target state — you're all clear)
     low      → green→yellow alternation (1-2 overdue, or soonest-due check-in today)
     mid      → yellow→red (3-4 overdue, or tomorrow-due)
     high     → red flashing (5+ overdue, or late)
   The nav-item already has box-shadow:inset-2px for .active state; we
   stack the urgency bar in the same column but don't conflict. */
.nav-item { position: relative; }
.nav-urgency-bar {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  border-radius: 3px; pointer-events: none; opacity: 0;
  transition: opacity .3s;
}
.nav-urgency-bar[data-state="idle"] { opacity: 0; }
.nav-urgency-bar[data-state="ok"]   { opacity: .9; background: #5ac53a; animation: nav-cue-ok 3s ease-in-out infinite; }
.nav-urgency-bar[data-state="low"]  { opacity: .95; background: linear-gradient(180deg, #5ac53a, #e8c444); animation: nav-cue-low 1.8s ease-in-out infinite; }
.nav-urgency-bar[data-state="mid"]  { opacity: 1; background: linear-gradient(180deg, #e8c444, #e8702f); animation: nav-cue-mid 1.2s ease-in-out infinite; }
.nav-urgency-bar[data-state="high"] { opacity: 1; background: #e8412f; animation: nav-cue-high 0.7s ease-in-out infinite; box-shadow: 0 0 10px rgba(232,65,47,0.6); }

@keyframes nav-cue-ok {
  0%,100% { box-shadow: 0 0 6px rgba(90,197,58,.55); }
  50%     { box-shadow: 0 0 14px rgba(90,197,58,.85); }
}
@keyframes nav-cue-low {
  0%,100% { background: #5ac53a; box-shadow: 0 0 8px rgba(90,197,58,.8); }
  50%     { background: #e8c444; box-shadow: 0 0 10px rgba(232,196,68,.8); }
}
@keyframes nav-cue-mid {
  0%,100% { background: #e8c444; box-shadow: 0 0 10px rgba(232,196,68,.85); }
  50%     { background: #e8702f; box-shadow: 0 0 12px rgba(232,112,47,.9); }
}
@keyframes nav-cue-high {
  0%,100% { opacity: 1; box-shadow: 0 0 10px rgba(232,65,47,.7); }
  50%     { opacity: .4; box-shadow: 0 0 14px rgba(232,65,47,.95); }
}

/* Mobile: show the urgency bars as a dot on the bottom-tab icon too.
   Simpler footprint on small screens where a 3px stripe is hard to see. */
@media (max-width: 900px) {
  .nav-urgency-bar { left: 2px; top: 8px; bottom: 8px; width: 3px; }
}

.sidebar-footer { padding: var(--sp-3); border-top: 1px solid var(--border); flex-shrink: 0; }
.capture-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, transform .1s;
}
.capture-btn:hover { background: var(--accent-active); transform: translateY(-1px); }
.capture-btn .capture-icon { font-size: 15px; }

/* Main area */
.main-area, .main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* .app-header / .header-left / .header-right / .header-title moved to
   css/topbar.css (shared) per ui-platform-convention.md (css_only_split). */
.content-area { flex: 1; overflow-y: auto; overflow-x: hidden; width: 100%; min-width: 0; }
.breadcrumb { flex: 1; font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.breadcrumb-sub { font-size: var(--fs-base); color: var(--text-muted); font-weight: 400; margin-left: var(--sp-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.key-status { font-size: var(--fs-xs); font-weight: 600; padding: var(--sp-1) var(--sp-3); border-radius: 20px; cursor: pointer; border: 1px solid; transition: all .15s; }
.key-ok  { border-color: rgba(15,186,121,.4); color: var(--success); background: rgba(15,186,121,.08); }
.key-bad { border-color: rgba(244,185,66,.4);  color: var(--gold);    background: rgba(244,185,66,.08); }
.btn-icon { width:38px; height:38px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--surface); color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:15px; transition:all .15s; }
.btn-icon:hover { color:var(--text); border-color:var(--accent); }

#content { flex: 1; overflow-y: auto; }
#content::-webkit-scrollbar { width: 5px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── COMPONENTS ──────────────────────────────────────────────── */
/* Buttons */
.btn { padding: var(--sp-2) var(--sp-4); border-radius:var(--radius-sm); border:none; cursor:pointer; font-size:var(--fs-base); font-weight:600; transition:all .15s; display:inline-flex; align-items:center; gap:var(--sp-2); letter-spacing:.1px; }
.btn-primary   { background:var(--accent); color:#fff; box-shadow: 0 2px 8px rgba(91,110,245,.25); }
.btn-primary:hover { background:var(--accent-hover); transform:translateY(-1px); box-shadow: 0 4px 12px rgba(91,110,245,.35); }
.btn-secondary { background:var(--card); color:var(--text); border:1px solid var(--border); }
.btn-secondary:hover { border-color:var(--accent); color:var(--accent); }
.btn-ghost  { background:none; color:var(--text-muted); border:1px solid transparent; }
.btn-ghost:hover { color:var(--text); background:var(--card); }
.btn-danger { background:var(--danger-dim); color:var(--danger); border:1px solid rgba(240,63,63,.3); }
.btn-danger:hover { background:rgba(240,63,63,.2); }
.btn-gold, .btn-accent { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(244,185,66,.3); }
.btn-gold:hover, .btn-accent:hover { background:rgba(244,185,66,.2); }
.btn-sm { padding: var(--sp-2) var(--sp-3); font-size:var(--fs-md); }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size:var(--fs-lg); }
.btn-full { width:100%; justify-content:center; }
.btn-icon-sm { width:32px; height:32px; border-radius:var(--radius-xs); border:1px solid var(--border); background:var(--surface); color:var(--text-muted); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; font-size: var(--fs-md); transition:all .15s; }
.btn-icon-sm:hover { color:var(--text); border-color:var(--accent); }

/* Cards */
.card, .dashboard-card, .settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.card-sm { padding: var(--sp-4); }
.card:hover { border-color: var(--border-2); }
.card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--sp-5); padding-bottom: var(--sp-4); border-bottom:1px solid var(--border); }
.card-title { font-size:var(--fs-lg); font-weight:700; color:var(--text); letter-spacing:-.1px; }
.card-subtitle { font-size:var(--fs-md); color:var(--text-muted); margin-top: var(--sp-1); font-weight:500; }

/* Section primitive — used on pages to segment content */
.section { margin-bottom: var(--sp-7); }
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--sp-4); gap:var(--sp-3); flex-wrap:wrap; }
.section-title { font-size: var(--fs-xl); font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 18px; background: var(--accent); border-radius: 2px; vertical-align: middle; margin-right: var(--sp-3); margin-bottom: var(--sp-1); }
.section-subtitle { font-size: var(--fs-base); color:var(--text-muted); margin-top: var(--sp-1); }
.section-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* Forms */
.form-group { margin-bottom: var(--sp-5); }
.form-label { display:block; font-size:var(--fs-sm); font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; margin-bottom: var(--sp-2); }
.form-label.required::after { content:' *'; color:var(--danger); }
.form-input, .form-select, .form-textarea, .form-control {
  width:100%; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text); padding: var(--sp-3);
  /* 16px unconditionally — prevents iOS Safari auto-zoom on focus */
  font-size: 16px; outline:none; transition:border-color .15s, box-shadow .15s; font-family:inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .form-control:focus {
  border-color:var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control-lg { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-lg); }
.form-control-sm { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-md); }
.form-input::placeholder, .form-textarea::placeholder, .form-control::placeholder { color:var(--text-dim); }
/* WebKit's date/time picker icons draw as a dark glyph by default — invisible
   against the app's dark background. Invert + tint so they read as light-gray
   across all themes, brighten on hover. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.85);
  opacity: 0.75;
  cursor: pointer;
  padding: 2px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="week"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.form-select option, .form-control option { background:var(--surface); }
.form-textarea, textarea.form-control { resize:vertical; min-height:80px; line-height:var(--lh-normal); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-4); }
.form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:var(--sp-3); }
.form-hint { font-size:var(--fs-sm); color:var(--text-dim); margin-top: var(--sp-1); line-height:var(--lh-relaxed); }
.form-section-label { font-size: var(--fs-sm); font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.6px; margin: var(--sp-5) 0 var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.form-section-label:first-child { border-top: none; padding-top: 0; margin-top: 0; }

/* Badges */
.badge { display:inline-flex; align-items:center; gap:3px; padding: var(--sp-1) var(--sp-2); border-radius:20px; font-size:var(--fs-sm); font-weight:600; }
.badge-accent  { background:var(--accent-dim); color:var(--accent); border:1px solid rgba(91,110,245,.25); }
.badge-success { background:var(--success-dim); color:var(--success); border:1px solid rgba(15,186,121,.25); }
.badge-danger  { background:var(--danger-dim); color:var(--danger); border:1px solid rgba(240,63,63,.25); }
.badge-warning { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(244,185,66,.25); }
.badge-muted   { background:rgba(139,163,194,.1); color:var(--text-muted); border:1px solid rgba(139,163,194,.2); }
.badge-gold    { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(244,185,66,.3); }

/* Priority badges */
.priority-high   { background:rgba(240,63,63,.12); color:#f87171; border:1px solid rgba(240,63,63,.25); }
.priority-medium { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(244,185,66,.25); }
.priority-low    { background:var(--success-dim); color:var(--success); border:1px solid rgba(15,186,121,.25); }

/* PARA badges */
.para-project  { background:rgba(91,110,245,.12); color:#818cf8; border:1px solid rgba(91,110,245,.25); }
.para-area     { background:rgba(15,186,121,.12); color:#34d399; border:1px solid rgba(15,186,121,.25); }
.para-resource { background:rgba(244,185,66,.12); color:#fbbf24; border:1px solid rgba(244,185,66,.25); }
.para-archive  { background:rgba(139,163,194,.1); color:var(--text-muted); border:1px solid rgba(139,163,194,.2); }

/* Leverage badge */
.leverage, .leverage-badge { font-size: var(--fs-sm); font-weight:700; padding: var(--sp-1) 9px; border-radius:var(--radius-xs); letter-spacing:.2px; }
.energy-badge { font-size: var(--fs-base); padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-xs); }
.energy-charging { background: rgba(15, 186, 121, 0.15); }
.energy-draining { background: rgba(244, 185, 66, 0.15); }

/* ═══════════════════════ Weekly Scorecard ═══════════════════════ */
.weekly-scorecard {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
}
.sc-header h3 { font-size: var(--fs-lg); font-weight: 700; color: var(--text); margin: 0; }
.sc-period { font-size: var(--fs-md); color: var(--text-muted); }
.sc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.sc-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.sc-value.sc-warn { color: var(--warning); }
.sc-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sc-detail {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.sc-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--sp-1);
}
.sc-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
@media (max-width: 900px) {
  .sc-grid { grid-template-columns: repeat(2, 1fr); }
}
.leverage-high   { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(244,185,66,.3); }
.leverage-medium { background:var(--accent-dim); color:var(--accent); border:1px solid rgba(91,110,245,.3); }
.leverage-low    { background:rgba(139,163,194,.1); color:var(--text-dim); border:1px solid rgba(139,163,194,.2); }

/* PARA badge alias */
.para-badge { display:inline-flex; align-items:center; padding: var(--sp-1) 9px; border-radius:var(--radius-xs); font-size: var(--fs-xs); font-weight:700; text-transform:uppercase; letter-spacing:.5px; }

/* Tabs */
.tabs { display:flex; gap:2px; border-bottom:1px solid var(--border); margin-bottom: var(--sp-6); }
.tab-btn, .tab { padding: 11px var(--sp-6); border:none; background:none; color:var(--text-muted); font-size:15px; font-weight:600; cursor:pointer; border-bottom:2px solid transparent; margin-bottom: -1px; transition:all .15s; }
.tab-btn:hover, .tab:hover { color:var(--text); }
.tab-btn.active, .tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-pane { display:none; }
.tab-pane.active { display:block; }

/* Modal */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.7); z-index:400; display:none; align-items:center; justify-content:center; padding: var(--sp-5); backdrop-filter:blur(6px); }
.modal-overlay.open { display:flex; }
/* Body scroll lock while a modal is open. top:-Ypx is set by JS to preserve
   scroll position; removed on close and scroll is restored. */
body.modal-open { position: fixed; width: 100%; overflow: hidden; }
.modal { background:var(--surface); border:1px solid var(--border); border-radius:16px; width:100%; max-width:600px; max-height:90vh; display:flex; flex-direction:column; animation:modalIn .18s ease; box-shadow:var(--shadow-lg); }
.modal-lg { max-width:800px; }
@keyframes modalIn { from{opacity:0;transform:translateY(-12px);}to{opacity:1;transform:none;} }
.modal-header { padding: var(--sp-5) var(--sp-6); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.modal-header h3, .modal-title { font-size:var(--fs-xl); font-weight:700; letter-spacing:-.2px; }
.modal-close { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:20px; padding: var(--sp-1) var(--sp-2); border-radius:4px; }
.modal-close:hover { color:var(--text); }
.modal-body { padding: var(--sp-6); overflow-y:auto; }
.modal-footer { padding: var(--sp-4) var(--sp-6); border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:var(--sp-3); flex-shrink:0; background: rgba(0,0,0,.15); border-radius: 0 0 16px 16px; }

/* Toast */
.toast-wrap { position:fixed; bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); right:var(--sp-5); z-index:1000; display:flex; flex-direction:column; gap:var(--sp-2); }
.toast { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); font-weight:500; display:flex; align-items:center; gap:var(--sp-2); animation:toastIn .2s ease; box-shadow:var(--shadow); max-width:340px; }
@keyframes toastIn { from{transform:translateX(110%);opacity:0;}to{transform:none;opacity:1;} }
.toast.success { border-left:3px solid var(--success); }
.toast.info    { border-left:3px solid var(--accent); }
.toast.warn    { border-left:3px solid var(--gold); }
.toast.error   { border-left:3px solid var(--danger); }

/* Misc */
.divider { height:1px; background:var(--border); margin: var(--sp-4) 0; }
.empty-icon  { font-size:44px; margin-bottom: var(--sp-3); }
.spinner { width:32px; height:32px; border:3px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-center { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding: 60px; color:var(--text-muted); }

/* Scrollbar */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

/* ── PAGE LAYOUTS ─────────────────────────────────────────────── */
.page, .page-layout { padding: var(--sp-7) var(--sp-7); max-width: none; width: 100%; }
.page-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom: var(--sp-7); gap:var(--sp-4); padding-bottom: var(--sp-5); border-bottom:1px solid var(--border); }
.page-title { font-size:var(--fs-2xl); font-weight:800; letter-spacing:-.4px; }
.page-subtitle { font-size:var(--fs-base); color:var(--text-muted); margin-top: var(--sp-1); }
.page-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }

.two-col { display:grid; grid-template-columns:300px 1fr; gap:24px; }
.three-col { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; }

/* Text helpers */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }

/* Status pills */
.status-text { font-size: var(--fs-md); font-weight: 500; margin-left: var(--sp-2); }
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }
.indicator-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right: var(--sp-2); vertical-align: middle; }
.dot-success { background: var(--success); box-shadow: 0 0 6px rgba(15,186,121,.5); }
.dot-error { background: var(--danger); }
.api-key-indicator, .gcal-indicator { display:flex; align-items:center; font-size: var(--fs-sm); color:var(--text-muted); padding: var(--sp-1) var(--sp-3); background: var(--card); border: 1px solid var(--border); border-radius: 20px; }

/* ── SETUP SCREEN ────────────────────────────────────────────── */
.setup-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; min-height:100dvh; padding: var(--sp-6); }
.setup-card { background:var(--card); border:1px solid var(--border); border-radius:20px; padding: 48px; max-width:480px; width:100%; text-align:center; }
.setup-logo { font-size:52px; margin-bottom: var(--sp-4); }
.setup-card h1 { font-size:28px; font-weight:800; margin-bottom: var(--sp-2); }
.setup-card p  { color:var(--text-muted); margin-bottom: var(--sp-7); font-size: var(--fs-base); }
.setup-hint { font-size: var(--fs-xs); color:var(--text-dim); margin-top: var(--sp-2); }

/* ── DASHBOARD ───────────────────────────────────────────────── */
.dashboard-layout { padding: var(--sp-7) var(--sp-7); max-width: none; width: 100%; }

/* Top row (welcome + weather) — compact */
.dashboard-area-top {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
}
.dashboard-hero {
  position: relative;
  background-color: var(--card);
  background-image:
    linear-gradient(135deg, rgba(10,15,18,0.88) 0%, rgba(10,15,18,0.55) 50%, rgba(10,15,18,0.30) 100%);
  background-size: cover;
  background-position: center;
  border: 0;
  border-radius: var(--radius);
  padding: var(--sp-6) var(--sp-7);
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.hero-greeting h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.hero-name { color: var(--warm); -webkit-text-fill-color: var(--warm); background: none; }
.hero-date { color: var(--text-muted); font-size: var(--fs-lg); margin-top: var(--sp-2); font-weight: 500; }
/* 3D greeting hero slot — Three.js canvas sizes to fill this. The element
   takes the right column of the dashboard-hero grid (1.3fr); height is
   driven by the greeting column's natural height + a sensible min so the
   scene has room to breathe. */
.hero-3d {
  position: relative;
  width: 100%;
  min-height: 220px;
  aspect-ratio: 1.3 / 1;
  pointer-events: none;
  /* Fade the canvas in once Three.js mounts to avoid a one-frame flash */
  opacity: 0;
  animation: hero3dFadeIn .6s .2s ease forwards;
}
@keyframes hero3dFadeIn { to { opacity: 1; } }
@media (max-width: 900px) {
  /* On mobile the hero collapses to single column — keep 3D scene but
     shorten so it doesn't push tasks too far down. */
  .hero-3d { min-height: 140px; aspect-ratio: 16/9; }
}

.weather-card-compact { display: flex; flex-direction: column; justify-content: center; padding: var(--sp-4) var(--sp-5) !important; }
.weather-card-compact .card-header { margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); }
.weather-card-compact .card-title { font-size: var(--fs-base) !important; }
.weather-card-compact .weather-current { gap: 14px; margin-bottom: var(--sp-2); }
.weather-card-compact .weather-emoji { font-size: 44px; }
.weather-card-compact .weather-temp { font-size: var(--fs-display); font-weight: 800; }
.weather-card-compact .weather-label { font-size: var(--fs-md); }
.weather-card-compact .weather-meta { font-size: var(--fs-sm); padding-top: var(--sp-2); }
.weather-tap-hint { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-2); text-align: center; }

/* Weather ambient visuals */
.weather-vibe {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  border-radius: inherit; z-index: 0;
}
#weather-body { position: relative; z-index: 1; }

/* Clear / Sunny — bold warm glow + pulsing sun */
.weather-vibe-clear {
  background: radial-gradient(circle at 80% 15%, rgba(250,204,21,.35) 0%, rgba(251,146,60,.1) 40%, transparent 70%);
}
.weather-vibe-clear::before {
  content: ''; position: absolute; top: -30%; right: -15%; width: 90%; height: 90%;
  background: radial-gradient(circle, rgba(250,204,21,.3) 0%, rgba(251,146,60,.08) 50%, transparent 70%);
  animation: sunPulse 4s ease-in-out infinite;
}
.weather-vibe-clear::after {
  content: ''; position: absolute; top: 5%; right: 8%; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(250,204,21,.2);
  box-shadow: 0 0 30px rgba(250,204,21,.4), 0 0 60px rgba(250,204,21,.2);
  animation: sunPulse 4s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Partly cloudy — sun glow + prominent drifting clouds */
.weather-vibe-partly {
  background: radial-gradient(circle at 80% 20%, rgba(250,204,21,.2) 0%, transparent 50%);
}
.weather-vibe-partly::before, .weather-vibe-partly::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(200,210,220,.2);
  box-shadow: 20px 5px 0 rgba(200,210,220,.15), -15px 8px 0 rgba(200,210,220,.12);
}
.weather-vibe-partly::before {
  width: 90px; height: 35px; top: 12%; left: -25%;
  animation: cloudDrift 10s linear infinite;
}
.weather-vibe-partly::after {
  width: 70px; height: 28px; top: 50%; left: -20%;
  animation: cloudDrift 16s linear infinite 3s;
}
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100% + 250px)); }
}

/* Overcast — heavy layered clouds */
.weather-vibe-cloudy {
  background: linear-gradient(180deg, rgba(100,116,139,.2) 0%, rgba(71,85,105,.08) 60%, transparent 100%);
}
.weather-vibe-cloudy::before, .weather-vibe-cloudy::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(100,116,139,.18);
  box-shadow: 25px 5px 0 rgba(100,116,139,.14), -20px 8px 0 rgba(100,116,139,.1);
}
.weather-vibe-cloudy::before { width: 120px; height: 40px; top: 8%; animation: cloudDrift 14s linear infinite; }
.weather-vibe-cloudy::after { width: 90px; height: 32px; top: 40%; animation: cloudDrift 20s linear infinite 5s; }

/* Fog — thick misty bands */
.weather-vibe-fog {
  background: linear-gradient(180deg, rgba(148,163,184,.25) 0%, rgba(148,163,184,.1) 50%, transparent 100%);
}
.weather-vibe-fog::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, rgba(148,163,184,.15) 4px, transparent 8px);
  animation: fogShift 6s ease-in-out infinite;
}
.weather-vibe-fog::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, rgba(148,163,184,.1) 6px, transparent 12px);
  animation: fogShift 9s ease-in-out infinite 2s;
}
@keyframes fogShift { 0%,100% { opacity: .4; transform: translateX(-5px); } 50% { opacity: 1; transform: translateX(5px); } }

/* Rain — visible falling streaks */
.weather-vibe-rain {
  background: linear-gradient(180deg, rgba(59,130,246,.15) 0%, rgba(30,64,175,.05) 100%);
}
.weather-vibe-rain::before, .weather-vibe-rain::after {
  content: ''; position: absolute; top: -20%; width: 100%; height: 140%;
  background-image:
    linear-gradient(180deg, rgba(96,165,250,.5) 0%, transparent 70%),
    linear-gradient(180deg, rgba(96,165,250,.4) 0%, transparent 55%),
    linear-gradient(180deg, rgba(147,197,253,.35) 0%, transparent 60%);
  background-size: 2px 16px, 1.5px 12px, 1px 10px;
  background-position: 15% 0, 45% 8px, 75% 3px;
  background-repeat: repeat;
  animation: rainFall .7s linear infinite;
  opacity: .7;
}
.weather-vibe-rain::after { animation-delay: .35s; background-position: 30% 5px, 60% 0, 90% 10px; opacity: .5; }
@keyframes rainFall { from { transform: translateY(-16px); } to { transform: translateY(16px); } }

/* Snow — prominent falling flakes */
.weather-vibe-snow {
  background: linear-gradient(180deg, rgba(226,232,240,.15) 0%, rgba(203,213,225,.05) 100%);
}
.weather-vibe-snow::before, .weather-vibe-snow::after {
  content: ''; position: absolute; top: -15%; width: 100%; height: 130%;
  background-image:
    radial-gradient(3px 3px at 10% 25%, rgba(255,255,255,.7) 50%, transparent 50%),
    radial-gradient(2.5px 2.5px at 30% 55%, rgba(255,255,255,.6) 50%, transparent 50%),
    radial-gradient(2px 2px at 55% 15%, rgba(255,255,255,.5) 50%, transparent 50%),
    radial-gradient(3px 3px at 75% 45%, rgba(255,255,255,.6) 50%, transparent 50%),
    radial-gradient(2px 2px at 90% 70%, rgba(255,255,255,.5) 50%, transparent 50%);
  background-size: 50px 50px;
  animation: snowFall 2.5s linear infinite;
  opacity: .8;
}
.weather-vibe-snow::after { animation-delay: 1.2s; animation-duration: 3.5s; opacity: .6;
  background-position: 5px 5px; }
@keyframes snowFall { from { transform: translateY(-25px) translateX(-3px); } to { transform: translateY(25px) translateX(3px); } }

/* Storm — heavy rain + bright lightning flashes */
.weather-vibe-storm {
  background: linear-gradient(180deg, rgba(99,102,241,.15) 0%, rgba(30,27,75,.1) 100%);
}
.weather-vibe-storm::before {
  content: ''; position: absolute; top: -20%; width: 100%; height: 140%;
  background-image:
    linear-gradient(180deg, rgba(96,165,250,.5) 0%, transparent 65%),
    linear-gradient(180deg, rgba(129,140,248,.4) 0%, transparent 55%);
  background-size: 2px 18px, 1.5px 14px;
  background-position: 20% 0, 55% 6px;
  background-repeat: repeat;
  animation: rainFall .6s linear infinite; opacity: .8;
}
.weather-vibe-storm::after {
  content: ''; position: absolute; inset: 0;
  animation: lightning 4s ease-in-out infinite;
  background: transparent;
}
@keyframes lightning {
  0%,88%,100% { background: transparent; }
  89% { background: rgba(255,255,255,.2); }
  90% { background: transparent; }
  91% { background: rgba(255,255,255,.15); }
  92% { background: rgba(255,255,255,.05); }
  93% { background: transparent; }
}

#weather-card.weather-expanded .weather-vibe { display: none; }

/* Weather 7-day forecast — slide expand */
.dashboard-area-top { transition: grid-template-columns .4s cubic-bezier(.4,0,.2,1); }
.dashboard-area-top.weather-expanded { grid-template-columns: 0fr 1fr; }
.dashboard-area-top.weather-expanded .dashboard-hero { opacity: 0; overflow: hidden; pointer-events: none; transition: opacity .3s; }
.dashboard-hero { transition: opacity .3s; }

#weather-card { transition: all .4s cubic-bezier(.4,0,.2,1); position: relative; overflow: hidden; }
#weather-card.weather-expanded { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }

.weather-forecast-panel { display: none; }
#weather-card.weather-expanded .weather-forecast-panel { display: block; }
#weather-card.weather-expanded #weather-body { display: none; }
#weather-card.weather-expanded .card-header { display: none; }
#weather-card.weather-expanded .weather-tap-hint { display: none; }

.weather-forecast-content { padding: var(--sp-1) 0; }
.weather-forecast-title {
  font-size: var(--fs-md); font-weight: 700; color: var(--accent); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: var(--sp-3); text-align: center;
}
.weather-forecast-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.weather-forecast-day {
  text-align: center; padding: var(--sp-2) var(--sp-1); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: border-color .2s;
  min-width: 0; overflow: hidden;
}
.weather-forecast-day:hover { border-color: var(--accent); }
.weather-forecast-today { border-color: var(--accent); background: var(--accent-dim); }
.weather-forecast-dayname { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.weather-forecast-icon { font-size: var(--fs-2xl); line-height: 1.2; }
.weather-forecast-temps { font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.weather-forecast-lo { color: var(--text-dim); font-weight: 400; margin-left: var(--sp-1); }
.weather-forecast-precip { font-size: var(--fs-xxs); color: var(--text-muted); }

@media (max-width: 600px) {
  .dashboard-area-top.weather-expanded { grid-template-columns: 1fr; }
  .dashboard-area-top.weather-expanded .dashboard-hero { display: none; }
  .weather-forecast-dayname { font-size: var(--fs-xxs); }
  .weather-forecast-icon { font-size: var(--fs-xl); }
  .weather-forecast-temps { font-size: var(--fs-xs); }
}

/* Stats bar — 1×4 with prominent numbers (fixed content, no list growth) */
.stats-bar { display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-item { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding: var(--sp-5); text-align:center; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; justify-content: center; }
.stat-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat-value, .stat-val { display:block; font-size: 34px; font-weight: 800; color: var(--text); letter-spacing: -.5px; line-height: 1.1; }
.stat-label { display:block; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-2); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }

/* Dashboard edit-layout toolbar */
.dashboard-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-3);
}

/* ── Per-tile state classes (D1, refactor 2026-05-07) ────────────── */
/* Tile lifecycle states emitted by the orchestrator + per-tile components.
   The orchestrator adds .tile-mounting on initial DOM insertion, then swaps
   to .tile-mounted on the next animation frame so the transition fires.
   Per-tile components emit .tile-loading / .tile-empty / .tile-error inside
   their body slot to communicate state without breaking the .dashboard-card
   chrome. */

.tile-mounting {
  opacity: 0;
  transform: translateY(8px);
}
.tile-mounted {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .35s ease-out, transform .35s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .tile-mounting, .tile-mounted {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Loading skeleton — shimmer overlay while a tile bootstraps. Tiles use
   tileSkeleton() from _tile-helpers.js to render this shape. */
.tile-loading {
  position: relative;
  min-height: 80px;
  overflow: hidden;
}
.tile-loading .tile-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent-glow) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: tileShimmer 1.4s ease-in-out infinite;
  opacity: .35;
}
@keyframes tileShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state — explicit "nothing to show here" treatment per D1. Tiles
   render their own empty content inside this; class signals the intent so
   the styling reads as "deliberate absence" rather than a broken card. */
.tile-empty {
  padding: var(--sp-3) var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* Error state — a tile's render or afterMount threw; orchestrator + adapter
   render this rather than letting one bad tile crash the dashboard. */
.tile-error {
  padding: var(--sp-3) var(--sp-3);
  color: var(--warning);
  font-size: var(--fs-sm);
  border-left: 3px solid var(--warning);
}

/* Edit mode styling */
.dashboard-editing { padding: var(--sp-1); background: var(--accent-glow); border-radius: var(--radius); }
.dashboard-editing [data-tile-id] {
  cursor: grab;
  border-color: var(--accent);
  border-style: dashed;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.dashboard-editing [data-tile-id]:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dashboard-editing [data-tile-id]::before {
  content: '⋮⋮';
  position: absolute;
  top: 8px;
  left: 8px;
  color: var(--accent);
  font-size: var(--fs-lg);
  font-weight: 900;
  letter-spacing: -2px;
  opacity: .6;
  pointer-events: none;
}
/* While editing, suppress mount-fade transition so a tile re-rendering
   mid-drag (defensive — orchestrator suspends updates anyway) does not
   visibly fade in under the user's cursor. */
.dashboard-editing [data-tile-id].tile-mounting,
.dashboard-editing [data-tile-id].tile-mounted {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.dashboard-editing [data-tile-id].dragging { opacity: .4; cursor: grabbing; }
.dashboard-editing [data-tile-id].drag-over { border-color: var(--link); border-style: solid; box-shadow: 0 0 0 3px var(--link-dim); }

/* Main area: stacked rows now that Current Events is archived. The right
   420px column previously reserved for the news rail is gone, so welcome+
   weather, stats, and the editable card grid each stretch the full width
   of the page-layout. */
.dashboard-main-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 16px 20px;
  align-items: stretch;
}
.dashboard-area-top   { grid-column: 1; grid-row: 1; min-width: 0; }
.dashboard-area-stats { grid-column: 1; grid-row: 2; margin-bottom: 0 !important; min-width: 0; }
.dashboard-area-grid  { grid-column: 1; grid-row: 3; min-width: 0; }

/* Editable grid: caps at 3 columns max */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  grid-auto-flow: dense;
}
.dashboard-grid .span-2 { grid-column: span 2; }
.dashboard-grid .span-3 { grid-column: 1 / -1; }

/* News column responsive shrink rules archived 2026-04-26 along with
   Current Events. The dashboard-main-area is single-column at every width;
   only the inner .dashboard-grid card matrix shrinks (3→2→1). */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .dashboard-area-top { grid-template-columns: 1fr; }
  .dashboard-hero { grid-template-columns: 1fr; gap: 16px; padding: var(--sp-4) var(--sp-5); }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2 { grid-column: 1 / -1; }
}
.card-link { font-size: var(--fs-md); color: var(--link); font-weight: 600; }
.card-link:hover { color: var(--link-hover); }
.card-action-btn {
  margin-left: auto;
  margin-right: var(--sp-2);
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: var(--fs-md);
  padding: 0 var(--sp-1);
  cursor: pointer;
  line-height: 1;
}
.card-action-btn:hover { color: var(--text); }
.gold-dot { color: var(--gold); margin-right: var(--sp-1); }

.vital-task { display:flex; align-items:center; gap:12px; padding: var(--sp-4); background:var(--card-2); border-radius:var(--radius-sm); border:1px solid var(--border); margin-bottom: var(--sp-3); cursor:pointer; transition:border-color .15s, background .15s; justify-content: space-between; }
.vital-task:hover { border-color:var(--gold); background: rgba(244,185,66,.04); }
.vital-task-main { display:flex; align-items:center; gap:12px; flex:1; min-width:0; }
.vital-task-info { flex: 1; min-width: 0; }
.vital-task-title { font-size:15px; font-weight:600; color: var(--text); }
.vital-task-project { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.vital-task-meta { display:flex; align-items:center; gap: 8px; flex-shrink: 0; }

.habit-check-row, .today-habit-row { display:flex; align-items:center; gap:12px; padding: var(--sp-3) var(--sp-1); border-bottom: 1px solid var(--border); transition: background .15s; }
.habit-check-row:last-child, .today-habit-row:last-child { border-bottom: none; }
.habit-check-row.done, .today-habit-row.done { opacity: .6; }
.habit-check-info, .today-habit-info { flex: 1; min-width: 0; }
.habit-check-name, .today-habit-name { font-size: 15px; font-weight: 600; }
.habit-check-identity { font-size: var(--fs-sm); color: var(--text-muted); font-style: italic; margin-top: var(--sp-1); }
.habit-check-streak, .today-habit-streak { display:flex; align-items:center; gap:4px; font-size: var(--fs-base); font-weight: 700; color: var(--gold); }
.streak-num { font-size: var(--fs-xl); }
.streak-flame, .streak-flame-sm { font-size: var(--fs-base); }

/* Projects list (single-page redesign) */
.projects-list { display: flex; flex-direction: column; gap: 10px; }
.project-row { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); display: flex; justify-content: space-between; align-items: center; gap: 14px; transition: border-color .15s, transform .15s; }
.project-row:hover { border-color: var(--accent); transform: translateX(2px); }
.project-row-main { flex: 1; min-width: 0; }
.project-row-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.project-row-title { font-size: var(--fs-lg); font-weight: 700; }
.priority-pill { font-size: var(--fs-xs); font-weight: 800; padding: var(--sp-1) var(--sp-2); border-radius: 10px; border: 1.5px solid; letter-spacing: .3px; }
.area-pill { font-size: var(--fs-xs); font-weight: 700; padding: var(--sp-1) 9px; border-radius: 10px; border: 1.5px solid; display: inline-flex; align-items: center; gap: 4px; }
.project-row-next { font-size: var(--fs-md); color: var(--gold); margin-bottom: var(--sp-2); }
.project-row-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: var(--fs-xs); padding: var(--sp-1) var(--sp-2); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); }
.chip-danger { color: var(--danger); border-color: rgba(240,63,63,.3); background: var(--danger-dim); }
.project-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.project-row { cursor: pointer; }
.project-detail-task {
  display: flex; align-items: flex-start; gap: 10px;
  padding: var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.project-detail-task:hover { background: var(--accent-glow); }
.project-detail-task:last-child { border-bottom: none; }
.project-detail-task-status { font-size: var(--fs-lg); flex-shrink: 0; margin-top: 1px; }
.archived-section { margin-top: var(--sp-6); border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.archived-section summary { font-size: var(--fs-md); color: var(--text-muted); cursor: pointer; font-weight: 600; }

/* Tasks view (with top filter chips) */
.tasks-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.filter-chip { padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.next-action-bar { padding: var(--sp-3) var(--sp-4); background: var(--gold-dim); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); font-size: var(--fs-md); color: var(--gold); font-weight: 600; margin-bottom: var(--sp-4); }

/* Dashboard task rows */
.dash-task-row { display: flex; align-items: center; gap: 12px; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.dash-task-row:last-child { border-bottom: none; }
.dash-task-main { flex: 1; min-width: 0; }
.dash-task-title { font-size: var(--fs-base); font-weight: 600; }
.dash-task-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-1); display: flex; gap: 8px; flex-wrap: wrap; }
.do-badge { background: var(--accent-dim); color: var(--accent); padding: var(--sp-1) var(--sp-2); border-radius: 10px; font-weight: 600; }
.deadline-badge { background: var(--gold-dim); color: var(--gold); padding: var(--sp-1) var(--sp-2); border-radius: 10px; font-weight: 600; }
.deadline-badge.overdue { background: var(--danger-dim); color: var(--danger); }
.do-chip { background: var(--accent-dim); color: var(--accent) !important; border-color: rgba(91,110,245,.3) !important; }

/* Weather card */
.weather-current { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-2); }
.weather-emoji { font-size: 38px; line-height: 1; }
/* Lottie weather slot — sits in the same flex slot as the emoji, swaps in
   when assets/lottie/weather-*.json exists. Sized to match emoji visual
   weight so the layout doesn't jump on swap. */
.weather-lottie-slot { width: 56px; height: 56px; }
.weather-card-compact .weather-lottie-slot { width: 64px; height: 64px; }
.weather-temp { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.weather-label { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.weather-meta { font-size: var(--fs-xs); color: var(--text-muted); padding-top: var(--sp-2); border-top: 1px solid var(--border); line-height: 1.5; }

/* Calendar card */
.cal-evt-row { display: flex; gap: 12px; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.cal-evt-row:last-child { border-bottom: none; }
.cal-evt-time { font-size: var(--fs-sm); font-weight: 700; color: var(--accent); min-width: 70px; }
.cal-evt-title { font-size: var(--fs-md); flex: 1; }
.cal-evt-loc { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-1); }

/* Insights */
.insight-row { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.insight-row:last-child { border-bottom: none; }
.insight-title { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--sp-1); }
.insight-summary { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; margin-bottom: var(--sp-1); }
.insight-link { font-size: var(--fs-sm); color: var(--link); font-weight: 600; }

/* Communications (Gmail inbox) — base styles migrated to
   css/communications.css on 2026-05-09 per docs/ui-platform-convention.md
   (paired desktop + mobile sheets gated by media attr in app.html). */
@media (max-width: 900px) {
  /* Generic .btn-icon mobile touch-target floor — applies to all icon buttons
     across the app, not just communications. Stays here. The matching
     .comm-action-slot-reserved 44x44 mobile rule moved to communications.mobile.css. */
  .btn-icon { width: 44px; height: 44px; font-size: 17px; }
}

/* .priority-pill button-override styles migrated to css/communications.css
   on 2026-05-09 (priority-pill is the per-sender priority override surfaced
   on email rows). */

/* ═══ Test Script modal ═══ */
.ts-modal-body { max-height: 70vh; overflow-y: auto; }
.ts-progress { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; }
.ts-progress-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.ts-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #2DC6F2); width: 0%; transition: width .3s; }
.ts-section { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.ts-module-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.ts-chip { padding: 4px 10px; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; font-size: 12px; font-weight: 600; }
.ts-module { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.ts-module-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; user-select: none; }
.ts-module-head:hover { background: var(--accent-glow); }
.ts-module-left { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.ts-module-icon { font-size: 17px; }
.ts-module-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.ts-status-untouched  { background: var(--surface); color: var(--text-dim); border: 1px solid var(--border); }
.ts-status-inprogress { background: rgba(232,196,68,.15); color: var(--warning); border: 1px solid var(--warning); }
.ts-status-complete   { background: rgba(90,197,58,.15);  color: var(--accent);  border: 1px solid var(--accent); }
.ts-module-body { display: none; padding: 0 14px 14px; border-top: 1px solid var(--border); }
.ts-module.open .ts-module-body { display: block; }
.ts-module-intro { padding: 10px 12px; margin: 10px 0; background: var(--bg); border-left: 3px solid var(--accent-cyan); border-radius: 4px; color: var(--text-muted); font-size: 13px; }
.ts-item { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.ts-item:last-of-type { border-bottom: none; }
.ts-item-title { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.ts-item-expected { padding-left: 10px; border-left: 2px solid var(--accent); color: var(--text-muted); font-size: 13px; font-style: italic; margin-bottom: 8px; }
.ts-outcome-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ts-outcome-pill { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; font-size: 13px; }
.ts-outcome-pill:hover { border-color: var(--accent); }
.ts-outcome-pill input { margin: 0; }
.ts-outcome-pill.picked-good { border-color: var(--accent); background: rgba(90,197,58,.1); }
.ts-outcome-pill.picked-bad  { border-color: var(--danger); background: rgba(232,65,47,.1); }
.ts-device-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 12px; }
.ts-device-label { text-transform: uppercase; letter-spacing: .4px; font-weight: 700; font-size: 11px; color: var(--text-dim); margin-right: 4px; }
.ts-device-pill { padding: 3px 9px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-size: 12px; cursor: pointer; color: var(--text-muted); }
.ts-device-pill.active { background: var(--accent-cyan); color: #000; border-color: var(--accent-cyan); font-weight: 700; }
.ts-item-note { width: 100%; min-height: 60px; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 8px; border-radius: 5px; font-family: inherit; font-size: 13px; resize: vertical; display: none; }
.ts-item.has-issue .ts-item-note { display: block; }
.ts-complete-row { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border); }
.ts-mark-complete:disabled { opacity: .5; cursor: not-allowed; }

/* Communications header toolbar layout (.comm-page-actions,
   .btn.comm-toolbar-btn pill chrome, shortcuts-btn — selector renamed to
   .js-comm-shortcuts-btn for Option B) + mobile sizing migrated to
   css/communications.{css,mobile.css} on 2026-05-09. */

/* Communications secondary toolbar (.comm-toolbar-row, .comm-toolbar-control,
   .comm-accounts-summary, .comm-account-chip) migrated to
   css/communications.css on 2026-05-09. */

/* Settings → Integrations group headers (Google Integrations / Knowledge
   Integration). Sit above sibling sections, visually separate the groups. */
.settings-group-header { font-size: var(--fs-xl); font-weight: 700; color: var(--text); margin: 0 0 var(--sp-2); letter-spacing: -.2px; }
.settings-group-desc { font-size: var(--fs-md); color: var(--text-muted); margin: 0 0 var(--sp-4); line-height: var(--lh-relaxed); }
/* Communications thread-summary-pill + lane-bar / lane / lane-add / lane-edit
   styles migrated to css/communications.css on 2026-05-09. */

/* AI search row base styles + mobile flex-wrap migrated to
   css/communications.{css,mobile.css} on 2026-05-09. */
/* Communications AI result + AI hit + undo toast styles migrated to
   css/communications.css on 2026-05-09. */
/* Communications unread + threading + archive animations + black-hole vortex
   styles migrated to css/communications.css on 2026-05-09. */

/* In-app confirm dialog */
.confirm-dialog { text-align: center; padding: var(--sp-6) var(--sp-5); }
.confirm-icon { font-size: 48px; margin-bottom: var(--sp-3); }
.confirm-title { font-size: var(--fs-xl); font-weight: 700; color: var(--text); margin-bottom: var(--sp-2); }
.confirm-message { font-size: var(--fs-base); color: var(--text-muted); margin-bottom: var(--sp-6); line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 100px; }
/* Communications row body + bulk-select mode + bulk-bar styles migrated to
   css/communications.css on 2026-05-09. */

/* Open-message modal meta / body / attachments / text-body / html-body
   styles migrated to css/communications.css on 2026-05-09. */

/* Compose / Reply modal */
/* Compose / Reply modal styles (.compose-context, .compose-ai-row) migrated
   to css/communications.css on 2026-05-09. */

/* Library bulk row */
.library-bulk-row { display: flex; justify-content: flex-end; margin-bottom: var(--sp-3); }

.reminder-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.reminder-row:last-child { border-bottom: none; }
.reminder-row-main { flex: 1; min-width: 0; }
.reminder-row-name { font-size: var(--fs-base); font-weight: 600; }
.reminder-row-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }

.habit-checklist-item { display:flex; align-items:center; gap:10px; padding: var(--sp-3) 0; border-bottom:1px solid var(--border); }
.habit-checklist-item:last-child { border-bottom:none; }
.habit-check, .habit-checkbox, .task-check, .habit-checkbox-lg { width:22px; height:22px; border-radius:6px; border:2px solid var(--border-2); cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:all .15s; background: var(--surface); color: transparent; font-weight: 800; font-size: var(--fs-md); }
.habit-checkbox-lg { width: 26px; height: 26px; font-size: 15px; }
.habit-check.done, .habit-check.checked, .habit-checkbox.checked, .task-check.checked, .habit-checkbox-lg.checked { background:var(--success); border-color:var(--success); color:#fff; }
.habit-check:not(.done):hover, .habit-checkbox:not(.checked):hover, .task-check:not(.checked):hover, .habit-checkbox-lg:not(.checked):hover { border-color:var(--accent); background: var(--accent-glow); }
/* Read-only completion indicator (used wherever toggling lives in Check-ins instead) */
.habit-status-indicator { width:22px; height:22px; border-radius:6px; border:2px solid var(--border-2); display:flex; align-items:center; justify-content:center; flex-shrink:0; background: transparent; color: var(--text-dim); font-weight: 800; font-size: var(--fs-sm); cursor: default; }
.habit-status-indicator.checked { background: var(--success); border-color: var(--success); color: #fff; }
.life-area-chip { display:inline-flex; align-items:center; gap:5px; padding: var(--sp-1) var(--sp-3); border-radius:20px; font-size: var(--fs-md); font-weight:600; border:1px solid; margin: var(--sp-1); cursor:default; }
.identity-quote { font-size: var(--fs-base); color:var(--text-muted); font-style:italic; padding: var(--sp-4) var(--sp-4); border-left:3px solid var(--accent); background:var(--accent-glow); border-radius:0 var(--radius-sm) var(--radius-sm) 0; line-height: 1.6; }

/* ── GOALS ───────────────────────────────────────────────────── */
.area-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom: var(--sp-6); }
@media (max-width: 1200px) { .area-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .area-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .area-grid { grid-template-columns: 1fr; } }
.area-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding: var(--sp-5); cursor:pointer; transition:all .2s; position: relative; overflow: hidden; }
.area-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--area-color, var(--accent)); opacity: .8; }
.area-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color: var(--area-color, var(--border-2)); }
.area-card.selected { border-color:currentColor; }
.area-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: var(--sp-4); }
.area-info { flex: 1; }
.area-icon { font-size:28px; flex-shrink: 0; }
.area-name { font-size: var(--fs-lg); font-weight:700; margin-bottom: var(--sp-1); }
.area-goals-count { font-size: var(--fs-md); color: var(--text-muted); }
.area-matters { font-size: var(--fs-md); color:var(--text-muted); line-height:1.5; font-style: italic; padding: var(--sp-3) var(--sp-3); background: rgba(0,0,0,.15); border-radius: var(--radius-sm); border-left: 2px solid var(--area-color, var(--accent)); }
.area-matters-empty { font-style: normal; color: var(--text-dim); }
.focus-row { display: flex; align-items: center; gap: 10px; margin: var(--sp-3) 0; }
.focus-label { font-size: var(--fs-xs); color:var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.focus-slider { flex: 1; }
.focus-value { font-size: var(--fs-md); font-weight: 700; color: var(--text); min-width: 40px; text-align: right; }
.focus-bar { flex:1; height:4px; background:var(--border); border-radius:2px; }
.focus-fill { height:100%; border-radius:2px; }

.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.goal-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding: var(--sp-5); transition:all .15s; cursor: pointer; }
.goal-card:hover { border-color:var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.goal-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--sp-3); }
.goal-area-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: var(--sp-2); flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.goal-title-wrap { flex: 1; min-width: 0; }
.goal-title { font-size: var(--fs-lg); font-weight:700; margin-bottom: var(--sp-1); line-height: 1.3; }
.goal-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.goal-why   { font-size: var(--fs-md); color:var(--text-muted); font-style:italic; margin-bottom: var(--sp-4); line-height:1.5; padding: var(--sp-3) var(--sp-3); background: var(--accent-glow); border-radius: var(--radius-sm); }
.goal-obstacles { margin-bottom: var(--sp-4); padding: var(--sp-3); background: rgba(240,63,63,0.06); border-left: 2px solid rgba(240,63,63,0.35); border-radius: var(--radius-sm); }
.goal-obstacles-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 1px; color: rgba(240,63,63,0.85); font-weight: 600; margin-bottom: var(--sp-1); }
.goal-obstacles-list { margin: 0; padding-left: var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.5; }
.goal-obstacles-list li { margin-bottom: 2px; }
.goal-meta, .goal-meta-row  { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); }
.goal-progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-3); }
.progress-bar, .progress-bar-wrap { flex: 1; height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.progress-fill, .progress-bar { height:100%; border-radius:3px; background: linear-gradient(90deg, var(--accent), var(--link)); transition:width .4s ease; }
.progress-pct { font-size: var(--fs-md); font-weight: 700; color: var(--text); min-width: 40px; text-align: right; }
.goal-links, .goal-links-row { display:flex; gap:8px; flex-wrap:wrap; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.goal-link-chip, .link-chip, .area-tag, .due-chip, .identity-chip { font-size: var(--fs-sm); color:var(--text-muted); background:var(--surface); border:1px solid var(--border); border-radius:20px; padding: var(--sp-1) var(--sp-3); }
.due-chip.overdue { color: var(--danger); border-color: rgba(240,63,63,.3); background: var(--danger-dim); }

/* ── TASKS ────────────────────────────────────────────────────── */
.tasks-layout { display:grid; grid-template-columns:280px 1fr; gap:0; height:calc(100vh - var(--header-h)); height:calc(100dvh - var(--header-h)); }
.projects-panel { border-right:1px solid var(--border); overflow-y:auto; padding: var(--sp-5) 0; background: var(--surface); }
.panel-header { display:flex; align-items:center; justify-content:space-between; padding: 0 var(--sp-5) var(--sp-4); margin-bottom: var(--sp-3); border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.panel-header-left { flex: 1; min-width: 0; }
.panel-header-right { display:flex; align-items:center; gap: 10px; flex-shrink: 0; }
.panel-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.next-action-hint { font-size: var(--fs-md); color: var(--gold); margin-top: var(--sp-1); }
.project-item { display:flex; align-items:center; gap:10px; padding: 11px var(--sp-5); cursor:pointer; transition:background .15s; justify-content: space-between; }
.project-item:hover { background:var(--accent-glow); }
.project-item.active { background:var(--accent-dim); color:var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.project-item-main { display:flex; align-items:center; gap: 8px; flex: 1; min-width: 0; }
.project-item-name, .project-title { flex:1; font-size: var(--fs-base); font-weight:500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-task-count { font-size: var(--fs-sm); color: var(--text-muted); background: var(--card); padding: var(--sp-1) var(--sp-2); border-radius: 20px; }
.tasks-panel { overflow-y:auto; padding: var(--sp-6); }
.task-item { display:flex; align-items:center; gap:12px; padding: var(--sp-4) var(--sp-4); background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom: var(--sp-3); transition:all .15s; justify-content: space-between; cursor: pointer; }
.task-status-chip { font-size: var(--fs-xs); font-weight:600; padding: 1px var(--sp-2); border-radius:10px; border:1px solid; text-transform:uppercase; letter-spacing:.03em; }

/* Focus Board — Kanban */
.board-container { display: flex; gap: 12px; overflow-x: auto; min-height: 400px; padding-bottom: var(--sp-2); }
/* Board columns now flex to fill the page width — Density v2 made the
   surrounding page-layout edge-to-edge, but the kanban columns were still
   capped at 280px and bunched against the left side. Drop the max-width
   so columns expand equally to fill the wide container. */
.board-column { flex: 1; min-width: 220px; display: flex; flex-direction: column; }
.board-column-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-3); margin-bottom: var(--sp-2); border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
}
.board-column-title { font-size: var(--fs-md); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.board-column-count { font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); background: var(--surface); padding: 1px var(--sp-2); border-radius: 10px; }
.board-column-body {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  padding: var(--sp-2); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px dashed var(--border);
  min-height: 60px; transition: border-color .2s, background .2s;
}
.board-drop-target { border-color: var(--accent) !important; background: var(--accent-dim) !important; }
.board-card {
  padding: var(--sp-3) var(--sp-3); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: grab; transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.board-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.board-card.board-dragging { opacity: .4; transform: rotate(2deg); }
.board-card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  justify-content: space-between;
}
.board-card-advance {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--fs-base);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  padding: 0;
}
.board-card-advance:hover {
  background: var(--accent-dim);
  transform: translateX(2px);
}
.board-card-advance:active { transform: translateX(4px); }
.board-card-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-1); }
.board-card-project { font-size: var(--fs-xs); color: var(--text-dim); }
.board-card-time { font-size: var(--fs-xs); color: var(--text-dim); }
.board-card-due { font-size: var(--fs-xs); color: var(--warning); }
.board-empty { font-size: var(--fs-sm); color: var(--text-dim); text-align: center; padding: var(--sp-4) var(--sp-2); }

/* Focus Timer Bar */
.focus-timer-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: 48px; display: flex; align-items: center; gap: 16px;
  padding: 0 var(--sp-6); background: linear-gradient(135deg, var(--card), var(--surface));
  border-top: 1px solid var(--accent); box-shadow: 0 -4px 24px rgba(0,0,0,.5), 0 0 12px var(--accent-glow);
}
.timer-task-name { flex: 1; font-size: var(--fs-base); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-display { font-size: var(--fs-2xl); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-controls { display: flex; gap: 8px; }
.timer-controls .btn-icon { font-size: var(--fs-xl); }
.timer-type { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.task-timer-btn { color: var(--accent) !important; font-size: var(--fs-base) !important; }

/* Task Work Section in modal */
.task-work-section {
  margin-top: var(--sp-4); padding: var(--sp-4); border-top: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-dim), transparent);
  border-radius: 0 0 var(--radius) var(--radius);
}
.task-work-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.task-work-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.task-work-btn { flex-shrink: 0; }

/* Focus Mode Overlay */
.focus-mode-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.focus-mode-content { text-align: center; max-width: 500px; width: 100%; padding: var(--sp-8); }
.focus-mode-task { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: var(--sp-4); }
.focus-mode-timer { font-size: 80px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 2px; text-shadow: 0 0 40px var(--accent-glow); margin-bottom: var(--sp-2); }
.focus-mode-type { font-size: var(--fs-base); color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: var(--sp-7); }
.focus-mode-notes { width: 100%; padding: var(--sp-3); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: var(--fs-base); resize: none; height: 80px; margin-bottom: var(--sp-6); }
.focus-mode-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Analytics grid */
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.plan-review-box { padding: var(--sp-3);border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--card);margin-bottom: var(--sp-3); }

@media (max-width: 900px) {
  .board-container { flex-direction: column; }
  .board-column { max-width: 100%; min-width: 0; }
}
.task-item:hover { border-color:var(--accent); transform: translateX(2px); }
.task-item.task-done, .task-item.done { opacity:.55; }
.task-item.task-overdue { border-left: 3px solid var(--danger); }
.task-item-left { display:flex; align-items:center; gap: 12px; flex: 1; min-width: 0; }
.task-item-right { display:flex; align-items:center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.task-item-body, .task-body { flex:1; min-width:0; }
.task-item-title, .task-title { font-size: var(--fs-base); font-weight:600; margin-bottom: var(--sp-1); }
.task-item-meta, .task-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size: var(--fs-sm); color: var(--text-muted); }
.task-project { font-weight: 500; }
.task-goal { color: var(--gold); }
.task-item-actions, .task-actions { display:flex; gap:4px; }
.quick-add, .quick-add-row { display:flex; gap:8px; margin-bottom: var(--sp-5); padding: var(--sp-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.quick-add input, .quick-add-row input { flex:1; background:transparent; border:none; color:var(--text); padding: var(--sp-3) var(--sp-3); font-size: var(--fs-base); outline:none; }
.toggle-label { display:flex; align-items:center; gap: 6px; font-size: var(--fs-md); color: var(--text-muted); cursor: pointer; }

/* ── HABITS ───────────────────────────────────────────────────── */
.today-habit-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-2) var(--sp-5); }
.habit-today-card { background:linear-gradient(135deg,var(--accent-dim),var(--card)); border:1px solid rgba(91,110,245,.3); border-radius:var(--radius); padding: var(--sp-6); margin-bottom: var(--sp-6); }
.habit-today-header { font-size: var(--fs-sm); font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.8px; margin-bottom: var(--sp-4); }
.habit-time-group { margin-bottom: var(--sp-7); }
.time-group-label { font-size: var(--fs-base); font-weight: 700; color: var(--text-muted); margin-bottom: var(--sp-4); text-transform: uppercase; letter-spacing: .6px; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.habits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.habit-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding: var(--sp-5); transition: border-color .15s; }
.habit-card:hover { border-color: var(--border-2); }
.habit-card.habit-done { border-left: 3px solid var(--success); }
.habit-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: var(--sp-4); }
.habit-card-left { display:flex; align-items:flex-start; gap: 12px; flex: 1; min-width: 0; }
.habit-card-title-block { flex: 1; min-width: 0; }
.habit-card-title { font-size: var(--fs-lg); font-weight:700; margin-bottom: var(--sp-1); }
.habit-identity, .habit-identity-text { font-size: var(--fs-md); color:var(--text-muted); font-style:italic; padding-left: var(--sp-3); border-left:2px solid var(--accent); }
.habit-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.habit-loop { display:grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); align-items:center; gap:6px; background:var(--surface); border-radius:var(--radius-sm); padding: var(--sp-3); margin-bottom: var(--sp-4); border: 1px solid var(--border); }
.loop-arrow { color:var(--text-dim); font-size: var(--fs-base); text-align:center; }
.loop-step, .loop-item { display: flex; flex-direction: column; align-items: center; text-align:center; gap: 3px; padding: var(--sp-1); }
.loop-item .loop-label, .loop-step-label { font-size: var(--fs-xxs); font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:.6px; }
.loop-cue .loop-label { color: #60a5fa; }
.loop-craving .loop-label { color: #fb7185; }
.loop-response .loop-label { color: var(--accent); }
.loop-reward .loop-label { color: var(--gold); }
.loop-value, .loop-step-val { font-size: var(--fs-sm); color:var(--text); font-weight: 500; }
.habit-card-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); font-size: var(--fs-md); color: var(--text-muted); }
.habit-card-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-4); }
.stat-pill { font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); }
.stat-pill strong { color: var(--text); font-weight: 700; }
.streak-display { display:flex; flex-direction: column; align-items:flex-end; gap:2px; }
.streak-number { font-size:28px; font-weight:800; color:var(--gold); line-height: 1; letter-spacing: -.5px; }
.streak-unit { font-size: var(--fs-xs); color:var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .5px; }
.streak-label { font-size: var(--fs-xs); color:var(--text-muted); }
.streak-fire { font-size:20px; }
.heatmap, .heatmap-grid { display:grid; grid-template-columns:repeat(12, 1fr); grid-template-rows: repeat(7, 1fr); gap:3px; margin-top: var(--sp-3); grid-auto-flow: column; }
.heatmap-cell { aspect-ratio:1; border-radius:2px; background:var(--border); transition:background .15s; }
.heatmap-cell.done { background:var(--success); }
.heatmap-cell.today { box-shadow:0 0 0 2px var(--link); }
.habit-stack, .stack-hint, .two-min-hint, .goal-link-hint { font-size: var(--fs-sm); color:var(--text-muted); padding: var(--sp-1) var(--sp-3); background:var(--surface); border-radius:var(--radius-xs); display:inline-block; border: 1px solid var(--border); }
.two-min, .two-min-hint { font-size: var(--fs-sm); color:var(--gold); padding: var(--sp-2) var(--sp-3); border-left:2px solid var(--gold); background:var(--gold-dim); border-radius:0 4px 4px 0; margin-top: var(--sp-2); border-right: none; border-top: none; border-bottom: none; }
.two-min-small { font-size: var(--fs-sm); color: var(--gold); margin-left: var(--sp-2); }

/* ── CHECK-INS ────────────────────────────────────────────────── */
.checkin-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
.checkin-main { display: flex; flex-direction: column; gap: 20px; }
.checkin-section { margin-bottom: var(--sp-1); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-6); }
.checkin-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-5); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border); }
.checkin-section-header h3 { font-size: 17px; font-weight: 700; }
.section-time-icon { font-size: 24px; }
.checkin-morning { border-left: 3px solid #f4b942; }
.checkin-evening { border-left: 3px solid #a855f7; }
.checkin-ai { border-left: 3px solid var(--link); }
.checkin-section-title { font-size: var(--fs-sm); font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.6px; margin-bottom: var(--sp-4); padding-bottom: var(--sp-2); border-bottom:1px solid var(--border); }
.energy-slider-wrap { display:flex; align-items: center; gap: 14px; background: var(--surface); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.energy-slider-wrap input[type=range] { flex: 1; }
.energy-display { font-size: 15px; font-weight: 700; color: var(--text); min-width: 80px; text-align: right; }
.energy-scale { display:flex; gap:8px; }
.energy-btn { width:44px; height:44px; border-radius:50%; border:2px solid var(--border); background:var(--surface); cursor:pointer; font-size:20px; transition:all .15s; display:flex; align-items:center; justify-content:center; }
.energy-btn:hover,.energy-btn.active { border-color:var(--accent); transform:scale(1.15); }
.gratitude-list { display:flex; flex-direction:column; gap:10px; }
.gratitude-input { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); outline:none; }
.gratitude-input:focus { border-color:var(--accent); }
.ai-brief, .ai-output-box { background:linear-gradient(135deg,var(--accent-dim),rgba(74,222,128,.06)); border:1px solid rgba(91,110,245,.3); border-radius:var(--radius); padding: var(--sp-5); margin-top: var(--sp-4); }
.ai-output-text { font-size: var(--fs-base); line-height:1.75; color:var(--text); white-space:pre-wrap; }
.ai-insight-box { padding: var(--sp-3) 0; }
.ai-goal-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.ai-insight-text { font-size: var(--fs-base); line-height: 1.75; color: var(--text); white-space: pre-wrap; }
/* Daily Check-In completed/celebration view */
.checkin-completed-card {
  background: linear-gradient(135deg, var(--success-dim), var(--card));
  border: 1px solid rgba(15,186,121,.35);
  border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-7);
  text-align: center;
}
.completed-icon { font-size: 56px; line-height: 1; margin-bottom: var(--sp-4); }
.completed-title { font-size: 28px; font-weight: 800; letter-spacing: -.3px; margin-bottom: var(--sp-2); }
.completed-sub { font-size: 15px; color: var(--text-muted); margin-bottom: var(--sp-7); }
.completed-streak { display: inline-flex; flex-direction: column; align-items: center; margin-bottom: var(--sp-5); padding: var(--sp-5) var(--sp-7); background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); }
.streak-big { display: flex; align-items: baseline; gap: 8px; }
.streak-big-num { font-size: 60px; font-weight: 800; color: var(--success); letter-spacing: -1.5px; line-height: 1; }
.streak-big-flame { font-size: var(--fs-display); }
.streak-big-label { font-size: var(--fs-md); color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-top: var(--sp-2); }
.completed-keep-going { font-size: 15px; color: var(--text); line-height: 1.6; margin-bottom: var(--sp-5); max-width: 520px; margin-left: auto; margin-right: auto; }
.completed-keep-going strong { color: var(--success); }
.completed-actions { margin-bottom: var(--sp-6); }
.completed-recap { text-align: left; max-width: 640px; margin: var(--sp-6) auto 0; padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.completed-recap h4 { font-size: var(--fs-md); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: var(--sp-3); }
.recap-item { font-size: var(--fs-base); line-height: 1.55; padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border); }
.recap-item:last-child { border-bottom: none; }
.recap-label { font-weight: 700; color: var(--accent); margin-right: var(--sp-2); }

.checkin-save-row { display: flex; align-items: center; gap: 14px; padding: var(--sp-4) 0; }
.save-hint { font-size: var(--fs-md); color: var(--text-muted); }
.checkin-history { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); height: fit-content; position: sticky; top: 20px; }
.history-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.history-item, .checkin-hist-item { background:var(--card-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding: var(--sp-3); cursor:pointer; transition:border-color .15s; margin-bottom: var(--sp-2); }
.history-item:hover, .checkin-hist-item:hover { border-color:var(--link); }
.history-pulse { background: var(--pulse-bg, var(--card-2)); }
.history-date, .checkin-hist-date { font-size: var(--fs-sm); color:var(--link); font-weight: 700; margin-bottom: var(--sp-1); }
.history-preview, .checkin-hist-preview { font-size: var(--fs-md); color:var(--text-muted); line-height: 1.5; }
.history-mood { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }

/* LifeOS Pulse Box */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px var(--pulse-color, var(--accent))22, inset 0 0 30px var(--pulse-color, var(--accent))08; }
  50% { box-shadow: 0 0 30px var(--pulse-color, var(--accent))33, inset 0 0 50px var(--pulse-color, var(--accent))12; }
}
.pulse-box {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 20px;
  padding: var(--sp-5) var(--sp-6); border-radius: 14px; margin: var(--sp-5) 0;
  animation: pulseGlow 3s ease-in-out infinite;
}
.pulse-score-ring {
  width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
}
.pulse-score-num { font-size: 26px; font-weight: 900; }
.pulse-content { flex: 1; }
.pulse-label { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-1); letter-spacing: -.02em; }
.pulse-statement { font-size: var(--fs-base); color: var(--text-muted); line-height: 1.5; }
.pulse-glow {
  position: absolute; top: -50%; right: -20%; width: 60%; height: 200%;
  pointer-events: none; opacity: .5;
}

/* Deadline reminders */
.checkin-deadline {
  display: flex; align-items: center; gap: 10px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm);
  margin-bottom: var(--sp-4); font-size: var(--fs-md);
  transition: all .3s;
}
.deadline-normal {
  background: var(--accent-dim); border: 1px solid rgba(90,197,58,.2);
  color: var(--accent);
}
.deadline-urgent {
  background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.3);
  color: #f97316; animation: pulseGlow 2s ease-in-out infinite;
  --pulse-color: #f97316;
}
.deadline-critical {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4);
  color: #ef4444; animation: pulseGlow 1.2s ease-in-out infinite;
  --pulse-color: #ef4444; font-weight: 700;
}
.deadline-icon { font-size: 20px; }
.deadline-label { font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .03em; }
.deadline-time { font-size: var(--fs-lg); font-weight: 800; }

/* Area detail modal */
.modal-body-lg { max-height: 75vh; padding: var(--sp-6); }
.area-detail-header { padding-top: var(--sp-6); }
.area-detail-title-wrap { display: flex; align-items: center; gap: 14px; }
.area-detail-icon { font-size: 36px; }
.area-detail-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.3px; }
.area-detail-focus { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; margin-top: var(--sp-1); }
.area-detail-actions { display: flex; align-items: center; gap: 8px; }

.area-matters-callout {
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
}
.area-matters-empty-callout { background: rgba(0,0,0,.15); border-left-color: var(--border-2); border-left-style: dashed; }
.callout-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-2); }
.callout-text { font-size: 15px; color: var(--text); line-height: 1.6; font-style: italic; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.detail-stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: var(--sp-6);
}
.detail-stat {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--sp-3); text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.detail-stat-num { font-size: var(--fs-2xl); font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.detail-stat-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.detail-section { margin-bottom: var(--sp-6); }
.detail-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.detail-section-title { font-size: 15px; font-weight: 700; color: var(--text); }

.detail-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--sp-3); margin-bottom: var(--sp-2);
  transition: border-color .15s, transform .15s;
}
.detail-row:hover { border-color: var(--accent); }
.detail-goal { cursor: pointer; }
.detail-goal:hover { transform: translateX(2px); }
.detail-row-main { flex: 1; min-width: 0; }
.detail-row-title { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--sp-1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-row-sub { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; margin-top: var(--sp-1); }
.detail-row-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.detail-progress-row { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-2); max-width: 300px; }

.detail-empty { font-size: var(--fs-md); color: var(--text-muted); padding: var(--sp-4); text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.detail-archive { margin-top: var(--sp-3); border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.detail-archive summary { font-size: var(--fs-md); color: var(--text-muted); }

/* Make area cards clearly clickable */
.area-card { cursor: pointer; }

/* Rollup cards (integrated check-ins) */
.rollup-card {
  background: linear-gradient(135deg, var(--link-dim), var(--card));
  border: 1px solid rgba(74,222,128,.25);
  border-left: 3px solid var(--link);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-1);
}
.rollup-card.rollup-compact { padding: var(--sp-4) var(--sp-5); }
.rollup-card.rollup-empty { opacity: .6; border-style: dashed; }
.rollup-header { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid rgba(74,222,128,.15); }
.rollup-icon { font-size: var(--fs-2xl); }
.rollup-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.rollup-count { font-size: var(--fs-sm); color: var(--link); font-weight: 700; background: var(--link-dim); padding: var(--sp-1) var(--sp-3); border-radius: 20px; }
.rollup-empty-text { font-size: var(--fs-md); color: var(--text-muted); margin-top: var(--sp-2); }
.rollup-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-4); }
.metric-chip { font-size: var(--fs-md); padding: var(--sp-1) 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); }
.metric-chip strong { color: var(--text); font-weight: 700; }
.rollup-section { margin-bottom: var(--sp-3); }
.rollup-section:last-child { margin-bottom: 0; }
.rollup-label { font-size: var(--fs-xs); font-weight: 700; color: var(--link); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-2); }
.rollup-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rollup-list li { font-size: var(--fs-md); color: var(--text); line-height: 1.5; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-6); background: rgba(0,0,0,.2); border-radius: var(--radius-xs); position: relative; }
.rollup-list li::before { content: '▸'; position: absolute; left: 10px; color: var(--link); font-weight: 700; }

/* Habits rollup in weekly/monthly/quarterly check-ins */
.rollup-habits { background: linear-gradient(135deg, rgba(244,185,66,.08), var(--card)); border-color: rgba(244,185,66,.2); border-left-color: var(--gold); }
.habit-rollup-list { display: flex; flex-direction: column; gap: 8px; }
.habit-rollup-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); }
@media (max-width: 900px) {
  /* Stack: title + identity occupy row 1 (full width), bar + count + rate
     occupy row 2 horizontally. Stops the bar from squeezing the title into
     a narrow column where every habit name wraps. */
  .habit-rollup-row { grid-template-columns: 1fr; gap: 8px; }
  .habit-rollup-stats { width: 100%; justify-content: flex-start; }
  .habit-rollup-bar-wrap { flex: 1 1 auto; width: auto; }
}
.habit-rollup-main { min-width: 0; }
.habit-rollup-title { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.habit-rollup-identity { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.habit-rollup-stats { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.habit-rollup-count { font-size: var(--fs-md); font-weight: 700; color: var(--text); min-width: 48px; text-align: right; }
.habit-rollup-bar-wrap { width: 100px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.habit-rollup-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }
.habit-rollup-bar.rate-good { background: var(--success); }
.habit-rollup-bar.rate-ok   { background: var(--gold); }
.habit-rollup-bar.rate-low  { background: var(--danger); }
.habit-rollup-rate { font-size: var(--fs-md); font-weight: 700; min-width: 42px; text-align: right; color: var(--text); }

/* Habits inside daily check-in */
.checkin-habits { border-left: 3px solid var(--gold); }
.checkin-habits-progress { font-size: var(--fs-md); font-weight: 700; color: var(--gold); background: var(--gold-dim); padding: var(--sp-1) var(--sp-3); border-radius: 20px; margin-left: auto; }
.checkin-habits-list { display: flex; flex-direction: column; gap: 8px; }
.checkin-habit-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); transition: border-color .15s; }
.checkin-habit-row:hover { border-color: var(--gold); }
.checkin-habit-row.done { background: rgba(15,186,121,.05); border-color: rgba(15,186,121,.25); }
.checkin-habit-info { min-width: 0; }
.checkin-habit-name { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.checkin-habit-identity { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.checkin-habit-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.habit-freq-chip { font-size: var(--fs-xs); color: var(--text-muted); background: var(--card); border: 1px solid var(--border); padding: var(--sp-1) var(--sp-2); border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.checkin-habit-streak { font-size: var(--fs-md); font-weight: 700; color: var(--gold); min-width: 32px; text-align: right; }

/* AI draft row */
.ai-draft-row {
  display: flex; align-items: center; gap: 14px;
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(135deg, var(--gold-dim), rgba(74,222,128,.05));
  border: 1px dashed rgba(244,185,66,.3);
  border-radius: var(--radius);
}
.ai-draft-hint { font-size: var(--fs-md); color: var(--text-muted); flex: 1; }
@media (max-width: 900px) {
  /* Stack: button on its own row above the explanatory hint, so the hint
     can use the full width and not get squeezed into a 100px column next
     to the button. */
  .ai-draft-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .ai-draft-row .btn { width: 100%; }
  .ai-draft-hint { flex: none; text-align: left; }
}

.life-area-scores, .area-scores-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; }
.life-area-score-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; background: var(--surface); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.area-score-icon { font-size: var(--fs-xl); }
.area-score-name { font-size: var(--fs-md); font-weight:600; }
.area-score-slider { width: 100px; }
.area-score-value { font-size: var(--fs-md); font-weight: 700; min-width: 50px; text-align: right; }

/* ── SETTINGS ─────────────────────────────────────────────────── */
.settings-layout { max-width: 960px; padding: var(--sp-7) var(--sp-7); display: flex; flex-direction: column; gap: 20px; width: 100%; }
.settings-section { max-width: 960px; }
.settings-section-title { font-size:17px; font-weight:700; color:var(--text); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: 10px; }
.settings-section h3 { font-size:17px; font-weight:700; color:var(--text); margin-bottom: var(--sp-2); }
.settings-section-desc { font-size: var(--fs-base); color: var(--text-muted); margin-bottom: var(--sp-5); line-height: 1.55; }
.settings-section-danger { border-color: rgba(240,63,63,.25); }
.settings-section-danger .settings-section-title::before { content: '⚠ '; color: var(--danger); }
.settings-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: var(--sp-3); }
.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; }
.setup-instructions { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); }
.setup-instructions summary { font-size: var(--fs-base); font-weight: 600; color: var(--link); cursor: pointer; }
.setup-instructions summary:hover { color: var(--link-hover); }
.setup-list { padding-left: var(--sp-5); margin-top: var(--sp-4); font-size: var(--fs-base); line-height: 1.9; color: var(--text-muted); }
.setup-list li { margin-bottom: var(--sp-1); }
.setup-list code { background: var(--card); padding: var(--sp-1) var(--sp-2); border-radius: 4px; color: var(--link); font-size: var(--fs-sm); font-family: 'SFMono-Regular', Consolas, monospace; }
.badge-p2 { background: var(--gold-dim); color: var(--gold); font-size: var(--fs-xs); padding: var(--sp-1) var(--sp-2); border-radius: 12px; margin-left: var(--sp-2); font-weight: 700; vertical-align: middle; }
.integration-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding: var(--sp-5); margin-bottom: var(--sp-3); }
.integration-header { display:flex; align-items:center; gap:10px; margin-bottom: var(--sp-4); }
.integration-icon { font-size:24px; }
.integration-name { font-size: var(--fs-lg); font-weight:700; flex:1; }
.integration-status { font-size: var(--fs-md); font-weight:600; }
.connected-status { color:var(--success); }
.disconnected-status { color:var(--text-dim); }
.oauth-steps { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); font-size: var(--fs-md); line-height:1.9; color:var(--text-muted); }
.oauth-steps ol { padding-left: var(--sp-5); }
.oauth-steps code { background:var(--card); padding: var(--sp-1) var(--sp-2); border-radius:4px; color:var(--link); font-size: var(--fs-sm); font-family: 'SFMono-Regular', Consolas, monospace; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: relative; width: 44px; height: 24px; background: var(--border); border-radius: 24px; transition: background .2s; flex-shrink: 0; }
.toggle-slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-text { font-size: var(--fs-base); color: var(--text); }

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); cursor: pointer; padding: var(--sp-1) var(--sp-3); background: var(--card); border: 1px solid var(--border); border-radius: 20px; }
.checkbox-label:hover { border-color: var(--accent); }
.checkbox-label input { margin: 0; }

/* Empty states */
.empty-state { text-align: center; padding: 60px var(--sp-6); background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.empty-icon { font-size: 52px; margin-bottom: var(--sp-4); opacity: .8; }
.empty-state h3 { font-size: var(--fs-xl); font-weight: 700; color: var(--text); margin-bottom: var(--sp-2); }
.empty-state p { font-size: var(--fs-base); margin-bottom: var(--sp-5); }

/* Per-user generated cover/vision art (Phase 7, 2026-04-26).
   Life Areas get a 16:9 banner header; Goals get a 4:3 hero strip on the
   edit modal. Both use background-image so we can layer a dark gradient
   on top — generated art is always painterly low-saturation, so a slight
   bottom-vignette keeps action buttons readable. */
.area-cover-zone, .goal-vision-zone { margin-bottom: var(--sp-4); }

.area-cover-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  overflow: hidden;
}
.goal-vision-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  overflow: hidden;
  max-height: 320px;
}
.area-cover-banner::after,
.goal-vision-banner::after {
  /* Bottom-fading dark gradient so the action buttons stay readable */
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,.55) 100%);
}
.area-cover-actions, .goal-vision-actions {
  position: absolute; bottom: var(--sp-2); right: var(--sp-2);
  display: flex; gap: 4px; z-index: 1;
}
.area-cover-actions .btn,
.goal-vision-actions .btn {
  background: rgba(0,0,0,.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
}
.area-cover-actions .btn:hover,
.goal-vision-actions .btn:hover {
  background: rgba(0,0,0,.75);
  border-color: var(--accent);
}

.area-cover-empty, .goal-vision-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
@media (max-width: 600px) {
  .area-cover-empty, .goal-vision-empty {
    flex-direction: column;
    align-items: stretch;
  }
  .area-cover-empty .btn, .goal-vision-empty .btn { width: 100%; }
}

/* Empty-state illustration (Phase 7, 2026-04-26).
   Shown above the existing empty-icon + headline + body. Painterly
   atmospheric image generated by Imagen, baked to /img/empty/<slug>.webp.
   Hides itself gracefully if the file isn't there yet (onerror in JS). */
.empty-state-art {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto var(--sp-5);
  border-radius: var(--radius-sm);
  opacity: .85;
  /* Subtle softening to keep the painterly look sympathetic to the dark
     editorial Pacific theme rather than feeling stuck-on. */
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
@media (max-width: 600px) {
  .empty-state-art { max-width: 240px; }
}
.empty-state-sm { padding: var(--sp-5); text-align: center; color: var(--text-muted); font-size: var(--fs-md); }

/* Loading spinner */
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }

/* Details/summary */
details summary { cursor: pointer; padding: var(--sp-3) 0; color: var(--text-muted); font-weight: 600; }
details summary:hover { color: var(--text); }
details[open] summary { margin-bottom: var(--sp-3); }

/* Toast enhancements */
.toast { background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding: var(--sp-3) var(--sp-5); font-size: var(--fs-base); font-weight:500; display:flex; align-items:center; gap:var(--sp-3); box-shadow:var(--shadow); max-width:380px; opacity: 0; transform: translateX(110%); transition: all .3s; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { border-left:3px solid var(--success); }
.toast-info    { border-left:3px solid var(--accent); }
.toast-warning { border-left:3px solid var(--gold); }
.toast-error   { border-left:3px solid var(--danger); }
.toast-icon { font-size: var(--fs-lg); font-weight: 800; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--gold); }
.toast-info .toast-icon { color: var(--accent); }
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }

/* Range input restyle */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 5px; background: var(--border); border-radius: 3px; outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; background: var(--accent); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; background: var(--accent); border-radius: 50%; cursor: pointer; border: none;
}
.range-value { font-size: var(--fs-md); color: var(--text); font-weight: 600; margin-left: var(--sp-3); }

/* Sidebar footer tweaks */
.btn-capture { background: var(--accent); color: #fff; width: 100%; justify-content: center; margin-bottom: var(--sp-2); box-shadow: 0 2px 8px rgba(91,110,245,.25); }
.btn-capture:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(91,110,245,.4); }

/* Archived details */
.archived-goals, .archived-projects, .done-tasks { margin-top: var(--sp-5); border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.goals-grid-muted { opacity: .6; }

/* ── CALENDAR ─────────────────────────────────────────────────── */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.cal-nav { display: flex; gap: 4px; }
.cal-nav .btn { min-width: 36px; }
.cal-month-label { font-size: 20px; font-weight: 700; letter-spacing: -.3px; text-align: center; flex: 1; }
.view-toggle { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-1); }

.cal-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: var(--sp-1); }
.cal-weekday { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; padding: var(--sp-2) var(--sp-1); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cal-cell {
  background: var(--card);
  padding: var(--sp-2) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 110px;
  cursor: pointer;
  transition: background .15s;
  overflow: hidden;
}
.cal-cell:hover { background: var(--card-2); }
.cal-cell-out { background: var(--surface); opacity: .5; }
.cal-cell-today { background: var(--accent-dim); }
.cal-cell-today .cal-day-num { color: var(--accent); font-weight: 800; }
.cal-cell-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.cal-day-num { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.cal-day-count { font-size: var(--fs-xxs); font-weight: 700; color: var(--text-muted); background: var(--surface); padding: 1px var(--sp-2); border-radius: 10px; }

.cal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-event {
  display: flex; gap: 4px; align-items: baseline;
  padding: var(--sp-1) var(--sp-2);
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-event:hover { background: var(--accent); color: #fff; }
.cal-event.linked { box-shadow: inset 2px 0 0 var(--link); }
.cal-event.allday { background: var(--gold-dim); color: var(--gold); }
.cal-event.allday:hover { background: var(--gold); color: var(--bg); }
.cal-event-time { font-weight: 700; flex-shrink: 0; font-size: var(--fs-xxs); }
.cal-event-title { overflow: hidden; text-overflow: ellipsis; }
.cal-event-more { font-size: var(--fs-xs); color: var(--text-muted); cursor: pointer; padding: 1px var(--sp-1); font-weight: 600; }
.cal-event-more:hover { color: var(--link); }

/* Agenda view */
.agenda-list { display: flex; flex-direction: column; gap: 20px; }
.agenda-day-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.agenda-day-label { font-size: var(--fs-base); font-weight: 700; color: var(--text); padding: var(--sp-4) var(--sp-5); background: var(--surface); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .5px; }
.agenda-day-label.today { color: var(--accent); background: var(--accent-dim); }
.agenda-day-events { display: flex; flex-direction: column; }
.agenda-event {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.agenda-event:last-child { border-bottom: none; }
.agenda-event:hover { background: var(--card-2); }
.agenda-event-time { font-size: var(--fs-md); font-weight: 700; color: var(--accent); white-space: nowrap; }
.agenda-event-main { min-width: 0; }
.agenda-event-title { font-size: 15px; font-weight: 600; margin-bottom: var(--sp-1); }
.agenda-event-loc { font-size: var(--fs-sm); color: var(--text-muted); }
.agenda-event-desc { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; margin-top: var(--sp-1); }

@media (max-width: 900px) {
  .cal-grid { grid-auto-rows: minmax(80px, 1fr); }
  .cal-event-title, .cal-event-time { font-size: var(--fs-xxs); }
  .agenda-event { grid-template-columns: 1fr; }
  .cal-month-label { font-size: var(--fs-lg); }
}

/* ── KNOWLEDGE ────────────────────────────────────────────────── */
.tab-count { font-size: var(--fs-xs); font-weight: 700; padding: var(--sp-1) var(--sp-2); background: var(--accent-dim); color: var(--accent); border-radius: 20px; margin-left: var(--sp-2); }
.tab-count-warn { background: var(--danger-dim); color: var(--danger); }

/* Topics of Focus bar */
.topics-bar {
  display: flex; align-items: center; gap: 14px;
  padding: var(--sp-4) var(--sp-5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.topics-bar-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; flex-shrink: 0; }
.topics-bar-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 200px; }
.topics-empty { font-size: var(--fs-md); color: var(--text-dim); font-style: italic; }
.topic-chip {
  display: inline-flex; align-items: center;
  padding: var(--sp-1) var(--sp-3);
  background: transparent;
  border: 1.5px solid;
  border-radius: 20px;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.topic-chip:hover { transform: translateY(-1px); }
.topic-chip.selected { box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.topic-chip-clear { color: var(--text-muted); border-color: var(--border-2); background: var(--surface); }
.topic-chip-clear:hover { color: var(--danger); border-color: var(--danger); }

.topic-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: .2px;
}

/* Topics manager modal */
.topics-list-group { margin-bottom: var(--sp-5); }
.topics-list-group h4 { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.topic-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: var(--sp-3) var(--sp-4); background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--sp-2); }
.topic-row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topic-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.topic-info { flex: 1; min-width: 0; }
.topic-name { font-size: var(--fs-base); font-weight: 700; }
.topic-desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); line-height: 1.4; }
.topic-archived { opacity: .5; }
.topic-row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.topic-add-row { display: flex; gap: 10px; padding-top: var(--sp-4); border-top: 1px solid var(--border); margin-top: var(--sp-3); }

/* Color picker for topic editor */
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s;
  border: 3px solid transparent;
  display: block;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

.inbox-hint { display: flex; align-items: center; gap: 14px; padding: var(--sp-4) var(--sp-5); background: var(--gold-dim); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); margin-bottom: var(--sp-5); font-size: var(--fs-base); color: var(--text); }
.inbox-hint > span { flex: 1; }

.captures-list { display: flex; flex-direction: column; gap: 10px; }
.capture-item { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-5); transition: border-color .15s; }
.capture-item:hover { border-color: var(--accent); }
.capture-article { border-left: 3px solid var(--link); }
.capture-title { font-size: 15px; font-weight: 700; margin-bottom: var(--sp-2); color: var(--text); line-height: 1.35; }
.capture-source-badge { font-size: var(--fs-xs); font-weight: 700; padding: var(--sp-1) var(--sp-2); background: var(--link-dim); color: var(--link); border-radius: 20px; letter-spacing: .3px; }
.capture-author { font-size: var(--fs-sm); color: var(--text-muted); font-style: italic; }
.capture-link { font-size: var(--fs-sm); color: var(--link); font-weight: 600; }
.capture-link:hover { color: var(--link-hover); }
.capture-main { flex: 1; min-width: 0; }
.capture-text { font-size: 15px; color: var(--text); line-height: 1.5; margin-bottom: var(--sp-2); white-space: pre-wrap; }
.capture-meta { display: flex; gap: 12px; font-size: var(--fs-sm); color: var(--text-muted); }
.capture-actions { display: flex; gap: 6px; flex-shrink: 0; }

.library-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: var(--sp-5); }

.knowledge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.knowledge-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); transition: border-color .15s; }
.knowledge-item:hover { border-color: var(--accent); }
.knowledge-item-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--sp-3); }
.knowledge-item-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.knowledge-item-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.knowledge-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.knowledge-summary { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.55; padding: var(--sp-3) var(--sp-3); background: var(--accent-glow); border-left: 2px solid var(--accent); border-radius: var(--radius-sm); margin-bottom: var(--sp-3); }
.knowledge-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.knowledge-source { color: var(--link); font-weight: 500; }
.tag-chip { font-size: var(--fs-xs); color: var(--link); background: var(--link-dim); padding: var(--sp-1) var(--sp-2); border-radius: 20px; font-weight: 600; }

/* ── CAREER ───────────────────────────────────────────────────── */
.career-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-6); }
.resume-subsection { margin: var(--sp-6) 0; padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.resume-subsection:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.section-subheader { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.section-subheader h4 { font-size: 15px; font-weight: 700; color: var(--text); }
.resume-certs-list { display: flex; flex-direction: column; gap: 6px; }
.resume-cert-chip {
  padding: var(--sp-2) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: var(--fs-md); color: var(--text);
}
.resume-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); margin-bottom: var(--sp-3); display: flex; flex-direction: column; gap: 10px; }
.resume-save-row { padding-top: var(--sp-5); margin-top: var(--sp-6); border-top: 1px solid var(--border); }

/* Category picker */
.category-list-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.category-choice-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: var(--sp-6) var(--sp-4);
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.category-choice-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.category-choice-btn.default { border-color: var(--gold); }
.choice-icon { font-size: 36px; }
.choice-name { font-size: 15px; font-weight: 700; }
.choice-default { font-size: var(--fs-xxs); color: var(--gold); text-transform: uppercase; letter-spacing: .6px; font-weight: 700; padding: var(--sp-1) var(--sp-2); background: var(--gold-dim); border-radius: 20px; }

.skill-chip-manager { display: flex; flex-direction: column; gap: 12px; }
.skill-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  min-height: 44px; padding: var(--sp-3) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.skill-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3);
  background: var(--accent-dim);
  border: 1px solid rgba(91,110,245,.3);
  border-radius: 20px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
}
.skill-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.skill-chip-text { white-space: nowrap; }
.skill-chip-remove {
  background: rgba(255,255,255,.1);
  border: none;
  color: inherit;
  width: 18px; height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--fs-xxs);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  padding: 0;
  opacity: .8;
  transition: opacity .15s, background .15s;
}
.skill-chip-remove:hover { opacity: 1; background: rgba(255,255,255,.25); }
.skill-empty { font-size: var(--fs-md); color: var(--text-dim); font-style: italic; padding: var(--sp-1); }
.skill-add-row { display: flex; gap: 8px; }
.skill-add-row input { flex: 1; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cert-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.cert-card.cert-overdue { border-left: 3px solid var(--danger); }
.cert-card.cert-soon    { border-left: 3px solid var(--gold); }
.cert-card.cert-warning { border-left: 3px solid var(--accent); }
.cert-card.cert-ok      { border-left: 3px solid var(--success); }
.cert-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-3); }
.cert-name { font-size: var(--fs-lg); font-weight: 700; }
.cert-issuer { font-size: var(--fs-md); color: var(--text-muted); margin-top: var(--sp-1); }
.cert-ce { margin-bottom: var(--sp-3); }
.cert-ce-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); margin-bottom: var(--sp-2); }
.cert-renewal { display: flex; gap: 8px; font-size: var(--fs-md); margin-bottom: var(--sp-2); align-items: center; flex-wrap: wrap; }
.cert-renewal-label { color: var(--text-muted); }
.cert-renewal-date { color: var(--text); font-weight: 600; }
.cert-days { font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-2); border-radius: 10px; font-weight: 700; }
.cert-days.overdue { background: var(--danger-dim); color: var(--danger); }
.cert-days.soon    { background: var(--gold-dim);  color: var(--gold); }
.cert-days.warning { background: var(--accent-dim);color: var(--accent); }
.cert-days.ok      { background: var(--success-dim); color: var(--success); }
.cert-notes { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }

/* Cert status */
.cert-status-badge { font-size: var(--fs-xxs); font-weight: 700; padding: var(--sp-1) 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; margin-left: var(--sp-2); vertical-align: middle; display: inline-flex; align-items: center; gap: 4px; }
.status-active   { background: var(--success-dim); color: var(--success); border: 1px solid rgba(15,186,121,.3); }
.status-pursuing { background: rgba(244,185,66,.14); color: var(--gold); border: 1px solid rgba(244,185,66,.3); }
.status-archived { background: rgba(139,163,194,.1); color: var(--text-muted); border: 1px solid rgba(139,163,194,.2); }
.cert-filter-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); flex-wrap: wrap; }

.cert-status-pursuing { border-left: 3px solid var(--gold); }
.cert-status-archived { opacity: .6; }

/* Study plan section inside cert card */
.study-plan-section { margin-top: var(--sp-4); padding: var(--sp-4) var(--sp-4); background: linear-gradient(135deg, rgba(244,185,66,.06), var(--card-2)); border: 1px solid rgba(244,185,66,.2); border-radius: var(--radius-sm); }
.study-plan-empty { text-align: center; }
.study-plan-empty-msg p { font-size: var(--fs-md); color: var(--text-muted); margin: var(--sp-2) 0 var(--sp-3); }
.study-plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); flex-wrap: wrap; gap: 8px; }
.study-plan-target { font-size: var(--fs-md); color: var(--text-muted); margin-left: var(--sp-2); }
.study-plan-actions { display: flex; gap: 6px; }

.study-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: var(--sp-4); }
.study-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); text-align: center; display: flex; flex-direction: column; gap: 2px; }
.study-metric-value { font-size: 15px; font-weight: 800; color: var(--text); }
.study-metric-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.study-metric.delta-ahead .study-metric-value { color: var(--success); }
.study-metric.delta-behind .study-metric-value { color: var(--gold); }
.study-metric.delta-behind-bad .study-metric-value { color: var(--danger); }

.study-progress-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-3); }
.study-progress-row { display: flex; align-items: center; gap: 12px; }
.study-progress-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; min-width: 120px; }

.study-preferred { font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-2) var(--sp-3); background: var(--surface); border-radius: var(--radius-xs); margin-bottom: var(--sp-3); }

.study-log-history { margin-top: var(--sp-3); }
.study-log-history summary { font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-2) 0; }
.study-log-table { width: 100%; font-size: var(--fs-sm); border-collapse: collapse; margin-top: var(--sp-2); }
.study-log-table th { text-align: left; padding: var(--sp-2) var(--sp-2); color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; font-size: var(--fs-xxs); border-bottom: 1px solid var(--border); }
.study-log-table td { padding: var(--sp-2); border-bottom: 1px solid var(--border); }

.delta-ahead { color: var(--success); font-weight: 700; }
.delta-behind { color: var(--gold); font-weight: 700; }
.delta-behind-bad { color: var(--danger); font-weight: 700; }
.delta-indicator { padding: var(--sp-3) var(--sp-4); background: var(--surface); border-radius: var(--radius-sm); text-align: center; font-weight: 700; margin-top: var(--sp-3); }

.study-plan-summary { margin-top: var(--sp-3); }
.sp-summary-box { background: var(--accent-glow); border: 1px solid rgba(91,110,245,.25); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); color: var(--text); text-align: center; }
.sp-summary-warn { padding: var(--sp-3) var(--sp-4); background: var(--danger-dim); color: var(--danger); border-radius: var(--radius-sm); font-size: var(--fs-md); }
.log-week-delta { margin-top: var(--sp-2); }

/* Weekly check-in study plan rollup */
.rollup-study { background: linear-gradient(135deg, rgba(244,185,66,.08), var(--card)); border-color: rgba(244,185,66,.2); border-left-color: var(--gold); }
.study-week-list { display: flex; flex-direction: column; gap: 10px; }
.study-week-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); }
.study-week-main { min-width: 0; }
.study-week-name { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--sp-1); }
.study-week-totals { font-size: var(--fs-sm); color: var(--text-muted); }
.study-week-inputs { display: flex; align-items: center; gap: 10px; }
.study-week-field { display: flex; flex-direction: column; gap: 2px; }
.study-week-field label { font-size: var(--fs-xxs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.study-week-field input { width: 72px; text-align: center; }
.study-week-delta { font-size: var(--fs-base); font-weight: 700; min-width: 50px; text-align: center; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-xs); background: var(--surface); }

.roles-list, .plans-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.study-plan-group { margin-bottom: var(--sp-7); }
.study-plan-group-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-3); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.plan-card-cert { border-left: 3px solid var(--gold); background: linear-gradient(135deg, rgba(244,185,66,.04), var(--card)); }
.plan-source-badge { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; margin-top: var(--sp-1); }
.plan-actions { display: flex; gap: 6px; }
.plan-footer-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.role-card, .plan-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; }
.role-main h4, .plan-card h4 { font-size: 15px; font-weight: 700; }
.role-company { font-size: var(--fs-md); color: var(--text-muted); }
.role-notes, .plan-notes { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; }
.plan-target { font-size: var(--fs-md); color: var(--gold); }
.plan-header { display: flex; justify-content: space-between; align-items: flex-start; }
.plan-progress { display: flex; align-items: center; gap: 10px; margin: var(--sp-2) 0; }

/* ── RELATIONSHIPS ────────────────────────────────────────────── */
.contacts-list { display: flex; flex-direction: column; gap: 10px; }
.contact-row {
  display: grid;
  grid-template-columns: 44px 1fr 160px auto auto;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.contact-row:hover { border-color: var(--accent); transform: translateX(2px); }
.contact-overdue { border-left: 3px solid var(--danger); }
.contact-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: var(--fs-xl); flex-shrink: 0; }
.contact-avatar-lg { width: 56px; height: 56px; font-size: 24px; }
.contact-main { min-width: 0; }
.contact-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.overdue-dot { color: var(--danger); font-size: var(--fs-xxs); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.contact-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.contact-cadence { text-align: right; }
.cadence-label { font-size: var(--fs-sm); color: var(--text-muted); }
.cadence-last { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.cadence-last.overdue { color: var(--danger); }
.contact-value, .contact-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.interaction-row {
  display: grid;
  grid-template-columns: 120px 100px 1fr;
  gap: 14px;
  padding: var(--sp-3);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
  align-items: start;
}
.interaction-date { font-size: var(--fs-md); font-weight: 700; color: var(--link); }
.interaction-type { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.interaction-notes { font-size: var(--fs-md); color: var(--text); line-height: 1.55; }
.interaction-followup { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--gold); padding: var(--sp-2) var(--sp-3); background: var(--gold-dim); border-radius: var(--radius-xs); margin-top: var(--sp-1); }
.contact-notes-box { padding: var(--sp-4) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-base); line-height: 1.6; white-space: pre-wrap; }

/* ── TRAVEL ───────────────────────────────────────────────────── */
.travel-dashboard { }
.travel-cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: var(--sp-5); }
.travel-cta-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.travel-cta-card h4 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-2); }
.travel-cta-card p { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-4); line-height: 1.5; }

.migration-banner {
  margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6);
  background: linear-gradient(135deg, var(--gold-dim), rgba(74,222,128,.05));
  border: 1px solid rgba(244,185,66,.3);
  border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.migration-content h4 { font-size: 15px; font-weight: 700; color: var(--gold); margin-bottom: var(--sp-1); }
.migration-content p { font-size: var(--fs-md); color: var(--text-muted); }
.migration-success { background: var(--success-dim); border-color: rgba(15,186,121,.3); color: var(--success); padding: var(--sp-3) var(--sp-5); }

/* Cards (ported from TRO, adapted to LifeOS) */
.travel-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }
.travel-card-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.travel-card-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.travel-card-header {
  padding: var(--sp-5) var(--sp-6);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.travel-card-name { font-size: 17px; font-weight: 800; margin-bottom: var(--sp-1); letter-spacing: -.2px; }
.travel-card-program { font-size: var(--fs-md); opacity: .85; margin-bottom: var(--sp-3); font-weight: 500; }
.travel-card-af { font-size: var(--fs-sm); font-weight: 600; opacity: .8; background: rgba(0,0,0,.25); padding: var(--sp-1) var(--sp-3); border-radius: 20px; display: inline-block; }
.travel-card-body { padding: var(--sp-5); }
.card-section { margin-bottom: var(--sp-4); }
.card-section:last-child { margin-bottom: 0; }
.card-section-label { font-size: var(--fs-xxs); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .6px; margin-bottom: var(--sp-2); }
.card-section-text { font-size: var(--fs-md); color: var(--text); line-height: 1.5; }
.earning-rates-list { display: flex; flex-direction: column; gap: 4px; }
.earning-rate { display: flex; gap: 10px; align-items: baseline; font-size: var(--fs-md); padding: var(--sp-1) 0; }
.er-rate { font-weight: 700; color: var(--gold); min-width: 80px; }
.er-cat { color: var(--text-muted); }
.credits-list { display: flex; flex-direction: column; gap: 4px; }
.credit-row { display: flex; justify-content: space-between; font-size: var(--fs-md); padding: var(--sp-1) 0; border-bottom: 1px dashed var(--border); }
.credit-row:last-child { border-bottom: none; }
.credit-name { color: var(--text); }
.credit-value { color: var(--success); font-weight: 700; }
.credit-row-more { font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-1) 0; font-style: italic; }
.card-expand { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.card-expand summary { font-size: var(--fs-md); color: var(--link); font-weight: 600; cursor: pointer; padding: var(--sp-1) 0; }
.card-expand summary:hover { color: var(--link-hover); }
.card-expand-body { padding-top: var(--sp-3); display: flex; flex-direction: column; gap: 12px; }
.card-bullet { font-size: 12.5px; color: var(--text); line-height: 1.5; padding: var(--sp-1) 0; }
.transfer-partners { display: flex; flex-wrap: wrap; gap: 5px; }
.tp-chip { font-size: var(--fs-xs); padding: var(--sp-1) var(--sp-2); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); }
.card-no-benefits { padding: var(--sp-4); text-align: center; color: var(--text-muted); font-size: var(--fs-md); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm); font-style: italic; }
.travel-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.card-updated { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-3); text-align: right; }

/* Card color picker */
.card-color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.card-color-swatch { width: 56px; height: 36px; border-radius: 6px; cursor: pointer; border: 3px solid transparent; transition: all .15s; display: block; }
.card-color-swatch:hover { transform: scale(1.05); }
.card-color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }

/* Fetch mode modal */
.fetch-mode-card { display: flex; gap: 14px; padding: var(--sp-4); background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, transform .15s; margin-bottom: var(--sp-3); }
.fetch-mode-card:hover { border-color: var(--accent); transform: translateX(2px); }
.fetch-mode-recommended { border-color: var(--link); background: linear-gradient(135deg, var(--link-dim), var(--card-2)); }
.fetch-mode-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.fetch-mode-title { font-size: 15px; font-weight: 700; margin-bottom: var(--sp-1); display: flex; align-items: center; gap: 8px; }
.fetch-mode-card p { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.55; }
.badge-recommended { font-size: var(--fs-xxs); font-weight: 700; padding: var(--sp-1) var(--sp-2); background: var(--link); color: #fff; border-radius: 10px; letter-spacing: .3px; }

.closed-cards-section { margin-top: var(--sp-7); border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.closed-cards-section summary { font-size: var(--fs-md); color: var(--text-muted); font-weight: 600; cursor: pointer; }

/* Trip Planner (ported from TRO) */
.planner-mode-toggle { display: flex; gap: 4px; padding: var(--sp-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--sp-4); }
.planner-mode-btn { flex: 1; padding: var(--sp-3) var(--sp-4); background: none; border: none; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--fs-base); font-weight: 600; cursor: pointer; transition: all .15s; }
.planner-mode-btn:hover { color: var(--text); }
.planner-mode-btn.active { background: var(--accent); color: #fff; }
.planner-form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-6); margin-bottom: var(--sp-4); }
.planner-form-card h3 { font-size: 17px; font-weight: 700; margin-bottom: var(--sp-5); }

.flex-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.flex-chip { padding: var(--sp-2) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: var(--fs-md); color: var(--text-muted); cursor: pointer; font-weight: 600; transition: all .15s; }
.flex-chip:hover { border-color: var(--accent); color: var(--text); }
.flex-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.explore-dest-row { display: flex; gap: 8px; margin-bottom: var(--sp-2); align-items: center; }
.explore-dest-input { flex: 1; }

.planner-loading { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-8); text-align: center; color: var(--text-muted); }
.planner-error { background: var(--danger-dim); border: 1px solid var(--danger); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); color: var(--danger); }

/* Optimize result */
.trip-result-wrap { display: flex; flex-direction: column; gap: 20px; }
.trip-summary-card { background: linear-gradient(135deg, var(--accent-dim), var(--card)); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-6) 26px; }
.trip-summary-card h2 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.3px; }
.trip-exec-summary { font-size: var(--fs-base); line-height: 1.6; color: var(--text); margin: var(--sp-4) 0; padding: var(--sp-3); background: var(--card-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); }
.trip-summary-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.trip-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-5); }
.trip-stat-val { font-size: var(--fs-2xl); font-weight: 800; }
.trip-stat-lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.trip-metric-green { color: var(--success); }

.trip-components { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.trip-component { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.trip-component-header { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.trip-component-icon { font-size: var(--fs-2xl); }
.trip-component h4 { font-size: 15px; font-weight: 700; }
.trip-comp-strategy { font-size: var(--fs-md); line-height: 1.55; margin-bottom: var(--sp-3); color: var(--text); }
.trip-comp-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin: var(--sp-3) 0; }
.trip-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: var(--sp-2) var(--sp-3); text-align: center; }
.trip-metric-val { font-size: 15px; font-weight: 800; color: var(--text); }
.trip-metric-lbl { font-size: var(--fs-xxs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.trip-comp-howto { font-size: var(--fs-sm); color: var(--text-muted); padding: var(--sp-2) var(--sp-3); background: var(--accent-glow); border-radius: var(--radius-xs); margin-top: var(--sp-2); line-height: 1.5; }
.trip-comp-swipe { font-size: var(--fs-sm); color: var(--gold); padding: var(--sp-2) var(--sp-3); background: var(--gold-dim); border-radius: var(--radius-xs); margin-top: var(--sp-2); }
.trip-comp-alts { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--border); }
.trip-comp-alts summary { font-size: var(--fs-sm); color: var(--link); cursor: pointer; font-weight: 600; }
.trip-alt { font-size: var(--fs-sm); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border); color: var(--text); line-height: 1.5; }
.trip-alt:last-child { border-bottom: none; }
.trip-alt-pros { color: var(--success); margin-top: var(--sp-1); }
.trip-alt-cons { color: var(--gold); margin-top: var(--sp-1); }

.trip-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5) var(--sp-6); }
.trip-section h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-3); }
.trip-benefits-list { display: flex; flex-direction: column; gap: 8px; }
.trip-benefit-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: var(--sp-3) var(--sp-3); background: var(--card-2); border-radius: var(--radius-sm); font-size: var(--fs-md); }
.trip-benefit-value { font-size: var(--fs-base); font-weight: 700; color: var(--success); }
.trip-benefit-action { font-size: var(--fs-sm); color: var(--text-muted); text-align: right; }
.points-impact-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.points-impact-table th, .points-impact-table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.trip-flex-scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: var(--sp-3); }
.trip-flex-scenario { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card-2); }
.trip-flex-better { border-color: var(--success); }
.trip-flex-worse { border-color: var(--danger); }
.trip-flex-dates { font-size: var(--fs-sm); color: var(--text-muted); }
.trip-flex-label { font-size: var(--fs-base); font-weight: 700; margin: var(--sp-1) 0; }
.trip-flex-impact { font-size: var(--fs-sm); color: var(--text); }
.trip-lounges { display: flex; flex-direction: column; gap: 16px; }
.trip-lounge-airport h5 { font-size: var(--fs-base); font-weight: 700; margin-bottom: var(--sp-2); }
.trip-lounge-role { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.trip-lounge { padding: var(--sp-3); background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--sp-2); font-size: var(--fs-md); line-height: 1.6; }
.trip-lounge-card { color: var(--gold); font-size: var(--fs-sm); margin: var(--sp-1) 0; }
.trip-lounge-highlights { display: flex; gap: 4px; flex-wrap: wrap; margin-top: var(--sp-2); }
.trip-warnings { background: rgba(244,185,66,.06); border-color: rgba(244,185,66,.3); }
.trip-warnings ul, .trip-protips ul { padding-left: var(--sp-5); font-size: var(--fs-md); color: var(--text); line-height: 1.6; }

/* Explore result */
.explore-results h2 { font-size: var(--fs-2xl); font-weight: 800; margin-bottom: var(--sp-4); }
.explore-feasibility-banner { display: flex; align-items: flex-start; gap: 16px; padding: var(--sp-5) var(--sp-6); border: 1px solid; border-radius: var(--radius); margin-bottom: var(--sp-4); }
.explore-feas-icon { font-size: 28px; }
.explore-feas-verdict { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-1); }
.explore-feas-summary { font-size: var(--fs-base); color: var(--text); line-height: 1.55; margin-bottom: var(--sp-3); }
.explore-feas-stats { display: flex; flex-wrap: wrap; gap: 16px; }
.explore-feas-stats > div { display: flex; flex-direction: column; }
.explore-feas-stats .lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.explore-feas-stats .val { font-size: 15px; font-weight: 700; }
.explore-budget-note { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); font-style: italic; }
.explore-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-4); }
.explore-section h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-3); }
.explore-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.explore-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); }
.explore-card-title { font-size: var(--fs-base); font-weight: 700; }
.explore-card-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.explore-card-rec { font-size: var(--fs-md); color: var(--gold); margin-top: var(--sp-2); }
.explore-card-detail { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); line-height: 1.5; }
.explore-benefits-list { display: flex; flex-direction: column; gap: 8px; }
.explore-benefit-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: var(--sp-3) var(--sp-3); background: var(--card-2); border-radius: var(--radius-sm); font-size: var(--fs-md); }
.explore-benefit-right { display: flex; align-items: center; gap: 10px; }
.explore-benefit-val { color: var(--success); font-weight: 700; }
.explore-rec-card { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-4); }
.explore-rec-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-3); gap: 14px; flex-wrap: wrap; }
.explore-rec-total { font-size: 15px; margin-bottom: var(--sp-1); }
.explore-points-savings { font-size: var(--fs-md); color: var(--gold); margin-top: var(--sp-2); }
.explore-rec-routing { padding: var(--sp-3); background: var(--accent-glow); border-radius: var(--radius-xs); font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.explore-rec-tradeoffs { margin-bottom: var(--sp-3); padding: var(--sp-3); background: rgba(244,185,66,.06); border-left: 2px solid var(--gold); border-radius: var(--radius-xs); }
.explore-rec-tradeoffs .label { font-size: var(--fs-xs); color: var(--gold); font-weight: 700; margin-bottom: var(--sp-1); text-transform: uppercase; letter-spacing: .5px; }
.explore-rec-tradeoffs > div:not(.label) { font-size: var(--fs-md); color: var(--text); padding: var(--sp-1) 0; }
.explore-rec-breakdown { font-size: var(--fs-md); font-family: 'SFMono-Regular', Consolas, monospace; line-height: 1.7; white-space: pre-wrap; color: var(--text); padding-top: var(--sp-3); border-top: 1px dashed var(--border); }
.explore-booking { padding: var(--sp-3) var(--sp-4); background: var(--accent-glow); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.explore-tips-list { padding-left: var(--sp-5); font-size: var(--fs-md); line-height: 1.6; color: var(--text); }

/* Compare Cards (ported from TRO) */
.compare-subnav { display: flex; align-items: center; gap: 4px; margin-bottom: var(--sp-4); border-bottom: 1px solid var(--border); padding-bottom: 0; }
.compare-subnav-btn { padding: var(--sp-3) var(--sp-4); background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: var(--fs-base); font-weight: 600; cursor: pointer; margin-bottom: -1px; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.compare-subnav-btn:hover { color: var(--text); }
.compare-subnav-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.compare-subnav-count { font-size: var(--fs-xs); font-weight: 700; padding: 1px var(--sp-2); background: var(--danger-dim); color: var(--danger); border-radius: 10px; }

.compare-usage-bar { display: flex; gap: 20px; flex-wrap: wrap; padding: var(--sp-4) var(--sp-5); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--sp-4); }
.compare-usage-stat { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--text-muted); }
.compare-usage-stat strong { color: var(--text); font-weight: 700; }
.usage-dot { width: 10px; height: 10px; border-radius: 50%; }
.usage-dot.used    { background: var(--success); box-shadow: 0 0 6px rgba(15,186,121,.5); }
.usage-dot.unused  { background: var(--gold); box-shadow: 0 0 6px rgba(244,185,66,.5); }
.usage-dot.skipped { background: var(--text-dim); }

.compare-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.compare-table-wrap::-webkit-scrollbar { height: 10px; }
.compare-table-wrap::-webkit-scrollbar-track { background: var(--surface); }
.compare-table-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
.compare-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.compare-table th, .compare-table td { padding: var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.compare-table th:last-child, .compare-table td:last-child { padding-right: var(--sp-5); }
.compare-label-col { width: 180px; min-width: 180px; max-width: 180px; font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); background: var(--surface); position: sticky; left: 0; z-index: 2; box-shadow: 2px 0 4px rgba(0,0,0,.25); }
.compare-sub-label { padding-left: var(--sp-6) !important; font-size: var(--fs-sm); font-weight: 500; }
.compare-card-col { background: var(--surface); border-bottom: 2px solid var(--accent); padding: var(--sp-3) !important; min-width: 220px; max-width: 280px; }
.compare-cell { min-width: 220px; max-width: 280px; }
.compare-card-header-name { font-size: var(--fs-base); font-weight: 700; color: var(--text); margin-bottom: var(--sp-1); }
.compare-card-header-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-2); }
.compare-card-header-fee { font-size: var(--fs-xs); color: var(--text-muted); background: var(--card); padding: var(--sp-1) var(--sp-2); border-radius: 10px; font-weight: 500; }
.compare-section-row td { background: var(--card-2); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); padding: var(--sp-3) var(--sp-4) !important; border-top: 1px solid var(--border); }
.compare-cell { font-size: var(--fs-md); color: var(--text); }
.compare-cell.no-value { color: var(--text-dim); }
.compare-cell.best-rate-cell { background: rgba(244,185,66,.08); }
.compare-none { opacity: .5; }
.compare-multiline { display: block; line-height: 1.55; color: var(--text-muted); font-size: var(--fs-sm); }
.compare-benefit-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.compare-benefit-list li { font-size: var(--fs-sm); color: var(--text); line-height: 1.5; padding-left: var(--sp-3); position: relative; }
.compare-benefit-list li::before { content: '•'; position: absolute; left: 0; color: var(--accent); }
.compare-partner-list { display: flex; flex-wrap: wrap; gap: 4px; }
.rate-chip { display: inline-block; padding: var(--sp-1) 9px; background: var(--accent-dim); color: var(--accent); border-radius: 6px; font-size: var(--fs-sm); font-weight: 700; }
.rate-chip.best-rate { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(244,185,66,.4); }
.best-rate-crown { margin-left: var(--sp-1); font-size: var(--fs-md); }

.credit-cell { display: flex; flex-direction: column; gap: 4px; }
.credit-amount { font-weight: 700; color: var(--success); font-size: var(--fs-md); }
.credit-amount.is-used { color: var(--text-dim); text-decoration: line-through; }
.credit-amount.is-skipped { color: var(--text-dim); }
.credit-desc { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.4; }
.usage-btn-group { display: flex; gap: 4px; flex-wrap: wrap; margin-top: var(--sp-1); }
.usage-toggle {
  font-size: var(--fs-xxs);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-xs);
  border: 1px solid;
  background: none;
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.usage-toggle.unused { color: var(--text-muted); border-color: var(--border); }
.usage-toggle.unused:hover { color: var(--success); border-color: var(--success); background: var(--success-dim); }
.usage-toggle.used { color: var(--success); border-color: var(--success); background: var(--success-dim); }
.usage-toggle.skipped { color: var(--text-dim); border-color: var(--border-2); background: rgba(139,163,194,.1); }

.unused-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.unused-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .15s; }
.unused-filter-chip:hover { border-color: var(--accent); color: var(--text); }
.unused-filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.unused-filter-count { font-size: var(--fs-xs); padding: 1px var(--sp-2); background: rgba(255,255,255,.2); border-radius: 10px; }
.unused-filter-chip:not(.active) .unused-filter-count { background: var(--card); color: var(--text-muted); }
.unused-filter-value { font-size: var(--fs-xs); color: var(--success); font-weight: 700; }
.unused-filter-chip.active .unused-filter-value { color: #fff; }
.unused-summary { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); color: var(--text-muted); }
.unused-summary strong { color: var(--success); font-size: 17px; }
.unused-list { display: flex; flex-direction: column; gap: 8px; }
.unused-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.unused-row:hover { border-color: var(--accent); }
.unused-benefit-name { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.unused-benefit-desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); line-height: 1.5; }
.unused-card-link { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-1); }
.unused-row-value { font-size: var(--fs-base); font-weight: 700; color: var(--success); white-space: nowrap; }
.unused-row-actions { display: flex; gap: 4px; }

@media (max-width: 900px) {
  .compare-label-col { width: 140px; }
}

/* Points & Miles — table layout (TRO parity) */
.points-totals-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: var(--sp-5); }
.points-total-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); text-align: center; }
.points-total-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--text); margin-bottom: var(--sp-1); }
.points-total-value-green { color: var(--success); }
.points-total-label { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.points-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.points-table { width: 100%; border-collapse: collapse; }
.points-table th { text-align: left; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); background: var(--surface); }
.points-table th.num-col { text-align: right; }
.points-table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.points-table td.num-col { text-align: right; }
.points-table tr:last-child td { border-bottom: none; }
.points-table tbody tr:hover { background: var(--card-2); }
.prog-name { font-size: var(--fs-base); font-weight: 600; }
.prog-linked { font-size: var(--fs-xs); color: var(--link); margin-top: var(--sp-1); }
.prog-notes { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-1); font-style: italic; }
.pts-total-cell { font-size: var(--fs-base); font-weight: 700; color: var(--success); }

.inline-num-input {
  width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-md);
  font-weight: 600;
  outline: none;
  transition: border-color .15s;
  text-align: right;
}
.inline-num-input:focus { border-color: var(--accent); }
.cpp-input-wrap { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.cpp-input-wrap .inline-num-input { width: 80px; }
.cpp-prefix, .cpp-suffix { font-size: var(--fs-sm); color: var(--text-muted); }

@media (max-width: 900px) {
  .points-totals-bar { grid-template-columns: 1fr; }
  .points-table { font-size: var(--fs-md); }
  .inline-num-input { width: 80px; }
  .cpp-input-wrap .inline-num-input { width: 60px; }
}

.trips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.trip-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); cursor: pointer; transition: border-color .15s, transform .15s; display: flex; flex-direction: column; }
.trip-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.trip-card-actions { margin-top: auto; padding-top: var(--sp-3); display: flex; justify-content: flex-end; }
.trip-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: var(--sp-3); margin-bottom: var(--sp-2); }
.trip-badge { font-size: var(--fs-xxs); font-weight: 700; padding: var(--sp-1) var(--sp-2); border-radius: 10px; letter-spacing: .3px; }
.trip-badge-optimize { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(91,110,245,.3); }
.trip-badge-explore  { background: var(--link-dim); color: var(--link); border: 1px solid rgba(74,222,128,.3); }
.trip-badge-itin     { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(244,185,66,.3); }

.trip-detail-notes { padding: var(--sp-3); background: var(--accent-glow); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: var(--fs-base); line-height: 1.55; margin-bottom: var(--sp-5); }

/* Activity Planner form */
.meal-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.meal-chip { padding: var(--sp-2) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: var(--fs-md); color: var(--text-muted); cursor: pointer; font-weight: 600; transition: all .15s; }
.meal-chip:hover { border-color: var(--accent); color: var(--text); }
.meal-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.rank-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rank-chip { display: inline-flex; align-items: center; gap: 6px; padding: var(--sp-2) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; font-size: var(--fs-md); color: var(--text-muted); cursor: pointer; font-weight: 500; transition: all .15s; position: relative; }
.rank-chip:hover { border-color: var(--accent); color: var(--text); }
.rank-chip.selected { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); font-weight: 700; }
.rank-badge { background: var(--accent); color: #fff; font-size: var(--fs-xxs); font-weight: 800; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }

/* Itinerary display */
.itin-summary { padding: var(--sp-4) var(--sp-5); background: var(--accent-glow); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: var(--fs-base); color: var(--text); line-height: 1.6; margin-bottom: var(--sp-5); }
.itin-days { display: flex; flex-direction: column; gap: 18px; }
.itin-day { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); }
.itin-day-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.itin-day-label { font-size: var(--fs-xs); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .6px; }
.itin-day-title { font-size: 17px; font-weight: 700; color: var(--text); margin-top: var(--sp-1); }
.itin-day-date { font-size: var(--fs-md); color: var(--text-muted); font-weight: 600; }
.itin-items { display: flex; flex-direction: column; gap: 12px; }
.itin-item { display: grid; grid-template-columns: 70px 30px 1fr; gap: 12px; align-items: start; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.itin-item-restaurant { border-left: 3px solid var(--gold); }
.itin-item-activity { border-left: 3px solid var(--accent); }
.itin-item-transport { border-left: 3px solid var(--text-dim); background: rgba(0,0,0,.15); }
.itin-time { font-size: var(--fs-md); font-weight: 700; color: var(--text-muted); }
.itin-icon { font-size: var(--fs-xl); line-height: 1.2; }
.itin-body { min-width: 0; }
.itin-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: var(--sp-1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.itin-meal-type { font-size: var(--fs-xxs); font-weight: 800; padding: var(--sp-1) var(--sp-2); background: var(--gold-dim); color: var(--gold); border-radius: 10px; text-transform: uppercase; letter-spacing: .3px; }
.itin-category { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; }
.itin-desc { font-size: var(--fs-md); color: var(--text); line-height: 1.5; margin-bottom: var(--sp-1); }
.itin-why { font-size: var(--fs-sm); color: var(--gold); line-height: 1.5; margin: var(--sp-1) 0; }
.itin-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--fs-xs); color: var(--text-muted); margin: var(--sp-2) 0; }
.itin-tips { font-size: var(--fs-sm); color: var(--link); line-height: 1.5; margin-top: var(--sp-1); padding: var(--sp-2) var(--sp-2); background: var(--link-dim); border-radius: var(--radius-xs); }
.itin-booking { margin-top: var(--sp-2); }
.itin-booking a { font-size: var(--fs-md); color: var(--link); font-weight: 700; }
.itin-tips-block { background: var(--gold-dim); border: 1px solid rgba(244,185,66,.3); border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-5); }
.itin-tips-block h5 { font-size: var(--fs-md); color: var(--gold); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-bottom: var(--sp-2); }
.itin-tips-block ul { padding-left: var(--sp-5); font-size: var(--fs-md); line-height: 1.7; color: var(--text); }
.trip-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-2); }
.trip-card-header h4 { font-size: var(--fs-lg); font-weight: 700; }
.trip-dates { font-size: var(--fs-md); color: var(--link); font-weight: 600; margin-bottom: var(--sp-2); }
.trip-purpose, .trip-budget { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-1); }
.trip-notes { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); }

.purchase-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-6); }

/* TRO import paste modal */
.tro-steps { display: flex; flex-direction: column; gap: 12px; }
.tro-step { display: flex; gap: 14px; align-items: flex-start; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-base); line-height: 1.5; }
.tro-step-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: var(--fs-md); }
.tro-step code { background: var(--card); padding: var(--sp-1) var(--sp-2); border-radius: 4px; color: var(--link); font-size: 12.5px; font-family: 'SFMono-Regular', Consolas, monospace; }
.tro-code { display: inline-block; margin-top: var(--sp-2); font-size: var(--fs-md); font-weight: 600; }
.tro-step kbd { background: var(--card); border: 1px solid var(--border-2); border-radius: 4px; padding: 1px var(--sp-2); font-size: var(--fs-sm); font-family: monospace; }
.tro-preview { margin-top: var(--sp-4); padding: var(--sp-4) var(--sp-5); background: var(--link-dim); border: 1px solid rgba(74,222,128,.3); border-radius: var(--radius-sm); }
.tro-preview-header { font-size: var(--fs-md); font-weight: 700; color: var(--link); margin-bottom: var(--sp-3); }
.tro-preview-stats { display: flex; gap: 18px; }
.tro-stat { font-size: var(--fs-md); color: var(--text); }
.tro-stat strong { color: var(--link); font-size: 15px; }

/* AwardWallet paste preview */
.aw-preview { margin-top: var(--sp-5); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.aw-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.aw-preview-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.aw-preview-table th { text-align: left; padding: var(--sp-2) var(--sp-3); color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.aw-preview-table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.aw-preview-table tr:last-child td { border-bottom: none; }
.aw-preview-table tbody tr:hover { background: var(--card-2); }
.aw-preview-table input[type=checkbox] { cursor: pointer; }
.aw-new-badge { font-size: var(--fs-xxs); font-weight: 700; padding: var(--sp-1) var(--sp-2); background: var(--link-dim); color: var(--link); border-radius: 10px; margin-left: var(--sp-2); letter-spacing: .3px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .dashboard-hero { grid-template-columns: 1fr; gap: 20px; }
  .checkin-layout { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  /* ── Hide desktop sidebar, show bottom tabs ── */
  .sidebar { display: none !important; }
  .bottom-tab-bar { display: flex !important; }

  /* Topbar mobile rules moved to css/topbar.mobile.css per
     ui-platform-convention.md (css_only_split). The content-area
     padding-top compensation also moved there (it pairs with the fixed
     header). Content-area padding-bottom for tab-bar clearance stays here. */

  /* ── Content area: room for tab bar ── */
  .content-area { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
  .page-layout, .dashboard-layout { padding-bottom: var(--sp-6) !important; }

  /* ── Page layouts ──
     Pacific :root .page-layout has 0,2,0 specificity which beat the plain
     .page-layout rule below — so on mobile, regular pages were keeping the
     chunky sp-8 horizontal padding while the dashboard (no Pacific override)
     collapsed correctly. Match specificity here so every page narrows the
     same amount at ≤900px. */
  .page, .page-layout, .dashboard-layout, .settings-layout,
  :root .page-layout, :root .dashboard-layout, :root .settings-layout,
  [data-theme="pacific"] .page-layout,
  [data-theme="pacific"] .dashboard-layout,
  [data-theme="pacific"] .settings-layout {
    padding: var(--sp-4);
    max-width: none;
  }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .page-actions .btn { flex: 1; min-width: 0; text-align: center; font-size: var(--fs-sm); padding: var(--sp-2) var(--sp-2); }

  /* ── Grid collapses ── */
  .two-col,.three-col,.dashboard-grid { grid-template-columns:1fr; }
  .tasks-layout { grid-template-columns:1fr; }
  .form-row,.form-row-3 { grid-template-columns:1fr; }
  .habits-grid, .goals-grid { grid-template-columns: 1fr; }
  .library-filters { grid-template-columns: 1fr; }
  .interaction-row { grid-template-columns: 1fr; }

  /* ── Contacts: stack instead of grid ── */
  .contact-row { grid-template-columns: 40px 1fr; gap: 10px; padding: var(--sp-3) var(--sp-3); }
  .contact-cadence, .contact-value { display: none; }
  .contact-actions { grid-column: 1 / -1; justify-content: flex-end; }

  /* Communications mobile row grid + .comm-row-actions/.comm-row-summary
     hide migrated to css/communications.mobile.css on 2026-05-09. */

  /* ── Tabs: horizontal scroll only.
     overflow-x: auto + overflow-y: hidden + touch-action: pan-x locks the
     row to horizontal panning. Without overflow-y: hidden, the spec
     implicitly turns y into auto, which lets the row scroll vertically too.
     overscroll-behavior-x: contain stops swipe-at-edge from triggering
     browser back/forward gestures. ── */
  .tabs {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    margin-bottom: var(--sp-4);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab, .tabs .tab-btn {
    flex-shrink: 0;
    font-size: var(--fs-md);
    padding: var(--sp-3) var(--sp-4);
    white-space: nowrap;
    margin-bottom: 0;
    border-bottom-width: 2px;
    min-height: 44px;
  }

  /* ── Modals: full-screen on mobile ── */
  /* padding-bottom: env(safe-area-inset-bottom) keeps the modal footer above
     the iPhone home indicator when align-items: flex-end pins to the very
     bottom edge. Without it, ~34px of the footer hides behind the home bar. */
  .modal-overlay { align-items: flex-end; padding: 0; padding-bottom: env(safe-area-inset-bottom, 0); }
  /* Use dvh so the modal tracks the dynamic viewport — 92vh on iOS refers to
     the large viewport (URL bar collapsed) and would clip the header above
     the visible area when the URL bar is showing. Subtract the safe-area
     inset so the modal max-height accounts for the home-indicator gap. */
  .modal { width: 100%; max-width: 100%; max-height: 92vh; max-height: calc(92dvh - env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; margin: 0; }
  .modal.modal-lg { width: 100%; max-width: 100%; }
  /* Modal body: use visualViewport-driven height (JS sets --vvh); fall back to
     a conservative dvh which already accounts for the URL bar. This prevents
     the content being pushed under the soft keyboard on iOS Safari. */
  .modal-body { max-height: calc(var(--vvh, 70dvh) - 140px); -webkit-overflow-scrolling: touch; }

  /* ── Touch targets: iOS HIG minimum 44px. btn-icon-sm was previously 28px
     and sat next to 44px primary buttons, causing tap-miss frustration. ── */
  .btn, .btn-sm, .btn-icon, .btn-icon-sm { min-height: 44px; min-width: 44px; }
  .filter-chip { min-height: 36px; padding: var(--sp-2) var(--sp-3); }
  .nav-item { min-height: 44px; }
  /* font-size:16px now applied globally on .form-control — keep tap-target only */
  .form-control, select.form-control { min-height: 44px; }

  /* ── Topic chips: wrap and scroll ── */
  .topics-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topics-bar-chips { flex-wrap: wrap; }

  /* ── Task list rows: stack left+right halves vertically on mobile so the
     right-column pills (priority/leverage/due/etc.) and action buttons don't
     overlap or overflow when the row is narrow. ── */
  .task-item { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
  .task-item-left { width: 100%; }
  .task-item-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .task-item-actions { margin-left: auto; }
  .task-item-meta { row-gap: 6px; }

  /* ── Settings: full-width ── */
  .settings-layout { max-width: 100%; }
  .settings-section { padding: var(--sp-4); }

  /* ── Knowledge page actions ── */
  .page-title { font-size: var(--fs-xl); }
  .page-subtitle { font-size: var(--fs-sm); }

  /* ── Stats bar: 2 cols ── */
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .detail-stats-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* ═══════════════════════ Bottom Tab Bar ═══════════════════════ */

.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--sp-2) 0;
  min-width: 56px;
  font-size: var(--fs-xxs);
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s;
}

.bottom-tab.active { color: var(--accent); }
.bottom-tab-icon { font-size: var(--fs-2xl); line-height: 1; }
.bottom-tab-label { letter-spacing: 0.02em; }

/* ═══════════════════════ More Sheet ═══════════════════════ */

.more-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity .2s;
}
.more-sheet-overlay.hidden { display: none; }

.more-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: var(--sp-2) var(--sp-4) calc(16px + env(safe-area-inset-bottom, 0px));
  animation: sheetUp .25s ease-out;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.more-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-1) var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-3);
}

.more-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.more-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-4) var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.more-sheet-item:active { background: var(--card-2); }
.more-sheet-item span:first-child { font-size: 24px; }

/* Integration sub-section in More sheet */
.more-sheet-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-dim);
  padding: var(--sp-4) var(--sp-1) var(--sp-2);
  margin-top: var(--sp-2);
  border-top: 1px solid var(--border);
}
.more-sheet-item.integration-item {
  flex-direction: row;
  justify-content: flex-start;
  font-size: var(--fs-md);
  padding: var(--sp-3);
  text-align: left;
}
.more-sheet-item.integration-item .integration-dot {
  font-size: 0; /* nullify the 24px first-child rule */
  width: 8px; height: 8px; flex: 0 0 8px;
  border-radius: 50%; background: #4a5e76;
  display: inline-block;
}
.more-sheet-item.integration-item .integration-dot[data-status="active"] {
  background: #5ac53a; box-shadow: 0 0 8px rgba(90, 197, 58, 0.5);
}
.more-sheet-item.integration-item .integration-dot[data-status="error"] {
  background: var(--danger); box-shadow: 0 0 8px rgba(240, 63, 63, 0.4);
}

/* ═══════════════════════ Orbit ═══════════════════════ */

:root { --c-orbit: #d946ef; }

/* Orbit selector pills */
.orbit-selector {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--sp-4);
}
.orbit-pill {
  padding: 10px 20px; border-radius: var(--radius-sm, 8px); border: 1px solid var(--border);
  background: var(--card); color: var(--text-muted); font-size: var(--fs-base); font-weight: 600;
  cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.orbit-pill:hover { border-color: var(--accent); color: var(--text); }
.orbit-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px var(--accent-glow); }
.orbit-pill-add { border-style: dashed; color: var(--text-dim); }
.orbit-pill-add:hover { border-color: var(--accent); color: var(--accent); }

/* Category pill — the top-level Couples / Children / Family / Friends
   selector. Always visible, rectangular, slightly larger than regular
   orbit pills. Empty categories (no orbits yet) render with a dimmed
   appearance so users can still click in and invite. */
.orbit-category-pill {
  padding: 14px 22px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-size: var(--fs-base); font-weight: 700;
  cursor: pointer; transition: all .18s ease;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 120px; justify-content: center;
}
.orbit-category-pill:hover { border-color: var(--accent); background: var(--accent-glow, rgba(90,197,58,.08)); }
.orbit-category-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 3px 12px var(--accent-glow, rgba(90,197,58,.25));
}
.orbit-category-pill.empty { opacity: .72; }
.orbit-category-pill.empty.active { opacity: 1; }
.orbit-category-pill .cat-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: rgba(255,255,255,.22); font-size: var(--fs-sm); font-weight: 700;
}
.orbit-category-pill:not(.active) .cat-count { background: var(--surface); color: var(--text-muted); }

/* Sub-selector inside a category (used when the user has multiple family
   or friend orbits, or multiple children). Same rectangular look as the
   category pills but slightly smaller. */
.orbit-sub-selector { display: flex; gap: 8px; flex-wrap: wrap; margin: var(--sp-3) 0; }
.orbit-sub-pill {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-weight: 600;
  font-size: var(--fs-sm); cursor: pointer; transition: all .15s;
}
.orbit-sub-pill:hover { border-color: var(--accent); }
.orbit-sub-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.orbit-pill-wrap { position: relative; display: inline-flex; }
.orbit-pill-delete {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--danger); color: #fff; border: none;
  font-size: var(--fs-xxs); font-weight: 700; cursor: pointer; display: none;
  align-items: center; justify-content: center; line-height: 1; z-index: 2;
}
.orbit-pill-wrap:hover .orbit-pill-delete { display: flex; }

.orbit-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: var(--sp-5); }
.orbit-setup-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-6); text-align: center;
}
.orbit-setup-card h3 { margin-bottom: var(--sp-2); color: var(--c-orbit); }
.orbit-setup-card p { color: var(--text-muted); font-size: var(--fs-base); margin-bottom: var(--sp-4); }

/* Orbit notification panel */
.orbit-notif-panel { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-4); }
.orbit-notif-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(244,63,115,.08), rgba(244,63,115,.03));
  border: 1px solid rgba(244,63,115,.25);
  transition: opacity .3s;
}
.orbit-notif-content { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-md); color: var(--text); }
.orbit-notif-content strong { font-size: var(--fs-base); }
.orbit-notif-actions { display: flex; gap: 6px; flex-shrink: 0; }

.orbit-suggest-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
  margin-bottom: var(--sp-2); transition: border-color .2s;
}
.orbit-suggest-card:hover { border-color: var(--accent); }
.orbit-link-badge {
  display: inline-flex; padding: 1px var(--sp-2); border-radius: 10px;
  background: var(--accent-dim); font-size: var(--fs-xs); text-decoration: none;
  margin-left: var(--sp-1); vertical-align: middle;
}
.orbit-activity-card { cursor: pointer; }
.orbit-activity-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.orbit-invite-card {
  max-width: 400px; margin: var(--sp-8) auto; background: var(--card);
  border: 2px solid var(--c-orbit); border-radius: var(--radius);
  padding: var(--sp-7); text-align: center;
}
.orbit-invite-code {
  font-size: 40px; font-weight: 800; letter-spacing: 8px; color: var(--c-orbit);
  margin: var(--sp-4) 0; font-family: monospace;
}

.orbit-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: var(--sp-3); }
.orbit-home-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); display: flex; flex-direction: column; }
.orbit-section-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: var(--sp-3); }

.orbit-home-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: var(--sp-5);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4);
}

.orbit-activity-list { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.orbit-activity-item {
  display: flex; align-items: flex-start; gap: 10px; padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}
.orbit-activity-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c-orbit);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700; flex-shrink: 0;
}
.orbit-activity-item.mine .orbit-activity-avatar { background: var(--accent); }
.orbit-activity-item.is-new { background: color-mix(in srgb, var(--c-orbit) 10%, transparent); border-left: 2px solid var(--c-orbit); padding-left: var(--sp-2); margin-left: -10px; }
.orbit-activity-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orbit-activity-text { font-size: var(--fs-md); color: var(--text); }
.orbit-activity-time { font-size: var(--fs-xs); color: var(--text-dim); }
.orbit-activity-badge { display: inline-block; margin-left: var(--sp-2); padding: var(--sp-1) var(--sp-2); background: var(--c-orbit); color: #fff; border-radius: 10px; font-size: var(--fs-xs); font-weight: 600; vertical-align: middle; }

.digest-pick { padding: var(--sp-3) var(--sp-3); margin-bottom: var(--sp-3); background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.digest-pick-title { font-size: var(--fs-base); font-weight: 600; color: var(--text); margin-bottom: var(--sp-1); }
.digest-pick-why { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-2); }
.digest-pick-meta { font-size: var(--fs-sm); color: var(--text-dim); }
.digest-pick-meta a { color: var(--accent); text-decoration: none; }

.orbit-messages-list { max-height: 350px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-3); padding-right: var(--sp-1); }
.orbit-message { display: flex; flex-direction: column; }
.orbit-message.mine { align-items: flex-end; }
.orbit-message.partner { align-items: flex-start; }
.orbit-message-bubble {
  padding: var(--sp-2) var(--sp-4); border-radius: 16px; max-width: 80%; font-size: var(--fs-base); line-height: 1.4;
  word-wrap: break-word;
}
.orbit-message.mine .orbit-message-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.orbit-message.partner .orbit-message-bubble { background: var(--card-2); color: var(--text); border-bottom-left-radius: 4px; }
.orbit-message-meta { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-1); padding: 0 var(--sp-1); }
.orbit-message-input { display: flex; gap: 8px; margin-top: auto; }
.orbit-message-input .form-control { flex: 1; }

.orbit-section-header { display: flex; justify-content: flex-end; margin-bottom: var(--sp-3); }

.orbit-card {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--c-orbit);
  border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-4); cursor: pointer;
  margin-bottom: var(--sp-2); transition: border-color .15s;
}
.orbit-card:hover { border-color: var(--c-orbit); }
.orbit-card-done { opacity: 0.5; }
.orbit-card-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: var(--sp-1); }
.orbit-card-sub { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-2); }
.orbit-card-meta { display: flex; gap: 12px; font-size: var(--fs-sm); color: var(--text-dim); flex-wrap: wrap; }
.orbit-attr { color: var(--c-orbit); font-weight: 600; }

/* Orbit check-in actions */
.orbit-checkin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Slider row */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row .form-range { flex: 1; accent-color: var(--accent); }
.slider-value { font-size: 20px; font-weight: 800; color: var(--accent); min-width: 28px; text-align: center; }

@media (max-width: 900px) {
  .orbit-home-grid { grid-template-columns: 1fr; }
  .orbit-home-stats { grid-template-columns: repeat(2, 1fr); }
  .orbit-setup { grid-template-columns: 1fr; }
  .orbit-selector { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════ Global High-Tech Treatment ═══════════════════════ */

/* Universal glass card — applied to all card-like containers */
.dashboard-card, .goal-card, .area-card, .task-item, .project-row,
.habit-card, .checkin-section, .knowledge-item, .capture-item,
.contact-row, .orbit-card, .orbit-home-section, .orbit-habit-card,
.settings-section, .day-plan-card, .weekly-scorecard {
  background: linear-gradient(135deg, var(--card), var(--surface)) !important;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
}
.dashboard-card::before, .goal-card::before, .area-card::before,
.habit-card::before, .checkin-section::before, .knowledge-item::before,
.capture-item::before, .orbit-card::before, .orbit-home-section::before,
.settings-section::before, .weekly-scorecard::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0; transition: opacity .3s;
}
.dashboard-card:hover::before, .goal-card:hover::before, .area-card:hover::before,
.habit-card:hover::before, .knowledge-item:hover::before, .capture-item:hover::before,
.orbit-card:hover::before, .orbit-home-section:hover::before, .settings-section:hover::before {
  opacity: 1;
}

/* Universal hover glow */
.dashboard-card:hover, .goal-card:hover, .area-card:hover,
.habit-card:hover, .knowledge-item:hover, .capture-item:hover,
.orbit-card:hover, .orbit-home-section:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 0 16px var(--accent-glow);
  transform: translateY(-2px);
}

/* Page headers — glowing titles */
.page-title {
  text-shadow: 0 0 20px var(--accent-glow);
}
.page-subtitle {
  color: var(--text-muted);
}

/* Section titles — accent treatment */
.card-header h3, .card-title, .settings-section-title,
.checkin-section-header h3, .orbit-section-title,
.detail-section-title {
  color: var(--accent) !important;
  text-shadow: 0 0 12px var(--accent-glow);
  letter-spacing: .04em;
}

/* Stats bar items — breathing glow */
.stat-item, .detail-stat, .sc-metric {
  background: linear-gradient(135deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  transition: all .25s ease;
  position: relative;
}
.stat-item:hover, .detail-stat:hover, .sc-metric:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-3px) scale(1.02);
}
.stat-item .detail-stat-num, .detail-stat .detail-stat-num, .sc-value {
  text-shadow: 0 0 12px var(--accent-glow);
}

/* Dashboard hero — upgraded gradient */
.dashboard-hero {
  background: linear-gradient(135deg, var(--card), var(--accent-dim)) !important;
  border: 1px solid var(--accent) !important;
  position: relative; overflow: hidden;
}
.dashboard-hero::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 40% 40%, var(--accent-glow) 0%, transparent 50%);
  animation: ringRotate 20s linear infinite;
  pointer-events: none; opacity: .5;
}
.dashboard-hero h1, .hero-greeting h1 {
  position: relative; z-index: 1;
  text-shadow: 0 0 20px var(--accent-glow);
}

/* Buttons — neon glow */
.btn-primary, .btn-accent {
  position: relative;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all .2s ease;
}
.btn-primary:hover, .btn-accent:hover {
  box-shadow: 0 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,.3) !important;
  text-shadow: 0 0 8px rgba(255,255,255,.3);
}
.btn-primary:active, .btn-accent:active {
  transform: scale(0.97);
  box-shadow: 0 0 12px var(--accent-glow) !important;
}
/* Consistent tap feedback on every button class — iOS shows a gray flash
   by default on taps; suppress that so our scale animation is the only
   visible feedback. */
.btn, .btn-icon, .btn-icon-sm, .tab, .tab-btn, .nav-item, .filter-chip,
.bottom-tab, .more-sheet-item {
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .btn-icon:active, .btn-icon-sm:active { transform: scale(0.97); }
.btn, .btn-icon, .btn-icon-sm { transition: transform .08s ease, background-color .15s, color .15s, border-color .15s; }
.btn-ghost {
  transition: all .2s ease;
}
.btn-ghost:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Form inputs — focus glow */
.form-control:focus, select.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 16px var(--accent-glow) !important;
}

/* Sidebar — subtle depth */
.sidebar {
  background: linear-gradient(180deg, var(--surface), var(--bg)) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 4px 0 24px rgba(0,0,0,.3);
}
.nav-item {
  transition: all .2s ease;
  border-radius: var(--radius-xs);
  margin: var(--sp-1) var(--sp-2);
}
.nav-item:hover {
  background: var(--accent-glow) !important;
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-item.active {
  background: var(--accent-dim) !important;
  box-shadow: inset 0 0 12px var(--accent-glow), 0 0 8px var(--accent-glow);
}

/* Bottom tab bar — glass */
.bottom-tab-bar {
  background: linear-gradient(180deg, var(--surface), var(--bg)) !important;
  box-shadow: 0 -4px 24px rgba(0,0,0,.4);
  border-top: 1px solid var(--border);
}
.bottom-tab.active .bottom-tab-icon {
  text-shadow: 0 0 12px var(--accent);
}
.bottom-tab.active .bottom-tab-label {
  text-shadow: 0 0 8px var(--accent-glow);
}

/* Modal — enhanced glass */
.modal {
  background: linear-gradient(135deg, var(--card), var(--surface)) !important;
  box-shadow: 0 16px 64px rgba(0,0,0,.6), 0 0 40px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.05) !important;
  border: 1px solid var(--border);
}
.modal-overlay.open {
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-header {
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

/* Toast — glass + glow */
.toast {
  background: linear-gradient(135deg, var(--card), var(--surface)) !important;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 16px var(--accent-glow);
}

/* Tabs — enhanced active state */
.tab {
  transition: all .2s ease;
}
.tab:hover {
  color: var(--text);
  text-shadow: 0 0 8px var(--accent-glow);
}
.tab.active {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

/* Contact avatar — glow ring */
.contact-avatar {
  box-shadow: 0 0 8px rgba(0,0,0,.3);
  transition: box-shadow .2s;
}
.contact-row:hover .contact-avatar {
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Habit check — glow on checked */
.habit-check.checked, .task-check.checked {
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Badge/chip hover — subtle glow */
.filter-chip:hover, .topic-chip:hover {
  box-shadow: 0 0 10px var(--accent-glow);
}
.filter-chip.selected, .topic-chip.selected {
  box-shadow: 0 0 12px var(--accent-glow);
  text-shadow: 0 0 6px rgba(255,255,255,.2);
}

/* Overdue dot — upgraded pulse */
.overdue-dot {
  text-shadow: 0 0 8px var(--danger);
}

/* Progress bars — neon */
progress, .progress-bar {
  box-shadow: 0 0 6px var(--accent-glow);
}

/* More sheet — glass */
.more-sheet {
  background: linear-gradient(180deg, var(--surface), var(--bg)) !important;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5), 0 0 20px var(--accent-glow);
}
.more-sheet-item {
  background: var(--card) !important;
  transition: all .2s ease;
}
.more-sheet-item:active {
  box-shadow: 0 0 12px var(--accent-glow);
  border-color: var(--accent);
}

/* Animated dot grid background for all page layouts */
@keyframes pageGridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}
.page-layout, .dashboard-layout, .settings-layout {
  background-image: radial-gradient(circle, var(--border) 0.5px, transparent 0.5px);
  background-size: 50px 50px;
  animation: pageGridScroll 12s linear infinite;
}

/* Invite code — neon */
.orbit-invite-code {
  text-shadow: 0 0 20px var(--accent-glow);
  animation: centerPulse 3s ease-in-out infinite;
}

/* Login card — glass */
.login-card {
  background: linear-gradient(135deg, var(--card), var(--surface)) !important;
  box-shadow: 0 16px 64px rgba(0,0,0,.5), 0 0 30px var(--accent-glow);
  border: 1px solid var(--border);
}
.login-logo-text {
  text-shadow: 0 0 20px var(--accent-glow);
}

/* ═══════════════════════ Attention System ═══════════════════════ */

/* Breathing accent glow — "this wants your attention" */
@keyframes attentionPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow), inset 0 0 4px var(--accent-glow); border-color: var(--accent); }
  50% { box-shadow: 0 0 20px var(--accent-glow), inset 0 0 10px var(--accent-glow); border-color: var(--accent); }
}
.attention-pulse {
  animation: attentionPulse 2.5s ease-in-out infinite;
  border: 1px solid var(--accent);
}

/* Urgent red pulse — overdue, over-budget, high-priority */
@keyframes attentionUrgent {
  0%, 100% { box-shadow: 0 0 6px rgba(240,63,63,.2); border-color: var(--danger); }
  50% { box-shadow: 0 0 18px rgba(240,63,63,.35); border-color: var(--danger); }
}
.attention-urgent {
  animation: attentionUrgent 2s ease-in-out infinite;
  border-color: var(--danger) !important;
}

/* Amber warning — near threshold */
@keyframes attentionWarn {
  0%, 100% { box-shadow: 0 0 6px rgba(244,185,66,.15); }
  50% { box-shadow: 0 0 14px rgba(244,185,66,.3); }
}
.attention-warn {
  animation: attentionWarn 2.5s ease-in-out infinite;
  border-color: var(--warning) !important;
}

/* Celebration burst — positive completion */
@keyframes celebratePop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.attention-celebrate { animation: celebratePop .5s cubic-bezier(.4,0,.2,1); }

/* Shimmer sweep across text/button */
@keyframes shimmerSweep {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--accent) 0%, #fff 50%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerSweep 3s linear infinite;
}

/* Priority pill badges */
.priority-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 14px;
  font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums;
}
.priority-pill-high { background: rgba(240,63,63,.2); color: var(--danger); animation: attentionUrgent 2s ease-in-out infinite; }
.priority-pill-med { background: rgba(244,185,66,.15); color: var(--warning); }
.priority-pill-low { background: var(--card-2); color: var(--text-dim); }

/* Unread accent bar (.comm-row.unread !important + ::after) migrated to
   css/communications.css on 2026-05-09. */

/* Enhanced range/slider */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
  outline: none; transition: all .2s;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent);
  cursor: pointer; box-shadow: 0 0 8px var(--accent-glow);
  transition: all .2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 16px var(--accent-glow); transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent);
  cursor: pointer; box-shadow: 0 0 8px var(--accent-glow);
}

/* Over-budget bar glow */
.fin-budget-over .fin-budget-fill {
  box-shadow: 0 0 8px var(--danger);
  background: linear-gradient(90deg, var(--danger), #f87171) !important;
}
.fin-budget-over {
  border-color: var(--danger) !important;
  animation: attentionUrgent 2s ease-in-out infinite;
}
.fin-budget-warn {
  border-color: var(--warning) !important;
  animation: attentionWarn 3s ease-in-out infinite;
}
.over-budget-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--danger);
  animation: attentionUrgent 2s ease-in-out infinite;
}

/* Uncategorized attention */
.fin-txn-row.needs-review {
  border-left: 3px solid var(--warning);
  background: rgba(244,185,66,.03);
}
.filter-chip.has-attention .tab-count {
  animation: attentionPulse 2s ease-in-out infinite;
  background: var(--warning); color: #000; border-radius: 8px; padding: 1px var(--sp-2);
}

/* Celebration confetti (CSS-only) */
@keyframes confetti1 { 0%{transform:translate(0,0) rotate(0);opacity:1} 100%{transform:translate(-40px,-80px) rotate(200deg);opacity:0} }
@keyframes confetti2 { 0%{transform:translate(0,0) rotate(0);opacity:1} 100%{transform:translate(30px,-90px) rotate(-180deg);opacity:0} }
@keyframes confetti3 { 0%{transform:translate(0,0) rotate(0);opacity:1} 100%{transform:translate(50px,-60px) rotate(150deg);opacity:0} }
@keyframes confetti4 { 0%{transform:translate(0,0) rotate(0);opacity:1} 100%{transform:translate(-20px,-100px) rotate(-120deg);opacity:0} }
.celebration-burst { position: relative; }
.celebration-burst::before, .celebration-burst::after,
.celebration-burst .conf-1, .celebration-burst .conf-2 {
  content: '✦'; position: absolute; font-size: var(--fs-lg); pointer-events: none;
}
.celebration-burst::before { color: var(--accent); top:40%; left:45%; animation: confetti1 1s ease-out forwards; }
.celebration-burst::after { color: var(--success); top:40%; left:55%; animation: confetti2 1s ease-out forwards .1s; }

/* Count-up animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.count-up { animation: countUp .6s ease backwards; }

/* Trip countdown badge */
.trip-countdown {
  display: inline-flex; align-items: center; gap: 4px; padding: var(--sp-1) var(--sp-3);
  border-radius: 12px; font-size: var(--fs-xs); font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  animation: attentionPulse 3s ease-in-out infinite;
}

/* High-fee card badge */
.fee-high { background: rgba(240,63,63,.15) !important; color: var(--danger) !important; animation: attentionUrgent 3s ease-in-out infinite; }

/* Trip countdown + past dimming */
.trip-countdown {
  display: inline-flex; align-items: center; gap: 4px; padding: var(--sp-1) var(--sp-3);
  border-radius: 12px; font-size: var(--fs-xs); font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  animation: attentionPulse 3s ease-in-out infinite;
  margin-left: var(--sp-2);
}
.trip-past { opacity: .5; }

/* Completed checkin glow */
.completed-icon { font-size: 56px; margin-bottom: var(--sp-3); }
.streak-big-num { text-shadow: 0 0 20px var(--accent-glow); }
.completed-streak { animation: celebratePop .6s cubic-bezier(.4,0,.2,1); }

/* Checkin struggling habit warn */
.checkin-habit-row.attention-warn {
  border-left: 3px solid var(--warning) !important;
}

/* ═══════════════════════ Onboarding ═══════════════════════ */

.onboard-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--sp-5);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: onboardFadeIn .5s ease;
}
.onboard-fade-out { animation: onboardFadeOut .4s ease forwards; }
@keyframes onboardFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes onboardFadeOut { from { opacity: 1; } to { opacity: 0; } }

.onboard-wide { max-width: 640px; }
.onboard-card {
  background: linear-gradient(135deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 520px; width: 100%;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 40px var(--accent-glow);
  position: relative;
  margin: auto 0;
  flex-shrink: 0;
  animation: onboardCardIn .4s cubic-bezier(.4,0,.2,1);
}
.onboard-exit { animation: onboardCardOut .25s ease forwards; }
.onboard-exit-rev { animation: onboardCardOutRev .25s ease forwards; }
@keyframes onboardCardIn { from { opacity: 0; transform: translateX(40px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes onboardCardOut { to { opacity: 0; transform: translateX(-40px) scale(.95); } }
@keyframes onboardCardOutRev { to { opacity: 0; transform: translateX(40px) scale(.95); } }

.onboard-progress { height: 3px; background: var(--border); }
.onboard-progress-fill { height: 100%; background: var(--accent); transition: width .4s ease; border-radius: 0 3px 3px 0; }

.onboard-skip {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: var(--text-dim); font-size: var(--fs-md);
  cursor: pointer; transition: color .2s; z-index: 2;
}
.onboard-skip:hover { color: var(--text); }

.onboard-content {
  padding: 48px var(--sp-8) var(--sp-6); text-align: center;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.onboard-icon-wrap {
  position: relative; display: inline-block; margin-bottom: var(--sp-5);
}
.onboard-icon {
  font-size: 56px; position: relative; z-index: 1;
  animation: iconFloat 3s ease-in-out infinite;
}
.onboard-icon-ring {
  position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: .2;
  animation: ringRotate 8s linear infinite;
}
.onboard-hero .onboard-icon { font-size: 72px; }
.onboard-hero .onboard-icon-ring { inset: -20px; border-width: 3px; opacity: .3; }

.onboard-title {
  font-size: 28px; font-weight: 800; color: var(--text);
  margin-bottom: var(--sp-2);
  text-shadow: 0 0 20px var(--accent-glow);
}
.onboard-hero .onboard-title { font-size: 36px; color: var(--accent); }
.onboard-final .onboard-title { color: var(--success); text-shadow: 0 0 20px rgba(15,186,121,.3); }

.onboard-subtitle {
  font-size: var(--fs-lg); color: var(--accent); font-weight: 600;
  letter-spacing: .03em; margin-bottom: var(--sp-4);
}
.onboard-hero .onboard-subtitle {
  font-size: var(--fs-xl); color: var(--text-muted);
}

.onboard-body {
  font-size: var(--fs-base); color: var(--text-muted); line-height: 1.7;
  max-width: 400px; margin: 0 auto;
}

.onboard-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-6) var(--sp-6); gap: 12px;
}

.onboard-dots { display: flex; gap: 6px; }
.onboard-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all .3s;
}
.onboard-dot.active {
  background: var(--accent); width: 24px; border-radius: 4px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.onboard-dot.done { background: var(--accent); opacity: .4; }

/* Hero card: extra glow treatment */
.onboard-hero {
  animation: onboardCardIn .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 60px var(--accent-glow);
}
.onboard-hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--accent-glow) 0%, transparent 50%);
  animation: ringRotate 20s linear infinite;
  pointer-events: none; opacity: .4;
}

/* Onboarding form + tag picker */
.onboard-form { text-align: left; margin-top: var(--sp-4); }
.onboard-form .form-group { margin-bottom: var(--sp-3); }
.onboard-form .form-label { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--sp-1); }
.onboard-tag-grid {
  display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto;
  padding: var(--sp-1) 0;
}
.onboard-tag {
  padding: var(--sp-2) var(--sp-4); border-radius: 20px; font-size: var(--fs-md); font-weight: 500;
  background: var(--card); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: all .2s;
}
.onboard-tag:hover { border-color: var(--accent); color: var(--text); }
.onboard-tag.selected {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600;
}

@media (max-width: 600px) {
  .onboard-content { padding: var(--sp-8) var(--sp-6) var(--sp-4); }
  .onboard-title { font-size: var(--fs-2xl); }
  .onboard-hero .onboard-title { font-size: 28px; }
  .onboard-icon { font-size: 44px; }
  .onboard-body { font-size: var(--fs-md); }
  .onboard-dots { display: none; }
  .onboard-wide { max-width: 100%; }
}

/* ═══════════════════════ Plaid Banner ═══════════════════════ */
.fin-plaid-banner {
  background: linear-gradient(135deg, var(--card), var(--accent-dim));
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4);
}
.fin-plaid-banner-content {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.fin-plaid-banner-content strong { font-size: 15px; color: var(--text); display: block; margin-bottom: var(--sp-1); }
.fin-plaid-banner-content p { font-size: var(--fs-md); color: var(--text-muted); margin: 0; }
@media (max-width: 900px) {
  .fin-plaid-banner-content { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════ Admin ═══════════════════════ */

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: var(--sp-6); }
.admin-stat { background: linear-gradient(135deg, var(--card), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5); text-align: center; }
.admin-stat-num { font-size: 28px; font-weight: 800; color: var(--text); display: block; text-shadow: 0 0 12px var(--accent-glow); }
.admin-stat-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }

.admin-section { margin-bottom: var(--sp-7); }
.admin-section-title { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: var(--sp-3); text-shadow: 0 0 10px var(--accent-glow); }

.admin-request-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: var(--sp-4) var(--sp-4); background: linear-gradient(135deg, var(--card), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--sp-2);
  transition: border-color .2s;
}
.admin-request-card:hover { border-color: var(--accent); }
.admin-request-name { font-size: 15px; font-weight: 600; color: var(--text); }
.admin-request-email { font-size: var(--fs-md); color: var(--accent); }
.admin-request-detail { font-size: var(--fs-sm); color: var(--text-dim); margin-top: var(--sp-1); }
.admin-request-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.admin-status-badge { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.admin-fb-section { padding: var(--sp-1) var(--sp-3); border-radius: 10px; background: var(--accent-dim); color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }
.admin-feedback-card { flex-direction: column; align-items: stretch; }

.admin-allowlist { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-allowlist-item {
  padding: var(--sp-2) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; font-size: var(--fs-md); color: var(--text-muted);
}

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-request-card { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════ Transitions & Polish ═══════════════════════ */

/* Page route transition */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.page-entering { animation: pageIn .25s ease; }

/* Enhanced card hovers */
.goal-card, .orbit-card, .project-row, .comm-row, .contact-row, .knowledge-item, .capture-item, .orbit-habit-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.goal-card:hover, .orbit-card:hover, .project-row:hover, .knowledge-item:hover, .capture-item:hover, .orbit-habit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.goal-card:active, .orbit-card:active, .project-row:active, .contact-row:active {
  transform: scale(0.99);
}

/* Button press feedback */
.btn { transition: all .15s ease; }
.btn:active { transform: scale(0.97); }
.btn-primary:hover, .btn-accent:hover { box-shadow: 0 0 24px var(--accent-glow), 0 4px 12px rgba(0,0,0,.3); }
.btn-icon { transition: all .15s ease; }
.btn-icon:hover { transform: scale(1.12); }
.btn-icon:active { transform: scale(0.92); }

/* Tab active indicator */
.tab { position: relative; transition: color .2s ease; }
.tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 2px; background: var(--accent); border-radius: 2px;
  animation: tabSlide .2s ease;
}
@keyframes tabSlide { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Sidebar nav hover glow */
.nav-item { transition: all .2s ease; }
.nav-item:hover { background: var(--accent-glow); }
.nav-item.active { position: relative; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
  animation: slideInLeft .2s ease;
}
@keyframes slideInLeft { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* List item stagger */
@keyframes listItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.stagger-item { animation: listItemIn .2s ease backwards; animation-delay: calc(var(--i, 0) * 30ms); }

/* Habit checkbox bounce */
@keyframes checkBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.habit-check.just-checked { animation: checkBounce .3s ease; }

/* Bottom tab tap bounce */
.bottom-tab:active .bottom-tab-icon { animation: checkBounce .25s ease; }

/* Progress bar shimmer */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.progress-fill, .sc-bar-fill {
  background-size: 200% 100%;
  background-image: linear-gradient(90deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%);
  animation: shimmer 2s infinite linear;
}

/* Modal entrance (enhanced) */
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.modal-overlay { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .2s ease; }

/* Toast icon + exit */
@keyframes toastOut { to { transform: translateX(110%); opacity: 0; } }
.toast-exiting { animation: toastOut .25s ease forwards; }

/* Skeleton loading shimmer */
@keyframes skeletonShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

/* Toggle switch smooth slide */
.toggle-slider { transition: background .2s ease; }
.toggle-slider::before { transition: transform .2s ease; }

/* Stat cards hover */
.detail-stat, .sc-metric {
  transition: transform .2s ease;
}
.detail-stat:hover, .sc-metric:hover {
  transform: translateY(-1px);
}

/* ═══════════════════════ Finance ═══════════════════════ */

/* Dashboard — command center feel */
@keyframes dashGridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}
.fin-dashboard {
  display: flex; flex-direction: column; gap: 20px;
  position: relative;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0;
  animation: dashGridScroll 8s linear infinite;
  padding: var(--sp-1);
}
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fin-card {
  background: linear-gradient(135deg, var(--card), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-6);
  transition: border-color .3s, box-shadow .3s, transform .3s;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.04);
}
.fin-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0; transition: opacity .3s;
}
.fin-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0; transition: opacity .3s;
}
.fin-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 20px var(--accent-glow); }
.fin-card:hover::before, .fin-card:hover::after { opacity: 1; }
.fin-card-title {
  font-size: var(--fs-md); font-weight: 700; color: var(--accent); text-transform: uppercase;
  margin-bottom: var(--sp-4); letter-spacing: .08em;
  text-shadow: 0 0 12px var(--accent-glow);
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border);
  position: relative;
}
.fin-card-title::after {
  content: ''; position: absolute; bottom: -1px; left: 0; width: 0; height: 1px;
  background: var(--accent); transition: width .4s ease;
}
.fin-card:hover .fin-card-title::after { width: 100%; }
.fin-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.fin-section-header h4 { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }

/* Net Worth Hero */
@keyframes nwPulse {
  0%, 100% { box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px var(--accent-glow); }
  50% { box-shadow: 0 0 50px var(--accent-glow), inset 0 0 50px var(--accent-glow); }
}
.fin-nw-hero {
  background: linear-gradient(135deg, var(--card), var(--accent-dim));
  border: 1px solid var(--accent); border-radius: var(--radius); padding: var(--sp-7) var(--sp-7); text-align: center;
  position: relative; overflow: hidden;
  animation: nwPulse 4s ease-in-out infinite;
}
.fin-nw-hero::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--accent-glow) 0%, transparent 50%);
  animation: ringRotate 15s linear infinite;
  pointer-events: none;
}
.fin-nw-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; position: relative; }
.fin-nw-value { font-size: 48px; font-weight: 800; color: var(--text); margin: var(--sp-2) 0 var(--sp-3); line-height: 1.1; position: relative; text-shadow: 0 0 30px var(--accent-glow); }
.fin-nw-change { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--sp-2); }
.fin-nw-change.positive { color: var(--success); }
.fin-nw-change.negative { color: var(--danger); }
.fin-nw-breakdown { font-size: var(--fs-md); color: var(--text-muted); }
.fin-nw-assets { color: var(--success); font-weight: 600; }
.fin-nw-liabilities { color: var(--danger); font-weight: 600; }
.fin-nw-sep { margin: 0 var(--sp-2); }

/* Donut chart — high-tech */
.fin-donut-wrap { display: flex; align-items: flex-start; gap: 28px; }
.fin-donut-chart { position: relative; flex-shrink: 0; }
.fin-donut-svg { display: block; filter: drop-shadow(0 0 12px rgba(0,0,0,.4)); }

@keyframes donutSliceIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.fin-donut-slice {
  cursor: pointer;
  transition: transform .25s cubic-bezier(.4,0,.2,1), filter .2s;
  transform-origin: center;
  animation: donutSliceIn .5s ease backwards;
  animation-delay: var(--delay, 0ms);
}
.fin-donut-slice:hover {
  transform: scale(1.08);
  filter: brightness(1.2) drop-shadow(0 0 8px currentColor);
}

.fin-donut-ring { animation: ringRotate 20s linear infinite; transform-origin: center; }
.fin-donut-ring-outer { animation: ringRotate 30s linear infinite reverse; transform-origin: center; }
.fin-donut-sweep { animation: ringRotate 6s linear infinite; transform-origin: center; }
@keyframes ringRotate { to { transform: rotate(360deg); } }

.fin-donut-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
@keyframes centerPulse {
  0%, 100% { text-shadow: 0 0 20px var(--accent-glow); }
  50% { text-shadow: 0 0 35px var(--accent-glow), 0 0 60px var(--accent-glow); }
}
.fin-donut-center-val {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--text);
  animation: centerPulse 3s ease-in-out infinite;
  transition: all .2s;
}
.fin-donut-center-label {
  font-size: var(--fs-xxs); color: var(--text-dim); text-transform: uppercase;
  letter-spacing: .08em; margin-top: var(--sp-1); transition: all .2s;
}

.fin-donut-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.fin-donut-legend-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-xs);
  transition: all .2s ease; border-left: 3px solid transparent;
}
.fin-donut-legend-item:hover {
  background: var(--card-2); border-left-color: var(--legend-color, var(--accent));
  transform: translateX(4px); box-shadow: 0 0 12px rgba(0,0,0,.2);
}
.fin-donut-legend-name { flex: 1; font-size: var(--fs-md); color: var(--text); font-weight: 500; }
.fin-donut-legend-pct { font-size: var(--fs-xs); color: var(--text-dim); font-weight: 600; min-width: 30px; }
.fin-donut-legend-val { font-size: var(--fs-base); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Drill-down */
@keyframes drillSlide {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; }
  to   { opacity: 1; transform: none; max-height: 200px; }
}
.fin-drilldown { margin-top: var(--sp-3); }
.fin-drilldown-header {
  display: flex; align-items: center; gap: 8px; padding: var(--sp-3) var(--sp-3);
  background: linear-gradient(135deg, var(--card-2), var(--surface)); border-radius: var(--radius-xs);
  font-size: var(--fs-md); color: var(--text); margin-bottom: var(--sp-1);
  border-left: 3px solid var(--accent); animation: drillSlide .3s ease;
}
.fin-drilldown-row {
  display: flex; justify-content: space-between; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-7);
  font-size: var(--fs-md); color: var(--text-muted); border-bottom: 1px solid var(--border);
  animation: drillSlide .3s ease backwards;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: background .15s;
}
.fin-drilldown-row:hover { background: var(--accent-glow); }
.fin-drilldown-row:last-child { border-bottom: none; }
.fin-drilldown-row .negative { color: var(--danger); }

/* Transaction data stream scan */
@keyframes dataScan {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}
.fin-dashboard .fin-txn-row {
  position: relative;
}
.fin-dashboard .fin-card {
  background-image: linear-gradient(180deg, transparent 45%, var(--accent-glow) 50%, transparent 55%);
  background-size: 100% 300%;
  background-position: 0 -100%;
}
.fin-dashboard .fin-card:hover {
  animation: dataScan 6s linear infinite;
}

/* Bar chart — neon */
@keyframes barGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
.fin-bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 140px; padding-bottom: var(--sp-7); position: relative; }
.fin-bar-chart-lg { height: 220px; }

/* Dashboard recent-transactions widget never shows the Owner column even on
   desktop (Michael wants it for the dashboard summary view only). */
.fin-dash-recent-txns .fin-txn-owner-col { display: none !important; }
.fin-bar-grid { position: absolute; inset: 0; bottom: 28px; pointer-events: none; }
.fin-bar-gridline {
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0.3;
}
.fin-bar-group {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%;
  position: relative; cursor: pointer;
}
.fin-bar-pair { display: flex; gap: 4px; align-items: flex-end; flex: 1; width: 100%; }
.fin-bar {
  flex: 1; border-radius: 4px 4px 0 0; min-height: 2px;
  transform-origin: bottom;
  animation: barGrow .6s cubic-bezier(.4,0,.2,1) backwards;
  animation-delay: var(--bar-delay, 0ms);
  transition: filter .2s, transform .2s;
  position: relative;
}
@keyframes barPulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}
.fin-bar-group:hover .fin-bar { animation: barPulse .4s ease; transform: scaleY(1.03); }
.fin-bar::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: rgba(255,255,255,.4); border-radius: 4px 4px 0 0;
}
.fin-bar-income {
  background: linear-gradient(to top, var(--success), #34d399);
  box-shadow: 0 0 18px rgba(15,186,121,.3), 0 0 6px rgba(15,186,121,.15), inset 0 0 8px rgba(255,255,255,.08);
}
.fin-bar-spent {
  background: linear-gradient(to top, var(--danger), #f87171);
  box-shadow: 0 0 18px rgba(240,63,63,.25), 0 0 6px rgba(240,63,63,.12), inset 0 0 8px rgba(255,255,255,.08);
}
.fin-bar-budget {
  background: linear-gradient(to top, var(--accent), #7dd56f);
  box-shadow: 0 0 18px var(--accent-glow), 0 0 6px var(--accent-glow), inset 0 0 8px rgba(255,255,255,.08);
  opacity: .5;
}
.fin-bar-actual {
  background: linear-gradient(to top, #6366f1, #818cf8);
  box-shadow: 0 0 18px rgba(99,102,241,.3), 0 0 6px rgba(99,102,241,.15), inset 0 0 8px rgba(255,255,255,.08);
}
.fin-legend-budget { color: var(--accent); font-weight: 600; opacity: .6; }
.fin-legend-actual { color: #818cf8; font-weight: 600; }

/* Bar hover tooltip */
.fin-bar-tooltip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs);
  padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--text); line-height: 1.5;
  white-space: nowrap; pointer-events: none; z-index: 10;
  opacity: 0; transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.fin-bar-group:hover .fin-bar-tooltip { opacity: 1; transform: translateX(-50%) translateY(-12px); }

.fin-bar-label { font-size: var(--fs-sm); color: var(--text-dim); font-weight: 500; }
.fin-bar-legend { display: flex; gap: 20px; justify-content: center; margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.fin-legend-income { color: var(--success); font-weight: 600; }
.fin-legend-spent { color: var(--danger); font-weight: 600; }

/* Category bars */
.fin-cat-bars { display: flex; flex-direction: column; gap: 10px; }
.fin-cat-row { display: flex; align-items: center; gap: 8px; }
.fin-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fin-cat-name { font-size: var(--fs-md); color: var(--text); min-width: 90px; }
.fin-cat-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fin-cat-bar-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.fin-cat-amt { font-size: var(--fs-md); font-weight: 600; color: var(--text); min-width: 70px; text-align: right; }
.fin-month-total { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--border); font-size: var(--fs-md); color: var(--text-muted); }

/* Account rows */
.fin-accounts-list { display: flex; flex-direction: column; gap: 8px; }
.fin-account-row { display: flex; align-items: center; gap: 10px; padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.fin-account-row:last-child { border-bottom: none; }
.fin-account-type { font-size: var(--fs-xl); }
.fin-account-name { flex: 1; font-size: var(--fs-base); color: var(--text); font-weight: 500; }
.fin-account-bal { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.fin-account-bal.negative { color: var(--danger); }

/* Account cards */
.fin-accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fin-account-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-5); cursor: pointer;
  transition: all .2s ease;
}
.fin-account-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.fin-account-card-type { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-1); }
.fin-account-card-name { font-size: var(--fs-lg); font-weight: 700; color: var(--text); }
.fin-account-card-inst { font-size: var(--fs-sm); color: var(--text-dim); margin-top: var(--sp-1); }
.fin-account-card-bal { font-size: 24px; font-weight: 800; color: var(--text); margin-top: var(--sp-3); font-variant-numeric: tabular-nums; }
.fin-account-card-bal.negative { color: var(--danger); }
.fin-account-card-updated { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-1); }

/* Transaction layout */
.fin-txn-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: var(--sp-3); font-size: var(--fs-md); color: var(--text-muted);
}
/* Transaction month picker bar */
.fin-txn-month-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); flex-wrap: wrap;
}
.fin-txn-month-bar .btn-icon {
  font-size: 20px; font-weight: 800; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all .15s;
}
.fin-txn-month-bar .btn-icon:hover { background: var(--accent-glow); color: var(--accent); }
.fin-txn-month-stats {
  display: flex; gap: 10px; align-items: center; margin-left: auto;
  font-size: var(--fs-md); color: var(--text-muted);
}

.fin-txn-toolbar { display: flex; gap: 8px; margin-bottom: var(--sp-4); flex-wrap: wrap; align-items: center; }
.fin-txn-date-group { margin-bottom: var(--sp-1); }
.fin-txn-date-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-3) var(--sp-2); font-size: var(--fs-sm); font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); margin-bottom: var(--sp-1);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.fin-txn-date-label { }
.fin-txn-date-total { font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Transaction type filter chips */
.fin-txn-type-filters { display: flex; gap: 6px; }

/* AI Categorize banner */
.fin-ai-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(90,197,58,.08), rgba(90,197,58,.03));
  border: 1px solid rgba(90,197,58,.25);
}
.fin-ai-banner-left { display: flex; align-items: center; gap: 14px; }
.fin-ai-banner-icon { font-size: 28px; }
.fin-ai-banner-left strong { display: block; font-size: var(--fs-base); color: var(--text); }
.fin-ai-banner-sub { font-size: var(--fs-sm); color: var(--text-muted); }

/* AI Categorize button — hero treatment */
@keyframes aiGlow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow), 0 0 20px rgba(90,197,58,.12); }
  50% { box-shadow: 0 0 16px var(--accent-glow), 0 0 40px rgba(90,197,58,.2); }
}
@keyframes aiShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}
.fin-ai-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: var(--sp-2) var(--sp-5); border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, rgba(90,197,58,.15), rgba(90,197,58,.08));
  border: 1px solid var(--accent);
  color: var(--accent); font-size: var(--fs-md); font-weight: 700;
  animation: aiGlow 3s ease-in-out infinite;
  transition: all .25s ease;
}
.fin-ai-btn:hover {
  background: linear-gradient(135deg, rgba(90,197,58,.3), rgba(90,197,58,.15));
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(90,197,58,.15);
}
.fin-ai-btn:active { transform: translateY(0) scale(0.98); }
.fin-ai-btn:disabled { opacity: .6; cursor: wait; animation: none; transform: none; }
.fin-ai-btn-icon { font-size: var(--fs-lg); }
.fin-ai-btn-count {
  background: var(--accent); color: #000; font-size: var(--fs-xs); font-weight: 800;
  padding: 1px var(--sp-2); border-radius: 10px; min-width: 20px; text-align: center;
}
.fin-ai-btn-glow {
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(90,197,58,.2), transparent);
  animation: aiShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

/* Transaction column headers */
.fin-txn-col-headers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 90px 100px;
  gap: 16px;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--sp-1);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 3;
}
.fin-txn-col-headers span:last-child { text-align: right; }

.fin-txn-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 90px 100px;
  align-items: center;
  gap: 16px;
  padding: 11px var(--sp-4);
  cursor: pointer; transition: background .15s; border-radius: var(--radius-xs);
}
.fin-txn-row:hover { background: var(--card); }
.fin-txn-row.is-pending { opacity: 0.6; font-style: italic; }
.fin-txn-row.is-pending:hover { opacity: 0.85; }
.fin-txn-row.is-transfer { opacity: 0.75; }
.fin-txn-pending-badge { display: inline-block; margin-left: var(--sp-2); padding: 1px var(--sp-2); font-size: var(--fs-xxs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: var(--gold-dim); color: var(--gold); border-radius: 3px; vertical-align: middle; font-style: normal; }
.fin-txn-desc { font-size: 15px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-txn-cat-col { font-size: var(--fs-base); display: flex; align-items: center; gap: 8px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-txn-cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.fin-txn-acct-col { font-size: var(--fs-base); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-txn-owner-col { font-size: var(--fs-base); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-txn-uncategorized { color: var(--warning) !important; font-weight: 600; }
.fin-txn-amount { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Account groups */
.fin-acct-nw-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.fin-acct-nw-item { text-align: center; }
.fin-acct-nw-label { display: block; font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--sp-1); }
.fin-acct-nw-val { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-acct-nw-sep { font-size: 20px; color: var(--text-dim); font-weight: 300; }

.fin-acct-group { margin-bottom: var(--sp-5); }
.fin-acct-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) var(--sp-3); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: var(--fs-md); font-weight: 700;
}
.fin-acct-group-title { color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.fin-acct-group-total { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.fin-acct-group-total.negative { color: var(--danger); }

.fin-acct-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3); border: 1px solid var(--border); border-top: none;
  cursor: pointer; transition: background .15s;
}
.fin-acct-row:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.fin-acct-row:hover { background: var(--card); }
.fin-acct-row-info { display: flex; flex-direction: column; gap: 2px; }
.fin-acct-row-name { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.fin-acct-row-inst { font-size: var(--fs-sm); color: var(--text-dim); }
.fin-acct-row-bal { font-size: var(--fs-lg); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.fin-acct-row-bal.negative { color: var(--danger); }

/* Asset equity display */
.fin-asset-equity { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.fin-asset-breakdown { display: flex; gap: 12px; font-size: var(--fs-sm); justify-content: flex-end; }
.fin-asset-loan { color: var(--danger); }
.fin-asset-eq { font-weight: 700; }
.fin-asset-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--card-2); font-size: var(--fs-base); color: var(--text-muted);
}

/* Budget overview bar */
.fin-budget-overview {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  padding: var(--sp-5); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: var(--sp-5); text-align: center;
}
.fin-budget-ov-item { display: flex; flex-direction: column; gap: 2px; }
.fin-budget-ov-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.fin-budget-ov-actual { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-budget-ov-target { font-size: var(--fs-sm); color: var(--text-muted); }

/* Budget groups */
.fin-budget-group { margin-bottom: var(--sp-5); }
/* <details>/<summary> default open marker — replace with our own chevron */
details.fin-budget-group > summary { list-style: none; cursor: pointer; }
details.fin-budget-group > summary::-webkit-details-marker { display: none; }
.fin-budget-group-header {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
/* When the group is collapsed, round the bottom of the header too — there's
   no body card below it to share the bottom radius with. */
details.fin-budget-group:not([open]) > .fin-budget-group-header,
details.fin-budget-group:not([open]) > summary.fin-budget-group-header {
  border-radius: var(--radius-sm);
}
/* Chevron rotates 90° when the details is open — no transition lag */
.fin-budget-chevron {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-right: var(--sp-1);
}
details.fin-budget-group[open] > summary > .fin-budget-chevron {
  transform: rotate(90deg);
}
.fin-budget-group-body {
  /* Padding top to separate body from header. Cards inside already have
     their own border/radius so we don't add a wrapping box here. */
  padding-top: var(--sp-2);
}
.fin-budget-group-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.fin-budget-group-rollup { display: flex; align-items: baseline; gap: 6px; }
.fin-budget-group-actual { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-budget-group-target { font-size: var(--fs-sm); color: var(--text-dim); }
.fin-budget-add-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--text-dim);
  color: var(--text-dim); font-size: var(--fs-lg); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; background: none; margin-left: var(--sp-2);
}
.fin-budget-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* Flex owner rollup + inline breakdown */
.fin-flex-rollup {
  display: flex; gap: 16px; padding: var(--sp-2) var(--sp-4); background: var(--card-2);
  border: 1px solid var(--border); border-top: none; font-size: var(--fs-md); flex-wrap: wrap;
}
.fin-flex-owner-row {
  display: flex; gap: 8px; align-items: center;
}
.fin-flex-owner-row span:first-child { color: var(--text-muted); font-weight: 600; }
.fin-flex-owner-row span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }

.fin-flex-breakdown {
  display: flex; gap: 8px; margin-top: var(--sp-2); flex-wrap: wrap;
}
.fin-flex-chip {
  font-size: var(--fs-xs); padding: var(--sp-1) var(--sp-2); border-radius: 10px;
  background: var(--accent-dim); color: var(--accent); font-weight: 600;
}

/* Budget cards */
.fin-budget-card {
  border: 1px solid var(--border); border-top: none;
  padding: var(--sp-4) var(--sp-4); cursor: pointer; transition: background .15s;
}
.fin-budget-card:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.fin-budget-card:hover { background: var(--card); }
.fin-budget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.fin-budget-cat { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.fin-budget-amounts { font-size: var(--fs-md); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fin-budget-pct { font-weight: 700; }
.fin-budget-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.fin-budget-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
.fin-budget-footer { display: flex; justify-content: space-between; margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }

@media (max-width: 900px) {
  .fin-grid { grid-template-columns: 1fr; }
  .fin-nw-value { font-size: var(--fs-display); }
  .fin-accounts-grid { grid-template-columns: 1fr; }
  .fin-budget-overview { gap: 16px; }
  .fin-budget-ov-actual { font-size: var(--fs-xl); }
  .fin-budget-group-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fin-dashboard, .page-layout, .dashboard-layout, .settings-layout { background-image: none !important; animation: none !important; }
  .fin-donut-wrap { flex-direction: column; align-items: center; }
  .fin-donut-legend { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .fin-bar-chart-lg { height: 160px; }
  .fin-nw-value { font-size: 36px; }
  .fin-bar-tooltip { display: none; }
  .fin-txn-toolbar { flex-direction: column; }
  .fin-txn-col-headers { display: none; }
  .fin-txn-row { grid-template-columns: 1fr auto; }
  .fin-txn-cat-col, .fin-txn-acct-col, .fin-txn-owner-col { display: none; }
  .fin-acct-nw-bar { flex-direction: column; gap: 8px; }
  .fin-acct-nw-sep { display: none; }
}

/* ═══════════════════════ Plan My Day ═══════════════════════ */

.plan-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  animation: planOverlayIn .4s ease;
}
.plan-overlay-exit { animation: planOverlayOut .4s ease forwards; }
@keyframes planOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes planOverlayOut { from { opacity: 1; } to { opacity: 0; } }

.plan-stage {
  text-align: center;
  transition: opacity .4s ease, transform .4s ease;
}
.plan-stage-exit { opacity: 0; transform: translateY(-20px) scale(.95); }
.plan-stage-enter { opacity: 0; transform: translateY(20px) scale(.95); animation: planStageIn .5s ease forwards; }
@keyframes planStageIn { to { opacity: 1; transform: none; } }

.plan-icon {
  font-size: 64px; margin-bottom: var(--sp-6);
  animation: planIconPulse 2s ease-in-out infinite;
}
@keyframes planIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.plan-message {
  font-size: var(--fs-2xl); font-weight: 600; color: var(--text);
  max-width: 400px; line-height: 1.5;
}

/* Day plan output */
.day-plan { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: 20px; }
.day-plan-section { }
.day-plan-heading {
  font-size: 15px; font-weight: 700; color: var(--accent);
  margin-bottom: var(--sp-3); display: flex; align-items: center; gap: 8px;
}
.day-plan-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--sp-4) var(--sp-4); margin-bottom: var(--sp-2);
  animation: listItemIn .25s ease backwards;
}
.day-plan-insight { font-size: var(--fs-base); color: var(--text); font-weight: 500; margin-bottom: var(--sp-2); }
.day-plan-action { font-size: var(--fs-md); color: var(--accent); font-weight: 600; }
.day-plan-intro { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-3); }

.day-plan-power-item {
  display: flex; align-items: center; gap: 12px;
}
.day-plan-type-badge { font-size: 20px; flex-shrink: 0; }
.day-plan-power-body { flex: 1; min-width: 0; }
.day-plan-power-title { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.day-plan-power-why { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }
.day-plan-minutes {
  font-size: var(--fs-md); font-weight: 700; color: var(--accent);
  background: var(--accent-dim); padding: var(--sp-1) var(--sp-3); border-radius: 12px;
  white-space: nowrap;
}

.day-plan-convo { }
.day-plan-convo-who { display: flex; align-items: baseline; gap: 8px; margin-bottom: var(--sp-2); }
.day-plan-convo-who strong { font-size: 15px; color: var(--text); }
.day-plan-convo-role { font-size: var(--fs-sm); color: var(--text-dim); }
.day-plan-convo-why { font-size: var(--fs-md); color: var(--text-muted); margin-bottom: var(--sp-2); }
.day-plan-convo-opener {
  font-size: var(--fs-base); color: var(--accent); font-style: italic;
  padding: var(--sp-3) var(--sp-4); background: var(--accent-dim); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

/* ═══════════════════════ Theme Picker ═══════════════════════ */

.theme-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: var(--sp-4) var(--sp-6); background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all .2s ease;
  min-width: 100px;
}
.theme-swatch:hover { border-color: var(--text-dim); transform: translateY(-2px); }
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.theme-swatch-color {
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.theme-swatch-label { font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); }
.theme-swatch.active .theme-swatch-label { color: var(--accent); }

/* ═══════════════════════ Login Screen ═══════════════════════ */

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  position: relative;
  background: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(10,15,18,0.78) 0%, rgba(10,15,18,0.52) 60%, rgba(10,15,18,0.78) 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.login-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10,15,18,0.6) 100%);
}
.login-screen > * { position: relative; z-index: 1; }
.login-card {
  background: rgba(23, 32, 37, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px var(--sp-8);
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: var(--sp-2);
}
.login-logo-icon {
  font-size: 36px;
}
.login-logo-text {
  font-size: var(--fs-display);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.login-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: var(--sp-7);
}
.login-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--sp-4) var(--sp-6);
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.login-google-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.login-google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-hint {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-top: var(--sp-4);
}

/* .header-user* moved to css/topbar.css (shared) per ui-platform-convention.md. */

/* Hide More sheet + bottom tabs on desktop */
@media (min-width: 901px) {
  .bottom-tab-bar { display: none !important; }
  .more-sheet-overlay { display: none !important; }
}

/* ─── Focus Sprint overlay (Phase 1, 2026-04-25) ───────────────────────── */

.sprint-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
}
.sprint-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sprint-stage {
  position: relative;
  max-width: 720px; width: calc(100% - 48px);
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: var(--sp-6, 32px);
  background: var(--card, #0e0e0e);
  border: 1px solid var(--accent, #5ac53a);
  border-radius: 16px;
  box-shadow: 0 0 80px rgba(90, 197, 58, 0.2), 0 20px 60px rgba(0,0,0,0.5);
  color: var(--text, #fafafa);
}
.sprint-kicker {
  font-size: var(--fs-xs, 11px); font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent, #5ac53a); margin-bottom: var(--sp-3, 16px);
}
.sprint-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4, 24px); margin-bottom: var(--sp-5, 28px);
  padding-bottom: var(--sp-4, 24px);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.sprint-progress { display: flex; flex-direction: column; gap: 2px; }
.sprint-progress-num { font-size: 28px; font-weight: 700; color: var(--text, #fafafa); }
.sprint-progress-label { font-size: var(--fs-xs, 11px); color: var(--text-muted, #888); text-transform: uppercase; letter-spacing: 0.1em; }
.sprint-timer { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 140px; }
.sprint-time { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent, #5ac53a); line-height: 1; }
.sprint-bar { width: 140px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.sprint-bar-fill { height: 100%; background: var(--accent, #5ac53a); transition: width 0.5s linear; }
.sprint-task {
  margin-bottom: var(--sp-5, 28px);
  padding: var(--sp-5, 28px); background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 12px;
}
.sprint-task-title { font-size: 22px; font-weight: 600; line-height: 1.3; margin-bottom: var(--sp-2, 8px); }
.sprint-task-notes { font-size: var(--fs-sm, 14px); color: var(--text-muted, #888); line-height: 1.5; }
.sprint-actions {
  display: flex; gap: var(--sp-2, 8px); margin-bottom: var(--sp-5, 28px);
  flex-wrap: wrap;
}
.sprint-actions .btn { flex: 1; min-width: 120px; }
.sprint-spotify {
  margin-bottom: var(--sp-4, 24px);
  padding: var(--sp-3, 16px);
  background: rgba(30, 215, 96, 0.05);
  border: 1px solid rgba(30, 215, 96, 0.2);
  border-radius: 10px;
}
.sprint-spotify-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm, 14px); margin-bottom: var(--sp-2, 8px);
}
.sprint-spotify-open { color: #1ed760; text-decoration: none; font-size: var(--fs-xs, 11px); }
.sprint-spotify-open:hover { text-decoration: underline; }
.sprint-spotify-frame { width: 100%; height: 152px; border: 0; border-radius: 8px; }
.sprint-spotify-hint { font-size: var(--fs-xs, 11px); color: var(--text-muted, #888); margin-top: var(--sp-2, 8px); line-height: 1.5; }
.sprint-spotify-hint a { color: #1ed760; }
.sprint-foot { text-align: center; padding-top: var(--sp-3, 16px); border-top: 1px solid var(--border, rgba(255,255,255,0.06)); }
.sprint-abandon {
  background: transparent; border: 0; color: var(--text-dim, #666);
  font-size: var(--fs-xs, 11px); cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sprint-abandon:hover { color: var(--danger, #ef4444); }

.sprint-resolution {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.sprint-resolution-card {
  max-width: 460px; width: calc(100% - 48px);
  padding: var(--sp-5, 28px); text-align: center;
  background: var(--card, #0e0e0e);
  border: 1px solid var(--accent, #5ac53a);
  border-radius: 12px;
}
.sprint-resolution-title { font-size: 20px; font-weight: 700; margin-bottom: var(--sp-2, 8px); }
.sprint-resolution-body { color: var(--text-muted, #888); margin-bottom: var(--sp-4, 24px); font-size: var(--fs-sm, 14px); }

@media (max-width: 600px) {
  .sprint-stage { padding: var(--sp-4, 24px); }
  .sprint-progress-num { font-size: 22px; }
  .sprint-time { font-size: 26px; }
  .sprint-task-title { font-size: 18px; }
  .sprint-actions .btn { flex: 1 1 100%; }
}

/* ─── Day-aware check-in stacked sections (Phase 2, 2026-04-25) ──────── */
.checkin-cadence-section {
  margin-bottom: var(--sp-6, 32px);
  padding-top: var(--sp-4, 24px);
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.checkin-cadence-section:first-of-type { border-top: 0; padding-top: 0; }
.checkin-cadence-label {
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent, #5ac53a);
  margin-bottom: var(--sp-3, 16px);
}

/* ─── Disabled budget categories (Phase 3, 2026-04-25) ──────────────── */
.fin-budget-disabled .fin-budget-cat { opacity: 0.65; }
.fin-budget-disabled .fin-budget-amounts { opacity: 0.75; }
.fin-budget-review { border-left: 3px solid var(--warning) !important; }
.fin-budget-group-disabled-active { background: rgba(244, 185, 66, 0.04); border-radius: var(--radius); padding: var(--sp-2); }
.fin-budget-group-disabled-idle summary::-webkit-details-marker { display: none; }
.fin-budget-toggle-disabled { background: transparent; border: 0; padding: 2px var(--sp-2); color: var(--text-dim); cursor: pointer; border-radius: var(--radius-sm); }
.fin-budget-toggle-disabled:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ─── Per-partner budget allocation (Phase 3.5, 2026-04-25) ──────────── */
.fin-budget-view-toggle {
  display: inline-flex;
  gap: 0;
  margin: var(--sp-2) 0 var(--sp-3) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.fin-budget-view-btn {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
  padding: 4px 12px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  cursor: pointer;
}
.fin-budget-view-btn:last-child { border-right: 0; }
.fin-budget-view-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.fin-budget-view-btn.active { background: var(--accent); color: #000; font-weight: 600; }

.fin-budget-split-card { border-left: 3px solid var(--accent); }
.fin-split-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px var(--sp-2);
  background: rgba(90,197,58,0.15);
  color: var(--accent);
  border-radius: 8px;
  margin-left: 6px;
}
.fin-partner-lines {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}
.fin-partner-line { display: flex; flex-direction: column; gap: 2px; }
.fin-partner-line.fin-partner-dim { opacity: 0.55; }
.fin-partner-head, .fin-partner-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm);
}
.fin-partner-label { font-weight: 600; }
.fin-partner-amts { font-variant-numeric: tabular-nums; }
.fin-joint-chip {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--text-muted);
  padding: 2px var(--sp-3); margin-top: var(--sp-2);
  border-top: 1px dashed var(--border); padding-top: var(--sp-2);
}
.fin-budget-attr-banner {
  background: rgba(244,185,66,0.08);
  border: 1px solid rgba(244,185,66,0.3);
  border-left: 3px solid var(--warning);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
}

/* ════════════════════════════════════════════════════════════════════
   Pacific — modern editorial primitives (Phase 6, 2026-04-26)
   Applies to all themes EXCEPT the legacy three (cyan/green/purple/school)
   which retain their original look during the soft-archive window.
   ════════════════════════════════════════════════════════════════════ */

:root,
[data-theme="pacific"] {
  --serif: 'Source Serif 4', 'Source Serif Pro', 'Crimson Pro', Georgia, serif;
}

/* Display + page titles → serif */
:root .page-title,
[data-theme="pacific"] .page-title {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: var(--fs-2xl);
}
:root .page-subtitle,
[data-theme="pacific"] .page-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: 400;
}

/* Modal — no border, deeper shadow, serif title */
:root .modal,
[data-theme="pacific"] .modal {
  border: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
}
:root .modal-header h3,
[data-theme="pacific"] .modal-header h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Buttons — primary teal, ghost with underline-on-hover, warm-amber for "earned/complete" */
:root .btn-primary,
[data-theme="pacific"] .btn-primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:root .btn-primary:hover,
[data-theme="pacific"] .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px var(--accent-glow);
}
:root .btn-warm,
[data-theme="pacific"] .btn-warm {
  background: var(--warm);
  color: #2A1500;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
:root .btn-warm:hover,
[data-theme="pacific"] .btn-warm:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px var(--warm-dim);
}
:root .btn-ghost:hover,
[data-theme="pacific"] .btn-ghost:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* Tabs — active state in serif with teal underline */
:root .tab.active,
:root .tab-btn.active,
[data-theme="pacific"] .tab.active,
[data-theme="pacific"] .tab-btn.active {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* Cards — no border, soft elevation shadow */
:root .dashboard-card,
:root .settings-section,
[data-theme="pacific"] .dashboard-card,
[data-theme="pacific"] .settings-section {
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* Card titles — serif when treated as primary entity titles
   (we keep .card-title default sans for tabular contexts; opt-in via .card-title-serif) */
:root .card-title-serif,
[data-theme="pacific"] .card-title-serif {
  font-family: var(--serif);
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.005em;
  font-size: var(--fs-lg);
}

/* Pills / badges — minimal hairline, lowercase tracked */
:root .badge,
[data-theme="pacific"] .badge {
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* Inputs — subtle, focus = thicker accent border (kept as box for now;
   the underline-only treatment is opt-in via .form-control-underline) */
:root .form-control:focus,
[data-theme="pacific"] .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
:root .form-control-underline,
[data-theme="pacific"] .form-control-underline {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 0;
}
:root .form-control-underline:focus,
[data-theme="pacific"] .form-control-underline:focus {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 7px;
  box-shadow: none;
}

/* Form labels — uppercase tracked, slightly more gravitas */
:root .form-label,
[data-theme="pacific"] .form-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Sidebar nav active state — soft tint, accent text */
:root .nav-item.active,
[data-theme="pacific"] .nav-item.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* The legacy themes keep their old behavior (no serif, original primitives)
   by overriding back to sans where needed. */
[data-theme="cyan"] .page-title,
[data-theme="green"] .page-title,
[data-theme="purple"] .page-title,
[data-theme="school"] .page-title,
[data-theme="cyan"] .modal-header h3,
[data-theme="green"] .modal-header h3,
[data-theme="purple"] .modal-header h3,
[data-theme="school"] .modal-header h3,
[data-theme="cyan"] .tab.active,
[data-theme="green"] .tab.active,
[data-theme="purple"] .tab.active,
[data-theme="school"] .tab.active {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

/* ════════════════════════════════════════════════════════════════════
   Pacific — STRUCTURAL primitives (Phase 6.2, 2026-04-26)
   This is where the actual redesign lives — sizes, paddings, radii,
   shapes — separate from the color tokens and font swaps in 6.1.
   Wrapped in :root + [data-theme="pacific"] so legacy themes keep
   their original structure.
   ════════════════════════════════════════════════════════════════════ */

/* ── Cards: more breathing room, larger radius, no border ──────────── */
:root .dashboard-card,
:root .settings-section,
:root .card,
[data-theme="pacific"] .dashboard-card,
[data-theme="pacific"] .settings-section,
[data-theme="pacific"] .card {
  padding: var(--sp-6);
  border-radius: var(--radius);
  border: 0;
}
:root .card-sm,
[data-theme="pacific"] .card-sm {
  padding: var(--sp-4) var(--sp-5);
}
:root .card-header,
[data-theme="pacific"] .card-header {
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
:root .card-title,
[data-theme="pacific"] .card-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
}

/* ── Modals: larger, more padding, deeper shadow ───────────────────── */
:root .modal,
[data-theme="pacific"] .modal {
  border-radius: 18px;
  max-width: 600px;
  width: calc(100% - 32px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 32px 80px rgba(0,0,0,0.5);
}
:root .modal-body,
[data-theme="pacific"] .modal-body {
  padding: var(--sp-6) var(--sp-7);
}
:root .modal-body-lg,
[data-theme="pacific"] .modal-body-lg {
  padding: var(--sp-6) var(--sp-7);
  max-height: calc(var(--vvh, 100vh) - 240px);
}
:root .modal-header,
[data-theme="pacific"] .modal-header {
  padding: var(--sp-6) var(--sp-7) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
:root .modal-header h3,
[data-theme="pacific"] .modal-header h3 {
  font-size: 22px;
  letter-spacing: -0.015em;
}
:root .modal-footer,
[data-theme="pacific"] .modal-footer {
  padding: var(--sp-4) var(--sp-7);
  background: transparent;
  border-top: 1px solid var(--border);
  gap: var(--sp-3);
}

/* ── Buttons: more generous padding, slightly larger radius ─────────── */
:root .btn,
[data-theme="pacific"] .btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.18s ease;
}
:root .btn-sm,
[data-theme="pacific"] .btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}
:root .btn-lg,
[data-theme="pacific"] .btn-lg {
  padding: 13px 22px;
  font-size: 15px;
  border-radius: 12px;
}
:root .btn-icon,
[data-theme="pacific"] .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}
:root .btn-icon-sm,
[data-theme="pacific"] .btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

/* ── Form inputs: editorial — taller, transparent surface, accent border on focus ── */
:root .form-control,
:root .form-input,
:root .form-select,
:root .form-textarea,
[data-theme="pacific"] .form-control,
[data-theme="pacific"] .form-input,
[data-theme="pacific"] .form-select,
[data-theme="pacific"] .form-textarea {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}
:root .form-control:hover,
[data-theme="pacific"] .form-control:hover {
  background: rgba(255, 255, 255, 0.035);
}
:root .form-control:focus,
[data-theme="pacific"] .form-control:focus {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: 0;
}
:root .form-control-sm,
[data-theme="pacific"] .form-control-sm {
  padding: 8px 12px;
  font-size: 13px;
}
:root .form-control-lg,
[data-theme="pacific"] .form-control-lg {
  padding: 16px 18px;
  font-size: 16px;
}
:root .form-group,
[data-theme="pacific"] .form-group {
  margin-bottom: var(--sp-5);
}
/* Desktop-only: 2-column grid. On mobile this would beat the @media collapse
   because :root adds specificity, leaving form-row children overlapping/
   overflowing in narrow modals. Scope the rule to desktop. */
@media (min-width: 901px) {
  :root .form-row,
  [data-theme="pacific"] .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
  }
}

/* ════════════════════════════════════════════════════════════════════
   PACIFIC × MOBILE — specificity-matched overrides
   The Pacific structural rules above use :root .X selectors (specificity
   0,2,0). Plain .X mobile rules (specificity 0,1,0) lose. This block
   re-asserts the mobile-correct values at matching specificity so they
   actually win. Do not delete without auditing every rule below.
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Form inputs — 16px font prevents iOS Safari focus-zoom. The Pacific
     rule sets 14px which silently overrode our earlier mobile fix. */
  :root .form-control,
  :root .form-input,
  :root .form-select,
  :root .form-textarea,
  [data-theme="pacific"] .form-control,
  [data-theme="pacific"] .form-input,
  [data-theme="pacific"] .form-select,
  [data-theme="pacific"] .form-textarea {
    font-size: 16px;
    padding: 11px 12px;
  }
  :root .form-control-sm,
  [data-theme="pacific"] .form-control-sm {
    font-size: 16px;
    padding: 8px 10px;
  }

  /* Modals — full-width on mobile, slide up from bottom (matching the
     mobile media block at the start of the file, but with :root specificity
     to beat Pacific's max-width: 600px / width: calc(100% - 32px) defaults). */
  :root .modal,
  [data-theme="pacific"] .modal {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
  :root .modal-body,
  [data-theme="pacific"] .modal-body {
    padding: var(--sp-4) var(--sp-5);
  }
  :root .modal-header,
  [data-theme="pacific"] .modal-header {
    padding: var(--sp-4) var(--sp-5) var(--sp-3);
  }
  /* Footer wraps so 3+ buttons don't run off the right edge. */
  :root .modal-footer,
  [data-theme="pacific"] .modal-footer {
    padding: var(--sp-3) var(--sp-5);
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  /* Buttons — enforce 44px tap targets even when Pacific declares a
     smaller exact size. */
  :root .btn,
  :root .btn-sm,
  [data-theme="pacific"] .btn,
  [data-theme="pacific"] .btn-sm {
    min-height: 44px;
  }
  :root .btn-icon,
  [data-theme="pacific"] .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }

  /* Cards — less internal padding on phone-width. */
  :root .dashboard-card,
  :root .settings-section,
  :root .card,
  [data-theme="pacific"] .dashboard-card,
  [data-theme="pacific"] .settings-section,
  [data-theme="pacific"] .card {
    padding: var(--sp-4);
  }
}

/* Phone-narrow: keep modal-footer buttons in a single row when they fit.
   flex-wrap lets them break to a second row only when they actually overflow
   (e.g., 4-button project modal). Buttons share remaining space equally via
   flex: 1 1 auto so 3 short labels (Save/Cancel/Delete) get balanced widths
   and don't crowd one corner. */
@media (max-width: 600px) {
  :root .modal-footer,
  [data-theme="pacific"] .modal-footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: stretch;
  }
  :root .modal-footer .btn,
  [data-theme="pacific"] .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ── Tabs: larger spacing, more deliberate active state ───────────── */
:root .tabs,
[data-theme="pacific"] .tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}
:root .tab,
:root .tab-btn,
[data-theme="pacific"] .tab,
[data-theme="pacific"] .tab-btn {
  padding: 12px 20px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
  margin-bottom: -1px;
}
:root .tab:hover,
:root .tab-btn:hover,
[data-theme="pacific"] .tab:hover,
[data-theme="pacific"] .tab-btn:hover {
  color: var(--text);
}
:root .tab.active,
:root .tab-btn.active,
[data-theme="pacific"] .tab.active,
[data-theme="pacific"] .tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
:root .tab-count,
[data-theme="pacific"] .tab-count {
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Page chrome: more generous, hierarchy clearer ────────────────── */
/* 2026-04-27 — Removed `max-width: 1400px; margin: 0 auto;` from the Pacific
   override so .page-layout pages match Dashboard's edge-to-edge behavior on
   wide monitors. Was causing hundreds of pixels of dead space on the left of
   every non-dashboard page on >1400px viewports. If a specific page (e.g.
   text-heavy reading views) needs a max-width for readability, apply it to an
   inner content container on that page rather than restoring the global cap. */
:root .page-layout,
[data-theme="pacific"] .page-layout {
  padding: var(--sp-7) var(--sp-8);
}
:root .page-header,
[data-theme="pacific"] .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
  flex-wrap: wrap;
}
/* Mobile: collapse to column + flex-start so page title sits flush left,
   not aligned to flex-end (which on a row layout was making the title look
   indented relative to the content below). The base @media .page-header
   rule lost to this :root rule's specificity. */
@media (max-width: 900px) {
  :root .page-header,
  [data-theme="pacific"] .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-4);
  }
}
:root .page-title,
[data-theme="pacific"] .page-title {
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ── Pills/badges: hairline outline, lowercase tracked ────────────── */
:root .badge,
[data-theme="pacific"] .badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--text-muted);
}
:root .badge-accent,
[data-theme="pacific"] .badge-accent {
  color: var(--accent);
}
:root .badge-warm,
[data-theme="pacific"] .badge-warm {
  color: var(--warm);
}

/* ── Sidebar: slightly more spacious nav items ────────────────────── */
:root .nav-item,
[data-theme="pacific"] .nav-item {
  padding: 11px 18px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
}
:root .nav-item.active,
[data-theme="pacific"] .nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}

/* ── Toasts: refined editorial style ──────────────────────────────── */
:root .toast,
[data-theme="pacific"] .toast {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-sm);
  border: 0;
  border-left: 3px solid var(--accent);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
}
:root .toast.success,
[data-theme="pacific"] .toast.success {
  border-left-color: var(--success);
}
:root .toast.error,
[data-theme="pacific"] .toast.error {
  border-left-color: var(--danger);
}
:root .toast.warning,
[data-theme="pacific"] .toast.warning {
  border-left-color: var(--warm);
}

/* ════════════════════════════════════════════════════════════════════
   Pacific icon system (Phase 6.3, 2026-04-26)
   Custom SVG icons replace emoji throughout. Hover animations subtle
   and on-brand — short durations, Pacific easing.
   ════════════════════════════════════════════════════════════════════ */

.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.nav-icon .lo-icon { display: block; }

/* Default icon color follows nav-item color (via currentColor in SVG) */
.lo-icon { color: var(--text-muted); transition: color 0.18s ease; }
.nav-item:hover .lo-icon { color: var(--text); }
.nav-item.active .lo-icon { color: var(--accent); }

/* Generic hover lift across all icons — subtle, fast */
.nav-item:hover .lo-icon { transform: translateY(-1px); }

/* Each animation runs once on hover; reset on leave so it can play again */
.lo-anim { transform-origin: center; transition: transform 0.32s cubic-bezier(.4, 0, .2, 1); }

/* DASHBOARD — cells reveal in sequence (use a key-staggered scale via :hover) */
.lo-icon-dashboard .lo-anim rect {
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
  transform-origin: center;
}
.nav-item:hover .lo-icon-dashboard .lo-anim rect:nth-child(1) { transform: scale(1.08); transition-delay: 0ms; }
.nav-item:hover .lo-icon-dashboard .lo-anim rect:nth-child(2) { transform: scale(1.08); transition-delay: 70ms; }
.nav-item:hover .lo-icon-dashboard .lo-anim rect:nth-child(3) { transform: scale(1.08); transition-delay: 140ms; }
.nav-item:hover .lo-icon-dashboard .lo-anim rect:nth-child(4) { transform: scale(1.08); transition-delay: 210ms; }

/* CHECKINS — lines draw left→right */
.lo-icon-checkins .lo-line {
  stroke-dasharray: 12; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.45s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:not(:hover) .lo-icon-checkins .lo-line { stroke-dashoffset: 12; }
.nav-item:hover .lo-icon-checkins .lo-line-1 { transition-delay: 50ms; }
.nav-item:hover .lo-icon-checkins .lo-line-2 { transition-delay: 130ms; }
.nav-item:hover .lo-icon-checkins .lo-line-3 { transition-delay: 210ms; }

/* TASKS — checkmark draws on */
.lo-icon-tasks .lo-tick {
  stroke-dasharray: 18; stroke-dashoffset: 18;
  transition: stroke-dashoffset 0.4s cubic-bezier(.4, 0, .2, 1) 60ms;
}
.nav-item:hover .lo-icon-tasks .lo-tick { stroke-dashoffset: 0; }

/* HABITS — flame flickers (gentle scale pulse) */
@keyframes lo-flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.08) rotate(-2deg); }
  50% { transform: scale(1.04) rotate(1deg); }
  75% { transform: scale(1.10) rotate(-1deg); }
}
.nav-item:hover .lo-icon-habits .lo-anim { animation: lo-flicker 0.9s ease-in-out infinite; transform-origin: 12px 18px; }

/* CALENDAR — marker dot pulses */
.lo-icon-calendar .lo-marker {
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .lo-icon-calendar .lo-marker { transform: scale(1.6); }

/* COMMUNICATIONS — envelope flap lifts */
.lo-icon-communications .lo-flap {
  transform-origin: 12px 6px;
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .lo-icon-communications .lo-flap { transform: rotate(-12deg) translateY(-1px); }

/* ORBIT — satellite revolves around the planet */
@keyframes lo-orbit-rev {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.lo-icon-orbit .lo-anim { transform-box: fill-box; transform-origin: center; }
.nav-item:hover .lo-icon-orbit .lo-anim { animation: lo-orbit-rev 4s linear infinite; }

/* SCHOOL — tassel sways */
.lo-icon-school .lo-tassel {
  transform-origin: 22px 9px;
  transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .lo-icon-school .lo-tassel { transform: rotate(20deg); }

/* FINANCE — coin gentle spin (rotateY) */
@keyframes lo-coin-spin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}
.nav-item:hover .lo-icon-finance .lo-anim { animation: lo-coin-spin 1.2s ease-in-out; transform-origin: center; }

/* GOALS — concentric rings expand outward */
.lo-icon-goals .lo-ring {
  transform-origin: center;
  transition: transform 0.36s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .lo-icon-goals .lo-ring-1 { transform: scale(1.06); transition-delay: 0ms; }
.nav-item:hover .lo-icon-goals .lo-ring-2 { transform: scale(1.10); transition-delay: 60ms; }
.nav-item:hover .lo-icon-goals .lo-ring-3 { transform: scale(1.14); transition-delay: 120ms; }

/* KNOWLEDGE — book pages tilt open */
.lo-icon-knowledge .lo-page-l { transform-origin: 12px 12px; transition: transform 0.36s cubic-bezier(.4, 0, .2, 1); }
.lo-icon-knowledge .lo-page-r { transform-origin: 12px 12px; transition: transform 0.36s cubic-bezier(.4, 0, .2, 1); }
.nav-item:hover .lo-icon-knowledge .lo-page-l { transform: perspective(40px) rotateY(-12deg); }
.nav-item:hover .lo-icon-knowledge .lo-page-r { transform: perspective(40px) rotateY(12deg); }

/* TRAVEL — paper plane flies forward */
@keyframes lo-plane-fly {
  0% { transform: translate(0, 0); }
  50% { transform: translate(2px, -2px); }
  100% { transform: translate(0, 0); }
}
.nav-item:hover .lo-icon-travel .lo-anim { animation: lo-plane-fly 0.7s ease-in-out infinite; }

/* HOUSE — window lights up */
.lo-icon-house .lo-window {
  transition: opacity 0.32s ease, fill 0.32s ease;
  opacity: 0.4;
}
.nav-item:hover .lo-icon-house .lo-window { opacity: 1; fill: var(--warm); }

/* ADMIN — shackle lifts */
.lo-icon-admin .lo-shackle {
  transform-origin: 12px 11px;
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover .lo-icon-admin .lo-shackle { transform: translateY(-2px); }

/* SETTINGS — gear rotates */
@keyframes lo-gear-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(60deg); }
}
.lo-icon-settings .lo-anim { transform-origin: center; transform-box: fill-box; }
.nav-item:hover .lo-icon-settings .lo-anim { animation: lo-gear-rotate 0.5s cubic-bezier(.4, 0, .2, 1) forwards; }

/* Page-header icons — same SVGs, slightly larger size */
.page-header .lo-icon { width: 24px; height: 24px; vertical-align: -4px; margin-right: var(--sp-2); color: var(--accent); }

/* Page-title icon — same SVG library, sized to sit next to the h1 */
.page-title-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; vertical-align: -7px; margin-right: 12px; color: var(--accent); }
.page-title-icon .lo-icon { display: block; }
.page-title-icon svg { width: 30px !important; height: 30px !important; }

/* Section titles (h3) inside cards can also use the icon at a smaller size */
.section-title-icon { display: inline-flex; vertical-align: -3px; margin-right: 8px; width: 20px; height: 20px; color: var(--accent); }
.section-title-icon svg { width: 20px !important; height: 20px !important; }

/* ── Calendar week view (Phase 6.4, 2026-04-26) ──────────────────────── */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cal-week-col {
  background: var(--card);
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.cal-week-col-today {
  background: rgba(31, 138, 156, 0.06);
}
.cal-week-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.cal-week-col-day {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cal-week-col-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.cal-week-col-today .cal-week-col-num { color: var(--accent); }
.cal-week-events {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.cal-week-event {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cal-week-event:hover { background: rgba(255, 255, 255, 0.06); }
.cal-week-event.allday { border-left-color: var(--warm); }
.cal-week-event-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.cal-week-event-title {
  color: var(--text);
  line-height: 1.3;
}
.cal-week-empty {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: var(--sp-3);
}

@media (max-width: 900px) {
  .cal-week-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(80px, auto);
  }
  .cal-week-col { min-height: auto; }
  .cal-week-col-header { flex-direction: row; align-items: center; gap: 8px; }
  .cal-week-col-num { font-size: 16px; }
}

/* Communications row-actions desktop display-flex + mobile expanded-row
   action wrap migrated to css/communications.{desktop.css,mobile.css} on
   2026-05-09 per docs/ui-platform-convention.md. */
/* .btn-icon.comm-act base + desktop 38px sizing + mobile 44px reserved-slot
   migrated to css/communications.{css,desktop.css,mobile.css} on 2026-05-09. */

/* Phone-narrow .btn-icon.comm-act sizing migrated to
   css/communications.mobile.css (inner @media (max-width:600px)). */

/* ── Integrations sidebar section (Phase 6.4, 2026-04-26) ──────────── */
.integration-item .nav-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.integration-item:hover .nav-label { color: var(--text); }
.integration-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4a5e76;
  margin-right: 12px;
  margin-left: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.integration-dot[data-status="active"] {
  background: #5ac53a;
  box-shadow: 0 0 8px rgba(90, 197, 58, 0.5);
}
.integration-dot[data-status="inactive"] {
  background: #4a5e76;
}
.integration-dot[data-status="error"] {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(240, 63, 63, 0.4);
}

/* ─────────────────────────────────────────────────────────────────────────
   Touch-device hover guard
   On devices without a real cursor (phones, tablets), CSS :hover styles
   "stick" after a tap until the user taps elsewhere, leaving cards in a
   visually-active state. Null out the most visual hover effects here.
   Color shifts and underlines stay (they replicate the touch-down state).
   ───────────────────────────────────────────────────────────────────────── */
@media (hover: none) {
  /* Disable transform-on-hover effects (translateY, scale, etc.) */
  .card:hover, .stat-card:hover, .nav-item:hover, .topic-card:hover,
  .insight-card:hover, .goal-card:hover, .task-card:hover, .habit-card:hover,
  .orbit-card:hover, .fin-account-card:hover, .fin-budget-card:hover,
  .knowledge-card:hover, .travel-card:hover, .integration-row:hover,
  .nav-icon-host:hover svg, .page-title-icon:hover svg,
  .btn:hover, .btn-icon:hover, .btn-icon-sm:hover, .filter-chip:hover {
    transform: none !important;
    animation: none !important;
  }
  /* Box-shadow elevation pops also feel sticky — mute them */
  .card:hover, .stat-card:hover, .topic-card:hover, .goal-card:hover,
  .task-card:hover, .knowledge-card:hover, .travel-card:hover {
    box-shadow: none !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   Module-specific mobile fixes (from full mobile audit, 2026-04-25).
   These complement the global Pacific × Mobile overrides above.
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  /* Modal title — Pacific 22px wraps unkindly; tighten on mobile */
  :root .modal-header h3,
  [data-theme="pacific"] .modal-header h3 {
    font-size: 18px;
  }
  /* Pacific form labels are uppercase tracked at .12em; on phones the
     resulting wrap eats vertical space. Slightly compact. */
  :root .form-label,
  [data-theme="pacific"] .form-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  /* Habit loop — collapse the cue→craving→response→reward grid */
  .habit-loop { grid-template-columns: 1fr !important; gap: var(--sp-2); }
  .loop-arrow { display: none; }

  /* Heatmap — fixed cell sizes; the auto-fit can over-pack on phones */
  .heatmap-grid { grid-template-columns: repeat(7, 1fr); gap: 2px; }

  /* Stats bar at 4 cells → 2x2 on phones */
  .stats-bar, .detail-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: var(--fs-xs); }

  /* Calendar view toggle — stack the 3 view buttons (Week/Month/Agenda) */
  .view-toggle { flex-wrap: wrap; gap: 4px; }
  .view-toggle .btn { flex: 1 1 0; min-width: 0; font-size: var(--fs-sm); padding: var(--sp-2); }

  /* Calendar month grid — allow horizontal scroll if it can't collapse */
  .cal-grid { overflow-x: auto; }
  .cal-event { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Task work-session inline buttons — stack vertically with full-width */
  .task-work-buttons {
    flex-direction: column !important;
    gap: var(--sp-2) !important;
  }
  .task-work-buttons .btn { width: 100%; min-height: 44px; }

  /* Goal link-chips — flex-wrap parent so chips lay out cleanly */
  .goal-links-row, .goal-link-chips {
    display: flex !important;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }
  .goal-link-chip, .link-chip { min-width: 0; }

  /* Goal area gauge — stack the label and the numeric ratio */
  .area-gauge-label-row { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Today's habit row — let the title shrink/wrap, pin streak right */
  .today-habit-name { flex: 1; min-width: 0; word-break: break-word; }
  .today-habit-streak { flex-shrink: 0; min-width: 50px; text-align: right; }

  /* School score buttons row — wrap the 1-10 row */
  .sc-score-buttons,
  .school-score-row,
  div[data-school-score-row] {
    flex-wrap: wrap !important;
  }

  /* Practice exam result card max-width fence */
  .onboard-card { max-width: calc(100vw - 32px); word-break: break-word; overflow-wrap: break-word; }

  /* .prio-grid 5x2 + .snooze-preset-grid 1fr 1fr migrated to
     css/communications.mobile.css on 2026-05-09. */

  /* Couples check-in goal status — title above, three colored buttons in
     one row sharing equal width. (Stack-each-on-own-row was rejected as
     too vertical.) */
  .cc-goal-status-options { gap: 6px; }

  /* Couples / check-in slider — value below slider, both full width */
  .slider-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .slider-row input[type="range"] { width: 100%; }
  .slider-value { text-align: left; }

  /* Pulse box — stack ring + content */
  .pulse-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  /* Check-in habit row — collapse meta to second line */
  .checkin-habit-row {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }
  .checkin-habit-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Contact rows — fully restructure: avatar + name on row 1; actions row 2 */
  .contact-row {
    grid-template-columns: 40px 1fr;
    gap: 8px;
    padding: var(--sp-3);
  }
  .contact-cadence, .contact-value { display: none; }
  .contact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Finance transactions — collapse 5-column row to 1fr + amount */
  .fin-txn-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: var(--sp-3);
  }
  .fin-txn-meta { grid-column: 1 / -1; font-size: var(--fs-xs); }
  .fin-txn-desc, .fin-txn-merchant { min-width: 0; }
  .fin-txn-desc, .fin-txn-amount { font-size: 13px; }

  /* Finance toolbar — full-width selects, stack vertically */
  .fin-txn-toolbar { flex-direction: column; align-items: stretch; }
  .fin-txn-toolbar select.form-control-sm,
  .fin-txn-toolbar input.form-control-sm { width: 100%; min-width: 0; }
  .fin-txn-type-filters { flex-wrap: wrap; }

  /* Finance partner sub-card head — stack name + amounts */
  .fin-partner-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .fin-partner-foot { flex-wrap: wrap; gap: var(--sp-2); }

  /* Finance budget card header — stack category + amounts */
  .fin-budget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .fin-budget-cat, .fin-budget-amounts { font-size: var(--fs-sm); }

  /* Finance accounts grid — 1 card per row */
  .fin-accounts-grid { grid-template-columns: 1fr; }

  /* Rules editor row — let constraint text break/wrap cleanly */
  .rule-row { word-break: break-word; }
  .rule-row > *:first-child { min-width: 0; }
}

/* Phone-narrow: tighten further on iPhone SE class devices.
   .snooze-preset-grid 1fr override migrated to css/communications.mobile.css. */
@media (max-width: 600px) {
  /* Couples check-in modal textareas — reduce visible rows so question fits */
  .cc-textarea-mobile { min-height: 60px; }
}

/* Comms .prio-grid + .snooze-preset-grid base + mobile collapses migrated to
   css/communications.{css,mobile.css} on 2026-05-09. */

/* Sprint music picker — 4-tile grid (Spotify / Soundscape / YouTube / Skip).
   Each tile is a card-style button with icon + title + subtitle. Stacks
   single-column on phone-narrow. */
.sprint-music-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 600px) { .sprint-music-grid { grid-template-columns: 1fr; } }

.sprint-music-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: var(--sp-4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sprint-music-tile:hover {
  border-color: var(--accent);
  background: var(--card-2);
  transform: translateY(-1px);
}
.sprint-music-tile:active { transform: translateY(0); }
.sprint-music-icon { font-size: 24px; }
.sprint-music-title { font-weight: 700; font-size: var(--fs-base); color: var(--text); }
.sprint-music-sub { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }

/* Soundscape sub-picker */
.sprint-soundscape-grid {
  display: flex; flex-direction: column; gap: 6px;
}
.sprint-soundscape-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
}
.sprint-soundscape-tile:hover { border-color: var(--accent); background: var(--card-2); }
.sprint-soundscape-tile.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 12px var(--accent-glow);
}
.sprint-soundscape-name { font-weight: 600; font-size: var(--fs-base); }
.sprint-soundscape-sub  { font-size: var(--fs-sm); color: var(--text-muted); }

/* YouTube focus radio sub-picker */
.sprint-yt-list { display: flex; flex-direction: column; gap: 6px; }
.sprint-yt-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
}
.sprint-yt-tile:hover { border-color: var(--accent); background: var(--card-2); }
.sprint-yt-name { font-weight: 600; font-size: var(--fs-base); }
.sprint-yt-sub  { font-size: var(--fs-sm); color: var(--text-muted); }

/* Sprint overlay: variants for the active audio block. The base
   .sprint-spotify styles are already defined elsewhere; these add accent
   tints so the user can tell which provider is active. */
.sprint-soundscape-active { border-left: 3px solid var(--accent); padding-left: var(--sp-3); }
.sprint-youtube-active   { border-left: 3px solid var(--danger); padding-left: var(--sp-3); }

/* YouTube embed wrapper: collapsed by default so the video isn't a visual
   distraction during a focus sprint. Iframe stays mounted (audio plays
   regardless), only the height is clipped. .expanded reveals the video.
   max-height animation, not display:none, because YouTube pauses video
   when its iframe is fully removed from the layout. */
.sprint-yt-video-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.sprint-yt-video-wrap.expanded {
  max-height: 240px;
  margin-top: var(--sp-2);
}

/* Now-playing pulse dot — small visual cue that audio is active even when
   the video itself is hidden. */
@keyframes sprintNowPlaying {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}
.sprint-yt-now-playing {
  display: inline-block;
  color: var(--danger);
  font-size: 10px;
  margin-right: 4px;
  animation: sprintNowPlaying 1.6s ease-in-out infinite;
}

.sprint-yt-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.sprint-yt-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sprint-ss-mute {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.sprint-ss-mute:hover { border-color: var(--accent); color: var(--accent); }

/* Re-categorize email picker styles migrated to css/communications.css on
   2026-05-09. */

/* Activity Planner — date+time always sit side-by-side (date inputs render
   compactly on iOS, no need to stack on phone-narrow). Duration goes on
   its own row below. */
.oa-datetime-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* Couples check-in: goal status row.
   Layout: goal title on row 1, 3 colored option buttons on row 2 sharing
   equal width. Each option carries its own tint (green / amber / teal) so
   the chosen state and unchosen states are easy to differentiate. */
.cc-goal-status-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
}
.cc-goal-status-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}
.cc-goal-status-options {
  display: flex;
  gap: 8px;
}
.cc-goal-status-btn {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
}
.cc-goal-status-btn:hover { background: var(--card-2); }
.cc-status-on-track { color: var(--success); border-color: rgba(15,186,121,.4); }
.cc-status-on-track.is-active {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(15,186,121,.35);
}
.cc-status-slipping { color: var(--warning); border-color: rgba(244,185,66,.4); }
.cc-status-slipping.is-active {
  background: var(--warning);
  color: #1a1206;
  border-color: var(--warning);
  box-shadow: 0 0 12px rgba(244,185,66,.35);
}
.cc-status-done { color: var(--accent); border-color: rgba(31,138,156,.4); }
.cc-status-done.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Communications open-email modal styles migrated to css/communications.css
   on 2026-05-09 per docs/ui-platform-convention.md. */

/* Finance budget split allocation rows — 3-column desktop, stacks mobile.
   Replaces a previous inline `style="grid-template-columns:1fr 100px 100px"`
   that beat the mobile collapse rule. */
.fb-split-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px;
  gap: var(--sp-3);
  align-items: end;
}
@media (max-width: 600px) {
  .fb-split-row { grid-template-columns: 1fr 1fr; }
  .fb-split-row .fb-split-label { grid-column: 1 / -1; }
}

/* Travel cards grid — 1 card per row on phone. The default minmax(380px,1fr)
   creates a 380px floor that overflows a 390px viewport with 18px gap. */
@media (max-width: 600px) {
  :root .travel-cards-grid,
  [data-theme="pacific"] .travel-cards-grid {
    grid-template-columns: 1fr;
  }
  .usage-btn-group { flex-direction: column; gap: var(--sp-2); }
  .usage-toggle { width: 100%; }
}

/* Dashboard life-balance widget — drop the fixed flex-basis numbers on phones
   so the row layout breathes at 390px. */
@media (max-width: 600px) {
  .lifebalance-row, .life-balance-row,
  [class*="lifebalance"] [style*="flex:0 0 100px"],
  [class*="life-balance"] [style*="flex:0 0 100px"] {
    flex-basis: auto !important;
    flex: 1 !important;
    min-width: 0;
  }
  .lifebalance-row [style*="flex:0 0 60px"],
  .life-balance-row [style*="flex:0 0 60px"] { flex-basis: 50px !important; }
}

/* ═════════════════════════════════════════════════════════════════════════
   Density v2 — Monarch-style primitives (2026-04-27)

   Five reusable component classes that bring the Dashboard's edge-to-edge,
   strong-typography pattern to every page. Opt-in: modules adopt these one
   section at a time. See plan: functional-greeting-pony.md.

   1. .kpi-hero       — page-top primary value (Net Worth, Left to Budget…)
   2. .list-row       — scannable [icon][title+meta][right value] row
   3. .amount         — money/numeric values w/ tabular figures + semantic color
   4. .group-row      — bold rollup line above leaf rows (replaces <details>)
   5. .density-tabs   — horizontal sub-nav (scrollable on mobile)
   ═════════════════════════════════════════════════════════════════════════ */

/* ── 1. Hero KPI ──────────────────────────────────────────────────────── */

.kpi-hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6) 0 var(--sp-7);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.kpi-hero-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.kpi-hero-value {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-hero-delta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-base);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.kpi-hero-delta.kpi-up   { color: var(--success); }
.kpi-hero-delta.kpi-down { color: var(--danger); }

/* Banner variant — Monarch's bright-green "Left to budget" header. */
.kpi-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--r-md);
  background: var(--success);
  color: #04150b;
  margin-bottom: var(--sp-6);
}
.kpi-banner-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.kpi-banner-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi-banner.kpi-banner-warn { background: var(--warning); color: #1f1502; }
.kpi-banner.kpi-banner-bad  { background: var(--danger);  color: #fff; }

/* Triplet variant — three stacked KPIs side-by-side at page top
   (e.g. Fixed / Flexible / Non-Monthly summary). */
.kpi-triplet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.kpi-triplet > .kpi-cell {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) 0;
  border-top: 2px solid var(--border);
}
.kpi-triplet > .kpi-cell.kpi-up    { border-top-color: var(--success); }
.kpi-triplet > .kpi-cell.kpi-down  { border-top-color: var(--danger); }
.kpi-triplet > .kpi-cell.kpi-warn  { border-top-color: var(--warning); }
.kpi-cell-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 600;
}
.kpi-cell-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi-cell-meta {
  font-size: var(--fs-sm);
  color: var(--text-dim);
}

/* ── 2. List row ──────────────────────────────────────────────────────── */

.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-2);
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
  cursor: pointer;
}
.list-row:hover { background: var(--accent-dim); }
.list-row:last-child { border-bottom: none; }

.list-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  font-size: var(--fs-lg);
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
}
.list-row-icon img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.list-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.list-row-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: 2px;
}
.list-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--sp-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.list-row-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  text-align: right;
}
.list-row-value .amount { font-size: var(--fs-lg); }
.list-row-value-strong .amount { font-size: var(--fs-xl); font-weight: 700; }
.list-row-meta-right {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Section header above a stack of .list-rows */
.list-section {
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.list-section > .list-row:first-child { border-top: 1px solid var(--border); }

/* Desktop task-tile sizing — make better use of horizontal space (Michael
   2026-04-28). The mobile layout is rebuilt as a 3-row grid in mobile.css;
   these rules only apply on ≥901px. */
@media (min-width: 901px) {
  .task-item.list-row { padding: var(--sp-4) var(--sp-4); min-height: 76px; gap: var(--sp-5); }
  .task-item.list-row .list-row-icon {
    width: 32px; height: 32px;
    min-width: 32px;
    font-size: var(--fs-base);
  }
  .task-item.list-row .list-row-title {
    font-size: var(--fs-lg);
    line-height: 1.35;
    margin-bottom: 2px;
  }
  .task-item.list-row .list-row-chip {
    padding: 4px var(--sp-3);
    font-size: var(--fs-sm);
    border-radius: 999px;
  }
  .task-item.list-row .list-row-meta-chips { gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-1); }
  /* Right column — bigger badges, due chip, action buttons */
  .task-item.list-row .list-row-value { gap: var(--sp-2); }
  .task-item.list-row .list-row-value .badge,
  .task-item.list-row .list-row-value .leverage-badge {
    padding: 4px var(--sp-3);
    font-size: var(--fs-sm);
  }
  .task-item.list-row .list-row-value .energy-badge { font-size: var(--fs-lg); }
  .task-item.list-row .list-row-meta-right { font-size: var(--fs-sm); }
  .task-item.list-row .task-item-actions { gap: var(--sp-2); }
  .task-item.list-row .task-item-actions .btn-icon {
    width: 36px; height: 36px;
    font-size: var(--fs-md);
  }
}

/* ── 2b. Density-v2 column grid (Projects/Tasks UI redesign, 2026-05-07) ──
   Spec source-of-truth: research task 7_Fwgy2mTLfsLZFqVJj0h, ui_reviewer
   iteration-3. Class names are the contract with productivity_specialist
   (js/tasks.js renderTaskItemV2 + renderProjectCard v2 branch). Density-v2
   only — legacy .task-item / .project-row codepaths untouched.

   Mobile (≤900px) overrides this in css/mobile.css with a card layout. */

.list-row-grid-tasks {
  display: grid;
  grid-template-columns: 36px 1fr 140px 200px 100px 96px;
  gap: var(--sp-3);
  align-items: center;
  position: relative;       /* host for the 4px energy stripe ::before */
}

.list-row-grid-projects {
  display: grid;
  grid-template-columns: 36px 1fr auto;     /* right track collapses to 0 when no meta */
  gap: var(--sp-3);
  align-items: start;
  position: relative;
}

/* 4px left-edge energy stripe — charging=accent / draining=text-dim / none=absent */
.task-row-energy-charging::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
}
.task-row-energy-draining::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-dim);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
}
/* Default (no .task-row-energy-* class): no ::before — stripe absent */

/* Compound P1·L9 badge inline at right edge of title cell.
   productivity_specialist emits <span class="task-pl-badge">P1·L9</span>. */
.task-pl-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: var(--sp-2);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Secondary chip line under title with +N more inline expander.
   Visible chips limited to 2 by JS; remaining chips carry .list-row-overflow-hidden. */
.list-row-overflow-chips {
  display: inline-flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}
.list-row-overflow-toggle {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}
.list-row-overflow-toggle:hover { color: var(--text); background: var(--card-2); }
.list-row-overflow-chips[data-expanded="true"] .list-row-overflow-hidden { display: inline-flex; }
.list-row-overflow-chips:not([data-expanded="true"]) .list-row-overflow-hidden { display: none; }

/* Schedule action button — top-level child of .task-item-actions. Hidden on
   desktop (96px action column shows only Focus + kebab per spec); revealed
   on mobile in css/mobile.css inside @media (max-width: 900px) where the
   action strip becomes a full-width 3-button grid. */
.task-action-schedule { display: none; }

/* Status pill color-coded variants (column 3, 140px). */
.status-pill-not-started {
  background: var(--card-2);
  color: var(--text-muted);
}
.status-pill-in-progress {
  background: rgba(31, 138, 156, 0.15);
  color: var(--accent);
}
.status-pill-done {
  background: rgba(15, 186, 121, 0.15);
  color: var(--success);
}
.status-pill-blocked {
  background: rgba(212, 165, 116, 0.15);
  color: var(--gold);
}

/* Overdue due text (column 5, 100px). */
.task-due-overdue { color: var(--danger); }

/* Project row right-meta — ⏰ deadline, ✓ task-count, optional review-due tag.
   Stays in column 3 (auto). When productivity_specialist emits no children,
   the `auto` track collapses and the row title gets the full 1fr. */
.project-row-right-meta {
  display: inline-flex;
  gap: var(--sp-3);
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.project-row-right-meta > * { display: inline-flex; align-items: center; gap: 4px; }
.project-row-right-meta .meta-deadline { color: var(--text-muted); }
.project-row-right-meta .meta-task-count { color: var(--text-muted); }

/* Triangular review-due tag (right edge of project row). Pure CSS triangle
   via clip-path so it doesn't depend on a unicode glyph that varies by
   system font. Background = warm-amber per Pacific palette. */
.project-row-review-due-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px 2px 14px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  clip-path: polygon(0 50%, 8px 0, 100% 0, 100% 100%, 8px 100%);
  white-space: nowrap;
}

/* ── 3. Amount (semantic money) ──────────────────────────────────────── */

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.amount-strong { font-size: var(--fs-xl); font-weight: 700; }
.amount-up     { color: var(--success); }
.amount-down   { color: var(--danger); }
.amount-muted  { color: var(--text-muted); font-weight: 500; }

/* ── 4. Group row (rollup heading above leaf list-rows) ─────────────── */

.group-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-2);
  border-bottom: 2px solid var(--border);
  cursor: pointer;
}
.group-row-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.group-row-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex: 1;
  font-variant-numeric: tabular-nums;
}
.group-row-meta.kpi-up   { color: var(--success); }
.group-row-meta.kpi-down { color: var(--danger); }
.group-row-value { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.group-row-chevron {
  display: inline-block;
  margin-right: 2px;
  transform: rotate(0deg);
  transition: transform .15s;
  color: var(--text-dim);
  font-size: var(--fs-base);
}
.group-row[aria-expanded="false"] .group-row-chevron { transform: rotate(-90deg); }

/* ── 5. Density tabs (Monarch sub-nav) ───────────────────────────────── */

.density-tabs {
  display: flex;
  gap: var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.density-tabs::-webkit-scrollbar { display: none; }
.density-tab {
  position: relative;
  padding: var(--sp-3) 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.density-tab:hover { color: var(--text); }
.density-tab.active {
  color: var(--text);
  background: var(--surface-2);
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
  border-radius: 999px;
}

/* ── 6. Split page layout (Monarch's main+sidepanel pattern) ─────────── */

.density-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-7);
  align-items: start;
}
.density-split-side {
  position: sticky;
  top: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.density-split-side h4 {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
@media (max-width: 1100px) {
  .density-split { grid-template-columns: minmax(0, 1fr); }
  .density-split-side { position: static; }
}

/* Multi-column list rows — Monarch's pattern of [icon][title][chip][chip][amount].
   Each column is a labeled flex item. Hidden on narrow viewports so the
   row collapses gracefully back to the standard list-row layout. */

.list-row-col {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.list-row-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--sp-3);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
}
.list-row-col-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.list-row-spark {
  flex-shrink: 0;
  width: 100px;
  height: 28px;
  opacity: 0.6;
}
@media (max-width: 900px) {
  .list-row-col, .list-row-spark { display: none; }
}

/* Tabular rows — like Monarch's budget table with Budget / Actual / Remaining columns */

.density-table {
  width: 100%;
  border-collapse: collapse;
}
.density-table th {
  text-align: right;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.density-table th:first-child { text-align: left; }
.density-table td {
  padding: var(--sp-4);
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.density-table td:first-child { text-align: left; white-space: normal; }
.density-table tr.density-table-group td {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  /* Tinted parent-group rows so they read as section headers, not just
     bolder leaf rows. Mirrors the active-nav teal hue on the sidebar so
     the page picks up the same "current section" feel. */
  background: var(--accent-dim);
  box-shadow: inset 3px 0 0 var(--accent);
}
.density-table tr.density-table-group:hover td {
  /* Slight lift on hover (group rows are clickable to collapse). */
  background: var(--accent-dim);
  filter: brightness(1.08);
}
.density-table tr:hover td { background: var(--accent-dim); cursor: pointer; }
.density-table .amount-up   { color: var(--success); }
.density-table .amount-down { color: var(--danger); }

/* Inline helpers for category cells inside .density-table rows */
.dt-chev { display: inline-block; margin-right: 4px; color: var(--text-dim); width: 12px; }
.dt-cat { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* Budget-headroom color signal on the category NAME itself. Replaces the
   old "Over" pill — same information, less visual noise. */
.dt-cat.dt-cat-near { color: var(--warning); font-weight: 600; }
.dt-cat.dt-cat-over { color: var(--danger);  font-weight: 600; }
.dt-toggle, .dt-add {
  margin-left: var(--sp-2);
  opacity: 0;
  transition: opacity .15s;
  font-size: var(--fs-xs);
  padding: 2px 6px;
}
.density-table tr:hover .dt-toggle,
.density-table tr:hover .dt-add { opacity: 0.7; }
.dt-toggle:hover, .dt-add:hover { opacity: 1 !important; }
.dt-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-right: var(--sp-2);
  background: var(--surface-2);
}
.dt-pill.warn { background: rgba(244,185,66,0.18); color: var(--warning); }
.dt-pill.bad  { background: rgba(240,63,63,0.18);  color: var(--danger); }
.density-table-disabled td { opacity: 0.55; }
.density-table-disabled:hover td { opacity: 1; }

/* Inline budget input — looks like static text until clicked, then becomes
   an editable input with a subtle focus ring. Tabular figures so values
   stay aligned across rows. */
.budget-inline-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px var(--sp-2);
  font-family: inherit;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: right;
  border-radius: 4px;
  cursor: text;
  transition: background .12s, border-color .12s, color .12s;
}
.budget-inline-input:hover {
  background: var(--surface-2);
  color: var(--text);
}
.budget-inline-input:focus {
  outline: none;
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}
.budget-inline-input::placeholder { color: var(--text-dim); }

/* ── Transactions column-layout (Density v2) ──────────────────────────
   Five-column grid: merchant | category | account | owner | amount.
   Headers + rows share the same .txn-row-cols grid template so the values
   stay aligned. On <900px we collapse to merchant + amount only. */

.txn-row-cols {
  display: grid;
  /* merchant | category | account | best-card | owner | amount
     Explicit minimums prevent each row from re-flowing its own grid based
     on content. Without these, rows with shorter merchant names ended up
     with slightly different track widths — visible as the categories /
     accounts columns appearing "indented" inconsistently row to row. */
  grid-template-columns:
    minmax(0, 2fr)        /* merchant — flexible */
    minmax(140px, 1.1fr)  /* category */
    minmax(140px, 1.2fr)  /* account */
    minmax(140px, 1.3fr)  /* best-card */
    minmax(70px, 0.7fr)   /* owner */
    minmax(110px, auto);  /* amount */
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3) var(--sp-2);
}
.txn-col-headers {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-3) var(--sp-2);
}
.txn-col-amount { text-align: right; }
.txn-col-headers .txn-col-amount { padding-right: var(--sp-1); }

.txn-date-group { margin-top: var(--sp-2); }
.txn-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-2);
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 2px;
}
.txn-date-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.txn-date-total {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.txn-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  font-size: var(--fs-base);
}
.txn-row:hover { background: var(--accent-dim); }

.txn-merchant {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-pending-pill {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 1px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.txn-cat-text {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-style: italic;
  font-size: var(--fs-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.txn-cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}

.txn-col-acct, .txn-col-owner {
  font-style: italic;
  color: var(--text-muted);
  font-size: var(--fs-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Best Card column ─────────────────────────────────────────────── */
.txn-col-bestcard {
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.best-card-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: filter 0.12s, transform 0.12s;
}
.best-card-pill:hover { filter: brightness(1.15); transform: translateY(-1px); }
.best-card-pill-green {
  background: rgba(34,197,94,0.14);
  color: var(--success, #22c55e);
  border: 1px solid rgba(34,197,94,0.35);
}
.best-card-pill-yellow {
  background: rgba(245,158,11,0.16);
  color: var(--warning, #f59e0b);
  border: 1px solid rgba(245,158,11,0.4);
}

/* Mobile chip — appears under the merchant when the desktop column is
   collapsed below the 900px breakpoint. Only emitted for yellow (missed
   reward) results to keep the row tight. */
.best-card-chip-mobile {
  display: none;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 9px;
  background: rgba(245,158,11,0.16);
  color: var(--warning, #f59e0b);
  border: 1px solid rgba(245,158,11,0.4);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  /* Phone: merchant + amount only; hide category/account/owner/best-card
     cells. The mobile chip below the merchant carries best-card hints. */
  .txn-row-cols { grid-template-columns: 1fr auto; gap: var(--sp-3); }
  .txn-col-cat, .txn-col-acct, .txn-col-owner, .txn-col-bestcard { display: none; }
  .txn-col-headers .txn-col-cat,
  .txn-col-headers .txn-col-acct,
  .txn-col-headers .txn-col-owner,
  .txn-col-headers .txn-col-bestcard { display: none; }
  .best-card-chip-mobile { display: inline-block; }
}

/* ── Mobile adjustments ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .kpi-hero-value { font-size: var(--fs-2xl); }
  .kpi-banner { padding: var(--sp-4) var(--sp-5); }
  .kpi-banner-value { font-size: var(--fs-xl); }
  .kpi-cell-value { font-size: var(--fs-xl); }
  .list-row { min-height: 72px; padding: var(--sp-3) var(--sp-2); }
  .list-row-icon { width: 40px; height: 40px; }
  .list-row-icon img { width: 40px; height: 40px; }
  .list-row-value-strong .amount { font-size: var(--fs-lg); }
  .group-row-title { font-size: var(--fs-lg); }
  .group-row-value { font-size: var(--fs-lg); }
  .density-tabs { gap: var(--sp-3); }
}

/* Metric tile (single-value dashboard card; e.g., Habits Done Today) */
.metric-tile-body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-4, 16px) var(--sp-3, 12px);
  gap: var(--sp-2, 8px);
}
.metric-tile-body .metric-value {
  font-size: 2.75rem; font-weight: 700; line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric-tile-body .metric-label {
  font-size: var(--fs-sm, 0.875rem);
  color: var(--text-muted);
  text-align: center;
}
.metric-tile-body .metric-sparkline {
  width: 100%; max-width: 84px; height: 24px;
  margin-top: var(--sp-2, 8px);
  color: var(--accent, currentColor);
  opacity: 0.85;
}
.metric-tile-body .metric-sparkline polyline {
  stroke-linejoin: round; stroke-linecap: round;
}
