/* ============================================================================
 * DESIGN TOKENS
 * ========================================================================= */

/* --- 1. Reference tokens (universal) ----------------------------------- */
:root {
  color-scheme: light dark;
  --space-1: 2px; --space-2: 4px; --space-3: 6px; --space-4: 8px;
  --space-5: 10px; --space-6: 12px; --space-7: 16px; --space-8: 20px;
  --space-9: 24px; --space-10: 32px; --space-11: 48px; --space-12: 64px;
  --radius-sm: 8px; --radius-md: 10px; --radius-lg: 12px; --radius-full: 999px;
  --radius: var(--radius-lg);
  --z-header: 50; --z-dropdown: 20; --z-backdrop: 99; --z-sidebar: 100;
  --motion-fast: 0.12s ease; --motion-mid: 0.18s ease;
  --text-xs: 10.5px; --text-sm: 11.5px; --text-md: 12.5px; --text-base: 13.5px;
  --text-body: 14px; --text-lg: 16px; --text-xl: 20px; --text-2xl: 24px;
  --radius-control: 8px; --radius-card: 12px; --radius-pill: 999px;
  --radius-checkbox: 5px; --border-width: 1px;
  --pad-card-x-base: 14px; --pad-card-y-base: 12px; --pad-row-y-base: 10px;
  --pad-button-x: 9px; --pad-button-y: 6px; --pad-pill-x: 8px; --pad-pill-y: 2px;
  --pad-seg-x: 11px; --pad-seg-y: 5px; --gap-card-content-base: 12px;

  /* Density (Settings → General, kv view.density). One multiplier scales the
   * card/row spacing tokens; themes override only the *-base values so each
   * keeps its own rhythm at every density. Chrome (buttons, pills, segs) stays
   * fixed — density is about content rows, not controls. */
  --density: 1;
  --pad-card-x: calc(var(--pad-card-x-base) * var(--density));
  --pad-card-y: calc(var(--pad-card-y-base) * var(--density));
  --pad-row-y: calc(var(--pad-row-y-base) * var(--density));
  --gap-card-content: calc(var(--gap-card-content-base) * var(--density));

  /* Accent / brand voltage. Defaults to ink so the non-Granola themes render
   * exactly as before; the Granola theme overrides these with olive-oat-green. */
  --accent: var(--ink); --accent-hover: var(--ink); --accent-ink: var(--surface);
  --accent-soft: var(--surface-2); --highlight: transparent; --focus: var(--ink-3);
  --font-display: var(--font-sans);
}
/* Density levels — data-density on <html> (default "cozy" needs no rule). */
:root[data-density="comfortable"] { --density: 1.2; }
:root[data-density="compact"] { --density: 0.75; }
/* Compact also drops the feed's secondary content: the participant pill row
 * under meeting titles and the task context lines. Both stay available in the
 * meeting side panel (its own .detail-people / .detail-task-summary classes). */
:root[data-density="compact"] #list .meeting-people,
:root[data-density="compact"] #list .task-summary { display: none; }

/* --- 2. Theme: GRANOLA (light) — id stays "default" -------------------- */
/* The "oats" palette: warm cream canvas, olive-oat-green CTA voltage, an
 * oat-yellow highlighter accent, Fraunces serif display + Geist body. */
:root {
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", "Geist Mono", "Menlo", "Consolas", monospace;
  --font-feature-settings: normal;
  --bg: #f7f7f2; --surface: #ffffff; --surface-2: #f1f1ea;
  --hover-surface: rgba(91, 111, 0, 0.05); --hover-strong: rgba(91, 111, 0, 0.09);
  --ink: #0e0f0c; --ink-2: #454745; --ink-3: #72726e; --ink-4: #b6b4aa;
  --line: #e3e3e3; --line-soft: #eaebe5;
  --radius-checkbox: 999px;
  --accent: #5b6f00; --accent-hover: #788c15; --accent-ink: #ffffff;
  --accent-soft: #e5eacd; --highlight: #febe29; --focus: #b2c248;
  --owner-bg: #e5eacd; --owner-border: rgba(91, 111, 0, 0.20); --owner-text: #4a5a00;
  --things-bg: #fdf3d6; --things-bg-hover: #f8e8b2; --things-border: rgba(193, 145, 22, 0.30);
  --things-text: #8a6712; --things-added-text: #5b6f00;
  --things-added-border: rgba(91, 111, 0, 0.25); --things-added-hover: #eef1dd;
  --error-bg: #fbeae5; --error-border: #f1c6b8; --error-ink: #bd4a30;
  --error-code-bg: rgba(255, 255, 255, 0.6);
  --green: #5b6f00; --amber: #c0851b; --red: #bd4a30;
  --shadow-sm: 0 1px 2px rgba(14, 15, 12, 0.05); --shadow-md: 0 2px 8px rgba(14, 15, 12, 0.06);
  --proj-tag-bg: #e5eacd; --proj-tag-border: rgba(91, 111, 0, 0.22); --proj-tag-text: #4a5a00;
  --internal-tag-bg: #f4e2a6; --internal-tag-border: rgba(160, 120, 20, 0.30); --internal-tag-text: #7a5e0a;
}

/* --- 2. Theme: GRANOLA (dark) — warm charcoal-olive paper -------------- */
[data-mode="dark"] {
  --bg: #15160f; --surface: #1e201a; --surface-2: #262820;
  --hover-surface: rgba(210, 224, 67, 0.06); --hover-strong: rgba(210, 224, 67, 0.11);
  --ink: #f3f2e9; --ink-2: #c3c4b6; --ink-3: #8f9082; --ink-4: #5d5f52;
  --line: rgba(243, 242, 233, 0.12); --line-soft: rgba(243, 242, 233, 0.06);
  --accent: #aebd3a; --accent-hover: #c2d24a; --accent-ink: #1a1c12;
  --accent-soft: rgba(174, 189, 58, 0.16); --highlight: #febe29; --focus: #b2c248;
  --owner-bg: rgba(174, 189, 58, 0.16); --owner-border: rgba(174, 189, 58, 0.32); --owner-text: #cdd97a;
  --things-bg: rgba(214, 160, 30, 0.16); --things-bg-hover: rgba(214, 160, 30, 0.26);
  --things-border: rgba(214, 160, 30, 0.40); --things-text: #e0b85a;
  --things-added-text: #b7c84a; --things-added-border: rgba(174, 189, 58, 0.40);
  --things-added-hover: rgba(174, 189, 58, 0.12);
  --error-bg: rgba(233, 93, 61, 0.14); --error-border: rgba(233, 93, 61, 0.40);
  --error-ink: #f0a892; --error-code-bg: rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --proj-tag-bg: rgba(174, 189, 58, 0.16); --proj-tag-border: rgba(174, 189, 58, 0.34); --proj-tag-text: #cdd97a;
  --internal-tag-bg: rgba(244, 226, 166, 0.14); --internal-tag-border: rgba(244, 226, 166, 0.30); --internal-tag-text: #e6d290;
}

/* --- 3. Theme: SOLARIZED ----------------------------------------------- */
[data-theme="solarized"] {
  --font-sans: "IBM Plex Sans", "PlexSans", "Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "PlexMono", "Plex Mono", "SF Mono", "Menlo", monospace;
  --font-feature-settings: normal;
  --bg: #fdf6e3; --surface: #fffbf0; --surface-2: #eee8d5;
  --hover-surface: rgba(181, 137, 0, 0.06); --hover-strong: rgba(181, 137, 0, 0.1);
  --ink: #073642; --ink-2: #586e75; --ink-3: #93a1a1; --ink-4: #c0b7a0;
  --line: rgba(7, 54, 66, 0.12); --line-soft: rgba(7, 54, 66, 0.05);
  --owner-bg: rgba(108, 113, 196, 0.12); --owner-border: rgba(108, 113, 196, 0.30); --owner-text: #5b60b8;
  --things-bg: rgba(181, 137, 0, 0.12); --things-bg-hover: rgba(181, 137, 0, 0.22);
  --things-border: rgba(181, 137, 0, 0.30); --things-text: #8b6914;
  --things-added-text: #6f8200; --things-added-border: rgba(133, 153, 0, 0.30); --things-added-hover: rgba(133, 153, 0, 0.08);
  --error-bg: rgba(220, 50, 47, 0.08); --error-border: rgba(220, 50, 47, 0.32);
  --error-ink: #b32a27; --error-code-bg: rgba(255, 251, 240, 0.7);
  --green: #859900; --amber: #b58900; --red: #dc322f;
  /* Own accent (Solarized blue) so the olive Granola CTA doesn't leak in. */
  --accent: #268bd2; --accent-hover: #1f6fa8; --accent-ink: #fdf6e3; --accent-soft: rgba(38, 139, 210, 0.14);
  --shadow-sm: 0 1px 2px rgba(7, 54, 66, 0.06); --shadow-md: 0 4px 12px rgba(7, 54, 66, 0.08);
  --proj-tag-bg: rgba(133, 153, 0, 0.10); --proj-tag-border: rgba(133, 153, 0, 0.28); --proj-tag-text: #6b7a00;
  --internal-tag-bg: rgba(42, 161, 152, 0.10); --internal-tag-border: rgba(42, 161, 152, 0.28); --internal-tag-text: #2aa198;
}
[data-theme="solarized"][data-mode="dark"] {
  --bg: #002b36; --surface: #073642; --surface-2: #0a4150;
  --hover-surface: rgba(253, 246, 227, 0.04); --hover-strong: rgba(253, 246, 227, 0.07);
  --ink: #fdf6e3; --ink-2: #93a1a1; --ink-3: #839496; --ink-4: #586e75;
  --line: rgba(253, 246, 227, 0.10); --line-soft: rgba(253, 246, 227, 0.05);
  --owner-bg: rgba(108, 113, 196, 0.22); --owner-border: rgba(108, 113, 196, 0.40); --owner-text: #aab0ff;
  --things-bg: rgba(181, 137, 0, 0.18); --things-bg-hover: rgba(181, 137, 0, 0.28);
  --things-border: rgba(181, 137, 0, 0.40); --things-text: #d4a73e;
  --things-added-text: #b3c84d; --things-added-border: rgba(133, 153, 0, 0.40); --things-added-hover: rgba(133, 153, 0, 0.14);
  --error-bg: rgba(220, 50, 47, 0.14); --error-border: rgba(220, 50, 47, 0.40);
  --error-ink: #ee756f; --error-code-bg: rgba(0, 43, 54, 0.55);
  --green: #b3c84d; --amber: #cb930b; --red: #ee756f;
  --accent: #2aa1d8; --accent-hover: #4cb3e2; --accent-ink: #002b36; --accent-soft: rgba(42, 161, 216, 0.20);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --proj-tag-bg: rgba(133, 153, 0, 0.18); --proj-tag-border: rgba(133, 153, 0, 0.38); --proj-tag-text: #b3c84d;
  --internal-tag-bg: rgba(42, 161, 152, 0.18); --internal-tag-border: rgba(42, 161, 152, 0.38); --internal-tag-text: #2aa198;
}

/* --- 4. Theme: CARBON -------------------------------------------------- */
[data-theme="carbon"] {
  --font-sans: "IBM Plex Sans", "PlexSans", "Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "PlexMono", "Plex Mono", "SF Mono", "Menlo", monospace;
  --font-feature-settings: normal;
  --radius-control: 0px; --radius-card: 0px; --radius-pill: 0px; --radius-checkbox: 0px;
  --pad-card-x-base: 16px; --pad-card-y-base: 14px; --pad-row-y-base: 12px; --pad-button-x: 12px;
  --pad-button-y: 7px; --pad-pill-x: 8px; --pad-pill-y: 4px; --pad-seg-x: 12px;
  --pad-seg-y: 6px; --gap-card-content-base: 14px;
  --bg: #ffffff; --surface: #f4f4f4; --surface-2: #ffffff;
  --hover-surface: #e8e8e8; --hover-strong: #d8d8d8;
  --ink: #161616; --ink-2: #525252; --ink-3: #6f6f6f; --ink-4: #a8a8a8;
  --line: #c6c6c6; --line-soft: #e0e0e0;
  --owner-bg: #edf5ff; --owner-border: #78a9ff; --owner-text: #0043ce;
  --things-bg: #fdf6dd; --things-bg-hover: #fcefc4; --things-border: #d2a106;
  --things-text: #6e5202; --things-added-text: #198038; --things-added-border: #6fdc8c; --things-added-hover: #defbe6;
  --error-bg: #fff1f1; --error-border: #fcd6d6; --error-ink: #a2191f; --error-code-bg: #ffffff;
  --green: #198038; --amber: #d2a106; --red: #da1e28;
  /* Own accent (IBM Carbon interactive blue). */
  --accent: #0f62fe; --accent-hover: #0353e9; --accent-ink: #ffffff; --accent-soft: rgba(15, 98, 254, 0.12);
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.06); --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
  --proj-tag-bg: #defbe6; --proj-tag-border: #6fdc8c; --proj-tag-text: #0e6027;
  --internal-tag-bg: #e5f6ff; --internal-tag-border: #82cfff; --internal-tag-text: #003a6d;
}
[data-theme="carbon"][data-mode="dark"] {
  --bg: #161616; --surface: #262626; --surface-2: #393939;
  --hover-surface: #353535; --hover-strong: #4c4c4c;
  --ink: #f4f4f4; --ink-2: #c6c6c6; --ink-3: #8d8d8d; --ink-4: #6f6f6f;
  --line: #525252; --line-soft: #393939;
  --owner-bg: #1c2a5a; --owner-border: #4589ff; --owner-text: #a6c8ff;
  --things-bg: #3d3000; --things-bg-hover: #5c4800; --things-border: #d2a106; --things-text: #f1c21b;
  --things-added-text: #6fdc8c; --things-added-border: rgba(111, 220, 140, 0.4); --things-added-hover: #1f3526;
  --error-bg: #3d1010; --error-border: rgba(218, 30, 40, 0.5); --error-ink: #ffb3b8; --error-code-bg: #262626;
  --green: #42be65; --amber: #f1c21b; --red: #fa4d56;
  --accent: #4589ff; --accent-hover: #6ea6ff; --accent-ink: #161616; --accent-soft: rgba(69, 137, 255, 0.18);
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.4); --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5);
  --proj-tag-bg: #1f3526; --proj-tag-border: rgba(111, 220, 140, 0.38); --proj-tag-text: #6fdc8c;
  --internal-tag-bg: #001141; --internal-tag-border: rgba(130, 207, 255, 0.38); --internal-tag-text: #82cfff;
}

/* --- 5. Theme: MATERIAL 3 ---------------------------------------------- */
[data-theme="material"] {
  --font-sans: "Roboto Flex", "Roboto", "Roboto Variable", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Roboto Mono", "SF Mono", "Menlo", monospace;
  --font-feature-settings: normal;
  --radius-control: 20px; --radius-card: 16px; --radius-pill: 8px; --radius-checkbox: 2px;
  --pad-card-x-base: 20px; --pad-card-y-base: 16px; --pad-row-y-base: 14px; --pad-button-x: 16px;
  --pad-button-y: 10px; --pad-pill-x: 12px; --pad-pill-y: 6px; --pad-seg-x: 14px;
  --pad-seg-y: 8px; --gap-card-content-base: 16px;
  --bg: #FEF7FF; --surface: #F3EDF7; --surface-2: #ECE6F0;
  --hover-surface: rgba(103, 80, 164, 0.08); --hover-strong: rgba(103, 80, 164, 0.12);
  --ink: #1D1B20; --ink-2: #49454F; --ink-3: #79747E; --ink-4: #CAC4D0;
  --line: #CAC4D0; --line-soft: #E7E0EC;
  --owner-bg: #EADDFF; --owner-border: rgba(103, 80, 164, 0.30); --owner-text: #21005D;
  --things-bg: #FFD8E4; --things-bg-hover: #FFC9DE; --things-border: rgba(125, 82, 96, 0.30);
  --things-text: #31111D; --things-added-text: #006D3F; --things-added-border: rgba(0, 109, 63, 0.30); --things-added-hover: #CEEFCF;
  --error-bg: #F9DEDC; --error-border: #F2B8B5; --error-ink: #B3261E; --error-code-bg: #FFFBFE;
  --green: #006D3F; --amber: #BF6A02; --red: #B3261E;
  /* Own accent (Material 3 primary / on-primary). */
  --accent: #6750A4; --accent-hover: #58438c; --accent-ink: #ffffff; --accent-soft: rgba(103, 80, 164, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05); --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
  --proj-tag-bg: #CEEFCF; --proj-tag-border: rgba(0, 109, 63, 0.28); --proj-tag-text: #006D3F;
  --internal-tag-bg: #E0F7FA; --internal-tag-border: rgba(0, 131, 143, 0.28); --internal-tag-text: #00838f;
}
[data-theme="material"][data-mode="dark"] {
  --bg: #141218; --surface: #211F26; --surface-2: #2B2930;
  --hover-surface: rgba(208, 188, 255, 0.08); --hover-strong: rgba(208, 188, 255, 0.12);
  --ink: #E6E0E9; --ink-2: #CAC4D0; --ink-3: #938F99; --ink-4: #49454F;
  --line: #49454F; --line-soft: #36343B;
  --owner-bg: #4F378B; --owner-border: rgba(208, 188, 255, 0.40); --owner-text: #EADDFF;
  --things-bg: #633B48; --things-bg-hover: #7A4859; --things-border: rgba(255, 177, 200, 0.30); --things-text: #FFD8E4;
  --things-added-text: #6FDBA0; --things-added-border: rgba(111, 219, 160, 0.40); --things-added-hover: #1F3526;
  --error-bg: #8C1D18; --error-border: rgba(242, 184, 181, 0.40); --error-ink: #F2B8B5; --error-code-bg: #141218;
  --green: #6FDBA0; --amber: #E2A058; --red: #F2B8B5;
  --accent: #D0BCFF; --accent-hover: #E0D0FF; --accent-ink: #381E72; --accent-soft: rgba(208, 188, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5);
  --proj-tag-bg: #1F3526; --proj-tag-border: rgba(111, 219, 160, 0.36); --proj-tag-text: #6FDBA0;
  --internal-tag-bg: rgba(0, 131, 143, 0.18); --internal-tag-border: rgba(0, 188, 212, 0.34); --internal-tag-text: #4dd0e1;
}

/* ============================================================================
 * GRANOLA THEME — chrome refinements, scoped to [data-theme="default"] so the
 * other three themes stay pixel-identical. Fraunces serif wordmark + section
 * heads, the oat-yellow highlighter gesture, and oat-green focus rings.
 * ========================================================================= */
[data-theme="default"] header.page h1,
[data-theme="default"] .auth-box h2,
[data-theme="default"] .smodal-pane h2,
[data-theme="default"] .gtdlg-title {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em;
}
[data-theme="default"] .auth-box h2 { font-size: 23px; }
/* The brand's hero gesture: a yellow-highlighter strip behind the wordmark. */
[data-theme="default"] .hl {
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat;
  background-size: 100% 0.42em; background-position: 0 0.92em;
  border-radius: 2px; padding: 0 0.08em;
}
/* Soft oat-green focus rings on inputs. */
[data-theme="default"] .auth-input:focus,
[data-theme="default"] .token-input:focus,
[data-theme="default"] .prompt-textarea:focus,
[data-theme="default"] .feedback-text:focus {
  border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-soft);
}
[data-theme="default"] .search-wrap:focus-within { border-color: var(--focus); }

/* ============================================================================
 * GRANOLA THEME — editorial polish to the Design System ("oats").
 * Everything below is scoped to [data-theme="default"] so it covers Granola in
 * both light and dark mode while leaving solarized / carbon / material untouched.
 * Type scale = Fraunces serif display + Geist body (DS tokens); serif weight
 * never exceeds 500. Density tokens are redefined here (NOT in :root) so the
 * roomier spacing reaches only Granola — solarized inherits the base :root.
 * ========================================================================= */

/* Roomier (but still balanced) density — only for Granola. */
[data-theme="default"] {
  --pad-card-x-base: 18px; --pad-card-y-base: 14px; --pad-row-y-base: 13px;
  --gap-card-content-base: 14px; --pad-pill-x: 11px; --pad-pill-y: 3px;
  --pad-seg-x: 12px; --pad-seg-y: 6px;
}

/* Editorial type scale. */
[data-theme="default"] header.page h1 {
  font-size: 34px; line-height: 38px; font-weight: 500; letter-spacing: -0.5px;
}
[data-theme="default"] .subtitle { font-size: 16px; line-height: 20px; letter-spacing: 0.16px; }
[data-theme="default"] .meeting-title {
  font-family: var(--font-display); font-size: 20px; line-height: 28px;
  font-weight: 500; letter-spacing: -0.3px;
}
[data-theme="default"] .meeting-meta { font-size: 13px; font-weight: 500; }
[data-theme="default"] .task-title { font-size: 16px; line-height: 20px; letter-spacing: 0.16px; }
[data-theme="default"] .task-summary { font-size: 14px; line-height: 18px; letter-spacing: 0.14px; }
[data-theme="default"] .detail-title { font-size: 34px; line-height: 38px; letter-spacing: -0.5px; }
[data-theme="default"] .detail-task-title { font-size: 16px; }

/* Pills, chips and actions settle on the DS button/caption size (13px / 500). */
[data-theme="default"] .chip { font-size: 13px; font-weight: 500; letter-spacing: 0.13px; }
[data-theme="default"] .pill,
[data-theme="default"] .pill.owner, [data-theme="default"] .pill.due { font-size: 13px; letter-spacing: 0.13px; }
[data-theme="default"] .found-badge { font-size: 13px; line-height: 16px; font-weight: 500; }

/* Search bar → full pill with a touch more padding; status line a hair larger. */
[data-theme="default"] .search-wrap { padding: 8px 14px; border-radius: var(--radius-pill); }
[data-theme="default"] .search-wrap input { font-size: 14px; }
[data-theme="default"] .status-bar { font-size: 13px; }

/* Airier list rhythm. */
[data-theme="default"] #list { gap: 18px; }
[data-theme="default"] .title-row { margin-bottom: 18px; }

/* Avatars are a Granola-theme flourish; outside it they'd render as a bare letter, so
   hide them entirely in the other themes and show the assignee name only. */
:root:not([data-theme="default"]) .owner-avatar,
:root:not([data-theme="default"]) .avatar { display: none; }

/* Assignee avatar — DS yellow circle + serif initial (read-only surfaces only). */
[data-theme="default"] .pill.owner .owner-avatar {
  width: 16px; height: 16px; border-radius: var(--radius-pill); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 9px; font-weight: 500;
  background: var(--highlight); color: var(--ink); margin-left: -3px;
}
/* Detail-panel assignee avatar → brand yellow (overrides the hue-rotated default,
   including dark mode via the higher-specificity descendant selector). */
[data-theme="default"] .detail-val .avatar {
  background: var(--highlight); color: var(--ink); font-family: var(--font-display);
}
/* Owner-kind colours in the oats theme: me = olive CTA, other = oat-yellow
   highlight, custom = neutral. (Base rules cover the other themes.) */
[data-theme="default"] .pill.owner.other {
  background: rgba(254, 190, 41, 0.20); border-color: rgba(254, 190, 41, 0.55); color: #5a4a00;
}
/* "Me" mirrors the soft "other" pill but in the olive CTA hue (with an olive-filled
   avatar), so it reads as elegant soft-green rather than a solid block. */
[data-theme="default"] .pill.owner.me {
  background: rgba(91, 111, 0, 0.14); border-color: rgba(91, 111, 0, 0.45); color: #4a5a00;
}
[data-theme="default"] .pill.owner.me .owner-avatar { background: var(--accent); color: var(--accent-ink); }
[data-theme="default"] .pill.owner.custom .owner-avatar { background: var(--surface-2); color: var(--ink-2); }
/* Unassigned chip (DS): three greys — a dark "?" avatar (Granola display font), a
   mid-grey "Unassigned" label, on a light-grey pill. */
[data-theme="default"] .pill.owner.na { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }
[data-theme="default"] .pill.owner.na .owner-avatar-na,
[data-theme="default"] .detail-val .avatar.avatar-na {
  background: var(--ink-4); color: var(--ink-2);
  font-family: var(--font-display); font-style: normal; font-weight: 500;
}
[data-mode="dark"][data-theme="default"] .pill.owner.na { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: var(--ink-3); }
[data-mode="dark"][data-theme="default"] .pill.owner.na .owner-avatar-na,
[data-mode="dark"][data-theme="default"] .detail-val .avatar.avatar-na { background: rgba(255,255,255,0.20); color: var(--ink); }
[data-mode="dark"][data-theme="default"] .pill.owner.other { color: #f0d894; }
[data-mode="dark"][data-theme="default"] .pill.owner.me { background: rgba(174, 189, 58, 0.16); border-color: rgba(174, 189, 58, 0.40); color: #cdd97a; }

/* ============================================================================
 * BASE
 * ========================================================================= */
* { box-sizing: border-box; }
/* Explicit `display` on a class would otherwise beat the UA's [hidden] rule
 * (auth boxes, settings sections, …) — enforce the attribute everywhere. */
[hidden] { display: none !important; }
html { touch-action: manipulation; } /* no double-tap zoom on touch devices */
body.scroll-locked { overflow: hidden; } /* freeze page scroll behind modals */
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--font-sans);
  font-feature-settings: var(--font-feature-settings);
  -webkit-font-smoothing: antialiased;
  /* Stop iOS from auto-inflating text after a landscape→portrait rotation. */
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  transition: background var(--motion-mid), color var(--motion-mid);
}
[data-mode="dark"] body { background: var(--bg); min-height: 100vh; }
.wrap { max-width: 860px; margin: 0 auto; padding: 20px 20px 80px; }

/* ============================================================================
 * AUTH GATE
 * ========================================================================= */
.auth-gate {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: safe center;
  background: var(--bg); z-index: 200; padding: 24px; overflow: auto;
}
.auth-gate[hidden] { display: none; }
.auth-box {
  width: 100%; max-width: 360px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-md);
}
.auth-box[hidden] { display: none; }
.auth-box h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.auth-box p { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.auth-input-row { display: flex; flex-direction: column; gap: 6px; }
.auth-input-row label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.01em; }
.auth-input {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 9px 11px; outline: none;
  width: 100%; transition: border-color 0.12s ease, box-shadow 0.12s ease;
  font-family: var(--font-mono);
}
.auth-input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 2px var(--line); }
.auth-error { font-size: 12px; color: var(--red); display: none; }
.auth-error.visible { display: block; }
.auth-submit {
  background: var(--accent); color: var(--accent-ink); border: 0;
  padding: 10px 16px; border-radius: var(--radius-control);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.12s ease; width: 100%;
}
.auth-submit:hover { opacity: 0.85; }

/* ============================================================================
 * HEADER
 * ========================================================================= */
header.page {
  position: sticky; top: 0; z-index: 50;
  margin: -20px -20px 0; padding: 20px 20px 12px;
  background: var(--bg); transition: background 0.18s ease;
}
header.page::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none; z-index: 1;
}
.title-row {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; min-height: 32px;
}
header.page h1 { font-size: 24px; font-weight: 650; margin: 0; letter-spacing: -0.02em; color: var(--ink); }
.subtitle { color: var(--ink-3); font-size: 13px; font-weight: 400; flex: 1; }
.header-actions { display: flex; gap: 4px; align-items: center; align-self: center; }
.header-btn {
  background: transparent; border: 1px solid var(--line);
  padding: var(--pad-button-y) var(--pad-button-x); border-radius: var(--radius-control);
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.12s ease; text-decoration: none; white-space: nowrap;
}
.header-btn:hover { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
.header-btn.danger:hover { color: var(--red); border-color: rgba(220,38,38,0.3); background: rgba(220, 38, 38, 0.06); }
.header-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.header-btn.icon-only { padding: 6px 7px; }
.header-btn:disabled { opacity: 0.5; cursor: progress; }
.header-btn.spinning svg { animation: spin 0.9s linear infinite; }
.header-btn.shake { animation: shake 0.32s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
.header-btn .chev { width: 9px; height: 9px; margin-left: -1px; opacity: 0.6; flex-shrink: 0; }
/* Uniform height across the header action buttons (Sync / activity / settings),
 * regardless of whether they carry a text label or just an icon. */
.header-actions .header-btn { height: 30px; box-sizing: border-box; line-height: 1; }

/* ============================================================================
 * DROPDOWNS
 * ========================================================================= */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 170px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-md); padding: 4px;
  display: flex; flex-direction: column; gap: 1px;
  z-index: 100; animation: menu-in 0.12s ease;
}
.dropdown-menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu button {
  text-align: left; background: transparent; border: 0;
  padding: var(--pad-seg-y) var(--pad-seg-x); font: inherit; font-size: 12.5px; color: var(--ink);
  cursor: pointer; border-radius: var(--radius-control);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.dropdown-menu button:hover { background: var(--hover-surface); }
.dropdown-menu button .hint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.dropdown-menu .sep { height: 1px; background: var(--line-soft); margin: 3px 2px; padding: 0; }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button.danger:hover { background: rgba(220, 38, 38, 0.08); }
.dropdown-menu button.danger .hint { color: var(--red); opacity: 0.7; }

/* Full re-sync scope modal + themed alert/confirm/prompt dialogs.
 * Sits above the settings modal (130/131) and detail panel (132/133) so
 * dialogs launched from those panes are never trapped behind them. */
.gtdlg-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.gtdlg-box {
  width: 100%; max-width: 440px;
  background: var(--surface); color: var(--ink);
  border: var(--border-width) solid var(--line-soft);
  border-radius: 14px; padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.gtdlg-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: 4px; }
.gtdlg-sub { font-size: var(--text-sm); color: var(--ink-3); margin-bottom: 14px; }
.gtdlg-opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-2); border: var(--border-width) solid var(--line-soft);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.gtdlg-opt:hover { border-color: var(--ink-3); background: var(--hover-surface); }
.gtdlg-opt.danger:hover { border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.06); }
.gtdlg-opt-title { display: block; font-size: var(--text-base); font-weight: 600; }
.gtdlg-opt.danger .gtdlg-opt-title { color: var(--red); }
.gtdlg-opt-sub { display: block; font-size: var(--text-sm); color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.gtdlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Themed alert / confirm / prompt dialogs (appAlert/appConfirm/appPrompt) */
.gtdlg-confirm { max-width: 400px; }
.gtdlg-confirm .gtdlg-title { font-size: var(--text-lg); margin-bottom: 0; }
.gtdlg-body {
  font-size: var(--text-body); color: var(--ink-3); line-height: 1.5;
  margin-top: 6px;
}
.gtdlg-input {
  width: 100%; box-sizing: border-box; margin-top: 14px;
  background: var(--surface-2); color: var(--ink);
  border: var(--border-width) solid var(--line-soft); border-radius: var(--radius-control);
  padding: 9px 12px; font: inherit; font-size: var(--text-base);
}
.gtdlg-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-soft); }
.gtdlg-confirm .gtdlg-actions { margin-top: 16px; }
.gtdlg-confirm .gtdlg-actions .header-btn { font-size: var(--text-base); padding: 8px 16px; }
.gtdlg-actions .header-btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.gtdlg-actions .header-btn.primary:hover { opacity: 0.88; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gtdlg-actions .header-btn.primary.danger {
  background: var(--red); color: var(--surface); border-color: var(--red);
}
.gtdlg-actions .header-btn.primary.danger:hover { opacity: 0.88; background: var(--red); border-color: var(--red); color: var(--surface); }

/* Subtle entrance — opt-in via .anim so the full re-sync modal stays instant */
.gtdlg-backdrop.anim { opacity: 0; transition: opacity 0.17s ease; }
.gtdlg-backdrop.anim.open { opacity: 1; }
.gtdlg-backdrop.anim .gtdlg-box { transform: scale(0.97); transition: transform 0.17s cubic-bezier(0.34, 1.4, 0.64, 1); }
.gtdlg-backdrop.anim.open .gtdlg-box { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .gtdlg-backdrop.anim, .gtdlg-backdrop.anim .gtdlg-box { transition: none; }
}

/* ============================================================================
 * TOOLBAR
 * ========================================================================= */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: var(--pad-card-y) var(--pad-card-x); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.seg {
  display: inline-flex; padding: 2px; gap: 1px;
  background: var(--surface-2); border-radius: var(--radius-control);
  border: 1px solid var(--line-soft);
}
.seg button {
  background: transparent; border: 0; padding: var(--pad-seg-y) var(--pad-seg-x);
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; border-radius: var(--radius-control); transition: all 0.12s ease;
  display: inline-flex; align-items: center; gap: 4px;
}
.seg button:hover:not(:disabled):not(.active) { background: var(--hover-surface); color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 0.5px var(--line); }
.seg button:disabled { opacity: 0.5; cursor: progress; }
.seg button svg { width: 11px; height: 11px; opacity: 0.7; }
.search-wrap {
  display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 140px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-control); padding: var(--pad-button-y) var(--pad-button-x);
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.search-wrap:focus-within { border-color: var(--ink-3); background: var(--surface); }
.search-wrap > svg { width: 13px; height: 13px; color: var(--ink-3); flex-shrink: 0; }
.search-wrap input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  font: inherit; font-size: 12.5px; color: var(--ink); padding: 0;
}
.search-wrap input::placeholder { color: var(--ink-3); }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--motion-fast), color var(--motion-fast);
}
.search-wrap.has-text .search-clear { opacity: 0.7; pointer-events: auto; }
.search-clear:hover { opacity: 1; color: var(--ink); }
.search-clear svg { width: 12px; height: 12px; }
.filter-chips { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
/* All three toolbar controls (Archived, assignee filter, sort) are chips, so they
   share one icon-aware pill shape; the active green is the shared selected state. */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-3);
  padding: 4px 10px; border-radius: var(--radius-pill);
  font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all var(--motion-fast);
}
.chip:hover:not(.active) { background: var(--hover-surface); color: var(--ink-2); border-color: var(--ink-4); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip svg { width: 13px; height: 13px; opacity: 0.8; flex-shrink: 0; }
/* The assignee filter's trailing chevron stays a touch quieter than the lead icon. */
.chip .chip-caret { width: 11px; height: 11px; opacity: 0.55; margin-left: -1px; }
.hidden-by-search { display: none !important; }
/* Mobile filter toggle: a funnel button on the right of the search bar that
   collapses/reveals the three filter chips. Desktop never shows it (the chips
   are always visible there); the mobile media query opts it back in. */
.filter-toggle { display: none; position: relative; }
.filter-toggle-dot { display: none; }

/* ============================================================================
 * STATUS BAR
 * ========================================================================= */
/* Sits in normal flow just under the (sticky) header so it scrolls away with the
   feed and is only visible at the top — it slides up behind the sticky header. */
.status-bar {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; padding: 0 4px;
  font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  min-height: 18px; flex-wrap: nowrap;
}
/* Stay one row: the status verb is fixed-width, the sync detail ellipsizes so a
   long "Checking for new meetings since…" never wraps and shoves the feed down
   (which then snapped back when sync finished). */
.status-bar #status { flex: 0 0 auto; white-space: nowrap; }
.status-bar .last-sync { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The "Synced X ago" text is the sync trigger (the header button is now the
   Inbox). An unstyled inline button; on hover-capable devices the label swaps
   to "Sync now" — suppressed mid-sync (.busy keeps the progress text readable)
   and when locked (no Granola key). */
.last-sync-btn {
  display: inline-grid; align-items: center; justify-items: start;
  grid-template-columns: minmax(0, max-content);
  flex: 0 1 auto; min-width: 0;
  background: none; border: 0; padding: 2px 6px; margin: -2px -6px;
  font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-pill);
}
/* Stack the two labels in one grid cell so the button width is always the wider
   of the two and NEVER reflows on hover. (With a display-swap the button shrank
   to "Sync now", the pointer slipped off the old "Synced X ago" width, :hover
   dropped, it grew back — a flicker loop near the right edge.) visibility:hidden
   still reserves space, so the track keeps its max width. */
.last-sync-btn > .last-sync,
.last-sync-btn > .sync-now-label { grid-area: 1 / 1; }
.last-sync-btn .sync-now-label { color: var(--accent); font-size: 11.5px; font-weight: 500; white-space: nowrap; visibility: hidden; }
@media (hover: hover) {
  .last-sync-btn:hover { background: var(--hover-surface); }
  .last-sync-btn:not(.busy):not(:disabled):hover .last-sync { visibility: hidden; }
  .last-sync-btn:not(.busy):not(:disabled):hover .sync-now-label { visibility: visible; }
}
.last-sync-btn:disabled { cursor: progress; }
.last-sync-btn:disabled:hover { background: none; }
.last-sync-btn.sync-locked { cursor: not-allowed; }
.last-sync-btn.shake { animation: shake 0.32s ease-in-out; }
.last-sync-btn[hidden] { display: none; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.dot.gray  { background: var(--ink-4); }
.dot.red   { background: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.last-sync { color: var(--ink-3); font-size: 11.5px; }

/* ============================================================================
 * MEETING CARDS & TASKS
 * ========================================================================= */
#list { display: flex; flex-direction: column; gap: calc(14px * var(--density)); margin-top: calc(16px * var(--density)); }
.meeting {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden;
  transition: box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
/* Hover affordances are pointer-only: on touch, iOS applies :hover stickily on
   tap (a scrolled-from row stayed highlighted) and re-evaluates hover chains
   while the finger drags — the background/box-shadow transitions then repaint
   cards mid-scroll and read as scroll lag. */
@media (hover: hover) {
  .meeting:hover { box-shadow: var(--shadow-md); }
}
.meeting-head {
  display: flex; align-items: center; gap: 2px 10px; flex-wrap: wrap;
  padding: var(--pad-card-y) var(--pad-card-x); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
/* Keep the right-side cluster (tag, date pill, project button, reprocess
 * icon, open-arrow) on the header's single first row: .meeting-title uses
 * flex-basis 0 (not auto), so its hypothetical size going into line-packing
 * is 0 rather than its full nowrap text width — with basis auto, a long
 * title's full-text width was what decided the row's contents, shoving the
 * cluster onto a wrapped second line. With basis 0 the cluster always wins
 * row one and the title grows into the leftover space, ellipsizing when it
 * runs out (one line always — a multi-line title made header spacing uneven
 * between cards). Wrapping is enabled only so the full-width participant row
 * (.meeting-people, basis 100%) can drop onto its own line below. */
.meeting-head > :not(.meeting-title):not(.meeting-people) { flex-shrink: 0; }
/* Participant group under the title in the feed (idea #18) — desktop only. The
 * row sits on its own line (flex-basis 100%) below the title; the .meeting-head
 * 2px row-gap spaces it tight against the title to match the meeting sidebar
 * (.detail-people margin-top). Drop the meeting-pane button's own block margins. */
.meeting-people { flex: 0 0 100%; display: flex; min-width: 0; }
.meeting-people .detail-people { margin: 0 0 0 -3px; }
.meeting-title {
  font-size: 14.5px; font-weight: 650; color: var(--ink);
  letter-spacing: -0.008em; flex: 1 1 0; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meeting-meta {
  font-size: 12px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line);
  padding: var(--pad-pill-y) var(--pad-pill-x); border-radius: var(--radius-pill); letter-spacing: -0.005em;
}
.tag-internal {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--internal-tag-text); background: var(--internal-tag-bg);
  border: 1px solid var(--internal-tag-border);
  padding: var(--pad-pill-y) var(--pad-pill-x); border-radius: var(--radius-pill); flex-shrink: 0;
}
.icon-btn {
  background: transparent; border: 0; padding: 4px; border-radius: var(--radius-control);
  cursor: pointer; color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.12s ease; text-decoration: none; min-width: 28px; min-height: 28px;
}
.icon-btn:hover:not(:disabled) { background: var(--hover-strong); color: var(--ink); }
.icon-btn:disabled { opacity: 0.4; cursor: progress; }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Locked because no Granola key is connected (not mid-sync): signal "unavailable",
   not "loading", by overriding the disabled `progress` cursor. Compound selectors
   keep specificity above the per-element `:disabled` rules above. */
.header-btn.sync-locked:disabled,
.icon-btn.sync-locked:disabled,
.pe-btn.sync-locked:disabled { cursor: not-allowed; }
ul.tasks { list-style: none; padding: 6px 0; margin: 0; }
li.task {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 4px; padding: var(--pad-row-y) var(--pad-card-x);
  border-top: 1px solid var(--line-soft);
  transition: opacity 0.2s ease, background 0.12s ease; align-items: start;
}
li.task:first-child { border-top: 0; }
/* Pointer-only (see the .meeting:hover note): sticky iOS tap-hover kept rows grey. */
@media (hover: hover) {
  li.task:hover { background: var(--surface-2); }
}
li.task.done { opacity: 0.5; }
/* Added tasks stay first-class visible (no dimming) now that adding doesn't archive. */
li.task.deleted { opacity: 0.45; background: var(--hover-surface); }
/* Vertical collapse used by the long-press delete (Archived off) for task rows + cards. */
.task.collapsing, .meeting.collapsing { transition: height 0.28s ease, opacity 0.22s ease, padding 0.28s ease, margin 0.28s ease; }
@media (prefers-reduced-motion: reduce) { .task.collapsing, .meeting.collapsing { transition: none; } }
li.task.deleted .task-title { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.checkbox {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 2px 0 0 4px;
  border: 1.5px solid var(--ink-4); border-radius: var(--radius-checkbox);
  cursor: pointer; background: var(--surface); position: relative;
  transition: all 0.12s ease; flex-shrink: 0;
}
.checkbox:hover { border-color: var(--ink-2); }
.checkbox:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 6px; height: 10px; border: solid var(--accent-ink);
  border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}
/* Deleted-row check: a white ✕ on a red fill so "deleted" reads at a glance. Clicking
   it marks the task done + clears the deleted flag (deleted → done). */
.check-deleted {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 2px 0 0 4px; padding: 0; flex-shrink: 0;
  border: 1.5px solid var(--red); border-radius: var(--radius-checkbox);
  background: var(--red); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: filter 0.12s ease;
}
.check-deleted:hover { filter: brightness(1.08); }
.check-deleted svg { width: 12px; height: 12px; }
.task-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 400; color: var(--ink); line-height: 1.42; word-wrap: break-word; letter-spacing: -0.003em; }
li.task.done .task-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.task-summary { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; word-wrap: break-word; }
.task-title[contenteditable], .task-summary[contenteditable] {
  outline: none; border-radius: 6px; padding: 2px 5px; margin: -2px -5px;
  cursor: text; transition: background 0.1s ease, box-shadow 0.1s ease;
  white-space: pre-wrap; word-break: break-word;
  /* Shrink the hit/edit target to the rendered text only — clicking the empty
     remainder of the row should not start an edit. */
  align-self: flex-start; max-width: 100%;
}
.task-title[contenteditable]:hover, .task-summary[contenteditable]:hover { background: var(--hover-surface); }
.task-title[contenteditable]:focus, .task-summary[contenteditable]:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--line); }
/* Gray placeholders are baked into every empty task field so blank fields read as
   tappable; pointer-events:none lets a click fall through to focus the field, and the
   placeholder vanishes the moment any text is typed (the field is no longer :empty). */
.task-title[contenteditable]:empty::before   { content: 'Title'; color: var(--ink-3); }
/* 'Description' shows on every task without one, so it stays extra-faint
   (--ink-4: lighter in light themes, darker in dark) to read as a whisper. */
.task-summary[contenteditable]:empty::before { content: 'Description'; color: var(--ink-4); }
.task-title[contenteditable]:empty::before,
.task-summary[contenteditable]:empty::before { pointer-events: none; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--ink-2); padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  white-space: nowrap; transition: all 0.1s ease;
}
.pill.owner { background: var(--owner-bg); border-color: var(--owner-border); color: var(--owner-text); font-weight: 500; }
.pill.owner.na { background: var(--surface-2); border-color: var(--line-soft); color: var(--ink-2); font-weight: 400; }
/* Three owner kinds: me (soft accent tint), other (themed owner colour), custom
   (neutral dashed = a typed name not yet in the roster). */
.pill.owner.me { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.pill.owner.other { background: var(--owner-bg); border-color: var(--owner-border); color: var(--owner-text); }
.pill.owner.custom { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); border-style: dashed; }
/* The owner pill is a button (opens the assignee dropdown). */
button.pill.owner { font: inherit; cursor: pointer; }
button.pill.owner:hover { box-shadow: 0 0 0 2px var(--line); }
button.pill.owner:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink-3); }
/* Right-side per-task action column: a connector "+" (only when configured) and a
   bin. Both icon cells are vertically centred and revealed on row hover (desktop);
   hovering a cell fills it with a soft pastel rectangle. On touch they're reached
   by swiping the row left (see the @media (hover: none) block below). */
.task-actions {
  grid-column: 3; align-self: stretch;
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity 0.12s ease;
}
li.task:hover .task-actions, li.task:focus-within .task-actions { opacity: 1; }
.task-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; background: transparent;
  border-radius: var(--radius-control); cursor: pointer; color: var(--ink-3);
  text-decoration: none; transition: background 0.1s ease, color 0.1s ease;
}
.task-act svg { width: 17px; height: 17px; }
.task-act.add:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.task-act.add.added { color: var(--accent); }
.task-act.trash:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
/* Put-back (restore) action — sits in the bin's slot on deleted rows, neutral (not
   destructive): hover tints toward the brand accent. */
.task-act.restore:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
li.task.pending-extract {
  opacity: 0.6; padding: var(--pad-row-y) var(--pad-card-x);
  display: flex; align-items: center; gap: 10px;
}
li.task.pending-extract .pe-label { font-size: 12.5px; color: var(--ink-3); font-style: italic; flex: 1; }
li.task.pending-extract .pe-btn {
  font: inherit; font-size: 11px; color: var(--ink-3);
  background: transparent; border: 1px solid var(--line);
  padding: 4px 10px; border-radius: var(--radius-pill); cursor: pointer;
  transition: all 0.1s ease; min-height: 30px;
}
li.task.pending-extract .pe-btn:hover:not(:disabled) { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
li.task.pending-extract .pe-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* "Add task" line — a thin, near-invisible row at the bottom of each meeting's task
   list. Hover/focus highlights it and brings the "+" (aligned with the checkbox
   column) and label forward; the whole line is the click target. */
li.task.task-add {
  cursor: pointer; align-items: center; min-height: 0;
  /* Pull the row down to absorb ul.tasks' 6px bottom padding so the hover
     highlight reaches the card's bottom edge (no white gap). The card clips it. */
  padding-top: 6px; padding-bottom: 12px; margin-bottom: -6px;
  color: var(--ink-4); transition: background 0.12s ease, color 0.12s ease;
}
li.task.task-add:focus-visible { background: var(--surface-2); color: var(--ink-2); outline: none; }
@media (hover: hover) {
  li.task.task-add:hover { background: var(--surface-2); color: var(--ink-2); outline: none; }
}
.task-add-plus {
  grid-column: 1; justify-self: start; width: 20px; height: 20px; margin: 0 0 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-4); opacity: 0.45; transition: opacity 0.12s ease, color 0.12s ease;
}
li.task.task-add:focus-visible .task-add-plus { opacity: 1; color: var(--accent); }
@media (hover: hover) {
  li.task.task-add:hover .task-add-plus { opacity: 1; color: var(--accent); }
}
.task-add-plus svg { width: 15px; height: 15px; }
.task-add-label {
  grid-column: 2; font-size: 12.5px; color: var(--ink-4);
  opacity: 0.55; transition: opacity 0.12s ease, color 0.12s ease;
}
li.task.task-add:focus-visible .task-add-label { opacity: 1; color: var(--ink-2); }
@media (hover: hover) {
  li.task.task-add:hover .task-add-label { opacity: 1; color: var(--ink-2); }
}
/* Detail-panel variant — mirrors the feed add-row inside the meeting pane's task list. */
.detail-task.detail-task-add {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  /* Match the task rows' horizontal inset (padding: 12px 14px) so the + lines up
     with the checkbox column above it. */
  padding: 8px 14px; color: var(--ink-4); transition: color 0.12s ease;
}
.detail-task.detail-task-add:hover, .detail-task.detail-task-add:focus-visible { color: var(--ink-2); outline: none; }
.detail-task.detail-task-add .task-add-plus { margin: 0; opacity: 0.5; }
.detail-task.detail-task-add:hover .task-add-plus, .detail-task.detail-task-add:focus-visible .task-add-plus { opacity: 1; color: var(--accent); }
.detail-task.detail-task-add .task-add-label { font-size: 13px; opacity: 0.7; }
.detail-task.detail-task-add:hover .task-add-label { opacity: 1; color: var(--ink-2); }
.empty {
  padding: 28px 20px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-card);
  color: var(--ink-3); font-size: 13px; background: var(--surface);
}
.empty strong { color: var(--ink-2); font-weight: 500; display: block; margin-bottom: 4px; }
.empty-demo {
  margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line);
}
.error {
  padding: 14px 16px; border: 1px solid var(--error-border); background: var(--error-bg);
  color: var(--error-ink); border-radius: var(--radius-card); font-size: 13px;
}
.error code { background: var(--error-code-bg); padding: 2px 5px; border-radius: var(--radius-control); font-size: 11.5px; word-break: break-all; }

/* ============================================================================
 * SIDEBARS — LOGS
 * ========================================================================= */
.logs-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease; z-index: 99;
}
.logs-backdrop.open { opacity: 1; pointer-events: auto; }
.logs-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 95vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(0,0,0,0.10); transform: translateX(100%);
  transition: transform 0.22s ease; z-index: 100; display: flex; flex-direction: column;
}
.logs-sidebar.open { transform: translateX(0); }
.logs-head {
  display: flex; align-items: center; gap: 8px; padding: 13px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.logs-head h2 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; letter-spacing: -0.01em; color: var(--ink); }
.logs-list { flex: 1; overflow-y: auto; padding: 6px; }
.log-entry {
  display: grid; grid-template-columns: 96px 1fr; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--line-soft);
}
.log-entry:last-child { border-bottom: 0; }
.log-time { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; align-self: start; padding-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.log-body { min-width: 0; }
.log-msg { color: var(--ink); line-height: 1.4; font-size: 12.5px; word-break: break-word; }
.log-msg .lvl { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.log-msg .lvl.info  { background: var(--ink-4); }
.log-msg .lvl.ok    { background: var(--green); }
.log-msg .lvl.warn  { background: var(--amber); }
.log-msg .lvl.error { background: var(--red); }
.log-meta { color: var(--ink-3); font-size: 11px; margin-top: 2px; line-height: 1.35; word-break: break-word; }
.logs-empty { padding: 30px 16px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.log-resync-btn {
  display: inline-flex; align-items: center; gap: 3px; font: inherit; font-size: 11px; color: var(--ink-3);
  background: transparent; border: 1px solid var(--line);
  padding: 2px 7px; border-radius: var(--radius-pill); cursor: pointer; margin-top: 5px;
  transition: all 0.1s ease;
}
.log-resync-btn:hover:not(:disabled) { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
.log-resync-btn:disabled { opacity: 0.45; cursor: progress; }
.log-resync-btn svg { width: 10px; height: 10px; }

/* ============================================================================
 * DEBUG / LIVE ACTIVITY PANEL
 * ========================================================================= */
.debug-panel {
  /* Sits above the desktop "Preview in Granola" launcher (.preview-fab, z-index 132),
     which shares the bottom-right corner — the live activity panel wins. */
  position: fixed; bottom: 16px; right: 16px; z-index: 133;
  width: min(380px, calc(100vw - 32px)); max-height: min(480px, 55vh);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  display: flex; flex-direction: column;
  animation: menu-in 0.14s ease;
}
.debug-panel[hidden] { display: none; }
.debug-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 8px 13px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; flex-shrink: 0;
}
.debug-title { flex: 1; font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.03em; text-transform: uppercase; }
.debug-act {
  background: transparent; border: 1px solid var(--line); color: var(--ink-3);
  font: inherit; font-size: 10.5px; padding: 2px 7px; border-radius: var(--radius-pill);
  cursor: pointer; display: flex; align-items: center; gap: 3px;
  transition: all 0.1s ease;
}
.debug-act:hover { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
.debug-act.debug-close { padding: 2px 5px; }
.debug-act.debug-close svg { width: 11px; height: 11px; }
.debug-list {
  flex: 1; overflow-y: auto; padding: 4px 0; font-family: var(--font-mono); font-size: 10.5px;
  scroll-behavior: smooth;
}
.debug-entry {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 8px;
  padding: 4px 13px; border-bottom: 1px solid var(--line-soft); line-height: 1.35;
}
.debug-entry:last-child { border-bottom: 0; }
.debug-entry .de-time { color: var(--ink-4); white-space: nowrap; align-self: start; padding-top: 1px; }
.debug-entry .de-msg { color: var(--ink-2); word-break: break-word; }
.debug-entry.de-ok    .de-msg { color: var(--green); }
.debug-entry.de-warn  .de-msg { color: var(--amber); }
.debug-entry.de-error .de-msg { color: var(--red); }
.debug-empty { padding: 24px 13px; color: var(--ink-4); font-size: 11px; text-align: center; }
.header-btn.active { background: var(--hover-strong); }

/* ============================================================================
 * FEEDBACK — floating launcher + panel (bug reports / ideas / requests)
 * ========================================================================= */
.feedback-btn {
  position: fixed; bottom: 16px; left: 16px; z-index: 132;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); border: 1px solid transparent; color: var(--accent-ink);
  padding: 8px 13px; border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 12.5px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: opacity 0.12s ease;
}
.feedback-btn:hover { opacity: 0.85; }
.feedback-btn[hidden] { display: none; }
/* Don't let the floating launchers (z-index 132) sit on top of an open
   overlay's content — settings, meeting detail, the Granola preview all lock
   page scroll while open. */
body.scroll-locked .feedback-btn,
body.scroll-locked .preview-fab { display: none; }
.feedback-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
/* Owner-only red "new" count, pinned to the button corner. */
.feedback-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px;
  padding: 0 5px; box-sizing: border-box; border-radius: var(--radius-pill);
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px;
  text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.feedback-badge[hidden] { display: none; }
/* Owner-only Admin Tools launcher: same pill as Feedback, stacked just above it
   (bottom-left). Shares .feedback-btn styling; only its offset differs. */
.admin-fab { bottom: 60px; }
/* The header Inbox button hosts the same badge — needs its own positioning context. */
#inbox-btn { position: relative; }
#inbox-btn[hidden] { display: none; }

/* Desktop-only floating "Preview in Granola" launcher, bottom-right. */
.preview-fab {
  position: fixed; bottom: 16px; right: 16px; z-index: 132;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); border: 1px solid transparent; color: var(--accent-ink);
  padding: 8px 14px; border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: opacity 0.12s ease;
}
.preview-fab svg { width: 15px; height: 15px; color: var(--accent-ink); }
.preview-fab:hover { opacity: 0.85; }
.preview-fab[hidden] { display: none; }
@media (max-width: 640px) { .preview-fab { display: none; } }

/* First-login coach marks for the floating launchers. A light scrim dims/blurs
   the feed while the launchers themselves are lifted above it (body.fab-coaching
   → z-index below) so they stay crisp and spotlit; a small callout sits above
   each — Feedback (bottom-left) and "Preview in Granola" (bottom-right, desktop
   only) — with a downward tail tying it to its button. Shown once per user per
   browser (localStorage, never in kv); a click anywhere dismisses and stores the
   flag (no explicit control — clicking a launcher fires it and dismisses too). */
.fab-coach { position: fixed; inset: 0; z-index: 150; cursor: pointer; }
.fab-coach-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 52%, transparent);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  animation: menu-in 0.16s ease;
}
/* Lift the launchers above the scrim so they read as the highlighted subjects,
   not part of the dimmed/blurred background. */
body.fab-coaching .feedback-btn,
body.fab-coaching .admin-fab,
body.fab-coaching .preview-fab { z-index: 160; }
.fab-coach-bubble {
  position: fixed; bottom: 66px; width: min(232px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: 0 10px 30px rgba(0,0,0,0.16);
  padding: 12px 14px;
}
.fab-coach-bubble.left  { left: 16px; }
.fab-coach-bubble.right { right: 16px; text-align: right; align-items: flex-end; }
.fab-coach-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink);
}
.fab-coach-ico svg { width: 15px; height: 15px; }
.fab-coach-copy { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.fab-coach-copy strong { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }
/* Downward tail tying each bubble to its launcher (a rotated square whose two
   outer edges keep the hairline; its top merges into the bubble body). */
.fab-coach-arrow {
  position: absolute; bottom: -8px; width: 15px; height: 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-top: 0; border-left: 0; transform: rotate(45deg);
}
.fab-coach-bubble.left  .fab-coach-arrow { left: 24px; }
.fab-coach-bubble.right .fab-coach-arrow { right: 24px; }
@media (max-width: 640px) { .fab-coach-bubble { bottom: 74px; } }
@media (prefers-reduced-motion: reduce) { .fab-coach-scrim { animation: none; } }
/* Granola theme — the callout title uses the Fraunces display face like the
   rest of the DS chrome. Scoped so Solarized / Carbon / Material keep theirs. */
[data-theme="default"] .fab-coach-copy strong {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.1px; font-size: 14px;
}

.feedback-panel {
  position: fixed; bottom: 16px; left: 16px; z-index: 132;
  width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: flex; flex-direction: column;
  animation: menu-in 0.14s ease;
}
.feedback-panel[hidden] { display: none; }
.feedback-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px 8px 13px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; flex-shrink: 0;
}
.feedback-title { flex: 1; font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: 0.03em; text-transform: uppercase; }
.feedback-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 10px; }
.feedback-seg { display: flex; width: 100%; align-self: stretch; }
.feedback-seg button { flex: 1; justify-content: center; }
.feedback-text {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px;
  font: inherit; font-size: 13px; line-height: 1.45; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 9px 11px; outline: none;
}
.feedback-text:focus { border-color: var(--ink-4); }
.feedback-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feedback-attach .header-btn { font-size: 12px; }
.feedback-attach-hint { font-size: 11px; color: var(--ink-4); }
.feedback-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-thumbs:empty { display: none; }
.feedback-thumb { position: relative; width: 56px; height: 56px; border-radius: var(--radius-control); overflow: hidden; border: 1px solid var(--line); }
.feedback-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feedback-thumb-rm {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px;
  padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.feedback-thumb-rm:hover { background: rgba(0,0,0,0.8); }
.feedback-panel.drag-over { outline: 2px dashed var(--ink-4); outline-offset: -4px; }

@media (max-width: 600px) {
  /* Compact to a round, icon-only launcher bottom-left. */
  .feedback-btn { padding: 0; width: 44px; height: 44px; border-radius: 50%; justify-content: center; }
  .feedback-btn-label { display: none; }
  .feedback-btn svg { width: 18px; height: 18px; }
  /* Clear the taller (44px) Feedback circle it stacks above. */
  .admin-fab { bottom: 68px; }
  .feedback-panel { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

/* ============================================================================
 * SIDEBARS — SETTINGS
 * ========================================================================= */
.settings-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease; z-index: 99;
}
.settings-backdrop.open { opacity: 1; pointer-events: auto; }
.settings-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 96vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(0,0,0,0.10); transform: translateX(100%);
  transition: transform 0.22s ease; z-index: 100; display: flex; flex-direction: column;
}
.settings-sidebar.open { transform: translateX(0); }
.settings-head {
  display: flex; align-items: center; gap: 8px; padding: 13px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); flex-shrink: 0;
}
.settings-head h2 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; letter-spacing: -0.01em; color: var(--ink); }
.settings-body { flex: 1; overflow-y: auto; padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 24px; }
.settings-section { display: flex; flex-direction: column; gap: 8px; }
.settings-label { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.09em; text-transform: uppercase; }
.settings-hint { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 4px; line-height: 1.5; }
.settings-help-link { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.settings-help-link:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
.settings-status { display: block; margin-top: 3px; }
.settings-checkbox { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.settings-checkbox input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.theme-seg {
  display: flex; padding: 4px; gap: 2px;
  background: var(--surface-2); border-radius: var(--radius-pill);
  border: 0; align-self: stretch; max-width: 360px;
}
#model-seg { max-width: 300px; }
.theme-seg button {
  flex: 1; justify-content: center; white-space: nowrap;
  background: transparent; border: 0; padding: 9px 10px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; border-radius: var(--radius-pill); transition: all 0.12s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.theme-seg button svg { width: 14px; height: 14px; opacity: 0.8; }
.theme-seg button:hover:not(.active) { color: var(--ink); }
.theme-seg button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 1px 1px rgba(0,0,0,0.04); }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.theme-card {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: var(--radius-card); cursor: pointer; font: inherit; color: var(--ink);
  text-align: left; transition: all var(--motion-fast);
}
.theme-card:hover:not(.active) { border-color: var(--ink-4); background: var(--surface); }
.theme-card.active { border-color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.theme-swatches { display: flex; gap: 0; height: 54px; border-radius: var(--radius-control); overflow: hidden; border: 1px solid var(--line-soft); }
.theme-swatch { flex: 1; display: block; }
.theme-card-label { font-size: 14px; font-weight: 500; text-align: center; color: var(--ink); }
/* Desktop: shrink the theme cards so the General tab fits without scrolling
   (scrolling is only needed once "Advanced" is expanded). */
@media (min-width: 641px) {
  .theme-card { padding: 10px; gap: 7px; }
  .theme-swatches { height: 36px; }
  .theme-card-label { font-size: 13px; }
}
.prompt-textarea {
  width: 100%; min-height: 168px; font: 12.5px/1.55 var(--font-mono);
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 10px 12px; resize: vertical;
  transition: border-color 0.12s ease, box-shadow 0.12s ease; outline: none;
}
.prompt-textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 2px var(--line); }
.settings-divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }
/* AI tab: sub-labels, char counter, language combobox, shorter guidance box */
.settings-sub { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin: 18px 0 9px; }
.settings-count { font-size: 12px; color: var(--ink-4); align-self: center; font-variant-numeric: tabular-nums; }
/* Output language: a custom design-system dropdown (trigger button + popover
   list) replacing the native <select>. Themed via the shared tokens so it adapts
   to every theme; the chevron hints at the menu. */
.lang-combo-wrap { position: relative; max-width: 300px; }
.lang-combo-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; cursor: pointer; font: 14px/1.2 var(--font-body, inherit); color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 11px 14px; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.lang-combo-btn:hover { border-color: var(--focus); }
.lang-combo-btn:focus-visible,
.lang-combo-wrap.open .lang-combo-btn { border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-soft, transparent); }
.lang-combo-chev { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.lang-combo-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control);
  box-shadow: 0 8px 24px rgba(14, 15, 12, 0.12); padding: 5px; max-height: 280px; overflow: auto;
}
.lang-opt {
  display: block; width: 100%; text-align: left; cursor: pointer; border: none;
  background: transparent; border-radius: 7px; padding: 9px 11px;
  font: 14px/1.2 var(--font-body, inherit); color: var(--ink-2);
  transition: background 0.1s ease, color 0.1s ease;
}
.lang-opt:hover { background: var(--surface-2); }
.lang-opt.active { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.guidance-textarea { min-height: 64px; font-family: var(--font-body, inherit); }
.settings-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.settings-actions .header-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.settings-actions .header-btn.primary:hover { opacity: 0.85; }
/* Token input in settings */
.token-input {
  font: 13px/1.2 var(--font-mono); color: var(--ink);
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-md); padding: 11px 14px; outline: none;
  width: 100%; transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.token-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--accent-soft, transparent); }
/* Mask secret values (Granola key, beta invite code) without using
   type="password" — a real password field pairs with the adjacent identity/name
   input and makes iOS treat Settings as a login form, popping a "Fill Password"
   prompt on the feed. -webkit-text-security keeps the dots; data-1p/lp-ignore +
   the non-password type stop password managers from offering to fill/save. */
.secret-input { -webkit-text-security: disc; text-security: disc; }

/* Danger zone — delete account */
.danger-zone { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 4px; }
.delete-account-box {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border: 1px solid rgba(220, 38, 38, 0.3); border-radius: var(--radius-card);
  background: rgba(220, 38, 38, 0.04);
}
.delete-account-warn { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.delete-account-warn strong { color: var(--red); font-family: var(--font-mono); }
.delete-account-box .header-btn.danger:not(:disabled) {
  color: var(--surface); background: var(--red); border-color: var(--red);
}
.delete-account-box .header-btn.danger:not(:disabled):hover { opacity: 0.88; }
.delete-account-box .header-btn.danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================================
 * SETTINGS — PROJECTS TABLE
 * ========================================================================= */
.proj-table { display: flex; flex-direction: column; gap: 6px; }
.proj-empty {
  font-size: 12px; color: var(--ink-3); padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: var(--radius-control); background: var(--surface-2);
}
.proj-row { display: flex; align-items: center; gap: 6px; }
.proj-row.dragging { opacity: 0.45; }
.proj-row.drag-over { box-shadow: inset 0 2px 0 var(--ink-3); }
.proj-drag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 36px; flex-shrink: 0;
  color: var(--ink-3); cursor: grab; border-radius: var(--radius-control);
  transition: background 0.12s ease, color 0.12s ease;
}
.proj-drag:hover { background: var(--hover-surface); color: var(--ink); }
.proj-drag:active { cursor: grabbing; }
.proj-drag svg { width: 15px; height: 15px; }
.proj-name, .proj-id {
  font: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: 8px 9px; outline: none;
  min-width: 0; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.proj-name { flex: 1.2; }
.proj-id { flex: 1; font-family: var(--font-mono); font-size: 11px; }
.proj-name:focus, .proj-id:focus { border-color: var(--ink-3); box-shadow: 0 0 0 2px var(--line); }
.proj-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-control); color: var(--ink-3); cursor: pointer;
  transition: all 0.12s ease;
}
.proj-del:hover { color: var(--red); border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.06); }
.proj-del svg { width: 14px; height: 14px; }

/* ============================================================================
 * PER-MEETING PROJECT BUTTON + POPOVER
 * ========================================================================= */
.proj-btn {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; max-width: 150px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-2); font: inherit; font-size: 11.5px; font-weight: 500;
  padding: var(--pad-pill-y) var(--pad-pill-x); border-radius: var(--radius-pill);
  cursor: pointer; transition: all 0.12s ease; min-height: 28px;
}
.proj-btn:hover { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
.proj-btn.has-proj { background: var(--proj-tag-bg); border-color: var(--proj-tag-border); color: var(--proj-tag-text); }
.proj-btn.has-proj:hover { background: var(--proj-tag-bg); }
.proj-btn > svg.proj-ico { width: 11px; height: 11px; opacity: 0.8; flex-shrink: 0; }
.proj-btn .proj-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-btn .chev { width: 9px; height: 9px; opacity: 0.6; flex-shrink: 0; margin-left: -1px; }
.proj-popover {
  position: fixed; z-index: 120;
  min-width: 180px; max-width: 280px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-md);
  padding: 4px; display: flex; flex-direction: column; gap: 1px; animation: menu-in 0.12s ease;
}
.proj-popover[hidden] { display: none; }
.proj-popover button {
  text-align: left; background: transparent; border: 0;
  padding: var(--pad-seg-y) var(--pad-seg-x); font: inherit; font-size: 12.5px;
  color: var(--ink); cursor: pointer; border-radius: var(--radius-control);
  display: flex; align-items: center; gap: 10px; min-height: 36px;
}
.proj-popover button:hover { background: var(--hover-surface); }
.proj-popover button.active { color: var(--owner-text); font-weight: 600; }
.proj-popover button .plabel { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-popover button .phint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.proj-popover button .pcheck { width: 13px; height: 13px; flex-shrink: 0; opacity: 0; }
.proj-popover button.active .pcheck { opacity: 1; }
.proj-popover .sep { height: 1px; background: var(--line-soft); margin: 3px 2px; }
/* Attendee list popover (read-only): avatar + name (+ organizer/email sub-label). */
.people-popover { min-width: 200px; gap: 0; padding: 6px; }
.people-popover .people-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-sm); }
.people-popover .detail-avatar { width: 22px; height: 22px; margin: 0; border: 0; font-size: 10px; }
.people-popover .people-name { font-size: 13px; color: var(--ink); display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.people-popover .people-name .phint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.proj-popover .pop-empty { padding: 9px 11px; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

/* Owner / assignee dropdown — a proj-popover mounted inside its trigger's scroll
   container as position:absolute. z-index sits *above* the sticky page header (z 50)
   so opening it near the top of the feed isn't clipped by the header; scrolling the
   feed (or tapping outside) dismisses it instead (see onOwnerPopoverScroll). Only the
   results list scrolls (the search box is a static flex header) — a sticky header
   inside an overflow-scroll box glitches transparent on WebKit during hard scroll. */
.owner-popover { position: absolute; z-index: 120; overflow: hidden; min-width: 244px; max-width: 320px; padding-top: 0; }
.owner-search { padding: 6px 2px; background: var(--surface); }
.owner-input {
  width: 100%; box-sizing: border-box; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius-control);
  padding: 7px 10px; font: inherit; font-size: 13px; color: var(--ink); outline: none;
}
.owner-input:focus { border-color: var(--ink-3); background: var(--surface); }
.owner-input::placeholder { color: var(--ink-3); }
.owner-results { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; }
.owner-popover .pop-section {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); padding: 8px 8px 3px;
}
.owner-popover button.owner-me .plabel { color: var(--accent); font-weight: 600; }
.owner-popover button.owner-custom .plabel { font-style: italic; }

/* Due-date chip — calendar icon + short date next to the owner pill; icon-only
 * (quiet, ink-4) when the task has no date. Overdue open tasks tint red via the
 * error tokens so every theme keeps its own palette. */
.pill.due { gap: 5px; }
.pill.due svg { width: 12px; height: 12px; flex-shrink: 0; }
button.pill.due { font: inherit; cursor: pointer; }
@media (hover: hover) {
  button.pill.due:hover { box-shadow: 0 0 0 2px var(--line); }
  button.pill.due.no-due:hover { color: var(--ink-2); }
}
button.pill.due:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ink-3); }
/* No date set: an icon-only chip with the exact same geometry as a dated chip.
   The icon (12px) is shorter than a text line, so without this the chip would be
   a few px shorter than the owner / filled-date pills next to it — force the
   content box to a full text line (1.25em) plus the shared pill padding+border,
   so all pills in the row are pixel-identical height (theme-robust via the
   tokens). The modifier is 'no-due', NOT 'empty' — the generic .empty
   empty-state card style would otherwise match a class="… empty" chip. */
.pill.due.no-due { color: var(--ink-3); gap: 0; }
/* Invisible non-breaking-space strut: gives the icon-only chip a text line box
   identical to a labelled pill, so its height matches the owner/filled-date
   pills exactly (no magic numbers, font-/theme-robust). width:0 + overflow
   hides the glyph. */
.pill.due.no-due::after { content: "\00a0"; width: 0; overflow: hidden; }
/* Overdue OR due-today open tasks tint red (Today is a soft deadline; it is
   still not counted overdue by the filters). See feedback #21. */
.pill.due.overdue, .pill.due.today { background: var(--error-bg); border-color: var(--error-border); color: var(--error-ink); }

/* Due-date calendar popover — a small month grid on the chip. Composes
 * .proj-popover (surface, hairline, radius, shadow) so it follows the active
 * theme + mode; position:absolute because it's appended to the nearest
 * scrollable host (same as .owner-popover). */
.due-popover { position: absolute; z-index: 120; width: 236px; min-width: 0; padding: 8px; gap: 0; overflow: hidden; }
.due-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.due-cal-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.due-popover button.due-nav { min-height: 0; width: 26px; height: 26px; padding: 0; justify-content: center; color: var(--ink-3); gap: 0; }
.due-popover button.due-nav:hover { color: var(--ink); }
.due-popover .due-nav svg { width: 13px; height: 13px; }
.due-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.due-wday { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-4); text-align: center; padding: 3px 0 4px; }
.due-popover button.due-cell { min-height: 0; height: 28px; padding: 0; justify-content: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); gap: 0; }
.due-cell.blank { height: 28px; }
.due-popover button.due-cell:hover { background: var(--hover-strong); color: var(--ink); }
.due-popover button.due-cell.today { box-shadow: inset 0 0 0 1px var(--ink-4); }
.due-popover button.due-cell.selected { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.due-popover button.due-cell.selected:hover { background: var(--accent-hover); color: var(--accent-ink); }
.due-cal-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 5px; }
.due-popover button.due-foot-btn { min-height: 0; padding: 5px 8px; font-size: 12px; font-weight: 500; color: var(--accent); gap: 0; }
.due-popover button.due-foot-btn.clear { color: var(--ink-3); }
.due-popover button.due-foot-btn:disabled { opacity: 0.4; cursor: default; }
.due-popover button.due-foot-btn.clear:hover:not(:disabled) { color: var(--red); background: var(--error-bg); }

/* ============================================================================
 * MOBILE RESPONSIVE
 * ========================================================================= */
@media (max-width: 600px) {
  .wrap { padding: 16px 12px 80px; }

  /* Thin, single-line header: title + a compact icon action bar */
  header.page { margin: -16px -12px 0; padding: 12px 12px 8px; }
  .status-bar { margin: 6px 0 12px; }
  .title-row { align-items: center; gap: 8px; margin-bottom: 10px; min-height: 0; }
  header.page h1 {
    font-size: 17px; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .subtitle { display: none; }

  /* Buttons collapse to icons so all five fit on one row (no clipping/scroll) */
  .header-actions { gap: 6px; flex-shrink: 0; }
  .header-btn { padding: 8px; }
  .header-actions .header-btn { height: 36px; }
  .header-btn svg { width: 16px; height: 16px; }
  .header-btn .btn-label,
  .header-btn .chev { display: none; }

  /* Toolbar: the search bar shares its row with a funnel toggle; the three filter
     chips are collapsed by default and only drop onto a second full-width row when
     the toggle is pressed (.toolbar.filters-open) — saves vertical space while scrolling. */
  .toolbar { gap: 8px; padding: 8px 10px; }
  .search-wrap { flex: 1 1 auto; min-width: 0; }
  .filter-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 36px; height: 36px; padding: 0;
    background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-2);
    border-radius: var(--radius-control); cursor: pointer;
    transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
  }
  .filter-toggle svg { width: 15px; height: 15px; opacity: 0.85; }
  .filter-toggle:active { background: var(--hover-surface); }
  .toolbar.filters-open .filter-toggle { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  /* A small accent dot marks active (non-default) filters so they stay discoverable
     while collapsed. app.js toggles .has-active when any filter is non-default. */
  .filter-toggle.has-active .filter-toggle-dot {
    display: block; position: absolute; top: 4px; right: 4px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); border: 1.5px solid var(--surface);
  }
  .toolbar.filters-open .filter-toggle.has-active .filter-toggle-dot { background: var(--accent-ink); border-color: var(--accent); }
  .filter-chips { display: none; flex: 1 1 100%; justify-content: flex-start; }
  .toolbar.filters-open .filter-chips { display: inline-flex; }

  /* Full-width sidebars on phone */
  .logs-sidebar, .settings-sidebar { width: 100vw; border-left: 0; }


  /* Meeting cards: title takes the full first row (truncated to one line); the
   * second row lists date, then project (if present), then tag (if present),
   * left-aligned. A persistent open-arrow pins to the right edge, vertically
   * centred across both rows, to signal the header is tappable. The reprocess
   * icon is dropped — re-extraction lives inside the meeting pane. */
  .meeting-head { gap: 6px 8px; row-gap: 8px; flex-wrap: wrap; position: relative; padding-right: 30px; }
  /* Mobile headers are already packed (title + date + project + tag wrap onto two
     rows) — keep the participant row desktop-only for now (idea #18). */
  .meeting-people { display: none; }
  .meeting-title {
    flex: 1 1 100%; font-size: 13.5px; order: 0; padding-right: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35;
  }
  .meeting-head .icon-btn { display: none; }
  .meeting-chev {
    display: block; position: absolute; right: var(--pad-card-x); top: 50%;
    transform: translateY(-50%); margin: 0; color: var(--ink-3);
  }
  /* The chevron is absolutely positioned here, so it must keep translateY(-50%)
     to stay vertically centred across a 1- or 2-line header. The global hover
     rule below uses translateX(1px) and would clobber that (equal specificity,
     later in source) — so this override is made more specific (adds .meeting-head)
     and folds both transforms together to win. */
  .meeting.summary-view:hover .meeting-head .meeting-chev { transform: translateY(-50%) translateX(1px); }
  .meeting-head .meeting-meta { order: 1; margin-left: 0; margin-right: 0; }
  .meeting-head .proj-btn { order: 2; }
  .meeting-head .tag-internal { order: 3; }

  /* Task rows: drop the dedicated action column on narrow screens (actions are
     swipe-revealed; see the touch block below). */
  li.task { grid-template-columns: 36px 1fr; }
}

/* Touch devices: the action column becomes a swipe-in drawer pinned to the right
   edge, off-screen at rest. wireTaskSwipe() finger-tracks the row content to the
   left to reveal the (tappable) bin + connector-add; a long/fast swipe deletes.
   A native-feeling spring snaps the row open/closed on release. */
@media (hover: none) {
  li.task { position: relative; overflow: hidden; touch-action: pan-y; }
  /* The action buttons sit on a layer *beneath* the task (z 1), uncovered as the
     task content slides left over them. An inset shadow on the drawer's left (the
     seam) reads as the task sitting above and casting onto the recessed buttons —
     contained inside the drawer, so there's no halo around the row. */
  li.task .task-actions {
    position: absolute; top: 0; right: 0; bottom: 0; height: auto; z-index: 1;
    opacity: 1; gap: 0; padding: 0;
    background: var(--surface-2);
    box-shadow: inset 11px 0 12px -8px rgba(14, 15, 12, 0.22);
    transform: translateX(100%);  /* hidden until swiped (JS overrides with px) */
  }
  li.task.swipe-open { background: var(--surface-2); }
  li.task .task-act { width: 52px; height: 100%; border-radius: 0; }
  li.task .task-act.add { color: var(--accent); }
  li.task .task-act.trash { color: var(--red); }
  li.task .task-act.restore { color: var(--accent); }
  /* The drawer extends a screen-width panel to its right so the revealed area always
     reaches the edge (no gap / rounded-corner peek) and goes "all light red" on arm. */
  li.task .task-actions::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 100%;
    width: 100vw; background: var(--surface-2);
  }
  /* No transform-lag on the checkbox while the row tracks the finger. */
  li.task.swiping .task-body, li.task.swiping .checkbox,
  li.task.swipe-open .task-body, li.task.swipe-open .checkbox { will-change: transform; transition: none; }
  /* Swipe takes priority over editing: the text isn't selectable until the field is
     actually focused (a clean tap), so a drag never starts a text selection. And the
     edit highlight (hover/focus background + ring) is dropped on touch — it read as a
     stray bubble around the wrapped text. */
  .task-title[contenteditable], .task-summary[contenteditable] {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  .task-title[contenteditable]:focus, .task-summary[contenteditable]:focus {
    -webkit-user-select: text; user-select: text;
  }
  .task-title[contenteditable]:hover, .task-summary[contenteditable]:hover,
  .task-title[contenteditable]:focus, .task-summary[contenteditable]:focus {
    background: transparent; box-shadow: none;
  }
  /* Armed for delete (swiped past the threshold): only the revealed drawer on the
     right goes light red — the task content itself keeps its normal surface. The
     drawer geometry stays fixed (so the task's right edge + seam shadow don't
     move) — the + fades out in place while the bin slides left into its slot. */
  li.task .task-act { transition: transform 0.16s ease, opacity 0.16s ease; }
  li.task.will-delete .task-actions,
  li.task.will-delete .task-actions::after { background: color-mix(in srgb, var(--red) 20%, var(--surface)); }
  li.task.will-delete .task-act.add { opacity: 0; pointer-events: none; }
  li.task.will-delete .task-act.add + .task-act.trash { transform: translateX(-52px); }
  /* Armed for put-back on a deleted row: same geometry, but neutral accent tint
     (the gesture restores, it doesn't destroy). */
  li.task.will-restore .task-actions,
  li.task.will-restore .task-actions::after { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
  li.task.will-restore .task-act.add { opacity: 0; pointer-events: none; }
  li.task.will-restore .task-act.add + .task-act.restore { transform: translateX(-52px); }
}

/* ============================================================================
 * V2 ADDITIONS — auth screen (beta gate + login), account & sync settings,
 * build label
 * ========================================================================= */
.auth-box form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.auth-link-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.auth-msg { font-size: 12px; min-height: 1.2em; color: var(--ink-3); }
.auth-msg.err { color: var(--red); }
.auth-msg.ok { color: var(--green); }
.auth-alt { text-align: center; font-size: 12px !important; }
.auth-alt a { color: var(--ink-2); }

/* ════════════════════════════════════════════════════════════════════════
   Onboarding — beta wall (.gbw, PRE-screen) + first-run welcome (.gtw,
   POST-screen). Token-driven (var(--…) with oat fallbacks) so the cards
   adapt to whichever theme is active. The .gbw card replaces the markup
   inside #auth-signin (the .auth-gate provides the fixed overlay); the .gtw
   card mounts in its own fixed overlay shown once on an empty account.
   Source mockup: granola "onboarding pair" snippet.
   ════════════════════════════════════════════════════════════════════════ */
.gbw, .gtw {
  --gtw-bg:var(--bg,#f7f7f2); --gtw-surface:var(--surface,#fff); --gtw-surface2:var(--surface-2,#f1f1ea);
  --gtw-ink:var(--ink,#0e0f0c); --gtw-ink2:var(--ink-2,#454745); --gtw-ink3:var(--ink-3,#72726e); --gtw-ink4:var(--ink-4,#b6b4aa);
  --gtw-line:var(--line,#e3e3e3); --gtw-line-soft:var(--line-soft,#eaebe5);
  --gtw-accent:var(--accent,#5b6f00); --gtw-accent-hover:var(--accent-hover,#788c15); --gtw-accent-ink:var(--accent-ink,#fff);
  --gtw-accent-soft:var(--accent-soft,#e5eacd); --gtw-hl:var(--highlight,#febe29);
  --gtw-lime:var(--focus,#b2c248); --gtw-owner:var(--owner-text,#4a5a00);
  --gtw-display:var(--font-display,"Fraunces",Georgia,serif); --gtw-sans:var(--font-sans,"Geist",system-ui,sans-serif);
  font-family:var(--gtw-sans); color:var(--gtw-ink); -webkit-font-smoothing:antialiased;
}
.gbw *, .gtw * { box-sizing:border-box; }

.gtw-overlay { position:fixed; inset:0; z-index:210; display:flex; align-items:center; justify-content:center;
  padding:clamp(16px,4vw,48px); background:rgba(14,15,12,.5); overflow:auto; }
.gtw-overlay[hidden] { display:none; }

/* ════ PRE-SCREEN — beta wall (mounted inside #auth-signin / .auth-gate) ════ */
.gbw { width:100%; max-width:860px; } /* center the card within the .auth-gate flex */
.gbw-card { container-type:inline-size; position:relative; width:100%; max-width:860px;
  background:var(--gtw-surface); border:1px solid var(--gtw-line); border-radius:22px; overflow:hidden;
  box-shadow:0 26px 64px rgba(14,15,12,.26),0 2px 6px rgba(14,15,12,.08);
  animation:gtwCardIn .55s cubic-bezier(.22,.7,.3,1) both; }
.gbw-card::before { content:""; position:absolute; left:0; right:0; top:0; height:4px; z-index:1;
  background:linear-gradient(90deg,var(--gtw-accent),var(--gtw-lime) 60%,var(--gtw-hl)); opacity:.9; }
.gbw-grid { display:grid; grid-template-columns:1fr; }
.gbw-aside { background:var(--gtw-surface2); border-bottom:1px solid var(--gtw-line);
  padding:clamp(28px,5cqi,44px); display:flex; flex-direction:column; gap:clamp(16px,2.8cqi,22px); }
.gbw-form { padding:clamp(28px,5cqi,44px); display:flex; flex-direction:column; justify-content:center;
  gap:12px; animation:gtwRise .55s cubic-bezier(.16,1,.3,1) .5s both; }
.gbw-form #invite-form { display:flex; flex-direction:column; gap:12px; margin:0; }

.gbw-brand { animation:gtwUp .5s ease .28s both; }
.gbw-wordmark { position:relative; display:inline-block; font-family:var(--gtw-display); font-weight:600;
  font-size:clamp(26px,4.8cqi,33px); letter-spacing:-.02em; color:var(--gtw-ink); line-height:1; z-index:0; }
.gbw-wordmark::after { content:""; position:absolute; left:-2px; right:-2px; bottom:1px; height:10px;
  background:var(--gtw-hl); border-radius:3px; z-index:-1; transform:scaleX(0); transform-origin:left;
  animation:gbwSwipe .6s cubic-bezier(.22,.7,.3,1) .55s both; }
.gbw-lead { margin:0; font-size:clamp(16px,2.5cqi,19px); line-height:1.5; color:var(--gtw-ink); font-weight:400;
  max-width:34ch; animation:gtwUp .5s ease .4s both; }
.gbw-points { list-style:none; margin:2px 0 0; padding:0; display:flex; flex-direction:column; gap:12px;
  animation:gtwUp .5s ease .55s both; }
.gbw-point { display:flex; gap:11px; align-items:flex-start; font-size:14px; line-height:1.45; color:var(--gtw-ink2); }
.gbw-tick { flex:none; width:20px; height:20px; border-radius:999px; background:var(--gtw-accent-soft);
  display:flex; align-items:center; justify-content:center; margin-top:1px; }
.gbw-tick svg { width:11px; height:11px; stroke:var(--gtw-owner); fill:none; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; }
.gbw-trust { display:flex; align-items:center; gap:7px; margin:auto 0 0; padding-top:4px; font-size:12.5px;
  color:var(--gtw-ink3); animation:gtwUp .5s ease .68s both; }
.gbw-trust svg { flex:none; width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.gbw-form-h { margin:0 0 4px; font-family:var(--gtw-display); font-weight:500; font-size:clamp(19px,3cqi,23px);
  letter-spacing:-.01em; color:var(--gtw-ink); }
.gbw-label { font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--gtw-ink2); margin-top:6px; }
.gbw-input { font:inherit; font-size:15px; letter-spacing:.06em; color:var(--gtw-ink); background:var(--gtw-surface2);
  border:1px solid var(--gtw-line); border-radius:12px; padding:14px 16px; width:100%; outline:none;
  transition:border-color .14s ease,box-shadow .14s ease,background .14s ease; }
.gbw-input::placeholder { color:var(--gtw-ink4); }
.gbw-input:focus { border-color:var(--gtw-lime); box-shadow:0 0 0 3px rgba(178,194,72,.35); background:var(--gtw-surface); }
.gbw-btn { font:inherit; font-size:15px; font-weight:600; color:var(--gtw-accent-ink); background:var(--gtw-accent);
  border:1px solid transparent; border-radius:12px; padding:14px; width:100%; cursor:pointer; transition:background .14s ease; margin-top:4px;
  display:block; text-align:center; text-decoration:none; }
.gbw-btn:hover { background:var(--gtw-accent-hover); }
.gbw-link-btn { box-sizing:border-box; }
.gbw-alt { text-align:center; margin:8px 0 0; font-size:13.5px; color:var(--gtw-ink3); }
.gbw-alt a { color:var(--gtw-ink); text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
@container (min-width:560px) {
  .gbw-grid { grid-template-columns:1.02fr .98fr; }
  .gbw-aside { border-bottom:none; border-right:1px solid var(--gtw-line); }
}

/* ════ POST-SCREEN — welcome ════ */
.gtw-card { container-type:inline-size; position:relative; width:100%; max-width:640px;
  background:var(--gtw-surface); border:1px solid var(--gtw-line); border-radius:22px;
  padding:clamp(26px,5cqi,46px); box-shadow:0 26px 64px rgba(14,15,12,.26),0 2px 6px rgba(14,15,12,.08);
  overflow:hidden; animation:gtwCardIn .55s cubic-bezier(.22,.7,.3,1) both; }
.gtw-card::before { content:""; position:absolute; left:0; right:0; top:0; height:4px;
  background:linear-gradient(90deg,var(--gtw-accent),var(--gtw-lime) 60%,var(--gtw-hl)); opacity:.9; }
.gtw-inner { display:flex; flex-direction:column; align-items:center; text-align:center; gap:clamp(22px,3.4cqi,30px); }
.gtw-hero { display:flex; flex-direction:column; align-items:center; gap:clamp(18px,3cqi,26px); }
.gtw-lockup { display:flex; align-items:center; gap:clamp(11px,1.8cqi,15px); animation:gtwUp .55s cubic-bezier(.16,1,.3,1) .25s both; }
.gtw-mark { width:clamp(48px,9cqi,62px); height:clamp(48px,9cqi,62px); flex:none; border-radius:clamp(13px,2.4cqi,17px);
  background:var(--gtw-lime); display:flex; align-items:center; justify-content:center; box-shadow:0 1px 0 rgba(14,15,12,.06) inset; }
.gtw-mark svg { width:74%; height:74%; display:block; }
.gtw-mark .ring, .gtw-mark .tick { stroke:var(--gtw-ink); fill:none; stroke-width:9.5; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:100; stroke-dashoffset:100; }
.gtw-mark .ring { animation:gtwDraw 1s ease .25s both; }
.gtw-mark .tick { animation:gtwDraw .55s ease 1.05s both; }
.gtw-wordmark { font-family:var(--gtw-display); font-weight:500; color:var(--gtw-ink); font-size:clamp(22px,4.9cqi,31px); letter-spacing:-.02em; line-height:1; }
.gtw-title { margin:clamp(3px,1.4cqi,11px) 0; font-family:var(--gtw-display); font-weight:500; font-size:clamp(27px,6.6cqi,42px);
  line-height:1.1; letter-spacing:-.022em; color:var(--gtw-ink); text-wrap:balance; animation:gtwUp .55s cubic-bezier(.16,1,.3,1) .5s both; }
.gtw-tbreak { display:none; }
.gtw-sub { margin:0; font-weight:300; font-size:clamp(15px,2.7cqi,19px); line-height:1.5; color:var(--gtw-ink2); max-width:52ch; animation:gtwUp .55s cubic-bezier(.16,1,.3,1) .72s both; }
.gtw-steps { display:grid; grid-template-columns:1fr; gap:16px; width:100%; animation:gtwRise .6s cubic-bezier(.16,1,.3,1) 1.15s both; }
.gtw-step { display:flex; gap:12px; align-items:flex-start; text-align:left; }
.gtw-step-n { flex:none; width:28px; height:28px; border-radius:999px; background:var(--gtw-accent-soft); color:var(--gtw-owner);
  font-family:var(--gtw-display); font-weight:600; font-size:15px; display:flex; align-items:center; justify-content:center; line-height:1; }
.gtw-step-t { font-size:clamp(13.5px,1.9cqi,15px); font-weight:600; color:var(--gtw-ink); margin:0 0 2px; letter-spacing:-.005em; }
.gtw-step-d { font-size:clamp(12.5px,1.7cqi,13.5px); line-height:1.45; color:var(--gtw-ink3); margin:0; }
.gtw-demo { width:100%; display:flex; flex-direction:column; align-items:stretch; gap:12px; animation:gtwRise .6s cubic-bezier(.16,1,.3,1) 1s both; }
.gtw-note { background:var(--gtw-surface2); border:1px solid var(--gtw-line-soft); border-radius:14px; padding:14px 16px; text-align:left; }
.gtw-note-top { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--gtw-ink3); margin-bottom:7px; }
.gtw-note-dot { width:6px; height:6px; border-radius:999px; background:var(--gtw-lime); }
.gtw-note-body { margin:0; font-size:clamp(13.5px,2cqi,15px); line-height:1.6; color:var(--gtw-ink2); }
.gtw-hl { background:linear-gradient(var(--gtw-hl),var(--gtw-hl)) no-repeat; background-position:0 .82em; background-size:0 .55em; border-radius:2px; padding:0 .06em; color:var(--gtw-ink); font-weight:500; }
.gtw-hl.m1 { animation:gtwMark .5s ease 1.8s both; }
.gtw-hl.m2 { animation:gtwMark .5s ease 2.05s both; }
.gtw-flow { display:flex; justify-content:center; color:var(--gtw-ink4); }
.gtw-flow svg { width:22px; height:22px; }
.gtw-tasks { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.gtw-task { display:flex; align-items:flex-start; gap:11px; background:var(--gtw-surface); border:1px solid var(--gtw-line); border-radius:13px; padding:11px 13px; box-shadow:0 1px 2px rgba(14,15,12,.05); animation:gtwPop .5s cubic-bezier(.22,.7,.3,1) both; animation-delay:var(--d,2s); }
.gtw-cb { flex:none; width:20px; height:20px; border-radius:999px; background:var(--gtw-accent); display:flex; align-items:center; justify-content:center; margin-top:1px; }
.gtw-cb svg { width:11px; height:11px; stroke:var(--gtw-accent-ink); fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.gtw-task-main { min-width:0; }
.gtw-task-t { font-size:clamp(13.5px,2cqi,15px); line-height:1.35; color:var(--gtw-ink); }
.gtw-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; align-items:center; }
.gtw-chip { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:500; color:var(--gtw-owner); background:var(--gtw-accent-soft); border:1px solid rgba(91,111,0,.2); padding:2px 9px 2px 3px; border-radius:999px; }
.gtw-ava { width:16px; height:16px; border-radius:999px; background:var(--gtw-hl); color:var(--gtw-ink); font-family:var(--gtw-display); font-weight:600; font-size:9px; display:flex; align-items:center; justify-content:center; }
.gtw-due { font-size:11px; font-weight:500; color:var(--gtw-ink3); background:var(--gtw-surface2); border:1px solid var(--gtw-line-soft); padding:2px 9px; border-radius:999px; }
.gtw-cta { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; width:100%; animation:gtwRise .6s cubic-bezier(.16,1,.3,1) 1.3s both; }
.gtw-btn { font:inherit; font-size:clamp(14px,2cqi,15px); font-weight:500; cursor:pointer; border-radius:999px; padding:clamp(11px,1.6cqi,13px) clamp(22px,3.2cqi,26px); border:1px solid transparent; transition:background .14s ease,border-color .14s ease,color .14s ease; white-space:nowrap; }
.gtw-btn--primary { background:var(--gtw-accent); color:var(--gtw-accent-ink); }
.gtw-btn--primary:hover { background:var(--gtw-accent-hover); }
.gtw-btn--ghost { background:transparent; color:var(--gtw-ink2); border-color:var(--gtw-line); }
.gtw-btn--ghost:hover { background:var(--gtw-surface2); border-color:var(--gtw-ink4); color:var(--gtw-ink); }
.gtw-foot { font-size:12px; color:var(--gtw-ink3); margin:0; animation:gtwRise .55s cubic-bezier(.16,1,.3,1) 1.45s both; }
/* Inbox-choice variant: a compact card with two stacked-label choice buttons. */
.gtw-card--choice { max-width:600px; }
.gtw-cta--choice { flex-wrap:nowrap; }
.gtw-btn--stack { display:flex; flex-direction:column; align-items:center; gap:4px; flex:1 1 0; min-width:0; white-space:normal; padding:clamp(13px,2cqi,16px) clamp(14px,2.4cqi,20px); font-size:clamp(15px,2.2cqi,17px); }
.gtw-btn--stack .gtw-btn-sub { font-size:clamp(10.5px,1.5cqi,11.5px); font-weight:400; line-height:1.35; opacity:.82; white-space:nowrap; }
@media (max-width: 640px) { .gtw-cta--choice { flex-wrap:wrap; } .gtw-btn--stack { flex:1 1 100%; } .gtw-btn--stack .gtw-btn-sub { white-space:normal; } }
@container (min-width:430px) {
  .gtw-steps { grid-template-columns:repeat(3,1fr); gap:18px; }
  .gtw-step { flex-direction:column; gap:9px; }
  .gtw-tbreak { display:inline; }
}

/* ════ onboarding animations ════ */
@keyframes gtwDraw { to { stroke-dashoffset:0; } }
@keyframes gtwUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes gtwRise { from { opacity:0; transform:translateY(26px); } to { opacity:1; transform:none; } }
@keyframes gtwPop { from { opacity:0; transform:translateY(12px) scale(.985); } to { opacity:1; transform:none; } }
@keyframes gtwMark { from { background-size:0 .55em; } to { background-size:100% .55em; } }
@keyframes gtwCardIn { from { opacity:0; transform:translateY(10px) scale(.99); } to { opacity:1; transform:none; } }
@keyframes gbwSwipe { from { transform:scaleX(0); } to { transform:scaleX(1); } }
@media (prefers-reduced-motion:reduce) {
  .gbw-card, .gbw-aside, .gbw-form, .gbw-brand, .gbw-lead, .gbw-points, .gbw-trust,
  .gtw-card, .gtw-lockup, .gtw-title, .gtw-sub, .gtw-steps, .gtw-demo, .gtw-note, .gtw-flow, .gtw-cta, .gtw-foot, .gtw-task { animation:none !important; }
  .gbw-wordmark::after { transform:none !important; animation:none !important; }
  .gtw-mark .ring, .gtw-mark .tick { stroke-dashoffset:0 !important; animation:none !important; }
  .gtw-hl { background-size:100% .55em !important; animation:none !important; }
}

.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-email { font-size: 13px; font-weight: 500; color: var(--ink); word-break: break-all; }
#granola-key-status.connected { color: var(--green); }
.settings-msg { font-size: 12px; min-height: 1.2em; color: var(--ink-3); }
.settings-msg.err { color: var(--red); }
.settings-msg.ok { color: var(--green); }
.sync-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sync-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}

/* Collapsed "Advanced" block at the bottom of Settings → General */
details.settings-advanced { border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.settings-advanced > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.01em; user-select: none;
}
details.settings-advanced > summary::-webkit-details-marker { display: none; }
details.settings-advanced > summary::before {
  content: ''; width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform var(--motion-fast);
}
details.settings-advanced[open] > summary { color: var(--ink-2); margin-bottom: 12px; }
details.settings-advanced[open] > summary::before { transform: rotate(90deg); }
/* The <details> element doesn't get the pane's flex gap, so restore the normal
   section rhythm between the stacked Advanced sections (Re-sync / Sync limits). */
details.settings-advanced .settings-section + .settings-section { margin-top: 24px; }

/* PWA pull-to-refresh pill: invisible at rest, faded + tracked into the gap
   that opens above the content while dragging (see setupPullToRefresh). */
#ptr {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%;
  transform: translateX(-50%); z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 var(--font-body, inherit); color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill, 9999px); padding: 6px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
#ptr svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.15s ease; }
#ptr.armed svg { transform: rotate(180deg); }
/* Installed PWA only: `contain` blocks scroll chaining / navigation gestures but
   KEEPS the native rubber-band, so a momentum scroll still bounces naturally at
   the top (with `none` it stopped dead). setupPullToRefresh() detects the native
   stretch (negative scrollY) and skips its own translate so the two never stack.
   Plain Safari keeps its own gesture untouched. */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: contain; }
}

/* Build stamp — pinned to the bottom of the Settings sidebar. Wraps onto a
   second line in the narrow mobile rail rather than truncating. */
.smodal-build {
  margin-top: auto; padding: 12px 10px 4px;
  font: 500 10.5px/1.35 var(--font-mono, monospace);
  color: var(--ink-4); white-space: normal; word-break: break-word;
  user-select: none;
}

/* ============================================================================
 * SETTINGS MODAL (v2) — centered dialog over a blurred backdrop, with a
 * Claude-style tab rail: Account / General / Extraction / Connectors.
 * ========================================================================= */
.smodal-backdrop {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.smodal-backdrop.open { opacity: 1; pointer-events: auto; }
.smodal {
  position: fixed; z-index: 131;
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.98);
  width: min(1080px, calc(100vw - 32px));
  height: min(704px, calc(100vh - 48px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.06);
  display: flex; overflow: hidden;
  opacity: 0; pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease;
}
.smodal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.smodal-nav {
  width: 236px; flex-shrink: 0; padding: 22px 14px 16px;
  border-right: 1px solid var(--line-soft); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 3px; overflow-y: auto;
}
.smodal-nav-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink); text-transform: none;
  padding: 4px 10px 16px;
}
.smodal-tab {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 450;
  color: var(--ink-2); cursor: pointer; text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}
.smodal-tab:hover { background: var(--hover-surface); color: var(--ink); }
.smodal-tab.active { background: var(--surface); color: var(--ink); font-weight: 500; border-color: var(--line-soft); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.smodal-tab svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.7; }

.smodal-content { flex: 1; overflow-y: auto; padding: 0 36px 56px; position: relative; }
.smodal-close {
  position: absolute; top: 12px; right: 12px; z-index: 7;
  background: var(--surface); color: var(--ink); border-color: var(--line);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.smodal-close:hover { background: var(--hover-strong); border-color: var(--ink-4); }
.smodal-pane { display: flex; flex-direction: column; gap: 32px; }
.smodal-pane[data-pane="account"], .smodal-pane[data-pane="general"] { max-width: 720px; }
.smodal-pane[data-pane="connectors"] { max-width: 860px; }
.smodal-pane[hidden] { display: none; }
.smodal-pane h2 { display: none; } /* replaced by the sticky per-tab header */

/* Sticky per-tab header — title + subtitle. The back chevron is mobile-only
   (drill-in); desktop keeps the sidebar visible so it stays hidden there. */
.smodal-head {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 11px;
  margin: 0 -36px 24px; padding: 24px 36px 18px;
  background: var(--surface); border-bottom: 1px solid var(--line-soft);
}
.smodal-head-text { min-width: 0; }
#smodal-title { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
.smodal-sub { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.smodal-back { display: none; }

/* AI tab — controls column + sticky preview rail. */
.ai-layout { display: flex; gap: 34px; align-items: flex-start; }
.ai-controls { flex: 1; min-width: 0; max-width: 480px; display: flex; flex-direction: column; gap: 16px; }
.ai-preview { width: 300px; flex: none; position: sticky; top: 104px; align-self: flex-start; }
/* Darken the AI tab's scroll area to cream so the white cards lift off it
   (paper-on-paper); the sticky header keeps its own surface bg. */
.smodal-content:has(.smodal-pane[data-pane="extraction"]:not([hidden])) { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
/* AI tab grouped cards (Model & language / Tasks / Abstract). Token-based so it
   adapts to every theme; the serif card title is the [data-theme="default"]
   editorial polish. Inner spacing is margin-based off the shared sub-label /
   hint components. */
.ai-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 18px 20px 20px;
}
[data-theme="default"] .ai-card { box-shadow: 0 1px 2px rgba(14, 15, 12, 0.04); }
.ai-card-head { margin-bottom: 4px; }
.ai-card-title { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
[data-theme="default"] .ai-card-title { font-family: var(--font-display, 'Fraunces', serif); font-weight: 400; letter-spacing: -0.015em; }
.ai-card-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
.ai-card .settings-sub { margin: 16px 0 9px; }
.ai-card .settings-hint { margin-top: 6px; }
.ai-card .settings-divider { margin: 18px 0; }
.ai-card .settings-divider + .settings-sub { margin-top: 0; }
.ai-card .settings-actions { margin-top: 12px; }
.ai-card-check { margin-top: 14px; }

/* AI settings live preview (illustrative sample) */
.ai-preview-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.ai-preview-tag { font-size: 9.5px; letter-spacing: 0.05em; color: var(--ink-3); background: var(--surface-2); border-radius: var(--radius-pill); padding: 2px 9px; }
.ai-preview-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.ai-preview-meta { font-size: 11px; color: var(--ink-3); }
.ai-preview-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 3px 0 11px; }
[data-theme="default"] .ai-preview-title { font-family: var(--font-display, 'Fraunces', serif); font-weight: 400; }
.ai-preview-abstract { margin: 0; font-size: 13px; line-height: 1.62; color: var(--ink-2); }
.ai-preview-divider { height: 1px; background: var(--line); margin: 14px 0 12px; }
.ai-preview-tasks-label { font-size: 10.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.ai-preview-tasks { display: flex; flex-direction: column; gap: 9px; }
.ai-preview-task { display: flex; gap: 9px; align-items: flex-start; }
.ai-preview-check { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; border: 1.5px solid var(--ink-4); border-radius: 5px; }
.ai-preview-task-text { font-size: 12.5px; color: var(--ink); line-height: 1.4; }
.ai-preview-task-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* Active sessions table */
.sessions-table { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: var(--radius-control); overflow: hidden; }
.sessions-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px;
  padding: 8px 12px; font-size: 12.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.sessions-row:last-child { border-bottom: 0; }
.sessions-head-row {
  font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3); background: var(--surface-2); padding: 6px 12px;
}
.sess-current {
  display: inline-block; font-size: 9.5px; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--surface); background: var(--ink);
  border-radius: var(--radius-pill); padding: 1.5px 7px; margin-left: 6px; vertical-align: 1px;
}
.sessions-empty { padding: 16px 12px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* Connector choice cards */
.conn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.conn-card {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  background: var(--surface-2); border: 2px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  font: inherit; cursor: pointer; transition: border-color 0.1s ease, background 0.1s ease;
}
.conn-card:hover:not(.active) { border-color: var(--ink-4); background: var(--surface); }
.conn-card.active { border-color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.conn-card-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.conn-card-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

/* Google task-list rows reuse .proj-row sizing */
.glist-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.glist-title { font-size: 12.5px; font-weight: 550; color: var(--ink); }
.glist-id { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); word-break: break-all; text-align: right; }
.glist-new, .tag-input { max-width: 220px; }

@media (max-width: 640px) {
  /* Fullscreen modal; drill-in navigation: a root tab list, then per-tab
     content reached by tapping a row (back chevron in the header returns). */
  .smodal {
    inset: 0; width: auto; height: auto; max-height: none;
    border-radius: 0; border: 0; transform: none; flex-direction: column;
  }
  .smodal.open { transform: none; }

  /* Root: the tab rail becomes a full-screen vertical list. */
  .smodal-nav {
    width: auto; height: 100%; flex: 1;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 16px 16px 12px; border-right: 0; overflow-y: auto;
  }
  .smodal-nav-title {
    display: block; font-size: 26px; text-transform: none; letter-spacing: -0.02em;
    color: var(--ink); padding: 8px 4px 14px;
  }
  [data-theme="default"] .smodal-nav-title { font-family: var(--font-display, 'Fraunces', serif); font-weight: 400; }
  .smodal-tab {
    width: 100%; justify-content: flex-start; gap: 13px;
    padding: 15px 14px; font-size: 15px; font-weight: 500;
    border: 1px solid var(--line-soft); border-radius: 14px;
    background: var(--surface); box-shadow: none; color: var(--ink);
  }
  .smodal-tab.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: none; }
  .smodal-tab svg { width: 18px; height: 18px; opacity: 0.7; }
  .smodal-tab::after { content: '›'; margin-left: auto; color: var(--ink-4); font-size: 20px; line-height: 1; }
  .smodal-build { display: block; margin-top: auto; }

  /* Drill: hide the list, reveal the content; the back chevron appears. */
  .smodal.drill .smodal-nav { display: none; }
  .smodal:not(.drill) .smodal-content { display: none; }
  .smodal:not(.drill) .smodal-close { display: inline-flex; } /* close from the root list */
  .smodal-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: none; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--radius-pill); color: var(--ink-2);
  }
  .smodal-back svg { width: 18px; height: 18px; }

  /* Vertical scroll only — a stray sub-pixel/momentum sideways drag on the
     single-column settings sheet read as a horizontal scroll. */
  .smodal-content { padding: 0 14px 28px; overflow-x: hidden; overscroll-behavior-x: none; }
  .smodal-head { margin: 0 -14px 16px; padding: 14px 52px 13px 14px; }
  #smodal-title { font-size: 23px; }
  /* AI tab stacks: preview card drops under the controls. */
  .ai-layout { flex-direction: column; gap: 26px; }
  .ai-controls { max-width: none; gap: 26px; }
  .ai-preview { width: auto; position: static; }
  .theme-seg { max-width: none; }
  #model-seg { max-width: none; }
  .conn-grid { grid-template-columns: 1fr; }
  .sessions-row { grid-template-columns: 1.4fr 1fr 1fr; font-size: 11px; }

  /* Allow settings-actions to wrap — fixes button overlap on narrow screens. */
  .settings-actions { flex-wrap: wrap; }
  .settings-actions .header-btn { padding: 7px 9px; font-size: 11.5px; min-width: 0; }
}

/* ============================================================================
 * SUMMARY VIEW — the meeting-digest layout (Settings → General → View). Each
 * meeting shows its AI summary as prose with the extracted action verbs
 * highlighted; the flat list view is untouched.
 * ========================================================================= */

/* The verb marker. The Granola theme gets the signature highlighter strip (the
 * same gesture as the .hl wordmark); the other themes get a tidy accent-tinted
 * chip, since their --highlight token is transparent. Kept as `mark.verb` so a
 * blind `mark` selector never sweeps up the wordmark's <span class="hl">. */
mark.verb {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; border-radius: 4px; padding: 0 3px;
  text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
[data-theme="default"] mark.verb {
  background: var(--highlight);
  /* Always-dark ink on the yellow strip — keeps it legible in dark mode too. */
  color: #15140f; font-weight: 600;
  /* Cover the whole word height, with a slightly irregular, hand-drawn outline. */
  padding: 0.06em 0.18em 0.04em;
  border-radius: 0.5em 0.3em 0.55em 0.35em / 0.45em 0.55em 0.4em 0.6em;
  text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Header chevron — signals the summary-view card opens the meeting panel. */
.meeting-chev {
  width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-4);
  margin-left: 2px; transition: color var(--motion-fast), transform var(--motion-fast);
}
.meeting.summary-view:hover .meeting-chev { color: var(--ink-2); transform: translateX(1px); }
.summary-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.summary-label svg { width: 13px; height: 13px; color: var(--accent); }
.summary-text {
  margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-2);
}
[data-theme="default"] .summary-text { font-size: 16px; line-height: 1.6; }

.extracted-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px var(--pad-card-x) 0;
}
/* Label holds the left; the "N found" badge + re-extract icon cluster right. */
.extracted-head .extracted-label { margin-right: auto; }
.detail-reextract { color: var(--ink-3); }
.detail-reextract:hover:not(:disabled) { color: var(--ink); }
.extracted-label {
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.02em; text-transform: uppercase;
}
[data-theme="default"] .extracted-label {
  font-family: var(--font-display); font-size: 20px; line-height: 28px;
  font-weight: 500; text-transform: none; letter-spacing: -0.3px;
}
.found-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft);
  border-radius: var(--radius-pill); padding: var(--pad-pill-y) var(--pad-pill-x);
}
.meeting.summary-view ul.tasks { padding-top: 2px; }

/* Unified feed: the meeting HEADER is the click target that opens the detail
   panel (the chevron signals it). Task rows below stay inline-editable and are
   not clickable, so the pointer cursor is scoped to the header only. */
.meeting.summary-view .meeting-head { cursor: pointer; }
.meeting.summary-view .meeting-head .proj-btn,
.meeting.summary-view .meeting-head .icon-btn { cursor: pointer; }

/* ============================================================================
 * DETAIL PANEL — meeting + task slide-overs for the Summary view. Desktop: a
 * right-side overlay over a dimmed backdrop. Mobile (<640px): full-screen with
 * a back button (mirrors the settings-modal inset:0 pattern).
 * ========================================================================= */
.detail-backdrop {
  position: fixed; inset: 0; z-index: 132;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.detail-backdrop.open { opacity: 1; pointer-events: auto; }

/* iOS/WebKit bug: a fixed element with backdrop-filter makes higher-z-index
   fixed siblings (our appDialog overlays at z-index 1000) render BEHIND it, and
   lets lower layers (the feed) bleed through the settings modal. These two
   backdrops sit in the DOM full-time, so on touch devices we drop the blur for
   a plain dim — desktop (hover) keeps the blur, where the bug doesn't occur. */
@media (hover: none) {
  .smodal-backdrop, .detail-backdrop {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: rgba(0, 0, 0, 0.5);
  }
}

.detail-panel {
  position: fixed; z-index: 133; top: 0; right: 0; bottom: 0;
  width: min(624px, calc(100vw - 64px));
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column;
  transform: translateX(100%); opacity: 0; pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.detail-panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }

.detail-back {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  cursor: pointer; box-shadow: var(--shadow-sm); transition: background var(--motion-fast);
}
.detail-back:hover { background: var(--surface-2); }
.detail-back svg { width: 16px; height: 16px; }
.detail-back .ic-back { display: none; }
.detail-back.is-back .ic-close { display: none; }
.detail-back.is-back .ic-back { display: inline; }

.detail-content {
  flex: 1; overflow-y: auto; padding: 56px 28px 32px;
  -webkit-overflow-scrolling: touch;
  /* Positioning context for the owner popover mounted inside the pane. */
  position: relative;
}

.detail-eyebrow {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.detail-title {
  margin: 0; font-size: 26px; line-height: 1.18; font-weight: 500;
  color: var(--ink); letter-spacing: -0.015em;
}
[data-theme="default"] .detail-title { font-family: var(--font-display); }
.detail-title.done, .detail-title.deleted { text-decoration: line-through; color: var(--ink-3); }
.detail-sub { font-size: 13px; color: var(--ink-3); }
.detail-muted { color: var(--ink-3); }

/* Meeting pane header grid. Desktop: the date gets its own row, and the content
   toggle (Abstract / Summary / Transcription) shares the next row with "Open in
   Granola" — so the link aligns with the toggle slider rather than the date.
   Mobile reflows the areas (see the max-width:640px block) so the link pins
   beside the date and the toggle spans full width. */
.detail-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "date  date"
    "views open";
  align-items: center;
  column-gap: 12px; row-gap: 18px;
  margin-top: 6px;
}
.detail-head .detail-sub   { grid-area: date; }
.detail-head .detail-views { grid-area: views; justify-self: start; }
.detail-head .detail-open-row {
  grid-area: open; justify-self: end;
  display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.detail-open {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font: inherit; font-size: 13px; color: var(--ink-2); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--radius-pill);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.detail-open:hover { background: var(--hover-surface); color: var(--ink); border-color: var(--ink-4); }
.detail-open svg { width: 13px; height: 13px; flex-shrink: 0; }
.detail-views { flex-wrap: wrap; }
.detail-views button { white-space: nowrap; }
/* Selected content tab uses the brand olive pill (design-system selected state). */
.detail-views button.active {
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
}
.detail-views button.active:hover { background: var(--accent); color: var(--accent-ink); }
/* Transcript chat-bubble view: own mic ('microphone') right + light-green, others left. */
.transcript-chat {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 60vh; overflow-y: auto; padding: 2px;
}
.bubble-row { display: flex; }
.bubble-row.me { justify-content: flex-end; }
.bubble-row.them { justify-content: flex-start; }
.bubble {
  max-width: 78%; padding: 9px 13px; border-radius: var(--radius-card);
  font-size: 13.5px; line-height: 1.5; color: var(--ink);
  word-break: break-word; white-space: pre-wrap;
}
.bubble-row.them .bubble { background: var(--surface-2); border: 1px solid var(--line-soft); border-bottom-left-radius: var(--radius-sm); }
.bubble-row.me .bubble { background: var(--accent-soft); border-bottom-right-radius: var(--radius-sm); }

.detail-card {
  margin-top: 18px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.detail-card .summary-text { margin: 0; }
.detail-card .summary-label { margin-bottom: 10px; }
.summary-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.summary-label-row .summary-label { margin-bottom: 0; }
.summary-label-row .icon-btn { flex-shrink: 0; margin: -4px -4px -4px 0; }
.summary-label-row .label-actions { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; margin: -4px -4px -4px 0; }
.summary-label-row .label-actions .icon-btn { margin: 0; }
.icon-btn.copied, .icon-btn.copied:hover:not(:disabled) { color: var(--accent); }

/* Rendered-markdown AI summary. The container is a <div> (.summary-md) so it can
 * hold block elements; spacing is reset to read as tight prose. Inline verb
 * marks still render via mark.verb. Structure is shared across themes; serif
 * headings are added for Granola only. */
.summary-md > :first-child { margin-top: 0; }
.summary-md > :last-child { margin-bottom: 0; }
.summary-md p { margin: 0 0 0.7em; }
.summary-md h1, .summary-md h2, .summary-md h3,
.summary-md h4, .summary-md h5, .summary-md h6 {
  margin: 1em 0 0.4em; line-height: 1.3; font-weight: 600; color: var(--ink);
}
.summary-md h1 { font-size: 1.25em; }
.summary-md h2 { font-size: 1.15em; }
.summary-md h3 { font-size: 1.05em; }
.summary-md h4, .summary-md h5, .summary-md h6 { font-size: 1em; }
.summary-md ul, .summary-md ol { margin: 0 0 0.7em; padding-left: 1.4em; }
.summary-md li { margin: 0.15em 0; }
.summary-md li::marker { color: var(--ink-3); }
.summary-md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.summary-md a:hover { color: var(--accent-hover); }
.summary-md strong { font-weight: 600; color: var(--ink); }
.summary-md em { font-style: italic; }
.summary-md code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 0.05em 0.35em;
}
.summary-md pre {
  margin: 0 0 0.7em; padding: 10px 12px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
}
.summary-md pre code { background: none; border: 0; padding: 0; font-size: 0.85em; }
.summary-md blockquote {
  margin: 0 0 0.7em; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line); color: var(--ink-2);
}
.summary-md hr { border: 0; border-top: 1px solid var(--line); margin: 0.9em 0; }
[data-theme="default"] .summary-md h1, [data-theme="default"] .summary-md h2,
[data-theme="default"] .summary-md h3, [data-theme="default"] .summary-md h4,
[data-theme="default"] .summary-md h5, [data-theme="default"] .summary-md h6 {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
}

.detail-meta { padding: 4px 16px; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; min-height: 24px;
}
.detail-row + .detail-row { border-top: 1px solid var(--line-soft); }
.detail-key { font-size: 13px; color: var(--ink-3); }
.detail-val { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.detail-val.assignee { display: inline-flex; align-items: center; gap: 8px; }

.avatar {
  width: 22px; height: 22px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
  background: hsl(var(--avatar-h, 90), 45%, 86%); color: hsl(var(--avatar-h, 90), 55%, 28%);
}
[data-mode="dark"] .avatar { background: hsla(var(--avatar-h, 90), 45%, 60%, 0.22); color: hsl(var(--avatar-h, 90), 60%, 75%); }

/* Meeting-tab participants: an overlapping avatar group + a quiet count, matching
   the design system's attendee group. */
/* Participants group — a tappable button (opens the full attendee list), flush-left
   with the title/eyebrow. */
.detail-people {
  display: inline-flex; align-items: center; gap: 10px; margin: 2px 0 12px;
  padding: 3px 8px 3px 3px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-pill); font: inherit; transition: background 0.1s ease;
}
.detail-people:hover { background: var(--hover-surface); }
.detail-avatars { display: inline-flex; align-items: center; }
.detail-avatar {
  width: 24px; height: 24px; border-radius: var(--radius-pill); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-left: -6px;
  border: 2px solid var(--surface);
  background: hsl(var(--avatar-h, 90), 45%, 86%); color: hsl(var(--avatar-h, 90), 55%, 28%);
}
.detail-avatar:first-child { margin-left: 0; }
.detail-avatar-more { background: var(--surface-2); color: var(--ink-3); font-weight: 600; }
.detail-people-count { font-size: 13px; color: var(--ink-3); }
[data-mode="dark"] .detail-avatar { background: hsla(var(--avatar-h, 90), 45%, 60%, 0.22); color: hsl(var(--avatar-h, 90), 60%, 75%); }
/* Granola theme: avatars adopt the brand oat-yellow + serif initial. */
[data-theme="default"] .detail-avatar { background: var(--highlight); color: var(--ink); font-family: var(--font-display); font-weight: 500; }
[data-theme="default"] .detail-avatar-more { background: var(--surface-2); color: var(--ink-2); }

/* Meeting panel: extracted-tasks list */
.detail-tasks { margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.detail-task {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 12px 14px; background: var(--surface); border: 0; cursor: default;
  font: inherit; text-align: left; color: var(--ink);
}
.detail-task + .detail-task { border-top: 1px solid var(--line-soft); }
.detail-task-check { margin-top: 1px; }
/* Inline-editable body: title + context + assignee pill (mirrors the feed). */
.detail-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.detail-task-title { font-size: 14px; color: var(--ink); line-height: 1.42; word-wrap: break-word; }
.detail-task-summary { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; word-wrap: break-word; }
.detail-task-title[contenteditable], .detail-task-summary[contenteditable] {
  outline: none; border-radius: 6px; padding: 2px 5px; margin: -2px -5px;
  cursor: text; transition: background 0.1s ease, box-shadow 0.1s ease;
  white-space: pre-wrap; word-break: break-word; align-self: flex-start; max-width: 100%;
}
.detail-task-title[contenteditable]:hover, .detail-task-summary[contenteditable]:hover { background: var(--hover-surface); }
.detail-task-title[contenteditable]:focus, .detail-task-summary[contenteditable]:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--line); }
.detail-task-title[contenteditable]:empty::before   { content: 'Title'; color: var(--ink-3); }
.detail-task-summary[contenteditable]:empty::before { content: 'Description'; color: var(--ink-4); }
.detail-task-title[contenteditable]:empty::before,
.detail-task-summary[contenteditable]:empty::before { pointer-events: none; }
.detail-task .pills { margin-top: 2px; }
.detail-task.done .detail-task-title { text-decoration: line-through; color: var(--ink-3); }
.detail-task.deleted .detail-task-title { text-decoration: line-through; color: var(--ink-3); }
/* Right-side actions in the meeting pane's task rows — mirrors the feed's hover
   column: a connector "+" (only when configured) and a bin. Revealed on row hover;
   always visible on touch (no hover). */
.detail-task-actions { flex-shrink: 0; display: flex; align-items: center; gap: 2px; margin: -2px -4px 0 0; opacity: 0; transition: opacity 0.12s ease; }
.detail-task:hover .detail-task-actions, .detail-task:focus-within .detail-task-actions { opacity: 1; }
@media (hover: none) { .detail-task-actions { opacity: 1; } }
.detail-task-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; background: transparent;
  border-radius: var(--radius-control); cursor: pointer; color: var(--ink-3);
  transition: background 0.1s ease, color 0.1s ease;
}
.detail-task-act svg { width: 16px; height: 16px; }
.detail-task-act.add:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.detail-task-act.add.added { color: var(--accent); }
.detail-task-act.trash:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.detail-task-act.restore:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* Round check toggle (task head + meeting-task rows) */
.detail-task-check, .detail-check {
  flex-shrink: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink-4); background: transparent; color: transparent;
}
.detail-task-check { width: 20px; height: 20px; cursor: pointer; transition: background var(--motion-fast), border-color var(--motion-fast); }
.detail-check { width: 26px; height: 26px; cursor: pointer; transition: background var(--motion-fast), border-color var(--motion-fast); }
.detail-task-check svg, .detail-check svg { width: 13px; height: 13px; }
.detail-task-check.on, .detail-check.on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
/* Deleted task: white ✕ on a red fill (detail head + meeting-pane task rows) — clicking
   it marks the task done + clears the deleted flag. */
.detail-check.deleted, .detail-task-check.deleted { background: var(--red); border-color: var(--red); color: #fff; }
.detail-check.deleted svg { width: 14px; height: 14px; }
.detail-check.deleted:hover, .detail-task-check.deleted:hover { filter: brightness(1.08); }

/* Task head: "TASK" eyebrow on its own row above the title; checkbox aligned to the title. */
.detail-task-head { display: flex; flex-direction: column; }
.detail-task-row { display: flex; align-items: flex-start; gap: 12px; }
.detail-task-row .detail-check { margin-top: 4px; }

/* Inline-editable detail fields */
.detail-title[contenteditable], .detail-context[contenteditable], .detail-owner[contenteditable] {
  outline: none; border-radius: var(--radius-sm);
  transition: background var(--motion-fast), box-shadow var(--motion-fast);
}
.detail-title[contenteditable] { flex: 1; }
.detail-title[contenteditable]:hover, .detail-context[contenteditable]:hover, .detail-owner[contenteditable]:hover {
  background: var(--hover-surface);
}
.detail-title[contenteditable]:focus, .detail-context[contenteditable]:focus, .detail-owner[contenteditable]:focus {
  background: var(--surface); box-shadow: 0 0 0 2px var(--accent-soft); border-color: var(--focus);
}
.detail-owner.na { color: var(--ink-3); }
/* Assignee in the detail pane is a button that opens the owner dropdown. */
button.detail-owner {
  font: inherit; background: transparent; border: 0; cursor: pointer;
  min-width: 3.5em; padding: 1px 6px; border-radius: var(--radius-sm);
  color: inherit; text-align: left;
  transition: background var(--motion-fast), box-shadow var(--motion-fast);
}
button.detail-owner:hover { background: var(--hover-surface); }
button.detail-owner.owner-kind-me { color: var(--accent); font-weight: 600; }
.detail-context:empty::before { content: attr(data-placeholder); color: var(--ink-4); }

/* "From meeting" navigation row */
.detail-from {
  margin-top: 18px; width: 100%;
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  cursor: pointer; font: inherit; text-align: left; color: var(--ink);
  transition: background var(--motion-fast);
}
.detail-from:hover { background: var(--hover-surface); }
.detail-from-icon { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.detail-from-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.detail-from-label { font-size: 11px; color: var(--ink-3); }
.detail-from-title { font-size: 13.5px; font-weight: 500; }
.detail-chev { width: 13px; height: 13px; color: var(--ink-4); flex-shrink: 0; }

/* Mark complete CTA + delete, side by side */
.detail-actions { margin-top: 18px; display: flex; align-items: stretch; gap: 10px; }
.detail-cta {
  flex: 1; padding: 13px;
  border: 0; border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  transition: background var(--motion-fast);
}
.detail-cta:hover { background: var(--accent-hover); }
/* Delete: design-system clay-red, distinct from the green CTA */
.detail-delete {
  flex-shrink: 0; padding: 13px 18px;
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600;
  background: transparent; color: var(--red);
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.detail-delete:hover { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 55%, transparent); }
/* "Add to Things / Google Tasks" — secondary action, full width, below the green CTA. */
.detail-add {
  margin-top: 10px; width: 100%; padding: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-pill); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  background: transparent; color: var(--accent);
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.detail-add:hover { background: var(--accent-soft); }
.detail-add svg { width: 14px; height: 14px; }
.detail-add.added { color: var(--ink-3); border-color: var(--line); cursor: default; }
.detail-add.added:hover { background: transparent; }

@media (max-width: 640px) {
  .detail-panel {
    inset: 0; width: auto; border-left: 0;
    transform: translateX(100%);
  }
  .detail-panel.open { transform: translateX(0); }
  /* The panel fills the viewport incl. the safe-area (viewport-fit=cover) so its
     surface runs under the status bar — no cream strip. The close button + content
     are pushed below the notch, and the top gap above "MEETING" is tightened. */
  .detail-back { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
  .detail-content { padding: calc(26px + env(safe-area-inset-top, 0px)) 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
  /* Reflow the header: date + "Open in Granola" on the first row, the content
     toggle full-width below (the desktop layout drops the link to the toggle
     row instead). */
  .detail-head {
    grid-template-areas:
      "date  open"
      "views views";
  }
  /* Content tabs span the full width, split into equal justified segments. */
  .detail-head .detail-views { justify-self: stretch; }
  .detail-views { display: flex; width: 100%; flex-wrap: nowrap; }
  .detail-views button {
    flex: 1 1 0; min-width: 0; justify-content: center;
    padding-left: 6px; padding-right: 6px; font-size: 12px;
  }
  .detail-title { font-size: 23px; }
  [data-theme="default"] .detail-title { font-size: 28px; line-height: 32px; }
}

/* ============================================================================
 * "PREVIEW IN GRANOLA" MOCKUP — a desktop-only concept overlay: a faux macOS
 * Granola app window (smooth corners + traffic lights) with a Home meeting list
 * and a new Tasks tab. Visual only; built with Granola "oats" tokens to read as
 * the real app. See #granola-preview in index.html and openGranolaPreview() in
 * app.js. Hidden on mobile (the launcher is desktop-only).
 *
 * The window carries its OWN --gp-* token scope (light + dark) rather than the
 * app's --ink/--surface tokens: it is impersonating a different application, so
 * it must not follow the user's theme pick (Solarized/Carbon/Material) — only
 * light/dark. That scope therefore has to mirror every DS value the task rows
 * need (accent, highlight, error family, danger), which is why new pill styles
 * are added as --gp-* tokens here and never by reaching outside the window.
 * ========================================================================= */
.gp-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 24px; box-sizing: border-box;
  background: rgba(14, 15, 12, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.2s ease;
}
.gp-overlay.open { opacity: 1; }
.gp-overlay[hidden] { display: none; }
.gp-overlay-bar {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
  max-width: 1180px; width: 100%;
}
.gp-overlay-tag { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); font-style: italic; }
.gp-overlay-close {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px; padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background 0.12s ease;
}
.gp-overlay-close:hover { background: rgba(255, 255, 255, 0.24); }
.gp-overlay-close svg { width: 13px; height: 13px; }

/* Window chrome */
.gp-window {
  --gp-bg: #f7f7f2; --gp-surface: #fff; --gp-ink: #1c1d18; --gp-ink-2: #6b6c64;
  --gp-line: #e7e7e0; --gp-accent: #5b6f00; --gp-highlight: #febe29;
  /* Error family (overdue due-dates) + the deleted-checkbox red, mirroring the
     app's --error-* / .check-deleted tokens inside the mockup's own scope. */
  --gp-error-bg: #fbeae5; --gp-error-border: #f1c6b8; --gp-error-ink: #bd4a30;
  --gp-danger: #c0442a;
  width: 100%; max-width: 1180px; flex: 1; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--gp-bg); color: var(--gp-ink);
  border-radius: 16px; border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  font-family: "Geist", system-ui, sans-serif;
  transform: translateY(8px) scale(0.995); transition: transform 0.22s ease;
}
.gp-overlay.open .gp-window { transform: none; }
/* The traffic lights sit at the top of the SIDEBAR, not on a full-width bar:
   the sidebar column (and the hairline dividing it from the main pane) runs to
   the very top of the window, as it does in the real app. */
.gp-titlebar {
  flex-shrink: 0; height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 0 6px; margin-bottom: 6px;
}
.gp-light { width: 12px; height: 12px; border-radius: 50%; }
.gp-light.r { background: #ff5f57; } .gp-light.y { background: #febc2e; } .gp-light.g { background: #28c840; }
/* The app's sidebar-collapse glyph, right of the lights. Decorative. */
.gp-side-toggle { margin-left: auto; display: inline-flex; color: var(--gp-ink-2); opacity: 0.75; }
.gp-side-toggle svg { width: 17px; height: 17px; }
.gp-body { flex: 1; min-height: 0; display: flex; }

/* Sidebar */
.gp-sidebar {
  width: 232px; flex-shrink: 0; padding: 8px 10px 12px; box-sizing: border-box;
  border-right: 1px solid var(--gp-line); background: var(--gp-bg);
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.gp-search {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding: 7px 10px; border-radius: 9px; background: var(--gp-surface);
  border: 1px solid var(--gp-line); color: var(--gp-ink-2); font-size: 13px;
}
.gp-search svg { width: 14px; height: 14px; }
.gp-search .gp-kbd { margin-left: auto; font-size: 11px; color: var(--gp-ink-2); }
.gp-nav { display: flex; flex-direction: column; gap: 2px; }
.gp-nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; background: transparent; border-radius: 8px;
  font: inherit; font-size: 13.5px; color: var(--gp-ink); cursor: pointer; text-align: left;
  transition: background 0.1s ease;
}
.gp-nav-item svg { width: 16px; height: 16px; color: var(--gp-ink-2); flex-shrink: 0; }
.gp-nav-item:hover { background: rgba(0, 0, 0, 0.045); }
.gp-nav-item.active { background: rgba(0, 0, 0, 0.07); font-weight: 500; }
.gp-space-ico { width: 16px; text-align: center; }
.gp-spaces { margin: 12px 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--gp-ink-2); text-transform: uppercase; }
.gp-badge {
  margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  color: #4a5a00; background: color-mix(in srgb, var(--gp-highlight) 55%, #fff);
  border-radius: 9999px; padding: 1px 7px;
}
/* The Tasks tab pulses until first clicked, cueing the integration. */
.gp-nav-tasks.pulse {
  background: color-mix(in srgb, var(--gp-highlight) 30%, transparent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--gp-highlight) 70%, transparent);
  animation: gpPulse 1.7s ease-out infinite;
}
.gp-nav-tasks.pulse svg { color: #8a6712; }
@keyframes gpPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gp-highlight) 65%, transparent); }
  70% { box-shadow: 0 0 0 9px rgba(254, 190, 41, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 190, 41, 0); }
}
@media (prefers-reduced-motion: reduce) { .gp-nav-tasks.pulse { animation: none; } }

/* Main pane */
/* Top padding is deliberately small: with no titlebar above it, the pane's own
   content (the back/home button, then the heading) is what sits near the window
   top, roughly level with the traffic lights across the divider. */
.gp-main { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 40px 40px; background: var(--gp-bg); }
.gp-pane[hidden] { display: none; }
.gp-h1 { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 30px; letter-spacing: -0.015em; margin: 0 0 18px; color: var(--gp-ink); }
.gp-sub { margin: -10px 0 20px; font-size: 13.5px; color: var(--gp-ink-2); }
/* The DS highlighter gesture (mark.verb / .hl), restated in the mockup's own
   token scope — always-dark ink on the oat-yellow strip so it stays legible in
   dark mode, where the strip keeps its brand colour. */
.gp-hl {
  background: var(--gp-highlight); color: #15140f; font-weight: 600;
  border-radius: 4px; padding: 0.05em 0.28em;
  text-decoration: none; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* Overdue tail: error ink, no fill — it is a sentence, not a chip. */
.gp-sub-overdue { color: var(--gp-error-ink); font-weight: 500; }
.gp-comingup {
  display: flex; align-items: center; gap: 16px; margin-bottom: 26px;
  padding: 16px 20px; background: var(--gp-surface); border: 1px solid var(--gp-line);
  border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.gp-comingup-date { display: flex; align-items: center; gap: 8px; }
.gp-comingup-date strong { font-size: 26px; font-weight: 600; }
.gp-comingup-date span { font-size: 12px; color: var(--gp-ink-2); line-height: 1.15; }
.gp-comingup-body { padding-left: 16px; border-left: 3px solid #e0143c; }
.gp-comingup-title { font-size: 15px; font-weight: 500; }
.gp-comingup-time { font-size: 12.5px; color: var(--gp-ink-2); }

/* Home: meeting rows (not clickable) */
.gp-meeting-list { display: flex; flex-direction: column; }
.gp-meeting { display: flex; align-items: center; gap: 14px; padding: 11px 6px; border-bottom: 1px solid var(--gp-line); }
.gp-meeting:last-child { border-bottom: 0; }
.gp-doc {
  width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: 8px; color: var(--gp-ink-2);
}
.gp-doc svg { width: 17px; height: 17px; }
.gp-meeting-main { flex: 1; min-width: 0; }
.gp-meeting-title { font-size: 14.5px; color: var(--gp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-meeting-sub { font-size: 12px; color: var(--gp-ink-2); }
.gp-meeting-time { font-size: 12.5px; color: var(--gp-ink-2); flex-shrink: 0; }
/* Attendee cluster under a meeting title — the feed's people row, read-only.
   DS avatars: oat-yellow disc + serif initials, overlapped and hairlined. */
.gp-people { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.gp-people-avatars { display: inline-flex; align-items: center; }
.gp-people-avatar {
  width: 22px; height: 22px; border-radius: 9999px; margin-left: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Fraunces", Georgia, serif; font-size: 11px; font-weight: 500;
  background: var(--gp-highlight); color: #3a2f00;
  border: 2px solid var(--gp-bg);
}
.gp-people-avatar:first-child { margin-left: 0; }
.gp-people-avatar.more {
  font-family: "Geist", system-ui, sans-serif; font-size: 9.5px; font-weight: 600;
  background: var(--gp-line); color: var(--gp-ink); border-color: var(--gp-bg);
}

/* Home/back button (Tasks pane → meeting list). A wide pill — chevron + house —
   sitting near the top of the pane, level with the traffic lights. */
.gp-homebtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; margin-bottom: 14px; padding: 0 12px;
  background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: 9999px;
  color: var(--gp-ink-2); cursor: pointer; transition: background 0.1s ease;
}
.gp-homebtn:hover { background: rgba(0, 0, 0, 0.05); }
/* The house is drawn on a 24 grid (see index.html) and sits smaller than the
   pill's height would suggest — it reads as a mark inside the button, not as
   the button. */
.gp-homebtn svg { width: 15px; height: 15px; }
.gp-homebtn .gp-homebtn-back { width: 12px; height: 12px; }
.gp-homebtn-home { opacity: 0.9; }

/* Tasks: grouped by meeting (date before the title) */
.gp-task-group { margin-bottom: 24px; }
.gp-task-group-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--gp-line);
}
.gp-task-group-date { font-size: 12px; font-weight: 600; color: var(--gp-ink-2); flex-shrink: 0; }
.gp-task-group-title {
  font-family: "Fraunces", Georgia, serif; font-size: 16px; font-weight: 500; color: var(--gp-ink);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Open-task count, mirroring the feed's meeting-card badge. */
.gp-task-group-count { margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--gp-ink-2); }
.gp-task { display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px; }
.gp-check {
  width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px;
  border: 1.6px solid #c3c3b8; border-radius: 6px; background: var(--gp-surface);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.gp-check.on { background: var(--gp-accent); border-color: var(--gp-accent); }
/* A deleted task reads as a white ✕ on red — the same signal as the feed's row. */
.gp-check.deleted { background: var(--gp-danger); border-color: var(--gp-danger); }
.gp-check svg { width: 12px; height: 12px; }
.gp-task.done .gp-task-title { text-decoration: line-through; color: var(--gp-ink-2); }
.gp-task.deleted .gp-task-title { text-decoration: line-through; color: var(--gp-ink-2); }
.gp-task.done, .gp-task.deleted { opacity: 0.72; }
.gp-task-body { flex: 1; min-width: 0; }
.gp-task-title { font-size: 14px; color: var(--gp-ink); line-height: 1.4; }
/* The task's context line — the second field the feed shows under every title. */
.gp-task-summary { margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--gp-ink-2); }
.gp-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }

/* Task pills — one shared shape (DS: full pill, hairline, 12px/500, sentence
   case), then a modifier per kind. */
.gp-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0.13px;
  border-radius: 9999px; padding: 2px 9px;
  background: var(--gp-surface); border: 1px solid var(--gp-line); color: var(--gp-ink-2);
}
.gp-pill svg { width: 12px; height: 12px; flex-shrink: 0; }
.gp-owner { padding-left: 3px; }
/* Assignee-pill colours mirror the feed's four kinds: me = olive CTA,
   other = oat-yellow highlight, custom (a typed name) = neutral + dashed,
   na = three greys with a dark "?" avatar. */
.gp-owner.me { background: rgba(91, 111, 0, 0.14); border-color: rgba(91, 111, 0, 0.45); color: #4a5a00; }
.gp-owner.me .gp-avatar { background: var(--gp-accent); color: #f7f7f2; }
.gp-owner.other { background: rgba(254, 190, 41, 0.20); border-color: rgba(254, 190, 41, 0.55); color: #5a4a00; }
.gp-owner.custom { border-style: dashed; }
.gp-owner.custom .gp-avatar { background: var(--gp-line); color: var(--gp-ink-2); }
.gp-owner.na { color: var(--gp-ink-2); }
.gp-avatar {
  width: 17px; height: 17px; border-radius: 9999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Fraunces", Georgia, serif; font-size: 9.5px; font-weight: 500;
  background: var(--gp-highlight); color: #3a2f00;
}
.gp-avatar.na { background: #c3c3b8; color: #4a4a42; }
/* Due date. Overdue (and due-today) tints error, exactly as the feed's chip does. */
.gp-due.soon { background: var(--gp-error-bg); border-color: var(--gp-error-border); color: var(--gp-error-ink); }
.gp-added svg { width: 11px; height: 11px; }
.gp-empty { padding: 32px 8px; font-size: 13.5px; color: var(--gp-ink-2); font-style: italic; }

/* Home meetings grouped by day */
.gp-day + .gp-day { margin-top: 18px; }
.gp-day-head { font-size: 12px; font-weight: 600; color: var(--gp-ink-2); margin: 0 0 4px 2px; }
/* Per-meeting open chevron (signals the row opens the meeting sidebar) */
.gp-open {
  flex-shrink: 0; width: 26px; height: 26px; padding: 0; border: 0; background: transparent;
  border-radius: 8px; color: var(--gp-ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.1s ease, color 0.1s ease;
}
.gp-open:hover { background: rgba(0, 0, 0, 0.06); color: var(--gp-ink); }
.gp-open svg { width: 12px; height: 12px; }

/* Tasks pane: filter chips (a visual mirror of the feed's filters) */
.gp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 20px; }
.gp-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; cursor: pointer;
  font-size: 12.5px; color: var(--gp-ink-2); background: var(--gp-surface);
  border: 1px solid var(--gp-line); border-radius: 9999px; padding: 5px 12px;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.gp-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.gp-chip .chip-caret { width: 12px; height: 12px; opacity: 0.7; }
.gp-chip:hover { border-color: var(--gp-ink-2); }
.gp-chip.on { color: #fff; background: var(--gp-accent); border-color: var(--gp-accent); }
/* Dark mode's accent is a light olive, so an active chip flips to dark ink —
   white on it lands near 2:1. */
[data-mode="dark"] .gp-chip.on { color: #1c1d1a; }

/* In-window meeting sidebar (read-only meeting detail, no tasks) */
.gp-body { position: relative; }
.gp-detail {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 64%);
  display: flex; flex-direction: column; background: var(--gp-surface);
  border-left: 1px solid var(--gp-line); box-shadow: -24px 0 60px -30px rgba(0, 0, 0, 0.5);
  transform: translateX(8px); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; z-index: 5;
}
.gp-detail.open { transform: none; opacity: 1; }
.gp-detail[hidden] { display: none; }
.gp-detail-bar { flex-shrink: 0; padding: 12px 14px 0; }
.gp-detail-close {
  width: 30px; height: 30px; padding: 0; border: 1px solid var(--gp-line); background: var(--gp-surface);
  border-radius: 9999px; color: var(--gp-ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.gp-detail-close:hover { background: rgba(0, 0, 0, 0.05); }
.gp-detail-close svg { width: 15px; height: 15px; }
.gp-detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px 24px; }

/* Dark/light coherence: the mockup follows the app's active mode. */
[data-mode="dark"] .gp-window {
  --gp-bg: #1c1d1a; --gp-surface: #26271f; --gp-ink: #ecebe3; --gp-ink-2: #9a9a8f;
  --gp-line: #34352c; --gp-accent: #aebd3a; --gp-highlight: #febe29;
  --gp-error-bg: rgba(233, 93, 61, 0.14); --gp-error-border: rgba(233, 93, 61, 0.40);
  --gp-error-ink: #f0a892; --gp-danger: #b8462c;
  border-color: rgba(255, 255, 255, 0.08);
}
[data-mode="dark"] .gp-check { border-color: #56564a; }
[data-mode="dark"] .gp-check.on svg { color: #1c1d1a; }
/* Assignee pills invert the way the app's do in dark mode: lighter ink on a
   low-alpha wash, so the four kinds stay distinguishable without glowing. */
[data-mode="dark"] .gp-owner.me { color: #cdd97a; background: rgba(174, 189, 58, 0.16); border-color: rgba(174, 189, 58, 0.40); }
[data-mode="dark"] .gp-owner.me .gp-avatar { color: #1c1d1a; }
[data-mode="dark"] .gp-owner.other { color: #f0d894; background: rgba(254, 190, 41, 0.16); border-color: rgba(254, 190, 41, 0.40); }
[data-mode="dark"] .gp-avatar.na { background: rgba(255, 255, 255, 0.22); color: var(--gp-ink); }

@media (max-width: 640px) { .gp-overlay { display: none; } }

/* ============================================================================
 * TASK INBOX — review overlay for pending AI-extracted tasks (Inbox mode).
 * Desktop: centered modal (settings-modal family, shares .smodal-backdrop
 * styling via #inbox-backdrop) with a grouped, inline-editable list and
 * ✓ accept / ✕ reject per row. Mobile (≤640px): full-screen card stack —
 * swipe right accepts, left rejects; the round buttons mirror the gestures.
 * Token-driven throughout so all four themes + dark mode stay coherent.
 * ========================================================================= */
.inbox-modal {
  position: fixed; z-index: 131;
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.98);
  width: min(720px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 48px));
  /* Same canvas as the home feed (cream, not white) — cards read as surfaces on it. */
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.20), 0 2px 8px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease;
}
.inbox-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.inbox-head {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft);
}
.inbox-title {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: 19px; letter-spacing: -0.01em; color: var(--ink);
}
.inbox-count { font-size: 12.5px; color: var(--ink-3); flex: 1; }
#inbox-accept-all[hidden] { display: none; }
.inbox-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 24px; position: relative; }

.inbox-empty {
  text-align: center; color: var(--ink-3); font-size: 13px; padding: 48px 20px;
}
.inbox-empty strong {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 17px; color: var(--ink); margin-bottom: 6px;
}

/* Desktop grouped list */
.inbox-group { margin-bottom: 22px; }
.inbox-group-head {
  display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; min-width: 0;
}
.inbox-group-title {
  font-weight: 500; font-size: 13.5px; color: var(--ink); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox-group-date { font-size: 12px; color: var(--ink-3); flex-shrink: 0; }
.inbox-task {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius-card); padding: 10px 12px; margin-bottom: 8px;
}
.inbox-task .task-body { flex: 1; min-width: 0; }
.inbox-task.collapsing { transition: height 0.28s ease, opacity 0.22s ease, padding 0.28s ease, margin 0.28s ease, border-width 0.28s ease; }
@media (prefers-reduced-motion: reduce) { .inbox-task.collapsing { transition: none; } }
.inbox-acts { display: flex; gap: 8px; flex-shrink: 0; align-items: center; margin-top: 2px; }
.inbox-act {
  width: 30px; height: 30px; padding: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font: inherit;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
.inbox-act svg { width: 15px; height: 15px; }
.inbox-act.accept { background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink); }
.inbox-act.accept:hover { opacity: 0.88; }
.inbox-act.reject { background: transparent; border: 1px solid var(--line); color: var(--red); }
.inbox-act.reject:hover { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: var(--red); }
.inbox-task.resolving-accept { border-color: var(--accent); }
.inbox-task.resolving-reject { border-color: var(--red); }

/* Mobile card stack — content-height cards anchored to the top of the stage
   (no forced full-height, so a short task isn't a wall of white). The two
   cards behind fan out with a slight tilt + downward offset to read as a
   physical pile; they're fully OPAQUE (a see-through card behind the top one
   looked like a rendering glitch mid-swipe). */
.inbox-stage { position: relative; height: 100%; min-height: 240px; }
.inbox-card {
  /* Vertically centred in the stage above the controls via the absolute
     margin:auto trick (top+bottom set, definite max-content height) — this
     avoids using `transform` for centring, leaving transform free for the
     swipe + rise animations. */
  position: absolute; top: 8px; bottom: 104px; left: 8px; right: 8px;
  height: max-content; max-height: calc(100% - 112px); margin: auto;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.05);
  overflow-y: auto; touch-action: pan-y;
  z-index: 3; will-change: transform; transform-origin: bottom center;
}
/* The top (interactive) card rises + straightens from the pile when it becomes
   the front card — visually, the card that was behind moves up as the old top
   flings away. */
.inbox-card:not(.ghost) { animation: inboxCardRise 0.3s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes inboxCardRise {
  from { transform: translateY(9px) scale(0.985) rotate(2deg); }
  to   { transform: none; }
}
.inbox-card.ghost { pointer-events: none; overflow: hidden; transform-origin: bottom center; }
.inbox-card.ghost.g1 { z-index: 2; transform: translateY(9px) scale(0.985) rotate(2deg); }
.inbox-card.ghost.g2 { z-index: 1; transform: translateY(18px) scale(0.97) rotate(-2.5deg); }
@media (prefers-reduced-motion: reduce) {
  .inbox-card:not(.ghost) { animation: none; }
}
.inbox-card-eyebrow {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 2px;
}
.inbox-card-meeting {
  font-weight: 500; font-size: 12.5px; color: var(--ink-2); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inbox-card-date { font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; }
.inbox-card .task-title { font-size: 18px; line-height: 1.35; }
.inbox-card .task-summary { font-size: 14.5px; line-height: 1.45; }
.inbox-card .pills { margin-top: 4px; padding-top: 6px; }
/* Accept/reject stamps fade in with the drag (opacity driven by --stamp). */
.inbox-stamp {
  position: absolute; top: 14px; width: 44px; height: 44px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; pointer-events: none; z-index: 4;
}
.inbox-stamp svg { width: 22px; height: 22px; }
.stamp-accept { left: 14px; background: var(--green); }
.stamp-reject { right: 14px; background: var(--red); }
.inbox-card.will-accept .stamp-accept { opacity: var(--stamp, 1); }
.inbox-card.will-reject .stamp-reject { opacity: var(--stamp, 1); }
.inbox-card-controls {
  position: absolute; left: 0; right: 0; bottom: 38px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.inbox-big {
  width: 54px; height: 54px; padding: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font: inherit; box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.inbox-big svg { width: 22px; height: 22px; }
.inbox-big.accept { background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink); }
.inbox-big.accept:active { opacity: 0.85; }
.inbox-big.reject { background: var(--surface); border: 1px solid var(--line); color: var(--red); }
.inbox-big.reject:active { background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
.inbox-big:disabled { opacity: 0.4; box-shadow: none; cursor: default; }
/* Blue rewind/undo — smaller than the big accept/reject, like Tinder's rewind.
   Brings back the last swiped card (session-scoped, until the inbox closes). */
.inbox-undo {
  --inbox-blue: #2f80ed;
  width: 44px; height: 44px; padding: 0; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font: inherit;
  background: var(--surface); border: 1px solid var(--inbox-blue); color: var(--inbox-blue);
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}
.inbox-undo svg { width: 18px; height: 18px; }
.inbox-undo:active { background: color-mix(in srgb, var(--inbox-blue) 10%, var(--surface)); }
.inbox-undo:disabled { opacity: 0.35; border-color: var(--line); color: var(--ink-4); box-shadow: none; cursor: default; }
[data-mode="dark"] .inbox-undo { --inbox-blue: #5b9bf0; }
.inbox-left {
  position: absolute; left: 0; right: 0; bottom: 14px;
  font-size: 12px; color: var(--ink-3); text-align: center;
}

@media (max-width: 640px) {
  /* Full-screen sheet; the body becomes the card stage's positioning context. */
  .inbox-modal {
    top: 0; left: 0; transform: none; width: 100vw; height: 100%;
    border-radius: 0; border: 0;
  }
  .inbox-modal.open { transform: none; }
  .inbox-head { padding: 14px 16px 12px; }
  .inbox-body { padding: 10px 12px 12px; overflow: hidden; }
}

/* "N tasks pending in Inbox" hint under the meeting pane's task list. */
.detail-inbox-hint { font-size: 12.5px; color: var(--ink-3); padding: 8px 2px 0; }
.detail-inbox-hint .linklike {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.detail-inbox-hint .linklike:hover { opacity: 0.85; }

/* Inbox — first-use swipe tutorial (mobile cards). A looping mini-card demo:
   sway right (✓ stamp) → back → sway left (✕ stamp). Sits over the stage +
   controls until "Got it" stores the local flag. */
.inbox-hint {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.inbox-hint-demo { display: flex; align-items: center; gap: 18px; }
.inbox-hint-card {
  position: relative; width: 118px; height: 88px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  padding: 14px 12px;
  animation: inboxHintSway 3.2s ease-in-out infinite;
}
.inbox-hint-line { display: block; height: 7px; border-radius: 4px; background: var(--line); margin-bottom: 8px; }
.inbox-hint-line.w1 { width: 78%; }
.inbox-hint-line.w2 { width: 52%; background: var(--line-soft); }
.inbox-hint-stamp {
  position: absolute; bottom: 10px; width: 26px; height: 26px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0;
}
.inbox-hint-stamp svg { width: 13px; height: 13px; }
.inbox-hint-stamp.ok { left: 10px; background: var(--green); animation: inboxHintStampOk 3.2s ease-in-out infinite; }
.inbox-hint-stamp.no { right: 10px; background: var(--red); animation: inboxHintStampNo 3.2s ease-in-out infinite; }
/* Side cues: faint ✓ / ✕ marking each swipe direction's meaning. */
.inbox-hint-side {
  width: 30px; height: 30px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.inbox-hint-side svg { width: 14px; height: 14px; }
.inbox-hint-side.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.inbox-hint-side.no { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.inbox-hint-copy { margin: 0; text-align: center; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.inbox-hint-copy strong { color: var(--ink); font-weight: 600; }
@keyframes inboxHintSway {
  0%, 8%   { transform: none; }
  26%, 32% { transform: translateX(44px) rotate(6deg); }
  50%, 58% { transform: none; }
  76%, 82% { transform: translateX(-44px) rotate(-6deg); }
  100%     { transform: none; }
}
@keyframes inboxHintStampOk {
  0%, 12% { opacity: 0; } 26%, 32% { opacity: 1; } 46%, 100% { opacity: 0; }
}
@keyframes inboxHintStampNo {
  0%, 62% { opacity: 0; } 76%, 82% { opacity: 1; } 96%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-hint-card, .inbox-hint-stamp.ok, .inbox-hint-stamp.no { animation: none; }
  .inbox-hint-stamp { opacity: 0.9; } /* static: both stamps just shown */
}

/* Granola theme — the inbox follows the DS type scale (Fraunces display for
   the meeting eyebrow, Geist body sizes for the task text). Scoped to
   [data-theme="default"] so Solarized / Carbon / Material keep their systems. */
[data-theme="default"] .inbox-card-meeting {
  font-family: var(--font-display); font-size: 17px; line-height: 24px;
  font-weight: 500; letter-spacing: -0.2px; color: var(--ink);
}
[data-theme="default"] .inbox-card-date { font-size: 13px; letter-spacing: 0.13px; }
[data-theme="default"] .inbox-card .task-title { font-size: 19px; line-height: 26px; letter-spacing: 0.16px; }
[data-theme="default"] .inbox-card .task-summary { font-size: 15px; line-height: 20px; letter-spacing: 0.14px; }
[data-theme="default"] .inbox-left { font-size: 13px; letter-spacing: 0.13px; font-weight: 500; }
[data-theme="default"] .inbox-group-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: -0.2px; }
[data-theme="default"] .inbox-count { font-size: 13px; letter-spacing: 0.13px; }
[data-theme="default"] .inbox-hint-copy { font-size: 15px; letter-spacing: 0.14px; }

/* ==========================================================================
   Share-link sandbox banner
   --------------------------------------------------------------------------
   Shown only to a visitor who arrived through a share link (auth/me → isDemo).
   They never signed up and did not choose this data, so the first thing above
   the header says whose it is — and offers the one thing the sandbox can't do.

   Amber rather than the accent green: this is an advisory about the state of
   the page, not a call to action, and green here would read as "all good".
   ========================================================================== */
.demo-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 14px;
  border: 1px solid var(--amber); border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
  font-size: 13.5px; color: var(--ink-2);
}
.demo-banner[hidden] { display: none; }
/* `header.page` is `position: sticky; top: 0` with `margin: -20px -20px 0` — the
   negative top margin cancels .wrap's padding so the sticky band starts flush
   with the viewport. With the banner above it, that same margin instead drags
   the opaque header (z-index 50) up over the banner's bottom border and clips
   it. When the banner is there, it is the thing occupying that space, so the
   header has nothing to reclaim. Scoped to the shown banner via :not([hidden]),
   so the normal layout is untouched for everyone else. */
.demo-banner:not([hidden]) + header.page { margin-top: 0; }
.demo-banner-text { flex: 1 1 12rem; min-width: 0; }
.demo-banner-cta {
  flex: 0 0 auto; font: inherit; font-size: 12.5px; font-weight: 550;
  padding: 6px 14px; min-height: 2rem;
  border: 1px solid var(--green); border-radius: var(--radius-pill);
  background: transparent; color: var(--green); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
@media (hover: hover) {
  .demo-banner-cta:hover { background: var(--green); color: var(--bg); }
}
.demo-banner-cta:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Recessive by design: dismissing is available, not advertised — the CTA next to
   it is the thing worth looking at. */
.demo-banner-close {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; margin-right: -4px;
  border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--ink-3); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
.demo-banner-close svg { width: 14px; height: 14px; }
@media (hover: hover) {
  .demo-banner-close:hover { background: var(--hover-surface); color: var(--ink); }
}
.demo-banner-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 600px) {
  /* On a phone the sentence takes the full width, then the CTA and the ✕ share
     the row below it — the button growing to fill whatever the 44px ✕ leaves,
     so both stay proper touch targets instead of a chip and a glyph squeezed
     alongside text they'd fight for space with. */
  .demo-banner { gap: 8px; padding: 10px 12px; font-size: 13px; }
  .demo-banner-text { flex-basis: 100%; }
  .demo-banner-cta { flex: 1 1 auto; min-height: 44px; font-size: 14px; }
  .demo-banner-close { width: 44px; height: 44px; margin-right: 0; }
  .demo-banner-close svg { width: 16px; height: 16px; }
}
