/* ============================================================
   NightOwl Agent Assistant — UI
   ============================================================ */

:root {
  /* ---- dark (default) ---- */
  color-scheme: dark;

  --bg-void: #07050E;
  --bg-panel: rgba(255, 255, 255, 0.022);
  --bg-raise: rgba(255, 255, 255, 0.045);
  --bg-raise-hover: rgba(255, 255, 255, 0.075);
  /* a touch flatter than --bg-raise, for large surfaces like the composer */
  --surface: rgba(255, 255, 255, 0.035);

  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #F1EEFA;
  --text-secondary: rgba(241, 238, 250, 0.58);
  --text-tertiary: rgba(241, 238, 250, 0.34);

  --accent: #8B5CF6;
  --accent-bright: #A78BFA;
  --accent-2: #E879F9;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.45);

  --success: #34D399;
  --danger: #FB7185;
  --warning: #F59E0B;

  /* page and card glows */
  --glow-a: rgba(124, 58, 237, 0.16);
  --glow-b: rgba(168, 85, 247, 0.10);
  --glow-c: rgba(88, 28, 135, 0.16);
  --card-glow: rgba(124, 58, 237, 0.10);

  /* surfaces that sit above the page rather than on it */
  --overlay-bg: rgba(18, 13, 30, 0.9);
  --drawer-bg: rgba(11, 7, 20, 0.97);
  --scrim: rgba(0, 0, 0, 0.6);

  /* the solid circular voice button: inverted against the page */
  --invert-hover: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

/*
 * Light theme. The neutral tints flip from white-on-dark to ink-on-light;
 * without that every surface and border would simply vanish. Purples are
 * darkened too: --accent-bright reads fine on near-black but fails contrast
 * on a light page.
 */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-void: #F4F2FB;
  --bg-panel: rgba(255, 255, 255, 0.80);
  --bg-raise: rgba(17, 12, 38, 0.045);
  --bg-raise-hover: rgba(17, 12, 38, 0.085);
  --surface: rgba(255, 255, 255, 0.72);

  --border: rgba(17, 12, 38, 0.10);
  --border-strong: rgba(17, 12, 38, 0.20);

  --text-primary: #18122E;
  --text-secondary: rgba(24, 18, 46, 0.78);
  --text-tertiary: rgba(24, 18, 46, 0.62);

  --accent: #7C3AED;
  --accent-bright: #6D28D9;
  --accent-2: #C026D3;
  --accent-soft: rgba(124, 58, 237, 0.10);
  --accent-line: rgba(124, 58, 237, 0.38);

  --success: #059669;
  --danger: #E11D48;
  --warning: #B45309;

  --glow-a: rgba(167, 139, 250, 0.20);
  --glow-b: rgba(232, 121, 249, 0.12);
  --glow-c: rgba(196, 181, 253, 0.26);
  --card-glow: rgba(167, 139, 250, 0.14);

  --overlay-bg: rgba(255, 255, 255, 0.96);
  --drawer-bg: rgba(250, 249, 253, 0.98);
  --scrim: rgba(24, 18, 46, 0.35);

  --invert-hover: #000000;

  --shadow-sm: 0 1px 2px rgba(24, 18, 46, 0.06);
  --shadow-md: 0 10px 30px rgba(24, 18, 46, 0.10);
  --shadow-lg: 0 24px 60px rgba(24, 18, 46, 0.16);
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.45s ease;
  background:
    radial-gradient(46% 40% at 42% 34%, var(--glow-a) 0%, transparent 68%),
    radial-gradient(38% 34% at 78% 12%, var(--glow-b) 0%, transparent 70%),
    radial-gradient(50% 40% at 30% 96%, var(--glow-c) 0%, transparent 72%),
    var(--bg-void);
}

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

.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }

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

.topbar {
  height: 66px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  z-index: 6;
  margin: 5px 0px;
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

/*
 * Both logos are the official assets, used whole and unmodified. Only the
 * height is ever set, width stays auto, so neither can be stretched.
 * The heights differ because the lockups differ: EmpireOne is a wide
 * horizontal lockup, Nova is a stacked one (mascot over wordmark) whose
 * artwork fills only ~62% of its square box. Nova therefore gets a taller
 * box so the two read as optically equal.
 */
.brand-empireone,
.brand-nova {
  display: block;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

.brand-empireone { width: auto; height: 38px; }

/*
 * Nova has a file per theme, drawn as a background rather than an <img> so the
 * browser only downloads the one in use. --nova-h is the single size knob the
 * breakpoints below turn; aspect-ratio derives the width from each file's own
 * canvas, so neither can be stretched.
 *
 * Its artwork sits ~3% above the middle of its box, hence the nudge.
 */
.brand-nova {
  --nova-h: 72px;
  height: var(--nova-h);
  aspect-ratio: 1024 / 1024;
  background: url("/logo.png") center / contain no-repeat;
  transform: translateY(3%);
}

/* Same canvas proportions and the same share of artwork as the dark file,
   so only the image swaps: size, ratio and nudge all carry over. */
:root[data-theme="light"] .brand-nova {
  background-image: url("/light-logo.png");
}

.brand-x {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16), 0 0 10px rgba(52, 211, 153, 0.7); }
.status-dot.error     { background: var(--danger);  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16), 0 0 10px rgba(251, 113, 133, 0.7); }

.assistant-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.assistant-pill svg { color: var(--accent-bright); flex-shrink: 0; }

/*
 * Nova's wordmark is near-white on a transparent background, so on a light
 * page it would disappear. Light mode sets it on a dark plate instead of
 * touching the artwork. border-box keeps the padded plate the same overall
 * height as the unpadded logo in dark mode.
 */
.topbar-theme,
.topbar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.topbar-theme:hover,
.topbar-logout:hover {
  background: var(--bg-raise-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.topbar-theme:active,
.topbar-logout:active { transform: scale(0.94); }

/* Show the theme you would switch TO */
.topbar-theme .icon-sun { display: block; }
.topbar-theme .icon-moon { display: none; }
:root[data-theme="light"] .topbar-theme .icon-sun { display: none; }
:root[data-theme="light"] .topbar-theme .icon-moon { display: block; }

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg-raise-hover); }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* ============================ LAYOUT ============================ */

.main-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  padding: 0 22px 20px;
  position: relative;
  z-index: 1;
}

/* ============================ CHAT CARD ============================ */

.chat-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 55% at 50% 18%, var(--card-glow) 0%, transparent 70%),
    var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.chat-tools {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.tool-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.tool-btn:hover { background: var(--bg-raise-hover); color: var(--text-primary); border-color: var(--border-strong); }
.tool-btn:active { transform: scale(0.94); }
.tool-btn-danger:hover { background: rgba(251, 113, 133, 0.14); color: var(--danger); border-color: rgba(251, 113, 133, 0.35); }

.tool-btn .icon-mic-off { display: none; }
#muteBtn.active { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.35); color: var(--warning); }
#muteBtn.active .icon-mic-on { display: none; }
#muteBtn.active .icon-mic-off { display: block; }

.chat-scroll {
  container: chat / inline-size;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 30px 34px 8px;
}

/* ---------------------- HERO ---------------------- */

.hero {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.hero-copy { display: flex; flex-direction: column; align-items: center; }

.hero-title {
  margin-top: 10px;
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}
.hero-accent {
  background: linear-gradient(100deg, var(--accent-bright), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sparkle { color: var(--accent-bright); vertical-align: -3px; margin-left: 2px; }

.hero-sub {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 520px;
}

/* Compact hero — used once the conversation starts */
.hero.compact {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 18px;
  padding-bottom: 24px;
}
.hero.compact .hero-copy { align-items: flex-start; }
.hero.compact .hero-title { margin-top: 0; font-size: 25px; }
.hero.compact .hero-sparkle { width: 20px; height: 20px; vertical-align: -2px; }
.hero.compact .hero-sub { margin-top: 5px; font-size: 13.5px; }
.hero.compact .suggestion-row { display: none; }

/* Voice mode is live — the chips would only send chat messages */
.hero.voice-active .suggestion-row { display: none; }

/* ---------------------- SUGGESTIONS ---------------------- */

.suggestion-row {
  margin-top: 30px;
  width: 100%;
  max-width: 960px;
}

.suggestion-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.suggestion {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.suggestion svg { color: var(--accent-bright); flex-shrink: 0; margin-top: 1px; }
.suggestion:hover {
  background: var(--bg-raise-hover);
  border-color: var(--accent-line);
  color: var(--text-primary);
  transform: translateY(-2px);
}
.suggestion:active { transform: scale(0.98); }

.suggestion-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

@container chat (max-width: 800px) {
  .suggestion-row { max-width: 600px; }
  .suggestion-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phones: one readable list, badge sits at the end of the row */
@container chat (max-width: 480px) {
  .suggestion-row { margin-top: 22px; }
  .suggestion-track { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .suggestion { align-items: center; padding: 13px 14px; font-size: 13px; }
  .suggestion svg { margin-top: 0; }
  .suggestion-body { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
}

/* Questions the assistant cannot answer yet */
.suggestion-soon {
  cursor: not-allowed;
  color: var(--text-tertiary);
}
.suggestion-soon svg { color: var(--text-tertiary); }
.suggestion-soon:hover {
  background: var(--bg-raise);
  border-color: var(--border);
  color: var(--text-tertiary);
  transform: none;
}
.suggestion-soon:active { transform: none; }

.soon-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ---------------------- ORB ---------------------- */

.orb-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 260px;
  height: 260px;
  transition: width 0.3s ease, height 0.3s ease;
}
.hero.compact .orb-wrapper { width: 60px; height: 60px; }

.orb {
  position: relative;
  width: 160px; height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s ease, height 0.3s ease;
}
.hero.compact .orb { width: 46px; height: 46px; }

.orb-glow {
  position: absolute;
  width: 232px; height: 232px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.34) 0%, rgba(232, 121, 249, 0.13) 44%, transparent 72%);
  filter: blur(10px);
  animation: glowBreathe 3.5s ease-in-out infinite;
}
.hero.compact .orb-glow { width: 80px; height: 80px; filter: blur(8px); }

.orb-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92) 0%, transparent 34%),
    conic-gradient(from 180deg, #C4B5FD, #F0ABFC, #8B5CF6, #A78BFA, #C4B5FD);
  box-shadow:
    0 0 60px rgba(139, 92, 246, 0.5),
    0 0 130px rgba(124, 58, 237, 0.22),
    inset 0 0 36px rgba(255, 255, 255, 0.28),
    inset 0 -18px 46px rgba(20, 6, 40, 0.35);
  animation: breathe 3.5s ease-in-out infinite, coreSpin 10s linear infinite;
  filter: saturate(1.12);
}
.orb-core::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.32) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.16) 100%);
}

.orb-swirl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 68%, rgba(255, 255, 255, 0.32), transparent 45%),
    radial-gradient(circle at 28% 72%, rgba(255, 255, 255, 0.16), transparent 40%);
  mix-blend-mode: overlay;
  animation: swirlDrift 6s ease-in-out infinite;
  pointer-events: none;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(167, 139, 250, 0.5);
  opacity: 0;
  width: 100%; height: 100%;
}
.ring-2 { transform: scale(1.17); }
.ring-3 { transform: scale(1.34); }
.hero.compact .orb-ring { display: none; }

@keyframes glowBreathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
@keyframes coreSpin {
  0%, 100% { filter: hue-rotate(-14deg) saturate(1.12); }
  50%      { filter: hue-rotate(20deg) saturate(1.12); }
}
@keyframes swirlDrift {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(15deg) scale(1.03); }
}

.orb.listening .orb-core { animation: pulseListen 1.4s ease-in-out infinite, coreSpin 10s linear infinite; }
@keyframes pulseListen {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 60px rgba(139, 92, 246, 0.5),  0 0 130px rgba(124, 58, 237, 0.22), inset 0 0 36px rgba(255, 255, 255, 0.28); }
  50%      { transform: scale(1.1); box-shadow: 0 0 92px rgba(139, 92, 246, 0.82), 0 0 160px rgba(124, 58, 237, 0.4),  inset 0 0 44px rgba(255, 255, 255, 0.38); }
}

.orb.speaking .orb-core { animation: speakPulse 0.9s ease-in-out infinite, coreSpin 4s linear infinite; }
.orb.speaking .orb-glow { animation: speakGlow 0.9s ease-in-out infinite; }
.orb.speaking .orb-ring { animation: ringPulse 1.6s ease-out infinite; opacity: 1; }
.orb.speaking .ring-2 { animation-delay: 0.35s; }
.orb.speaking .ring-3 { animation-delay: 0.7s; }

@keyframes speakPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 60px rgba(139, 92, 246, 0.55), 0 0 130px rgba(124, 58, 237, 0.28), inset 0 0 36px rgba(255, 255, 255, 0.28); }
  50%      { transform: scale(1.13); box-shadow: 0 0 104px rgba(139, 92, 246, 0.9), 0 0 180px rgba(124, 58, 237, 0.5),  inset 0 0 48px rgba(255, 255, 255, 0.4); }
}
@keyframes speakGlow {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%      { transform: scale(1.18); opacity: 1; }
}
@keyframes ringPulse {
  0%   { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0;   transform: scale(1.55); }
}

.orb.thinking .orb-core { animation: coreSpin 1.1s linear infinite, breathe 2s ease-in-out infinite; }
.orb.idle .orb-core { transform: scale(0.9); filter: saturate(0.78) brightness(0.9); }
.orb.idle .orb-glow { opacity: 0.55; }

/* ---------------------- MESSAGES ---------------------- */

.conversation-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 8px;
}
.conversation-panel:empty { display: none; }

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideUp 0.28s ease;
}
.msg-row.user { justify-content: flex-end; }

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

.msg-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.mini-orb {
  width: 30px; height: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9) 0%, transparent 36%),
    conic-gradient(from 180deg, #C4B5FD, #F0ABFC, #8B5CF6, #A78BFA, #C4B5FD);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.55);
}
.msg-avatar.agent { background: transparent; border: none; }

.bubble {
  max-width: min(560px, 74%);
  padding: 14px 17px;
  font-size: 14px;
  line-height: 1.55;
  border-radius: 18px;
}

.bubble.user {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #FFFFFF;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 26px rgba(109, 40, 217, 0.35);
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.bubble.user .message-text { flex: 1; min-width: 0; }

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  padding-bottom: 1px;
}

.bubble.assistant {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  color: var(--text-primary);
}

.message-text { white-space: pre-wrap; word-wrap: break-word; }

.bubble-time {
  margin-top: 9px;
  text-align: right;
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ---------------------- COMPOSER ---------------------- */

.composer {
  flex-shrink: 0;
  margin: 8px 34px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.06), 0 14px 34px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer:focus-within {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12), 0 14px 34px rgba(0, 0, 0, 0.35);
}

/* Solid filled circle with a waveform mark — the ChatGPT start-voice affordance */
.composer-voice {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--text-primary);
  border: none;
  color: var(--bg-void);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.2s ease;
}
.composer-voice:hover { background: var(--invert-hover); transform: translateY(-1px); }
.composer-voice:active { transform: scale(0.94); }
.composer-voice:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.composer-voice .icon-voice-stop { display: none; }

/* Voice mode active — the same button stops the conversation */
.composer.voice-mode .composer-voice {
  background: linear-gradient(135deg, var(--accent), #6D28D9);
  color: #FFFFFF;
  animation: voicePulse 1.8s ease-in-out infinite;
}
.composer.voice-mode .composer-voice .icon-voice-start { display: none; }
.composer.voice-mode .composer-voice .icon-voice-stop { display: block; }

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16); }
  50%      { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.08); }
}

#textInput {
  flex: 1;
  min-width: 0;
  height: 42px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
}
#textInput::placeholder { color: var(--text-tertiary); }
#textInput:disabled { cursor: default; }

.composer-send {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent) 60%, #7C3AED);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.composer-send:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(139, 92, 246, 0.6); }
.composer-send:active { transform: scale(0.94); }
.composer-send:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.disclaimer {
  flex-shrink: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 13px 20px 15px;
}

/* ============================ SESSION DETAILS ============================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-tertiary);
  padding: 2px 4px 6px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.info-card:hover { border-color: var(--border-strong); background: var(--bg-raise-hover); }

.info-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: var(--accent-bright);
}

.info-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.info-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.info-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.badge {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: var(--accent-bright);
}

.mic-dot {
  flex-shrink: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.6);
}
.mic-dot.on     { background: var(--success); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.mic-dot.muted  { background: var(--warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.mic-dot.denied { background: var(--danger);  box-shadow: 0 0 8px rgba(251, 113, 133, 0.6); }

/* ============================ TOASTS ============================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  background: var(--overlay-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  max-width: 320px;
  animation: toastIn 0.3s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================ SCROLLBARS ============================ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 1180px) {
  .brand-empireone { height: 34px; }
  .brand-nova { --nova-h: 56px; }
  .main-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .chat-scroll { padding: 26px 24px 8px; }
  .composer { margin: 8px 24px 0; }
}

@media (max-width: 1024px) {
  .hamburger-btn { display: flex; }
  .assistant-pill { display: none; }
  .brand-empireone { height: 30px; }
  .brand-nova { --nova-h: 50px; }

  .main-layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }

  .sidebar {
    position: fixed;
    top: 66px;
    right: 0;
    bottom: 0;
    width: min(88vw, 340px);
    border-radius: 0;
    background: var(--drawer-bg);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }

  .orb-wrapper { width: 210px; height: 210px; }
  .orb { width: 132px; height: 132px; }
  .orb-glow { width: 210px; height: 210px; }
  .hero-title { font-size: 28px; }
}

@media (max-height: 760px) {
  .orb-wrapper { width: 170px; height: 170px; }
  .orb { width: 110px; height: 110px; }
  .orb-glow { width: 170px; height: 170px; }
  .hero-title { margin-top: 4px; }
}

@media (max-width: 700px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .status-pill { padding: 0 11px; font-size: 12px; }
  .brand-empireone { height: 26px; }
  .brand-nova { --nova-h: 44px; }
  .brand-x { font-size: 12px; }

  .chat-scroll { padding: 22px 16px 8px; }
  .composer { margin: 8px 14px 0; gap: 8px; padding: 10px 11px; }
  .composer-voice, .composer-send { width: 38px; height: 38px; }
  #textInput { font-size: 14px; }

  .hero-title { font-size: 23px; }
  .hero-sub { font-size: 13px; }
  .orb-wrapper { width: 170px; height: 170px; }
  .orb { width: 110px; height: 110px; }
  .orb-glow { width: 170px; height: 170px; }

  .bubble { max-width: 84%; }
  .hero.compact { gap: 12px; }
  .hero.compact .hero-title { font-size: 20px; }
  .hero.compact .hero-sub { display: none; }
  .disclaimer { font-size: 11px; padding: 11px 14px 13px; }
  .sidebar { width: 100%; }
}

@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 8px; }
  .status-pill { padding: 0 9px; font-size: 11.5px; }
  .brand-empireone { height: 22px; }
  .brand-nova { --nova-h: 38px; }
}

/* Below this the connection label would push the logos out of the bar,
   so the pill keeps only its status dot. */
@media (max-width: 430px) {
  .status-pill { padding: 0; width: 34px; justify-content: center; gap: 0; }
  .status-pill span:not(.status-dot) { display: none; }
}
