/* =========================================================================
   MeetKB side panel — "Observation Room" aesthetic.
   Refined editorial darkness: hairline rules, Fraunces serif display,
   tabular Inter body, JetBrains Mono for telemetry. Indigo accent
   (#7C7AFC) used precisely; warm cream (#F5E9D4) used very sparingly
   for editorial highlights.
   ========================================================================= */

:root {
  /* ---- Ink ladder (cool-neutral darks) ---- */
  --ink-0:  #08080a;          /* page base */
  --ink-1:  #0d0d11;          /* surface */
  --ink-2:  #131318;          /* elevated */
  --ink-3:  #1b1b22;          /* interactive */
  --ink-4:  #25252e;          /* hover crest */
  --ink-input: #0a0a0d;       /* input wells */

  /* ---- Hairlines ---- */
  --line:        rgba(255, 255, 255, 0.055);
  --line-strong: rgba(255, 255, 255, 0.10);
  --line-bright: rgba(255, 255, 255, 0.18);
  --line-accent: rgba(124, 122, 252, 0.36);

  /* ---- Text ladder ---- */
  --text:    #f2f3f6;
  --text-2:  #c6cad1;
  --text-3:  #8a8e96;
  --text-4:  #545861;

  /* ---- Accent (distinctive indigo-violet, not the default #4f46e5) ---- */
  --accent:        #7c7afc;
  --accent-strong: #8e8cff;
  --accent-deep:   #5f5dd6;
  --accent-soft:   rgba(124, 122, 252, 0.14);
  --accent-glow:   rgba(124, 122, 252, 0.30);
  --accent-ink:    #0a0a14;

  /* ---- Cream (sparing editorial highlight) ---- */
  --cream:      #f5e9d4;
  --cream-soft: rgba(245, 233, 212, 0.06);
  --cream-line: rgba(245, 233, 212, 0.22);

  /* ---- Signal colors ---- */
  --rec:       #ff6b6b;
  --rec-glow:  rgba(255, 107, 107, 0.35);
  --go:        #3fe0a6;
  --go-glow:   rgba(63, 224, 166, 0.30);
  --warn:      #f5a742;
  --warn-soft: rgba(245, 167, 66, 0.10);
  --danger:    #f47174;
  --danger-soft: rgba(244, 113, 116, 0.12);

  /* ---- Type ---- */
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  --font-display: var(--font-body); /* legacy alias — kept so no rule breaks */

  /* ---- Radii ---- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* ---- Aliases preserved for legacy class hooks ---- */
  --bg:            var(--ink-0);
  --bg-2:          var(--ink-1);
  --surface:       var(--ink-1);
  --surface-2:     var(--ink-2);
  --surface-3:     var(--ink-3);
  --surface-input: var(--ink-input);
  --border:        var(--line);
  --border-strong: var(--line-strong);
  --border-bright: var(--line-bright);
  --indigo:        var(--accent);
  --indigo-soft:   var(--accent-soft);
  --success:       var(--go);
  --accent-2:      var(--accent-deep);
  --accent-soft-strong: var(--line-accent);
  --text-mute:     var(--text-2);
  --text-dim:      var(--text-3);
  --text-faint:    var(--text-4);
  --radius:        var(--r-md);
  --radius-sm:     var(--r-sm);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--ink-0);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  /* atmospheric depth — a single soft indigo wash up top, no busy gradients */
  background-image:
    radial-gradient(
      460px 240px at 50% -120px,
      rgba(124, 122, 252, 0.08),
      transparent 70%
    );
}

::selection {
  background: var(--accent-soft);
  color: var(--cream);
}

/* ---- Scrollbars ---- */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); background-clip: padding-box; }

/* ---- Reusable eyebrow ----
   Small-caps telemetry label that appears above big headings and inside
   panel headers. Defines the editorial rhythm. */
.panel-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* =========================================================================
   TOP BAR
   ========================================================================= */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 70%),
    var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  /* Sit above any composer dropdown that escapes upward (KB picker
     opens with bottom: 100% from the bottom-anchored composer). Higher
     than .kb-picker-menu's z-index: 100 so the topbar is never
     visually covered. */
  z-index: 110;
  min-height: 44px;
}
/* Top hairline highlight — gives the bar a subtle "lit edge" */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.10),
    transparent
  );
  border-radius: var(--r-md) var(--r-md) 0 0;
  pointer-events: none;
}

.topbar-left  { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-rec   { display: flex; align-items: center; gap: 10px; justify-content: center; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

/* ---- Brand mark (logo + wordmark) ---- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  user-select: none;
}
.brand-mark .brand-logo {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  display: block;
  /* Source PNG is already a rounded square — no extra border-radius or
     shadow so the rendered mark exactly matches the toolbar / Chrome
     side panel chrome icon. */
  image-rendering: -webkit-optimize-contrast;
}
.brand-mark .brand-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
/* When the user is signed in, hand the topbar-left space over to the
   auth-chip (avatar + name) — the brand becomes redundant there. */
.brand-mark.is-hidden { display: none; }
/* While recording, collapse the wordmark too so the timer/controls own
   the bar — keep the logo glyph as the identity anchor. */
body.is-recording .brand-mark .brand-name { display: none; }

/* ---- Auth chip (compact, avatar + sign-out only) ---- */
.auth-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.auth-chip-email {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
/* While recording (and while paused — still an active session) collapse
   the name/email so the timer + rec controls get the full top bar. The
   avatar stays as the identity anchor. */
body.is-recording .auth-chip-email { display: none; }

.auth-chip-avatar-btn {
  width: 28px; height: 28px;
  padding: 0; border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  transition: box-shadow 0.18s ease;
}
.auth-chip-avatar-btn::after {
  /* hairline ring around avatar */
  content: "";
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
.auth-chip-avatar-btn:hover::after { border-color: var(--line-accent); }
.auth-chip-avatar-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }

.auth-chip-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.auth-chip-avatar-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 25%, #8e8cff, #4a48b8 70%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.signout-icon-btn {
  width: 22px; height: 22px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text-3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-left: 2px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.signout-icon-btn:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(244, 113, 116, 0.30);
}
.signout-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }

/* ---- Status + timer + recording-action cluster ---- */

/* Status pill — small-caps when idle/recording; the *text* hides during
   recording so the timer carries the signal alone. */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  padding: 0;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-4);
  flex: 0 0 auto;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
/* Recording state: hide the "RECORDING" text via font-size:0 + transparent
   color so the dot pseudo (a flex child) stays renderable. Earlier
   version used width:0 + overflow:hidden which clipped the dot itself. */
.status.recording {
  color: transparent;
  font-size: 0;
  letter-spacing: 0;
  gap: 0;
  padding: 0;
}
.status.recording::before {
  background: var(--go);
  width: 8px; height: 8px;
  /* Static glow ring — no animated box-shadow (was forcing full-frame
     paints, pegging GPU). Cheap opacity blink below carries the "alive"
     signal at a fraction of the cost. */
  box-shadow: 0 0 0 3px var(--go-glow);
  animation: rec-blink 1.6s ease-in-out infinite;
  margin-right: 4px;
}
.status.paused::before { background: var(--warn); }
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.timer {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.rec-actions {
  display: flex; align-items: center; gap: 4px;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
/* When all children are hidden, hide the divider too. JS controls
   .hidden on the buttons; .rec-actions.is-idle is set via a small
   observer-free rule based on the timer's hidden state. */
#timer[hidden] ~ .rec-actions { display: none; }

.icon-btn {
  width: 24px; height: 24px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover {
  background: var(--ink-3);
  color: var(--text);
  border-color: var(--line-bright);
}
.icon-btn:active { transform: translateY(1px); }
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn-resume {
  color: var(--warn);
  border-color: rgba(245, 167, 66, 0.30);
}
.icon-btn-resume:hover {
  background: var(--warn-soft);
  border-color: rgba(245, 167, 66, 0.55);
  color: #fbc171;
}
.icon-btn-stop {
  color: var(--rec);
  border-color: rgba(255, 107, 107, 0.30);
}
.icon-btn-stop:hover {
  background: rgba(255, 107, 107, 0.10);
  border-color: rgba(255, 107, 107, 0.55);
  color: #ff8888;
}

/* ---- Record button (idle state) ---- */
.btn-start-compact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px 0 10px;
  background: linear-gradient(180deg, #1f2030, #15161e);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-start-compact:hover {
  background: linear-gradient(180deg, #262738, #1a1b25);
  border-color: var(--line-accent);
  color: #fff;
}
.btn-start-compact:active { transform: translateY(1px); }
.btn-start-compact:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-start-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.18), 0 0 8px var(--rec-glow);
  flex: 0 0 auto;
}
.btn-start-label { line-height: 1; }

/* ---- Nav links in top bar — icon-only, clearly visible on hover ---- */
.settings-link {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.settings-link:hover {
  color: var(--text);
  background: var(--ink-3);
  border-color: var(--line);
}
.settings-link svg { flex: 0 0 auto; }

/* =========================================================================
   STATUS STRIP
   ========================================================================= */

/* status-strip uses display: contents so its hidden children don't waste
   gap space in the body's flex column when there's nothing to show. */
.status-strip { display: contents; }

.model-status {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-4);
  padding: 2px 8px 2px 12px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
}
.model-status::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 5px var(--go-glow);
}
.model-status.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(244, 113, 116, 0.22);
}
.model-status.error::before { background: var(--danger); box-shadow: 0 0 5px rgba(244, 113, 116, 0.45); }

/* ---- Error toast (within status strip) ---- */
.error {
  font-size: 12px;
  color: #fda4a8;
  padding: 8px 12px;
  background: var(--danger-soft);
  border: 1px solid rgba(244, 113, 116, 0.22);
  border-radius: var(--r-sm);
  position: relative;
}
.error-link { color: var(--accent-strong); text-decoration: underline; margin-left: 4px; }

.global-error {
  position: relative;
  font-size: 12px;
  color: #fda4a8;
  padding: 10px 32px 10px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(244, 113, 116, 0.28);
  border-radius: var(--r-md);
}
.global-error-close {
  position: absolute; top: 4px; right: 6px;
  background: transparent; border: 0;
  color: var(--danger);
  font-size: 18px; line-height: 1;
  cursor: pointer; padding: 4px 6px;
}

/* ---- Captions-suggest banner ---- */
/* =========================================================================
   PANELS
   ========================================================================= */

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
}

.panel-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  /* base label is rendered using .panel-eyebrow children — see HTML */
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.panel-label .panel-eyebrow + span {
  display: inline-block;
  margin-left: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.panel-label-actions { display: flex; gap: 12px; align-items: center; }

/* Quiet inline count next to the "Detected" label — no chip, no border,
   no background. Just a tiny mono number that disappears into the
   eyebrow until you actually look at it. */
.count-pill {
  display: inline;
  margin-left: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

.panel-collapse-btn {
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-sm);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.panel-collapse-btn:hover {
  color: var(--text);
  background: var(--ink-3);
  border-color: var(--line-bright);
}
.panel-collapse-caret {
  font-size: 11px;
  line-height: 1;
  color: var(--text-3);
}
.panel-collapse-btn:hover .panel-collapse-caret { color: var(--accent-strong); }
.panel.is-collapsed > *:not(.panel-label) { display: none !important; }
.panel.is-collapsed { padding-top: 9px; padding-bottom: 9px; }

/* =========================================================================
   ONBOARDING PANEL
   ========================================================================= */

.onboarding-panel {
  background:
    radial-gradient(700px 200px at 0% 0%, var(--cream-soft), transparent 60%),
    var(--ink-1);
  border-color: var(--line);
}
.onboarding-title {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-top: 2px;
}
.onboarding-sub {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 8px;
}
.onboarding-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.onboarding-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.onboarding-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0;
  align-self: start;
  padding-top: 2px;
}
.onboarding-step-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.onboarding-step-help {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 3px;
}
.onboarding-step-help code {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
}
.onboarding-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* =========================================================================
   SIGN-IN PANEL
   ========================================================================= */

.signin-panel {
  padding: 18px 16px 16px;
  background:
    radial-gradient(500px 180px at 100% 0%, var(--accent-soft), transparent 60%),
    var(--ink-1);
}
.signin-title {
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.020em;
  margin: 6px 0 10px;
}
.signin-title br + * { /* no-op for inline structure */ }
.signin-sub {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Official Google "G" used as-is on the white-on-dark sign-in button. */
.signin-google-mark {
  width: 18px; height: 18px;
  margin-right: 10px;
  flex: 0 0 auto;
  display: inline-block;
}

.signin-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-4);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 14px 0 12px;
}
.signin-divider::before,
.signin-divider::after {
  content: ""; flex: 1;
  height: 1px;
  background: var(--line);
}

.signin-form { display: flex; flex-direction: column; gap: 8px; }
.signin-form label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 2px;
}
.signin-form input {
  background: var(--ink-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.signin-form input::placeholder { color: var(--text-4); }
.signin-form input:focus {
  outline: none;
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.signin-toggle {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 10px;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.signin-toggle a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-accent);
}
.signin-toggle a:hover { border-bottom-style: solid; }

.signin-advanced {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.signin-advanced summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  list-style: none;
}
.signin-advanced summary::before { content: "▸"; margin-right: 6px; }
.signin-advanced[open] summary::before { content: "▾"; }
.signin-advanced .row { display: flex; gap: 6px; }
.signin-advanced .row input { flex: 1; }
.signin-advanced label { display: block; margin-top: 8px; }
.signin-advanced .muted.small { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* =========================================================================
   ANONYMOUS HINT
   ========================================================================= */

.anon-hint {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(63, 224, 166, 0.05), transparent),
    var(--ink-1);
  border-color: rgba(63, 224, 166, 0.22);
}
.anon-hint-mark {
  font-size: 8px;
  color: var(--go);
  text-shadow: 0 0 6px var(--go-glow);
}
.anon-hint-body { flex: 1; }
.anon-hint-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.anon-hint-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.anon-hint-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--go);
  text-decoration: none;
  border-bottom: 1px dotted rgba(63, 224, 166, 0.5);
}
.anon-hint-link:hover { border-bottom-style: solid; }

/* =========================================================================
   TABS — pill-style segmented control. Each tab fills equal width, the
   active tab gets a clear filled background so it can't be missed.
   ========================================================================= */

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  /* Same rationale as .topbar — sit above the KB picker dropdown so a
     short panel never visually covers the Transcript / Q&A tabs. */
  z-index: 110;
}
.tab {
  flex: 1 1 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-3);
  transition: color 0.15s ease, background 0.15s ease;
}
.tab-label { letter-spacing: -0.005em; }
.tab:hover { color: var(--text); background: var(--ink-2); }
.tab.active {
  color: var(--text);
  background: var(--ink-3);
  font-weight: 600;
  box-shadow:
    0 0 0 1px var(--line-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.tab-pane {
  display: flex; flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

/* ---- Empty state ---- */
.tab-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-3);
  gap: 6px;
}
.tab-empty-mark {
  font-family: var(--font-body);
  font-size: 24px;
  color: var(--text-4);
  margin-bottom: 6px;
  opacity: 0.7;
}
.tab-empty-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.tab-empty-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 260px;
  line-height: 1.55;
}
/* Prominent Start recording CTA shown inside the empty transcript state
   so a first-time user can't miss the next step. Hidden along with the
   rest of .tab-empty once recording begins (transcriptEmpty.hidden=true
   is driven by the existing recording-state logic). */
.btn-start-big {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 22px 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 22px -10px var(--accent-glow);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-start-big:hover {
  background: var(--accent-strong);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 12px 28px -10px var(--accent-glow);
}
.btn-start-big:active { transform: translateY(1px); }
.btn-start-big:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-start-big-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow:
    0 0 0 2px rgba(255, 107, 107, 0.20),
    0 0 10px var(--rec-glow);
  flex: 0 0 auto;
}

/* =========================================================================
   SUMMARY PANEL
   ========================================================================= */

.summary-panel .summary-body {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.summary-panel .summary-body h3 {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 14px 0 5px;
}
.summary-panel .summary-body h3:first-child { margin-top: 0; }
.summary-panel .summary-body p { margin: 0 0 8px; color: var(--text); }
.summary-panel .summary-body ul { margin: 0 0 10px; padding-left: 18px; }
.summary-panel .summary-body li { margin: 0 0 4px; color: var(--text); }
.summary-panel .summary-body strong { color: var(--text); font-weight: 600; }

/* =========================================================================
   TRANSCRIPT
   ========================================================================= */

.transcript-panel { flex: 1; min-height: 0; }
.transcript-list {
  display: flex; flex-direction: column;
  gap: 12px;
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.65;
}
.transcript-cue, .transcript-block {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  /* Skip layout/paint work for off-screen rows. `contain-intrinsic-size`
     gives the browser a height hint so scrollbar geometry stays sane
     before the row is actually rendered. */
  content-visibility: auto;
  contain-intrinsic-size: auto 44px;
  contain: layout style paint;
}
.transcript-cue:last-child, .transcript-block:last-child { border-bottom: 0; }
.transcript-cue > .ts,
.transcript-block > .ts {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.transcript-cue > :not(.ts) {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}
.transcript-block > .block-speaker {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.transcript-block > .block-text {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0;
  white-space: nowrap;
  text-align: right;
  padding-top: 3px;
}
.block-speaker {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  line-height: 1.3;
}
.block-text { color: var(--text); line-height: 1.55; }
.transcript-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-3);
  font-style: italic;
}

/* =========================================================================
   Q&A — DETECTED QUESTIONS
   ========================================================================= */

#paneQA > .questions-panel { flex: 0 0 auto; }
#paneQA > .ask-panel       { flex: 0 0 auto; }
#paneQA > .answer-panel    { flex: 1 1 auto; min-height: 0; }

.questions-panel { padding: 10px 12px; }
.questions-panel.is-collapsed { padding: 8px 12px; }
.questions-panel .panel-label { font-size: 11.5px; }

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 16vh;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.question-item {
  display: grid;
  /* Last column is the AI-feedback widget. When the widget is collapsed
   * (no rating, not hovered) its `max-width: 0` makes the column add
   * effectively no horizontal space — the row stays the same width as
   * before. When expanded the badges slide in next to the × button.
   *
   * Inline placement avoids the content-visibility/contain conflict
   * that was clipping absolutely-positioned descendants. */
  grid-template-columns: 34px 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  line-height: 1.35;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
  /* Off-screen rows skip paint/layout work. */
  content-visibility: auto;
  contain-intrinsic-size: auto 28px;
  contain: layout style paint;
}
.question-item::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--text-4);
  transition: background 0.18s ease;
}
.question-item:hover { background: var(--ink-3); border-color: var(--line-strong); }
.question-item.priority-high::before   { background: var(--go); }
.question-item.priority-medium::before { background: var(--accent); }
.question-item.priority-low::before    { background: var(--text-4); }

.question-item .q-text,
.question-item .q-edit {
  background: transparent; border: none; padding: 0;
  font: inherit; color: var(--text);
  cursor: text; text-align: left; line-height: 1.4;
  font-size: 11.5px;
  /* Let long questions wrap onto multiple lines instead of getting
     cut off with ellipsis — the parent .questions-list already caps
     vertical space and scrolls. min-width:0 keeps the grid column
     from blowing out on long unbroken strings; overflow-wrap covers
     URLs / no-space text. */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.question-item .q-edit:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--line-accent);
  text-underline-offset: 2px;
}
.question-item .q-ts {
  font-family: var(--font-mono);
  color: var(--text-4);
  font-size: 9.5px;
  letter-spacing: 0;
  align-self: center;
}
.question-item .q-ask {
  background: var(--ink-3);
  color: var(--accent-strong);
  border: 1px solid var(--line-accent);
  border-radius: var(--r-xs);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}
.question-item .q-ask:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.question-item .q-remove {
  background: transparent;
  color: var(--text-4);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  width: 18px; height: 18px;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.question-item .q-remove:hover {
  color: var(--danger);
  border-color: rgba(244, 113, 116, 0.30);
  background: var(--danger-soft);
}
.question-item.active { outline: 1px solid var(--line-accent); outline-offset: -1px; }
.question-item.pending .q-text { opacity: 0.7; }
.question-item.pending .q-text::after { content: " …"; color: var(--text-3); }

/* /open-questions tracks answered status. Dim the row and overlay a check
   marker so users see "this was addressed in the meeting" without losing
   the entry. Click-to-ask still works on answered items (rep can re-ask
   for a refresher) — only the visual emphasis is muted. */
.question-item.status-answered {
  opacity: 0.55;
}
.question-item.status-answered .q-text {
  text-decoration: line-through;
  text-decoration-color: var(--text-4);
  text-decoration-thickness: 1px;
  color: var(--text-3);
}
.question-item.status-answered::after {
  content: "✓";
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #5ee0a8;
  pointer-events: none;
}
.question-item.status-answered:hover { opacity: 0.85; }

/* =========================================================================
   Q&A — ANSWER THREADS (editorial-letter style)
   ========================================================================= */

.answer-panel { flex: 1; min-height: 0; padding: 12px 14px; }

.answer-history {
  display: flex; flex-direction: column;
  gap: 14px;
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0 6px 0 2px;
}
/* The newest thread claims the full visible height ONLY when there are
   collapsed prior threads to push off-screen. For a first thread (no
   priors), the natural content height is used so the user doesn't see
   a viewport-tall empty card while the answer streams. */
.answer-history > .answer-thread.is-collapsed ~ .answer-thread:last-child:not(.is-collapsed) {
  min-height: 100%;
}

.answer-entry, .answer-thread {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-left-color 0.18s ease, background 0.18s ease;
  position: relative;
  /* No content-visibility here — it gave Chrome a placeholder size hint
     that prematurely clipped the streaming answer's height, cutting the
     accent stripe partway through long answers. Threads are typically
     low-count anyway (5–20 per meeting); transcript + questions still
     get the virtualization hint elsewhere. */
}
.answer-thread:last-child { border-left-color: var(--accent); }
.answer-thread:hover      { border-left-color: var(--accent); }

.thread-turns { display: flex; flex-direction: column; gap: 14px; }
.thread-turn  { display: flex; flex-direction: column; gap: 8px; }
.thread-turn + .thread-turn { padding-top: 14px; border-top: 1px dashed var(--line); }

/* Question — clearly the user's text. Bold weight + subtle accent strip
   replaces the serif Q. marker. */
.answer-question {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
}

.answer-body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  padding-top: 4px;
}
.answer-body.streaming::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: stream-blink 1s steps(2) infinite;
}
@keyframes stream-blink {
  0%, 49%   { opacity: 0.85; }
  50%, 100% { opacity: 0; }
}

/* "Thinking…" placeholder shown between submit and the first SSE token.
   Animated three-dot ellipsis via a ::after pseudo-element gives an
   unambiguous "in progress" cue when the server's pre-LLM work
   (embeddings + retrieval + reranking) holds the response open for
   several seconds before tokens start streaming. Replaced by real
   answer content as soon as the first token arrives. */
.answer-thinking {
  color: var(--text-2);
  font-style: italic;
  display: inline-block;
}
.answer-thinking::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: thinking-dots 1.4s steps(4, end) infinite;
}
@keyframes thinking-dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}
.answer-body strong { color: var(--text); font-weight: 600; }
.answer-body em { font-style: italic; }
.answer-body code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.answer-body p { margin: 0 0 8px; }
.answer-body ul, .answer-body ol { margin: 0 0 8px; padding-left: 18px; }
.answer-body li { margin-bottom: 3px; }
.answer-body h1, .answer-body h2, .answer-body h3,
.answer-body h4, .answer-body h5, .answer-body h6 {
  font-family: var(--font-body);
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text);
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.answer-body h4 { font-size: 13px; }
.answer-body h5, .answer-body h6 { font-size: 12.5px; color: var(--text-2); }
/* Tables — used by the LLM for comparison questions (e.g. "X vs Y").
   Compact, sourcebar-style header, single border per row. */
.answer-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}
.answer-body th, .answer-body td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.answer-body th {
  background: var(--ink-2);
  color: var(--text-2);
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  font-size: 11.5px;
}
/* Code blocks — server rarely emits these for the meeting use case but
   we honour them when it does (e.g. inline curl example). */
.answer-body pre {
  margin: 8px 0;
  padding: 8px 10px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
}
.answer-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.answer-sources {
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 10px 12px 8px;
  margin-top: 4px;
  background: var(--ink-1);
  border-top: 1px dashed var(--line);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.sources-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}
.answer-sources ul { list-style: none; padding: 0; margin: 0; }
.answer-sources li {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  padding: 2px 0;
  display: flex; gap: 6px;
  align-items: baseline;
  counter-increment: src-counter;
}
.answer-sources ul { counter-reset: src-counter; }
.answer-sources li::before {
  content: "[" counter(src-counter) "]";
  color: var(--accent);
  font-weight: 500;
}

.thread-followup-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.thread-followup-btn:hover {
  background: var(--ink-3);
  border-color: var(--line-accent);
  color: var(--accent-strong);
}

.thread-reply-box {
  display: flex; gap: 6px;
  margin-top: 6px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.thread-reply-input {
  flex: 1;
  background: var(--ink-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
}
.thread-reply-input:focus {
  outline: none;
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.thread-reply-ask {
  /* shares .btn .btn-ask, see below */
}
.thread-reply-cancel {
  font-size: 10px;
  color: var(--text-3);
}

/* ---- Collapsed (older) threads: one-line summary, click to expand ---- */
.answer-thread.is-collapsed {
  cursor: pointer;
  padding: 8px 12px;
  gap: 0;
  background: transparent;
  border-color: var(--line);
  border-left-color: var(--line);
}
.answer-thread.is-collapsed:hover {
  background: var(--ink-2);
  border-left-color: var(--accent);
}
.answer-thread.is-collapsed .thread-turn { gap: 0; }
.answer-thread.is-collapsed .thread-turn + .thread-turn,
.answer-thread.is-collapsed .thread-followup-btn,
.answer-thread.is-collapsed .thread-reply-box,
.answer-thread.is-collapsed .answer-body,
.answer-thread.is-collapsed .answer-sources {
  display: none !important;
}
.answer-thread.is-collapsed .answer-question {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
  padding: 0;
  padding-right: 18px;
  background: transparent;
  border-left: 0;
}
.answer-thread.is-collapsed::after {
  content: "›";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-55%);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1;
}
.answer-thread.is-collapsed:hover::after { color: var(--accent-strong); }

/* =========================================================================
   Q&A — COMPOSER
   ========================================================================= */

.ask-panel-composer {
  gap: 8px;
  padding: 10px 12px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  position: relative;
}
.ask-panel-composer::before {
  /* hairline highlight at top to lift the composer */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-bright), transparent);
  border-radius: var(--r-md) var(--r-md) 0 0;
  pointer-events: none;
}

.ask-composer-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}

.ask-row {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: var(--ink-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
.ask-row:focus-within {
  border-color: var(--line-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ask-row input {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.ask-row input:focus { outline: none; }
.ask-row input::placeholder { color: var(--text-4); }

.btn-ask {
  width: 38px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  flex: 0 0 38px;
  transition: background 0.15s ease;
}
.btn-ask:hover { background: var(--accent-strong); }
.btn-ask:active { background: var(--accent-deep); }
.btn-ask:disabled { opacity: 0.55; cursor: not-allowed; }

/* =========================================================================
   KB PICKER (button + menu)
   ========================================================================= */

.kb-picker { position: relative; }
.kb-picker-btn {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px 4px 8px;
  max-width: 220px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.kb-picker-btn:hover {
  border-color: var(--line-bright);
  background: var(--ink-2);
  color: var(--text);
}
.kb-picker-btn[aria-expanded="true"] {
  border-color: var(--line-accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.kb-picker-icon {
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
}
.kb-picker-caret { opacity: 0.55; font-size: 9px; }
.kb-picker-menu {
  position: absolute;
  /* Default direction: opens upward (button sits at the bottom of the
     composer, so above is the natural place). JS adds .opens-down when
     the space below the button exceeds the space above. */
  bottom: calc(100% + 6px);
  top: auto;
  /* Anchor to the LEFT edge of the kb-picker button so the menu opens
     rightward into the panel, not leftward past the panel's edge. */
  left: 0;
  right: auto;
  width: 240px;
  /* Hard cap against the side panel's viewport width — leaves 16px of
     breathing room. */
  max-width: calc(100vw - 24px);
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 6px;
  z-index: 100;
  /* Cap on tall panels; clamp on short ones. JS positioning picks the
     direction so the menu always fits inside the viewport. */
  max-height: min(280px, calc(100vh - 160px));
  overflow-y: auto;
  box-shadow:
    0 12px 28px -8px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--line);
}
/* Flipped variant — opens downward from the top edge of the picker
   button. JS sets this class when there isn't enough space above. */
.kb-picker-menu.opens-down {
  bottom: auto;
  top: calc(100% + 6px);
}
.kb-picker-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: var(--r-sm);
  font-size: 11.5px; color: var(--text);
  cursor: pointer; user-select: none;
  min-width: 0;
  transition: background 0.12s ease;
}
.kb-picker-item:hover { background: var(--ink-3); }
.kb-picker-item.disabled { opacity: 0.5; cursor: not-allowed; }
.kb-picker-item input[type="checkbox"] {
  margin: 0; accent-color: var(--accent); flex: 0 0 auto;
}
/* KB name takes available space and truncates with ellipsis. The status
   pill is now a sibling (not a child) so truncation can't squash it. */
.kb-picker-item .kb-picker-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-picker-item .kb-picker-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  flex: 0 0 auto;
}
.kb-picker-item .kb-status-pill { flex: 0 0 auto; margin-left: 0; }

.kb-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--ink-1);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.kb-status-pill::before {
  content: ""; width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-4);
}
.kb-status-pill.is-ready    { color: #cad7cd; }
.kb-status-pill.is-ready::before    { background: var(--go); box-shadow: 0 0 4px var(--go-glow); }
.kb-status-pill.is-indexing { color: #d8cba3; }
.kb-status-pill.is-indexing::before { background: var(--warn); animation: kb-pulse 1.4s ease-in-out infinite; }
.kb-status-pill.is-error    { color: #d8b8b8; }
.kb-status-pill.is-error::before    { background: var(--danger); }
@keyframes kb-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

.kb-picker-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* =========================================================================
   GENERIC BUTTONS / LINKS
   ========================================================================= */

.btn {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--ink-3); color: var(--text); border-color: var(--line-bright); }

.btn-signin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  background: var(--ink-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
}
.btn-signin:hover { background: var(--ink-4); border-color: var(--line-bright); }

.link-btn {
  background: none;
  border: 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  padding: 0;
  transition: color 0.15s ease;
  border-bottom: 1px dotted transparent;
}
.link-btn:hover {
  color: var(--cream);
  border-bottom-color: var(--cream-line);
}

/* =========================================================================
   FOCUS-VISIBLE — global accessibility flair
   ========================================================================= */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--accent-glow);
  border-radius: var(--r-sm);
}
.icon-btn:focus-visible,
.btn-start-compact:focus-visible,
.settings-link:focus-visible,
.signout-icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* =========================================================================
   ANIMATION INTAKES
   ========================================================================= */
.panel { animation: panel-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both; }
/* Hot-path panels (transcript/answer/questions) flip visibility often
   during a meeting; replaying a 220ms transform animation each time
   added perceptible jank. Keep their visible state instant. */
.transcript-panel,
.questions-panel,
.answer-panel,
.ask-panel {
  animation: none;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* No animation on tab switch — replaying a fade-in every time the user
   flips between Transcript and Q&A was the perceptible "tab switch
   hang" on slower machines. Visibility flip is now instant. */
.tab-pane.active { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================================
   INSIGHTS TAB — on-demand summary / follow-ups / action items
   ========================================================================= */

.insights-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.insights-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.insights-action-btn:hover {
  background: var(--ink-3);
  border-color: var(--line-bright);
}
.insights-action-btn:active { transform: translateY(1px); }
.insights-action-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.insights-action-btn.active {
  background: var(--accent-bg, rgba(99, 102, 241, 0.12));
  border-color: var(--accent);
  color: var(--accent);
}
.insights-action-icon {
  font-size: 18px;
  line-height: 1;
}
.insights-action-label {
  font-size: 11.5px;
  line-height: 1.3;
}

.insights-result-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.insights-result-body .insights-loading {
  color: var(--text-2);
  font-style: italic;
  padding: 6px 0;
}
.insights-result-body .insights-error {
  color: var(--danger, #f47174);
  padding: 8px 10px;
  border: 1px solid rgba(244, 113, 116, 0.35);
  border-radius: var(--r-sm);
  background: rgba(244, 113, 116, 0.07);
  font-size: 12.5px;
}
.insights-result-body .insights-empty-state {
  color: var(--text-2);
  font-style: italic;
  font-size: 12.5px;
  padding: 6px 0;
}

/* Structured summary rendering */
.insights-summary-block + .insights-summary-block { margin-top: 12px; }
.insights-summary-block .insights-summary-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 4px;
}
.insights-summary-block ul {
  margin: 0;
  padding-left: 18px;
}
.insights-summary-block li { margin: 2px 0; }
.insights-summary-paragraph { margin: 0; }

/* Follow-up questions list */
.insights-followup-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: followup;
}
.insights-followup-list li {
  counter-increment: followup;
  position: relative;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  margin-bottom: 8px;
  transition: border-color 120ms ease, background 120ms ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.insights-followup-list li::before {
  content: counter(followup);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.insights-followup-list li:hover {
  border-color: var(--line-bright);
  background: var(--ink-3);
}
.insights-followup-list .followup-text {
  line-height: 1.4;
}
.insights-followup-list .followup-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.insights-followup-list .followup-copy-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.insights-followup-list .followup-copy-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--ink-1);
}
.insights-followup-list .followup-copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
}
.insights-followup-list .followup-ask-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.insights-followup-list .followup-ask-btn:hover {
  background: var(--accent-2, var(--accent));
  filter: brightness(1.1);
}
.insights-followup-list .followup-ask-btn:active { transform: scale(0.97); }

/* Action items list */
.insights-action-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.insights-action-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink-2);
  margin-bottom: 8px;
}
.insights-action-text { font-size: 13px; }
.insights-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
}
.insights-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-3);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.insights-action-pill.owner { color: var(--accent); border-color: rgba(99, 102, 241, 0.35); }
.insights-action-pill.due   { color: var(--warn, #f5a742); border-color: rgba(245, 167, 66, 0.32); }
.insights-result-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-2);
  font-style: italic;
}

/* ============================================================
 * AI content feedback (👍 / 👎)
 * Mounted by feedback-ui.js on Q&A answers, summaries, action items,
 * detected questions, and Insights tab outputs.
 * ============================================================ */
.ai-feedback {
  display: inline-flex;
  gap: 4px;
  margin-top: 6px;
  align-items: center;
}
.ai-feedback.busy { opacity: 0.65; }

.ai-fb {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
  color: var(--text-mute);
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.ai-fb:hover:not([disabled]) {
  background: var(--surface-2);
  border-color: var(--border);
}
.ai-fb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.ai-fb[aria-pressed="true"].up {
  color: var(--success);
  background: rgba(63, 224, 166, 0.14);
  border-color: rgba(63, 224, 166, 0.35);
}
.ai-fb[aria-pressed="true"].down {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(244, 113, 116, 0.35);
}
.ai-fb[disabled] {
  cursor: progress;
  opacity: 0.55;
}

/* Read-only widgets (admin viewing someone else's meeting) — disabled
 * thumbs that should still clearly show the user's rating, not look
 * "pending". We keep full opacity on the pressed thumb and fade the
 * unpressed one to a soft hint. Cursor stays default so the affordance
 * matches the lack of interactivity. */
.ai-feedback.readonly .ai-fb[disabled] {
  cursor: default;
  opacity: 1;
}
.ai-feedback.readonly .ai-fb[aria-pressed="false"] {
  opacity: 0.35;
}
.ai-feedback.readonly .ai-fb:hover {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}

/* Dense list surfaces (live detected-questions in sidepanel, history-popup
 * detected questions) — inline collapse/expand reaction badges in the row's
 * own grid track. The widget collapses to max-width: 0 when not active
 * (so the row keeps its pre-feedback compact width), and slides out to
 * full width on hover, focus, or when the user has already rated.
 *
 * Behavior:
 *   - No rating + not hovered  → collapsed (zero width, fully invisible)
 *   - No rating + hovered      → both 👍 and 👎 slide in
 *   - One rating + not hovered → only the pressed thumb is visible (badge)
 *   - One rating + hovered     → both thumbs show again so the user can flip
 */
.question-item .ai-feedback,
.dq-row .ai-feedback {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-width 150ms ease, opacity 120ms ease;
}
.question-item:hover .ai-feedback,
.question-item:focus-within .ai-feedback,
.dq-row:hover .ai-feedback,
.dq-row:focus-within .ai-feedback {
  max-width: 56px;
  opacity: 1;
  pointer-events: auto;
}
.question-item .ai-feedback:has(.ai-fb[aria-pressed="true"]),
.dq-row .ai-feedback:has(.ai-fb[aria-pressed="true"]) {
  max-width: 56px;
  opacity: 1;
  pointer-events: auto;
}

/* When a thumb is already pressed AND the row isn't hovered/focused,
 * show only the pressed thumb (the badge). Hovering brings the other
 * back in so the user can flip. */
.question-item:not(:hover):not(:focus-within) .ai-feedback:has(.ai-fb[aria-pressed="true"]) .ai-fb:not([aria-pressed="true"]),
.dq-row:not(:hover):not(:focus-within) .ai-feedback:has(.ai-fb[aria-pressed="true"]) .ai-fb:not([aria-pressed="true"]) {
  display: none;
}
.question-item:not(:hover):not(:focus-within) .ai-feedback:has(.ai-fb[aria-pressed="true"]),
.dq-row:not(:hover):not(:focus-within) .ai-feedback:has(.ai-fb[aria-pressed="true"]) {
  max-width: 28px;        /* only one thumb visible when collapsed */
}

/* Tiny reaction-emoji buttons. */
.question-item .ai-fb,
.dq-row .ai-fb {
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  background: var(--ink-1);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.question-item .ai-fb:hover:not([disabled]),
.dq-row .ai-fb:hover:not([disabled]) {
  background: var(--ink-2);
}
.question-item .ai-fb[aria-pressed="true"].up,
.dq-row .ai-fb[aria-pressed="true"].up {
  background: rgba(63, 224, 166, 0.22);
  border-color: rgba(63, 224, 166, 0.55);
}
.question-item .ai-fb[aria-pressed="true"].down,
.dq-row .ai-fb[aria-pressed="true"].down {
  background: rgba(244, 113, 116, 0.22);
  border-color: rgba(244, 113, 116, 0.55);
}
