/* Centrica Pulse — Operating Console */

/* ═══ THEMES ═══
   Switch theme by setting data-theme on <html>:
   document.documentElement.dataset.theme = "nord";
   Available: classic, wabi, nord, ember, horizon
═══════════════ */

:root {
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --rail-w: 248px;
  --right-w: 320px;
  --row-pad-y: 12px;
  --row-pad-x: 14px;
  --card-pad: 18px;
  --gap: 14px;
  --title-size: 22px;
  --body-size: 14px;
  --meta-size: 12px;
}

/* ── Classic — the original purple/white ── */
[data-theme="classic"], :root:not([data-theme]) {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #1F1A2E;
  --ink-2: rgba(31,26,46,0.72);
  --ink-3: #6B6483;
  --ink-4: #9B95AC;
  --line: rgba(31,26,46,0.08);
  --line-2: rgba(31,26,46,0.04);
  --accent: #664FAD;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFEAF7;
  --accent-softer: #F6F2FB;
  --accent-line: rgba(102,79,173,0.22);
  --accent-rgb: 102,79,173;
  --ok: #29B263;
  --ok-soft: #E8F6EE;
  --warn: #F97316;
  --warn-soft: #FEF0E5;
  --danger: #DC2626;
  --danger-soft: #FDECEC;
  --magenta: #D03E9D;
  --experiment: #1A73E8;
  --experiment-soft: #E8F0FE;
  --idea-alt: #B07FD0;
  --idea-soft: #F3F0FF;
  --avatar-you: linear-gradient(135deg, #664FAD, #D03E9D);
  --avatar-hue: 262;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 14px rgba(31,26,46,0.06), 0 1px 2px rgba(31,26,46,0.04);
  --shadow-lg: 0 12px 40px rgba(31,26,46,0.12), 0 2px 8px rgba(31,26,46,0.06);
}

/* ── Wabi — minimal Japanese aesthetic, warm neutrals, moss green ── */
[data-theme="wabi"] {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --ink: #2C2924;
  --ink-2: rgba(44,41,36,0.72);
  --ink-3: #7A7267;
  --ink-4: #A69E93;
  --line: rgba(44,41,36,0.08);
  --line-2: rgba(44,41,36,0.04);
  --accent: #5B8C5A;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(91,140,90,0.10);
  --accent-softer: rgba(91,140,90,0.05);
  --accent-line: rgba(91,140,90,0.22);
  --accent-rgb: 91,140,90;
  --ok: #5B8C5A;
  --ok-soft: rgba(91,140,90,0.10);
  --warn: #C6923A;
  --warn-soft: rgba(198,146,58,0.10);
  --danger: #C0564B;
  --danger-soft: rgba(192,86,75,0.10);
  --magenta: #9B6B8A;
  --experiment: #6B8FA3;
  --experiment-soft: rgba(107,143,163,0.10);
  --idea-alt: #C6923A;
  --idea-soft: rgba(198,146,58,0.08);
  --avatar-you: linear-gradient(135deg, #5B8C5A, #3D6B5E);
  --avatar-hue: 120;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(44,41,36,0.06), 0 1px 2px rgba(44,41,36,0.04);
  --shadow-lg: 0 12px 40px rgba(44,41,36,0.10), 0 2px 8px rgba(44,41,36,0.05);
}

/* ── Nord — Inspired by the Arctic colour palette. Deep polar night base
   with aurora-derived accents. Cool, focused, serene. The kind of interface
   you'd design if you worked in a glass studio overlooking a fjord.
   Colour theory: analogous blues with a single complementary frost-green
   accent for CTAs. Muted semantic colours avoid competing with content. ── */
[data-theme="nord"] {
  --bg: #2E3440;
  --surface: #3B4252;
  --ink: #ECEFF4;
  --ink-2: rgba(236,239,244,0.78);
  --ink-3: #D8DEE9;
  --ink-4: #7B88A1;
  --line: rgba(236,239,244,0.08);
  --line-2: rgba(236,239,244,0.04);
  --accent: #88C0D0;
  --accent-ink: #2E3440;
  --accent-soft: rgba(136,192,208,0.14);
  --accent-softer: rgba(136,192,208,0.07);
  --accent-line: rgba(136,192,208,0.25);
  --accent-rgb: 136,192,208;
  --ok: #A3BE8C;
  --ok-soft: rgba(163,190,140,0.14);
  --warn: #EBCB8B;
  --warn-soft: rgba(235,203,139,0.12);
  --danger: #BF616A;
  --danger-soft: rgba(191,97,106,0.14);
  --magenta: #B48EAD;
  --experiment: #81A1C1;
  --experiment-soft: rgba(129,161,193,0.14);
  --idea-alt: #EBCB8B;
  --idea-soft: rgba(235,203,139,0.10);
  --avatar-you: linear-gradient(135deg, #88C0D0, #5E81AC);
  --avatar-hue: 193;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Ember — Warm light theme. The colour of unbleached linen, terracotta
   tiles, espresso on a wooden counter. Background is warm ivory — not white,
   not cream, but the colour of a page in a well-made book. Accent is burnt
   sienna: confident, earthy, human. Semantic colours are drawn from nature —
   forest green, ochre, brick — nothing synthetic.
   Colour theory: analogous warm earth tones with cool dusty-blue counterpoint
   for information/experiment signals. Every colour could exist in a kiln. ── */
[data-theme="ember"] {
  --bg: #FAF6F1;
  --surface: #FFFFFF;
  --ink: #2D2117;
  --ink-2: rgba(45,33,23,0.74);
  --ink-3: #7A6555;
  --ink-4: #A99683;
  --line: rgba(45,33,23,0.08);
  --line-2: rgba(45,33,23,0.04);
  --accent: #B84C2A;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(184,76,42,0.09);
  --accent-softer: rgba(184,76,42,0.04);
  --accent-line: rgba(184,76,42,0.20);
  --accent-rgb: 184,76,42;
  --ok: #3D7A4A;
  --ok-soft: rgba(61,122,74,0.08);
  --warn: #A87B2B;
  --warn-soft: rgba(168,123,43,0.09);
  --danger: #A63D3D;
  --danger-soft: rgba(166,61,61,0.08);
  --magenta: #8C5A6F;
  --experiment: #547A93;
  --experiment-soft: rgba(84,122,147,0.09);
  --idea-alt: #A87B2B;
  --idea-soft: rgba(168,123,43,0.07);
  --avatar-you: linear-gradient(135deg, #B84C2A, #8C5A6F);
  --avatar-hue: 15;
  --shadow-sm: 0 1px 2px rgba(45,33,23,0.05);
  --shadow-md: 0 4px 14px rgba(45,33,23,0.07), 0 1px 2px rgba(45,33,23,0.04);
  --shadow-lg: 0 12px 36px rgba(45,33,23,0.11), 0 2px 8px rgba(45,33,23,0.05);
}

/* ── Horizon — Cool steel with vivid cyan. The background is noticeably
   blue-grey — not another white page with a different accent colour. This
   is the difference: you feel the temperature shift immediately. The accent
   is a saturated teal-cyan that cuts through the cool base like neon
   reflected on wet asphalt. Ink is near-black navy. Shadows are cool.
   Feels like a modern control room — Stripe, Linear, the tools built by
   people who think about interfaces all day.
   Colour theory: cool monochrome base + high-chroma complementary accent
   (cyan against blue-grey). Warm signals (warn, idea) provide deliberate
   temperature contrast for attention. ── */
[data-theme="horizon"] {
  --bg: #EDF1F5;
  --surface: #F8FAFB;
  --ink: #0F172A;
  --ink-2: rgba(15,23,42,0.74);
  --ink-3: #475569;
  --ink-4: #94A3B8;
  --line: rgba(15,23,42,0.08);
  --line-2: rgba(15,23,42,0.04);
  --accent: #0891B2;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(8,145,178,0.10);
  --accent-softer: rgba(8,145,178,0.05);
  --accent-line: rgba(8,145,178,0.22);
  --accent-rgb: 8,145,178;
  --ok: #0D9488;
  --ok-soft: rgba(13,148,136,0.09);
  --warn: #CA8A04;
  --warn-soft: rgba(202,138,4,0.09);
  --danger: #BE123C;
  --danger-soft: rgba(190,18,60,0.08);
  --magenta: #7C3AED;
  --experiment: #1D4ED8;
  --experiment-soft: rgba(29,78,216,0.09);
  --idea-alt: #CA8A04;
  --idea-soft: rgba(202,138,4,0.07);
  --avatar-you: linear-gradient(135deg, #0891B2, #0D9488);
  --avatar-hue: 185;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.07), 0 1px 3px rgba(15,23,42,0.03);
  --shadow-lg: 0 12px 36px rgba(15,23,42,0.11), 0 2px 8px rgba(15,23,42,0.05);
}

[data-density="compact"] {
  --rail-w: 232px;
  --right-w: 300px;
  --row-pad-y: 8px;
  --row-pad-x: 12px;
  --card-pad: 14px;
  --gap: 10px;
  --title-size: 20px;
  --body-size: 13px;
  --meta-size: 11px;
}

[data-density="terminal"] {
  --rail-w: 220px;
  --right-w: 288px;
  --row-pad-y: 5px;
  --row-pad-x: 10px;
  --card-pad: 10px;
  --gap: 6px;
  --title-size: 18px;
  --body-size: 12.5px;
  --meta-size: 11px;
  --radius: 6px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: var(--body-size);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
#root { min-height: 100vh; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* Default icon sizing — SVGs without an explicit size fall back to 14px.
   Prevents the occasional un-sized svg blowing up to container width. */
.search > svg, .wiki-search > svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-3); }

.mono { font-family: 'Menlo', 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; letter-spacing: 0.2px; }
.muted { color: var(--ink-3); }
.kicker { font-family: 'Menlo', ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ── App shell ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr var(--right-w);
  grid-template-rows: 56px 1fr;
  height: 100vh;
  min-height: 680px;
  background: var(--bg);
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px 0 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
  position: sticky; top: 0;
}

.brand {
  width: var(--rail-w);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 100%;
  border-right: 1px solid var(--line);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 1px 2px rgba(0,0,0,0.2);
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.2px; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.tabs { display: flex; gap: 2px; background: var(--surface); padding: 3px; border: 1px solid var(--line); border-radius: 8px; }
.tab {
  border: 0; background: transparent; padding: 5px 12px;
  font-size: 13px; color: var(--ink-2); border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab[aria-current="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }

.search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink-3);
  font-size: 13px;
}
.search > svg { width: 14px; height: 14px; flex-shrink: 0; }
.wiki-search > svg { width: 14px; height: 14px; flex-shrink: 0; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--ink); font-size: 13px; }
.kbd {
  font-family: 'Menlo', ui-monospace, monospace;
  font-size: 10.5px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--bg);
}

.reminder { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; }
.reminder-dot { width: 14px; height: 14px; color: var(--ok); }
.reminder b { color: var(--ink); font-weight: 500; }

.checkin-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--ok);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 1px 3px rgba(41,178,99,0.4);
  transition: transform 120ms ease, box-shadow 120ms ease, background 200ms ease;
}
.checkin-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 0 rgba(255,255,255,0.25) inset, 0 4px 10px rgba(41,178,99,0.35); }
.checkin-btn.done {
  background: var(--surface-2, #f0f0f0);
  color: var(--ink-3);
  box-shadow: none;
  cursor: default;
}
.checkin-btn.done:hover { transform: none; box-shadow: none; }
.checkin-btn .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.8); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

/* ── Left rail ─────────────────────────────────────────────── */
.rail {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}
.rail-section { padding: 16px 12px 6px; }
.rail-heading {
  font-family: 'Menlo', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 8px 6px;
  display: flex; justify-content: space-between; align-items: center;
}

.squad-switcher {
  display: flex; flex-direction: column; gap: 2px;
}
.squad-switch-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border: 1px solid transparent; background: transparent;
  border-radius: 7px; font-size: 12.5px; font-weight: 500;
  color: var(--ink-3); text-align: left;
  cursor: pointer; font-family: inherit;
  transition: all 100ms ease;
}
.squad-switch-btn:hover { background: var(--bg); color: var(--ink-2); }
.squad-switch-btn[aria-current="true"] {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.scope-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: var(--row-pad-y) var(--row-pad-x);
  border: 0; background: transparent;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  letter-spacing: -0.1px;
  transition: background 100ms ease;
}
.scope-item:hover { background: rgba(var(--accent-rgb),0.06); color: var(--ink); }
.scope-item[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--ink);
}
.scope-item .scope-icon { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.scope-item[aria-current="true"] .scope-icon { color: var(--accent); }
.scope-item .scope-label { flex: 1; }
.scope-item .scope-meta { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.scope-ring { display: flex; align-items: center; flex-shrink: 0; }
.scope-ring-svg { width: 22px !important; height: 22px !important; }
.scope-bar {
  width: 36px; height: 5px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.scope-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.user-card {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}

/* ── Profile panel ─────────────────────────────────────────── */
.profile-panel { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: flex-start; }
.profile-panel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.2); z-index: 0; }
.profile-panel-content {
  position: relative; z-index: 2;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 20px; width: 320px; max-height: 80vh; overflow-y: auto;
  margin: 12px; margin-left: 60px;
}
.theme-switcher { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 11px; color: var(--ink); user-select: none; }
.theme-pill:hover { background: var(--line-2); }
.theme-pill.active { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 600; }
.theme-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.profile-field { margin-bottom: 12px; }
.profile-field label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.profile-field input, .profile-field select {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-1); outline: none;
}
.profile-field input:focus, .profile-field select:focus { border-color: var(--accent); }
.squad-checklist {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--surface);
}
/* Override the generic .profile-field label (display:block / uppercase) */
.profile-field .squad-check {
  display: flex !important; align-items: center; gap: 8px;
  padding: 7px 8px; margin: 0; border-radius: 6px;
  font-size: 12.5px; font-weight: 400; line-height: 1.3; text-transform: none; letter-spacing: 0;
  cursor: pointer; color: var(--ink-2);
}
.profile-field .squad-check:hover { background: var(--bg); }
.profile-field .squad-check.on { background: var(--accent-soft); color: var(--ink-1); }
.profile-field .squad-check input { accent-color: var(--accent); flex-shrink: 0; margin: 0; width: auto; }
.profile-field .squad-check span { flex: 1; min-width: 0; }  /* min-width:0 stops per-character wrap */
.profile-detail-grid { display: flex; flex-direction: column; gap: 8px; }
.profile-detail-item { display: flex; justify-content: space-between; align-items: center; }
.profile-detail-label { font-size: 12px; color: var(--ink-3); }
.profile-detail-value { font-size: 12px; font-weight: 500; color: var(--ink-1); }
.profile-ancestry { display: flex; flex-direction: column; gap: 4px; padding-left: 8px; border-left: 2px solid var(--line); }
.profile-ancestry-item { display: flex; align-items: center; gap: 8px; }
.profile-ancestry-type { font-size: 10px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; min-width: 60px; }
.profile-ancestry-name { font-size: 12.5px; color: var(--ink-1); font-weight: 500; }

/* ── Right rail ────────────────────────────────────────────── */
.right-rail {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 14px 18px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 16px;
}
.rr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

/* Coming soon overlay */
.coming-soon-wrap {
  position: relative;
  overflow: hidden;
}
.coming-soon-wrap > *:not(.coming-soon-overlay) {
  filter: blur(2.5px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.coming-soon-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coming-soon-overlay span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.rr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rr-head svg { width: 14px; height: 14px; color: var(--accent); }
.rr-title { font-size: 13px; font-weight: 600; letter-spacing: -0.2px; }

.goal { margin-bottom: 12px; }
.goal:last-child { margin-bottom: 0; }
.goal-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; letter-spacing: -0.1px; }
.goal-head .pct { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.goal-bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.goal-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--magenta) 100%);
  border-radius: 99px;
}
.goal-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.todo { display: flex; gap: 9px; padding: 6px 0; font-size: 13px; align-items: flex-start; line-height: 1.4; }
.todo input[type=checkbox] { accent-color: var(--accent); margin-top: 2px; }
.todo label { flex: 1; cursor: pointer; color: var(--ink-2); letter-spacing: -0.1px; }
.todo input:checked + label { color: var(--ink-4); text-decoration: line-through; }
.todo .from { color: var(--ink-4); font-size: 11px; margin-top: 2px; display: block; }
.todo.overdue { border-left: 3px solid var(--danger); padding-left: 8px; margin-left: -8px; border-radius: 2px; }
.todo.prio-high { background: var(--danger-soft); border-radius: 6px; padding: 6px 8px; margin: 2px -8px; }
.todo.prio-medium { background: var(--experiment-soft); border-radius: 6px; padding: 6px 8px; margin: 2px -8px; }
.todo.prio-low { background: var(--line-2); border-radius: 6px; padding: 6px 8px; margin: 2px -8px; }
.todo.completing {
  text-decoration: line-through;
  opacity: 0.4;
  transform: translateX(4px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.todo.completing label { color: var(--ink-4) !important; }
.todo-meta { font-size: 11px; color: var(--ink-4); }

.senti-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.senti-cell { aspect-ratio: 1; border-radius: 4px; background: var(--accent-soft); }
.senti-legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 8px; }

/* ── Main panel ────────────────────────────────────────────── */
.main {
  overflow-y: auto;
  padding: 24px 28px 40px;
  scroll-behavior: smooth;
}
.main-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px; flex-wrap: wrap;
}
.main-title { font-size: var(--title-size); font-weight: 600; letter-spacing: -0.6px; }
.main-title .sub { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 10px; letter-spacing: -0.1px; }
.main-meta { font-size: 12px; color: var(--ink-3); }

/* Period type toggle (Day · Week · Month · Quarter) */
.period-types { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.period-type {
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 12.5px; font-weight: 500; padding: 5px 12px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.period-type:hover { color: var(--ink-1); }
.period-type.active { background: var(--accent); color: #fff; }

/* Period navigation row (‹ This week · 2–8 Jun ›) */
.period-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.period-arrow {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.period-arrow:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink-1); }
.period-arrow:disabled { opacity: 0.3; cursor: default; }
.period-label { font-size: 13.5px; font-weight: 600; color: var(--ink-1); min-width: 90px; }
.period-exact { font-weight: 400; color: var(--ink-3); }
.period-today {
  border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 2px 4px;
}
.period-today:hover { text-decoration: underline; }
.period-meta { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--card-pad);
  margin-bottom: var(--gap);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Today's check-ins */
.checkins-card { padding: 18px; }
.checkins-compact { padding: 14px 18px; }
.checkins-title { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; white-space: nowrap; }
.checkins-row {
  display: flex; align-items: center; gap: 16px;
}
.checkins-clusters {
  display: flex; align-items: center; gap: 14px;
}
.checkins-cluster {
  display: flex; align-items: center; position: relative; cursor: default;
  padding: 4px 8px 4px 4px; border-radius: 20px;
}
.checkins-cluster.done { background: rgba(41,178,99,0.08); }
.checkins-cluster.pending { background: var(--line-2); }
.checkins-avatar-wrap {
  position: relative; margin-left: -10px; flex-shrink: 0; border-radius: 50%;
}
.checkins-avatar-wrap:first-child { margin-left: 0; }
.checkins-avatar-wrap .avatar.sm {
  border: 2px solid var(--surface); width: 26px; height: 26px; font-size: 9px;
}
.checkins-cluster.done .checkins-avatar-wrap .avatar.sm {
  border-color: rgba(41,178,99,0.3);
}
.checkins-cluster-tick {
  position: absolute; top: -3px; right: -3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ok); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.checkins-cluster-tick svg { width: 9px; height: 9px; }
.checkins-cluster-more {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  margin-left: 4px; white-space: nowrap;
}

/* Instant custom tooltips */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 11.5px; line-height: 1.4; font-weight: 500;
  padding: 6px 10px; border-radius: 6px;
  white-space: pre-line; width: max-content; max-width: 200px;
  pointer-events: none; opacity: 0;
  transition: opacity 80ms ease;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Legacy member grid (kept for other usages) */
.checkins-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.checkins-pct {
  display: flex; align-items: center; gap: 10px;
  font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600;
}
.checkins-bar { width: 108px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.checkins-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 500ms ease; }
.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.member {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  font-size: 13px;
  transition: background 120ms ease, border-color 120ms ease;
}
.member.done { border-color: rgba(41,178,99,0.28); background: rgba(41,178,99,0.05); }
.member.you { border-color: rgba(var(--accent-rgb),0.3); background: rgba(var(--accent-rgb),0.04); }
.member.you.done { border-color: rgba(var(--accent-rgb),0.4); background: rgba(var(--accent-rgb),0.08); }
.member .name { flex: 1; font-weight: 500; letter-spacing: -0.1px; }
.member .time { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.member .dot-done { width: 14px; height: 14px; color: var(--ok); }
.member .dot-todo { width: 14px; height: 14px; color: var(--ink-4); }

/* AI summary */
.ai-card {
  background: var(--accent-softer);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: var(--gap);
}
.ai-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: -0.1px; }
.ai-label svg { width: 14px; height: 14px; }
.ai-source { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.ai-body { color: var(--ink); font-size: 14px; line-height: 1.55; letter-spacing: -0.1px; }
.ai-body ul { margin: 6px 0 0; padding-left: 18px; }
.ai-body li { margin: 3px 0; }

/* Detail level picker dropdown */
.detail-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 200px;
}
.detail-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
}
.detail-option:hover { background: var(--accent-softer); }
.detail-option strong { font-weight: 600; }
.detail-option span { font-size: 11.5px; color: var(--ink-3); margin-left: 8px; }

/* Filter chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--gap); }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}
.chip svg { width: 12px; height: 12px; }
.chip .count { font-variant-numeric: tabular-nums; color: var(--ink-4); font-size: 11px; margin-left: 2px; }
.chip[aria-pressed="true"] .count { color: var(--accent); }

/* Update cards */
.update {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: var(--gap);
}
.update-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.update-head .meta { flex: 1; }
.update-head .who { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.update-head .role { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.update-head .time { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.update-title { font-size: 15px; font-weight: 600; margin: 4px 0 6px; letter-spacing: -0.2px; }
.update-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; letter-spacing: -0.05px; }
.update-foot { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.tag svg { width: 11px; height: 11px; flex-shrink: 0; }
.tag.decision { background: var(--warn-soft); color: var(--warn); }
.tag.blocker { background: var(--danger-soft); color: var(--danger); }
.tag.idea { background: var(--idea-soft, var(--accent-soft)); color: var(--idea-alt, var(--accent)); }
.tag.knowledge { background: var(--accent-soft); color: var(--accent); }
.tag.experiment { background: var(--experiment-soft); color: var(--experiment); }
.tag.outcome { background: var(--ok-soft); color: var(--ok); }
.tag.voice { background: var(--line); color: var(--ink-3); }
.tag.meeting { background: var(--experiment-soft); color: var(--experiment); }
.tag.article { background: var(--accent-softer); color: var(--accent); border: 1px solid var(--accent-line); }
.tag.ghost { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }

/* Edit check-in */
.edit-checkin-btn {
  border: 0; background: transparent; color: var(--ink-4); cursor: pointer;
  padding: 3px; border-radius: 4px; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.15s;
}
.update:hover .edit-checkin-btn { opacity: 1; }
.edit-checkin-btn:hover { color: var(--accent); }
.edit-checkin-form { margin-top: 8px; }
.edit-checkin-textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink-1); resize: vertical; outline: none;
  line-height: 1.5;
}
.edit-checkin-textarea:focus { border-color: var(--accent); }
.edit-checkin-tags {
  display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.edit-tag-btn {
  font-size: 11.5px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  cursor: pointer; font-weight: 500; transition: all 0.12s;
}
.edit-tag-btn.active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.edit-tag-btn:hover:not(.active) { border-color: var(--ink-4); color: var(--ink-2); }
.edit-checkin-actions {
  display: flex; gap: 8px; margin-top: 10px;
}

.link-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
.link-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: var(--accent-softer);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.link-pill .arrow { color: var(--accent); opacity: 0.8; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--magenta) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border-width: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 22px; }

/* Voice note player */
.voice-player {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--accent-softer);
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: 12px;
  margin-top: 10px;
}
.voice-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 0; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(var(--accent-rgb),0.35);
}
.voice-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; }
.voice-wave span {
  flex: 1; background: var(--accent); opacity: 0.35;
  border-radius: 1.5px; min-height: 3px; max-height: 100%;
  transition: opacity 60ms linear;
}
.voice-wave span.on { opacity: 1; }
.voice-meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.voice-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: var(--line); color: var(--ink-3); font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }
.voice-transcript {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 8px; line-height: 1.55;
  padding: 10px 12px;
  background: rgba(var(--accent-rgb),0.04);
  border-radius: 8px;
  border-left: 2px solid var(--accent-line);
}
.editable-transcript {
  cursor: text;
  transition: background 120ms ease, border-color 120ms ease;
}
.editable-transcript:hover {
  background: rgba(var(--accent-rgb),0.07);
  border-left-color: var(--accent);
}
.editable-transcript:focus-within {
  background: rgba(var(--accent-rgb),0.07);
  border-left-color: var(--accent);
  outline: none;
}
.transcript-text {
  outline: none;
}
.transcript-text:focus {
  outline: none;
}
.transcript-edit-icon {
  position: absolute;
  top: 10px; right: 10px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.editable-transcript:hover .transcript-edit-icon {
  opacity: 0.7;
}
.editable-transcript:focus-within .transcript-edit-icon {
  opacity: 0;
}

/* ── Auth screen (now in auth.css) ──────────────────────────────────────── */

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  appearance: none;
  letter-spacing: -0.05px;
  transition: border-color 120ms ease, background 120ms ease;
}
.field input::placeholder { color: var(--ink-4); }
.field input:focus,
.field select:focus {
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08);
}
.field select { cursor: pointer; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6483' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field select:disabled { opacity: 0.45; cursor: not-allowed; }
.field-hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 3px rgba(var(--accent-rgb),0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 4px 10px rgba(var(--accent-rgb),0.3); }
.btn-primary:disabled { opacity: 0.55; transform: none; cursor: not-allowed; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.suggested-todos-modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 24px; max-width: 380px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideUp 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head .t { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.modal-head .t .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.modal-head .when { font-size: 12px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.modal-close { background: transparent; border: 0; color: var(--ink-3); padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.modal-close:hover { background: var(--bg); color: var(--ink); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.1px; }
.field textarea {
  width: 100%; min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
  outline: none;
  letter-spacing: -0.05px;
  transition: border-color 120ms ease, background 120ms ease;
}
.field textarea:focus { border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08); }

.rec-btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  transition: all 120ms ease;
}
.rec-btn:hover { border-color: var(--ok); background: var(--ok-soft); }
.rec-btn.recording { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.rec-btn .mic {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ok); color: #fff; display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(41,178,99,0.3);
}
.rec-btn.recording .mic { background: var(--danger); }

/* ── Voice Hero ─────────────────────────────────────────────── */
.voice-hero {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb),0.16);
  border-radius: 14px;
  padding: 22px 22px 20px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 240ms ease, background 240ms ease;
}
.voice-hero.is-recording {
  background: var(--accent-softer);
  border-color: rgba(var(--accent-rgb),0.32);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb),0.06);
}
.voice-hero.is-recorded {
  background: var(--surface);
}
.voice-hero-prompt { margin-bottom: 10px; }
.voice-hero-title {
  font-size: 16px; font-weight: 600; letter-spacing: -0.25px;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.voice-hero-title.recording-title { color: var(--accent); }
.voice-hero-title .rec-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0.5);
  animation: voice-pulse 1.4s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0.55); }
  50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb),0); }
}
.voice-hero-sub {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 4px; letter-spacing: -0.05px;
}
.voice-hero-stage {
  height: 96px;
  margin: 6px -6px 14px;
  display: flex; align-items: stretch;
  pointer-events: none;
}
/* Live wave inside the playback player — fills the wave slot, clearly visible */
.voice-wave-live {
  flex: 1; min-width: 0;
  height: 44px; min-height: 44px;
  display: flex; align-items: stretch; gap: 2px;
}
/* The wave wrapper (measured 1:1) must fill the flex slot */
.voice-wave-live .voice-wave-wrap { flex: 1; min-width: 0; }
/* fallback static bars share the slot */
.voice-wave-live span {
  flex: 1; align-self: center; background: var(--accent); opacity: 0.35;
  border-radius: 1.5px; min-height: 3px; max-height: 100%;
}
.voice-wave-wrap { display: block; }
.voice-hero-stage .voice-wave-wrap { flex: 1; }
.voice-wave-svg { display: block; width: 100%; height: 100%; }
.voice-hero-controls {
  display: flex; align-items: center; gap: 14px;
}
.voice-hero-after {
  display: flex; align-items: center; gap: 12px;
}

.mic-fab {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb),0.32), 0 1px 2px rgba(var(--accent-rgb),0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  position: relative;
}
.mic-fab:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(var(--accent-rgb),0.38); }
.mic-fab:active { transform: translateY(0); }
.mic-fab.recording {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb),0.3);
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb),0.10), 0 4px 14px rgba(var(--accent-rgb),0.18);
}
.mic-fab.recording::before {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),0.18);
  animation: voice-ring 1.8s ease-out infinite;
}
@keyframes voice-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}
.mic-fab.small { width: 44px; height: 44px; box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.24); }
.mic-fab .stop-icon {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 3px;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 99px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.05px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.ghost-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }

.text-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 18px;
  transition: border-color 120ms, color 120ms;
}
.text-toggle:hover { border-color: var(--accent); color: var(--accent); }

.sentiment-row { display: flex; gap: 6px; flex-wrap: wrap; }
.sentiment-row button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.sentiment-row button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sentiment-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* Scope selector pills */
.scope-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-pill {
  font-size: 12.5px; padding: 5px 12px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  cursor: pointer; transition: all 0.15s;
}
.scope-pill:hover { border-color: var(--ink-3); }
.scope-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* File upload zone */
.file-drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--ink-3);
  font-size: 13px;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-softer);
}
.file-drop-zone .file-hint {
  font-size: 11.5px;
  color: var(--ink-4);
}
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-2, #f5f7f9);
  border-radius: 6px;
  font-size: 13px;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.file-item .file-remove {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--ink-3); padding: 0 4px; line-height: 1;
}
.file-item .file-remove:hover { color: var(--danger, #c0392b); }

.meeting-drop svg { opacity: 0.7; }
.meeting-result-card {
  background: var(--bg-2, #f5f7f9);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.meeting-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meeting-file-row .file-remove {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--ink-3); padding: 0 4px; line-height: 1;
}
.meeting-file-row .file-remove:hover { color: var(--danger, #c0392b); }

.ai-preview {
  background: var(--accent-softer);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  padding: 14px;
  margin-top: 6px;
}
.ai-preview .ph { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--accent); font-weight: 600; margin-bottom: 8px; letter-spacing: -0.1px; }
.ai-preview .ph svg { width: 13px; height: 13px; }
.ai-preview .row { font-size: 13px; color: var(--ink); padding: 5px 0; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; letter-spacing: -0.05px; }
.ai-preview .row .t { font-family: 'Menlo', ui-monospace, monospace; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--ink-3); font-weight: 600; margin-top: 1px; flex-shrink: 0; border: 1px solid var(--line); letter-spacing: 0.3px; }
.ai-preview .row .t.dec { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.ai-preview .row .t.blk { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.ai-preview .row .t.kb { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ai-preview .row .t.exp { color: var(--experiment); border-color: var(--experiment); background: var(--experiment-soft); }
.ai-preview .row .t.idea { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ai-preview .row .t.out { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.ai-preview .row .t.tsk { color: var(--ink); }
.ai-preview .empty { font-size: 12.5px; color: var(--ink-3); font-style: italic; padding: 8px 2px; }

.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.modal-foot .l { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.modal-foot .r { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.primary:disabled { background: var(--ink-4); border-color: var(--ink-4); cursor: not-allowed; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.accent:hover { filter: brightness(1.15); }

.btn .sp { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 6px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-wrap {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink); color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  min-width: 280px;
  animation: toastIn 280ms cubic-bezier(0.2,0.9,0.3,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.toast b { font-weight: 600; }
.toast .lk { color: #C9BFE3; margin-left: auto; font-size: 12px; text-decoration: underline; cursor: pointer; }

/* Fanout animation */
@keyframes fanIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes wikiPulse { 0%,100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 3px var(--accent); } }
.wiki-focus { animation: wikiPulse 1.6s ease; outline: 1.5px solid var(--accent); }
.fan-new { animation: fanIn 420ms cubic-bezier(0.2, 0.9, 0.3, 1); }
.fan-highlight {
  position: relative;
}
.fan-highlight::before {
  content: ""; position: absolute; inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--accent);
  pointer-events: none;
  animation: highlight 1.6s ease-out;
  opacity: 0;
}
@keyframes highlight {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Wiki layout ───────────────────────────────────────── */
.wiki-layout {
  display: grid;
  grid-template-columns: 188px 1fr;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.wiki-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
}
.wiki-nav-item {
  display: flex;
  width: 100%;
  align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 0; background: transparent;
  border-radius: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  margin-bottom: 1px;
  box-sizing: border-box;
  cursor: pointer;
}
.wiki-nav-item:hover { background: var(--bg); color: var(--ink); }
.wiki-nav-item[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }

.wiki-badge {
  margin-left: auto;
  min-width: 18px; height: 18px;
  background: var(--warn-soft); color: var(--warn);
  border-radius: 99px; font-size: 10.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  flex-shrink: 0;
}

.wiki-stat-row {
  display: flex;
  justify-content: space-between; align-items: center;
  padding: 3px 10px;
  font-size: 12px; color: var(--ink-3);
}
.wiki-stat-row span:last-child { font-family: 'Menlo', ui-monospace, monospace; font-size: 11px; }

.wiki-content { min-width: 0; }

.wiki-cat-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px;
  flex-wrap: wrap;
}
.wiki-cat-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  cursor: pointer;
}
.wiki-cat-tab:hover { background: var(--bg); color: var(--ink); }
.wiki-cat-tab[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border-color: var(--line); }

.wiki-section-group { margin-bottom: 22px; }
.wiki-group-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px; padding: 0 4px;
}

.decision-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 100ms ease;
}
.decision-row:hover { border-color: rgba(var(--accent-rgb),0.3); }
.decision-row-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
}
.decision-title { font-size: 14px; font-weight: 600; letter-spacing: -0.15px; line-height: 1.4; }
.decision-body {
  padding: 12px 16px 14px 40px;
  border-top: 1px solid var(--line);
}

.wiki-status {
  font-size: 10.5px; font-weight: 500; padding: 2px 8px;
  border-radius: 99px; white-space: nowrap;
  flex-shrink: 0;
}
.wiki-status.live { background: var(--ok-soft); color: var(--ok); }
.wiki-status.draft { background: var(--warn-soft); color: var(--warn); }
.wiki-status.archived { background: var(--bg); color: var(--ink-4); border: 1px solid var(--line); }

/* ── Wiki ──────────────────────────────────────────────── */
.wiki-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.wiki-search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--ink); font-size: 13.5px; }

.wiki-upload-panel {
  background: var(--surface);
  border: 1px solid rgba(var(--accent-rgb),0.16);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wiki-scope-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  margin-bottom: 14px;
  overflow-x: auto;
}
.wiki-scope-sep {
  color: var(--ink-4);
  font-size: 14px;
  margin: 0 2px;
  user-select: none;
}
.wiki-scope-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.15s;
}
.wiki-scope-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.wiki-scope-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.1);
}
.wiki-scope-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  font-weight: 500;
}
.wiki-scope-squad-group {
  display: flex;
  gap: 4px;
}

.wiki-item { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.wiki-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
}
.wiki-icon.outcome { background: var(--ok-soft); color: var(--ok); }
.wiki-icon.decision { background: var(--warn-soft); color: var(--warn); }
.wiki-icon.file { background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); }
.wiki-body { flex: 1; }
.wiki-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.wiki-desc { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.wiki-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.wiki-foot .tags { margin-left: auto; display: flex; gap: 5px; }
.wiki-foot .tag { font-size: 11px; background: var(--bg); color: var(--ink-3); border: 1px solid var(--line); padding: 2px 8px; }
.wiki-type { font-size: 11px; border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; color: var(--ink-3); text-transform: capitalize; }

/* ── Person profile ───────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; border: 0; background: transparent; padding: 0; margin-bottom: 16px; }
.back:hover { color: var(--ink); }
.person-head { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.person-name { font-size: 24px; font-weight: 600; letter-spacing: -0.6px; }
.person-role { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.person-actions { display: flex; gap: 8px; margin-top: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.8px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value.ok { color: var(--ok); }
.stat-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

.heatmap { display: flex; flex-wrap: wrap; gap: 3px; margin: 10px 0; }
.heat { width: 10px; height: 18px; border-radius: 2px; background: var(--line); position: relative; }
.heat[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2, #2c2640);
  color: var(--ink-1, #f0edf8);
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: none;
}
.heat.lv1 { background: var(--ok); }
.heat.lv2 { background: rgba(var(--accent-rgb),0.35); }
.heat.lv3 { background: var(--danger); }
.heat.lv4 { background: var(--accent); }
.heat.decision-heat   { background: var(--warn); }
.heat.blocker-heat    { background: var(--danger); }
.heat.knowledge-heat  { background: var(--accent); }
.heat.experiment-heat { background: var(--experiment); }
.heat.idea-heat       { background: var(--idea-alt); }
.heat.outcome-heat    { background: var(--ok); }
.heat.voice-heat      { background: var(--ink-3); }

.heatmap-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); align-items: center; }
.heatmap-legend .swatches { display: flex; gap: 4px; }
.heatmap-legend .sw { width: 10px; height: 10px; border-radius: 2px; }

/* ── History (My Check-Ins) ──────────────────────────── */
.hist-row {
  display: grid; grid-template-columns: 92px 1fr auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.hist-date { font-family: 'Menlo', ui-monospace, monospace; font-size: 11.5px; color: var(--ink-3); padding-top: 2px; }
.hist-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.hist-title { font-weight: 600; color: var(--ink); font-size: 14px; letter-spacing: -0.1px; }
.hist-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 220px; }

/* Misc */
.hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.nowrap { white-space: nowrap; }

/* Scrollbars */
.main::-webkit-scrollbar, .rail::-webkit-scrollbar, .right-rail::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb, .right-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.main::-webkit-scrollbar-thumb:hover, .rail::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
