/*
 * Quanta Sovereign Suite — Liquid Glass Design System
 * 
 * Minimalist, World-Class Luminescent Glass Theme.
 * Engineered for Zero Lag & Smooth 60fps Scrolling on Mobile & Android WebView.
 */

:root {
  --bg: #06070a;
  --bg-deep: #030406;
  --bg-gradient: radial-gradient(circle at 50% 0%, #101426 0%, #06070a 80%);
  
  --panel: rgba(14, 17, 28, 0.72);
  --panel-solid: #10131f;
  --panel-bright: #181d30;
  
  --glass-surface: rgba(15, 19, 32, 0.65);
  --glass-surface-hover: rgba(22, 28, 46, 0.78);
  --glass-surface-active: rgba(30, 38, 62, 0.88);
  --glass-dock: rgba(9, 12, 20, 0.82);
  --glass-card: rgba(15, 19, 32, 0.58);
  
  --raised: rgba(255, 255, 255, 0.045);
  --raised-hover: rgba(255, 255, 255, 0.085);
  --raised-active: rgba(255, 255, 255, 0.13);
  
  --line: rgba(255, 255, 255, 0.09);
  --line-subtle: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(56, 189, 248, 0.45);
  --line-glow: rgba(56, 189, 248, 0.25);
  
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 16px rgba(56, 189, 248, 0.02);
  --glass-specular-bright: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 20px rgba(56, 189, 248, 0.18);
  --glass-blur: blur(24px) saturate(180%);
  --glass-blur-heavy: blur(32px) saturate(190%);
  --glass-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.55);
  
  --text: #f1f5f9;
  --text-bright: #ffffff;
  --muted: #94a3b8;
  --faint: #64748b;
  
  --user-bubble: linear-gradient(135deg, rgba(28, 36, 56, 0.9) 0%, rgba(18, 23, 38, 0.9) 100%);
  --user-bubble-border: 1px solid rgba(255, 255, 255, 0.12);
  
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-purple: #818cf8;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #a855f7 100%);
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --emerald: #34d399;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #ef4444;
  --indigo: #818cf8;
  
  --radius-sm: 9px;
  --radius: 15px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  
  --bar-h: 54px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent !important;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent !important;
}
::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 9999px !important;
}
::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.35) !important;
}

.hidden {
  display: none !important;
}

button, input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  box-sizing: border-box;
  touch-action: manipulation;
}

html,
body {
  color-scheme: dark;
  height: 100%;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; }

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ------------------------------------------------------------------ *
 * Top App Bar Header (Liquid Glass Studio Aesthetic)
 * ------------------------------------------------------------------ */

.bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  padding-top: calc(8px + env(safe-area-inset-top));
  border-bottom: var(--line);
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  flex: none;
}

/* Center Brand Capsule / Studio Selector */
.brand-center.brand-capsule {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 13px 4px 5px;
  background: rgba(22, 27, 44, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--glass-specular);
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  max-width: 240px;
}

.brand-center.brand-capsule:hover {
  background: rgba(30, 37, 60, 0.8);
  border-color: var(--line-strong);
  box-shadow: var(--glass-specular-bright);
}

.brand-center.brand-capsule:active {
  background: rgba(36, 44, 72, 0.9);
  transform: scale(0.98);
}

/* Luminous Logo Frame */
.brand-logo-frame {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  flex: none;
}

.brand-logo-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.brand-logo-glow {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.7;
  animation: logoPulse 4s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  0% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 0.85; transform: scale(1.1); }
}

.drawer-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.quantum-emblem {
  display: none;
}

/* Brand Text Stack */
.brand-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0px;
  line-height: 1.15;
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: linear-gradient(180deg, #ffffff 40%, #d4d4d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  display: inline-block;
  animation: pulseDot 2.5s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 10px #38bdf8; }
}

.brand-studio-title,
.brand-studio-badge {
  font-size: 10px;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.brand-chevron {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  color: #71717a;
  stroke-width: 2.2;
  fill: none;
  flex: none;
  margin-left: 2px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.brand-center.brand-capsule:hover .brand-chevron {
  color: #e4e4e7;
  transform: translateY(1px);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex: none;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}
.icon-btn:active {
  background: rgba(255, 255, 255, 0.13);
  transform: scale(0.95);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn-sm:active {
  color: var(--text-bright);
  background: var(--raised-hover);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

/* ------------------------------------------------------------------ *
 * Left Slide-out Drawer (Navigation Hub)
 * ------------------------------------------------------------------ */

.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.drawer-scrim.visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(300px, 84vw);
  background: #06080e;
  background-image: radial-gradient(circle at 0% 0%, #0d1222 0%, #05070c 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  z-index: 110;
  transform: translate3d(-100%, 0, 0);
  -webkit-transform: translate3d(-100%, 0, 0);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-transition: -webkit-transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.85);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer.open {
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.drawer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-title-wrap {
  display: flex;
  flex-direction: column;
}
.drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}
.drawer-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.drawer-action-row {
  padding: 10px 14px 6px 14px;
}
.btn-drawer-new {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 18, 30, 0.85);
  color: var(--text-bright);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.btn-drawer-new:hover {
  background: rgba(22, 28, 48, 0.95);
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-drawer-new:active {
  background: var(--panel-bright);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
}
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding: 6px 6px 2px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.badge-count {
  background: var(--raised);
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  font-size: 9.5px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}
.drawer-item:active {
  background: var(--raised);
  color: var(--text-bright);
}
.drawer-item.active {
  background: var(--panel-solid);
  border-color: var(--line);
  color: var(--text-bright);
}
.drawer-item.active .ico {
  color: var(--text-bright);
}
.nav-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.nav-badge.sota {
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
}
.nav-badge.studio {
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
}

.drawer-history-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.drawer-chat-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.chat-history-item:active {
  background: var(--raised);
  color: var(--text);
}
.chat-history-item.active {
  background: var(--panel-solid);
  color: var(--text-bright);
}
.chat-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.chat-delete-btn {
  opacity: 0.35;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.chat-delete-btn:active {
  opacity: 1;
  color: var(--red);
}

.drawer-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.provider-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.provider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  display: inline-block;
}
.provider-dot.active {
  background: var(--emerald);
}
.provider-status-label {
  font-size: 10.5px;
  color: var(--muted);
  margin-left: 3px;
}
.drawer-settings-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.drawer-settings-btn:active {
  color: var(--text-bright);
}

/* ------------------------------------------------------------------ *
 * Main Views Container
 * ------------------------------------------------------------------ */

.view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100vw;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.thread {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 18px 32px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty {
  margin: auto;
  text-align: center;
  max-width: 320px;
  padding: 24px 12px;
  color: var(--muted);
}
.empty-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px auto;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.empty h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.empty p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.empty-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.suggest-card {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.suggest-card:active {
  background: var(--panel-bright);
  color: var(--text-bright);
}

/* Clean Message Stream (Anthropic Claude Editorial Style) */
.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  word-break: break-word;
  contain: content;
}
.msg.user {
  align-self: flex-end;
  max-width: 86%;
}
.msg.user .bubble {
  background: var(--user-bubble);
  color: #ffffff;
  border-radius: 16px;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.55;
  border: 1px solid var(--line);
  box-shadow: none;
}

.msg.model {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
}
.msg.model .bubble {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 2px 0;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--text);
  letter-spacing: -0.01em;
  box-shadow: none;
}

.msg.model .bubble p {
  margin-bottom: 12px;
}
.msg.model .bubble p:last-child {
  margin-bottom: 0;
}

.msg.model .bubble h1,
.msg.model .bubble h2,
.msg.model .bubble h3,
.msg.model .bubble h4 {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 18px;
  margin-bottom: 8px;
  line-height: 1.35;
}
.msg.model .bubble h1 { font-size: 19px; }
.msg.model .bubble h2 { font-size: 17px; }
.msg.model .bubble h3 { font-size: 15.5px; }

.msg.model .bubble blockquote {
  border-left: 3px solid var(--cyan);
  padding-left: 12px;
  margin: 10px 0;
  color: #94a3b8;
  font-style: italic;
}

.msg.model .bubble ul,
.msg.model .bubble ol {
  padding-left: 20px;
  margin: 8px 0 12px 0;
}
.msg.model .bubble li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.msg.model .bubble strong {
  color: #ffffff;
  font-weight: 600;
}

.msg.model .bubble hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.msg-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.msg-avatar {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.msg-avatar .ico { width: 12px; height: 12px; stroke-width: 2; }
.msg-sender-name {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.msg-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg-btn-action {
  background: transparent;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.msg-btn-action:active {
  color: var(--text-bright);
  background: var(--raised);
}

/* ------------------------------------------------------------------ *
 * Thought & Reasoning Accordion (Claude 3.7 & Gemini SOTA Style)
 * ------------------------------------------------------------------ */

.thought-box {
  margin-bottom: 8px;
  width: 100%;
}

.thought-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}
.thought-pill-btn:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
}
.thought-brain-icon {
  color: var(--cyan);
  transition: color 0.2s ease;
}
.thought-shimmer-text {
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Active Thinking State Pulse & Glow */
.thought-box.thinking-active .thought-pill-btn {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(99, 102, 241, 0.08));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.15);
}
.thought-box.thinking-active .thought-brain-icon {
  color: #38bdf8;
  animation: pulse-glow 1.5s infinite ease-in-out;
}
.thought-box.thinking-active .thought-shimmer-text {
  color: #38bdf8;
  font-weight: 600;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 4px #38bdf8); }
}

.thought-chevron {
  font-size: 12px;
  color: var(--faint);
  transition: transform 0.2s ease;
  margin-left: 2px;
}
.thought-box.open .thought-chevron {
  transform: rotate(90deg);
  color: var(--cyan);
}

.thought-drawer {
  display: none;
  margin-top: 8px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(10, 11, 16, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #38bdf8;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: slide-in-down 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.thought-box.open .thought-drawer {
  display: block;
}

@keyframes slide-in-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.thought-drawer-inner {
  padding: 12px 14px;
}
.thought-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
}
.thought-meta-pill {
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-copy-thought-inline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-copy-thought-inline:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.thought-drawer-content {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------------ *
 * Clean In-Chat Media (Zero Sci-Fi Borders or Glowing Boxes)
 * ------------------------------------------------------------------ */

.chat-media-card {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 8px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--line);
}

.chat-media-img {
  display: block;
  max-width: 100% !important;
  max-height: 320px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: calc(var(--radius) - 1px);
}

.chat-media-video {
  display: block;
  max-width: 100% !important;
  max-height: 320px !important;
  width: 100%;
  background: #000000;
  border-radius: calc(var(--radius) - 1px);
}

.chat-media-dl {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.12s ease;
}
.chat-media-dl:active {
  transform: scale(0.92);
}

/* Global Bubble Image Clamp */
.bubble img {
  max-width: 100% !important;
  max-height: 260px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px;
  display: block;
  margin: 6px 0;
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------------ *
 * Code Blocks & Artifact Cards (Claude Artifacts Style)
 * ------------------------------------------------------------------ */

.code-card {
  margin: 8px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.code-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.code-lang {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-actions-top {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-code-action {
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-code-action:active {
  color: var(--text-bright);
  background: var(--raised-hover);
}
.btn-code-action.primary {
  color: var(--text-bright);
  border-color: var(--line-strong);
}

pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
}
code {
  font-family: inherit;
}
p code {
  background: var(--raised);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-bright);
}

/* Claude-Style Live Player Container */
.chat-player-container {
  width: 100%;
  margin: 10px 0 6px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  gap: 6px;
  flex-wrap: wrap;
}

.chat-player-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}

.chat-player-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-player-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.btn-player-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
}
.btn-player-action:active {
  background: var(--raised-hover);
  color: var(--text-bright);
}
.btn-player-action.primary {
  color: var(--text-bright);
  border-color: var(--line-strong);
}

.chat-player-viewport {
  position: relative;
  width: 100%;
  height: 240px;
  background: #000000;
  overflow: hidden;
}

.chat-player-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.chat-player-code-drawer {
  background: #000000;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  max-height: 180px;
  overflow-y: auto;
}
.chat-player-code-drawer pre {
  margin: 0;
  font-family: monospace;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------ *
 * Web Page Snapshot Cards (Interactive Grounding & Web Previews)
 * ------------------------------------------------------------------ */
.web-snapshot-card {
  width: 100%;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
}
.web-snapshot-card:active {
  background: var(--panel-solid);
}

.web-snapshot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  gap: 6px;
}

.web-snapshot-domain-box {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.web-snapshot-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #ffffff;
  flex: none;
}

.web-snapshot-domain {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.web-snapshot-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  text-transform: uppercase;
  flex: none;
}

.web-snapshot-viewport {
  position: relative;
  width: 100%;
  height: 150px;
  background: #0a0a0c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.web-snapshot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.web-snapshot-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  gap: 4px;
  padding: 12px;
}
.web-snapshot-fallback .fallback-domain {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-bright);
}
.web-snapshot-fallback .fallback-sub {
  font-size: 10.5px;
  color: var(--muted);
}

.web-snapshot-footer {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
}

.web-snapshot-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.web-snapshot-url-line {
  font-size: 10.5px;
  font-family: monospace;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ *
 * CREATIVE STUDIOS: Image, Video, Music
 * ------------------------------------------------------------------ */

.studio-container {
  padding: 12px;
  padding-bottom: calc(85px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  contain: content;
  transform: translateZ(0);
}
.studio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.studio-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.studio-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
}
.studio-subtitle {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.studio-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.prompt-wrap {
  position: relative;
  margin-bottom: 10px;
}
.studio-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-size: 13px;
  padding: 10px;
  padding-bottom: 34px;
  resize: none;
  font-family: inherit;
  outline: none;
}
.studio-textarea:focus {
  border-color: var(--line-strong);
}
.btn-prompt-magic {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text-bright);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-prompt-magic:active {
  background: var(--panel-bright);
}
.studio-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  margin-top: 6px;
}

/* Spotlight Stage */
.spotlight-stage {
  margin-bottom: 8px;
  width: 100%;
}
.spotlight-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  gap: 6px;
}
.spotlight-header-left {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.spotlight-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}
.spotlight-header-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-badges {
  display: flex;
  gap: 4px;
  flex: none;
}
.spotlight-badge {
  font-size: 8.5px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
}
.spotlight-viewport {
  position: relative;
  width: 100%;
  height: 190px;
  max-height: 190px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.spotlight-img {
  max-width: 100%;
  max-height: 190px;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.spotlight-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.spotlight-placeholder-icon {
  font-size: 24px;
  color: var(--muted);
}
.spotlight-placeholder-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-bright);
}
.spotlight-placeholder-sub {
  font-size: 10.5px;
  color: var(--muted);
  max-width: 220px;
}
.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  gap: 6px;
}
.spotlight-prompt {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Recent Strip */
.recent-strip-container {
  margin-bottom: 8px;
}
.recent-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
  padding: 0 2px;
}
.recent-thumbnails-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.recent-thumb-item {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  flex: none;
  cursor: pointer;
  position: relative;
}
.recent-thumb-item.active {
  border-color: var(--accent);
}
.recent-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Compact Generator Card & Flyout Toolbar */
.compact-generator-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.studio-flyout-toolbar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1px 0 3px 0;
}
.flyout-trigger-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text-bright);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.flyout-trigger-pill:active {
  background: var(--panel-bright);
}
.pill-val {
  color: var(--text-bright);
  font-weight: 600;
}
.pill-arrow {
  font-size: 8px;
  color: var(--muted);
}

/* Stage Video Player Footer */
.stage-player-footer {
  padding: 6px 10px;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.stage-player-info {
  font-size: 10.5px;
  color: var(--muted);
}
.stage-player-btn-group {
  display: flex;
  gap: 4px;
}

.btn-studio-action {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--accent);
  color: #121214;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn-studio-action:active {
  opacity: 0.85;
}

/* Music Visualizer */
.music-visualizer-box {
  background: #000000;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 8px 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.music-canvas {
  width: 100%;
  height: 80px;
}
.synth-status-pill {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}
.music-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-danger-action {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--red);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * VIEW 5: Coding & Artifacts Studio
 * ------------------------------------------------------------------ */

.coding-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  gap: 6px;
}
.coding-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}
.code-tab-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.code-tab-btn.active {
  background: var(--panel-solid);
  border-color: var(--line);
  color: var(--text-bright);
}
.select-pill {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  color: var(--text-bright);
  font-size: 11.5px;
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  outline: none;
}

.coding-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.code-editor-wrap {
  flex: 1;
  display: flex;
  padding: 10px;
  background: #000000;
}
.code-editor {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  color: #ececec;
  white-space: pre;
}
.code-actions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}
.code-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.code-action-btn.highlight {
  background: var(--panel-bright);
  border-color: var(--line-strong);
  color: var(--text-bright);
}

.artifacts-grid {
  padding: 12px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.artifact-card-item {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.artifact-card-item:active {
  background: var(--panel-solid);
}
.empty-state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 12px;
  color: var(--muted);
}
.empty-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  color: var(--faint);
}
.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 2px;
}
.empty-desc {
  font-size: 11.5px;
  line-height: 1.4;
  max-width: 260px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ *
 * VIEW 6: Desktop IDE Remote
 * ------------------------------------------------------------------ */

.ide-container {
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ide-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}
.ide-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.ide-status-indicator.connected {
  background: var(--emerald);
}
.ide-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-bright);
}
.ide-subtitle {
  font-size: 10.5px;
  color: var(--muted);
}

.ide-terminal-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000000;
  overflow: hidden;
}
.term-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.term-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.term-dot.red { background: #ef4444; }
.term-dot.yellow { background: #eab308; }
.term-dot.green { background: #22c55e; }
.term-title {
  margin-left: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
.terminal-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #94a3b8;
}
.term-line.prompt { color: var(--accent); }
.term-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--panel-solid);
  border-top: 1px solid var(--line);
}
.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12px;
  color: #ffffff;
}
.term-run-btn {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text-bright);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * VIEW 7: API Keys & Settings
 * ------------------------------------------------------------------ */

.settings-container {
  width: 100%;
  padding: 14px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-header {
  margin-bottom: 2px;
}
.settings-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
}
.settings-subtitle {
  font-size: 11.5px;
  color: var(--muted);
}

.settings-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.provider-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-bright);
}
.key-status-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--faint);
}
.key-status-chip.set {
  background: var(--raised);
  color: var(--emerald);
  border: 1px solid var(--line);
}
.card-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
}
.key-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12.5px;
  color: #ffffff;
  outline: none;
  font-family: inherit;
}
.key-input:focus { border-color: var(--line-strong); }
.btn-toggle-vis {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 3px;
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-save {
  flex: 1;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--accent);
  color: #121214;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-fetch {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.models-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.model-tag {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--line);
}
.provider-badge.quanta-sota {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.2));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.gateway-mode-selector, .drawer-mode-toggle {
  display: flex;
  background: rgba(13, 16, 32, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  margin-bottom: 12px;
}

.drawer-gateway-toggle-wrap {
  padding: 0 12px 8px 12px;
}

.gateway-tab, .drawer-mode-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gateway-tab.active, .drawer-mode-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(139, 92, 246, 0.25));
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}

.input-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.gateway-config-section {
  display: flex;
  flex-direction: column;
}

.quanta-cluster-info-box {
  background: rgba(8, 10, 20, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.cluster-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}
.cluster-stat-row .stat-label {
  color: var(--muted);
}
.cluster-stat-row .stat-val {
  color: var(--text-bright);
  font-weight: 600;
  font-family: var(--font-mono);
}

.speed-tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.speed-tier-item {
  background: rgba(13, 16, 32, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tier-badge.flash {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.tier-badge.pro {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.tier-badge.frontier {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}
.tier-badge.vision {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tier-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.tier-speed {
  margin-left: auto;
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  font-family: var(--font-mono);
}

.tier-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pref-row label {
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Full-Screen Artifact Panel (Slide-over)
 * ------------------------------------------------------------------ */

.artifact-panel {
  position: fixed;
  inset: 0;
  background: #000000;
  z-index: 135;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  padding-top: env(safe-area-inset-top);
}
.artifact-panel.open {
  transform: translateY(0);
}
.artifact-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  gap: 6px;
}
.artifact-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.artifact-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--text-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.artifact-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.artifact-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-lang-badge {
  font-size: 9.5px;
  color: var(--muted);
  font-weight: 500;
}
.artifact-tabs {
  display: flex;
  gap: 3px;
  background: var(--raised);
  padding: 2px;
  border-radius: var(--radius-sm);
}
.art-tab {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.art-tab.active {
  background: var(--panel-solid);
  color: #ffffff;
}
.artifact-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.artifact-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.art-pane {
  position: absolute;
  inset: 0;
  overflow: auto;
}
.art-pre {
  height: 100%;
  padding: 12px;
  background: #000000;
}
.sandbox-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* ------------------------------------------------------------------ *
 * Composer & Docked Model Selection Bar (Liquid Glass Dock)
 * ------------------------------------------------------------------ */

.composer {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 8px 14px;
  padding-bottom: max(14px, calc(8px + env(safe-area-inset-bottom)));
  background: var(--glass-dock);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: none;
}

.composer-control-dock,
.input-row,
.attachments {
  width: 100%;
  max-width: 860px;
}

.composer-control-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

/* Floating Model Selector Pill */
.model-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(22, 27, 44, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-specular);
  color: var(--text-bright);
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  flex: 1;
  min-width: 0;
  max-width: 220px;
}
.model-pill:hover {
  background: rgba(28, 35, 56, 0.75);
  border-color: var(--line-strong);
  box-shadow: var(--glass-specular-bright);
}
.model-pill:active {
  background: rgba(36, 44, 72, 0.9);
  transform: scale(0.98);
}
.pill-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}
.pill-badge .ico { width: 13px; height: 13px; }
.pill-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
  letter-spacing: -0.01em;
}
.pill-caret {
  width: 12px;
  height: 12px;
  color: var(--muted);
  flex: none;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.dock-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 27, 44, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.dock-chip:hover {
  color: #ffffff;
  background: rgba(30, 38, 60, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}
.dock-chip:active,
.dock-chip.active {
  color: #ffffff;
  border-color: var(--line-strong);
  background: rgba(35, 45, 75, 0.85);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}
.dock-chip .ico { width: 12px; height: 12px; }

.input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 22, 36, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-lg);
  padding: 4px 8px;
  min-height: 44px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.input-row:focus-within {
  border-color: var(--line-strong);
  background: rgba(24, 30, 48, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 16px rgba(56, 189, 248, 0.18);
}

textarea#input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 20px;
  color: #ffffff;
  min-height: 20px;
  max-height: 120px;
  padding: 2px 4px;
  align-self: center;
}
textarea#input::placeholder {
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 2px 4px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 3px;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text);
  flex: none;
}
.attachment-thumb {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
}
.attachment-name {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}
.attachment-remove:active { color: var(--red); }

.round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: opacity 0.12s ease;
}
.round.ghost {
  background: transparent;
  color: var(--muted);
}
.round.ghost:active {
  background: var(--raised);
  color: var(--text-bright);
}
.round.ghost.listening {
  color: #ffffff;
  background: var(--red);
}

.round.voice-waveform-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  transition: all 0.15s ease;
}
.round.voice-waveform-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.round.voice-waveform-btn:active {
  transform: scale(0.92);
  background: var(--accent-gradient);
  color: #ffffff;
}
.waveform-ico {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.round.send {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(56, 189, 248, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.round.send:active {
  filter: brightness(1.15);
  transform: scale(0.92);
}

/* Universal Bottom Sheet (Liquid Frosted Glass Modal) */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 120;
}
.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 82vh;
  background: rgba(13, 16, 26, 0.92);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.7);
  z-index: 130;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  contain: content;
}

.sheet-grip {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 12px auto;
}
.sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}
.sheet-subtitle-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 25, 42, 0.5);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.sheet-item:hover {
  background: rgba(28, 36, 60, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}
.sheet-item:active, .sheet-item.active {
  border-color: var(--line-strong);
  background: rgba(35, 46, 76, 0.85);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

.sheet-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.sheet-item-icon {
  font-size: 16px;
  flex: none;
}
.sheet-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}
.sheet-item-desc {
  font-size: 11px;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: calc(75px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #27272a;
  border: 1px solid var(--line-strong);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 150;
  pointer-events: none;
}

.nav-badge.live {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ------------------------------------------------------------------ *
 * Full-Screen Morphing Live Voice Stage (SOTA Ambient Experience)
 * ------------------------------------------------------------------ */

.live-voice-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)) 20px;
  background: #040711;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.live-voice-stage.hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}
.live-voice-stage.hidden * {
  animation: none !important;
}

.voice-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: #02040a;
}

/* Wandering Blue Flashlight in the Dark - 60 FPS GPU Accelerated */
.flashlight-beam-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translateZ(0);
  pointer-events: none;
}

.flashlight-blue-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 440px;
  height: 440px;
  margin-top: -220px;
  margin-left: -220px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.55) 0%, rgba(37, 99, 235, 0.25) 40%, rgba(14, 165, 233, 0.08) 65%, transparent 80%);
  animation: flashlightSearchGpu 18s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.flashlight-secondary-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  margin-top: -160px;
  margin-left: -160px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.35) 0%, rgba(56, 189, 248, 0.15) 50%, transparent 75%);
  animation: secondaryBeamWanderGpu 24s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

@keyframes flashlightSearchGpu {
  0% { transform: translate3d(-35vw, -30vh, 0) scale(1); }
  25% { transform: translate3d(25vw, 15vh, 0) scale(1.2); }
  50% { transform: translate3d(30vw, -18vh, 0) scale(0.95); }
  75% { transform: translate3d(-25vw, 22vh, 0) scale(1.15); }
  100% { transform: translate3d(10vw, -20vh, 0) scale(1.05); }
}

@keyframes secondaryBeamWanderGpu {
  0% { transform: translate3d(28vw, 25vh, 0) scale(1); }
  33% { transform: translate3d(-28vw, -12vh, 0) scale(1.15); }
  66% { transform: translate3d(12vw, -25vh, 0) scale(0.9); }
  100% { transform: translate3d(-15vw, 18vh, 0) scale(1.1); }
}

/* Frosted Glass Scrim - Pure Hardware Accelerated Gradients */
.voice-frosted-glass-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.05) 0%, rgba(2, 4, 10, 0.82) 85%);
  box-shadow: inset 0 0 80px rgba(56, 189, 248, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateZ(0);
  pointer-events: none;
}

.voice-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, #02040a 98%);
  pointer-events: none;
  transform: translateZ(0);
}

.voice-top-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateZ(0);
}

.voice-model-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: -0.01em;
}

.voice-model-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.voice-status-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.voice-status-text.listening { color: #38bdf8; text-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
.voice-status-text.speaking { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.4); }
.voice-status-text.thinking { color: #818cf8; text-shadow: 0 0 8px rgba(129, 140, 248, 0.4); }
.voice-status-text.muted { color: #64748b; text-shadow: none; }

.icon-btn-glass {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.icon-btn-glass:active {
  transform: scale(0.95);
}

/* Center Stage: Living Quantum Logo & Breathing Orb */
.voice-center-stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 420px;
  transform: translateZ(0);
}

.voice-orb-container {
  position: relative;
  width: 230px;
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transform: translateZ(0);
}

/* Pulsing Acoustic Rings - 100% GPU Transform */
.voice-ripple-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.3);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.voice-ripple-ring.ring-1 {
  width: 160px;
  height: 160px;
  animation: rippleOutGpu 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.voice-ripple-ring.ring-2 {
  width: 160px;
  height: 160px;
  animation: rippleOutGpu 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite 1.1s;
}

.voice-ripple-ring.ring-3 {
  width: 160px;
  height: 160px;
  animation: rippleOutGpu 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite 2.2s;
}

@keyframes rippleOutGpu {
  0% { transform: scale(0.85) translateZ(0); opacity: 0.65; border-color: rgba(56, 189, 248, 0.6); }
  60% { opacity: 0.25; }
  100% { transform: scale(1.9) translateZ(0); opacity: 0; border-color: rgba(168, 85, 247, 0); }
}

/* Outer Fluid Plasma Halo - Ultra-Smooth GPU Layers */
.voice-fluid-halo {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  pointer-events: none;
  transform: translateZ(0);
}

.orb-lobe {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.55;
  will-change: transform;
  transform: translateZ(0);
}

.orb-lobe.lobe-1 {
  background: radial-gradient(circle at 35% 35%, rgba(56, 189, 248, 0.4) 0%, transparent 60%);
  animation: lobeRotateGpu1 16s linear infinite;
}

.orb-lobe.lobe-2 {
  background: radial-gradient(circle at 65% 65%, rgba(129, 140, 248, 0.35) 0%, transparent 60%);
  animation: lobeRotateGpu2 20s linear infinite reverse;
}

.orb-lobe.lobe-3 {
  background: radial-gradient(circle at 50% 25%, rgba(168, 85, 247, 0.3) 0%, transparent 60%);
  animation: lobeRotateGpu3 14s linear infinite;
}

@keyframes lobeRotateGpu1 {
  0% { transform: rotate(0deg) translateZ(0); }
  100% { transform: rotate(360deg) translateZ(0); }
}

@keyframes lobeRotateGpu2 {
  0% { transform: rotate(0deg) translateZ(0); }
  100% { transform: rotate(-360deg) translateZ(0); }
}

@keyframes lobeRotateGpu3 {
  0% { transform: rotate(0deg) translateZ(0); }
  100% { transform: rotate(360deg) translateZ(0); }
}

/* Counter-Rotating Orbital Rings */
.logo-orbital-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

.logo-orbital-ring.ring-spin-cw {
  width: 188px;
  height: 188px;
  border: 1.5px dashed rgba(56, 189, 248, 0.4);
  animation: ringSpinCW 18s linear infinite;
}

.logo-orbital-ring.ring-spin-ccw {
  width: 210px;
  height: 210px;
  border: 1.5px dotted rgba(168, 85, 247, 0.35);
  animation: ringSpinCCW 24s linear infinite;
}

@keyframes ringSpinCW {
  0% { transform: rotate(0deg) translateZ(0); }
  100% { transform: rotate(360deg) translateZ(0); }
}

@keyframes ringSpinCCW {
  0% { transform: rotate(0deg) translateZ(0); }
  100% { transform: rotate(-360deg) translateZ(0); }
}

/* The Living Animated Quantum Logo Orb */
.voice-living-logo-orb {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 45% 45%, rgba(56, 189, 248, 0.3), rgba(129, 140, 248, 0.2) 60%, rgba(2, 4, 10, 0.8) 100%);
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.45), inset 0 0 16px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  will-change: transform;
  transform: translateZ(0);
}

.voice-living-logo-orb.speaking {
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.3);
  animation: logoSpeakingBreath 1.6s ease-in-out infinite alternate;
}

.voice-living-logo-orb.listening {
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.5), inset 0 0 16px rgba(56, 189, 248, 0.25);
  animation: logoListeningDrift 3.5s ease-in-out infinite alternate;
}

.voice-living-logo-orb.thinking {
  box-shadow: 0 0 35px rgba(129, 140, 248, 0.6);
  animation: logoThinkingSpin 1.4s linear infinite;
}

.voice-living-logo-orb.muted {
  box-shadow: 0 0 12px rgba(100, 116, 139, 0.2);
  filter: grayscale(0.85) opacity(0.5);
}

@keyframes logoSpeakingBreath {
  0% { transform: scale(1.02) translateZ(0); }
  100% { transform: scale(1.12) translateZ(0); }
}

@keyframes logoListeningDrift {
  0% { transform: scale(1) translateZ(0); }
  100% { transform: scale(1.05) translateZ(0); }
}

@keyframes logoThinkingSpin {
  0% { transform: scale(1.04) rotate(0deg) translateZ(0); }
  100% { transform: scale(1.04) rotate(360deg) translateZ(0); }
}

/* Living Logo Layers */
.living-logo-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.living-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  filter: contrast(1.18) brightness(1.1);
  animation: logoSpiralRotate 32s linear infinite;
}

@keyframes logoSpiralRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.living-logo-specular-shimmer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, transparent 40%, rgba(255, 255, 255, 0.28) 60%, transparent 100%);
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: specularSweep 6s ease-in-out infinite;
}

@keyframes specularSweep {
  0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.05) rotate(180deg); }
}

.living-logo-chroma-glow {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(168, 85, 247, 0.25) 50%, transparent 75%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: chromaBreathe 4s ease-in-out infinite alternate;
}

@keyframes chromaBreathe {
  0% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 0.85; transform: scale(1.1); }
}

.living-equator-wave {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.85), #ffffff, rgba(168, 85, 247, 0.85), transparent);
  filter: blur(0.5px);
  box-shadow: 0 0 12px #38bdf8;
  opacity: 0.75;
  pointer-events: none;
  animation: equatorPulse 2.2s ease-in-out infinite alternate;
}

@keyframes equatorPulse {
  0% { opacity: 0.4; transform: translateY(-50%) scaleX(0.85); }
  100% { opacity: 0.95; transform: translateY(-50%) scaleX(1.15); box-shadow: 0 0 16px #38bdf8; }
}

.voice-canvas-wave {
  width: 280px;
  height: 50px;
  opacity: 0.9;
}

/* Floating Live Captions & Subtitles */
.voice-captions-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-height: 150px;
  overflow-y: auto;
  padding: 0 4px;
}

.voice-caption-user {
  font-size: 14.5px;
  font-weight: 500;
  color: #38bdf8;
  text-align: center;
  line-height: 1.4;
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  min-height: 24px;
  display: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.voice-caption-user:not(:empty) {
  display: block;
  animation: fadeInCaption 0.25s ease;
}

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

.voice-caption-ai {
  font-size: 15px;
  font-weight: 500;
  color: #f8fafc;
  text-align: center;
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  max-height: 100px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Bottom Glass Control Dock */
.voice-controls-dock {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.voice-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.voice-control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.voice-control-btn:active {
  transform: scale(0.95) translateY(0);
}

.voice-control-btn.active-muted {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.voice-control-btn.btn-interrupt {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
}

.voice-control-btn.btn-end-call {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.voice-control-btn.btn-end-call:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* ------------------------------------------------------------------ *
 * Desktop & Large Screen Optimizations (ChatGPT / Claude Web Style)
 * ------------------------------------------------------------------ */

@media (min-width: 768px) {
  .bar {
    padding: 10px 24px;
  }
  .brand-center.brand-capsule {
    max-width: 320px;
    padding: 5px 16px 5px 8px;
  }
  .thread {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
  }
  .msg.user {
    max-width: 75%;
  }
  .composer {
    padding: 10px 20px 14px 20px;
  }
  .composer-control-dock {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
  }
  .input-row {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 6px 12px;
  }
  .attachments {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
  }
  .studio-container, .settings-container {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
  }
  .sheet {
    max-width: 560px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 24px 24px 0 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
  }
}

@media (min-width: 1100px) {
  .thread {
    max-width: 920px;
  }
  .composer-control-dock, .input-row, .attachments, .studio-container, .settings-container {
    max-width: 920px;
  }
}

/* ------------------------------------------------------------------ *
 * Quanta Sovereign Welcome Hero Stage (Center Experience)
 * ------------------------------------------------------------------ */

.quanta-hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(30px, 6vh, 60px) 20px clamp(40px, 8vh, 80px);
  min-height: calc(100vh - 160px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.quanta-hero-stage.hidden {
  display: none !important;
}

.hero-orb-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px auto;
}
.hero-orb-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.45), rgba(139, 92, 246, 0.3), transparent 70%);
  filter: blur(16px);
  animation: heroPulse 3.5s ease-in-out infinite alternate;
}
.hero-orb-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(34, 211, 238, 0.5);
  animation: heroRotate 18s linear infinite;
}
.hero-orb-emblem {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(139, 92, 246, 0.65);
}

@keyframes heroPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}
@keyframes heroRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-brand-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(36px, 6vw, 54px);
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #ffffff 30%, var(--cyan) 75%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  line-height: 1.1;
}
.hero-brand-tagline {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 34px;
}

.hero-center-pill-wrap {
  width: 100%;
  max-width: 740px;
  margin: 0 auto 22px auto;
}
.hero-center-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 22, 38, 0.8);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 100px;
  padding: 8px 12px 8px 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 28px rgba(34, 211, 238, 0.16);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-center-pill:focus-within {
  border-color: var(--cyan);
  background: rgba(24, 30, 52, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 36px rgba(34, 211, 238, 0.32);
  transform: translateY(-2px);
}
.center-pill-sparkle {
  color: var(--cyan);
  display: flex;
  align-items: center;
}
.center-pill-sparkle .ico {
  width: 20px;
  height: 20px;
}
#center-pill-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: #ffffff;
  line-height: 1.5;
}
#center-pill-input::placeholder {
  color: var(--dim);
}
.btn-center-pill-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border: none;
  color: #050609;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-center-pill-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(34, 211, 238, 0.6);
}
.btn-center-pill-send .ico {
  width: 18px;
  height: 18px;
}

.hero-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 780px;
  margin: 0 auto 30px auto;
}
.hero-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 8px 18px;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hero-chip:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.15);
}

.hero-ethics-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 100px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.hero-ethics-banner:hover {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}
.hero-ethics-banner .ico {
  width: 15px;
  height: 15px;
  color: var(--cyan);
}

/* In Development Badges & Pulse Indicators */
.in-dev-chip {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--cyan);
  display: inline-block;
  line-height: 1.2;
}

.header-dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-dev-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.header-dev-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dev-pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulseDevDot 2s infinite ease-in-out;
}

@keyframes pulseDevDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ------------------------------------------------------------------ *
 * Minimalist Glowing 3-Dot Thinking Animation (Beside Quanta Bubble)
 * ------------------------------------------------------------------ */

.quanta-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  width: fit-content;
  margin: 2px 0;
}

.quanta-thinking-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: quantaPulseDot 1.4s infinite ease-in-out both;
}

.quanta-thinking-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.quanta-thinking-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
.quanta-thinking-indicator .dot:nth-child(3) { animation-delay: 0s; }

@keyframes quantaPulseDot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.35;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 10px var(--cyan);
  }
}

/* ------------------------------------------------------------------ *
 * Drawer User Account Strip & Card (Anthropic / OpenAI style)
 * ------------------------------------------------------------------ */

.drawer-account-section {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(4, 6, 12, 0.4);
}

.drawer-user-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.drawer-user-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.user-avatar-wrap {
  position: relative;
  flex: none;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.user-status-online {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #06080e;
}

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

.user-display-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan-badge {
  font-size: 10.5px;
  color: var(--cyan);
  font-family: var(--font-mono);
}

.user-menu-dots {
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Universal Drag & Drop Ingestion Overlay
 * ------------------------------------------------------------------ */

.dropzone-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dropzone-box {
  width: min(520px, 90vw);
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(56, 189, 248, 0.5);
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.12) 0%, rgba(10, 14, 26, 0.8) 100%);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  animation: dropzonePulse 2.5s infinite ease-in-out;
}

@keyframes dropzonePulse {
  0%, 100% { transform: scale(1); border-color: rgba(56, 189, 248, 0.5); }
  50% { transform: scale(1.02); border-color: rgba(56, 189, 248, 0.9); box-shadow: 0 0 60px rgba(56, 189, 248, 0.4); }
}

.dropzone-icon-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}
.dropzone-icon {
  width: 26px;
  height: 26px;
}
.dropzone-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}
.dropzone-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Rich Multi-File Attachment Chips */
.attachment-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 6px;
  border-radius: 8px;
  background: rgba(22, 28, 48, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 12px;
  color: var(--text-bright);
  flex: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.attachment-file-icon {
  font-size: 14px;
}
.attachment-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.attachment-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #ffffff;
}
.attachment-size {
  font-size: 9.5px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ *
 * Header Account Profile Avatar Button
 * ------------------------------------------------------------------ */

.header-account-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex: none;
}
.header-account-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.55);
}
.header-account-btn:active {
  transform: scale(0.95);
}

/* ------------------------------------------------------------------ *
 * Dock Live Voice Button & Active Pulse
 * ------------------------------------------------------------------ */

.dock-chip-voice {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
}
.dock-chip-voice:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.live-voice-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: voiceDotPulse 1.8s infinite ease-in-out;
  display: inline-block;
  flex: none;
}
@keyframes voiceDotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 12px #38bdf8; }
}

/* ------------------------------------------------------------------ *
 * Sovereign Authentication & Account Modal (Liquid Glass Hub)
 * ------------------------------------------------------------------ */

.account-auth-panel {
  max-width: 440px !important;
  width: 92vw;
  background: rgba(10, 13, 24, 0.88) !important;
  backdrop-filter: var(--glass-blur-heavy) !important;
  -webkit-backdrop-filter: var(--glass-blur-heavy) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.12) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}

.account-tabs {
  display: flex;
  background: rgba(14, 18, 34, 0.75);
  border-bottom: 1px solid var(--line);
  padding: 4px;
  gap: 4px;
}

.account-tab {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.account-tab:hover {
  color: var(--text-bright);
}
.account-tab.active {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.auth-section {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.auth-link-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--cyan);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-password-wrap input {
  padding-right: 36px;
}
.btn-toggle-pass {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  padding: 4px;
}
.btn-toggle-pass:hover { opacity: 1; }

.auth-select {
  cursor: pointer;
  background-color: var(--bg);
}

.auth-error-msg {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 12px;
  line-height: 1.4;
}

.btn-auth-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  margin-top: 4px;
}
.btn-auth-primary:hover {
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}
.btn-auth-primary:active {
  transform: translateY(1px);
}

/* Logged In Profile Card */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.profile-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.profile-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-email {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.profile-tier-chip {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan);
  letter-spacing: 0.03em;
}
.profile-sync-chip {
  font-size: 10px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sovereign-id-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sovereign-id-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.sovereign-id-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--cyan);
}

.profile-actions-grid {
  display: flex;
  gap: 8px;
}
.profile-actions-grid button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  font-size: 11.5px;
}
.btn-fetch.danger {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.btn-fetch.danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-logout:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

/* ------------------------------------------------------------------ *
 * Web Grounding Citations Bar (Claude & Gemini SOTA Style)
 * ------------------------------------------------------------------ */

.web-citations-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.web-citation-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.web-citation-chip:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}
.web-citation-favicon {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}
.web-citation-domain {
  font-weight: 500;
}



