/* ===================================================================
   Mira Digital Human — Cyber-Nexus Theme (Futuristic Light Blue)
   =================================================================== */

/* --- Design Tokens --- */
:root {
  color-scheme: dark;
  --bg: #020610; /* Deepest space vacuum black */
  --panel: #050d1a; /* Metallic deep navy panel */
  --panel-2: #091428; /* Medium tech navy */
  --panel-3: #10213d; /* Active navy highlights */
  --glass: rgba(5, 13, 26, 0.65); /* Translucent HUD plates */
  --glass-border: rgba(0, 240, 255, 0.16); /* Fine cyber-cyan glass border */
  --line: rgba(0, 240, 255, 0.08); /* Grid line subtle cyan */
  --line-strong: rgba(0, 240, 255, 0.18); /* Stronger HUD outline */
  --text: #e3f4ff; /* Crisp ice blue text */
  --text-secondary: #92b2d6; /* Steel blue information text */
  --muted: #6080a8; /* Dimmed metal labels */
  --accent: #00f0ff; /* Electric neon cyan (Ready / Idle) */
  --accent-dim: rgba(0, 240, 255, 0.12);
  --accent-glow: rgba(0, 240, 255, 0.35);
  --accent-2: #4d88ff; /* Laser blue (Thinking) */
  --accent-strong: #7df9ff; /* Radiant ice blue (Speaking) */
  --danger: #ff2a85; /* Cyberpunk neon magenta-pink (Listening / Recording) */
  --danger-dim: rgba(255, 42, 133, 0.15);
  --danger-glow: rgba(255, 42, 133, 0.35);
  --user-bubble: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.04));
  --user-border: rgba(0, 240, 255, 0.3);
  --radius: 8px; /* Sharper cyber corners */
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 20px 60px rgba(0, 240, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.65);
  --font-mono: 'Orbitron', 'Space Grotesk', ui-monospace, monospace;
  --font: 'Space Grotesk', 'Inter', ui-sans-serif, -apple-system, sans-serif;
  --transition: 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(77, 136, 255, 0.03) 0%, transparent 40%);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input {
  font: inherit;
  color: inherit;
}

/* --- Shell Container --- */
.shell {
  width: min(1560px, calc(100vw - 40px));
  height: calc(100svh - 40px);
  min-height: 560px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
  transition: grid-template-columns 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cyber ornaments on the shell outer border */
.shell::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 30px;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 10;
  pointer-events: none;
}

.shell.stage-collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
}

/* --- Stage (Avatar Area) --- */
.stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(0, 240, 255, 0.08), transparent 60%),
    linear-gradient(180deg, #030812 0%, #050d1a 50%, #030812 100%);
  border-right: 1px solid var(--line-strong);
  transition: opacity 300ms ease;
}

.shell.stage-collapsed .stage {
  opacity: 0;
  pointer-events: none;
}

/* --- HUD & Cyber Grid Overlay --- */
.hud-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 95%);
  pointer-events: none;
  opacity: 0.75;
}

/* Cyber Corner HUD Brackets */
.hud-corners {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  z-index: 2;
}
.hud-corners::before,
.hud-corners::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 240, 255, 0.25);
}
/* Top-Left Corner Bracket */
.hud-corners::before {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  box-shadow: -2px -2px 0 rgba(0, 240, 255, 0.15);
}
/* Bottom-Right Corner Bracket */
.hud-corners::after {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  box-shadow: 2px 2px 0 rgba(0, 240, 255, 0.15);
}

/* Laser Scanline Beam */
.scanline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  z-index: 4;
  pointer-events: none;
  animation: scanMoving 6s linear infinite;
  opacity: 0.45;
}

.avatar.thinking ~ .scanline,
.avatar.speaking ~ .scanline {
  animation-duration: 3s;
  opacity: 0.75;
}

/* --- Ambient Effects --- */
.ambient-glow {
  position: absolute;
  bottom: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 240, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: ambientPulse 5s ease-in-out infinite;
}

/* Concentric Dual-Axis Holographic Rings */
.ambient-ring {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform-style: preserve-3d;
  pointer-events: none;
  border-radius: 50%;
}

.ambient-ring-inner {
  width: 180px;
  height: 48px;
  margin-left: -90px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 
    0 0 35px rgba(0, 240, 255, 0.08),
    inset 0 0 20px rgba(0, 240, 255, 0.05);
  animation: ringRotateClockwise 8s linear infinite;
}

.ambient-ring-outer {
  width: 240px;
  height: 64px;
  margin-left: -120px;
  border: 1px dashed rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.03);
  animation: ringRotateCounterClockwise 12s linear infinite;
}

.ambient-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  animation: particleFloat 8s ease-in-out infinite;
}

.ambient-particles span:nth-child(1) { left: 18%; top: 72%; animation-delay: 0s; animation-duration: 7s; }
.ambient-particles span:nth-child(2) { left: 78%; top: 62%; animation-delay: 1.2s; animation-duration: 9s; }
.ambient-particles span:nth-child(3) { left: 33%; top: 82%; animation-delay: 2.5s; animation-duration: 6s; width: 2px; height: 2px; }
.ambient-particles span:nth-child(4) { left: 62%; top: 78%; animation-delay: 3.8s; animation-duration: 8s; }
.ambient-particles span:nth-child(5) { left: 22%; top: 58%; animation-delay: 5s; animation-duration: 10s; width: 2px; height: 2px; }
.ambient-particles span:nth-child(6) { left: 85%; top: 48%; animation-delay: 6.5s; animation-duration: 7.5s; }

/* --- Stage Top Bar --- */
.stage-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(77, 136, 255, 0.4);
  transition: all var(--transition);
}

.dot.online {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.dot.error {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.6);
}

.stage-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.stage-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

/* --- Avatar Portrait Immersive --- */
.avatar {
  position: relative;
  align-self: center;
  justify-self: center;
  z-index: 5;
  width: min(82%, 260px);
  display: grid;
  justify-items: center;
  animation: avatarIdle 3.5s ease-in-out infinite;
}

.avatar-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1; /* Perfect square layout to fit 1:1 AI images */
  display: grid;
  place-items: center;
  border-radius: 50%; /* Circle holographic lens */
  overflow: hidden;
  background: transparent;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
  transition: transform 300ms ease, filter 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
  border: 1.5px solid rgba(0, 240, 255, 0.15);
  box-shadow: 
    0 0 20px rgba(0, 240, 255, 0.08),
    inset 0 0 15px rgba(0, 240, 255, 0.06);
  /* Apply soft vignette radial mask to fade out hard square image edges */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 96%);
  mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 96%);
}

.avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1), transform 500ms cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: opacity, transform;
}

.avatar-image-default {
  opacity: 1;
}

.avatar.thinking .avatar-image-default,
.avatar.speaking .avatar-image-default {
  opacity: 0;
  transform: scale(0.97);
}

.avatar.thinking .avatar-image-thinking {
  opacity: 1;
  transform: scale(1.02);
}

.avatar.speaking .avatar-image-speaking {
  opacity: 1;
  transform: scale(1.025);
}

.avatar.listening .avatar-image-default {
  transform: scale(1.01);
}

/* Avatar state-specific glow */
.avatar.thinking {
  animation: avatarThink 2.5s ease-in-out infinite;
}

.stage:has(.avatar.thinking) .ambient-glow {
  background: radial-gradient(ellipse, rgba(77, 136, 255, 0.15) 0%, transparent 70%);
}

.avatar.speaking .avatar-portrait {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 
    0 0 30px rgba(0, 240, 255, 0.22),
    inset 0 0 20px rgba(0, 240, 255, 0.15);
  filter: drop-shadow(0 10px 25px rgba(0, 240, 255, 0.12));
}

.stage:has(.avatar.speaking) .ambient-glow {
  animation: ambientPulseSpeaking 1.8s ease-in-out infinite;
}

.stage:has(.avatar.speaking) .ambient-ring-inner {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 
    0 0 45px rgba(0, 240, 255, 0.15),
    inset 0 0 25px rgba(0, 240, 255, 0.08);
}

/* Holographic Thoughts bubble */
.thoughts {
  position: absolute;
  top: -24px;
  right: -10px;
  display: flex;
  gap: 5px;
  z-index: 10;
  opacity: 0;
  transform: translateY(5px) scale(0.9);
  transition: all var(--transition);
  pointer-events: none;
}

.avatar.thinking .thoughts {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.thoughts span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: thinkingDot 1.4s ease-in-out infinite;
}

.thoughts span:nth-child(2) { animation-delay: 200ms; }
.thoughts span:nth-child(3) { animation-delay: 400ms; }

/* Mouth overlay — disabled, expressions are native to illustrations */
.avatar-portrait .mouth {
  display: none;
}

/* Speaking subtle pulse effect on portrait container */
.avatar.speaking .avatar-portrait {
  animation: speakingPulse 1.2s ease-in-out infinite;
}

/* --- Sci-Fi Telemetry diagnostics --- */
.hud-telemetry {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 24px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  pointer-events: none;
}

.telemetry-item {
  display: flex;
  align-items: center;
}

.telemetry-item::before {
  content: '>';
  margin-right: 6px;
  color: var(--accent);
  opacity: 0.8;
}

/* --- Link latency trace panel --- */
.trace-panel {
  position: relative;
  z-index: 10;
  margin: 12px 24px 0;
  padding: 12px;
  border: 1px solid rgba(0, 240, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(3, 10, 22, 0.66);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.04);
  color: var(--muted);
  font-family: var(--font-mono);
  pointer-events: none;
}

.trace-panel.active {
  border-color: rgba(0, 240, 255, 0.28);
  box-shadow:
    inset 0 0 18px rgba(0, 240, 255, 0.06),
    0 0 22px rgba(0, 240, 255, 0.06);
}

.trace-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.trace-panel-header span {
  color: var(--accent);
  font-weight: 800;
}

.trace-panel-header strong {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0;
}

.trace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trace-grid div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.trace-grid span,
.trace-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-grid span {
  margin-bottom: 3px;
  color: var(--text-secondary);
  font-size: 9px;
}

.trace-grid strong {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0;
}

.trace-hint {
  margin-top: 9px;
  color: var(--accent-2);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

/* --- Stage Overlay (Badge & Wave) --- */
.stage-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 26px;
}

/* Glassmorphism Status Badge */
.state-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.state-icon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: all var(--transition);
}

.state-badge strong {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
}

/* --- Dynamic Volume Voice Wave --- */
.voice-wave {
  height: 32px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  gap: 4px;
  opacity: 0;
  flex-shrink: 0;
  width: 84px;
  transition: opacity var(--transition);
}

.voice-wave.listening,
.voice-wave.speaking { 
  opacity: 1; 
}

.voice-wave span {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.25);
  transform-origin: center;
  /* Bind to native transform in JS, transition smooths out packet jitter */
  transition: transform 120ms cubic-bezier(0.1, 0.8, 0.3, 1), background 200ms ease;
  will-change: transform;
}

.voice-wave span:nth-child(1),
.voice-wave span:nth-child(7) { transform: scaleY(0.7); }
.voice-wave span:nth-child(2),
.voice-wave span:nth-child(6) { transform: scaleY(1.3); }
.voice-wave span:nth-child(3),
.voice-wave span:nth-child(5) { transform: scaleY(2.2); }
.voice-wave span:nth-child(4) { transform: scaleY(3.0); }

.voice-wave.listening span {
  background: var(--danger);
  /* Pure JS dynamic height takes over, fallback to static keyframes is overridden */
}

.voice-wave.speaking span {
  background: var(--accent-strong);
}

.voice-wave.thinking span {
  opacity: 1;
  background: rgba(77, 136, 255, 0.6);
  animation: waveLift 1.1s ease-in-out infinite;
}
.voice-wave.thinking span:nth-child(2) { animation-delay: 70ms; }
.voice-wave.thinking span:nth-child(3) { animation-delay: 140ms; }
.voice-wave.thinking span:nth-child(4) { animation-delay: 210ms; }
.voice-wave.thinking span:nth-child(5) { animation-delay: 280ms; }
.voice-wave.thinking span:nth-child(6) { animation-delay: 350ms; }

/* --- Conversation Area --- */
.conversation {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #040914; /* Cyber dark slate */
  position: relative;
}

/* Grid overlay for conversation */
.conversation::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.8;
  z-index: 0;
}

/* Header Section */
.conversation-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
}

.conversation-header .eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conversation-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  font-family: var(--font);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.icon-button:hover {
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--accent);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.icon-button:active {
  transform: scale(0.96);
}

/* --- Messages Container & Bubbles --- */
.messages {
  position: relative;
  z-index: 2;
  overflow-y: auto;
  padding: 28px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Customize Cyber scrollbar */
.messages::-webkit-scrollbar {
  width: 6px;
}
.messages::-webkit-scrollbar-track {
  background: transparent;
}
.messages::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.12);
  border-radius: 99px;
  border: 1px solid transparent;
}
.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.25);
}

.message {
  max-width: min(82%, 520px);
  padding: 13px 18px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  animation: messageIn 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

/* Cybernetic User Message Bubble */
.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  border: 1px solid var(--user-border);
  color: #f0f8ff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.04);
}

/* Assistant Message wrapping with mini-avatar */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(85%, 550px);
  animation: messageIn 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
  background: #030812;
}

.message-row .message {
  max-width: 100%;
  animation: none; /* Already animated by the row wrapper */
}

/* Cybernetic Assistant Message Bubble */
.message.assistant {
  align-self: flex-start;
  background: rgba(10, 22, 44, 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Special Assistant Audio action trigger */
.message.audio-action {
  align-self: flex-start;
  margin-left: 44px; /* Align perfectly with assistant bubble (32px avatar + 12px gap) */
  background: var(--glass);
  border: 1px dashed var(--line-strong);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  font-size: 13px;
}

.audio-unlock-button {
  position: fixed;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  z-index: 220;
  transform: translateX(-50%) translateY(10px);
  min-width: 172px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(3, 12, 24, 0.92);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow:
    0 0 20px rgba(0, 240, 255, 0.18),
    inset 0 0 12px rgba(0, 240, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.audio-unlock-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.message.audio-action::before {
  content: '▶';
  font-size: 10px;
}

.message.audio-action:hover {
  background: rgba(0, 240, 255, 0.06);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

/* Cyber System notifications */
.message.system {
  align-self: center;
  max-width: 90%;
  background: rgba(146, 178, 214, 0.04);
  border: 1px solid rgba(146, 178, 214, 0.1);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: none;
}

/* Error message indicators */
.message.error {
  align-self: center;
  max-width: 90%;
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  color: #ffb8c6;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.1);
}

/* Thinking Indicator Bubble */
.message.thinking {
  display: flex;
  gap: 6px;
  padding: 14px 22px;
  align-items: center;
  background: rgba(10, 22, 44, 0.7);
  border: 1px solid rgba(77, 136, 255, 0.2);
}

.message.thinking span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 6px rgba(77, 136, 255, 0.5);
  animation: thinkingDot 1.4s ease-in-out infinite;
}

.message.thinking span:nth-child(2) { animation-delay: 200ms; }
.message.thinking span:nth-child(3) { animation-delay: 400ms; }

/* --- Cybernetic Composer (Footer Input) --- */
.composer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
  background: rgba(4, 9, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Cyber Record Mic Button */
.record-button {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  outline: none;
}

.record-button span {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: all var(--transition);
}

.record-button:hover {
  border-color: var(--accent);
  background: var(--panel-3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.record-button:hover span {
  transform: scale(1.15);
  background: var(--accent-strong);
}

/* Active Recording state */
.record-button.recording {
  border-color: var(--danger);
  background: rgba(255, 42, 133, 0.08);
  box-shadow: 0 0 20px rgba(255, 42, 133, 0.25);
  animation: recordPulse 1.2s infinite;
}

.record-button.recording span {
  border-radius: 3px;
  background: var(--danger);
  transform: scale(0.9);
  box-shadow: 0 0 12px var(--danger-glow);
}

.record-button.recording::before,
.record-button.recording::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--danger);
  opacity: 0;
  pointer-events: none;
  animation: micRipple 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.record-button.recording::after {
  animation-delay: 600ms;
}

/* Interactive custom mic level ring */
.record-button::before {
  transform: scale(calc(1 + var(--record-level, 0) * 0.8));
  opacity: calc(var(--record-level, 0) * 0.7);
  transition: transform 80ms ease, opacity 80ms ease;
}

/* Text input bar */
.composer input {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.composer input::placeholder {
  color: var(--muted);
  font-family: var(--font);
}

.composer input:focus {
  border-color: var(--accent);
  background: var(--panel-3);
  box-shadow: 
    0 0 15px rgba(0, 240, 255, 0.15),
    inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Send button */
.composer button[type="submit"] {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  outline: none;
}

.composer button[type="submit"]:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--panel-3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.composer button[type="submit"]:active:not(:disabled) {
  transform: scale(0.95);
}

.composer button[type="submit"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--line);
}

/* --- Core Keyframe Animations --- */
@keyframes ambientPulse {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@keyframes ambientPulseSpeaking {
  0%, 100% { opacity: 0.7; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.4); }
}

@keyframes ringRotateClockwise {
  0% { transform: translateX(-50%) rotateX(72deg) rotateZ(0deg); }
  100% { transform: translateX(-50%) rotateX(72deg) rotateZ(360deg); }
}

@keyframes ringRotateCounterClockwise {
  0% { transform: translateX(-50%) rotateX(72deg) rotateZ(360deg); }
  100% { transform: translateX(-50%) rotateX(72deg) rotateZ(0deg); }
}

@keyframes particleFloat {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 0.7; }
  80% { opacity: 0.7; }
  100% { transform: translateY(-70px) scale(0.6); opacity: 0; }
}

@keyframes avatarIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes avatarThink {
  0%, 100% { transform: translateY(0) scale(1); filter: brightness(1); }
  50% { transform: translateY(-3px) scale(0.995); filter: brightness(1.15); }
}

@keyframes speakingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
  50% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.12); }
}

@keyframes thinkingDot {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 133, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(255, 42, 133, 0.05); }
}

@keyframes micRipple {
  0% { transform: scale(0.88); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes waveLift {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.3); }
}

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

@keyframes scanMoving {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* --- Header Actions --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Futuristic Settings Drawer --- */
.settings-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  z-index: 100;
  background: rgba(4, 9, 20, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.settings-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
  outline: none;
}

.drawer-close:hover {
  color: var(--danger);
  border-color: rgba(255, 42, 133, 0.2);
  background: rgba(255, 42, 133, 0.08);
}

.drawer-body {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setting-item textarea, 
.setting-item select {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}

.setting-item textarea:focus, 
.setting-item select:focus {
  border-color: var(--accent);
  background: var(--panel-3);
  box-shadow: 
    0 0 10px rgba(0, 240, 255, 0.12),
    inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.setting-item textarea {
  resize: none;
  font-family: var(--font);
  line-height: 1.5;
}

.checkbox-item {
  margin-top: 10px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.switch-label input {
  display: none;
}

.switch-slider {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  transition: all var(--transition);
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: all var(--transition);
}

.switch-label input:checked + .switch-slider {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent);
}

.switch-label input:checked + .switch-slider::before {
  left: 20px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.drawer-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
  background: rgba(4, 9, 20, 0.5);
}

.action-button {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(0, 240, 255, 0.04));
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition);
  outline: none;
}

.action-button:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.28), rgba(0, 240, 255, 0.08));
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.action-button:active {
  transform: scale(0.97);
}

/* --- High-end Responsive & Adapters --- */

@media (max-width: 768px) {
  body {
    padding: 0;
    overflow: auto;
  }

  .shell {
    width: 100%;
    height: 100vh;
    margin: 0;
    border: none;
    border-radius: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .shell.stage-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: 0px 1fr;
  }

  /* Compact top-bar HUD on mobile */
  .stage {
    height: 170px;
    min-height: 0;
    max-height: none;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-right: none;
    border-bottom: 1px solid var(--line-strong);
    background:
      radial-gradient(circle at 80% 90%, rgba(0, 240, 255, 0.08), transparent 50%),
      linear-gradient(135deg, #030812 0%, #050d1a 100%);
  }

  .hud-grid {
    background-size: 24px 24px;
  }

  .hud-corners {
    inset: 6px;
  }

  .hud-telemetry {
    display: none; /* Hide multi-line metadata on small viewports */
  }

  .trace-panel {
    display: none;
  }

  .stage-top-bar {
    padding: 10px 14px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
  }

  /* Float mobile avatar to the right side gracefully */
  .avatar {
    position: absolute;
    right: 16px;
    bottom: 8px;
    z-index: 5;
    width: 105px;
    animation: avatarIdleMobile 4s ease-in-out infinite;
    transform: none;
  }

  .avatar-portrait {
    border-radius: 50%;
    aspect-ratio: 1;
    border: 1.5px solid rgba(0, 240, 255, 0.2);
    box-shadow: 
      0 0 15px rgba(0, 240, 255, 0.12),
      inset 0 0 10px rgba(0, 240, 255, 0.08);
    /* Mobile vignette mask */
    -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 96%);
    mask-image: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 96%);
  }

  .ambient-ring-inner {
    width: 90px;
    height: 28px;
    bottom: 2%;
    left: auto;
    right: 28px;
    margin: 0;
  }
  
  .ambient-ring-outer {
    display: none; /* Simplify overlapping rings on mobile */
  }

  .ambient-particles {
    display: none;
  }

  .stage-overlay {
    position: absolute;
    left: 14px;
    bottom: 10px;
    align-items: flex-start;
    padding: 0;
    gap: 8px;
  }

  .state-badge {
    padding: 4px 10px;
    font-size: 10px;
  }

  .voice-wave {
    height: 20px;
    width: 60px;
    gap: 3px;
  }

  .voice-wave span {
    height: 4px;
  }

  .conversation {
    grid-template-rows: auto 1fr auto;
    background: #040914;
    overflow: hidden;
  }

  .conversation-header {
    padding: 14px 18px;
  }

  .conversation-header h1 {
    font-size: 18px;
  }

  .messages {
    padding: 18px 18px 12px;
    gap: 14px;
  }

  .message {
    padding: 10px 14px;
    font-size: 14px;
  }

  .composer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .record-button {
    width: 52px;
    height: 52px;
  }

  .composer input {
    height: 44px;
    font-size: 14px;
    border-radius: var(--radius);
  }

  .composer button[type="submit"] {
    width: 44px;
    height: 44px;
  }

  .settings-drawer {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line-strong);
  }
}

@keyframes avatarIdleMobile {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Accessibility: respect users who prefer reduced animations */
@media (prefers-reduced-motion: reduce) {
  .avatar,
  .avatar.thinking,
  .avatar.speaking .avatar-portrait,
  .thoughts span,
  .message.thinking span,
  .record-button.recording,
  .record-button.recording::before,
  .record-button.recording::after,
  .voice-wave span,
  .ambient-glow,
  .ambient-ring-inner,
  .ambient-ring-outer,
  .ambient-particles span,
  .scanline {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Holographic Secure Gateway Overlay --- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 16, 0.95);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms ease;
  overflow: hidden;
}

.login-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
}

.login-overlay.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.login-box {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 36px 36px;
  box-shadow: 
    0 30px 100px rgba(0, 240, 255, 0.1),
    0 0 80px rgba(0, 0, 0, 0.8),
    inset 0 0 30px rgba(0, 240, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.login-box .hud-corners {
  position: absolute;
  inset: 12px;
  pointer-events: none;
}

.login-box .hud-corners::before,
.login-box .hud-corners::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
}

.login-box .hud-corners::before {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

.login-box .hud-corners::after {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

.cyber-badge {
  display: inline-block;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.login-header h2 {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: 1px;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.login-header .description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.login-form input[type="password"] {
  width: 100%;
  height: 52px;
  background: rgba(2, 6, 16, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 16px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: border-color 250ms, box-shadow 250ms;
}

.login-form input[type="password"]::placeholder {
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--muted);
}

.login-form input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 
    0 0 18px rgba(0, 240, 255, 0.25),
    inset 0 0 10px rgba(0, 240, 255, 0.1);
}

.auth-error-msg {
  font-size: 12px;
  color: var(--danger);
  min-height: 18px;
  line-height: 1.5;
  text-align: center;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 42, 133, 0.3);
}

.login-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  letter-spacing: 0.5px;
}

/* --- Lin Xiaozhi: Exhibition Hall Reception Theme (Glowing Amber-Gold) --- */
body.theme-exhibition {
  --bg: #090602; /* Tech dark amber black */
  --panel: #140d05; /* Warm deep bronze-gold panel */
  --panel-2: #21160a; /* Medium amber-bronze */
  --panel-3: #32210e;
  --glass: rgba(20, 13, 5, 0.7);
  --glass-border: rgba(255, 170, 0, 0.18);
  --line: rgba(255, 170, 0, 0.08);
  --line-strong: rgba(255, 170, 0, 0.22);
  --text: #fff6e0; /* Warm golden-white text */
  --text-secondary: #d6be92; /* Sandy gold secondary text */
  --muted: #a38965; /* Muted gold bronze labels */
  --accent: #ffaa00; /* Rich neon gold (Ready / Idle) */
  --accent-dim: rgba(255, 170, 0, 0.12);
  --accent-glow: rgba(255, 170, 0, 0.35);
  --accent-2: #ff7700; /* Rich orange (Thinking) */
  --accent-strong: #ffdf7a; /* Brilliant warm gold (Speaking) */
  --danger: #ff4500; /* Energetic red-orange (Listening) */
  --danger-dim: rgba(255, 69, 0, 0.15);
  --danger-glow: rgba(255, 69, 0, 0.35);
  --user-bubble: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(255, 170, 0, 0.04));
  --user-border: rgba(255, 170, 0, 0.3);
  
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 170, 0, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 119, 0, 0.04) 0%, transparent 40%);
}

/* Full-body layout adjustments for vertical totem presentation */
body.theme-exhibition .avatar {
  width: min(85%, 280px);
  height: 84%; /* Grows taller to show full body digital human */
  align-self: center;
  justify-self: center;
  animation: avatarIdleMobile 4.5s ease-in-out infinite; /* Slower breathing animation */
}

body.theme-exhibition .avatar-portrait {
  aspect-ratio: 3/4; /* Elegant vertical full-body rectangle */
  border-radius: var(--radius-lg); /* Sci-fi glass panel with rounded corners */
  border: 1.5px solid rgba(255, 170, 0, 0.25);
  box-shadow: 
    0 20px 50px rgba(255, 170, 0, 0.08),
    0 0 0 1px rgba(255, 170, 0, 0.15),
    inset 0 0 25px rgba(255, 170, 0, 0.05);
  /* Disable circular lens opacity mask to show full body details! */
  -webkit-mask-image: none;
  mask-image: none;
  transition: all 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.theme-exhibition .avatar:hover .avatar-portrait {
  border-color: var(--accent);
  box-shadow: 
    0 25px 60px rgba(255, 170, 0, 0.18),
    inset 0 0 30px rgba(255, 170, 0, 0.1);
  transform: translateY(-2px);
}

body.theme-exhibition .mini-avatar {
  border-radius: 4px;
}

/* Theme Toggle Button Style */
.skin-toggle-button {
  position: relative;
  transition: color 250ms, background-color 250ms, box-shadow 250ms;
}

body.theme-exhibition .skin-toggle-button {
  color: var(--accent);
  background: rgba(255, 170, 0, 0.08);
  border-color: rgba(255, 170, 0, 0.25);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.2);
}

.skin-toggle-button svg {
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skin-toggle-button:hover svg {
  transform: rotate(360deg) scale(1.1);
}
