/* Base Styles & Custom Properties */
:root {
  --font-title: 'Lexend', 'Noto Sans Hebrew', Arial, sans-serif;
  --font-body: 'Lexend', 'Noto Sans Hebrew', Arial, sans-serif;

  /* Clean White Light Palette */
  --bg-primary: #ffffff;
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #fbfdff 52%, #f7fbff 100%);
  
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.05), 
                  inset 0 1px 1px 0 rgba(255, 255, 255, 0.4);
  
  --color-primary: #0a4ebd;
  --color-accent: #00a3ff;
  --color-glow: #00e5ff;
  --color-purple: #7000ff;
  
  --text-main: #102a56;
  --text-muted: #4e6b98;
  --text-light: #ffffff;
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}


/* Immersive Dark Theme overrides */
body.theme-dark {
  --bg-primary: #2D3034;
  --bg-gradient: #2D3034;
  --glass-bg: rgba(13, 22, 38, 0.65);
  --glass-bg-hover: rgba(13, 22, 38, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 20px 50px 0 rgba(0, 0, 0, 0.45), 
                  inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  --text-main: #e2f0fd;
  --text-muted: #8fa0bd;
  background-color: #2D3034;
}

body.theme-dark .chat-terminal-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.15);
}

body.theme-dark .chat-input-row {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .chat-input-row:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 163, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 163, 255, 0.15);
}

body.theme-dark .voice-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .voice-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

body.theme-dark .suggest-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

body.theme-dark .suggest-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.theme-dark .chat-bubble-container.bubble-bot-container .chat-bubble {
  background: rgba(13, 22, 38, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2f0fd;
}

body.theme-dark .mesh-glow {
  opacity: 0;
}

body.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

body.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Theme Toggle Button */
.theme-toggle-btn,
.header-settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-fast);
  outline: none;
}

.theme-toggle-btn:hover,
.header-settings-btn:hover {
  background: var(--glass-bg-hover);
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  transition: transform 0.3s ease;
}

.header-settings-btn svg {
  transition: transform 0.3s ease;
}

.header-settings-btn:hover svg {
  transform: rotate(35deg);
}

.theme-toggle-btn:active svg {
  transform: rotate(20deg) scale(0.9);
}

.theme-toggle-btn .sun-icon {
  display: none;
}

.theme-toggle-btn .moon-icon {
  display: block;
}

body.theme-dark .theme-toggle-btn .sun-icon {
  display: block;
  stroke: #ffca28; /* Golden Sun color */
}

body.theme-dark .theme-toggle-btn .moon-icon {
  display: none;
}

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

body {
  font-family: var(--font-body);
  font-weight: 350;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  transition: var(--transition-smooth);
}

/* Background Mesh Gradients */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: var(--bg-gradient);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.mesh-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  mix-blend-mode: multiply;
  opacity: 0.55;
  transition: var(--transition-smooth);
  animation: float-glow 20s infinite alternate ease-in-out;
}


.glow-1 {
  top: -10%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 163, 255, 0.45) 0%, rgba(200, 220, 255, 0) 70%);
  animation-duration: 25s;
}

.glow-2 {
  bottom: -10%;
  left: -5%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(112, 0, 255, 0.25) 0%, rgba(200, 220, 255, 0) 70%);
  animation-duration: 30s;
  animation-delay: -5s;
}

.glow-3 {
  top: 30%;
  left: 25%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.3) 0%, rgba(200, 220, 255, 0) 70%);
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes float-glow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -40px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.9); }
}

/* Main Dashboard layout */
.dashboard-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  gap: 16px;
  position: relative;
  z-index: 1;
}

/* Left Mini Navigation Sidebar */
.sidebar-mini {
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  flex-shrink: 0;
  height: 100%;
}

.sidebar-logo {
  width: 64px;
  height: 64px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.sidebar-logo-light {
  display: block;
}

.sidebar-logo-dark {
  display: none;
}

body.theme-dark .sidebar-logo-light {
  display: none;
}

body.theme-dark .sidebar-logo-dark {
  display: block;
}

.sidebar-nav {
  flex-grow: 1;
  display: flex;
  align-items: center;
  margin-top: 30px;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-nav li {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  width: 100%;
  height: 100%;
  text-decoration: none;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.sidebar-nav li a svg {
  stroke: var(--text-muted);
}

/* Sidebar button hover */
.sidebar-nav li:not(.active):hover {
  background: rgba(255, 255, 255, 0.4);
}

.sidebar-nav li:not(.active):hover a svg {
  stroke: var(--text-main);
  transform: scale(1.05);
}



/* Sidebar Active Tab */
.sidebar-nav li.active {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(10, 78, 189, 0.08);
}


.sidebar-nav li.active a svg {
  stroke: var(--color-primary);
}


/* Main Workspace Styling */
.main-workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding-right: 2px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  margin-bottom: 16px;
}

.greeting-section {
  display: flex;
  flex-direction: column;
}

.greeting-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}


.spark {
  display: inline-block;
  animation: bounce 2s infinite ease-in-out;
}

.greeting-main {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 26px;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Weather & Search pills in header */
.weather-pill, .search-trigger-pill {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.01);
  transition: var(--transition-fast);
}

.weather-pill:hover, .search-trigger-pill:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.weather-icon {
  font-size: 14px;
}

.weather-info {
  color: var(--text-main);
}

.search-trigger-pill svg {
  stroke: var(--text-muted);
}

.search-trigger-pill span {
  color: var(--text-muted);
}

.search-trigger-pill:hover svg, .search-trigger-pill:hover span {
  color: var(--text-main);
}


/* Dual-Column Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  flex-grow: 1;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Chat Terminal widget */
.chat-terminal {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.chat-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  transition: var(--transition-smooth);
}


.bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-avatar-container {
  position: relative;
  width: 36px;
  height: 36px;
}

.bot-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  transition: var(--transition-fast);
}

.bot-avatar-orb {
  width: 44px;
  height: 44px;
  margin: -4px;
  flex-shrink: 0;
}

.bot-orb-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 6px rgba(58, 130, 247, 0.5));
}


.bot-pulse-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background-color: #00d27a;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 6px #00d27a;
  animation: pulse 1.8s infinite;
}


.bot-details h3 {
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.bot-details p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

/* Control buttons inside Chat Header */
.terminal-controls {
  display: flex;
  gap: 8px;
}

.terminal-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}


.terminal-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-main);
}

body.theme-dark .terminal-ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.38);
  color: #f6f6f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.theme-dark .terminal-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #00DBE9;
  color: #ffffff;
}

body.theme-dark .terminal-ctrl-btn.active {
  background: rgba(0, 219, 233, 0.16);
  border-color: #00DBE9;
  color: #00DBE9;
}


.terminal-ctrl-btn.active {
  background: #ffffff;
  color: var(--color-primary);
  border-color: #ffffff;
}

.voice-playback-stop-btn {
  color: #ffffff;
  background: #c43232;
  border-color: #c43232;
}

.voice-playback-stop-btn:hover {
  color: #ffffff;
  background: #a92727;
  border-color: #a92727;
}

.voice-playback-stop-btn[hidden] {
  display: none;
}


.terminal-ctrl-btn svg {
  stroke: currentColor;
}


/* Scrollable Chat Feed area */
.chat-feed-area {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Chat bubble structures */
.chat-bubble-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 82%;
  animation: bubble-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-bubble-container.bubble-user-container {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-container.bubble-bot-container {
  align-self: flex-start;
}

.bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.8);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.01);
}

.bubble-avatar-orb {
  border: none;
  background: none;
  box-shadow: none;
  width: 36px;
  height: 36px;
  margin: -3px;
}

.bubble-avatar-orb svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 5px rgba(58, 130, 247, 0.45));
}


.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.01);
}

.chat-bubble-container.bubble-user-container .chat-bubble {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 6px 20px rgba(10, 78, 189, 0.1);
}

.chat-bubble-container.bubble-bot-container .chat-bubble {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--text-main);
  border-top-left-radius: 4px;
}


.chat-bubble strong {
  font-weight: 700;
  color: inherit;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border-top-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
  margin-left: 40px; /* offset for avatar */
  animation: bubble-slide-in 0.3s ease;
}


.typing-dot {
  width: 5px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing-dot-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot-bounce {
  0%, 100%, 80% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

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


/* Chat Footer panel */
.chat-terminal-footer {
  padding: 14px 20px 18px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
}


/* Suggestion pills */
.suggestions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.suggestions-row::-webkit-scrollbar {
  display: none;
}

.suggest-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}


.suggest-chip svg {
  stroke: var(--text-muted);
  flex-shrink: 0;
}

.suggest-chip:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}


.suggest-chip:hover svg {
  stroke: var(--color-primary);
}


/* Chat Input row */
.chat-input-row {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 5px 6px;
  gap: 10px;
  transition: var(--transition-smooth);
}


.chat-input-row:focus-within {
  background: #ffffff;
  border-color: rgba(0, 163, 255, 0.4);
  box-shadow: 0 4px 15px rgba(0, 163, 255, 0.04);
}


.chat-input-row input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-main);
  padding: 6px 4px;
}

.chat-input-row input::placeholder {
  color: var(--text-muted);
}

/* Voice & Send buttons inside input */
.voice-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}


.voice-btn:hover {
  transform: scale(1.04);
  background: #ffffff;
  color: var(--text-main);
}


.voice-btn svg {
  stroke: currentColor;
}

.voice-btn-inner-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent) 0%, rgba(255,255,255,0) 70%);
  filter: blur(4px);
  opacity: 0;
  transition: var(--transition-smooth);
}

.chat-input-row.listening-active .voice-btn {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 0 10px rgba(0, 163, 255, 0.25);
}

.chat-input-row.listening-active .voice-btn-inner-glow {
  opacity: 0.65;
  animation: pulse-glow 1.5s infinite;
}

.send-btn {
  background: var(--color-primary);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition-fast);
}


.send-btn:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}


.send-btn svg {
  stroke: currentColor;
}

/* Audio waves visualizer inside footer */
.voice-wave-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 0px;
  opacity: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.voice-wave-container.active {
  height: 32px;
  opacity: 1;
}

.wave-bar {
  width: 4px;
  height: 12px;
  border-radius: 3px;
  transform-origin: center;
}

.wave-bar:nth-child(1) { background-color: #0071F6; }
.wave-bar:nth-child(2) { background-color: #F191A1; }
.wave-bar:nth-child(3) { background-color: #00DD95; }
.wave-bar:nth-child(4) { background-color: #FFE76B; }

.voice-wave-container.active .wave-bar {
  animation: wave-bar-pulse 1.2s infinite ease-in-out;
}

.voice-wave-container.active .wave-bar:nth-child(1) { animation-delay: 0s; height: 14px; }
.voice-wave-container.active .wave-bar:nth-child(2) { animation-delay: 0.16s; height: 26px; }
.voice-wave-container.active .wave-bar:nth-child(3) { animation-delay: 0.32s; height: 20px; }
.voice-wave-container.active .wave-bar:nth-child(4) { animation-delay: 0.48s; height: 16px; }

.voice-wave-container.speaking .wave-bar {
  animation: none;
  transform: scaleY(var(--audio-wave-scale, 0.42));
  transition: transform 70ms linear;
  will-change: transform;
}

.voice-wave-container.listening:not(.speaking) {
  gap: 9px;
}

.voice-wave-container.listening:not(.speaking) .wave-bar,
.voice-wave-container.listening:not(.speaking) .wave-bar:nth-child(n) {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  animation: listening-ball-pulse 950ms infinite ease-in-out;
}

.voice-wave-container.listening:not(.speaking) .wave-bar:nth-child(1) { animation-delay: 0ms; }
.voice-wave-container.listening:not(.speaking) .wave-bar:nth-child(2) { animation-delay: 110ms; }
.voice-wave-container.listening:not(.speaking) .wave-bar:nth-child(3) { animation-delay: 220ms; }
.voice-wave-container.listening:not(.speaking) .wave-bar:nth-child(4) { animation-delay: 330ms; }

@keyframes listening-ball-pulse {
  0%, 100% {
    opacity: 0.58;
    transform: translateY(0) scale(0.82);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px) scale(1.18);
  }
}

.voice-wave-container.thinking:not(.speaking) {
  position: relative;
  width: 42px;
  height: 42px;
  gap: 0;
  overflow: visible;
}

.voice-wave-container.thinking:not(.speaking) .wave-bar,
.voice-wave-container.thinking:not(.speaking) .wave-bar:nth-child(n) {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  transform-origin: 4px 4px;
  animation: thinking-ball-orbit 1.35s infinite linear;
}

.voice-wave-container.thinking:not(.speaking) .wave-bar:nth-child(1) { animation-delay: 0ms; }
.voice-wave-container.thinking:not(.speaking) .wave-bar:nth-child(2) { animation-delay: -337.5ms; }
.voice-wave-container.thinking:not(.speaking) .wave-bar:nth-child(3) { animation-delay: -675ms; }
.voice-wave-container.thinking:not(.speaking) .wave-bar:nth-child(4) { animation-delay: -1012.5ms; }

@keyframes thinking-ball-orbit {
  from { transform: rotate(0deg) translateX(15px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(15px) rotate(-360deg); }
}

@keyframes wave-bar-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(2.2); }
}


/* Right Column: Widgets Column Layout */
.widgets-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  overflow-y: auto;
}

/* Glass panel default card */
.widgets-column .card {
  transition: var(--transition-smooth);
}

.widgets-column .card:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
}

.widgets-column .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
}

.widgets-column .card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widgets-column .card-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}


.widgets-column .card-icon svg {
  stroke: currentColor;
}

.widgets-column h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.1px;
}

.widgets-column .card-body {
  padding: 8px 16px 14px;
}

/* Central Glowing Orb Widget */
.orb-widget {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 16px 0;
}

.orb-widget-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(112, 0, 255, 0.05) 50%, rgba(255,255,255,0) 70%);
  filter: blur(15px);
  z-index: 1;
  pointer-events: none;
}

/* Base Pedestal Ring in perspective */
.orb-pedestal-ring {
  width: 90px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 163, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 163, 255, 0.1),
              inset 0 0 8px rgba(0, 163, 255, 0.1);
  transform: rotateX(75deg);
  margin-top: -15px;
  position: relative;
  z-index: 2;
  animation: spin 15s linear infinite;
}

.sela-portal-orb {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  z-index: 3;
  cursor: pointer;
  animation: float-orb-widget 6s infinite ease-in-out;
  transform-style: preserve-3d;
}

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

.sela-portal-orb .layer-deep {
  background: radial-gradient(circle at 35% 35%, rgba(0, 229, 255, 0.35) 0%, rgba(10, 78, 189, 0.8) 50%, rgba(16, 42, 86, 0.95) 100%);
  box-shadow: inset -5px -5px 15px rgba(0,0,0,0.6),
              inset 8px 8px 15px rgba(255,255,255,0.25);
}

.sela-portal-orb .layer-middle {
  background: radial-gradient(circle at 65% 65%, rgba(0, 163, 255, 0.4) 0%, rgba(112, 0, 255, 0.25) 60%, rgba(0,0,0,0) 100%);
  mix-blend-mode: color-dodge;
  filter: blur(2px);
  animation: spin 8s linear infinite;
}

.sela-portal-orb .layer-outer {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.01) 50%, rgba(0, 163, 255, 0.05) 100%);
  box-shadow: 0 4px 15px rgba(0, 163, 255, 0.15),
              inset 0 0 10px rgba(255, 255, 255, 0.2);
  animation: spin-back 20s linear infinite;
}

.orb-hint-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

/* Today's Agenda card */
.add-agenda-btn {
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.7);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
}


.add-agenda-btn:hover {
  background: #ffffff;
  color: var(--color-primary);
}


.agenda-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: var(--transition-fast);
}


.agenda-item:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(2px);
}


.agenda-item.checked {
  opacity: 0.5;
}

.agenda-item.checked .agenda-text {
  text-decoration: line-through;
}

.agenda-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(10, 78, 189, 0.08);
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
}


.agenda-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}

.agenda-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.agenda-cat {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 3px;
  width: fit-content;
}

.cat-work { background: rgba(0,163,255,0.1); color: #008be0; }
.cat-design { background: rgba(112,0,255,0.1); color: #6905eb; }
.cat-client { background: rgba(255,90,0,0.1); color: #e65100; }
.cat-personal { background: rgba(0,210,122,0.1); color: #009959; }

.agenda-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 0 4px;
}

.more-events-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.more-events-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}


.more-events-btn:hover {
  transform: translateX(2px);
}

/* Daily Insight card */
.insight-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.indigo-glow {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(10, 78, 189, 0.08);
}


.sparkline-container {
  position: relative;
  width: 100%;
  height: 52px;
  cursor: pointer;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
}

.sparkline-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw-chart 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes draw-chart {
  to { stroke-dashoffset: 0; }
}

.sparkline-dot {
  animation: pulse-glow 2s infinite;
}

.chart-tooltip {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--text-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: var(--transition-fast);
}

.sparkline-container:hover .chart-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(-4px);
}


/* Time & Date Workspace Footer widget */
.workspace-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.footer-time-group {
  display: flex;
  gap: 8px;
}

.divider {
  opacity: 0.3;
}

.latency-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--color-accent);
}


/* Command Palette Modal styling */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background-color: rgba(8, 14, 25, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.search-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-content {
  width: 520px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(10, 78, 189, 0.12),
              inset 0 1px 0 rgba(255,255,255,0.6);
  overflow: hidden;
  transform: translateY(15px) scale(0.96);
  transition: var(--transition-smooth);
}


.search-modal.active .search-modal-content {
  transform: translateY(0) scale(1);
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  gap: 12px;
}


.search-modal-header input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-main);
}

.esc-kbd {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.6);
}


.search-modal-body {
  padding: 16px 20px;
}

.search-modal-body .section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.search-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-results li {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  gap: 12px;
}

.search-results li:hover {
  background: rgba(10, 78, 189, 0.05);
}


.search-results .icon {
  font-size: 16px;
}

.search-results .details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.search-results .action-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.search-results li:hover .action-name {
  color: var(--color-primary);
}


.search-results .action-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.search-results .kbd {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.6);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.03);
}



/* Agenda Modal styling */
.agenda-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background-color: rgba(8, 14, 25, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.agenda-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.agenda-modal-content {
  width: 360px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(10, 78, 189, 0.1),
              inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 20px;
  transform: translateY(15px) scale(0.96);
  transition: var(--transition-smooth);
}

.agenda-modal.active .agenda-modal-content {
  transform: translateY(0) scale(1);
}

.agenda-modal-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--color-primary);
  background: #ffffff;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancel {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.btn-cancel:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text-main);
}

.btn-submit {
  background: var(--color-primary);
  border: none;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 10px rgba(10, 78, 189, 0.15);
}

.btn-submit:hover {
  background: var(--color-accent);
}


/* Scrollbar custom styles */
.chat-feed-area::-webkit-scrollbar {
  width: 6px;
}

.chat-feed-area::-webkit-scrollbar-track {
  background: transparent;
}

.chat-feed-area::-webkit-scrollbar-thumb {
  background: rgba(10, 78, 189, 0.12);
  border-radius: 3px;
}


.chat-feed-area::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 78, 189, 0.25);
}


/* Animations definitions */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-back {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes float-glow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 210, 122, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 210, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 210, 122, 0); }
}

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


/* Interactive 3D Voice Core Card styling (Main Attraction) */
.bot-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  
  /* Neon cyan borders and shadow glow */
  border: 1px solid rgba(0, 229, 255, 0.3) !important;
  box-shadow: 0 10px 35px rgba(0, 229, 255, 0.15), inset 0 0 25px rgba(0, 229, 255, 0.05);
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: center;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 255, 0.6) !important;
  box-shadow: 0 15px 45px rgba(0, 229, 255, 0.25), inset 0 0 35px rgba(0, 229, 255, 0.1);
}

.bot-card-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.2) 0%, rgba(0, 163, 255, 0.06) 50%, rgba(255,255,255,0) 70%);
  filter: blur(20px);
  z-index: 1;
  pointer-events: none;
  transition: var(--transition-smooth);
}


#bobby-3d-viewport {
  width: 100%;
  height: 220px;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

#bobby-3d-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.bot-status-text {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 8px;
  z-index: 3;
  transition: var(--transition-fast);
}

.bot-card:hover .bot-status-text {
  color: var(--color-primary);
}



/* Multi-Page Views (SPA layout) */
.view-panel {
  display: none;
  width: 100%;
  flex-grow: 1;
  min-height: 0;
}

.view-panel.active-view {
  animation: viewFadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#view-home.active-view {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#view-chat.active-view {
  display: flex;
  flex-direction: column;
}

#view-chat .workspace-grid {
  grid-template-columns: 1fr;
  width: 100%;
  margin: 0 0 16px;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Home / Voice Core View styling */
.voice-core-hero-container {
  max-width: 580px;
  width: 100%;
  padding: 40px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(0, 229, 255, 0.2) !important;
  box-shadow: 0 15px 45px rgba(0, 229, 255, 0.12), inset 0 0 35px rgba(0, 229, 255, 0.05);
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center;
}

.voice-core-title {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 1.2px;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
}

body.theme-dark .voice-core-title {
  color: #ffffff;
}

.voice-core-subtitle {
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.voice-core-status-text {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
  transition: var(--transition-fast);
}

#view-home #bobby-3d-viewport {
  width: min(72vw, 430px);
  max-width: none;
  height: 340px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: -8px 0 -18px;
}

/* Home view canvas sizing */
#view-home #bobby-3d-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
}

.voice-core-trigger-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  width: 100%;
}

.voice-core-mic-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(0, 163, 255, 0.08) 100%);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.25);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

body:not(.theme-dark) .voice-core-mic-btn {
  background: linear-gradient(135deg, #00c8e8 0%, #008de8 100%);
  border-color: rgba(0, 126, 210, 0.36) !important;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 126, 210, 0.16) !important;
}

body:not(.theme-dark) .voice-core-mic-btn svg {
  stroke: #ffffff;
}

body:not(.theme-dark) .mic-glow-inner {
  border-color: rgba(0, 126, 210, 0.16);
}

.voice-core-mic-btn:hover {
  transform: scale(1.08);
  border-color: rgba(0, 229, 255, 0.7);
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.45);
}

body:not(.theme-dark) .voice-core-mic-btn:hover {
  border-color: rgba(0, 126, 210, 0.48) !important;
  box-shadow: 0 10px 22px rgba(0, 126, 210, 0.2) !important;
}

.voice-core-mic-btn.active {
  background: rgba(0, 229, 255, 0.85);
  box-shadow: 0 0 45px rgba(0, 229, 255, 0.65);
  border-color: #fff;
}

.voice-core-mic-btn.active svg {
  stroke: #0a0e17;
  transform: scale(1.1);
}

.mic-glow-inner {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.2);
  pointer-events: none;
  animation: pulseMic 2s infinite;
}

@keyframes pulseMic {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

.home-waves-container {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  height: 32px;
}

.home-waves-container.active {
  display: flex;
}

.home-wave-bar {
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  animation: homeWaveDance 0.8s infinite alternate ease-in-out;
}

.home-wave-bar:nth-child(1) { animation-delay: 0.1s; height: 12px; }
.home-wave-bar:nth-child(2) { animation-delay: 0.3s; height: 24px; }
.home-wave-bar:nth-child(3) { animation-delay: 0.5s; height: 18px; }
.home-wave-bar:nth-child(4) { animation-delay: 0.2s; height: 30px; }
.home-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 15px; }
.home-wave-bar:nth-child(6) { animation-delay: 0.6s; height: 26px; }
.home-wave-bar:nth-child(7) { animation-delay: 0.1s; height: 10px; }
.home-wave-bar:nth-child(8) { animation-delay: 0.3s; height: 22px; }
.home-wave-bar:nth-child(9) { animation-delay: 0.5s; height: 14px; }
.home-wave-bar:nth-child(10) { animation-delay: 0.2s; height: 8px; }

@keyframes homeWaveDance {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.4); }
}

.home-suggestions-row {
  margin-top: 36px;
  justify-content: center;
  flex-wrap: wrap;
  overflow: visible;
  width: 100%;
}

.home-suggestions-row .suggest-chip {
  padding: 8px 18px;
  font-size: 11px;
}

/* Cardless presentation */
.sidebar-mini,
.chat-terminal,
.voice-core-hero-container,
.theme-toggle-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar-mini {
  border-right: 1px solid rgba(16, 42, 86, 0.08);
  border-radius: 0;
}

body.theme-dark .sidebar-mini {
  border-right-color: rgba(255, 255, 255, 0.08);
}

.voice-core-hero-container {
  max-width: none;
  padding: 0;
  border-radius: 0;
  border: 0 !important;
  box-shadow: none !important;
  background-image: none;
  background: transparent !important;
}

.chat-terminal {
  border-radius: 0;
}

.chat-terminal-header,
.chat-terminal-footer {
  background: transparent;
  border-color: rgba(16, 42, 86, 0.08);
}

body.theme-dark .chat-terminal-header,
body.theme-dark .chat-terminal-footer {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

.chat-feed-area {
  padding: 20px 8px;
}

.chat-input-row {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(16, 42, 86, 0.12);
  box-shadow: none;
}

body.theme-dark .chat-input-row {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle-btn {
  border-color: rgba(16, 42, 86, 0.12);
}

.header-settings-btn {
  border-color: rgba(16, 42, 86, 0.12);
}

body.theme-dark .theme-toggle-btn,
body.theme-dark .header-settings-btn {
  border-color: rgba(255, 255, 255, 0.1);
}


/* Responsiveness (Tablet and Mobile breakpoints) */
@media (max-width: 992px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .widgets-column {
    overflow-y: visible;
  }
  .chat-terminal {
    height: 550px; /* fix height on medium wrapped layouts */
  }
}

@media (max-width: 640px) {
  .header-settings-btn {
    display: none;
  }

  .dashboard-container {
    padding: 8px;
    gap: 8px;
  }
  .sidebar-mini {
    display: none; /* hide left sidebar to prioritize viewport space */
  }
  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-end;
  }
  .chat-terminal {
    height: 480px;
  }
  .voice-core-hero-container {
    padding: 32px 20px;
  }
  .home-suggestions-row {
    gap: 10px;
  }
  .home-suggestions-row .suggest-chip {
    flex: 1 1 150px;
    justify-content: center;
  }
}

/* Sela product visual system: shared presentation layer, no workflow changes. */
:root {
  --sela-charcoal: #2D3034;
  --sela-white: #FFFFFF;
  --sela-muted: #F6F6F6;
  --sela-cyan: #00DBE9;
  --sela-blue: #0071F6;
  --sela-line-light: rgba(45, 48, 52, 0.14);
  --sela-line-dark: rgba(255, 255, 255, 0.14);
  --sela-text-muted: #677078;
  --sela-text-dark-muted: #B7BEC3;
  --sela-control-size: 36px;
  --sela-radius: 8px;

  --bg-primary: var(--sela-white);
  --bg-gradient: var(--sela-white);
  --glass-bg: var(--sela-white);
  --glass-bg-hover: var(--sela-muted);
  --glass-border: var(--sela-line-light);
  --glass-shadow: none;
  --color-primary: var(--sela-cyan);
  --color-accent: var(--sela-blue);
  --color-glow: var(--sela-cyan);
  --text-main: var(--sela-charcoal);
  --text-muted: var(--sela-text-muted);
  --radius-sm: var(--sela-radius);
  --radius-md: var(--sela-radius);
  --radius-lg: var(--sela-radius);
}

body.theme-dark {
  --bg-primary: var(--sela-charcoal);
  --bg-gradient: var(--sela-charcoal);
  --glass-bg: var(--sela-charcoal);
  --glass-bg-hover: #383C40;
  --glass-border: var(--sela-line-dark);
  --glass-shadow: none;
  --text-main: var(--sela-white);
  --text-muted: var(--sela-text-dark-muted);
  background-color: var(--sela-charcoal);
}

.dashboard-container {
  padding: 0;
  gap: 0;
}

.sidebar-mini {
  width: 144px;
  padding: 30px 0;
  border-right: 1px solid var(--sela-line-light);
  background: var(--bg-primary);
}

body.theme-dark .sidebar-mini {
  border-right-color: var(--sela-line-dark);
}

.sidebar-logo {
  width: 72px;
  height: 42px;
}

.sidebar-nav {
  margin-top: 44px;
}

.sidebar-nav ul {
  gap: 14px;
}

.sidebar-nav li,
.sidebar-nav li a {
  width: var(--sela-control-size);
  height: var(--sela-control-size);
}

.sidebar-nav li.active {
  background: var(--sela-muted);
  box-shadow: none;
}

body.theme-dark .sidebar-nav li.active {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav li.active a svg,
.sidebar-nav li:hover a svg {
  stroke: var(--sela-cyan);
}

.main-workspace {
  padding: 0 34px;
}

.workspace-header {
  min-height: 88px;
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--sela-line-light);
}

body.theme-dark .workspace-header {
  border-bottom-color: var(--sela-line-dark);
}

.theme-toggle-btn,
.header-settings-btn,
.terminal-ctrl-btn {
  width: var(--sela-control-size);
  height: var(--sela-control-size);
  border: 1px solid var(--sela-line-light);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--text-main);
}

body.theme-dark .theme-toggle-btn,
body.theme-dark .header-settings-btn,
body.theme-dark .terminal-ctrl-btn {
  border-color: var(--sela-line-dark);
  background: transparent;
  color: var(--sela-white);
  box-shadow: none;
}

.theme-toggle-btn:hover,
.header-settings-btn:hover,
.terminal-ctrl-btn:hover,
body.theme-dark .terminal-ctrl-btn:hover {
  border-color: var(--sela-cyan);
  background: rgba(0, 219, 233, 0.08);
  color: var(--text-main);
}

body.theme-dark .theme-toggle-btn:hover,
body.theme-dark .header-settings-btn:hover,
body.theme-dark .terminal-ctrl-btn:hover {
  color: var(--sela-white);
}

.terminal-ctrl-btn.active,
body.theme-dark .terminal-ctrl-btn.active {
  border-color: var(--sela-cyan);
  background: rgba(0, 219, 233, 0.12);
  color: var(--sela-cyan);
}

.unified-assistant {
  grid-template-columns: minmax(340px, 0.92fr) minmax(440px, 1.28fr);
  gap: 0;
}

.unified-assistant .chat-terminal {
  padding-left: clamp(28px, 3vw, 52px);
  border-left: 1px solid var(--sela-line-light);
  border-radius: 0;
  background: transparent;
}

body.theme-dark .unified-assistant .chat-terminal {
  border-left-color: var(--sela-line-dark);
}

.chat-terminal-header,
.chat-terminal-footer {
  border-color: var(--sela-line-light);
  background: transparent;
}

body.theme-dark .chat-terminal-header,
body.theme-dark .chat-terminal-footer {
  border-color: var(--sela-line-dark);
  background: transparent;
}

.chat-terminal-header {
  padding: 18px 0;
}

.chat-terminal-footer {
  padding: 18px 0;
}

.chat-feed-area,
.unified-assistant .chat-feed-area {
  padding: 24px 0;
}

.chat-bubble {
  border-radius: var(--sela-radius);
  box-shadow: none;
}

.chat-bubble-container.bubble-bot-container .chat-bubble,
body.theme-dark .chat-bubble-container.bubble-bot-container .chat-bubble {
  background: var(--sela-muted);
  border: 1px solid transparent;
  color: var(--sela-charcoal);
}

body.theme-dark .chat-bubble-container.bubble-bot-container .chat-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sela-white);
}

.chat-bubble-container.bubble-user-container .chat-bubble {
  background: var(--sela-cyan);
  color: var(--sela-charcoal);
  box-shadow: none;
}

.chat-input-row,
body.theme-dark .chat-input-row {
  min-height: 52px;
  border: 1px solid var(--sela-line-light);
  border-radius: var(--sela-radius);
  background: var(--sela-white);
  box-shadow: none;
}

body.theme-dark .chat-input-row {
  border-color: var(--sela-line-dark);
  background: transparent;
}

.chat-input-row:focus-within,
body.theme-dark .chat-input-row:focus-within {
  border-color: var(--sela-cyan);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(0, 219, 233, 0.12);
}

.send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sela-cyan);
  color: var(--sela-charcoal);
}

.send-btn:hover {
  background: var(--sela-blue);
  color: var(--sela-white);
}

.voice-btn,
body.theme-dark .voice-btn {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.chat-input-row.listening-active .voice-btn {
  background: rgba(0, 219, 233, 0.14);
  border-color: var(--sela-cyan);
  color: var(--sela-cyan);
  box-shadow: none;
}

.voice-core-subtitle,
.voice-core-status-text {
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.voice-core-status-text {
  color: var(--sela-cyan);
}

.workspace-footer {
  padding: 18px 0 24px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .dashboard-container {
    padding: 0;
  }

  .main-workspace {
    padding: 0 18px;
  }

  .workspace-header {
    min-height: 72px;
  }

  .unified-assistant .chat-terminal {
    padding-left: 0;
    border-left: 0;
  }
}

/* Functional assistant controls */
.chat-terminal {
  position: relative;
}

.message-content {
  min-width: 0;
  max-width: 100%;
}

.message-actions {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-bubble-container:hover .message-actions,
.chat-bubble-container:focus-within .message-actions {
  opacity: 1;
}

.message-action-btn,
.composer-icon-btn,
.stop-btn,
.attachment-remove-btn,
.dialog-close-btn,
.mobile-nav-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.message-action-btn:hover {
  color: var(--color-primary);
  background: rgba(0, 163, 255, 0.08);
}

.message-action-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.message-error .chat-bubble {
  border-color: rgba(210, 54, 54, 0.25) !important;
  color: #a82e2e !important;
}

body.theme-dark .message-error .chat-bubble {
  color: #ff9b9b !important;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.message-attachments span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  font-size: 10px;
}

.attachment-tray {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.attachment-tray.visible {
  display: flex;
}

.attachment-item {
  min-width: 150px;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border-left: 2px solid var(--color-accent);
  background: rgba(0, 163, 255, 0.06);
}

.attachment-details {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  text-align: left;
}

.attachment-details strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-details small {
  color: var(--text-muted);
  font-size: 9px;
}

.attachment-remove-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 24px;
  font-size: 18px;
}

.attachment-remove-btn:hover {
  color: #c43232;
  background: rgba(196, 50, 50, 0.08);
}

.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  visibility: hidden;
  opacity: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.92);
  border: 2px dashed var(--color-accent);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.theme-dark .drop-overlay {
  color: var(--color-glow);
  background: rgba(7, 13, 25, 0.94);
}

.drop-overlay.visible {
  visibility: visible;
  opacity: 1;
}

.drop-overlay span {
  font-size: 13px;
  font-weight: 600;
}

.composer-icon-btn,
.stop-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: 0 0 28px;
}

.composer-icon-btn:hover {
  color: var(--color-primary);
  background: rgba(0, 163, 255, 0.08);
}

.composer-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.stop-btn {
  color: #ffffff;
  background: #c43232;
}

.stop-btn[hidden],
.send-btn[hidden] {
  display: none;
}

.terminal-ctrl-btn.active {
  color: var(--color-primary);
  background: rgba(0, 163, 255, 0.1);
  border-color: rgba(0, 163, 255, 0.18);
}

.service-offline .active-dot {
  background: #d14343;
  box-shadow: 0 0 5px rgba(209, 67, 67, 0.5);
}

.mobile-nav {
  display: none;
}

.header-tools {
  margin-left: auto;
}

.settings-dialog {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid rgba(16, 42, 86, 0.12);
  border-radius: 8px;
  color: var(--text-main);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 42, 86, 0.18);
}

body.theme-dark .settings-dialog {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2f0fd;
  background: #0a1220;
}

.settings-dialog::backdrop {
  background: rgba(7, 13, 25, 0.46);
  backdrop-filter: blur(5px);
}

.settings-header,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(16, 42, 86, 0.1);
}

.settings-header h2 {
  font-size: 17px;
  letter-spacing: 0;
}

.dialog-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.dialog-close-btn:hover {
  background: rgba(0, 163, 255, 0.08);
  color: var(--color-primary);
}

.setting-row {
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(16, 42, 86, 0.07);
}

body.theme-dark .settings-header,
body.theme-dark .setting-row {
  border-color: rgba(255, 255, 255, 0.08);
}

.conversation-list {
  display: flex;
  max-height: min(420px, 58vh);
  overflow-y: auto;
  flex-direction: column;
  padding: 8px 0;
}

.conversation-list-row {
  display: flex;
  align-items: stretch;
}

.conversation-list-item {
  min-width: 0;
  flex: 1;
  min-height: 44px;
  overflow: hidden;
  padding: 11px 20px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--text-main);
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-list-item:hover {
  background: rgba(0, 163, 255, 0.06);
}

.conversation-list-item.active {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(0, 163, 255, 0.09);
}

.conversation-delete-btn {
  display: grid;
  width: 40px;
  flex: 0 0 40px;
  margin-right: 6px;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
  background: transparent;
}

.conversation-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.conversation-delete-btn:hover,
.conversation-delete-btn:focus-visible {
  color: #c43232;
  background: rgba(196, 50, 50, 0.08);
}

.setting-row span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.setting-row strong {
  font-size: 12px;
}

.setting-row small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.setting-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

.voice-setting-row {
  align-items: flex-start;
  flex-direction: column;
}

.language-setting-row {
  align-items: flex-start;
  flex-direction: column;
}

.language-setting-row select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(16, 42, 86, 0.14);
  border-radius: 6px;
  color: var(--text-main);
  background: #ffffff;
  font: 500 11px var(--font-body);
}

body.theme-dark .language-setting-row select {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2f0fd;
  background: #0d1626;
}

.setting-row .voice-picker {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 2px;
}

.voice-picker select {
  min-width: 0;
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(16, 42, 86, 0.14);
  border-radius: 6px;
  color: var(--text-main);
  background: #ffffff;
  font: 500 11px var(--font-body);
}

body.theme-dark .voice-picker select {
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2f0fd;
  background: #0d1626;
}

.voice-preview-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--color-primary);
  cursor: pointer;
}

.voice-preview-btn:hover {
  background: var(--color-accent);
}

.voice-preview-btn:disabled,
.voice-picker select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.settings-action {
  margin: 16px 20px 20px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: #b52f2f;
  background: transparent;
  font: 600 11px var(--font-body);
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 32px));
  padding: 9px 13px;
  border-radius: 6px;
  color: #ffffff;
  background: #102a56;
  box-shadow: 0 8px 24px rgba(16, 42, 86, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 640px) {
  .dashboard-container {
    height: 100dvh;
    padding: 8px 8px 70px;
  }

  .workspace-header {
    min-height: 40px;
    margin-bottom: 4px;
    padding: 2px 4px;
  }

  .workspace-footer {
    display: none;
  }

  #view-chat .workspace-grid {
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }

  .chat-terminal {
    height: 100%;
    min-height: 0;
  }

  .chat-terminal-header {
    padding: 10px 8px;
  }

  .chat-terminal-footer {
    padding: 10px 4px 6px;
  }

  .chat-feed-area {
    padding: 12px 2px;
  }

  .chat-bubble-container {
    max-width: 94%;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 58px;
    border-top: 1px solid rgba(16, 42, 86, 0.1);
    background: rgba(255, 255, 255, 0.96);
  }

  body.theme-dark .mobile-nav {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(7, 13, 25, 0.97);
  }

  .mobile-nav-btn {
    position: relative;
    color: var(--text-muted);
  }

  .mobile-nav-btn.active {
    color: var(--color-primary);
  }

  .mobile-nav-btn.active::after {
    position: absolute;
    bottom: 5px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    content: '';
  }

  .voice-core-hero-container {
    padding: 0 8px;
  }

  #view-home #bobby-3d-viewport {
    width: min(92vw, 390px);
    height: 290px;
  }

  .home-suggestions-row {
    margin-top: 22px;
  }

  .message-actions {
    opacity: 1;
  }

  .toast {
    bottom: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Unified hologram and conversation workspace */
#view-home.active-view {
  display: block;
  min-height: 0;
  overflow: hidden;
  text-align: left;
}

.unified-assistant {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(440px, 1.25fr);
  gap: clamp(20px, 3vw, 46px);
}

.voice-stage {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#view-home .voice-stage #bobby-3d-viewport {
  width: min(38vw, 430px);
  height: min(50vh, 360px);
  margin: -4px 0 -12px;
}

.unified-assistant .chat-terminal {
  height: 100%;
  min-height: 0;
  border-left: 1px solid rgba(16, 42, 86, 0.08);
}

body.theme-dark .unified-assistant .chat-terminal {
  border-left-color: rgba(255, 255, 255, 0.08);
}

.unified-assistant .chat-feed-area {
  min-height: 0;
  padding: 18px 20px;
}

.unified-assistant .chat-terminal-footer {
  display: flex;
}

#view-home.chat-only .unified-assistant {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
}

#view-home.chat-only .voice-stage {
  display: none;
}

#view-home.chat-only .chat-terminal {
  border-left: 0;
}

#view-home:not(.chat-only) .voice-btn {
  display: grid;
}

.sela-speaking .voice-core-status-text {
  color: var(--color-accent);
}

.sela-speaking #bobby-3d-viewport {
  filter: saturate(1.15) brightness(1.08);
}

#bobby-3d-viewport:focus-visible {
  outline: none;
}

#bobby-3d-viewport:focus-visible canvas {
  filter: drop-shadow(0 0 12px rgba(0, 163, 255, 0.45));
}

#bobby-3d-viewport[aria-pressed="true"] {
  filter: saturate(1.18) brightness(1.08);
}


@media (max-width: 900px) {
  .unified-assistant {
    grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
    gap: 16px;
  }

  #view-home .voice-stage #bobby-3d-viewport {
    width: min(40vw, 360px);
    height: 310px;
  }
}

@media (max-width: 640px) {
  .unified-assistant {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(235px, 40%) minmax(0, 60%);
    gap: 0;
  }

  #view-home.chat-only .unified-assistant {
    grid-template-rows: minmax(0, 1fr);
  }

  .voice-stage {
    justify-content: center;
    padding: 0;
  }

  .voice-core-subtitle {
    margin-bottom: 0;
  }

  #view-home .voice-stage #bobby-3d-viewport {
    width: min(88vw, 330px);
    height: min(31vh, 250px);
    margin: -12px 0 -24px;
  }

  .unified-assistant .chat-terminal {
    height: 100%;
    border-top: 1px solid rgba(16, 42, 86, 0.08);
    border-left: 0;
  }

  body.theme-dark .unified-assistant .chat-terminal {
    border-top-color: rgba(255, 255, 255, 0.08);
    border-left: 0;
  }

  .unified-assistant .chat-terminal-header {
    padding: 8px 6px;
  }

  .unified-assistant .chat-feed-area {
    padding: 10px 2px;
  }

  .mobile-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sela-style saved-chat rail using the existing conversation model. */
.main-workspace {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  grid-template-rows: 88px minmax(0, 1fr) auto;
}

.workspace-header {
  grid-column: 1 / -1;
  grid-row: 1;
}

.chat-history-panel {
  grid-column: 1;
  grid-row: 2 / 4;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px 20px;
  border-right: 1px solid var(--sela-line-light);
}

body.theme-dark .chat-history-panel {
  border-right-color: var(--sela-line-dark);
}

.chat-history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

.chat-history-new-btn {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--sela-line-light);
  border-radius: var(--sela-radius);
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

body.theme-dark .chat-history-new-btn {
  border-color: var(--sela-line-dark);
  color: var(--sela-white);
}

.chat-history-new-btn:hover {
  border-color: var(--sela-cyan);
  background: rgba(0, 219, 233, 0.08);
}

.chat-history-list {
  max-height: none;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.chat-history-list .conversation-list-item {
  min-height: 40px;
  padding: 10px 12px;
  border-left: 0;
  border-radius: var(--sela-radius);
}

.chat-history-list .conversation-list-item.active {
  border-left: 0;
  background: rgba(0, 219, 233, 0.12);
  color: var(--text-main);
}

body.theme-dark .chat-history-list .conversation-list-item.active {
  color: var(--sela-white);
}

.voice-core-status-text {
  display: none;
}

#conversations-btn,
#new-chat-btn,
#clear-chat-btn {
  display: none;
}

.workspace-footer {
  display: none;
}

body.is-loading {
  overflow: hidden;
}

.app-loader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--sela-charcoal, #2D3034);
  opacity: 1;
  transition: opacity 220ms ease;
}

.app-loader img {
  width: clamp(348px, 42vw, 516px);
  height: auto;
  display: block;
}

body:not(.theme-dark) .app-loader {
  background: #F6F6F6;
}

body:not(.theme-dark) .app-loader img {
  filter: drop-shadow(0 14px 28px rgba(0, 219, 233, 0.2));
}

.app-loader.is-exiting {
  opacity: 0;
  pointer-events: none;
}

#view-home.active-view {
  grid-column: 2;
  grid-row: 2;
}

.workspace-footer {
  grid-column: 2;
  grid-row: 3;
}

@media (max-width: 640px) {
  .main-workspace {
    display: flex;
  }

  .chat-history-panel {
    display: none;
  }
}

/* Unified header after sidebar removal. */
.workspace-header {
  justify-content: flex-start;
  gap: 20px;
}

.workspace-header > .sidebar-logo {
  width: 72px;
  height: 42px;
  flex: 0 0 auto;
}

.workspace-header {
  position: relative;
}

.workspace-header > .sidebar-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.workspace-header > .header-tools {
  margin-left: auto;
}

@media (max-width: 640px) {
  .workspace-header {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .workspace-header > .header-tools {
    width: auto;
    margin-left: auto;
  }
}

/* Header navigation placement. */
.workspace-header > .sidebar-nav {
  flex-grow: 0;
  margin: 0;
}

.workspace-header > .sidebar-nav ul {
  flex-direction: row;
  gap: 8px;
}

.workspace-header > .sidebar-nav li,
.workspace-header > .sidebar-nav li a {
  width: var(--sela-control-size);
  height: var(--sela-control-size);
}

@media (max-width: 640px) {
  .workspace-header > .sidebar-nav {
    display: none;
  }
}

/* Conversation polish: visual hierarchy without changing the chat workflow. */
.voice-stage {
  justify-content: center;
}

.voice-stage .voice-core-subtitle {
  margin-bottom: 4px;
  color: var(--sela-cyan);
  font-weight: 600;
}

#view-home #bobby-3d-viewport {
  filter: drop-shadow(0 18px 30px rgba(0, 219, 233, 0.16));
  transition: filter 280ms ease, transform 280ms ease;
}

#view-home #bobby-3d-viewport:hover,
#view-home #bobby-3d-viewport:focus-visible {
  filter: drop-shadow(0 22px 36px rgba(0, 219, 233, 0.28));
  transform: scale(1.015);
  outline: none;
}

.chat-feed-area {
  scroll-behavior: smooth;
}

.conversation-empty-state {
  align-self: stretch;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 5vw, 68px) 0;
  animation: conversation-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.conversation-empty-kicker {
  margin-bottom: 12px;
  color: var(--sela-cyan);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.conversation-empty-state h2 {
  max-width: 460px;
  margin: 0;
  color: var(--text-main);
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 450;
  line-height: 1.2;
}

.conversation-empty-state p {
  max-width: 430px;
  margin: 12px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.empty-state-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state-suggestions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--sela-line-light);
  border-radius: 7px;
  background: rgba(0, 219, 233, 0.06);
  color: var(--text-main);
  font: 400 12px/1 var(--font-body);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

body.theme-dark .empty-state-suggestions button {
  border-color: var(--sela-line-dark);
  background: rgba(0, 219, 233, 0.1);
  color: var(--sela-white);
}

.empty-state-suggestions button:hover,
.empty-state-suggestions button:focus-visible {
  border-color: var(--sela-cyan);
  background: rgba(0, 219, 233, 0.16);
  outline: none;
  transform: translateY(-2px);
}

.conversation-date-group + .conversation-date-group {
  margin-top: 22px;
}

.conversation-date-label {
  margin: 0 0 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-history-list .conversation-list-row {
  margin: 1px 0;
}

.chat-history-list .conversation-list-item {
  font-size: 12px;
  font-weight: 380;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.chat-history-list .conversation-list-item:hover {
  background: rgba(0, 219, 233, 0.08);
  color: var(--text-main);
  transform: translateX(2px);
}

body.theme-dark .chat-history-list .conversation-list-item:hover {
  color: var(--sela-white);
}

.chat-history-list .conversation-list-item.active {
  box-shadow: none;
}

.chat-bubble-container {
  margin-bottom: 22px;
  animation: conversation-enter 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-bubble-container .message-content {
  max-width: min(680px, 88%);
}

.chat-bubble-container .chat-bubble {
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
}

.message-meta {
  display: block;
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0;
}

.bubble-user-container .message-meta {
  margin-left: auto;
  text-align: right;
}

.bubble-user-container .chat-bubble {
  border-radius: 8px 8px 2px 8px;
}

.bubble-bot-container .chat-bubble {
  border-radius: 2px 8px 8px;
}

.message-attachments span {
  border-color: rgba(0, 219, 233, 0.46);
  background: rgba(0, 219, 233, 0.12);
  color: inherit;
}

.attachment-item {
  border-left-color: var(--sela-cyan);
  border-radius: 0 7px 7px 0;
  background: rgba(0, 219, 233, 0.1);
}

.chat-input-row {
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chat-input-row:focus-within {
  transform: translateY(-1px);
}

.composer-icon-btn:focus-visible,
.voice-btn:focus-visible,
.send-btn:focus-visible,
.chat-history-new-btn:focus-visible,
.conversation-list-item:focus-visible {
  outline: 2px solid var(--sela-cyan);
  outline-offset: 2px;
}

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

@media (max-width: 640px) {
  .conversation-empty-state {
    padding: 32px 0;
  }

  .conversation-empty-state h2 {
    font-size: 25px;
  }

  .chat-bubble-container .message-content {
    max-width: 92%;
  }
}

/* Collapsible conversation rail. */
.header-chat-rail-btn {
  width: var(--sela-control-size);
  height: var(--sela-control-size);
  border: 1px solid var(--sela-line-light);
  border-radius: 50%;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

body.theme-dark .header-chat-rail-btn {
  border-color: var(--sela-line-dark);
  color: var(--sela-white);
}

.header-chat-rail-btn:hover,
.header-chat-rail-btn:focus-visible {
  border-color: var(--sela-cyan);
  background: rgba(0, 219, 233, 0.1);
  color: var(--sela-cyan);
  outline: none;
}

.header-chat-rail-btn svg {
  transition: transform 220ms ease;
}

body.chats-collapsed .header-chat-rail-btn svg {
  transform: rotate(180deg);
}

body.chats-collapsed .main-workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.chats-collapsed .chat-history-panel {
  display: none;
}

body.chats-collapsed #view-home.active-view,
body.chats-collapsed .workspace-footer {
  grid-column: 1;
}

@media (max-width: 640px) {
  .header-chat-rail-btn {
    display: none;
  }
}

/* Keep the new-chat command anchored to the bottom of the conversation rail. */
.chat-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding: 12px 0 2px;
}

.chat-history-new-btn {
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--sela-cyan) 30%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--sela-cyan) 9%, transparent);
  color: var(--text-main);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

body.theme-dark .chat-history-new-btn {
  border-color: color-mix(in srgb, var(--sela-cyan) 36%, transparent);
  background: color-mix(in srgb, var(--sela-cyan) 12%, transparent);
  color: var(--sela-white);
}

.chat-history-new-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.chat-history-new-btn:hover,
.chat-history-new-btn:focus-visible {
  border-color: var(--sela-cyan);
  background: color-mix(in srgb, var(--sela-cyan) 16%, transparent);
  color: var(--sela-cyan);
  outline: none;
  transform: none;
}

.mode-icon-swapping svg {
  animation: mode-icon-swap 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mode-icon-swap {
  0% {
    opacity: 0;
    transform: scale(0.72) rotate(-16deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Animated brand mark in the first-chat state. */
.conversation-empty-state {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.8fr);
  column-gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

.empty-state-bobby {
  width: min(100%, 540px);
  justify-self: end;
}

.empty-state-bobby img {
  width: 100%;
  height: auto;
  display: block;
}

body.theme-dark .empty-state-bobby img {
  filter: drop-shadow(0 16px 28px rgba(0, 219, 233, 0.16));
}

body:not(.theme-dark) .empty-state-bobby img {
  filter: drop-shadow(0 12px 22px rgba(0, 219, 233, 0.1));
}

@media (max-width: 760px) {
  .conversation-empty-state {
    display: flex;
  }

  .empty-state-bobby {
    width: 300px;
    align-self: center;
    margin-top: 28px;
  }
}

/* Final layout reinforcement for the shared Sela product system. */
.unified-assistant {
  grid-template-columns: minmax(340px, 0.92fr) minmax(440px, 1.28fr);
  gap: 0;
}

.unified-assistant .chat-terminal {
  padding-left: clamp(28px, 3vw, 52px);
  border-left-color: var(--sela-line-light);
}

body.theme-dark .unified-assistant .chat-terminal {
  border-left-color: var(--sela-line-dark);
}

.unified-assistant .chat-feed-area {
  padding: 24px 0;
}

@media (max-width: 900px) {
  .unified-assistant {
    grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1.28fr);
    gap: 0;
  }
}

@media (max-width: 640px) {
  .unified-assistant {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .unified-assistant .chat-terminal {
    padding-left: 0;
    border-left: 0;
  }

  .unified-assistant .chat-feed-area {
    padding: 10px 2px;
  }
}
