/* Lexi v2 — Dashboard shell
 * Section 13 design tokens. Dark-mode native. No light mode in v1. */

/* LEXI-149: Self-hosted fonts — Albert Sans + IBM Plex Mono */
@font-face { font-family:"Albert Sans"; font-weight:300; font-display:swap; src:url("/pwa/v2/fonts/albert-sans-300.woff2") format("woff2"); }
@font-face { font-family:"Albert Sans"; font-weight:400; font-display:swap; src:url("/pwa/v2/fonts/albert-sans-400.woff2") format("woff2"); }
@font-face { font-family:"Albert Sans"; font-weight:500; font-display:swap; src:url("/pwa/v2/fonts/albert-sans-500.woff2") format("woff2"); }
@font-face { font-family:"Albert Sans"; font-weight:600; font-display:swap; src:url("/pwa/v2/fonts/albert-sans-600.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-weight:400; font-display:swap; src:url("/pwa/v2/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-weight:500; font-display:swap; src:url("/pwa/v2/fonts/ibm-plex-mono-500.woff2") format("woff2"); }

/* LEXI-146: ONE global guard for the recurring `[hidden]`-defeated-by-`display`
 * gotcha. An author `display:flex/grid` at equal specificity beats the UA
 * `[hidden]{display:none}` rule, so a toggled element shipped permanently-visible
 * (8 prior recurrences: .alerts-card, .travel-card, .bc-expanded, …). This base
 * rule makes the `hidden` attribute authoritative regardless of any author
 * `display`. Safe: v2 JS toggles visibility via the `hidden` attribute, never via
 * inline `style.display`, so nothing needs to override this. The per-element
 * `.X[hidden]{display:none}` companions below are now redundant (kept, harmless). */
[hidden] { display: none !important; }

:root {
  --bg-phone:     #0E0E11;
  --bg-card:      #17171B;
  --bg-card-alt:  #1F1F25;

  /* 2026-07-28 Jason: gray-on-charcoal was hard to read on device — brightened
     secondary/muted (muted was ~3.5:1 on --bg-card, below AA). Hierarchy kept. */
  --text-primary:   #F4F4F6;
  --text-secondary: #C0C0CA;
  --text-muted:     #8E8E9A;
  --text-hint:      #6E6E78;
  --text-whisper:   #4A4A52;

  --signal-green: #5DCAA5;
  --signal-amber: #F0993B;
  --signal-red:   #E24B4A;

  /* Single cool accent for interactive/live states. Lexi blue —
   * muted enough to sit alongside the signal palette without fighting it. */
  --accent-cyan: #66B5FF;
  --accent-cyan-glow: rgba(102,181,255,0.16);

  /* Albert Sans — luxe-dark identity font. */
  --font-stack: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale — bumped to Android-native body size (16px) per on-device retest */
  --t-hero:     32px;
  --t-head:     20px;
  --t-body:     16px;
  --t-item:     15px;
  --t-meta:     13px;
  --t-section:  12px;

  /* Weights — iOS-emulation pass: 400 regular + 600 semibold.
   * Albert Sans renders 400 with good readability on OLED, so we don't need the
   * 600/700 bump that Roboto required. */
  --weight-regular: 400;
  --weight-heavy:   600;

  /* FAB geometry */
  --fab-size: 60px;
  --fab-right: 30px;
  --fab-bottom: 90px;

  /* LEXI-149 redesign — additive tokens */
  --ground:#0E0E11; --surface:#17171B; --surface-2:#1F1F25;
  --hairline:rgba(255,255,255,0.07); --hairline-2:rgba(255,255,255,0.04);
  /* 2026-07-28 Jason: brightened soft/mute (readability on device); whisper
     nudged to keep the hierarchy proportional. */
  --ink:#F4F4F6; --ink-soft:#C0C0CA; --ink-mute:#8E8E9A; --ink-whisper:#5C5C66;
  --acc:#66B5FF; --acc-bright:#A6D6FF; --acc-deep:#3D8AE6;
  --acc-glow:rgba(102,181,255,0.32); --acc-glow-soft:rgba(102,181,255,0.16); --acc-wash:rgba(102,181,255,0.07);
  --live:#5DCAA5; --live-glow:rgba(93,202,165,0.30);
  --wip:#66B5FF;  --wip-glow:rgba(102,181,255,0.30);
  --early:#E0A23A; --early-glow:rgba(224,162,58,0.30);
  --font-display:"Albert Sans", system-ui, sans-serif;
  --font-sans:"Albert Sans", system-ui, sans-serif;
  --font-mono:"IBM Plex Mono", ui-monospace, monospace;
  --r-sm:10px; --r-md:16px; --r-lg:20px; --r-pill:999px;
  --ease-out:cubic-bezier(0.22,1,0.36,1); --ease-soft:cubic-bezier(0.4,0,0.2,1); --spring:cubic-bezier(0.34,1.56,0.64,1);
  --dur-fast:140ms; --dur-med:260ms; --dur-slow:420ms; --breath:4.4s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg-phone);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-weight: var(--weight-regular);
  font-size: var(--t-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  overflow: hidden;
}

body {
  /* Sentence case always — no utility class forcing otherwise */
  text-transform: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view.hidden,
.hidden { display: none !important; }

/* ------------------------------------------------------------------ *
 * Deck — horizontally snapping panel scroller
 * ------------------------------------------------------------------ */

.deck {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.deck::-webkit-scrollbar { display: none; }

.panel {
  flex: 0 0 100vw;
  max-width: 100vw;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0) + 16px) 20px 0;
  overflow-y: auto;
  /* Hard guard: a panel must never grow wider than the viewport. Long
     unbreakable content (emails/URLs in calendar titles) was widening the
     panel and shifting every row's left edge off-screen. Clip horizontally
     so content wraps inside the panel instead of pushing the deck sideways. */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* LEXI-244: keep overscroll inside the panel — stops scroll-chaining to the
     deck and the browser's own native pull-to-refresh from hijacking our pull. */
  overscroll-behavior-y: contain;
}

/* LEXI-244: pull-to-refresh indicator (Projects panel). Flow child at the top
   of the .panel scroller; height is driven by --ptr during the drag. */
.ptr-indicator {
  flex: none;
  height: var(--ptr, 0px);
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.25s ease;
  pointer-events: none;
}
.ptr-indicator.ptr-dragging { transition: none; }
.ptr-indicator.ptr-refreshing { height: 44px; }
.ptr-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--hairline, rgba(255, 255, 255, 0.18));
  border-top-color: var(--accent, #4a9eff);
  opacity: 0.35;
  transition: opacity 0.15s ease;
}
.ptr-indicator.ptr-armed .ptr-spinner { opacity: 1; }
.ptr-indicator.ptr-refreshing .ptr-spinner { opacity: 1; animation: ptr-spin 0.7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* --- Lexi Mobile 1A: sub-panels stacked inside a single deck panel --- */
/* Workspace = Home + Activity; Projects = Projects + Select. The inner blocks
   are NOT scroll-snap children — only the 3 outer .panel wrappers are. */
.subpanel { display: flex; flex-direction: column; }
.subpanel + .subpanel { margin-top: 8px; }
/* Only the outer .panel-body needs FAB/dots bottom clearance; an inner body
   mid-panel would otherwise inject dead space before the next subpanel. */
.subpanel:not(:last-child) .panel-body { padding-bottom: 24px; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: var(--t-section);
  font-weight: var(--weight-heavy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-hint);
}

.panel-body {
  flex: 1 1 auto;
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 120px); /* clear FAB + dots */
}

/* Defensive: text anywhere in a panel wraps long unbreakable tokens
   (emails, URLs, IDs in calendar titles) rather than forcing the layout
   wider than the viewport. Pairs with .panel overflow-x: hidden. */
.panel-body * { overflow-wrap: anywhere; }

/* Empty-state copy — iOS Title 3 / Large Subhead feel.
 * 20px / weight 400 / tightened letter-spacing reads as a clean display line
 * rather than a marketing headline. When real content lands (Wave 2), these
 * are replaced and body drops to var(--t-body). */
.empty-lexi {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: var(--weight-regular);
  line-height: 1.4;
  max-width: 34ch;
  margin-top: 18vh;
  letter-spacing: -0.01em;
}
/* Defensive: ensure HTML hidden attribute always wins. .empty-lexi never sets
 * display itself, but enforcing this guards against accidental future overrides
 * (and matches the pattern Wave 5 had to add for .alerts-card[hidden]). */
.empty-lexi[hidden] { display: none !important; }
/* Activity-panel variant: lives alongside the Today card as a fallback when
 * no events are logged today. Doesn't need the 18vh "centerpiece" margin. */
.empty-lexi.activity-empty { margin-top: 24px; }

/* ------------------------------------------------------------------ *
 * Dot indicator — visual 6px, hit target 44px via transparent padding
 * ------------------------------------------------------------------ */

.dots {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
  display: flex;
  justify-content: center;
  gap: 0;
  pointer-events: none;
  z-index: 10;
}

.dot {
  width: 44px;
  height: 44px;
  padding: 19px; /* (44 - 6) / 2 */
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.dot::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-whisper);
  transition: background-color 150ms ease, transform 150ms ease;
}

.dot[aria-current="true"]::before {
  background: var(--text-primary);
  transform: scale(1.15);
}

/* Hide dots while a workshop session is open — panel swipes don't belong
 * in a drilled-down session. */
body.workshop-session-open .dots { display: none; }

/* ------------------------------------------------------------------ *
 * Error region (used by pair flow and unhandled errors)
 * ------------------------------------------------------------------ */

#error-region {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 12px);
  left: 16px;
  right: 16px;
  z-index: 30;
  pointer-events: none;
}

#error-region .toast {
  background: var(--bg-card);
  color: var(--signal-red);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: var(--t-meta);
  margin-bottom: 8px;
  pointer-events: auto;
}

/* ------------------------------------------------------------------ *
 * Wave 2 — Home panel
 * ------------------------------------------------------------------ */

.home-content { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; }
/* LEXI-338 follow-up (Jason device check 2026-07-28): an EMPTY pending-card
   mount still contributes a 24px flex gap — adding the heal mount made the
   idle Workspace top spacing jump 24px → 48px. Empty mounts take zero space;
   they pop in only when a pending card actually renders. */
.confirm-cards-mount:empty,
.heal-cards-mount:empty,
.plaud-route-mount:empty { display: none; }

.headline-soj {
  font-size: var(--t-head);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 34ch;
}

.icon-btn {
  background: transparent; border: 0;
  color: var(--text-muted);
  font-size: 16px; cursor: pointer;
  padding: 6px 10px;
  -webkit-tap-highlight-color: transparent;
}

.section-subhead {
  font-size: var(--t-section);
  font-weight: var(--weight-heavy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-hint);
  margin-bottom: 8px;
}

.card { background: var(--bg-card); border: 1px solid #2c2c2c; border-radius: 12px; padding: 14px; }

.task-pills { display: flex; gap: 10px; }

.pill {
  background: var(--bg-card-alt);
  padding: 10px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-meta);
  color: var(--text-primary);
  border: 0;
  cursor: default;
  font-family: var(--font-stack);
  -webkit-tap-highlight-color: transparent;
}
.pill .pill-count { font-size: var(--t-item); font-weight: var(--weight-heavy); }
.pill .pill-label { color: var(--text-secondary); }
.pill.pill-zero              { color: var(--text-muted); }
.pill.pill-zero .pill-count  { color: var(--text-muted); }
button.pill { cursor: pointer; }

/* ------------------------------------------------------------------ *
 * Wave 2 — Projects panel
 * ------------------------------------------------------------------ */

.projects-content { display: flex; flex-direction: column; gap: 24px; margin-top: 16px; }

.proj-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-row {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.02);
  transition: box-shadow var(--dur-med) var(--ease-soft), border-color var(--dur-med) var(--ease-soft);
}
.proj-row:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
.proj-row.has-progress {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.proj-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.proj-row .proj-name { flex: 1 1 auto; font-family: var(--font-display); font-weight: 500; font-size: var(--t-item); color: var(--ink); letter-spacing: -0.01em; }
.proj-row .proj-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); white-space: nowrap; letter-spacing: 0.02em; }

.proj-progress-track {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.proj-progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width 900ms var(--ease-out);
}
.proj-progress-fill.live  { background: linear-gradient(90deg, var(--live-glow), var(--live));   box-shadow: 0 0 10px var(--live-glow); }
.proj-progress-fill.wip   { background: linear-gradient(90deg, var(--wip-glow), var(--wip));     box-shadow: 0 0 10px var(--wip-glow); }
.proj-progress-fill.early { background: linear-gradient(90deg, var(--early-glow), var(--early)); box-shadow: 0 0 10px var(--early-glow); }

.proj-empty {
  list-style: none;
  color: var(--text-muted);
  font-size: var(--t-body);
  padding: 12px 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.pulse-dot.live  { background: var(--live);  box-shadow: 0 0 8px var(--live-glow); }
.pulse-dot.wip   { background: var(--wip);   box-shadow: 0 0 8px var(--wip-glow); }
.pulse-dot.early { background: var(--early); box-shadow: 0 0 8px var(--early-glow); }
.dot-hidden { display: none; }

/* ------------------------------------------------------------------ *
 * Wave 2 — Select panel
 * ------------------------------------------------------------------ */

.select-content { display: flex; flex-direction: column; gap: 24px; margin-top: 16px; }

.pipeline-hero { display: flex; flex-direction: column; gap: 4px; }
.pipeline-hero .hero-number {
  font-size: var(--t-hero);
  font-weight: var(--weight-regular);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.pipeline-hero .hero-sub { font-size: var(--t-meta); color: var(--text-muted); }

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .metric-count { font-size: var(--t-item); color: var(--text-primary); }
.metric .metric-value { font-size: var(--t-meta); color: var(--text-muted); }

.pill.pill-red {
  background: rgba(226, 75, 74, 0.18);
  color: var(--signal-red);
}
.pill.pill-red .pill-count { color: var(--signal-red); }
.pill.pill-red .pill-label { color: var(--signal-red); opacity: 0.85; }

/* ------------------------------------------------------------------ *
 * Wave 2 — Skeleton shimmer (shown only after 150ms load threshold, Section 11)
 * ------------------------------------------------------------------ */

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.panel-body.skeleton-on .home-content,
.panel-body.skeleton-on .projects-content,
.panel-body.skeleton-on .select-content,
.panel-body.skeleton-on .empty-lexi {
  display: none;
}

.panel-body.skeleton-on::before,
.panel-body.skeleton-on::after {
  content: "";
  display: block;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-alt) 50%, var(--bg-card) 75%);
  background-size: 200px 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  animation: shimmer 1.4s infinite linear;
}
.panel-body.skeleton-on::before { height: 28px; width: 70%; margin-top: 20px; }
.panel-body.skeleton-on::after  { height: 80px; width: 100%; }

/* ------------------------------------------------------------------ *
 * Wave 3 — Workshop panel (list + session view)
 * ------------------------------------------------------------------ */

.workshop-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 12px;
}

/* NASA-vibe start button — dark card with a thin accent border, a live
 * indicator dot, the label, and a thin-stroke mic icon on the right. No
 * green fill, no emoji. Reads as "arm a new session" not "tap the cartoon". */
.workshop-start {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--t-body);
  font-weight: var(--weight-regular);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-stack);
  letter-spacing: 0.01em;
  transition: background-color 150ms ease;
}
.workshop-start:active { background: var(--accent-cyan-glow); }
.workshop-start-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  flex: 0 0 auto;
}
.workshop-start-label { flex: 1 1 auto; }
.workshop-start-mic {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex: 0 0 auto;
}

.workshop-recent { display: flex; flex-direction: column; gap: 8px; }
.workshop-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workshop-recent-item {
  background: var(--bg-card-alt);
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}
.workshop-recent-title { font-size: var(--t-item); color: var(--text-primary); }
.workshop-recent-meta  { font-size: var(--t-meta); color: var(--text-muted); margin-top: 4px; }

/* Session view ----------------------------------------------------- */

.workshop-session {
  /* CSS Grid — transcript gets 1fr (fills), composer gets auto (natural).
   * Bulletproof vs flex+margin-auto for the pin-to-bottom + scroll behavior;
   * the transcript's scroll container is unambiguous and new messages always
   * land above the composer regardless of how short or long the transcript is. */
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

/* In-session layout: pin header, zero FAB-clearance padding, flex panel-body
 * so workshop-session fills remaining space and transcript scrolls inside it. */
body.workshop-session-open .panel[data-deck-panel="talk"] > .panel-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-phone);
  margin-bottom: 12px;
  padding: 4px 0 8px;
}
body.workshop-session-open .panel[data-deck-panel="talk"] > .panel-body {
  padding-bottom: env(safe-area-inset-bottom, 0);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.workshop-transcript {
  /* Grid parent sizes this to 1fr; min-height:0 lets it actually shrink
   * (without it the grid row ignores the transcript's overflow and lets
   * content escape into the panel's scroll container). */
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  overscroll-behavior: contain;
  position: relative; /* positioning context for the press-to-reveal action popover */
}

/* Pin content to the bottom so new messages always land above the composer.
 * margin-top:auto on the first bubble absorbs free space above when the
 * transcript is taller than its content; when content overflows, auto
 * resolves to 0 and normal scroll takes over. */
.workshop-transcript > :first-child { margin-top: auto; }

/* Hierarchy: LEXI-184 — you = right solid, Lexi = left blue-edge.
 * ws-river is a flex column; align-self drives bubble alignment. */
.ws-turn {
  margin: 0 0 20px;
  max-width: 88%;
  position: relative;
  line-height: 1.45;
}
.ws-me {
  align-self: flex-end;
  background: #202028;
  color: #dcdce2;
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 18px 18px 6px 18px;
  text-align: left;
}
/* LEXI-270 — ephemeral "Capturing…" placeholder while a share ingests. Reads as
   in-flight (dimmed + a slow pulse); removed when the real capture card lands. */
.ws-share-pending { opacity: 0.6; animation: ws-share-pulse 1.4s ease-in-out infinite; }
@keyframes ws-share-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.75; } }
/* LEXI-181 — command chip: a compact right-aligned pill that replaces the verbose
 * skill prompt in the user position (Workspace river + ephemeral Talk stream). */
.cmd-chip {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: 84%;
  padding: 5px 12px;
  background: var(--surface);
  border-left: 2px solid var(--acc);
  border-radius: var(--r-pill, 999px);
  color: var(--acc);
  font-size: var(--t-meta, 13px);
  font-weight: var(--weight-medium, 500);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* In the Talk stream the chip is an inline <span>; right-align it on its own line. */
.talk-live-block .tl-mine.cmd-chip {
  display: inline-flex;
  margin-left: auto;
}

.ws-lexi {
  align-self: flex-start;
  position: relative; /* popover + ⋯ button anchor — do not remove */
  background: linear-gradient(180deg, rgba(102,181,255,.10), rgba(102,181,255,.02));
  border: 1px solid rgba(102,181,255,.14);
  border-left: 2px solid var(--acc);
  border-radius: 6px 16px 16px 16px;
  color: #dfe3ea;
  max-width: 90%;
  padding: 12px 15px;
}

/* Modality stripe belongs on Lexi's bubble (where the card is) — skip it
 * on the user whisper. */
.ws-lexi.ws-modality-ptt          { border-left: 2px solid var(--acc); }
.ws-lexi.ws-modality-conversation { border-left: 2px solid var(--acc); }

/* LEXI-179 — warm greeting header + gear (replaces LEXI-149 search-bar + avatar) */
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 0; margin-bottom: 0; }
/* LEXI-184 — trim the gap ABOVE the greeting banner (Workspace only; keeps notch clearance) */
.panel[data-deck-panel="workspace"] { padding-top: calc(env(safe-area-inset-top, 0) + 8px); }
.ws-greet-hi { font-size: 18px; font-weight: 600; color: var(--ink, #E8E8EC); }
.ws-greet-date { font-size: 12.5px; color: var(--ink-mute, #7a7a83); margin-top: 3px; }
.ws-gear { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--ink-mute, #7f7f88); cursor: pointer; flex: none; }
.ws-gear:active { transform: scale(0.92); }
.ws-gear svg { width: 21px; height: 21px; }

.ws-turn-text { font-size: 14.5px; line-height: 1.58; }
/* LEXI-184 — Lexi's replies read a touch larger than your own messages */
.ws-lexi .ws-turn-text { font-size: 16px; line-height: 1.6; }
.ws-turn-text.bubble-rich p { margin: 0 0 8px; }
.ws-turn-text.bubble-rich p:last-child { margin-bottom: 0; }
.ws-turn-text.bubble-rich code {
  background: var(--bg-phone);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

/* LEXI-184 — refined inline links inside Lexi's bubble (no raw blue underline) */
.bubble-rich a { color: var(--acc); text-decoration: none; font-weight: 500; }
.bubble-rich a:active { opacity: .7; }

/* a link that is the sole content of its paragraph = an action pill */
.bubble-rich p > a:only-child {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  background: rgba(102,181,255,.12); border: 1px solid rgba(102,181,255,.30);
  color: #9fd0ff; font-size: 13px; font-weight: 600; padding: 7px 13px;
  border-radius: 999px; text-decoration: none;
}
.bubble-rich p > a:only-child::before { content: "↗"; font-weight: 700; }


.workshop-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-card-alt);
  padding: 8px;
  border-radius: 14px;
}
.workshop-input {
  flex: 1 1 auto;
  min-height: 40px;
  max-height: 140px;
  resize: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid transparent;
  outline: none;
  font: inherit;
  line-height: 1.4;
}
.workshop-input:focus { border-color: var(--text-hint); }

.workshop-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text-primary);
  color: var(--bg-phone);
}

/* Workshop header wrap button — sits top-right in the panel-head next to Back.
 * icon-btn is the base; workshop-wrap adds a pill border + accent color. */
.workshop-wrap {
  color: var(--signal-amber);
  border: 1px solid var(--signal-amber);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: var(--t-meta);
  font-weight: var(--weight-heavy);
  background: transparent;
}
.workshop-wrap:disabled { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------------ *
 * Wave 3 — Session action sheet (long-press on workshop-recent-item)
 * ------------------------------------------------------------------ */

.session-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  animation: sheet-fade-in 150ms ease-out;
}
@keyframes sheet-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.session-sheet-card {
  background: var(--bg-card);
  width: 100%;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 14px 14px calc(env(safe-area-inset-bottom, 0) + 14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-sheet-title {
  font-size: var(--t-meta);
  color: var(--text-muted);
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--bg-card-alt);
  margin-bottom: 4px;
}
.session-sheet-btn {
  background: var(--bg-card-alt);
  color: var(--text-primary);
  border: 0;
  border-radius: 10px;
  padding: 14px;
  font-size: var(--t-body);
  font-family: var(--font-stack);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.session-sheet-btn:active { background: rgba(255, 255, 255, 0.05); }
.session-sheet-danger { color: var(--signal-red); }
.session-sheet-cancel {
  background: transparent;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

/* Wave 3.5 — session header rename */
.workshop-rename-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  margin-left: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.workshop-rename-btn svg { width: 14px; height: 14px; }
.workshop-rename-btn:hover { color: var(--accent-cyan, #7ae5ff); }
.workshop-title-input {
  background: transparent;
  border: 1px solid var(--accent-cyan, #7ae5ff);
  border-radius: 4px;
  color: inherit;
  font: inherit;
  padding: 2px 6px;
  min-width: 220px;
  max-width: 100%;
}
.workshop-title-input:focus { outline: none; }

/* Wave 3.5 — stale-then-skeleton on session load */
.workshop-session.is-stale .ws-turn {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}
.workshop-transcript.skeleton-on {
  position: relative;
  min-height: 180px;
}
.workshop-transcript.skeleton-on .ws-turn {
  display: none;  /* hide real bubbles while skeleton is on */
}
.workshop-transcript.skeleton-on::before,
.workshop-transcript.skeleton-on::after {
  content: "";
  display: block;
  margin: 14px 0;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 200% 100%;
  animation: workshop-shimmer 1.2s linear infinite;
}
.workshop-transcript.skeleton-on::before { width: 72%; }
.workshop-transcript.skeleton-on::after  { width: 55%; margin-left: auto; }
@keyframes workshop-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Wave 4 — select-mode */
.workshop-recent-item .ws-row-check { display: none; }
body.select-mode .workshop-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 10px;
}
body.select-mode .workshop-recent-item .ws-row-check {
  display: grid;
  place-items: center;
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 50%;
  border: 2px solid #3a3a3a;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
}
body.select-mode .workshop-recent-item.is-selected .ws-row-check {
  background: var(--accent-cyan, #5ec2d4);
  border-color: var(--accent-cyan, #5ec2d4);
  color: #0b0d10;
}
body.select-mode .workshop-recent-item.is-selected {
  background: #1a2530;
}
body.select-mode {
  /* Suppress horizontal deck-nav swipes while selecting */
  touch-action: pan-y;
}
body.select-mode #deck { touch-action: pan-y; }

.workshop-select-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card-alt);
  border-top: 1px solid #2c2c2c;
  z-index: 5;
}
.workshop-select-footer[hidden] { display: none; }
.workshop-select-count { font-size: 13px; color: var(--text-primary); flex: 1 1 auto; }
.workshop-footer-btn {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #2c2c2c;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}
.workshop-footer-danger {
  color: #ff6b6b;
  border-color: #4a2a2a;
  background: #2a1818;
}
.workshop-footer-cancel { color: var(--text-muted); }

/* ── C1: Segmented pill (All / Archived) ───────────────────────── */
.workshop-segmented {
  display: flex;
  gap: 2px;
  padding: 4px;
  margin: 0 0 14px;
  background: var(--bg-card-alt);
  border-radius: 10px;
}
.workshop-segmented button {
  flex: 1 1 0;
  padding: 8px 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.workshop-segmented button.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ── C2: Pull-down search bar ──────────────────────────────────── */
.workshop-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 10px;
  background: var(--bg-card-alt);
  border-radius: 10px;
  border: 1px solid #2c2c2c;
  animation: workshop-search-slide 160ms ease-out;
}
.workshop-search[hidden] { display: none; }
.workshop-search input {
  flex: 1 1 auto;
  background: transparent;
  color: var(--text-primary);
  border: 0;
  outline: 0;
  font-size: 15px;
}
.workshop-search input::placeholder { color: var(--text-muted); }
.workshop-search button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
}
@keyframes workshop-search-slide {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ------------------------------------------------------------------ */
/* Typing bubble — D1 
/* ------------------------------------------------------------------ */
.lexi-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  margin: 4px 0;
  background: var(--bg-card-alt);
  border-radius: 18px;
  width: fit-content;
}
.lexi-typing-bubble span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
  animation: lexi-thinking-dots 1.2s infinite ease-in-out;
}
.lexi-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.lexi-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lexi-thinking-dots {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-2px); }
}

/* Activity home card — D3
/* ------------------------------------------------------------------ */
.home-card {
  background: var(--bg-card);
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 14px;
}
.home-card .home-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
}
.home-card h3 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan, #5ec2d4);
  margin: 0;
  font-weight: 600;
}
.home-card .card-meta { font-size: 12px; color: var(--text-muted); }
.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.activity-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
}
.activity-item .time {
  flex: 0 0 44px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.activity-item .text { flex: 1 1 auto; }
.activity-expand {
  margin-top: 10px;
  background: transparent;
  border: 0;
  color: var(--accent-cyan, #5ec2d4);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

/* === Wave 5 — alerts card ============================================ */
.alerts-card[hidden],
.alerts-row[hidden] { display: none; }
.alerts-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.alerts-card-icon { width: 28px; height: 28px; flex: 0 0 auto; color: var(--accent-cyan, #4ad); }
.alerts-card-icon svg { width: 100%; height: 100%; }
.alerts-card-body { flex: 1; min-width: 0; }
.alerts-card-title { font-weight: 600; margin-bottom: 2px; }
.alerts-card-copy { font-size: 13px; opacity: 0.78; line-height: 1.4; }
.alerts-card-cta {
  flex: 0 0 auto;
  background: var(--accent-cyan, #4ad);
  color: #000;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.alerts-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  font-size: 14px;
}
.alerts-row-status { opacity: 0.78; }
.alerts-row-manage {
  background: transparent; border: 1px solid currentColor; opacity: 0.78;
  border-radius: 6px; padding: 4px 12px; cursor: pointer;
}

/* === Wave 5 — manage sheet =========================================== */
.manage-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000;
}
.manage-sheet[hidden], .manage-sheet-backdrop[hidden] { display: none; }
.manage-sheet {
  width: 100%; max-width: 560px;
  background: var(--bg, #1a1a1a);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  padding: 16px 16px max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
}
.manage-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.manage-sheet-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.manage-sheet-close {
  background: transparent; border: 0; font-size: 24px; line-height: 1;
  color: inherit; cursor: pointer; padding: 0 8px;
}
.manage-sheet-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.manage-sheet-row input[type=checkbox] {
  width: 22px; height: 22px;
}
.manage-sheet-note {
  font-size: 12px; opacity: 0.6; margin: 14px 0 16px;
  line-height: 1.4;
}
.manage-sheet-off {
  width: 100%;
  background: transparent;
  color: #f44;
  border: 1px solid #f44;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* === Wave 5 — cutover toast ========================================== */
.cutover-toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%) translateY(40px);
  background: var(--accent-cyan, #4ad);
  color: #000;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
  pointer-events: none;
}
.cutover-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------------ *
 * LEXI-003 — Agenda, Spend, Travel cards
 * ------------------------------------------------------------------ */

/* Agenda card */
.agenda-card { display: flex; flex-direction: column; gap: 6px; }
.agenda-sub {
  font-size: var(--t-section);
  font-weight: var(--weight-heavy);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-hint);
  margin-top: 8px;
}
.agenda-sub-first { margin-top: 0; }
.agenda-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
}
.agenda-time {
  flex: 0 0 auto;
  font-size: var(--t-meta);
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
}
.agenda-title {
  flex: 1 1 auto;
  min-width: 0;               /* allow the flex item to shrink below content width */
  overflow-wrap: anywhere;    /* break long unbreakable tokens (emails/URLs) */
  font-size: var(--t-item);
  color: var(--text-primary);
}
.agenda-empty {
  font-size: var(--t-body);
  color: var(--text-secondary);
}

/* Spend card */
.spend-card { display: flex; flex-direction: column; gap: 8px; }
.spend-line {
  font-size: var(--t-item);
  color: var(--text-primary);
}
.cap-bar {
  height: 6px;
  background: var(--bg-card-alt);
  border-radius: 4px;
  overflow: hidden;
}
.cap-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 300ms ease;
}
.cap-green { background: #3fb950; }
.cap-amber { background: #d29922; }
.cap-red   { background: #f85149; }
.cap-label {
  font-size: var(--t-meta);
  color: var(--text-muted);
}

/* Travel card */
.travel-card { display: flex; flex-direction: column; gap: 6px; }
.travel-card[hidden] { display: none; }
.travel-head { margin-bottom: 2px; }
.travel-dest { font-size: var(--t-item); color: var(--text-primary); }
.travel-flight {
  font-size: var(--t-meta);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Phase 1 v2 — live interim transcript bubble. */
.ws-turn.ws-interim {
  opacity: 0.55;
  font-style: italic;
}
.ws-turn.ws-interim .ws-turn-text::after {
  content: "…";
  margin-left: 4px;
  opacity: 0.7;
}

/* LEXI-148: the audio-quality-poor inline panel was retired with ephemeral Talk
 * (the dock's text affordance is the safety valve). Styles removed with the JS. */

/* Stale-while-revalidate: a thin top progress line while the last (cached)
   view is shown and fresh data is still loading in the background. The old
   view stays fully visible + interactive — this just signals "updating". */
body.data-refreshing::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9999;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent-cyan) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: lexi-refresh-sweep 1.1s ease-in-out infinite;
}
@keyframes lexi-refresh-sweep {
  0%   { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* Inbox / News card (LEXI-118) */
.inbox-card { display: flex; flex-direction: column; gap: 6px; }
.inbox-email { font-size: var(--t-item); color: var(--text-primary); }
.inbox-news-head { font-size: var(--t-meta); color: var(--text-hint); margin-top: 4px; }
.inbox-news-row { font-size: var(--t-item); line-height: 1.35; }
.inbox-news-src { color: var(--text-muted); }
.inbox-news-title { color: var(--accent-cyan); text-decoration: none; }

/* Tappable task pills — drill-in detail (LEXI-118) */
.task-pills .pill { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.task-detail { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 6px; }
.task-detail-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: var(--t-item); color: var(--text-primary);
}
.task-detail-title { flex: 1 1 auto; min-width: 0; }
.task-detail-meta { flex: 0 0 auto; font-size: var(--t-meta); color: var(--text-muted); }
.task-detail-row.task-overdue .task-detail-meta { color: var(--signal-red); }
.task-detail-empty { font-size: var(--t-meta); color: var(--text-hint); }

/* ------------------------------------------------------------------ *
 * Lexi Mobile 1B — persistent session dock
 * ------------------------------------------------------------------ */
.session-dock {
  position: fixed; left: 8px; right: 8px;
  bottom: calc(env(safe-area-inset-bottom, 0) + 56px);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 18px; padding: 8px 11px;
  z-index: 11;
}
.session-dock[hidden] { display: none; }

.dock-orb {
  width: 34px; height: 34px; border-radius: 50%; flex: none; border: 0;
  background: var(--text-primary); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; transition: transform 120ms ease;
}
.dock-orb:active { transform: scale(0.94); }
.dock-orb[data-voice-state="idle"] { }
.dock-orb[data-voice-state="listening"] {
  box-shadow: 0 0 0 3px var(--accent-cyan),
              0 0 calc(8px + 24px * var(--fab-pulse-intensity, 0.0)) var(--accent-cyan-glow);
  animation: dock-pulse-listening 1.2s ease-in-out infinite;
  filter: brightness(calc(0.85 + 0.45 * var(--fab-pulse-intensity, 0.0)));
}
.dock-orb[data-voice-state="thinking"] {
  box-shadow: 0 0 0 3px var(--signal-amber, #d8a04a);
  animation: dock-pulse-thinking 2.0s ease-in-out infinite;
}
.dock-orb[data-voice-state="speaking"] {
  box-shadow: 0 0 0 3px var(--accent-cyan), 0 0 24px var(--accent-cyan-glow);
  animation: dock-pulse-speaking 0.9s ease-in-out infinite; filter: brightness(1.15);
}
.dock-orb[data-voice-state="muted"],
.dock-orb[data-voice-state="paused"] { box-shadow: 0 0 0 2px rgba(255,255,255,0.35); filter: brightness(0.6) saturate(0.4); }
.dock-orb[data-voice-state="disconnected"] { box-shadow: 0 0 0 3px rgba(255,80,80,0.7); }
@keyframes dock-pulse-listening { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
@keyframes dock-pulse-thinking  { 0%,100%{transform:scale(1);filter:brightness(1.0)} 50%{transform:scale(1.02);filter:brightness(1.15)} }
@keyframes dock-pulse-speaking  { 0%,100%{filter:brightness(1.0)} 50%{filter:brightness(1.4)} }

.dock-line { flex: 1; font-size: var(--t-meta); color: var(--text-hint); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.dock-btn { background: none; border: 1px solid var(--hairline); border-radius: 8px; color: var(--text-primary); font-size: 14px; padding: 5px 8px; cursor: pointer; }
.dock-end { color: #ff9b9b; border-color: #5a2b2b; }
.dock-composer { flex: 1; display: flex; gap: 8px; align-items: flex-end; }
.dock-composer[hidden] { display: none; }
/* LEXI-182 — text field reads as the SAME bar component: Lexi-blue identity kept
   on focus (no UA yellow ring, no chrome dissipation), radius matched to the
   bar's rounded pill chrome so the composer sits in the idle bar's frame. */
/* LEXI-182 — size the field to match the orb/+ /send, which are all 44px circles
   (lines ~1373/1406/1400). A 36px field read as stunted between them; a 44px floor
   makes all four elements equal height, and a 22px radius gives a full pill to echo
   the round +/orb. 16px font fills the taller field. */
.dock-input { flex: 1; resize: none; max-height: 120px; min-height: 44px; box-sizing: border-box; background: var(--ground); border: 1px solid var(--hairline); border-radius: 22px; color: var(--text-primary); padding: 10px 16px; font: inherit; font-size: 16px; line-height: 1.3; }
.dock-input:focus { outline: none; border-color: var(--acc); }
.dock-send { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--acc); color: var(--ground); display: grid; place-items: center; font-size: 15px;
  transition: transform var(--dur-fast) var(--ease-out); }
.dock-send[hidden] { display: none; }
.dock-send:active { transform: scale(0.92); }
.dock-reply { position: fixed; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0) + 112px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 10px 12px; color: var(--text-primary); font-size: var(--t-body); z-index: 11; }
.dock-reply[hidden] { display: none; }
.dock-reply p { margin: 0 0 8px; }
.dock-reply p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ *
 * LEXI-177 — interaction bar redesign (Phase A: orb + voice bar)
 * ------------------------------------------------------------------ */

/* hat row (idle only) */
.dock-hatrow { position: fixed; left: 14px; right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0) + 56px + 64px); /* above the dock */
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 11; }
.dock-hatrow[hidden] { display: none; }
.dock-hatchip { position: relative; display: inline-flex; align-items: center; gap: 7px; background: var(--surface);
  border: 1px solid rgba(255,255,255,.09); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
/* LEXI-177 C2 — active-hat count pill, top-right of the chip; red when overdue */
.dock-hatbadge {
  position: absolute; top: -7px; right: -6px;
  min-width: 17px; height: 17px; padding: 0 5px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; line-height: 1; color: #fff;
  background: var(--acc, #66B5FF); border-radius: 999px;
  border: 1.5px solid var(--bg, #141418);
}
.dock-hatbadge.overdue { background: var(--danger, #E24B4A); }
.dock-hatbadge[hidden] { display: none; }
.dock-hatmenu-count {
  min-width: 18px; height: 18px; padding: 0 6px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; line-height: 1; color: var(--ink-soft, #cfcfcf);
  background: rgba(255,255,255,.08); border-radius: 999px;
}
.dock-hatmenu-count.overdue { background: rgba(226,75,74,.22); color: #f2a6a5; }
.dock-hatmenu-count[hidden] { display: none; }
.dock-hatchip svg { width: 12px; height: 12px; color: var(--ink-mute); }
.dock-hatdot { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); }
.dock-hatname { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
/* (.dock-ptthint removed — PTT hint deferred with the gesture) */

/* hat picker dropdown (LEXI-177 — UI forward; routing bias lands in Phase C) */
.dock-hatmenu-backdrop { position: fixed; inset: 0; z-index: 12; }
.dock-hatmenu-backdrop[hidden] { display: none; }
.dock-hatmenu { position: fixed; left: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0) + 56px + 64px + 44px); /* above the hat chip */
  width: 212px; z-index: 13; background: #1D1D22; border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; box-shadow: 0 14px 36px rgba(0,0,0,.55); padding: 7px;
  animation: dock-hatpop .16s ease-out; transform-origin: bottom left; }
.dock-hatmenu[hidden] { display: none; }
@keyframes dock-hatpop { from{opacity:0;transform:scale(.92)} to{opacity:1;transform:scale(1)} }
.dock-hatmenu-h { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; padding: 6px 10px 8px; }
.dock-hatmenu-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.dock-hatmenu-row:hover { background: rgba(255,255,255,.04); }
.dock-hatmenu-row .hd { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dock-hatmenu-row .nm { flex: 1; font-size: 14px; color: var(--ink); }
.dock-hatmenu-row .ck { width: 15px; height: 15px; color: var(--acc); }
.dock-hatmenu-row .ck[hidden] { display: none; }

/* bar is bottom-anchored so a growing composer pins the buttons to the bottom */
.session-dock { align-items: flex-end; gap: 9px; border-radius: 24px; padding: 6px; }

/* round buttons (44px) */
.dock-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; padding: 0; background: var(--surface-2);
  border: 1px solid var(--hairline); color: #9bb9d6; cursor: pointer; }
.dock-btn[hidden] { display: none; }
.dock-btn svg { width: 21px; height: 21px; }
.dock-end { background: rgba(226,75,74,.16); border-color: rgba(226,75,74,.5); color: var(--signal-red); }
.dock-mic { background: transparent; border: 1.5px solid rgba(255,255,255,.22); color: var(--ink); } /* clean outline */
.dock-mic[aria-pressed="true"] { background: rgba(240,153,59,.14); border-color: rgba(240,153,59,.45); color: var(--signal-amber); }
/* LEXI-279: force-endpoint Send — accent fill so "Send" reads consistently with the text-composer send */
.dock-voice-send { background: var(--acc); border-color: transparent; color: #06121f; }
.dock-voice-send:active { transform: scale(0.92); }

/* idle line */
.dock-line { flex: 1; font-size: var(--t-meta); color: var(--text-hint); font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; align-self: center; }

/* voice status + waveform (middle, active) */
.dock-status { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 6px; min-width: 0; align-self: center; }
.dock-status[hidden] { display: none; }
.dock-status-txt { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-wave { display: inline-flex; align-items: center; gap: 2.5px; height: 22px; flex: none; }
.dock-wave[hidden] { display: none; }
.dock-wave > span { width: 2.6px; height: 18px; border-radius: 1.4px; background: var(--acc);
  transform-origin: center; animation: dock-wave 1s ease-in-out infinite; }
.dock-wave > span:nth-child(2){animation-delay:.1s}.dock-wave > span:nth-child(3){animation-delay:.2s}
.dock-wave > span:nth-child(4){animation-delay:.3s}.dock-wave > span:nth-child(5){animation-delay:.15s}
.dock-wave > span:nth-child(6){animation-delay:.25s}.dock-wave > span:nth-child(7){animation-delay:.35s}
.dock-wave > span:nth-child(8){animation-delay:.05s}.dock-wave > span:nth-child(9){animation-delay:.22s}
.dock-wave > span:nth-child(10){animation-delay:.32s}
@keyframes dock-wave { 0%,100%{transform:scaleY(.3)} 50%{transform:scaleY(1)} }

/* composer send icon button (override the old text glyph) */
.dock-send { width: 44px; height: 44px; border-radius: 50%; background: var(--acc); color: #06121f; }
.dock-send svg { width: 20px; height: 20px; }

/* hybrid orb — identity sphere + equalizer overlay */
.dock-orb { width: 44px; height: 44px; border-radius: 50%; flex: none; border: 0; position: relative;
  display: flex; align-items: center; justify-content: center; cursor: pointer; touch-action: none;
  -webkit-tap-highlight-color: transparent;
  /* LEXI-177 orb D — light/airy orb, deep-blue equalizer bars cut into it */
  background: radial-gradient(circle at 40% 34%, #C7E4FF, #8FC6FA 60%, #66B5FF 100%); }
.dock-orb-eq { display: none; align-items: center; gap: 2.2px; }
.dock-orb-eq > span { width: 2.4px; border-radius: 1.2px; background: #1F5FAE; display: block;
  transform-origin: center; animation: dock-wave 1s ease-in-out infinite; }
.dock-orb-eq > span:nth-child(1){height:6px}.dock-orb-eq > span:nth-child(2){height:11px;animation-delay:.12s}
.dock-orb-eq > span:nth-child(3){height:16px;animation-delay:.24s}.dock-orb-eq > span:nth-child(4){height:11px;animation-delay:.36s}
.dock-orb-eq > span:nth-child(5){height:6px;animation-delay:.48s}

/* state cues */
.dock-orb[data-voice-state="idle"] { box-shadow: 0 0 0 3px var(--acc-glow-soft), 0 0 18px var(--acc-glow-soft);
  animation: dock-breath 4.4s ease-in-out infinite; }
@keyframes dock-breath { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
.dock-orb[data-voice-state="listening"] { box-shadow: 0 0 0 3px var(--acc),
  0 0 calc(18px + 16px * var(--fab-pulse-intensity, 0)) var(--acc-glow);
  animation: none; filter: none; }
/* LEXI-585: a FIXED glow while she speaks — no --fab-pulse-intensity. The mic
   level is his voice; it must not move the orb during her turn (those frames are
   never sent), or talking over her looks heard. Tap is the only interrupt. */
.dock-orb[data-voice-state="speaking"] { box-shadow: 0 0 0 3px var(--acc), 0 0 26px var(--acc-glow); }
.dock-orb[data-voice-state="idle"] .dock-orb-eq,
.dock-orb[data-voice-state="listening"] .dock-orb-eq,
.dock-orb[data-voice-state="speaking"] .dock-orb-eq,
.dock-orb[data-voice-state="muted"] .dock-orb-eq { display: flex; }
/* idle wears the same equalizer glyph as the active states, but STATIC — a
   resting voice avatar, not a "listening" one (only active states animate). */
.dock-orb[data-voice-state="idle"] .dock-orb-eq > span { animation: none; }
.dock-orb[data-voice-state="listening"]::after,
.dock-orb[data-voice-state="listening"]::before { content:""; position:absolute; inset:0; border-radius:50%;
  border:2px solid rgba(102,181,255,.6); animation: dock-ripple 1.6s ease-out infinite; }
.dock-orb[data-voice-state="listening"]::before { animation-delay:.8s; }
@keyframes dock-ripple { 0%{transform:scale(.7);opacity:.6} 100%{transform:scale(1.9);opacity:0} }
.dock-orb[data-voice-state="speaking"] { animation: dock-qpulse .9s ease-in-out infinite; }
@keyframes dock-qpulse { 0%,100%{filter:brightness(1)} 50%{filter:brightness(1.32)} }
.dock-orb[data-voice-state="thinking"] { animation: none; filter: none; }
.dock-orb[data-voice-state="thinking"] .ring,
.dock-orb[data-voice-state="thinking"]::after { content:""; position:absolute; inset:-3px; border-radius:50%;
  border:2px solid rgba(240,153,59,.25); border-top-color: var(--signal-amber); animation: dock-spin 1.1s linear infinite; }
@keyframes dock-spin { to { transform: rotate(360deg); } }
/* muted: orb stays live (no dim) — mic button + status carry "muted"; stop any leaked filter from old block */
.dock-orb[data-voice-state="muted"] { filter: none; }
.dock-orb[data-voice-state="disconnected"] { box-shadow: 0 0 0 3px rgba(255,80,80,.7); }
/* paused: intentional dim cue — distinct from mic-mute (which keeps orb live) */
.dock-orb[data-voice-state="paused"] {
  filter: brightness(0.6) saturate(0.5);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
  animation: none;
}
.dock-orb[data-voice-state="paused"] .dock-orb-eq { display: flex; }

/* LEXI-585: while she speaks the dock status reads only "Tap to stop" — in place
   of the waveform (which looks the same as listening) and of "Lexi is speaking…",
   which would squeeze the hint on a phone. Toggled by talk_live.js. */
.session-dock.is-speaking .dock-wave,
.session-dock.is-speaking .dock-status-txt { display: none; }
.dock-orb-hint { flex: none; font-size: 13.5px; font-weight: 600; color: var(--acc); white-space: nowrap; }
.dock-orb-hint[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .dock-orb, .dock-orb-eq > span, .dock-wave > span,
  .dock-orb[data-voice-state="listening"]::after, .dock-orb[data-voice-state="listening"]::before,
  .dock-orb[data-voice-state="thinking"]::after { animation: none; }
}

.ws-thread-hint { color: var(--text-hint); font-size: var(--t-body); text-align: center; margin: 28px 12px 0; }
.manage-sheet-subscribe { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--accent-cyan);
  background: none; color: var(--accent-cyan); border-radius: 999px; font-size: 14px; cursor: pointer; }

/* ------------------------------------------------------------------ *
 * Lexi Mobile 1C — Talk resting-state hero (front door)
 * ------------------------------------------------------------------ */
/* Talk header ("TALK") hidden in normal mode — the greeting is the top element.
   Workshop-session mode re-reveals it (display:flex on the body.workshop-session-open rule). */
.panel[data-deck-panel="talk"] > .panel-head { display: none; }
/* Talk body is a flex column so the rest-hero can sit ~40% down (balanced air
   above + below) instead of pinned to the top. The dock-clearance bottom padding
   keeps the ::after spacer from pushing content behind the dock. */
.panel[data-deck-panel="talk"] > .panel-body { display: flex; flex-direction: column; }
.talk-rest {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top, 0) 16px 0; text-align: center;
}
/* Layout B: text block centered between the top edge and the orb; orb centered;
   equal bottom region keeps the lower band reserved for the ephemeral stream. */
.talk-rest-textreg { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.talk-rest-botreg  { flex: 1 1 0; }
/* Greeting is the top element (TALK header hidden in normal mode). */
.talk-rest-greet { font-size: 22px; font-weight: var(--weight-heavy); color: var(--ink); letter-spacing: -0.005em; }
.talk-rest-time { margin-top: 11px; font-size: 44px; font-weight: 300; letter-spacing: -0.015em; color: var(--ink-soft); line-height: 1; }
/* "## min until <title>" — only inside the 2h window (toggled via [hidden]). */
.talk-rest-until { margin-top: 9px; font-size: 12.5px; color: var(--ink-mute); }
.talk-rest-until[hidden] { display: none; }
.talk-rest-until-n { color: var(--acc-bright); font-weight: var(--weight-heavy); font-variant-numeric: tabular-nums; }
/* LEXI-219: ≤10 min → red, mirroring .ws-next.is-urgent-10m */
.talk-rest-until.is-urgent-10m .talk-rest-until-n { color: var(--signal-red); }
.talk-rest-date { margin-top: 8px; font-size: 14.5px; color: var(--ink-mute); }
.talk-rest-orb {
  width: 170px; height: 170px; border-radius: 50%; border: 0; cursor: pointer;
  /* LEXI-177 orb D — match the dock avatar (light/airy) so hero + dock are one identity */
  background: radial-gradient(circle at 40% 34%, #C7E4FF, #8FC6FA 60%, #66B5FF 100%);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 5px var(--acc-glow-soft), 0 0 50px var(--acc-glow), 0 0 110px var(--acc-glow-soft);
  animation: talk-rest-breath 4.4s ease-in-out infinite;
  transition: width var(--dur-slow) var(--ease-out), height var(--dur-slow) var(--ease-out);
}
.talk-rest-orb:active { filter: brightness(0.85); }
/* LEXI-585: the big orb says "Tap to stop" while she speaks — words, not a colour. */
.talk-rest-orb-hint { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; color: #1F5FAE; pointer-events: none; }
.talk-rest-orb-hint[hidden] { display: none; }
@keyframes talk-rest-breath {
  0%,100% { transform: scale(1);    box-shadow: 0 0 0 4px var(--acc-glow-soft), 0 0 28px var(--acc-glow-soft); }
  50%     { transform: scale(1.05); box-shadow: 0 0 0 7px var(--acc-glow), 0 0 44px var(--acc-glow); }
}
/* LEXI-149 — during a live exchange the hero persists: orb shrinks modestly,
   the hint fades, and What's-next lightens to give the receipts band room. */
.talk-rest-hint, .talk-rest-next { transition: opacity var(--dur-slow) var(--ease-soft), transform var(--dur-slow) var(--ease-soft); }
.talk-rest.is-live .talk-rest-orb { width: 110px; height: 110px; }
.talk-rest.is-live .talk-rest-hint { opacity: 0; }
.talk-rest.is-live .talk-rest-next { opacity: 0.5; transform: scale(0.97); }
.talk-rest-hint { font-size: var(--t-meta); color: var(--text-hint); font-style: italic; }
.talk-rest-next {
  margin-top: 4px; width: 100%; max-width: 340px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 5px; text-align: left;
}
.talk-rest-next-label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.16em; }
.talk-rest-next-body { font-size: var(--t-item); color: var(--ink); }
.talk-rest-next-count { color: var(--acc-bright); font-variant-numeric: tabular-nums; }

/* LEXI-139: next-event countdown folded into the Workspace header — one compact
   muted line under the date (no card, no extra Workspace real estate). ≤10 min
   away → red urgency cue (folds in LEXI-219). */
.ws-next {
  margin-top: 2px;
  font-size: var(--t-meta);
  color: var(--text-hint);
  font-variant-numeric: tabular-nums;
}
.ws-next[hidden] { display: none; }
.ws-next.is-urgent-10m { color: var(--signal-red); font-weight: 600; }

/* LEXI-184 — day dividers: normal-flow, generous margin, never overlapping */
.ws-day-divider { display: flex; justify-content: center; margin: 22px 0; position: static; }
.ws-day-divider span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #7a7a83; background: #161620; border: 1px solid rgba(255,255,255,.07); padding: 6px 13px; border-radius: 999px; }

/* Lexi Mobile 1C — press-to-reveal action popover */
.ws-popover {
  position: absolute; z-index: 5; display: flex; gap: 4px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 5px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  transform: translateY(calc(-100% - 6px));
}
.ws-pop-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; color: var(--text-primary);
  font-size: 13px; padding: 7px 9px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.ws-pop-btn svg { width: 16px; height: 16px; color: var(--ink-mute, #9a9aa2); flex: none; }
.ws-pop-btn:active { background: var(--surface-2); }
.ws-pop-btn.is-listening,
.ws-pop-btn.is-listening svg { color: var(--acc); }

/* LEXI-184 — ⋯ actions moved to a footer row below bubble content (no overlap). */
.ws-turn-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.ws-turn-more { background: none; border: 0; color: var(--ink-mute, #6f6f78); font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer; }
.ws-turn-more:active { opacity: .6; }

/* Lexi Mobile 1C — feed link preview (Telegram-grade) */
.ws-link-preview {
  display: flex; margin-top: 8px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--hairline); background: var(--surface); text-decoration: none;
  color: var(--text-primary); max-width: 320px;
}
.ws-link-preview.is-loading { opacity: 0.6; }
.ws-lp-thumb { width: 84px; flex: none; background: var(--ground) center/cover no-repeat; }
.ws-lp-thumb.has-img { min-height: 64px; }
.ws-link-preview.no-thumb .ws-lp-body { padding-left: 12px; }
.ws-lp-body { padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ws-lp-title { font-size: var(--t-body); font-weight: 500; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ws-lp-site { font-size: var(--t-meta); color: var(--text-hint); }

/* ── Phase 1D cards (LEXI-134) ─────────────────────────────────────────────
 * Tool-derived cards rendered into the Talk feed. Palette-aligned to the v2
 * neutral-grey + cyan accent tokens (not the link-preview purple). */
.ws-card {
  max-width: 340px;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  background: var(--bg-card-alt);
  color: var(--text-primary);
}
.ws-card-title { font-weight: 600; font-size: var(--t-body); margin-bottom: 6px; }
.ws-card-sub, .ws-card-meta, .ws-card-snippet { font-size: var(--t-meta); color: var(--text-hint); }
.ws-card-snippet { margin: 4px 0 2px; }
.ws-card-head { display: flex; gap: 10px; align-items: center; }
.ws-card-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  background: #2c2c2c; color: var(--text-primary); font-weight: 600;
}
.ws-card-foot { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ws-card-act {
  border: none; background: #2c2c2c; color: var(--text-primary);
  font-size: 13px; padding: 7px 10px; border-radius: 8px;
  text-decoration: none; cursor: pointer; display: inline-block;
}
.ws-card-act:active { background: #3a3a3a; }
.ws-card-act[disabled] { opacity: 0.5; pointer-events: none; }

/* LEXI-167/207 — inline capture-note editor (deterministic, ID-keyed). */
.ws-cap-note { margin-top: 8px; }
.ws-cap-note[hidden] { display: none; }
.ws-cap-note-input {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 38px;
  border: 1px solid #3a3a3a; background: #1f1f1f; color: var(--text-primary);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.ws-cap-note-input:focus { outline: none; border-color: var(--accent, #5a8dee); }
.ws-cap-note-acts { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ws-cap-note-msg { flex: 1; font-size: var(--t-meta); color: var(--text-secondary); }
.ws-cap-note-save { background: var(--accent, #5a8dee); color: #fff; }
.ws-cap-note-save:active { background: #4a7bd0; }

/* Plaud 4-hat routing card (CP4) — captures awaiting a hat assignment. */
.plaud-route-mount { display: flex; flex-direction: column; gap: 8px; }
.plaud-route-card { max-width: 340px; max-height: 400px; overflow: hidden; transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease; }
.plaud-route-card.is-dissolving { opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .plaud-route-card { transition: opacity 0.4s ease; } .plaud-route-card.is-dissolving { max-height: 0; } }
.plaud-route-head { margin-bottom: 8px; }
.plaud-route-title { font-weight: 600; font-size: var(--t-body); }
.plaud-route-meta { font-size: var(--t-meta); color: var(--text-hint); margin-top: 2px; }
.plaud-route-prompt { font-size: var(--t-meta); color: var(--text-hint); margin-bottom: 8px; }
.plaud-route-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plaud-hat-btn {
  border: none; background: #2c2c2c; color: var(--text-primary);
  font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer; flex: 1 1 auto;
}
.plaud-hat-btn:active { background: #3a3a3a; }
.plaud-route-card.is-filing { opacity: 0.6; pointer-events: none; }
.plaud-route-receipt { font-size: var(--t-meta); color: var(--text-hint); }
.plaud-route-error { font-size: var(--t-meta); color: #e0a44b; margin-top: 8px; }
.plaud-route-flash { animation: plaud-route-flash 1.5s ease-out; }
@keyframes plaud-route-flash {
  0% { box-shadow: 0 0 0 2px var(--accent, #6aa9ff); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.ws-tree-row, .ws-task-row {
  display: flex; gap: 8px; align-items: center; width: 100%;
  border: none; background: none; color: var(--text-primary);
  text-align: left; padding: 6px 2px; font-size: var(--t-body); cursor: pointer;
}
.ws-tree-row:active { background: #232323; }
.ws-task-row { cursor: default; }
.ws-task-row.is-actionable { cursor: pointer; }  /* LEXI-137: tappable-to-complete affordance */
.ws-task-row.is-done { color: var(--text-hint); text-decoration: line-through; }
.ws-tree-ico, .ws-task-box { flex: 0 0 auto; }
.ws-hat-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-hat-btn {
  border: 1px solid #2c2c2c; background: none; color: var(--text-primary);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.ws-hat-btn.is-current { background: var(--accent-cyan); color: #06121a; border-color: transparent; }

/* ── Phase 2 briefing card (LEXI-136) ───────────────────────────────────── */
.bc-chip { display: inline-flex; align-items: center; gap: 10px; width: auto; text-align: left;
  border: 1px solid var(--hairline); border-radius: var(--r-pill); padding: 9px 15px; background: var(--surface);
  color: var(--ink); cursor: pointer; }
.bc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--acc);
  box-shadow: 0 0 10px var(--acc-glow); animation: bc-dot-pulse 2.6s var(--ease-soft) infinite; }
@keyframes bc-dot-pulse { 0%,100% { box-shadow: 0 0 6px var(--acc-glow-soft); } 50% { box-shadow: 0 0 16px var(--acc-glow); } }
.bc-chip-date { font-size: var(--t-meta); color: var(--ink-soft); }
.bc-chip-headline { display: none; }
.bc-empty { color: var(--ink-mute); font-weight: 500; }
.bc-expanded { margin-top: 8px; display: flex; flex-direction: column; gap: 14px; }
/* Companion reset: the JS toggles the `hidden` attribute, but `.bc-expanded{display:flex}`
   defeats the UA [hidden] rule (equal specificity, author wins). Without this the brief is
   permanently expanded and the chip's tap-to-expand no-ops. Matches the same pattern used by
   .alerts-card[hidden], .travel-card[hidden], etc. */
.bc-expanded[hidden] { display: none; }
.bc-actions { display: flex; justify-content: flex-end; }
.bc-listen { border: 1px solid #2c2c2c; background: none; color: var(--accent-cyan);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.bc-sec-head { font-weight: 600; font-size: var(--t-body); margin-bottom: 4px; }
.bc-prose { font-size: var(--t-body); color: var(--text-secondary); line-height: 1.4; white-space: pre-wrap; }
.bc-prose a { color: var(--acc); text-decoration: underline; font-weight: 500; }
.bc-block { font-size: var(--t-body); }
.bc-muted { color: var(--text-hint); }
.bc-agenda-day { font-weight: 500; margin-top: 6px; }
.bc-agenda-row { display: flex; gap: 10px; padding: 3px 0; }
.bc-agenda-time { color: var(--text-hint); min-width: 92px; }
.bc-tiles { display: flex; gap: 8px; }
.bc-tile { border: 1px solid #2c2c2c; border-radius: 10px; padding: 8px 12px; flex: 1; text-align: center; }
.bc-tile-v { font-size: var(--t-head); font-weight: 600; }
.bc-tile-l { font-size: var(--t-meta); color: var(--text-hint); }

/* ── Briefing card in the Workspace thread (briefs-in-thread) ─────────────── */
.briefing-card { display: flex; flex-direction: column; gap: 0; }
.briefing-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: 10px 14px; cursor: pointer; color: var(--ink);
}
.briefing-chip[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.briefing-eyebrow { font-size: var(--t-meta); color: var(--ink-soft); }
.briefing-headline {
  font-size: var(--t-body); font-weight: 600; color: var(--ink);
  /* LEXI-331: collapsed title is abbreviated — truncate with ellipsis instead of
     wrapping. width:100% is load-bearing: the flex-column chip sizes children to
     content by default, so overflow:hidden has no boundary without it. */
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.briefing-body {
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--hairline); border-top: none;
  border-bottom-left-radius: var(--r-card); border-bottom-right-radius: var(--r-card);
  padding: 12px 14px; background: var(--surface);
}
.briefing-body[hidden] { display: none; }
.briefing-collapse {
  align-self: center; margin-top: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--acc); font: inherit; font-size: 13px; padding: 6px 12px;
}

/* Lexi Mobile Phase 2 cards (LEXI-138) — agenda / deal / spend */
.ws-agenda-row {
  display: flex; flex-direction: column; gap: 1px;
  width: 100%; text-align: left; border: none;
  background: transparent; color: var(--text-primary);
  padding: 7px 0; border-top: 1px solid #242424; cursor: pointer;
}
.ws-agenda-row:first-of-type { border-top: none; }
.ws-agenda-when { font-size: var(--t-meta); color: var(--accent-cyan); }
.ws-agenda-title { font-size: var(--t-item); }
.ws-agenda-loc { font-size: var(--t-meta); color: var(--text-muted); }

.ws-deal-meta { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.ws-deal-stage {
  font-size: var(--t-meta); color: var(--text-secondary);
  background: #2c2c2c; padding: 2px 8px; border-radius: 999px;
}
.ws-deal-amount { font-size: var(--t-body); font-weight: 600; color: var(--signal-green); }

.ws-spend-figure { font-size: var(--t-head); font-weight: 600; margin: 4px 0 8px; }
.ws-spend-period { font-size: var(--t-meta); color: var(--text-muted); font-weight: 400; }
.ws-gauge {
  height: 8px; border-radius: 999px; background: #242424;
  overflow: hidden; margin-bottom: 6px;
}
.ws-gauge-fill { height: 100%; border-radius: 999px; }
.ws-gauge-fill.is-green { background: var(--signal-green); }
.ws-gauge-fill.is-amber { background: var(--signal-amber); }
.ws-gauge-fill.is-red { background: var(--signal-red); }

/* table card (LEXI-140) */
.ws-table-scroll { overflow-x: auto; margin-top: 4px; }
.ws-table { border-collapse: collapse; width: 100%; font-size: var(--t-meta); }
.ws-table th, .ws-table td {
  text-align: left; padding: 5px 8px; white-space: nowrap;
  border-bottom: 1px solid #242424;
}
.ws-table th { color: var(--text-secondary); font-weight: 600; }
.ws-table td { color: var(--text-primary); }
.ws-table tbody tr:last-child td { border-bottom: none; }

/* capture + image cards + lightbox (LEXI-141) */
.ws-cap-head { display: flex; gap: 10px; align-items: flex-start; }
.ws-cap-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.ws-cap-chips { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
/* LEXI-413: preview text under the capture title, so the card says what the
   thing IS. Clamped to 3 lines — a long caption must not push the
   Open / View note / Add note row off the card. */
.ws-cap-preview { font-size: var(--t-meta); color: var(--text-secondary);
  margin-top: 8px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.ws-cap-chip { font-size: var(--t-meta); color: var(--text-secondary); background: #2c2c2c; padding: 2px 8px; border-radius: 999px; }
.ws-image-thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-top: 4px; cursor: zoom-in; }
.ws-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: none; align-items: center; justify-content: center; z-index: 1000; }
.ws-lightbox.is-open { display: flex; }
.ws-lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; }

/* ===================================================================== *
 * DESIGN-SYSTEM CANON (Lexi Mobile Consolidation, LEXI-142)
 * The one vocabulary every page conforms to. Tokens only — never hardcode
 * colors. Card shell = .ws-card; section header = .lx-section; chip =
 * .ws-cap-chip; button = .ws-card-act; gauge = .ws-gauge. New shared bits:
 * ===================================================================== */
.lx-section {
  font-size: var(--t-section); font-weight: var(--weight-heavy);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-hint); margin: 0 0 8px;
}
.lx-empty {
  color: var(--text-muted); font-size: var(--t-item);
  text-align: center; padding: 18px 8px;
}
.lx-drawer { border: none; margin-top: 8px; }
.lx-drawer > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; background: var(--bg-card-alt);
  color: var(--text-secondary); font-size: var(--t-item);
}
.lx-drawer > summary::-webkit-details-marker { display: none; }
.lx-drawer > summary::after { content: "›"; color: var(--text-hint); transition: transform 150ms ease; }
.lx-drawer[open] > summary::after { transform: rotate(90deg); }
.lx-drawer-body { padding: 10px 2px 2px; }
.lx-more {
  width: 100%; border: none; background: transparent; cursor: pointer;
  color: var(--text-hint); font-size: var(--t-meta); padding: 10px;
  text-align: center;
}

/* === Phase 2b Workspace record river ============================== */
/* position:relative — the long-press/⋯ popover (LEXI-152) is position:absolute and
 * appended here; without a positioned container it anchored to a higher ancestor
 * and rendered off-screen (the "3 dots but no menu" bug). */
/* LEXI-184 — breathing room: the river gap is the single inter-turn rhythm
   (the .ws-turn margin-bottom from the hierarchy rule is zeroed so they don't
   stack to ~28px). 18px reads calm + spacious without feeling sparse. */
.ws-river { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 22px; padding: 2px 0 var(--dock-clearance, 96px); overflow-y: auto; position: relative; }
.ws-river > .ws-turn { margin-bottom: 0; }
.ws-river > .ws-day-divider { margin: 4px 0; }
.ws-session-chip { align-self: center; font-size: 10px; color: #7f8a90; padding: 2px 0; letter-spacing: .3px; }
.ws-search-overlay { position: absolute; inset: 0; background: var(--ground); z-index: 20; display: flex; flex-direction: column; }
.ws-search-bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #242424; }
.ws-search-bar input { flex: 1; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 8px 12px; color: var(--ink); font-size: 13px; }
.ws-search-results { flex: 1; overflow-y: auto; padding: 6px 10px; }
.ws-search-hit { padding: 9px 10px; border-bottom: 1px solid #1f1f1f; cursor: pointer; }
.ws-search-hit .hit-meta { font-size: 10px; color: #7f8a90; margin-bottom: 2px; }
.ws-search-hit .hit-snip { font-size: 12.5px; color: #d6d6d6; }
.ws-turn.ws-jump-flash { animation: wsJumpFlash 1.4s ease-out; }
@keyframes wsJumpFlash { 0% { box-shadow: 0 0 0 2px rgba(102,181,255,.6); } 100% { box-shadow: 0 0 0 0 rgba(102,181,255,0); } }

/* === Phase 2b ephemeral Talk live-exchange ========================== */
.panel[data-deck-panel="talk"] .panel-body { position: relative; }
/* LEXI-149 — the receipts band: her reply scrolls as one block, brightness graded
   dark→light by a fixed window mask; sits low so the persistent orb is never crowded. */
.talk-live { position: absolute; left: 0; right: 0; bottom: 50px; height: 200px; max-width: 340px; margin: 0 auto; pointer-events: none; }
.talk-live-mask { position: absolute; inset: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, rgba(0,0,0,0.45) 22%, #000 52%, #000 86%, transparent 100%);
          mask-image: linear-gradient(to top, transparent 0%, rgba(0,0,0,0.45) 22%, #000 52%, #000 86%, transparent 100%); }
.talk-live-block { position: absolute; left: 0; right: 0; padding: 0 18px; text-align: center;
  font-size: 14px; font-weight: 300; line-height: 1.95; letter-spacing: 0.01em; color: #BBBBC2;
  animation: talk-block-scroll 19s linear infinite; }
@keyframes talk-block-scroll { 0% { transform: translateY(150px); } 100% { transform: translateY(-100%); } }
/* LEXI-177: both turns scroll in one stream — yours small + dark (recedes),
   her reply prominent (larger + lighter). The old pinned .talk-live-you is gone. */
.talk-live-block .tl-mine { font-size: 13px; font-weight: 300; color: var(--ink-mute); }
.talk-live-block .tl-lexi { font-size: 16px; font-weight: 400; color: #D8D8DE; }
.talk-live-block .tl-sep  { color: var(--ink-whisper); }

/* LEXI-557 — "card ready" hint. A card no longer slides Home away; this small
   pill sits top-right, out of the layout flow so nothing on Home moves when it
   appears, and taps through to Workspace. */
.talk-card-ready {
  position: absolute; top: calc(env(safe-area-inset-top, 0) + 12px); right: 14px; z-index: 2;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--acc-glow);
  background: rgba(102, 181, 255, 0.12); color: var(--acc-bright);
  font-size: 12.5px; font-weight: var(--weight-heavy); letter-spacing: 0.01em;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  animation: talk-card-ready-in var(--dur-slow) var(--ease-soft);
}
.talk-card-ready[hidden] { display: none; }
@keyframes talk-card-ready-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .talk-card-ready { animation: none; } }

/* LEXI-181 follow-up — a command tapped on Talk renders static + centered in the
   band (not a doubled, right-aligned, scrolling stream): one chip, larger, mid-band. */
.talk-live-block.tl-static {
  animation: none;
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.talk-live-block.tl-static .tl-mine.cmd-chip {
  margin: 0;                       /* centered by align-items (overrides margin-left:auto) */
  font-size: var(--t-body, 15px);
  padding: 7px 16px;
}
.talk-live-block.tl-static .tl-lexi {
  font-size: 17px; text-align: center; max-width: 100%;
  max-height: 100%; overflow: hidden;
}

/* [hidden] companions — an author `display:flex` defeats the UA `[hidden]{display:none}`
   rule (author wins over UA at any specificity), so every toggled element with a
   display override needs this or its `hidden` attribute is a no-op. This was the
   2b live-verify bug: the opaque .ws-search-overlay stayed painted over the record.
   Recurring gotcha — LEXI-146 (9th occurrence). */
.ws-search-overlay[hidden] { display: none; }
.ws-river[hidden] { display: none; }
.talk-live[hidden] { display: none; }
.talk-rest[hidden] { display: none; }

/* === Phase 2b — What's-next urgency tiers ========================== */
.talk-rest-next.is-soon .talk-rest-next-body,
.talk-rest-next.is-soon .talk-rest-next-count { color: var(--signal-amber, #e0a23a); }
.talk-rest-next.is-urgent .talk-rest-next-body,
.talk-rest-next.is-urgent .talk-rest-next-count { color: var(--signal-red, #e0564a); font-weight: 600; }
/* Workspace home fills the panel so the river (ws-river) is the internal scroll
   container — required for scroll-up pagination + scroll-to-newest to work
   (the .panel scroller would otherwise swallow them). Mirrors the old in-session
   transcript pattern. */
.subpanel[data-panel="home"] { flex: 1 1 auto; min-height: 0; }
.subpanel[data-panel="home"] .panel-body { position: relative; min-height: 0; display: flex; flex-direction: column; }

/* LEXI-310: the pending-card stack (.home-content — plaud-route + confirm
   mounts) sits ABOVE .ws-river as a plain unbounded flex child. With ≥3
   cards it grows taller than the panel, the river (flex-basis 0) collapses
   to zero, and the cards become unreachable — .panel-body is NOT a scroller
   (hard constraint: never make it one, that failed on-device 5x during the
   dock-clearance work — see reference_pwa_dock_clearance_bounded_scroller).
   Fix: bound .home-content as its OWN inner scroller, scoped to Home only,
   so the stack never blocks the thread/composer below it. Cap at 28dvh (vh
   fallback for older WebViews) ≈ 40% of the visible pane — Jason's on-device
   call after trying 42dvh (~60% of pane, too dominant); the river keeps the
   rest. Below the cap (0-2 cards) height is natural and behavior is
   unchanged. `.hidden` carries `!important` (line 110) so it still wins
   over this rule when the stack is empty. */
.subpanel[data-panel="home"] .home-content {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 28vh;
  max-height: 28dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ── Phase 3: Projects command center ───────────────────────────── */
/* Hide the "PROJECTS" page header for more real estate — the Active/Backlog/
   Tickets tabs ride near the top (the .panel already pads for the notch). */
.panel[data-deck-panel="projects"] > .subpanel > .panel-head { display: none; }
.panel[data-deck-panel="projects"] .projects-content { margin-top: 4px; }
/* Make content END at the dock (mirrors the WORKING Workspace river exactly):
   the outer panel stops scrolling; panel-body is a flex column whose padding-bottom
   SHORTENS the flex area to stop at the dock's top; the INNER projects-content is
   the bounded scroller filling that shortened area. (w94 wrongly made panel-body
   itself the scroller — full-viewport-tall, so content that fit never scrolled and
   sat behind the floating dock.) */
.panel[data-deck-panel="projects"] { overflow-y: hidden; }
.panel[data-deck-panel="projects"] > .subpanel { flex: 1 1 auto; min-height: 0; }
.panel[data-deck-panel="projects"] .panel-body {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 132px);   /* shortens the flex area to the dock top */
}
.panel[data-deck-panel="projects"] .projects-content {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.seg-strip {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-card); border: 1px solid #2c2c2c; border-radius: 10px;
  margin-bottom: 12px;
}
.seg-btn {
  flex: 1 1 0; padding: 7px 4px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-muted);
  font-size: var(--t-meta); font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn.seg-active { background: var(--bg-card-alt); color: var(--text-primary); }

.proj-view.hidden { display: none; }
.proj-tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.proj-tap:active { opacity: 0.7; }

.proj-phase {
  font-size: var(--t-meta); color: var(--text-secondary);
  margin-top: 2px; line-height: 1.3;
}

.ticket-badge {
  font-size: var(--t-meta); color: var(--text-secondary);
  background: var(--bg-card-alt); border-radius: 999px;
  padding: 1px 7px; white-space: nowrap;
}
.ticket-badge.badge-hot { color: var(--signal-red); }

/* LEXI-149 — Projects premium: status legend, spring-in, skeleton loaders */
.proj-legend { display: flex; gap: 16px; padding: 2px 2px 12px; }
.proj-legend span { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); }
.proj-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.proj-legend i.live { background: var(--live); }
.proj-legend i.wip { background: var(--wip); }
.proj-legend i.early { background: var(--early); }

.proj-row.proj-in { opacity: 0; animation: proj-spring 520ms var(--spring) forwards; }
@keyframes proj-spring { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

.proj-sk { list-style: none; background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--r-lg); padding: 16px; }
.proj-sk .sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #1c1c21 0%, #26262d 40%, #1c1c21 80%); background-size: 200% 100%; animation: proj-shimmer 1.3s linear infinite; margin-bottom: 8px; }
.proj-sk .sk-line.name { width: 56%; height: 14px; }
.proj-sk .sk-line.bar { width: 100%; height: 4px; margin-top: 12px; margin-bottom: 0; }
@keyframes proj-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.tickets-head { font-size: var(--t-meta); color: var(--text-muted); margin-bottom: 8px; }
.chip-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  padding: 4px 10px; border: 1px solid #2c2c2c; border-radius: 999px;
  background: transparent; color: var(--text-secondary);
  font-size: var(--t-meta); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip.chip-active { border-color: var(--accent-cyan); color: var(--accent-cyan); }

.ticket-list { display: flex; flex-direction: column; gap: 6px; }
.ticket-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-card); border: 1px solid #2c2c2c; border-radius: 12px;
  padding: 10px 12px;
}
.sev-chip {
  flex: 0 0 auto; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px; margin-top: 1px;
}
.sev-chip.sev-hot  { background: rgba(226,75,74,0.15); color: var(--signal-red); }
.sev-chip.sev-cool { background: var(--bg-card-alt); color: var(--text-muted); }

/* What the ticket asks of Jason — Decide, Do or Check. Sits where the severity
   chip sits on everyone else's rows, because on his rows that is the thing he
   is scanning for. */
.needs-chip {
  flex: 0 0 auto; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 6px; margin-top: 1px;
  letter-spacing: 0.02em; white-space: nowrap;
  background: var(--bg-card-alt); color: var(--text-secondary);
}
.needs-chip.needs-decide { background: rgba(255,176,32,0.16); color: var(--accent-amber, #ffb020); }
.needs-chip.needs-do     { background: rgba(226,75,74,0.15); color: var(--signal-red); }
.needs-chip.needs-check  { background: rgba(0,200,255,0.13); color: var(--accent-cyan); }
.ticket-row.ticket-yours { border-color: #3a3a44; }
.ticket-badge.badge-yours { color: var(--accent-cyan); }
.ticket-rest { opacity: 0.75; }
.ticket-body { flex: 1 1 auto; min-width: 0; }
.ticket-title {
  font-size: var(--t-item); color: var(--text-primary); line-height: 1.3;
}
.ticket-sub { font-size: var(--t-meta); color: var(--text-muted); margin-top: 2px; }
.ticket-group-head { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { .talk-live-block { animation: none; } .talk-rest-orb { animation: none; } .proj-in { animation: none; opacity: 1; } .proj-sk .sk-line { animation: none; } .proj-progress-fill { transition: none; } .bc-dot { animation: none; } }

/* LEXI-149 — visible keyboard focus on the redesigned interactive elements */
.ws-gear:focus-visible, .dock-send:focus-visible,
.seg-btn:focus-visible, .proj-row.proj-tap:focus-visible, .bc-chip:focus-visible,
.talk-rest-orb:focus-visible {
  outline: 2px solid var(--acc); outline-offset: 2px;
}

/* LEXI-154 — in-app file viewer (bottom sheet). The [hidden] attr is handled by
 * the global LEXI-146 guard, so no per-element display reset is needed. */
.fv-backdrop {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.fv-sheet {
  width: 100%; max-width: 620px; height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-card, #17171B);
  border-top-left-radius: 16px; border-top-right-radius: 16px;
  box-shadow: 0 -12px 44px rgba(0,0,0,0.62);
  animation: fvUp 0.22s ease-out;
}
@keyframes fvUp { from { transform: translateY(14px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.fv-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--hairline, rgba(255,255,255,0.08));
}
.fv-title {
  flex: 1; min-width: 0; font-size: 15px; font-weight: 600;
  color: var(--text-primary, #F4F4F6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.fv-close {
  flex: 0 0 auto; background: transparent; border: 0;
  color: var(--text-secondary, #A4A4AD); font-size: 22px; line-height: 1;
  padding: 2px 8px; cursor: pointer; border-radius: 8px;
}
.fv-close:active { background: var(--bg-card-alt, #1F1F25); }
.fv-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 14px 16px max(20px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.fv-md { color: var(--text-primary, #F4F4F6); font-size: 15px; line-height: 1.5; }
.fv-md h1, .fv-md h2, .fv-md h3 { line-height: 1.25; }
.fv-text {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  color: var(--text-primary, #F4F4F6);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.5;
}
.fv-state { color: var(--text-secondary, #A4A4AD); font-size: 14px; padding: 8px 2px; }
.fv-error { color: var(--signal-red, #E24B4A); }

/* Self-Healing Lexi — approval card (LEXI-NNN) */
.heal-sheet { /* inherits fv-sheet sizing + animation */ }
.heal-body { display: flex; flex-direction: column; gap: 12px; }
.ws-card-heal { /* inherits ws-card base from the existing sheet */ }
.heal-plan {
  white-space: pre-wrap; word-break: break-word; margin: 8px 0 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px;
  color: var(--text-secondary, #A4A4AD); line-height: 1.45; max-height: 120px;
  overflow-y: auto;
}
.heal-diff { margin: 4px 0; }
.heal-diff-summary {
  font-size: 12px; color: var(--text-secondary, #A4A4AD);
  cursor: pointer; padding: 2px 0;
}
.heal-diff-pre {
  white-space: pre-wrap; word-break: break-word; margin: 6px 0 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px;
  color: var(--text-secondary, #A4A4AD); line-height: 1.4; max-height: 200px;
  overflow-y: auto;
}
.heal-verdict { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.heal-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; white-space: nowrap; flex: 0 0 auto;
}
.heal-badge-ok  { background: rgba(56,200,120,0.15); color: #38C878; }
.heal-badge-warn { background: rgba(226,180,74,0.15); color: #E2B44A; }
.heal-act-reject { color: var(--signal-red, #E24B4A); }
.heal-empty {
  color: var(--text-secondary, #A4A4AD); font-size: 14px;
  padding: 24px 4px; text-align: center;
}

/* ------------------------------------------------------------------ *
 * LEXI-177 Phase B — "Send to Lexi" skills sheet
 * Ported from .superpowers/brainstorm/781-1782323589/content/sheet-v5.html
 * z-index: backdrop 14 / sheet 15 (above hat menu backdrop 12 / menu 13)
 * ------------------------------------------------------------------ */

.skills-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 14;
}

.skills-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  /* Own vertical drags so the browser doesn't hijack the pull as a scroll and
     cancel the pointer gesture mid-pull (was the "snaps back up" finickiness). */
  touch-action: none;
  background: #161619;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 26px 26px 0 0;
  padding: 12px 16px max(20px, env(safe-area-inset-bottom, 20px));
  /* Open + close are driven by inline transitions in skills_sheet.js — NO CSS
     keyframe entrance, so toggling .is-dragging can't replay it and fight the
     close (that was the "snaps up then drops down" glitch). */
}

.skills-sheet[hidden] { display: none; }
.skills-sheet-backdrop[hidden] { display: none; }
/* While the finger is dragging, kill any transition so the sheet tracks 1:1. */
.skills-sheet.is-dragging { transition: none; }
.skills-sheet-grab { cursor: grab; touch-action: none; }

.skills-sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #3a3d42;
  margin: 0 auto 14px;
}

.skills-sheet-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink, #F4F4F6);
  margin: 0 2px 2px;
}

.skills-sheet-sub {
  font-size: 12.5px;
  color: var(--ink-mute, #6E6E78);
  margin: 0 2px 15px;
}

/* 4-column tile grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Individual skill tile */
.skill-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 11px 3px 9px;
  background: var(--surface-2, #1F1F25);
  border: 1px solid var(--hairline, rgba(255, 255, 255, .07));
  border-radius: 13px;
  cursor: pointer;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}

.skill-tile:hover   { border-color: rgba(102, 181, 255, .4); }
.skill-tile:active  { border-color: var(--acc, #66B5FF); }

/* Icon circle */
.skill-tile-ic {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: rgba(102, 181, 255, .12);   /* acc-wash per mockup */
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-tile-ic svg {
  width: 18px;
  height: 18px;
  color: #9bb9d6;
}

/* Tile label */
.skill-tile-nm {
  font-size: 11px;
  color: var(--ink-soft, #A4A4AD);
  text-align: center;
  line-height: 1.15;
}

/* Slash command hint */
.skill-tile-cmd {
  font-size: 9px;
  font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  color: var(--ink-mute, #6E6E78);
  opacity: .75;
}

/* "soon" chip (Add file) */
.skill-tile-soon {
  position: absolute;
  top: 6px;
  right: 7px;
  font-size: 8px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-mute, #6E6E78);
  background: rgba(255, 255, 255, .05);
  border-radius: 5px;
  padding: 2px 4px;
}

/* ------------------------------------------------------------------ *
 * LEXI-179 — full-screen search sheet (search target for + tile + /search)
 * Bottom-up full-screen panel; Lexi-blue focus field matching the dock input.
 * Scoped .ss-* / .search-sheet-* classes so it never collides with the dormant
 * Workspace .ws-search-* overlay.
 * ------------------------------------------------------------------ */

.search-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 16;
}
.search-sheet-backdrop[hidden] { display: none; }

.search-sheet {
  position: fixed;
  inset: 0;
  z-index: 17;
  display: flex;
  flex-direction: column;
  background: var(--ground, #0E0E11);
  padding-top: env(safe-area-inset-top, 0);
  animation: searchSheetUp var(--dur-med, 260ms) var(--ease-out, cubic-bezier(0.22,1,0.36,1));
}
.search-sheet[hidden] { display: none; }

@keyframes searchSheetUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1;   }
}

.search-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline, rgba(255,255,255,.07));
}

.search-sheet-input {
  flex: 1;
  background: var(--surface, #17171B);
  border: 1px solid var(--hairline, rgba(255,255,255,.07));
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--ink, #F4F4F6);
  font: inherit;
  font-size: 15px;
}
.search-sheet-input:focus {
  outline: none;
  border-color: var(--acc, #66B5FF);
}

.search-sheet-close {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2, #1F1F25);
  border: 1px solid var(--hairline, rgba(255,255,255,.07));
  color: var(--ink-soft, #A4A4AD);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.search-sheet-close:active { border-color: var(--acc, #66B5FF); }

.search-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px max(16px, env(safe-area-inset-bottom, 16px));
}

/* LEXI-476 — Dashboards page (full-screen sheet; same chrome as search). */
.dashboards-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 16;
}
.dashboards-sheet-backdrop[hidden] { display: none; }
.dashboards-sheet {
  position: fixed;
  inset: 0;
  z-index: 17;
  display: flex;
  flex-direction: column;
  background: var(--ground, #0E0E11);
  padding-top: env(safe-area-inset-top, 0);
  animation: searchSheetUp var(--dur-med, 260ms) var(--ease-out, cubic-bezier(0.22,1,0.36,1));
}
.dashboards-sheet[hidden] { display: none; }
.dashboards-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline, rgba(255,255,255,.07));
}
.dashboards-sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink, #F4F4F6);
}
.dashboards-sheet-close {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2, #1F1F25);
  border: 1px solid var(--hairline, rgba(255,255,255,.07));
  color: var(--ink-soft, #A4A4AD);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dashboards-sheet-close:active { border-color: var(--acc, #66B5FF); }
.dashboards-sheet-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px max(16px, env(safe-area-inset-bottom, 16px));
}
.dashboards-empty {
  color: var(--ink-soft, #A4A4AD);
  font-size: 14px;
  padding: 24px 8px;
  text-align: center;
}

.ss-section {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute, #6E6E78);
  padding: 12px 4px 6px;
}

.ss-empty {
  padding: 22px 6px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-mute, #6E6E78);
}

/* Task 7R — All/Mobile/Sidebar surface toggle, inserted above the results
   list. Scoped .ss-seg-* so it stays independent of .workshop-segmented. */
.ss-segmented {
  display: flex;
  gap: 2px;
  padding: 4px;
  margin: 10px 12px 0;
  background: var(--surface, #17171B);
  border: 1px solid var(--hairline, rgba(255,255,255,.07));
  border-radius: 10px;
}
.ss-seg-btn {
  flex: 1 1 0;
  padding: 7px 0;
  background: transparent;
  border: 0;
  color: var(--ink-mute, #6E6E78);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ss-seg-btn.ss-seg-active {
  background: var(--surface-2, #1F1F25);
  color: var(--ink, #F4F4F6);
}

.ss-hit {
  padding: 11px 10px;
  border-bottom: 1px solid var(--hairline, rgba(255,255,255,.06));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ss-hit:active { background: var(--acc-wash, rgba(102,181,255,.07)); }
.ss-hit-meta {
  font-size: 10px;
  color: var(--acc-bright, #A6D6FF);
  margin-bottom: 3px;
}
.ss-hit-snip {
  font-size: 13px;
  color: var(--ink-soft, #D6D6D6);
  line-height: 1.35;
}

/* ------------------------------------------------------------------ *
 * LEXI-177 Phase B — Slash autocomplete list
 * Ported visuals from .superpowers/brainstorm/781-1782323589/content/sheet-v5.html
 * (.slash / .srow panel from the Commands col-side).
 * Floats fixed above the dock; z-index 13 (below skills sheet 15, above hat
 * menu 13 — but slash and hat menu are never open together so the tie is fine;
 * use 13 so it doesn't obscure the backdrop at 14).
 * ------------------------------------------------------------------ */

.slash-list {
  position: fixed;
  left: 12px;
  right: 12px;
  /* Floats above the dock; --dock-clearance is the dock height + 20px padding.
     We add 8px so the list sits 8px above the dock bottom edge. */
  bottom: calc(var(--dock-clearance, 80px) + 8px);
  z-index: 13;

  background: #161619;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);

  /* Slide-up entrance */
  animation: slashListUp var(--dur-fast, 140ms) var(--ease-out, cubic-bezier(0.22,1,0.36,1));
}

@keyframes slashListUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* Section header */
.slash-list::before {
  content: "Commands";
  display: block;
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute, #6E6E78);
  font-weight: 600;
}

/* Individual command row */
.slash-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, .04);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast, 140ms);
}

.slash-row:active,
.slash-row:hover {
  background: rgba(102, 181, 255, .06);
}

/* /cmd token — mono, accent coloured */
.slash-row-cmd {
  min-width: 78px;
  flex: none;
  font-family: var(--font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 12.5px;
  color: var(--acc, #66B5FF);
}

/* Description */
.slash-row-desc {
  font-size: 12px;
  color: var(--ink-soft, #A4A4AD);
}

/* --- LEXI-118: dedicated captures surface ------------------------------- */
/* Appended at the end deliberately: late rules win this cascade, and the
   dock-bar sizing episode is the standing reminder that an earlier rule
   elsewhere can silently override an identical selector. */
.captures-cards-mount.hidden { display: none; }
.captures-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.captures-card .card-title {
  font-size: var(--t-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #9a9a9a);
}
.captures-card .card-badge {
  font-size: var(--t-meta);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-card-alt);
  color: var(--acc, #7db9ff);
}
.captures-list { list-style: none; margin: 0; padding: 0; }
.capture-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid #242424;
}
.capture-row:first-child { border-top: none; }
.capture-title {
  color: var(--text-primary);
  font-size: var(--t-body, 15px);
  /* One line. A capture title can be a whole email subject and the card is a
     glance surface, not a reader — the vault path is on hover. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.capture-row.unrouted .capture-title { color: var(--acc, #7db9ff); }
.capture-meta { font-size: var(--t-meta); color: var(--text-secondary, #8a8a8a); }
.captures-more {
  margin-top: 8px;
  font-size: var(--t-meta);
  color: var(--text-secondary, #8a8a8a);
}
.captures-card.flash {
  animation: captures-flash var(--dur-slow, 600ms) ease-out 2;
}
@keyframes captures-flash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 2px var(--acc-glow, rgba(125, 185, 255, 0.45)); }
}

/* LEXI-473 — Select/Zoho pipeline lane card */
.pipeline-card-mount.hidden { display: none; }
.pipeline-card .card-head { margin-bottom: 6px; }
.pipeline-card .card-title {
  font-size: var(--t-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #9a9a9a);
}
.pipeline-sub { font-size: var(--t-meta); color: var(--text-secondary, #8a8a8a); margin-bottom: 8px; }
.pipeline-sub.warn { color: var(--warn, #e0a458); }
.pipeline-list { list-style: none; margin: 0; padding: 0; }
.pipeline-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #242424;
}
.pipeline-row:first-child { border-top: none; }
.pipeline-stage {
  color: var(--text-primary);
  font-size: var(--t-body, 15px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-figs { font-size: var(--t-meta); color: var(--text-secondary, #9a9a9a); white-space: nowrap; }
.pipeline-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #2c2c2c;
  font-size: var(--t-meta);
  color: var(--text-secondary, #8a8a8a);
}
.pipeline-foot-total { color: var(--text-primary); font-weight: 600; }

/* LEXI-472 — DistrictWise health card */
.districtwise-card-mount.hidden { display: none; }
.districtwise-card .card-head { margin-bottom: 6px; }
.districtwise-card .card-title {
  font-size: var(--t-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #9a9a9a);
}
.dw-status { display: flex; align-items: center; gap: 8px; font-size: var(--t-body, 15px); }
.dw-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dw-dot.ok { background: var(--ok, #4caf6d); }
.dw-dot.down { background: var(--danger, #e05a5a); }
.dw-status-text.warn { color: var(--warn, #e0a458); }
.dw-uptime { font-size: var(--t-meta); color: var(--text-secondary, #9a9a9a); margin-top: 6px; }
.dw-metrics-missing {
  font-size: var(--t-meta);
  color: var(--text-muted, #6f6f6f);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #242424;
}
