/* ============================================================
   TALOS — AI COMMAND SURFACE v2.0
   Ultra-premium · Glassmorphic · Neural depth · Cinematic
   ============================================================ */

/* Manrope — HIKE brand typeface */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;700;800&display=swap');

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Background layers */
  --bg-void: #0B0B0F;
  --bg-deep: #0d0b18;

  /* Glass layers — warm-tinted */
  --glass-0:  rgba(252,249,247,0.02);
  --glass-1:  rgba(252,249,247,0.05);
  --glass-2:  rgba(252,249,247,0.09);
  --glass-3:  rgba(252,249,247,0.15);

  /* ── HIKE Brand Palette ────────────────────────────────── */
  /* ── Status colors (functional, not brand) ── */
  /* Green = System online / Connected — always stays green */
  --emerald:       #10b981;
  --emerald-dim:   rgba(16,185,129,0.18);
  --emerald-glow:  rgba(16,185,129,0.35);

  /* 10% — Punchy yellow (key accent) */
  --blue:          #F4EB33;
  --blue-dim:      rgba(244,235,51,0.14);
  --blue-glow:     rgba(244,235,51,0.35);

  /* Purple reused as violet slot */
  --violet:        #7E6E94;
  --violet-dim:    rgba(126,110,148,0.14);
  --violet-glow:   rgba(126,110,148,0.35);

  /* Yellow as cyan slot (bright accent) */
  --cyan:          #F4EB33;
  --cyan-dim:      rgba(244,235,51,0.12);

  /* Brand cream — used for warm highlights */
  --cream:         #FCF9F7;
  --pink:          #a08bb8;  /* soft purple tint */

  /* ── Text — cream-based ────────────────────────────────── */
  --t1: #FCF9F7;                     /* 100% cream  */
  --t2: rgba(252,249,247,0.82);      /* 82%         */
  --t3: rgba(252,249,247,0.55);      /* 55%         */
  --t4: rgba(252,249,247,0.30);      /* 30%         */
  --t5: rgba(252,249,247,0.14);      /* 14%         */

  /* Geometry */
  --bar-width:  clamp(560px, 58vw, 800px);
  --r-xl:       32px;
  --r-lg:       22px;
  --r-md:       14px;
  --r-sm:       10px;

  /* Easing */
  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── HIKE Background: dark base + purple right glow ─────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    /* Purple atmospheric column — right side (30%) */
    radial-gradient(ellipse 55% 90% at 88% 45%,
      rgba(126,110,148,0.55) 0%,
      rgba(126,110,148,0.30) 25%,
      rgba(11,11,15,0)       65%),
    /* Soft purple left atmosphere */
    radial-gradient(ellipse 40% 60% at 10% 70%,
      rgba(126,110,148,0.18) 0%,
      transparent 60%),
    /* Deep space base */
    #0B0B0F;
  pointer-events: none;
}

/* ─── Yellow accent hairline at the very top ──────────────── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  z-index: 100;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244,235,51,0.8) 35%,
    rgba(244,235,51,0.4) 60%,
    transparent 100%
  );
  pointer-events: none;
}

/* ─── Neural Grid Canvas ─────────────────────────────────── */
#neuralCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}

/* ─── Ambient Orbs ───────────────────────────────────────── */
.ambient-orbs {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation: orbDrift 24s ease-in-out infinite;
}

/* Yellow orb — top left, primary accent (10%) */
.orb-1 {
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(244,235,51,0.13) 0%, rgba(244,235,51,0.04) 45%, transparent 70%);
  filter: blur(90px);
  top: -25%; left: -15%;
  animation-duration: 26s;
}
/* Purple orb — bottom right, secondary (30%) */
.orb-2 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(126,110,148,0.22) 0%, rgba(126,110,148,0.06) 45%, transparent 70%);
  filter: blur(80px);
  bottom: -20%; right: -10%;
  animation-duration: 32s;
  animation-delay: -12s;
}
/* Purple orb — mid right */
.orb-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(126,110,148,0.12) 0%, transparent 65%);
  filter: blur(60px);
  top: 35%; right: 15%;
  animation-duration: 20s;
  animation-delay: -6s;
}
/* Yellow orb — bottom left, subtle warmth */
.orb-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(244,235,51,0.07) 0%, transparent 60%);
  filter: blur(50px);
  top: 60%; left: 8%;
  animation-duration: 18s;
  animation-delay: -3s;
}

@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(35px, -45px) scale(1.06); }
  50%       { transform: translate(-15px, 25px) scale(0.96); }
  75%       { transform: translate(20px, 40px) scale(1.03); }
}

/* ─── Energy Trace Line ──────────────────────────────────── */
#energyTrace {
  position: fixed;
  top: 0; left: 50%;
  width: 1px;
  height: 0;
  background: linear-gradient(180deg, transparent 0%, var(--blue) 40%, var(--violet) 70%, transparent 100%);
  transform: translateX(-50%);
  z-index: 38;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  filter: blur(0.5px);
  box-shadow: 0 0 8px var(--blue-glow), 0 0 20px var(--violet-glow);
}

#energyTrace.fire {
  opacity: 1;
  animation: traceDown 0.8s var(--ease-out) forwards;
}

@keyframes traceDown {
  0%   { height: 0; opacity: 0; }
  40%  { opacity: 1; }
  100% { height: 100vh; opacity: 0; }
}

/* ─── Surface Header ─────────────────────────────────────── */
#surfaceHeader {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30; /* above chatSurface (25) so back-link is always clickable */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  /* Fully solid background — no content bleeds through when scrolling */
  background: var(--bg-void);
}

#surfaceHeader.visible {
  opacity: 1;
  pointer-events: auto;
}

.brand-mark {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #F4EB33;
  filter: drop-shadow(0 0 10px rgba(244,235,51,0.7)) drop-shadow(0 0 28px rgba(244,235,51,0.3));
}

.brand-mark span {
  color: #F4EB33;
  font-weight: 800;
  letter-spacing: 0.45em;
}

/* ─── Logout Button — fully floating, no border/bg ───────── */
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 40px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  color: var(--t4);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Manrope', sans-serif;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
  cursor: pointer;
}

.logout-btn:hover {
  background: transparent;
  border: none;
  color: #F4EB33;
  transform: translateX(2px);
  box-shadow: none;
}

.logout-btn svg {
  transition: transform 0.2s var(--ease);
}

.logout-btn:hover svg {
  transform: translateX(2px);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Right side control group: back | sign-out | toggle */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Back button — fully floating, no border/bg */
#backButton.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 40px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  color: var(--t4);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: color 0.2s var(--ease), opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

#backButton.header-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#backButton.header-btn svg {
  transition: transform 0.2s var(--ease);
}

#backButton.header-btn:hover {
  background: transparent;
  border: none;
  color: #F4EB33;
  transform: translateX(-3px);
}

#backButton.header-btn:hover svg {
  transform: translateX(-3px);
}

/* Light mode override for header back button — still floating */
[data-theme="light"] #backButton.header-btn {
  background: transparent;
  border: none;
  color: rgba(28,28,28,0.45);
}
[data-theme="light"] #backButton.header-btn:hover {
  background: transparent;
  border: none;
  color: #6b5e00;
  transform: translateX(-3px);
}
[data-theme="light"] .logout-btn {
  background: transparent;
  border: none;
  color: rgba(28,28,28,0.45);
}
[data-theme="light"] .logout-btn:hover {
  background: transparent;
  border: none;
  color: #6b5e00;
}

.sys-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald-glow);
  animation: connPulse 2.5s ease-in-out infinite;
}

.sys-label {
  font-size: 0.625rem;
  font-weight: 300;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--t4);
}

/* ─── Login Screen ───────────────────────────────────────── */
#loginScreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3rem;
}

/* ─── HIKE Logo (above hero text) ───────────────────────── */
#hikeLogo {
  display: block;
  width: 100px;
  height: 100px;
  margin: 0 auto 0.75rem;
  flex-shrink: 0;
  object-fit: contain;
  animation: fadeUpIn 0.85s 0.2s var(--ease) both;
}







.login-hero {
  text-align: center;
  animation: fadeUpIn 0.9s var(--ease) forwards;
}

.login-eyebrow {
  font-size: 0.625rem;
  font-weight: 300;
  letter-spacing: 0.6em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 1.5rem;
}

.login-wordmark {
  font-size: clamp(4rem, 9vw, 7rem);
  font-weight: 100;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--emerald) 0%, var(--cyan) 40%, var(--blue) 70%, var(--violet) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 40px rgba(59,130,246,0.2));
}

.login-tagline {
  font-size: 0.8125rem;
  font-weight: 200;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--t3);
}

.google-signin-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 2.75rem;
  background: var(--glass-1);
  backdrop-filter: blur(48px);
  -webkit-backdrop-filter: blur(48px);
  border: none;
  outline: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl);
  color: var(--t2);
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Inter', inherit;
  transition: all 0.35s var(--ease);
  box-shadow:
    0 8px 48px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.07);
  animation: fadeUpIn 0.9s 0.2s var(--ease) both;
}

.google-signin-btn:hover {
  background: var(--glass-2);
  outline-color: rgba(255,255,255,0.2);
  transform: translateY(-3px);
  box-shadow: 0 20px 70px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
  color: var(--t1);
}

.login-secure {
  font-size: 0.5875rem;
  font-weight: 200;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--t5);
  animation: fadeUpIn 0.9s 0.4s var(--ease) both;
}

/* ─── Command Surface Root ───────────────────────────────── */
#commandSurface {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: align-items 0.6s var(--ease);
}

/* ─── Center Stage ───────────────────────────────────────── */
#centerStage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: var(--bar-width);
  transition: transform 0.55s var(--ease);
}

/* When user starts typing — slide hero up to make room for results */
#centerStage.searching {
  transform: translateY(-10vh);
}

/* ─── Hero Text ──────────────────────────────────────────── */
#stageHero {
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: transform;
}

#stageHero.visible {
  opacity: 1;
  transform: translateY(0);
  animation: heroFloat 7s ease-in-out infinite;
}

@keyframes heroFloat {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-18px); }
  100% { transform: translateY(0px); }
}

.hero-eyebrow {
  font-size: 0.575rem;
  font-weight: 300;
  letter-spacing: 0.65em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--blue), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: eyebrowGlow 9s ease-in-out infinite;
}

@keyframes eyebrowGlow {
  0%, 100% { filter: brightness(1);   opacity: 0.7; }
  50%       { filter: brightness(1.4); opacity: 1;   }
}

.hero-title {
  font-size: clamp(30px, 3.8vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

@keyframes titleBreath {
  0%, 100% { text-shadow: 0 0 20px rgba(168,85,247,0.25), 0 0 60px rgba(59,130,246,0.15); opacity: 1; }
  50%       { text-shadow: 0 0 40px rgba(168,85,247,0.45), 0 0 100px rgba(59,130,246,0.25), 0 0 160px rgba(168,85,247,0.1); opacity: 1; }
}


/* ─── Hero Title Layout ──────────────────────────────────── */
.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

.hero-static {
  display: block;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.04em;
}

/* ─── Cycling Words ──────────────────────────────────────── */
.cycling-words {
  position: relative;
  display: block;
  height: 1.6em;        /* extra room for descenders (g, y, p…) */
  overflow: visible;    /* never clip */
}

.cw {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  white-space: nowrap;
  opacity: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
  /* padding-bottom extends the background-clip:text region below the
     baseline so descenders on g, y, p are never cut off */
  padding-bottom: 0.3em;
  background: linear-gradient(90deg, #F4EB33 0%, #F4EB33 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* filter intentionally NOT set here — lives in keyframes only */
  filter: drop-shadow(0 0 0px transparent);
  animation: cwCycle 8s ease-in-out infinite;
}

@keyframes cwCycle {
  /* enter: fade + glow blooms in */
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px);  filter: drop-shadow(0 0 0px transparent); }
  6%   { opacity: 1; transform: translateX(-50%) translateY(0);    filter: drop-shadow(0 0 14px rgba(244,235,51,0.7)); }
  /* hold */
  19%  { opacity: 1; transform: translateX(-50%) translateY(0);    filter: drop-shadow(0 0 14px rgba(244,235,51,0.7)); }
  /* exit: glow fades out with opacity — no ghost */
  25%  { opacity: 0; transform: translateX(-50%) translateY(-8px); filter: drop-shadow(0 0 0px transparent); }
  /* wait invisible — glow fully off */
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); filter: drop-shadow(0 0 0px transparent); }
}



/* ─── Command Bar ────────────────────────────────────────── */

#commandBar {
  position: relative;
  width: var(--bar-width);
  background: rgba(13,11,24,0.75);
  backdrop-filter: blur(60px) saturate(150%);
  -webkit-backdrop-filter: blur(60px) saturate(150%);
  border-radius: var(--r-xl);
  box-shadow:
    0 0 0 1px rgba(252,249,247,0.07),
    0 30px 100px rgba(0,0,0,0.7),
    0 0 60px rgba(126,110,148,0.06),
    inset 0 1px 0 rgba(252,249,247,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.3);
  z-index: 30;
  overflow: hidden;
  animation: barFloat 7s ease-in-out infinite;
  transition:
    width 0.7s var(--ease),
    background 0.5s var(--ease),
    box-shadow 0.5s var(--ease);
  will-change: transform;
}

@keyframes barFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-4px); }
}

/* Breathing glow ring */
#commandBar::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--r-xl) + 1px);
  background: transparent;
  animation: glowBreathe 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes glowBreathe {
  /* yellow at rest — subtle */
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(244,235,51,0.10),
      0 0 30px rgba(244,235,51,0.04);
  }
  /* purple at peak */
  50% {
    box-shadow:
      0 0 0 1px rgba(126,110,148,0.20),
      0 0 60px rgba(126,110,148,0.12),
      0 0 120px rgba(244,235,51,0.05);
  }
}

/* Connected state — green (functional status indicator) */
#commandBar.connected::before {
  animation: glowConnected 3.5s ease-in-out infinite;
}

@keyframes glowConnected {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(16,185,129,0.30),
      0 0 40px rgba(16,185,129,0.14);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(16,185,129,0.55),
      0 0 80px rgba(16,185,129,0.24),
      0 0 150px rgba(16,185,129,0.08);
  }
}

/* ─── Search Phase ───────────────────────────────────────── */
#searchPhase {
  position: relative;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
}

#searchPhase.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0; left: 0; right: 0;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.375rem 1.875rem;
}

.search-icon {
  flex-shrink: 0;
  width: 17px; height: 17px;
  color: var(--t4);
  transition: color 0.3s var(--ease), filter 0.3s var(--ease);
}

.search-icon.active {
  color: var(--blue);
  filter: drop-shadow(0 0 6px var(--blue-dim));
}

#commandInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-size: 1.0625rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  font-family: 'Inter', inherit;
  caret-color: var(--blue);
}

#commandInput::placeholder {
  color: var(--t4);
  font-weight: 200;
  letter-spacing: 0.07em;
}

.search-shortcut {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--t5);
  background: rgba(255,255,255,0.04);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Search Results ─────────────────────────────────────── */
#searchResults {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s var(--ease);
}

#searchResults.has-results {
  max-height: 460px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.results-list {
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Floating result entry */
.result-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  border-radius: var(--r-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  animation: resultRise 0.4s var(--ease) forwards;
  transition:
    background 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
  will-change: transform;
  position: relative;
  overflow: hidden;
}

.result-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(168,85,247,0.04) 100%);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.result-entry:hover {
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 30px rgba(59,130,246,0.05);
}

.result-entry:hover::before { opacity: 1; }

@keyframes resultRise {
  to { opacity: 1; transform: translateY(0); }
}

.result-name {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--t2);
  letter-spacing: 0.025em;
  margin-bottom: 0.2rem;
}

.result-id {
  font-size: 0.7rem;
  font-weight: 300;
  font-family: 'JetBrains Mono', monospace;
  color: var(--t4);
  letter-spacing: 0.1em;
}

.result-arrow {
  color: var(--t5);
  font-size: 0.8rem;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
  flex-shrink: 0;
}

.result-entry:hover .result-arrow {
  transform: translateX(4px);
  color: var(--t3);
}

.results-hint {
  padding: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--t4);
  letter-spacing: 0.08em;
  text-align: center;
  font-family: 'Inter', inherit;
}

/* ─── Connection Banner ──────────────────────────────────── */
#connectionBanner {
  padding: 1.125rem 1.875rem;
  display: none;
  align-items: center;
  gap: 1rem;
}

#connectionBanner.visible {
  display: flex;
  animation: fadeUpIn 0.6s var(--ease) forwards;
}

.conn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald-glow);
  animation: connPulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes connPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(1.4); }
}

.conn-label {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--emerald);
  font-family: 'JetBrains Mono', monospace;
}

.conn-change {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--t5);
  cursor: pointer;
  transition: color 0.2s var(--ease);
  text-transform: uppercase;
}

.conn-change:hover { color: var(--t3); }

/* ─── Workspace Context Bar — Fixed Top Below Header ─── */
.ws-context-bar {
  position: fixed;
  top: 46px; /* flush below header */
  left: 0; right: 0;
  z-index: 28; /* above chat surface (25), below main header (30) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 2.5rem;
  /* Fully solid — zero bleed from scrolled content */
  background: var(--bg-void);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.55), 0 1px 0 rgba(168,85,247,0.08);
}

.ws-context-bar.visible {
  display: flex;
}

.ws-context-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ws-ctx-label {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(168, 85, 247, 0.65);
  font-family: 'JetBrains Mono', monospace;
  margin-right: 0.5rem;
}

/* ─── Workspace Selector ─────────────────────────────────── */
.workspace-selector {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.ws-label {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: rgba(168, 85, 247, 0.95);
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.2s var(--ease), background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  cursor: pointer;
  /* Bigger tap/click target */
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-sm, 8px);
  min-width: 140px;
}

.ws-label:hover {
  color: rgba(200, 130, 255, 1);
  background: rgba(168, 85, 247, 0.07);
}

.ws-label #wsName { color: #fff; font-weight: 500; }

.ws-label #wsName {
  color: rgba(168,85,247,0.8);
  font-weight: 300;
}

.ws-caret {
  font-size: 0.55rem;
  color: var(--t5);
  transition: transform 0.2s;
}

.workspace-selector:hover .ws-label { color: var(--t1); }
.workspace-selector:hover .ws-caret { transform: translateY(1px); }

/* Workspace dropdown — opens downward (bar is at top) */
.ws-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 280px;
  background: rgba(6,4,18,0.97);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: var(--r-lg);
  padding: 0.35rem 0;
  display: none;
  flex-direction: column;
  z-index: 50;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.55);
}

.ws-dropdown.open { display: flex; animation: fadeUpIn 0.15s var(--ease) forwards; }

.ws-item {
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--t3);
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  /* Full-width row — entire row is the click target */
  width: 100%;
  box-sizing: border-box;
}

.ws-item:hover { color: var(--t1); background: rgba(168,85,247,0.09); }
.ws-item.active {
  color: rgba(168,85,247,0.9);
  background: rgba(168,85,247,0.06);
}

.ws-item-id {
  font-size: 0.62rem;
  color: var(--t5);
  margin-left: auto;
  /* Don't intercept click events from parent row */
  pointer-events: none;
}

.ws-item.active .ws-item-id { color: rgba(168,85,247,0.4); }

/* ─── Chat Surface ───────────────────────────────────────── */
#chatSurface {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  pointer-events: none; /* surface itself is transparent to clicks */
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

#chatSurface.active {
  opacity: 1;
}

/* Messages area — only captures scroll/clicks while IN chat mode */
#chatMessages {
  flex: 1;
  overflow-y: auto;
  /*
   * ❄️ Frozen-row clearance:
   *   ~64px  = surfaceHeader height
   *   ~42px  = wsContextBar height
   *   + 24px = breathing room
   * = 130px top — content never starts under the frozen bars
   *
   * Bottom padding matches chatInputArea (~200px quick chips + input + fade)
   */
  padding: 130px 0 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  scrollbar-width: none;
  pointer-events: none; /* disabled until chat is active */
}

#chatSurface.active #chatMessages {
  pointer-events: auto; /* scrollable + clickable only in chat mode */
}

#chatMessages::-webkit-scrollbar { display: none; }

/* ─── Floating messages — NO box, NO border, NO background ── */
.msg-bubble {
  width: var(--bar-width);
  max-width: 90vw;
  padding: 0.25rem 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.72;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: translateY(10px);
  animation: bubbleFloat 0.5s var(--ease) forwards;
  will-change: transform, opacity;
  position: relative;
  overflow: visible;
}

@keyframes bubbleFloat {
  to { opacity: 1; transform: translateY(0); }
}

.msg-bubble.user  { color: var(--t3); }
.msg-bubble.assistant { color: rgba(255,255,255,0.92); } /* slightly brighter for Talos responses */

/* System / status messages — subtler */
.msg-bubble.system { color: var(--t4); font-size: 0.8rem; }

/* No accent bar — just space */
.msg-bubble.assistant::before { display: none; }

.msg-meta {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
  font-family: 'JetBrains Mono', monospace;
}

.msg-bubble.user .msg-meta    { color: rgba(255,255,255,0.38); font-size: 0.65rem; }
.msg-bubble.assistant .msg-meta {
  color: rgba(168,85,247,0.95);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.55));
}

/* ─── Markdown Content Styles ────────────────────────────── */
.msg-content { word-break: break-word; }

/* Paragraph spacing */
.md-p { margin: 0; display: block; }
.md-p + .md-p { margin-top: 0.5rem; }

/* Headings */
.md-h1, .md-h2, .md-h3 {
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.35rem;
  color: var(--t1);
}
.md-h1 { font-size: 1.05rem; }
.md-h2 { font-size: 0.97rem; color: var(--t2); }
.md-h3 { font-size: 0.9rem;  color: var(--t3); font-weight: 300; }

/* Horizontal rule */
.md-hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 1rem 0;
}

/* Lists */
.md-ul, .md-ol {
  margin: 0.4rem 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.md-ul li, .md-ol li {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--t2);
  line-height: 1.6;
}

/* Arrow action list */
.md-arrow-list {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.md-arrow {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--emerald);
  letter-spacing: 0.02em;
}
.md-arrow::before {
  content: '→';
  color: rgba(16,185,129,0.55);
  flex-shrink: 0;
}

/* Tables */
.md-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: var(--r-md);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.md-table thead { background: rgba(168,85,247,0.08); }
.md-table th {
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(168,85,247,0.75);
  border-bottom: 1px solid rgba(168,85,247,0.14);
}
.md-table td {
  padding: 0.55rem 0.9rem;
  color: var(--t2);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.md-table tr:last-child td { border-bottom: none; }
.md-table tr:hover td { background: rgba(255,255,255,0.025); }

/* Code */
.md-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  background: rgba(255,255,255,0.07);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  color: var(--cyan);
}
.md-pre {
  background: rgba(0,0,0,0.4);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.775rem;
  line-height: 1.6;
  color: var(--t2);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.4rem 0;
}

.typing-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(168,85,247,0.55);
  animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingPulse {
  0%, 60%, 100% { transform: translateY(0) scale(1); opacity: 0.35; }
  30%           { transform: translateY(-7px) scale(1.1); opacity: 1; }
}


/* ─── Chat Input Area — fully floating, no panel ─────────── */
#chatInputArea {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2.5rem;
  background: linear-gradient(to top, rgba(0,0,4,0.98) 40%, rgba(0,0,4,0.65) 75%, transparent);
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.65s var(--ease);
}

#chatInputArea.active {
  transform: translateY(0);
  pointer-events: auto;
}

/* ─── Operations Library ─ popup panel above input bar ───── */
.ops-library {
  position: absolute;
  bottom: calc(100% + 8px); /* floats just above the input bar */
  left: 0;
  right: 0;
  z-index: 40;
  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.ops-library.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Glassmorphic inner panel */
.ops-library-inner {
  background: rgba(4, 2, 16, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 14px;
  padding: 1rem 1.1rem 0.9rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* One group = section header + collapsible cards */
.ops-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Clickable section header row */
.ops-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0.45rem 0.1rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.ops-group-header:hover {
  background: rgba(255,255,255,0.03);
}

.ops-group-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Coloured dot — reflects section colour */
.ops-group-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.ops-group-label {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(252,249,247,0.55);
}

.ops-group-count {
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(252,249,247,0.22);
  padding: 0.1rem 0.35rem;
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
}

/* Chevron rotates when open */
.ops-group-chevron {
  width: 13px;
  height: 13px;
  color: rgba(252,249,247,0.22);
  transition: transform 0.22s var(--ease), color 0.15s;
  flex-shrink: 0;
}
.ops-group.open .ops-group-chevron {
  transform: rotate(180deg);
  color: rgba(252,249,247,0.5);
}

/* Cards hidden by default — animate open */
.ops-cards {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 2px;
  /* Collapsed by default */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.28s var(--ease), opacity 0.2s var(--ease), padding 0.2s;
  padding-top: 0;
  margin-top: 0;
}
.ops-cards::-webkit-scrollbar { display: none; }

.ops-group.open .ops-cards {
  max-height: 160px;
  opacity: 1;
  pointer-events: auto;
  padding-top: 0.45rem;
  margin-top: 0;
}

/* Individual card */
.ops-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.7rem 1rem 0.65rem;
  min-width: 110px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  text-align: left;
}

.ops-card:hover {
  background: rgba(168, 85, 247, 0.07);
  border-color: rgba(168, 85, 247, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.12);
}

.ops-card:active {
  transform: translateY(0);
  box-shadow: none;
}

.ops-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 0.15rem;
  filter: saturate(0.8);
  transition: filter 0.2s;
}
.ops-card:hover .ops-icon { filter: saturate(1.4); }

.ops-card-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.ops-card-desc {
  font-size: 0.62rem;
  font-weight: 300;
  color: var(--t5);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
  line-height: 1.3;
  white-space: nowrap;
}

/* Accent card variant — Ecommerce green */
.ops-card--accent {
  border-color: rgba(16,185,129,0.18);
}
.ops-card--accent:hover {
  background: rgba(16,185,129,0.07);
  border-color: rgba(16,185,129,0.35);
  box-shadow: 0 6px 20px rgba(16,185,129,0.12);
}
.chat-input-glass {
  width: var(--bar-width);
  max-width: 90vw;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 0;
  transition: border-color 0.3s var(--ease);
}

.chat-input-glass:focus-within {
  border-top-color: rgba(168,85,247,0.2);
}

#chatInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  resize: none;
  max-height: 160px;
  line-height: 1.72;
  caret-color: var(--violet);
  scrollbar-width: none;
}

#chatInput::-webkit-scrollbar { display: none; }

#chatInput::placeholder {
  color: var(--t4);
  font-weight: 200;
  letter-spacing: 0.09em;
}

/* Ghost send button — glow only, no box */
#sendButton {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
  opacity: 0.45;
  filter: none;
  box-shadow: none;
  position: relative;
}

#sendButton:hover {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(168,85,247,0.7));
  transform: none;
}

#sendButton:active { opacity: 0.6; }

#sendButton svg {
  width: 17px; height: 17px;
  color: var(--violet);
}

/* Ghost mic button */
#micButton {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
  opacity: 0.35;
  position: relative;
}

#micButton svg {
  width: 16px; height: 16px;
  color: var(--t3);
  transition: color 0.2s;
}

#micButton:hover {
  opacity: 0.8;
  filter: drop-shadow(0 0 8px rgba(255,80,80,0.4));
}

#micButton:hover svg { color: #ff6b6b; }

/* Recording active state */
#micButton.recording {
  opacity: 1;
  animation: micPulse 1.2s ease-in-out infinite;
}

#micButton.recording svg { color: #ff4444; }

@keyframes micPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,40,40,0.5)); }
  50%       { filter: drop-shadow(0 0 18px rgba(255,40,40,0.9)); }
}

/* ─── Language Picker ────────────────────────────────────── */
.lang-picker-wrap {
  position: relative;
  flex-shrink: 0;
}

#langButton {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
  position: relative;
}

#langButton svg {
  width: 15px; height: 15px;
  color: var(--t3);
  transition: color 0.2s;
}

#langButton:hover {
  opacity: 0.8;
  filter: drop-shadow(0 0 8px rgba(168,85,247,0.3));
}
#langButton:hover svg { color: rgba(168,85,247,0.85); }

#langButton.active-lang {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.5));
}
#langButton.active-lang svg { color: rgba(168,85,247,1); }

/* Badge showing language code on the button */
.lang-badge {
  position: absolute;
  bottom: -2px;
  right: -3px;
  font-size: 0.38rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  color: rgba(168,85,247,0.9);
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 3px;
  padding: 0 2px;
  line-height: 1.4;
  display: none; /* hidden when English */
}
.lang-badge.visible { display: block; }

/* Dropdown panel */
.lang-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -8px;
  min-width: 160px;
  background: rgba(4, 2, 16, 0.95);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 12px;
  padding: 0.5rem 0.4rem;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  z-index: 50;
}

.lang-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-dropdown-label {
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(168,85,247,0.4);
  padding: 0.25rem 0.5rem 0.4rem;
}

.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 0.42rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 300;
  font-family: 'Inter', sans-serif;
  color: var(--t3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}
.lang-option:hover {
  background: rgba(168,85,247,0.08);
  color: var(--t1);
}
.lang-option.active {
  background: rgba(168,85,247,0.12);
  color: rgba(168,85,247,0.95);
  font-weight: 400;
}


/* Polish / Enhance button */
#polishButton {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
}

#polishButton svg {
  width: 15px; height: 15px;
  color: #f59e0b;
  transition: color 0.2s;
}

#polishButton:hover {
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(245,158,11,0.6));
}

#polishButton.polishing {
  opacity: 1;
  animation: polishSpin 1.5s linear infinite;
}

#polishButton.polishing svg { color: #fbbf24; }

@keyframes polishSpin {
  0%   { filter: drop-shadow(0 0 6px rgba(245,158,11,0.5)); transform: rotate(0deg); }
  50%  { filter: drop-shadow(0 0 16px rgba(245,158,11,0.9)); }
  100% { filter: drop-shadow(0 0 6px rgba(245,158,11,0.5)); transform: rotate(360deg); }
}

/* Library / book button */
#libraryButton {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity 0.25s var(--ease), filter 0.25s var(--ease);
}

#libraryButton svg {
  width: 15px; height: 15px;
  color: var(--t3);
  transition: color 0.2s;
}

#libraryButton:hover {
  opacity: 0.8;
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.4));
}
#libraryButton:hover svg { color: rgba(168,85,247,0.9); }

/* Active = panel is open: purple glow stays on */
#libraryButton.active {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(168,85,247,0.65));
}
#libraryButton.active svg { color: rgba(168,85,247,1); }

/* ─── Shared Animations ──────────────────────────────────── */
@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Message content styles ─────────────────────────────── */
.msg-content p { margin-bottom: 0.6rem; }
.msg-content p:last-child { margin-bottom: 0; }

.msg-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  background: rgba(34,211,238,0.08);
  padding: 0.15em 0.5em;
  border-radius: 6px;
  color: var(--cyan);
}

.msg-content pre {
  background: rgba(0,0,0,0.4);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  overflow-x: auto;
}

.msg-content pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--t2);
}

.msg-content strong { font-weight: 500; color: var(--t1); }
.msg-content em { color: var(--t3); font-style: italic; }

.msg-content ul, .msg-content ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.msg-content li { margin-bottom: 0.35rem; color: var(--t2); }

/* Scrollbar */
#chatMessages {
  scrollbar-color: rgba(168,85,247,0.15) transparent;
  scrollbar-width: thin;
}

/* ─── Paginated List Table ───────────────────────────────── */
.list-table-heading {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--t2);
  margin-bottom: 0.85rem;
  letter-spacing: 0.01em;
}
.list-table-heading strong {
  color: var(--t1);
  font-weight: 500;
}

.list-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.07);
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}

.list-table thead tr {
  background: rgba(168,85,247,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.list-table th {
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--cyan);
  text-transform: uppercase;
  white-space: nowrap;
}

.list-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.list-table tbody tr:last-child { border-bottom: none; }
.list-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.list-table td {
  padding: 0.6rem 0.9rem;
  color: var(--t2);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lt-num {
  color: var(--t4) !important;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  width: 3rem;
}

.lt-name {
  font-weight: 300;
}

.lt-type-badge {
  display: inline-block;
  background: rgba(34,211,238,0.1);
  color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.2);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.lt-id-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--violet);
  opacity: 0.7;
}

/* Pagination bar */
.list-pag-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.list-pag-btn {
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.25);
  color: var(--violet);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.04em;
}
.list-pag-btn:hover:not(:disabled) {
  background: rgba(168,85,247,0.2);
  border-color: rgba(168,85,247,0.5);
}
.list-pag-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.list-pag-label {
  font-size: 0.75rem;
  color: var(--t3);
  letter-spacing: 0.06em;
  min-width: 7rem;
  text-align: center;
}

/* Cache age badges */
.list-cache-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.list-cache-badge.cached {
  background: rgba(251,191,36,0.1);
  color: rgba(251,191,36,0.85);
  border: 1px solid rgba(251,191,36,0.2);
}
.list-cache-badge.fresh {
  background: rgba(16,185,129,0.1);
  color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.2);
}

.list-sync-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.68rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.list-sync-btn:hover { opacity: 1; }

/* ═══ Clarification Card ═════════════════════════════════════════ */
.clarify-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0.25rem 0;
}

.clarify-title {
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--t2);
  line-height: 1.5;
}
.clarify-title strong { color: var(--t1); font-weight: 500; }

.clarify-sub {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  margin-top: -0.6rem;
}

/* Horizontal scrolling chip row */
.clarify-chips {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}
.clarify-chips::-webkit-scrollbar { display: none; }

/* Individual type chip — vertical card style */
.clarify-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem 0.6rem;
  min-width: 96px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  text-align: left;
}
.clarify-chip:hover {
  background: rgba(168,85,247,0.07);
  border-color: rgba(168,85,247,0.2);
  transform: translateY(-2px);
}
.clarify-chip.selected {
  background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.45);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.2);
}
.clarify-chip[disabled] { opacity: 0.4; pointer-events: none; }

.clarify-chip-icon {
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 0.1rem;
}
.clarify-chip-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}
.clarify-chip-desc {
  font-size: 0.6rem;
  font-weight: 300;
  color: var(--t5);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Name input row */
.clarify-name-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.clarify-name-label {
  font-size: 0.62rem;
  color: var(--t4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.clarify-name-input {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  color: var(--t1);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.clarify-name-input::placeholder { color: var(--t5); }
.clarify-name-input:focus { border-color: rgba(168,85,247,0.4); }
.clarify-name-input:disabled { opacity: 0.4; }

/* Submit button */
.clarify-submit {
  align-self: flex-start;
  padding: 0.55rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  border-radius: 8px;
  border: 1px solid rgba(168,85,247,0.35);
  background: rgba(168,85,247,0.12);
  color: rgba(200,150,255,0.9);
  cursor: pointer;
  outline: none;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s, transform 0.15s;
}
.clarify-submit:not(:disabled):hover {
  background: rgba(168,85,247,0.22);
  border-color: rgba(168,85,247,0.6);
  transform: translateY(-1px);
}
.clarify-submit:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ─── Back Button (chat mode only) ──────────────────────────── */
.back-btn-row {
  display: flex;
  justify-content: flex-start;
  padding: 0 0.25rem 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.back-btn-row.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#backButton {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem 0.35rem 0.6rem;
  background: rgba(252,249,247,0.04);
  border: 1px solid rgba(252,249,247,0.10);
  border-radius: 40px;
  color: var(--t4);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}

#backButton svg {
  width: 12px; height: 12px;
  flex-shrink: 0;
  transition: transform 0.22s var(--ease);
}

#backButton:hover {
  background: rgba(244,235,51,0.08);
  border-color: rgba(244,235,51,0.25);
  color: #F4EB33;
  transform: translateX(-2px);
}

#backButton:hover svg {
  transform: translateX(-2px);
}


/* ══════════════════════════════════════════════════════════════
   HIKE BRAND LIGHT MODE SYSTEM
   Toggle: [data-theme="light"] on <body>
   Palette: FCF9F7 (60%) · F4EB33 (30%) · 7E6E94 (10%)
   ══════════════════════════════════════════════════════════════ */

/* ─── Smooth theme cross-fade ─────────────────────────────── */
body,
body::before,
body::after {
  transition:
    background 0.4s ease,
    background-color 0.4s ease,
    color 0.3s ease;
}

/* ─── Theme Toggle Button ─────────────────────────────────── */
#themeToggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}

.theme-track {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: rgba(126,110,148,0.22);
  border: 1px solid rgba(126,110,148,0.30);
  position: relative;
  transition: background 0.3s cubic-bezier(0.4,0,0.2,1),
              border-color 0.3s cubic-bezier(0.4,0,0.2,1);
}

.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #7E6E94;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              background 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Active (light mode) state */
[data-theme="light"] .theme-track {
  background: #F4EB33;
  border-color: #d4cc00;
}
[data-theme="light"] .theme-knob {
  transform: translateX(16px);
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}

/* Icon inside toggle */
.theme-icon-sun,
.theme-icon-moon {
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.45;
  transition: opacity 0.3s ease;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}
.theme-icon-sun  { opacity: 0; }
[data-theme="light"] .theme-icon-sun  { opacity: 0.6; }
[data-theme="light"] .theme-icon-moon { opacity: 0; }


/* ─── LIGHT MODE: Global background & text ────────────────── */
[data-theme="light"] body,
[data-theme="light"] {
  color: #1C1C1C;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 55% 80% at 90% 40%,
      rgba(126,110,148,0.07) 0%,
      transparent 55%),
    radial-gradient(ellipse 40% 50% at 8% 70%,
      rgba(126,110,148,0.05) 0%,
      transparent 60%),
    #FCF9F7;
}

/* Yellow hairline stays, just slightly more visible */
[data-theme="light"] body::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244,235,51,0.9) 35%,
    rgba(244,235,51,0.5) 60%,
    transparent 100%
  );
}

/* ─── Text vars override ──────────────────────────────────── */
[data-theme="light"] {
  --t1: #1C1C1C;
  --t2: rgba(28,28,28,0.80);
  --t3: rgba(28,28,28,0.55);
  --t4: rgba(28,28,28,0.35);
  --t5: rgba(28,28,28,0.18);
  --glass-0: rgba(255,255,255,0.30);
  --glass-1: rgba(255,255,255,0.55);
  --glass-2: rgba(255,255,255,0.75);
  --glass-3: rgba(255,255,255,0.90);
}

/* ─── Neural canvas — dimmer in light mode ───────────────── */
[data-theme="light"] #neuralCanvas {
  opacity: 0.18;
  filter: invert(1) hue-rotate(180deg);
}

/* ─── Orbs — lighter tints ────────────────────────────────── */
[data-theme="light"] .orb-1 {
  background: radial-gradient(circle, rgba(244,235,51,0.09) 0%, transparent 70%);
}
[data-theme="light"] .orb-2 {
  background: radial-gradient(circle, rgba(126,110,148,0.10) 0%, transparent 70%);
}
[data-theme="light"] .orb-3 {
  background: radial-gradient(circle, rgba(126,110,148,0.06) 0%, transparent 65%);
}
[data-theme="light"] .orb-4 {
  background: radial-gradient(circle, rgba(244,235,51,0.05) 0%, transparent 60%);
}

/* ─── Login Screen ───────────────────────────────────────── */
[data-theme="light"] .login-wordmark {
  background: linear-gradient(135deg, #7E6E94 0%, #F4EB33 45%, #d4cc00 80%, #7E6E94 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: none;
}
[data-theme="light"] .login-eyebrow   { color: rgba(28,28,28,0.35); }
[data-theme="light"] .login-tagline   { color: rgba(28,28,28,0.5); }
[data-theme="light"] .login-secure    { color: rgba(28,28,28,0.2); }

[data-theme="light"] .google-signin-btn {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  outline: 1px solid rgba(126,110,148,0.18);
  color: #1C1C1C;
  box-shadow:
    0 8px 30px rgba(126,110,148,0.12),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

[data-theme="light"] .google-signin-btn:hover {
  background: rgba(255,255,255,0.88);
  outline-color: rgba(244,235,51,0.5);
  box-shadow:
    0 14px 48px rgba(126,110,148,0.18),
    0 0 0 3px rgba(244,235,51,0.35),
    inset 0 1px 0 rgba(255,255,255,1);
}

/* ─── Surface Header ─────────────────────────────────────── */
[data-theme="light"] #surfaceHeader {
  background: linear-gradient(to bottom, rgba(252,249,247,0.92) 0%, transparent 100%);
}
[data-theme="light"] .sys-label { color: rgba(28,28,28,0.35); }

[data-theme="light"] .logout-btn {
  background: rgba(255,255,255,0.5);
  border-color: rgba(126,110,148,0.18);
  color: rgba(28,28,28,0.5);
}
[data-theme="light"] .logout-btn:hover {
  background: #F4EB33;
  border-color: #F4EB33;
  color: #1C1C1C;
  box-shadow: 0 4px 20px rgba(244,235,51,0.35);
}

/* ─── Hero Text ──────────────────────────────────────────── */
[data-theme="light"] .hero-eyebrow {
  background: linear-gradient(90deg, #7E6E94, #b8a8cc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .hero-static { color: #1C1C1C; }
[data-theme="light"] .cw {
  background: linear-gradient(90deg, #F4EB33 0%, #d4cc00 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(244,235,51,0.3));
}

/* ─── Command Bar (universal — used in search & chat mode) ── */
[data-theme="light"] #commandBar {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 10px 30px rgba(126,110,148,0.15),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

[data-theme="light"] #commandBar::before {
  animation: glowBreatheLight 5s ease-in-out infinite;
}

@keyframes glowBreatheLight {
  0%, 100% { box-shadow: 0 0 0 1px rgba(244,235,51,0.18), 0 0 20px rgba(244,235,51,0.06); }
  50%       { box-shadow: 0 0 0 1px rgba(126,110,148,0.25), 0 0 40px rgba(126,110,148,0.08); }
}

[data-theme="light"] #commandBar.connected::before {
  animation: glowConnected 3.5s ease-in-out infinite; /* keep green for functional status */
}

/* Search input in light mode */
[data-theme="light"] #commandInput {
  color: #1C1C1C;
  caret-color: #F4EB33;
}
[data-theme="light"] #commandInput::placeholder { color: rgba(28,28,28,0.32); }
[data-theme="light"] .search-shortcut {
  background: rgba(126,110,148,0.08);
  color: rgba(28,28,28,0.30);
}

/* Search results */
[data-theme="light"] #searchResults.has-results { border-top-color: rgba(126,110,148,0.10); }
[data-theme="light"] .result-entry:hover {
  background: rgba(126,110,148,0.06);
  box-shadow: 0 8px 24px rgba(126,110,148,0.12), 0 0 0 1px rgba(126,110,148,0.08);
}
[data-theme="light"] .result-name { color: #1C1C1C; }
[data-theme="light"] .result-id   { color: #7E6E94; }
[data-theme="light"] .results-hint { color: rgba(28,28,28,0.40); }

/* Connection banner */
[data-theme="light"] .conn-label  { color: rgba(28,28,28,0.6); }
[data-theme="light"] .conn-change { color: rgba(126,110,148,0.7); }
[data-theme="light"] .conn-change:hover { color: #7E6E94; }

/* ─── Workspace Context Bar ───────────────────────────────── */
[data-theme="light"] .ws-context-bar {
  background: rgba(252,249,247,0.90);
  border-bottom-color: rgba(126,110,148,0.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
[data-theme="light"] .ws-ctx-label { color: rgba(28,28,28,0.30); }
[data-theme="light"] .ws-label     { color: rgba(28,28,28,0.65); }
[data-theme="light"] .ws-caret     { color: rgba(126,110,148,0.6); }
[data-theme="light"] .workspace-selector:hover { color: #1C1C1C; }

[data-theme="light"] .ws-dropdown {
  background: rgba(252,249,247,0.97);
  border-color: rgba(126,110,148,0.15);
  box-shadow: 0 8px 32px rgba(126,110,148,0.15);
}
[data-theme="light"] .ws-item     { color: rgba(28,28,28,0.55); }
[data-theme="light"] .ws-item:hover { color: #1C1C1C; background: rgba(126,110,148,0.06); }
[data-theme="light"] .ws-item.active { color: #7E6E94; }
[data-theme="light"] .ws-item-id  { color: rgba(28,28,28,0.22); }

/* ─── Chat Surface / Messages ─────────────────────────────── */
[data-theme="light"] .msg-bubble.user      { color: rgba(28,28,28,0.50); }
[data-theme="light"] .msg-bubble.assistant { color: #1C1C1C; }
[data-theme="light"] .msg-bubble.system    { color: rgba(28,28,28,0.35); }

[data-theme="light"] .msg-bubble.assistant .msg-meta {
  color: #6B3FA0;
  font-size: 0.72rem;
  font-weight: 600;
  filter: none;
}
[data-theme="light"] .msg-bubble.user .msg-meta { color: rgba(28,28,28,0.45); font-size: 0.65rem; }

/* Markdown in light mode */
[data-theme="light"] .md-h1,
[data-theme="light"] .md-h2,
[data-theme="light"] .md-h3     { color: #1C1C1C; }
[data-theme="light"] .md-h2     { color: rgba(28,28,28,0.75); }
[data-theme="light"] .md-h3     { color: rgba(28,28,28,0.60); }
[data-theme="light"] .md-hr     { border-top-color: rgba(126,110,148,0.12); }
[data-theme="light"] .md-ul li,
[data-theme="light"] .md-ol li  { color: rgba(28,28,28,0.75); }
[data-theme="light"] .md-code {
  background: rgba(126,110,148,0.09);
  color: #7E6E94;
}
[data-theme="light"] .md-pre {
  background: rgba(126,110,148,0.07);
  color: rgba(28,28,28,0.80);
}

/* Tables */
[data-theme="light"] .md-table thead   { background: rgba(126,110,148,0.06); }
[data-theme="light"] .md-table th      { color: #7E6E94; border-bottom-color: rgba(126,110,148,0.12); }
[data-theme="light"] .md-table td      { color: rgba(28,28,28,0.75); border-bottom-color: rgba(126,110,148,0.07); }
[data-theme="light"] .md-table tr:hover td { background: rgba(126,110,148,0.04); }

/* Typing indicator */
[data-theme="light"] .typing-dot { background: rgba(126,110,148,0.55); }

/* ─── Chat Input Area ─────────────────────────────────────── */
[data-theme="light"] #chatInputArea {
  background: linear-gradient(
    to top,
    rgba(252,249,247,0.98) 45%,
    rgba(252,249,247,0.70) 75%,
    transparent
  );
}

[data-theme="light"] .chat-input-glass {
  border-top-color: rgba(126,110,148,0.12);
}
[data-theme="light"] .chat-input-glass:focus-within {
  border-top-color: rgba(244,235,51,0.45);
}

[data-theme="light"] #chatInput { color: #1C1C1C; caret-color: #7E6E94; }
[data-theme="light"] #chatInput::placeholder { color: rgba(28,28,28,0.30); }

[data-theme="light"] #sendButton svg    { color: #7E6E94; }
[data-theme="light"] #sendButton:hover  { filter: drop-shadow(0 0 10px rgba(126,110,148,0.5)); }

[data-theme="light"] #micButton svg     { color: rgba(28,28,28,0.45); }
[data-theme="light"] #langButton svg    { color: rgba(28,28,28,0.45); }
[data-theme="light"] #polishButton svg  { color: #b3940c; }
[data-theme="light"] #libraryButton svg { color: rgba(28,28,28,0.45); }

[data-theme="light"] #libraryButton:hover svg  { color: #7E6E94; }
[data-theme="light"] #libraryButton.active svg  { color: #7E6E94; }
[data-theme="light"] #libraryButton.active      { filter: drop-shadow(0 0 10px rgba(126,110,148,0.4)); }

/* Operations Library panel */
[data-theme="light"] .ops-library-inner {
  background: rgba(252,249,247,0.95);
  border-color: rgba(126,110,148,0.14);
  box-shadow: 0 -8px 32px rgba(126,110,148,0.12), 0 0 0 1px rgba(126,110,148,0.06);
}
[data-theme="light"] .ops-group-label   { color: rgba(126,110,148,0.55); }
[data-theme="light"] .ops-card {
  background: rgba(255,255,255,0.60);
  border-color: rgba(126,110,148,0.12);
}
[data-theme="light"] .ops-card:hover {
  background: rgba(126,110,148,0.06);
  border-color: rgba(126,110,148,0.22);
  box-shadow: 0 6px 20px rgba(126,110,148,0.10);
}
[data-theme="light"] .ops-card-name { color: #1C1C1C; }
[data-theme="light"] .ops-card-desc { color: rgba(28,28,28,0.35); }

/* Language dropdown */
[data-theme="light"] .lang-dropdown {
  background: rgba(252,249,247,0.98);
  border-color: rgba(126,110,148,0.14);
  box-shadow: 0 -8px 32px rgba(126,110,148,0.12);
}
[data-theme="light"] .lang-dropdown-label { color: rgba(126,110,148,0.45); }
[data-theme="light"] .lang-option         { color: rgba(28,28,28,0.55); }
[data-theme="light"] .lang-option:hover   { background: rgba(126,110,148,0.07); color: #1C1C1C; }
[data-theme="light"] .lang-option.active  { background: rgba(126,110,148,0.10); color: #7E6E94; }

/* ─── Data Tables (list view) ─────────────────────────────── */
[data-theme="light"] .list-table-wrap    { border-color: rgba(126,110,148,0.12); }
[data-theme="light"] .list-table thead tr { background: rgba(126,110,148,0.05); border-bottom-color: rgba(126,110,148,0.10); }
[data-theme="light"] .list-table th       { color: #7E6E94; }
[data-theme="light"] .list-table tbody tr { border-bottom-color: rgba(126,110,148,0.06); }
[data-theme="light"] .list-table tbody tr:hover { background: rgba(126,110,148,0.04); }
[data-theme="light"] .list-table td       { color: rgba(28,28,28,0.75); }
[data-theme="light"] .lt-num              { color: rgba(28,28,28,0.35) !important; }
[data-theme="light"] .lt-type-badge {
  background: rgba(126,110,148,0.08);
  color: #7E6E94;
  border-color: rgba(126,110,148,0.18);
}
[data-theme="light"] .lt-id-code { color: #7E6E94; }

[data-theme="light"] .list-pag-bar       { border-top-color: rgba(126,110,148,0.08); }
[data-theme="light"] .list-pag-btn {
  background: rgba(126,110,148,0.08);
  border-color: rgba(126,110,148,0.22);
  color: #7E6E94;
}
[data-theme="light"] .list-pag-btn:hover:not(:disabled) {
  background: rgba(126,110,148,0.16);
  border-color: rgba(126,110,148,0.4);
}
[data-theme="light"] .list-pag-label { color: rgba(28,28,28,0.50); }

/* ─── Clarification Card ──────────────────────────────────── */
[data-theme="light"] .clarify-title  { color: rgba(28,28,28,0.75); }
[data-theme="light"] .clarify-title strong { color: #1C1C1C; }
[data-theme="light"] .clarify-sub    { color: rgba(28,28,28,0.35); }
[data-theme="light"] .clarify-chip {
  background: rgba(255,255,255,0.65);
  border-color: rgba(126,110,148,0.16);
}
[data-theme="light"] .clarify-chip:hover {
  background: rgba(126,110,148,0.07);
  border-color: rgba(126,110,148,0.30);
}
[data-theme="light"] .clarify-chip.selected {
  background: rgba(244,235,51,0.14);
  border-color: rgba(244,235,51,0.40);
  color: #6b5e00;
}
[data-theme="light"] .clarify-text-input {
  background: rgba(255,255,255,0.55);
  border-color: rgba(126,110,148,0.18);
  color: #1C1C1C;
}
[data-theme="light"] .clarify-text-input:focus {
  border-color: rgba(244,235,51,0.50);
  box-shadow: 0 0 0 3px rgba(244,235,51,0.15);
}

/* ─── Back Button ─────────────────────────────────────────── */
[data-theme="light"] #backButton {
  background: rgba(255,255,255,0.55);
  border-color: rgba(126,110,148,0.16);
  color: rgba(28,28,28,0.45);
}
[data-theme="light"] #backButton:hover {
  background: rgba(244,235,51,0.12);
  border-color: rgba(244,235,51,0.35);
  color: #6b5e00;
}

/* ─── Scrollbar in light mode ─────────────────────────────── */
[data-theme="light"] #chatMessages {
  scrollbar-color: rgba(126,110,148,0.18) transparent;
}


