/* =========================================================
   ZOZ ROUTER - NEURAL VOID CYBERPUNK STYLESHEET
   Accents: Neon Cyan (#00F0FF), Singularity Teal (#00FFC2),
   Neural Amber (#FF5200), Obsidian Surface (#08090D)
   ========================================================= */

/* Visual Stability: FOIT Prevention with font-display: swap */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: local('Plus Jakarta Sans'), local('PlusJakartaSans');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: local('Space Grotesk'), local('SpaceGrotesk');
}

@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: local('Fira Code'), local('FiraCode');
}

/* Font Awesome 6 font-display: swap policy (FOIT Prevention & Lighthouse Compliance) */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
  font-family: 'Font Awesome 6 Free';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-regular-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-brands-400.woff2') format('woff2');
}

:root {
  --bg-core: #07080c;
  --bg-surface: #0d0f17;
  --bg-card: #121622;
  --bg-card-hover: #191e2e;
  --bg-glass: rgba(13, 15, 23, 0.85);
  
  --border-subtle: #1e2438;
  --border-glow: rgba(0, 240, 255, 0.35);
  --border-teal: rgba(0, 255, 194, 0.35);
  
  --neon-cyan: #00F0FF;
  --neon-teal: #00FFC2;
  --neon-amber: #FF5200;
  --neon-magenta: #FF007F;
  --neon-purple: #a855f7;
  
  --text-main: #F0F4FC;
  --text-muted: #8E99B0;
  --text-secondary: #8E99B0;
  --text-dim: #5C657A;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-reading: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'Fira Code', monospace;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-display: 'Space Grotesk', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-glow-cyan: 0 0 20px rgba(0, 240, 255, 0.25);
  --shadow-glow-teal: 0 0 20px rgba(0, 255, 194, 0.25);
  --sidebar-width: 18rem;
}

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

/* High-Visibility Cyberpunk Text Selection Highlight */
::selection {
  background: rgba(0, 240, 255, 0.4) !important;
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6) !important;
}

::-moz-selection {
  background: rgba(0, 240, 255, 0.4) !important;
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6) !important;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Layout Container */
.app-container {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 100vw;
  height: calc(100% - 44px);
  height: calc(100dvh - 44px);
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.04) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(0, 255, 194, 0.03) 0%, transparent 50%),
              var(--bg-core);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktop Collapsed Sidebar State */
.app-container.sidebar-collapsed .sidebar,
.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

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

.brand-logo-wrap,
button.brand-logo-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

button.brand-logo-wrap:hover {
  transform: scale(1.08);
}

button.brand-logo-wrap:hover .brand-logo {
  filter: drop-shadow(0 0 10px var(--neon-cyan)) drop-shadow(0 0 16px rgba(0, 240, 255, 0.4));
}

button.brand-logo-wrap:hover .pulse-ring {
  opacity: 0.7;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

button.brand-logo-wrap:active {
  transform: scale(0.94);
}

button.brand-logo-wrap.active .pulse-ring {
  border-color: var(--neon-teal);
  box-shadow: 0 0 12px var(--neon-teal), inset 0 0 8px var(--neon-cyan);
  opacity: 0.85;
  animation: pulseTeal 1.5s infinite alternate;
}

button.brand-logo-wrap.active .brand-logo {
  filter: drop-shadow(0 0 8px var(--neon-cyan)) drop-shadow(0 0 14px var(--neon-teal));
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

.pulse-ring {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--neon-cyan);
  border-radius: 12px;
  opacity: 0.3;
  animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.2; }
  100% { transform: scale(1.08); opacity: 0.6; }
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.brand-text h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin: 0;
  white-space: nowrap;
  background: linear-gradient(135deg, #FFF 20%, var(--neon-cyan) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


.version-tag {
  font-size: 0.65rem;
  font-family: var(--font-code);
  color: var(--neon-teal);
  letter-spacing: 0.5px;
}

/* Sidebar Actions */
.sidebar-actions {
  padding: 14px 16px;
}

.new-chat-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 255, 194, 0.15));
  border: 1px solid var(--border-glow);
  color: #FFF;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.new-chat-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.28), rgba(0, 255, 194, 0.28));
  border-color: var(--neon-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-1px);
}

.terminal-top-btn {
  width: 100%;
  background: #080a11;
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: #FFF;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-top-btn:hover {
  background: #0c101d;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

/* ==================== ENDOCRINE CHAT v2 CYBERNETIC CONTROLLER ==================== */
.endocrine-chat-v2-card {
  position: relative;
  width: 100%;
  margin: 6px 0 8px 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, #070d19 0%, #03060d 100%);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.endocrine-chat-v2-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 242, 254, 0.6) 50%, transparent 100%);
  opacity: 0.5;
  transition: opacity 0.3s;
}

.endocrine-chat-v2-card.is-on {
  border-color: rgba(0, 242, 254, 0.65);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.22), inset 0 0 14px rgba(0, 242, 254, 0.08);
}

.endocrine-chat-v2-card.is-on::before {
  opacity: 1;
}

.endocrine-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.endocrine-v2-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.endocrine-v2-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00f2fe;
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
  line-height: 1.2;
}

.endocrine-v2-status-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2.5px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-status-line {
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.endocrine-v2-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.endocrine-v2-info-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: rgba(0, 242, 254, 0.5);
  color: #00f2fe;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.35);
}

.endocrine-v2-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 9999px;
  border: 1px solid rgba(0, 242, 254, 0.15);
  transition: border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-switch-row {
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 242, 254, 0.15);
}

.endocrine-v2-lbl {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  transition: all 0.25s;
  user-select: none;
}

.endocrine-v2-lbl.lbl-off {
  color: #94a3b8;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}

.endocrine-chat-v2-card.is-on .endocrine-v2-lbl.lbl-off {
  color: #334155;
  text-shadow: none;
}

.endocrine-v2-lbl.lbl-on {
  color: #334155;
  text-shadow: none;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-lbl.lbl-on {
  color: #00f2fe;
  text-shadow: 0 0 10px #00f2fe, 0 0 20px rgba(0, 242, 254, 0.7);
}

.endocrine-v2-toggle-btn {
  position: relative;
  width: 76px;
  height: 28px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}

.endocrine-v2-track {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(180deg, #050a14 0%, #0c1626 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 242, 254, 0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-track {
  border-color: #00f2fe;
  box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.35), 0 0 14px rgba(0, 242, 254, 0.45);
}

.endocrine-v2-thumb {
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 32px;
  height: 22px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(71, 85, 105, 0.5) 100%);
  border: 1.5px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-thumb {
  transform: translateX(37px);
  border-color: #00f2fe;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 242, 254, 0.4) 45%, rgba(4, 190, 254, 0.85) 100%);
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.95), inset 0 0 8px rgba(255, 255, 255, 0.85);
}

.endocrine-v2-thumb-ring {
  position: absolute;
  right: 3px;
  top: 2px;
  bottom: 2px;
  width: 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.endocrine-chat-v2-card.is-on .endocrine-v2-thumb-ring {
  border-color: #00f2fe;
  box-shadow: 0 0 8px #00f2fe, inset 0 0 4px #00f2fe;
}

.endocrine-v2-thumb-glare {
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  height: 40%;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* Engine Status Panel (Zero Overlap, Clean Sleek Cards) */
.engine-status-panel {
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 4px var(--text-dim);
  transition: all 0.3s ease;
}

.status-indicator.online {
  background: var(--neon-teal);
  box-shadow: 0 0 8px var(--neon-teal);
}

.status-indicator.error {
  background: var(--neon-amber);
  box-shadow: 0 0 8px var(--neon-amber);
}

.status-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.status-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.status-val {
  font-size: 0.75rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.status-refresh-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  transition: color 0.2s, transform 0.3s;
}

.status-refresh-btn:hover {
  color: var(--neon-cyan);
  transform: rotate(180deg);
}

/* Search History Box */
.search-history-box {
  margin: 0 16px 10px;
  position: relative;
}

.search-history-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
}

.search-history-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 7px 10px 7px 32px;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-history-box input:focus {
  border-color: var(--neon-cyan);
}

/* History List */
.history-section {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
}

.history-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 6px 4px;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
  position: relative;
  group: 1;
}

.history-item:hover {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.history-item.active {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
}

.history-item.is-pinned {
  border-left: 2px solid var(--neon-cyan);
  background: rgba(0, 240, 255, 0.04);
}

.history-item.is-pinned:hover {
  background: rgba(0, 240, 255, 0.08);
}

.history-pin-icon {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  transform: rotate(45deg);
  margin-right: 2px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.5));
}

.history-item.active .history-title {
  color: var(--neon-cyan);
  font-weight: 600;
}

.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  flex-grow: 1;
}

.history-title-wrap i {
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.history-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: relative;
}

.history-item:hover .history-item-actions,
.history-item.active .history-item-actions,
.history-item.menu-open .history-item-actions {
  opacity: 1;
}

/* A11y: kontrol yang biasanya muncul saat hover tetap terlihat ketika diTab
   (tanpa ini fokus jatuh ke tombol opacity:0 yang tak terlihat). */
.history-item:focus-within .history-item-actions {
  opacity: 1;
}

@media (max-width: 768px) {
  .history-item-actions {
    opacity: 0.85;
  }
}

.history-item-btn,
.history-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.history-menu-btn:hover,
.history-item-btn:hover {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
}

/* History 3-Dots Dropdown Menu */
.history-dropdown-menu {
  position: fixed;
  min-width: 160px;
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 2px;
  animation: dropIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-dropdown-item i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

.history-dropdown-item:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
}

.history-dropdown-item.delete-item:hover {
  background: rgba(255, 0, 85, 0.15);
  color: var(--neon-pink, #ff0055);
}

/* Inline Rename Input */
.history-rename-input {
  background: var(--bg-core);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 3px 6px;
  width: 100%;
  outline: none;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.sidebar-footer-btn:hover {
  color: var(--text-main);
  border-color: var(--neon-cyan);
  background: var(--bg-card-hover);
}

.sidebar-footer-btn i {
  transition: transform 0.3s ease;
}

.sidebar-footer-btn:hover i.fa-gear {
  transform: rotate(45deg);
}

/* ==================== DEEPSEEK-STYLE HISTORY MULTI-SELECT & TIME GROUPING ==================== */
.history-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 4px;
}

.history-label-row .history-label {
  padding: 0;
}

.history-select-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.history-select-toggle-btn:hover {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.25);
}

/* Multi-Select Top Bar */
.history-select-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 4px 12px 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.select-count-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 0.2px;
}

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

.select-text-action-btn {
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--neon-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-text-action-btn:hover {
  background: rgba(0, 240, 255, 0.2);
}

.select-close-circle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-close-circle-btn:hover {
  background: rgba(255, 0, 85, 0.25);
  color: #FF0055;
}

/* Time Group Title (DeepSeek Style: Pinned, Hari Ini, Kemarin, 7 Hari Terakhir, etc.) */
.history-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 10px 8px 3px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  user-select: none;
}

/* Selection Circle Indicator */
.history-select-circle {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
  color: var(--text-dim);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.history-select-circle.selected {
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.6));
}

.history-item.in-select-mode {
  user-select: none;
}

.history-item.in-select-mode:hover {
  background: rgba(0, 240, 255, 0.05);
}

.history-item.in-select-mode .history-item-actions {
  display: none !important;
}

.history-item.is-selected {
  background: rgba(0, 240, 255, 0.09) !important;
  border-color: rgba(0, 240, 255, 0.35) !important;
}

/* Multi-Select Bottom Action Bar */
.history-select-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  gap: 10px;
  animation: slideUp 0.2s ease;
}

.select-bottom-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
}

.select-bottom-btn.select-pin-btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.select-bottom-btn.select-delete-btn {
  color: #FF4D4D;
  border-color: rgba(255, 77, 77, 0.3);
  background: rgba(255, 77, 77, 0.06);
}

.select-bottom-btn.select-delete-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: #FF4D4D;
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.35);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Top Nav Bar */
#topNav.top-nav,
.top-nav {
  height: 44px;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 400;
  flex-shrink: 0;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-sidebar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-auto-router-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-teal);
  box-shadow: 0 0 8px var(--neon-teal), 0 0 12px var(--neon-cyan);
  animation: pulseTeal 1.6s infinite alternate;
  pointer-events: none;
}

.toggle-sidebar-btn:hover {
  background: var(--bg-card);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}

.mode-tabs {
  display: flex;
  background: transparent;
  padding: 0;
  border-radius: var(--radius-md);
  border: none;
  gap: 4px;
  align-items: center;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-tab:hover {
  color: var(--text-main);
}

.mode-tab.active {
  background: var(--bg-card);
  color: #FFF;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.auto-router-quantum-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: none;
  transition: all 0.25s ease;
  pointer-events: none;
}

/* Logo Sakura ZOZ ROUTER (sidebar): lingkaran penuh tanpa sudut gelap, glow merah muda */
button.brand-logo-wrap.sakura-brand-logo-btn {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  overflow: visible;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.35);
}

button.brand-logo-wrap.sakura-brand-logo-btn .sakura-brand-logo-img {
  display: block;
  border-radius: 9999px;
  filter: drop-shadow(0 0 4px rgba(251, 113, 133, 0.45));
}

button.brand-logo-wrap.sakura-brand-logo-btn:hover {
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.55);
}

button.brand-logo-wrap.sakura-brand-logo-btn.active {
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.55), 0 0 18px var(--neon-teal);
}

button.brand-logo-wrap.active .auto-router-quantum-dot {
  background: var(--neon-teal);
  border-color: #ffffff;
  box-shadow: 0 0 8px var(--neon-teal), 0 0 14px var(--neon-cyan);
  animation: pulseTeal 1.4s infinite alternate;
}

/* Top Nav Right */
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Model Picker Combo Pill (Unified Glass Capsule) */
.model-picker-container {
  position: relative;
}

.model-picker-combo-btn-group {
  display: inline-flex;
  align-items: stretch;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.model-picker-combo-btn-group:hover,
.model-picker-combo-btn-group:focus-within {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(20, 29, 48, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.model-picker-combo-btn-group .model-picker-chip {
  background: transparent !important;
  border: none !important;
  border-radius: 999px 0 0 999px !important;
  box-shadow: none !important;
  padding: 5px 8px 5px 11px;
}

.model-picker-combo-btn-group .model-picker-chip:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
}

.model-picker-divider {
  width: 1px;
  height: 14px;
  align-self: center;
  background: rgba(255, 255, 255, 0.11);
  flex-shrink: 0;
}

.model-kebab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  padding: 0 8px 0 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  border-radius: 0 999px 999px 0;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.model-kebab-btn:hover {
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.model-kebab-btn[aria-expanded="true"] {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.14) !important;
}

.model-chip-status-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 1px;
}

.chip-status-icon-bolt {
  color: #fbbf24;
  font-size: 9.5px;
  opacity: 0.92;
}

.chip-status-icon-pin {
  color: #2dd4bf;
  font-size: 9.5px;
  opacity: 0.92;
}

/* Model Options Popup Menu (Modern Linear / Raycast Popover) */
.model-options-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 312px;
  max-width: calc(100vw - 24px);
  max-height: min(76vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(16, 21, 34, 0.98) 0%, rgba(11, 15, 25, 0.99) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow:
    0 22px 50px -12px rgba(0, 0, 0, 0.88),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 1050;
  padding: 10px;
  transform-origin: top right;
  animation: fadeInDown 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 480px) {
  .model-options-popup {
    position: fixed;
    top: 52px;
    right: 12px;
    left: auto;
    width: min(312px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100dvh - 68px);
  }
}

.model-options-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 6px;
}

.model-options-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(45, 212, 191, 0.25);
  color: #2dd4bf;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.model-options-header-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.model-options-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: #f8fafc;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-options-subrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.model-options-engine-badge {
  font-size: 0.6rem;
  padding: 1.5px 6px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan, #38bdf8);
  border: 1px solid rgba(0, 240, 255, 0.26);
}

.model-options-status-text {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-options-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-options-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, transform 0.12s ease;
  user-select: none;
}

.model-options-action-item:hover {
  background: rgba(255, 255, 255, 0.055);
}

.model-options-action-item:active {
  transform: scale(0.99);
}

.model-options-action-item.active-pin,
.model-options-action-item.active-autostart {
  background: rgba(255, 255, 255, 0.035);
  border-color: transparent;
}

.model-options-action-item.active-pin:hover,
.model-options-action-item.active-autostart:hover {
  background: rgba(255, 255, 255, 0.065);
}

.action-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.action-item-icon.pin-icon-box {
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
}

.model-options-action-item.active-pin .action-item-icon.pin-icon-box {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.14);
}

.action-item-icon.rocket-icon-box {
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
}

.model-options-action-item.active-autostart .action-item-icon.rocket-icon-box {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
}

.action-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.action-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.action-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.25;
}

.action-item-desc {
  font-size: 0.67rem;
  color: #7c8ba1;
  margin-top: 2px;
  line-height: 1.3;
}

.action-item-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.action-item-badge.pinned-badge,
.action-item-badge.autostart-badge {
  display: none !important;
}

/* Modern Toggle Switch inside Model Options */
.model-opt-switch {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.model-opt-switch-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #94a3b8;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.model-options-action-item.active-pin .model-opt-switch {
  background: rgba(45, 212, 191, 0.28);
  border-color: rgba(45, 212, 191, 0.65);
}

.model-options-action-item.active-pin .model-opt-switch-thumb {
  transform: translateX(14px);
  background: #2dd4bf;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.5);
}

.model-options-action-item.active-autostart .model-opt-switch {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.65);
}

.model-options-action-item.active-autostart .model-opt-switch-thumb {
  transform: translateX(14px);
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.model-options-footer {
  margin-top: 6px;
  padding: 8px 10px 3px;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-options-footer-text {
  font-size: 0.69rem;
  color: #7c8ba1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-options-footer-text strong {
  color: #cbd5e1;
  font-family: var(--font-code);
  font-weight: 600;
}

/* Badges for dropdown rows */
.model-pinned-tag {
  color: #2dd4bf;
  font-size: 0.72rem;
  margin-left: 4px;
}

.model-autostart-tag {
  color: #fbbf24;
  font-size: 0.72rem;
  margin-left: 4px;
}

.model-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 6px;
  flex-shrink: 0;
}

.model-item-action-btn {
  background: transparent;
  border: none;
  color: #64748b;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.model-item-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.model-item-action-btn.active-pin {
  color: #2dd4bf;
}

.model-item-action-btn.active-autostart {
  color: #fbbf24;
}

.model-picker-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.model-picker-chip:hover {
  border-color: var(--neon-cyan);
  background: var(--bg-card-hover);
}

.chip-icon {
  color: var(--neon-teal);
  font-size: 0.85rem;
}

.current-model-name {
  font-family: var(--font-code);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-arrow {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.2s;
}

/* Model Dropdown Menu */
.model-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 440px;
  max-width: calc(100vw - 20px);
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  z-index: 700;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.model-dropdown-menu.show {
  display: flex;
  animation: dropIn 0.2s ease;
}

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

.dropdown-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.dropdown-header input {
  width: 100%;
  background: var(--bg-core);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 10px;
  font-size: 0.8rem;
  outline: none;
}

.dropdown-header input:focus {
  border-color: var(--neon-cyan);
}

.dropdown-model-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-option-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.model-option-item:hover {
  background: var(--bg-card);
  color: var(--neon-cyan);
}

.model-option-item.selected {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  font-weight: 600;
}

.model-option-item.is-fav {
  border-left: 2px solid var(--neon-amber);
  background: rgba(255, 183, 3, 0.04);
}

.model-option-item.is-fav:hover {
  background: rgba(255, 183, 3, 0.1);
}

/* Model item inner text helpers for intact wrapping */
.model-item-text-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-right: 6px;
}

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

.model-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--text-main);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.model-item-id {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-code);
  line-height: 1.3;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  margin-top: 2px;
}

/* ==================== MODEL FAVORITE (LAPTOP ICON) STYLES ==================== */
.model-fav-btn,
.catalog-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  user-select: none;
}

.model-fav-btn:hover,
.catalog-fav-btn:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.45);
  transform: scale(1.12);
}

.model-fav-btn.active,
.catalog-fav-btn.active {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.25), rgba(0, 240, 255, 0.18));
  border-color: var(--neon-amber);
  color: var(--neon-amber);
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.6), inset 0 0 6px rgba(0, 240, 255, 0.2);
  transform: scale(1.05);
}

.model-fav-btn.active:hover,
.catalog-fav-btn.active:hover {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.4), rgba(0, 240, 255, 0.3));
  box-shadow: 0 0 16px rgba(255, 183, 3, 0.85);
  transform: scale(1.18);
}

.model-fav-tag {
  color: var(--neon-amber);
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 4px rgba(255, 183, 3, 0.7));
  animation: favGlow 2s infinite ease-in-out;
}

.catalog-fav-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 183, 3, 0.15);
  border: 1px solid rgba(255, 183, 3, 0.5);
  color: var(--neon-amber);
  margin-left: 6px;
  box-shadow: 0 0 8px rgba(255, 183, 3, 0.4);
}

.catalog-model-row.is-fav {
  border-left: 3px solid var(--neon-amber);
  background: rgba(255, 183, 3, 0.03);
}

@keyframes favGlow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.dropdown-custom-add {
  padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.dropdown-custom-add input {
  flex-grow: 1;
  background: var(--bg-core);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 5px 8px;
  font-size: 0.75rem;
  outline: none;
}

/* Icon Buttons */
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  background: var(--bg-card-hover);
}

/* ==================== CHAT VIEWPORT ==================== */
.chat-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

/* Floating Scroll-to-Bottom Button (Cyberpunk Glassmorphic Floating HUD) */
.scroll-bottom-btn {
  position: absolute;
  bottom: 120px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(12, 17, 30, 1) 0%, rgba(18, 25, 46, 1) 100%);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--neon-cyan);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75),
              0 0 16px rgba(0, 240, 255, 0.3),
              inset 0 1px 2px rgba(255, 255, 255, 0.35),
              inset 0 -1px 3px rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.88);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s,
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  font-size: 1rem;
  user-select: none;
}

.scroll-bottom-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.scroll-bottom-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22) 0%, rgba(20, 32, 60, 0.98) 100%);
  border-color: #00f0ff;
  color: #ffffff;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8),
              0 0 28px rgba(0, 240, 255, 0.65),
              inset 0 1px 3px rgba(255, 255, 255, 0.6),
              inset 0 0 14px rgba(0, 240, 255, 0.3);
}

.scroll-bottom-btn:hover .scroll-bottom-icon {
  color: #ffffff;
  text-shadow: 0 0 12px #00f0ff, 0 0 24px #00f0ff;
  animation: none;
  transform: translateY(2px);
}

.scroll-bottom-btn:active {
  transform: translateY(0) scale(0.94);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.45);
}

.scroll-bottom-icon {
  display: inline-block;
  color: var(--neon-cyan);
  font-size: 1.05rem;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.75);
  transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
  animation: subtleScrollBounce 2s ease-in-out infinite;
}

@keyframes subtleScrollBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2.5px);
  }
}

.scroll-btn-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.45);
  pointer-events: none;
  animation: scrollPulseRing 2.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  opacity: 0;
}

@keyframes scrollPulseRing {
  0% {
    transform: scale(0.92);
    opacity: 0.85;
    border-color: rgba(0, 240, 255, 0.65);
  }
  50% {
    opacity: 0.25;
  }
  100% {
    transform: scale(1.38);
    opacity: 0;
    border-color: rgba(0, 240, 255, 0);
  }
}

@media (max-width: 768px) {
  .scroll-bottom-btn {
    bottom: 110px;
    right: 18px;
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
  .scroll-bottom-icon {
    font-size: 0.95rem;
  }
}

/* One-Click Continue Response Button (For Nemotron / Truncated AI Answers) */
.continue-response-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.15);
}

.continue-response-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.continue-response-btn i {
  font-size: 0.85rem;
}

.chat-messages-container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1120px) {
  #mainContent:not(.wa-chat-themed):not(.is-wa-chat-mode) .chat-messages-container {
    padding-right: 52px;
  }
}

@media (max-width: 640px) {
  #mainContent:not(.wa-chat-themed):not(.is-wa-chat-mode) .chat-messages-container {
    padding-right: 40px;
  }
}

@media (min-width: 769px) and (max-width: 1280px) {
  .app-container:not(.sidebar-collapsed) #mainContent:not(.wa-chat-themed):not(.is-wa-chat-mode) .chat-messages-container {
    padding-left: 54px;
  }
}

/* ==================== WELCOME HERO (Clean Minimalist Cyberpunk Hub) ==================== */
.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 24px 30px 24px;
  margin: auto 0;
  position: relative;
}

.welcome-greeting-wrap {
  position: relative;
  z-index: 10;
  margin-bottom: 6px;
}

.welcome-greeting-text {
  font-family: var(--font-mono, monospace);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.welcome-greeting-text .greeting-welcome {
  color: #34d399;
  text-shadow: 0 0 16px rgba(52, 211, 153, 0.55);
}

.welcome-greeting-text .greeting-to {
  color: #f8fafc;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  background: linear-gradient(135deg, #FFF 30%, var(--neon-cyan) 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--neon-teal);
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.hero-desc {
  max-width: 620px;
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ==================== PULL-UP TO TRIGGER NEW CHAT (Modern ChatGPT Style with Pull & Hold) ==================== */
.pull-up-new-chat-wrapper {
  position: sticky;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pull-up-new-chat-wrapper.visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stage 1: Minimalist Pure Circular Loading Spinner (ChatGPT Style) */
.pull-up-loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.2), 0 0 10px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.pull-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-right-color: var(--neon-teal);
  border-radius: 50%;
  animation: pullSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pullSpin {
  to { transform: rotate(360deg); }
}

/* Stage 2: Action Button after Holding / Threshold Reached */
.pull-up-new-chat-btn {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  background: rgba(10, 15, 29, 0.92);
  border: 1px solid var(--neon-cyan);
  border-radius: 9999px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  box-shadow: 0 4px 22px rgba(0, 240, 255, 0.3), 0 0 12px rgba(0, 240, 255, 0.18);
  transition: all 0.22s ease;
  user-select: none;
  animation: popInBtn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popInBtn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.pull-up-new-chat-wrapper.revealed .pull-up-loading-indicator {
  display: none;
}

.pull-up-new-chat-wrapper.revealed .pull-up-new-chat-btn {
  display: inline-flex;
}

.pull-up-new-chat-btn i.fa-plus {
  color: var(--neon-cyan);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.pull-up-new-chat-btn .btn-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(0, 240, 255, 0.14);
  color: var(--neon-teal);
  font-family: var(--font-code);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pull-up-new-chat-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-teal);
  box-shadow: 0 6px 28px rgba(0, 240, 255, 0.45);
  transform: translateY(-2px);
}

.pull-up-new-chat-btn:hover i.fa-plus {
  transform: rotate(90deg);
}

.pull-up-new-chat-btn:active {
  transform: translateY(1px);
}

/* Messages List */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-row {
  display: flex;
  gap: 14px;
  width: 100%;
  animation: msgFadeIn 0.3s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

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

.message-row.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-self: flex-end;
  margin-left: auto;
  width: 100%;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.message-row.user .message-avatar {
  background: linear-gradient(135deg, #00F0FF, #00FFC2);
  color: #08090D;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.message-row.user.is-incognito .message-avatar,
.message-row.user .message-avatar.incognito-avatar {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #c084fc 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.48), inset 0 0 0 1px rgba(233, 213, 255, 0.42);
}

.message-row.assistant .message-avatar {
  background: linear-gradient(135deg, #00F0FF, #00FFC2);
  color: #08090D;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.message-row.assistant .message-avatar.memory-used {
  background: linear-gradient(135deg, #00F0FF 0%, #38BDF8 50%, #00FFC2 100%);
  color: #061018;
  font-size: 1.05rem;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.message-content-box {
  max-width: min(92%, 860px);
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-row.user .message-content-box {
  max-width: 74%;
  flex: 0 1 auto;
  align-items: flex-end;
  margin-left: auto;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.message-row.user .message-meta {
  justify-content: flex-end;
  color: rgba(0, 240, 255, 0.88);
}

.message-row.user.is-incognito .message-meta {
  color: rgba(216, 180, 254, 0.94);
}

body.light-theme .message-row.user.is-incognito .message-meta {
  color: #7c3aed;
}

body.zoz-incognito-active #mainContent:not(.wa-chat-themed) .composer-box:not(.studio-composer-box) {
  border-color: rgba(168, 85, 247, 0.34);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(168, 85, 247, 0.28), 0 0 18px rgba(168, 85, 247, 0.12);
}

body.zoz-incognito-active #mainContent:not(.wa-chat-themed) .composer-box:not(.studio-composer-box):focus-within {
  border-color: rgba(192, 132, 252, 0.58);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(192, 132, 252, 0.48), 0 0 22px rgba(168, 85, 247, 0.2);
}

.meta-model-badge {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-code);
  font-size: 0.78rem;
}

/* Universal Text Copyability & Selectability Guarantee */
.chat-messages-container,
.messages-list,
.message-row,
.message-content-box,
.message-bubble,
.msg-text-content,
.msg-text-content *,
.message-bubble *,
.markdown-body,
.markdown-body *,
.message-bubble p,
.message-bubble span:not(.code-lang):not(.copy-text):not(.preview-text):not(.edit-text):not(.katex-mathml),
.message-bubble div:not(.message-actions-bar):not(.message-meta):not(.message-avatar):not(.code-header):not(.mermaid-header):not(.mermaid-toolbar),
.message-bubble li,
.message-bubble table,
.message-bubble th,
.message-bubble td,
.message-bubble blockquote,
.message-bubble pre,
.message-bubble code,
.doc-preview-content,
.terminal-screen,
.preview-pane {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* UI Action Buttons, Code Headers, & Hidden MathML remain strictly non-selectable on Mobile & Desktop */
.message-avatar,
.message-meta,
.message-actions-bar,
.message-actions-bar *,
.msg-action-btn,
.code-header,
.code-header *,
.code-copy-btn,
.code-preview-btn,
.code-edit-btn,
.code-lang,
.mermaid-header,
.mermaid-header *,
.mermaid-toolbar,
.mermaid-toolbar *,
.katex-mathml,
.katex-mathml *,
.ai-file-card-actions,
.ai-file-card-actions *,
.history-select-circle,
.sidebar-header {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

.message-bubble {
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  font-family: var(--font-reading);
  font-size: 1.15rem;
  line-height: 1.72;
  letter-spacing: 0.004em;
  overflow-wrap: break-word;
  word-break: normal;
  text-rendering: optimizeLegibility;
  position: relative;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.message-row.user .message-bubble {
  background: rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  color: #F8FAFC;
  border-radius: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  text-align: left;
  font-family: var(--font-reading);
  font-size: 1.08rem;
  line-height: 1.62;
  padding: 12px 18px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.message-row.user .message-bubble:hover {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.message-row.user .message-actions-bar {
  justify-content: flex-end;
  width: 100%;
}

.message-row.assistant .message-bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  color: #F1F5F9;
  padding: 4px 2px 6px 0;
  min-width: 0;
  max-width: 100%;
}

.msg-text-content {
  min-width: 0;
  max-width: 100%;
  font-size: inherit;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.message-bubble img.attached-vision-img {
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* Markdown typography inside assistant bubble (Comfortable Reading Hierarchy) */
.message-bubble p {
  font-size: 1em;
  margin-bottom: 16px;
  line-height: 1.72;
  text-wrap: pretty;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  font-family: var(--font-reading);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.35;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.message-bubble h1 {
  font-size: 1.48em;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.message-bubble h2 {
  font-size: 1.3em;
  margin: 22px 0 10px;
}
.message-bubble h3 {
  font-size: 1.16em;
  margin: 18px 0 8px;
  color: #E2E8F0;
}
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
  font-size: 1.04em;
  margin: 14px 0 6px;
  color: #CBD5E1;
}
.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child,
.message-bubble h4:first-child {
  margin-top: 2px;
}

/* ==================== CODE BLOCKS & COPY BUTTONS ==================== */
.message-bubble pre {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 14px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: #0f121a;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-code);
  font-size: 0.84rem;
  color: var(--text-muted);
  user-select: none;
}

.code-header .code-lang-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--neon-teal);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.code-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-preview-btn,
.code-edit-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  color: var(--neon-cyan);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-family: var(--font-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.code-edit-btn {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.32);
  color: var(--neon-teal);
}

.code-preview-btn:hover,
.code-edit-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.code-copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-family: var(--font-main);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.code-copy-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.code-copy-btn.copied {
  background: rgba(0, 255, 194, 0.15);
  border-color: var(--neon-teal);
  color: var(--neon-teal);
}

.message-bubble pre code {
  display: block;
  padding: 14px 16px;
  font-family: var(--font-code);
  font-size: 1.04rem;
  overflow-x: auto;
  line-height: 1.62;
  color: #E6EDF8;
}

.message-bubble :not(pre) > code {
  background: rgba(0, 240, 255, 0.12);
  color: #64f3ff;
  border: 1px solid rgba(0, 240, 255, 0.28);
  font-family: var(--font-code);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
}

.message-bubble a {
  color: #00FFC2;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.message-bubble a:hover {
  color: #64f3ff;
}

.message-bubble strong, .message-bubble b {
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: 0;
}

.message-bubble blockquote {
  border-left: 3px solid #00F0FF;
  background: rgba(0, 240, 255, 0.06);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #DCE4F2;
  margin: 16px 0;
  font-size: 0.98em;
  line-height: 1.7;
  text-wrap: pretty;
}

.message-bubble hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 20px 0;
}

.message-bubble ul, .message-bubble ol {
  padding-left: 26px;
  margin: 10px 0 16px;
}

.message-bubble ul {
  list-style-type: disc;
}

.message-bubble ol {
  list-style-type: decimal;
}

.message-bubble ul ul {
  list-style-type: circle;
  margin: 6px 0;
}

.message-bubble ul ul ul {
  list-style-type: square;
}

.message-bubble li {
  display: list-item;
  margin-bottom: 9px;
  color: #E8EEF7;
  line-height: 1.7;
}

.message-bubble li > p {
  margin-bottom: 6px;
}

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.94em;
  line-height: 1.58;
}

.message-bubble table th, .message-bubble table td {
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  text-align: left;
}

.message-bubble table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.message-bubble table th {
  background: var(--bg-card);
  color: #00FFC2;
  font-weight: 600;
}

/* High-Contrast Code Syntax Highlight Overrides for Mobile & Dark OLED */
.hljs {
  background: transparent !important;
  color: #E6EDF8 !important;
}
.hljs-keyword, .hljs-selector-tag, .hljs-subst {
  color: #FF7B72 !important;
  font-weight: 600;
}
.hljs-string, .hljs-title, .hljs-section, .hljs-attribute, .hljs-literal, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-addition {
  color: #7EE787 !important;
}
.hljs-comment, .hljs-quote, .hljs-deletion, .hljs-meta {
  color: #9AA4B5 !important;
  font-style: italic;
}
.hljs-number, .hljs-regexp, .hljs-link {
  color: #79C0FF !important;
}
.hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name, .hljs-selector-id, .hljs-selector-class {
  color: #FFA657 !important;
}
.hljs-symbol, .hljs-bullet, .hljs-built_in, .hljs-builtin-name, .hljs-attr {
  color: #56D364 !important;
}
.hljs-params {
  color: #F0F6FC !important;
}

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--neon-cyan);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Message Actions Bar */
.message-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.msg-action-btn:hover {
  color: var(--neon-cyan);
  background: var(--bg-card);
}

.msg-action-btn.regen-msg-btn:hover i {
  transform: rotate(90deg);
}

.msg-action-btn.regen-msg-btn i {
  transition: transform 0.25s ease;
}

.message-row.assistant:not(.is-last-assistant) .regen-msg-btn,
.message-row.assistant .regen-msg-btn[hidden] {
  display: none !important;
}

.msg-action-btn.read-report-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
  font-weight: 600;
  padding: 3px 8px;
}

.msg-action-btn.read-report-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  color: #FFF;
}

/* ==================== READ ALOUD (BACAKAN / EDGE TTS) ==================== */
.msg-action-btn.read-aloud-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.msg-action-btn.read-aloud-btn[data-tts-state="loading"] {
  color: var(--neon-amber, #f59e0b);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.msg-action-btn.read-aloud-btn[data-tts-state="playing"] {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
  font-weight: 600;
}

.msg-action-btn.read-aloud-btn[data-tts-state="playing"]:hover {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.tts-wave-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  margin-left: 2px;
}

.tts-wave-bars span {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  animation: zozTtsWave 0.9s ease-in-out infinite;
}

.tts-wave-bars span:nth-child(2) {
  animation-delay: 0.18s;
}

.tts-wave-bars span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes zozTtsWave {
  0%, 100% { height: 3px; opacity: 0.6; }
  50% { height: 11px; opacity: 1; }
}

.msg-action-btn.tts-voice-quick-btn {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  background: rgba(0, 240, 255, 0.06);
  color: var(--neon-cyan);
}

.msg-action-btn.tts-voice-quick-btn:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-cyan);
}

.msg-action-btn.tts-voice-quick-btn[hidden] {
  display: none !important;
}

.tts-settings-card {
  margin-top: 12px;
}

.tts-settings-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .tts-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== COMPOSER (INPUT) ==================== */
.composer-container {
  flex-shrink: 0;
  padding: 10px 20px 14px;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 8, 12, 0.34) 100%);
  position: relative;
  z-index: 60;
}

/* DeepSeek Style Attachment Bar inside Composer */
.attachment-preview-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 4px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  order: 0;
}

.deepseek-img-cards-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.preview-card {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.preview-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.5);
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 13px;
}

.remove-attachment-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 5;
}


.remove-attachment-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

.deepseek-doc-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 6px;
}

/* Prompt Box Collapsed State */

.composer-container.composer-collapsed .composer-box {
  max-height: 0;
  opacity: 0;
  /* visibility (bukan hanya opacity) mengeluarkan textarea/tombol dari tab order —
     dulu pengguna bisa mengetik & mengirim pesan tak terlihat saat composer "collapse". */
  visibility: hidden;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-color: transparent;
  overflow: hidden;
}

.composer-container.composer-collapsed .attachment-preview-bar,
.composer-container.composer-collapsed .composer-footnote {
  display: none !important;
}

.composer-container.composer-collapsed {
  padding-top: 4px;
  padding-bottom: 12px;
}

/* Composer Box (Floating Translucent Borderless Glass Dock) */
.composer-box {
  position: relative;
  max-width: 920px;
  width: 100% !important;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.055) !important;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: none !important;
  border-radius: 24px !important;
  padding: 11px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

/* Inner input flow: wrap into full-width textarea on top, toolbar on bottom */
.composer-box > .flex {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  width: 100% !important;
  row-gap: 8px !important;
}

/* Prompt typing area: Sits directly under photo & pills, spanning 100% width */
.composer-box .input-field-wrap {
  order: 1 !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  min-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
}

.composer-box #promptInput {
  width: 100% !important;
  min-height: 44px !important;
  max-height: 200px !important;
  font-size: 14.5px !important;
  line-height: 1.45 !important;
  color: #f8fafc !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 4px 6px !important;
  resize: none !important;
}

.composer-box #promptInput::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-size: 14px !important;
}

/* Bottom Toolbar: Tools on Left, Send Button on Right */
.composer-box .composer-tools-left {
  order: 2 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.composer-box .composer-tools-right {
  order: 3 !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* ==================== SLASH COMMANDS & QUICK TOOLS AUTOCOMPLETE MENU ==================== */
.slash-commands-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(11, 15, 23, 0.96);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  contain: paint;
  z-index: 1050;
  overflow: hidden;
  animation: slashMenuFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.slash-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.slash-menu-title {
  font-family: var(--font-main, inherit);
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.slash-menu-list {
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}

.slash-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

@media (hover: hover) {
  .slash-menu-item:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.25);
  }
}

.slash-menu-item:active {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.35);
}

.slash-menu-item.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
}

.slash-menu-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slash-menu-item-info {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.slash-menu-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slash-menu-item-name {
  font-family: var(--font-code);
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.slash-menu-item-badge {
  display: none !important;
}

.slash-menu-item-desc {
  display: none !important;
}

.composer-box:not(.studio-composer-box):hover {
  background: rgba(255, 255, 255, 0.075) !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.composer-box:not(.studio-composer-box):focus-within {
  background: rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

.composer-box.drag-file-over,
#mainContent .composer-box.drag-file-over {
  border: 1.5px solid #2dd4bf !important;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.45), 0 12px 36px rgba(45, 212, 191, 0.28) !important;
  background: rgba(15, 28, 36, 0.92) !important;
}

.global-file-drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px dashed rgba(45, 212, 191, 0.72);
  border-radius: 20px;
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(45, 212, 191, 0.14);
  animation: fadeIn 0.14s ease-out;
}

.global-drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 34px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(45, 212, 191, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 28px rgba(45, 212, 191, 0.18);
  max-width: 90%;
}

.global-drop-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #2dd4bf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.global-drop-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.global-drop-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}

body #mainContent .composer-box.image-mode-active {
  border: 1.5px solid #FF007F !important;
  box-shadow: 0 8px 30px rgba(255, 0, 127, 0.24), inset 0 0 12px rgba(255, 0, 127, 0.1) !important;
  animation: cyberImagePulse 3s infinite ease-in-out;
}

body #mainContent .composer-box.image-mode-active:focus-within {
  border: 1.5px solid #FF2E93 !important;
  box-shadow: 0 8px 36px rgba(255, 0, 127, 0.34), inset 0 0 16px rgba(255, 0, 127, 0.14) !important;
}

@keyframes cyberImagePulse {
  0%, 100% {
    opacity: 0.94;
    border-color: rgba(255, 0, 127, 0.7);
  }
  50% {
    opacity: 1;
    border-color: #FF007F;
  }
}

body #mainContent .composer-box.image-mode-active .send-btn:not(.is-mic-mode):not(.is-listening) {
  background: linear-gradient(135deg, #FF007F, #9D4EDD) !important;
  color: #ffffff !important;
  border-color: rgba(255, 0, 127, 0.5) !important;
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.4) !important;
}

body #mainContent .composer-box.image-mode-active .send-btn:not(.is-mic-mode):not(.is-listening):hover {
  background: linear-gradient(135deg, #FF2E93, #B5179E) !important;
  box-shadow: 0 0 22px rgba(255, 0, 127, 0.65) !important;
}

body #mainContent .composer-box.music-mode-active {
  border: 1.5px solid #00FFC2 !important;
  box-shadow: 0 8px 30px rgba(0, 255, 194, 0.24), inset 0 0 12px rgba(0, 255, 194, 0.1) !important;
  animation: cyberMusicPulse 3s infinite ease-in-out;
}

body #mainContent .composer-box.music-mode-active:focus-within {
  border: 1.5px solid #00F0FF !important;
  box-shadow: 0 8px 36px rgba(0, 240, 255, 0.34), inset 0 0 16px rgba(0, 240, 255, 0.14) !important;
}

@keyframes cyberMusicPulse {
  0%, 100% {
    opacity: 0.94;
    border-color: rgba(0, 255, 194, 0.7);
  }
  50% {
    opacity: 1;
    border-color: #00FFC2;
  }
}

body #mainContent .composer-box.music-mode-active .send-btn:not(.is-mic-mode):not(.is-listening) {
  background: linear-gradient(135deg, #00FFC2, #00B4D8) !important;
  color: #080B10 !important;
  border-color: rgba(0, 255, 194, 0.6) !important;
  box-shadow: 0 0 16px rgba(0, 255, 194, 0.45) !important;
}

body #mainContent .composer-box.music-mode-active .send-btn:not(.is-mic-mode):not(.is-listening):hover {
  background: linear-gradient(135deg, #00F0FF, #00E5FF) !important;
  box-shadow: 0 0 22px rgba(0, 255, 194, 0.7) !important;
}

.composer-tools-left, .composer-tools-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.composer-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

/* AI Music Mode Indicator */
.composer-tools-left .music-mode-indicator {
  display: none;
  width: 28px;
  height: 28px;
  margin: 4px 6px;
  border-radius: 4px;
  background: rgba(0,255,194,0.1);
  color: #00FFC2;
  border: 1px solid rgba(0,255,194,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.composer-tools-left .music-mode-indicator:hover {
  background: rgba(0,255,194,0.2);
  color: #00F0FF;
}
.composer-tools-left .music-mode-indicator:hover i {
  /* icon will be changed via JS */
}

/* AI Image Mode Indicator (cara kerja sama dengan music-mode-indicator) */
.composer-tools-left .image-mode-indicator {
  width: 28px;
  height: 28px;
  margin: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 0, 127, 0.1);
  color: #FF007F;
  border: 1px solid rgba(255, 0, 127, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.composer-tools-left .image-mode-indicator:hover {
  background: rgba(255, 0, 127, 0.2);
  color: #FF2E93;
}


/* Status aktif untuk item menu lampiran (mis. Cari Video YouTube) */
.attachment-menu-item.active {
  background: rgba(255, 255, 255, 0.06);
}
.attach-yt-check {
  display: none;
  color: #FF0033;
  font-size: 0.85rem;
  margin-left: auto;
}
.attachment-menu-item.active .attach-yt-check {
  display: block;
}

.composer-btn:hover {
  color: var(--neon-cyan);
  background: var(--bg-card);
}

.composer-btn.web-search-toggle.active {
  color: #08090D;
  background: linear-gradient(135deg, var(--neon-cyan), #00b4d8);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  font-weight: bold;
}

/* ==================== AI IMAGE STUDIO MODEL SELECTOR DROPDOWN ==================== */
.image-model-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.composer-btn.image-gen-toggle {
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-btn.image-gen-toggle:hover {
  color: #FF007F;
  background: rgba(255, 0, 127, 0.12);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.35);
}

.composer-btn.image-gen-toggle.active {
  color: #ffffff;
  background: linear-gradient(135deg, #FF007F, #9D4EDD);
  border-color: #FF007F;
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.6);
  animation: cyberWandPulse 2s infinite alternate;
}

.image-model-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(135deg, #FF007F, #9D4EDD);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.7);
  pointer-events: none;
  animation: badgePop 0.25s ease;
  white-space: nowrap;
}

.composer-btn.music-gen-toggle {
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-btn.music-gen-toggle:hover {
  color: #00FFC2;
  background: rgba(0, 255, 194, 0.12);
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.35);
}

.composer-btn.music-gen-toggle.active {
  color: #050811;
  background: linear-gradient(135deg, #00FFC2, #00F0FF);
  border-color: #00FFC2;
  box-shadow: 0 0 16px rgba(0, 255, 194, 0.6);
}

.music-model-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: linear-gradient(135deg, #00FFC2, #00F0FF);
  color: #050811;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.7);
  pointer-events: none;
  animation: badgePop 0.25s ease;
  white-space: nowrap;
}

.image-model-dropdown-popup {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  width: 320px;
  max-width: calc(100vw - 20px);
  max-height: min(480px, calc(86vh - 60px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(13, 16, 26, 0.98);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  border: 1px solid rgba(255, 0, 127, 0.45);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 0, 127, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  animation: dropIn 0.2s ease forwards;
  transform-origin: top left;
}

.image-model-dropdown-popup::-webkit-scrollbar {
  width: 5px;
}
.image-model-dropdown-popup::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 127, 0.4);
  border-radius: 3px;
}
.image-model-dropdown-popup::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.image-model-dropdown-header {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FF007F;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.image-model-header-tag {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  text-transform: none;
}

/* Tab Navigation */
.image-model-tabs-nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.image-model-tab-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.image-model-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.image-model-tab-btn.active {
  background: rgba(255, 0, 127, 0.18);
  border-color: rgba(255, 0, 127, 0.45);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.35);
}

.image-model-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* OpenRouter Tab Specifics */
.image-model-status-bar {
  font-size: 0.68rem;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-model-status-bar.connected {
  background: rgba(0, 255, 194, 0.1);
  border-color: rgba(0, 255, 194, 0.3);
  color: var(--neon-teal);
}

.image-model-status-bar.warning {
  background: rgba(255, 170, 0, 0.12);
  border-color: rgba(255, 170, 0, 0.35);
  color: var(--neon-amber);
}

.image-model-status-bar .status-action-btn {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.image-model-status-bar .status-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-model-search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.image-model-search-box .search-box-icon {
  position: absolute;
  left: 9px;
  font-size: 0.72rem;
  color: var(--text-dim);
  pointer-events: none;
}

.image-model-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 0, 127, 0.28);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 28px;
  font-size: 0.74rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.image-model-search-input:focus {
  border-color: #FF007F;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3);
  background: rgba(0, 0, 0, 0.75);
}

.image-model-custom-row {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.image-model-custom-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.72rem;
  color: #fff;
  outline: none;
  font-family: monospace;
  transition: all 0.2s ease;
}

.image-model-custom-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.image-model-custom-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), #00b4d8);
  color: #08090D;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.image-model-custom-btn:hover {
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.image-model-openrouter-list {
  max-height: 250px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.image-model-openrouter-list::-webkit-scrollbar {
  width: 4px;
}
.image-model-openrouter-list::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.4);
  border-radius: 2px;
}

.image-model-section-divider {
  padding: 6px 10px 2px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 3px;
}

.image-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
}

.image-model-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.image-model-item.active {
  background: rgba(255, 0, 127, 0.12);
  border-color: rgba(255, 0, 127, 0.45);
}

.image-model-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.image-model-icon-box.off-accent {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.image-model-icon-box.flux-accent {
  background: rgba(255, 0, 127, 0.16);
  color: #FF007F;
  border: 1px solid rgba(255, 0, 127, 0.38);
}

.image-model-icon-box.realism-accent {
  background: rgba(0, 240, 255, 0.16);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.38);
}

.image-model-icon-box.anime-accent {
  background: rgba(255, 75, 175, 0.18);
  color: #FF4BAF;
  border: 1px solid rgba(255, 75, 175, 0.4);
}

.image-model-icon-box.cgi-accent {
  background: rgba(255, 170, 0, 0.16);
  color: var(--neon-amber);
  border: 1px solid rgba(255, 170, 0, 0.38);
}

.image-model-icon-box.turbo-accent {
  background: rgba(255, 220, 0, 0.16);
  color: #FFDC00;
  border: 1px solid rgba(255, 220, 0, 0.38);
}

.image-model-icon-box.pro-accent {
  background: rgba(157, 78, 221, 0.18);
  color: #9D4EDD;
  border: 1px solid rgba(157, 78, 221, 0.42);
}

.image-model-icon-box.mj-accent {
  background: rgba(0, 180, 216, 0.18);
  color: #00B4D8;
  border: 1px solid rgba(0, 180, 216, 0.4);
}

.image-model-icon-box.cloud-accent {
  background: rgba(66, 133, 244, 0.16);
  color: #4285F4;
  border: 1px solid rgba(66, 133, 244, 0.38);
}

.image-model-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
}

.image-model-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.image-model-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-model-tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.image-model-item.active .image-model-tag {
  background: rgba(255, 0, 127, 0.2);
  color: #FF007F;
  border: 1px solid rgba(255, 0, 127, 0.35);
}

.image-model-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-model-check {
  font-size: 0.82rem;
  color: #FF007F;
  margin-left: auto;
  flex-shrink: 0;
}

@keyframes cyberWandPulse {
  from {
    transform: scale(0.98);
    opacity: 0.85;
  }
  to {
    transform: scale(1.05);
    opacity: 1;
  }
}

/* ==================== AI MUSIC STUDIO MODEL SELECTOR ==================== */
.music-model-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.music-model-dropdown-popup {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  width: 320px;
  max-width: calc(100vw - 20px);
  max-height: min(480px, calc(86vh - 60px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(10, 16, 24, 0.98);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  border: 1px solid rgba(0, 255, 194, 0.45);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 194, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  animation: dropIn 0.2s ease forwards;
  transform-origin: top left;
}

.music-model-dropdown-popup::-webkit-scrollbar {
  width: 5px;
}
.music-model-dropdown-popup::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 194, 0.4);
  border-radius: 3px;
}
.music-model-dropdown-popup::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.music-model-dropdown-header {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-teal);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.music-model-header-tag {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  text-transform: none;
}

.music-model-tabs-nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.music-model-tab-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.music-model-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.music-model-tab-btn.active {
  background: rgba(0, 255, 194, 0.18);
  border-color: rgba(0, 255, 194, 0.45);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.35);
}

.music-model-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.music-model-status-bar {
  font-size: 0.68rem;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.music-model-status-bar.connected {
  border-color: rgba(0, 255, 194, 0.3);
  background: rgba(0, 255, 194, 0.06);
  color: var(--neon-teal);
}

.music-model-status-bar.warning {
  border-color: rgba(255, 184, 0, 0.3);
  background: rgba(255, 184, 0, 0.06);
  color: var(--neon-amber);
}

.music-model-search-box {
  position: relative;
  margin-bottom: 5px;
}

.music-model-search-box .search-box-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
}

.music-model-search-input {
  width: 100%;
  padding: 5px 8px 5px 26px;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 194, 0.25);
  border-radius: 4px;
  color: #fff;
  box-sizing: border-box;
}

.music-model-search-input:focus {
  outline: none;
  border-color: var(--neon-teal);
  box-shadow: 0 0 8px rgba(0, 255, 194, 0.3);
}

.music-model-custom-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.music-model-custom-input {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
}

.music-model-custom-input:focus {
  outline: none;
  border-color: var(--neon-teal);
  box-shadow: 0 0 6px rgba(0, 255, 194, 0.25);
}

.music-model-custom-btn {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 255, 194, 0.15);
  border: 1px solid rgba(0, 255, 194, 0.35);
  color: var(--neon-teal);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.music-model-custom-btn:hover {
  background: var(--neon-teal);
  color: #080B10;
}

.music-model-filter-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 1px 0 5px;
  margin-bottom: 5px;
  scrollbar-width: none;
}

.music-model-filter-pills::-webkit-scrollbar {
  display: none;
}

.music-filter-pill {
  font-size: 0.64rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.music-filter-pill:hover {
  background: rgba(0, 255, 194, 0.12);
  border-color: rgba(0, 255, 194, 0.35);
  color: #fff;
}

.music-filter-pill.active {
  background: rgba(0, 255, 194, 0.22);
  border-color: var(--neon-teal);
  color: var(--neon-teal);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.25);
}

.music-model-openrouter-list,
.music-model-ollama-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 330px;
  overflow-y: auto;
}

.music-model-section-divider {
  padding: 6px 10px 2px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 3px;
}

.music-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: left;
}

.music-model-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.music-model-item.active {
  background: rgba(0, 255, 194, 0.12);
  border-color: rgba(0, 255, 194, 0.45);
  box-shadow: 0 0 14px rgba(0, 255, 194, 0.18);
}

.music-model-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: rgba(0, 255, 194, 0.12);
  color: var(--neon-teal);
  border: 1px solid rgba(0, 255, 194, 0.3);
}

.music-model-icon-box.off-accent {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.music-model-icon-box.cloud-accent {
  background: rgba(66, 133, 244, 0.16);
  color: #4285F4;
  border: 1px solid rgba(66, 133, 244, 0.38);
}

.music-model-icon-box.gemini-accent {
  background: rgba(0, 240, 255, 0.16);
  color: #00F0FF;
  border: 1px solid rgba(0, 240, 255, 0.38);
}

.music-model-icon-box.llama-accent {
  background: rgba(157, 78, 221, 0.18);
  color: #9D4EDD;
  border: 1px solid rgba(157, 78, 221, 0.42);
}

.music-model-icon-box.qwen-accent {
  background: rgba(255, 170, 0, 0.16);
  color: #FFAA00;
  border: 1px solid rgba(255, 170, 0, 0.38);
}

.music-model-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.music-model-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.music-model-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-model-tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.music-model-item.active .music-model-tag {
  background: rgba(0, 255, 194, 0.2);
  color: var(--neon-teal);
  border: 1px solid rgba(0, 255, 194, 0.35);
}

.music-model-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-model-check {
  font-size: 0.82rem;
  color: var(--neon-teal);
  margin-left: auto;
  flex-shrink: 0;
}

.doc-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.2s ease;
}

.doc-preview-chip i.doc-icon {
  color: var(--neon-cyan);
  font-size: 0.85rem;
}

.doc-preview-chip .doc-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-code);
}

.doc-preview-chip .doc-size {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.doc-preview-chip .remove-doc-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.doc-preview-chip .remove-doc-btn:hover {
  color: var(--neon-amber);
}

/* Auto Markdown Snippet Pill & Convert Row */
.auto-convert-doc-row {
  max-width: 920px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  animation: fadeIn 0.25s ease;
}

.convert-md-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  border-radius: 20px;
  color: var(--neon-cyan);
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.convert-md-pill:hover {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
  color: #ffffff;
}

.convert-md-pill i {
  font-size: 0.82rem;
}

/* Floating Composer Prompt Folding Confirmation Card */
.composer-fold-prompt-card {
  max-width: 920px;
  margin: 0 auto 8px;
  background: rgba(8, 16, 26, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.06);
  animation: slideDownFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 65;
}

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

.fold-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.fold-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fold-card-text strong {
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fold-card-text span {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fold-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-fold-action {
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-fold-confirm {
  background: var(--neon-cyan);
  color: #050a12;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.btn-fold-confirm:hover {
  background: #ffffff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
  transform: translateY(-1px);
}

.btn-fold-dismiss {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-fold-dismiss:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

@media (max-width: 600px) {
  .composer-fold-prompt-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .fold-card-actions {
    justify-content: flex-end;
  }
}

/* Document Preview & Revert Modal */
.doc-preview-modal-card {
  max-width: 820px;
  width: 94%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.doc-preview-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-preview-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
}

.doc-preview-meta-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--neon-teal);
}

.doc-preview-meta-bar span i {
  color: var(--neon-cyan);
}

.doc-preview-content {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-family: var(--font-code);
  font-size: 1.04rem;
  line-height: 1.65;
  color: #eaeaea;
  max-height: 52vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* User Message Document Badges */
.attached-docs-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.msg-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.76rem;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.msg-doc-badge:hover,
a.msg-doc-badge:hover {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
  color: #ffffff;
}

.msg-doc-badge i {
  color: var(--neon-cyan);
  font-size: 0.8rem;
}

.msg-doc-badge .msg-doc-name {
  font-family: var(--font-code);
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-doc-badge .msg-doc-size {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.composer-btn.recording {
  color: var(--neon-magenta);
  animation: pulseMic 1s infinite alternate;
}

@keyframes pulseMic {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.input-field-wrap {
  flex-grow: 1;
  min-width: 0;
  display: flex;
}

.input-field-wrap textarea {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 180px;
  padding: 5px 0;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.35) transparent;
}

.input-field-wrap textarea::-webkit-scrollbar {
  width: 5px;
}

.input-field-wrap textarea::-webkit-scrollbar-track {
  background: transparent;
}

.input-field-wrap textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.35);
  border-radius: 4px;
}

.input-field-wrap textarea::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

.send-btn {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-teal));
  border: none;
  color: #08090D;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-weight: bold;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.stop-btn {
  color: var(--neon-amber) !important;
}

.composer-footnote {
  max-width: 920px;
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-code);
}

/* ==================== BUTTONS & UTILITIES ==================== */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-teal));
  color: #08090D;
}
.btn-primary:hover {
  box-shadow: var(--shadow-glow-cyan);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  color: #FFF;
  border-color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
}
.btn-outline:hover {
  background: rgba(0, 240, 255, 0.12);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

/* ==================== MODALS ==================== */
body.modal-open {
  overflow: hidden !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overscroll-behavior: contain;
}

.modal-backdrop.show {
  display: flex !important;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.modal-card.modal-lg {
  max-width: 820px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.modal-close-btn:hover {
  color: var(--neon-amber);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex-grow: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  flex-wrap: nowrap;
}
.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.settings-tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  font-weight: 600;
}

.settings-tab-pane {
  display: none;
}
.settings-tab-pane.active {
  display: block;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select,
#settingOllamaEndpoint,
#settingOllamaApiKey,
#settingOpenRouterKey,
#settingSerperApiKey,
#settingAutoPolicy,
#settingMusicModel,
#inputWorkspaceNewFileName,
#inputWorkspaceNewFileContent,
#inputTaskSubject {
  width: 100%;
  background-color: #0b0f19 !important;
  background: #0b0f19 !important;
  border: 1px solid rgba(0, 240, 255, 0.24) !important;
  border-radius: var(--radius-sm) !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #00f0ff !important;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none !important;
  color-scheme: dark;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
#settingOllamaEndpoint::placeholder,
#settingOllamaApiKey::placeholder,
#settingOpenRouterKey::placeholder,
#settingSerperApiKey::placeholder,
#settingMusicModel::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  opacity: 1 !important;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
#settingOllamaEndpoint:focus,
#settingOllamaApiKey:focus,
#settingOpenRouterKey:focus,
#settingSerperApiKey:focus,
#settingAutoPolicy:focus,
#settingMusicModel:focus,
#inputWorkspaceNewFileName:focus,
#inputWorkspaceNewFileContent:focus,
#inputTaskSubject:focus {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.18) !important;
}

.form-group select option,
select.custom-select option {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0b0f19 inset !important;
  box-shadow: 0 0 0 1000px #0b0f19 inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  color: #f8fafc !important;
  caret-color: #00f0ff !important;
  transition: background-color 5000s ease-in-out 0s;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-hint a {
  color: var(--neon-cyan);
  text-decoration: none;
}

.range-header {
  display: flex;
  justify-content: space-between;
}

.range-val {
  font-family: var(--font-code);
  color: var(--neon-teal);
  font-weight: 600;
}

/* Model Hub Modal */
.hub-search-filter {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

.filter-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.model-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.model-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.model-card-item:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.1);
}

.model-card-title {
  font-family: var(--font-code);
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFF;
  word-break: break-all;
}

.model-card-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 194, 0.15);
  color: var(--neon-teal);
  align-self: flex-start;
}

.model-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  top: 54px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Di atas semua modal (katalog/inspector z10050 !important) — dulu toast
     tenggelam di belakang modal dan umpan balik tak pernah terlihat. */
  z-index: 10100;
  pointer-events: none;
}

body:has(#terminalModal.show) .toast-container {
  top: auto;
  bottom: 24px;
  right: 24px;
}

.toast {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--neon-cyan);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  animation: slideInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.error {
  border-color: var(--neon-amber);
}

.toast.warning {
  border-color: #f59e0b;
  color: #fef3c7;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .toast-container {
    top: auto;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: auto;
    max-width: 90vw;
    z-index: 10100;
  }
  .toast {
    font-size: 0.75rem;
    padding: 7px 12px;
  }
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar.open + .sidebar-backdrop.active,
#sidebar.open + .sidebar-backdrop.show,
body.mobile-sidebar-open #sidebar.open + .sidebar-backdrop {
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer;
}

#sidebar:not(.open) + .sidebar-backdrop {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (min-width: 769px) {
  .sidebar-backdrop,
  #sidebarBackdrop {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}


/* ==================== RESPONSIVE (MOBILE & ANDROID CHROME) ==================== */
@media (max-width: 768px) {
  /* Off-canvas mobile sidebar - completely detached from flex layout */
  #sidebar,
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0;
    flex-shrink: 0 !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.85);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  
  #sidebar.open,
  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* Main container and chat MUST be 100% full width and never displaced by sidebar */
  #appContainer,
  .app-container {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - 52px);
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #mainContent,
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    overflow-x: hidden !important;
  }

  #chatViewport,
  .chat-viewport,
  #singleChatContainer,
  .chat-messages-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  #welcomeHero,
  .welcome-hero {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .toggle-sidebar-btn {
    display: flex;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* Compact Top Nav on Mobile */
  #topNav.top-nav,
  .top-nav {
    height: 52px;
    padding: 0 10px;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
  }

  .top-nav-left {
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
  }

  .mode-tabs {
    padding: 2px;
    gap: 2px;
    flex-shrink: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .mode-tab {
    padding: 4px 8px;
    font-size: 0.72rem;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .top-nav-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .model-picker-chip {
    padding: 4px 8px;
    gap: 5px;
  }

  .current-model-name {
    max-width: 80px;
    font-size: 0.72rem;
  }

  .top-action-btn {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
    padding: 0;
  }

  .model-dropdown-menu {
    position: fixed;
    top: 48px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: 440px;
    margin: 0 auto;
    z-index: 1050;
  }

  .dropdown-model-list {
    max-height: min(420px, 55vh);
  }

  /* Chat Viewport & Messages */
  .chat-viewport {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .chat-messages-container {
    padding: 14px 12px 84px;
    width: 100%;
    max-width: 100%;
  }

  /* Compact Hero on Mobile */
  .welcome-hero {
    padding: 16px 8px;
    margin-bottom: 12px;
  }

  .welcome-greeting-text {
    font-size: 0.95rem;
    letter-spacing: 0.22em;
  }

  .hero-title {
    font-size: 1.45rem;
    letter-spacing: 0.5px;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  .hero-desc {
    font-size: 0.76rem;
    line-height: 1.4;
    margin-bottom: 16px;
  }

  .hero-quick-prompts.triangle-prompts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .prompt-card-apex,
  .prompt-card-left,
  .prompt-card-right,
  .prompt-card-bottom {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .quick-prompt-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .prompt-icon-wrap {
    width: 30px;
    height: 30px;
  }

  .prompt-icon-wrap i {
    font-size: 0.85rem;
  }

  .quick-prompt-card .card-text strong {
    font-size: 0.78rem;
  }

  .quick-prompt-card .card-text span {
    font-size: 0.7rem;
  }

  .pull-up-new-chat-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  /* Chat Bubbles (Optimized Comfortable Readability on Mobile) */
  .message-row {
    margin-bottom: 18px;
    gap: 8px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
    flex-shrink: 0;
  }

  .message-content-box {
    max-width: calc(100% - 36px);
  }

  .message-row.user .message-content-box {
    max-width: 88%;
    align-items: flex-end;
    margin-left: auto;
  }

  .message-row.user .message-bubble {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    font-family: var(--font-reading);
    font-size: 1.08rem;
    line-height: 1.6;
    padding: 11px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    color: #FFFFFF;
  }

  .message-row.assistant .message-bubble {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 2px 2px 6px 0;
  }

  .message-meta {
    font-size: 0.84rem;
    margin-bottom: 4px;
    gap: 6px;
  }

  .message-bubble {
    padding: 15px 16px;
    font-family: var(--font-reading);
    font-size: 1.14rem;
    line-height: 1.72;
    letter-spacing: 0.004em;
    border-radius: 16px;
    word-break: normal;
    overflow-wrap: break-word;
    color: #F1F5F9;
  }

  .message-bubble p {
    font-size: 1em;
    line-height: 1.72;
    margin-bottom: 15px;
    text-wrap: pretty;
  }

  .message-bubble p:last-child {
    margin-bottom: 0;
  }

  .message-bubble ul, .message-bubble ol {
    padding-left: 22px;
    margin: 8px 0 15px;
  }

  .message-bubble ul {
    list-style-type: disc;
  }

  .message-bubble ol {
    list-style-type: decimal;
  }

  .message-bubble li {
    font-size: 1em;
    line-height: 1.68;
    margin-bottom: 9px;
    color: #E8EEF7;
  }

  .message-bubble strong, .message-bubble b {
    color: #FFFFFF;
    font-weight: 700;
    letter-spacing: 0;
  }

  .message-bubble h1, .message-bubble h2, .message-bubble h3, .message-bubble h4 {
    font-family: var(--font-reading);
    line-height: 1.35;
    color: #FFFFFF;
    font-weight: 700;
  }

  .message-bubble h1 {
    font-size: 1.38em;
    margin: 20px 0 10px;
  }

  .message-bubble h2 {
    font-size: 1.24em;
    margin: 18px 0 8px;
  }

  .message-bubble h3 {
    font-size: 1.12em;
    margin: 16px 0 6px;
  }

  .message-bubble h4 {
    font-size: 1.03em;
    margin: 14px 0 6px;
  }

  .message-bubble blockquote {
    font-size: 0.96em;
    line-height: 1.66;
    padding: 10px 14px;
    margin: 14px 0;
  }

  .message-bubble pre {
    max-width: 100%;
    padding: 0;
    border-radius: 10px;
    margin: 14px 0;
    overflow: hidden;
  }

  .message-bubble pre code {
    font-size: 0.98rem;
    line-height: 1.58;
    padding: 12px 14px;
    overflow-x: auto;
  }

  .message-bubble table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.94rem;
  }

  .message-actions-bar {
    margin-top: 6px;
    gap: 12px;
  }

  .msg-action-btn {
    font-size: 0.84rem;
    padding: 5px 10px;
  }

  .inline-edit-box {
    min-width: 200px !important;
  }

  /* Bottom Composer Section */
  .composer-container {
    padding: 6px 10px 10px;
    width: 100%;
    max-width: 100vw;
  }

  .composer-box {
    padding: 6px 8px;
    border-radius: var(--radius-md);
    gap: 6px;
  }

  .input-field-wrap textarea {
    font-size: 14px;
    padding: 4px 4px;
    min-height: 32px;
    line-height: 1.4;
  }

  .composer-tools-left,
  .composer-tools-right {
    gap: 3px;
    flex-shrink: 0;
  }

  .composer-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .send-btn {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .composer-footnote {
    font-size: 0.62rem;
    padding: 2px 2px 0;
    flex-wrap: wrap;
    text-align: center;
  }

  /* Modals on Mobile */
  .modal-card {
    width: 95%;
    max-width: 95vw;
    max-height: 90vh;
    margin: auto;
    border-radius: 12px;
  }

  .modal-header {
    padding: 10px 12px;
  }

  .modal-title {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 10px 12px;
  }

  .modal-footer {
    padding: 8px 12px;
  }

  .settings-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px 6px;
    -webkit-overflow-scrolling: touch;
  }

  .settings-tab-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
  }


  .model-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Hardware Performance & Thermal Optimization for Mobile (Helio/Mali GPU Cooling) */
  *, *::before, *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .top-nav {
    background: rgba(10, 14, 24, 0.96) !important;
  }
  #mainContent:not(.ai-nature-themed):not(.wa-chat-themed) .composer-container {
    background: linear-gradient(180deg, rgba(10, 14, 24, 0) 0%, rgba(10, 14, 24, 0.45) 100%) !important;
  }
  #mainContent:not(.wa-chat-themed) .composer-box:not(.studio-composer-box),
  #mainContent:not(.wa-chat-themed) .composer-box:not(.studio-composer-box):hover,
  #mainContent:not(.wa-chat-themed) .composer-box:not(.studio-composer-box):focus-within {
    background: rgba(18, 22, 34, 0.68) !important;
    border: none !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  }
  #mainContent.wa-chat-themed .composer-box:not(.studio-composer-box),
  #mainContent.wa-chat-themed .composer-box:not(.studio-composer-box):hover,
  #mainContent.wa-chat-themed .composer-box:not(.studio-composer-box):focus-within {
    background: rgba(18, 22, 34, 0.72) !important;
    border: none !important;
  }
}

/* ==================== UNIFIED ATTACHMENT MENU (GEOMETRIC COMPACT MATRIX) ==================== */
.attachment-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.attach-toggle-btn {
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.attach-toggle-btn.active,
.attach-toggle-btn:hover {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
}

.attach-toggle-btn.active {
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
  transform: rotate(45deg);
}

.attachment-dropdown-popup {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  min-width: min(252px, calc(100vw - 24px));
  max-width: min(290px, calc(100vw - 24px));
  background: rgba(13, 16, 26, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 240, 255, 0.18);
  padding: 8px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: attachMenuPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom left;
}

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

/* Attachment & Tools Segmented Tab Switcher */
.attachment-tabs-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.attachment-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.attachment-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.attachment-tab-btn.active {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.45);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.22);
}

.attachment-tab-btn#tabAttachTools.active {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.45);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.tool-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 6px #c084fc;
  display: inline-block;
  margin-left: 2px;
}

.attachment-pane {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: attachPaneFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.attachment-dropdown-header {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  color: var(--text-main);
}

.attachment-menu-item:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  transform: translateX(3px);
}

.attach-item-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.attach-item-icon-box.camera-accent {
  background: rgba(255, 0, 85, 0.15);
  color: #FF0055;
  border: 1px solid rgba(255, 0, 85, 0.3);
}

.attachment-menu-item:hover .attach-item-icon-box.camera-accent {
  background: rgba(255, 0, 85, 0.28);
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.5);
}

.attach-item-icon-box.image-accent {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.attachment-menu-item:hover .attach-item-icon-box.image-accent {
  background: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

.attach-item-icon-box.image-gen-accent {
  background: rgba(255, 0, 127, 0.15);
  color: #FF007F;
  border: 1px solid rgba(255, 0, 127, 0.35);
}

.attachment-menu-item:hover .attach-item-icon-box.image-gen-accent {
  background: rgba(255, 0, 127, 0.28);
  border-color: #FF007F;
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.6);
}

.attach-item-icon-box.website-gen-accent {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.attachment-menu-item:hover .attach-item-icon-box.website-gen-accent {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
}

.attach-item-icon-box.doc-gen-accent {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.attachment-menu-item:hover .attach-item-icon-box.doc-gen-accent {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

.attach-item-icon-box.doc-accent {
  background: rgba(255, 170, 0, 0.15);
  color: var(--neon-amber);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.attachment-menu-item:hover .attach-item-icon-box.doc-accent {
  background: rgba(255, 170, 0, 0.28);
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.5);
}

.attach-item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.attach-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFF;
  line-height: 1.25;
}

.attach-item-desc {
  display: none !important;
}

/* ==================== SEARCH MODE DROPDOWN & BUTTON STYLES ==================== */
.search-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.composer-btn.web-search-toggle {
  position: relative;
  transition: all 0.25s ease;
}

.composer-btn.web-search-toggle.mode-default {
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.composer-btn.web-search-toggle.mode-premium {
  color: var(--neon-amber);
  background: rgba(255, 170, 0, 0.18);
  border-color: var(--neon-amber);
  box-shadow: 0 0 16px rgba(255, 170, 0, 0.45);
  animation: pulseGold 2s infinite alternate;
}

@keyframes pulseGold {
  from { opacity: 0.78; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}

.composer-btn.web-search-toggle.mode-autonomous {
  color: var(--neon-teal);
  background: rgba(0, 255, 194, 0.18);
  border-color: var(--neon-teal);
  box-shadow: 0 0 16px rgba(0, 255, 194, 0.4);
  animation: pulseTeal 2.4s infinite alternate;
}

@keyframes pulseTeal {
  from { opacity: 0.78; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}

.search-badge {
  position: absolute;
  top: -4px;
  right: -5px;
  background: linear-gradient(135deg, #FFB703, #FF8500);
  color: #000;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(255, 183, 3, 0.6);
  pointer-events: auto;
  cursor: pointer;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.search-dropdown-popup {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  min-width: 290px;
  background: rgba(13, 16, 26, 0.97);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 240, 255, 0.18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 700;
  animation: dropdownSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: bottom left;
}

.search-dropdown-header {
  padding: 6px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.search-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.search-menu-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.35);
}

.search-menu-item.active[data-mode="premium"] {
  background: rgba(255, 170, 0, 0.12);
  border-color: rgba(255, 170, 0, 0.4);
}

.search-item-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.search-item-icon-box.off-accent {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.search-item-icon-box.default-accent {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.search-item-icon-box.premium-accent {
  background: rgba(255, 170, 0, 0.16);
  color: var(--neon-amber);
  border: 1px solid rgba(255, 170, 0, 0.38);
}

.search-item-icon-box.auto-accent {
  background: rgba(0, 255, 194, 0.16);
  color: var(--neon-teal);
  border: 1px solid rgba(0, 255, 194, 0.38);
}

.search-menu-item:hover .search-item-icon-box.default-accent {
  background: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

.search-menu-item:hover .search-item-icon-box.premium-accent {
  background: rgba(255, 170, 0, 0.28);
  box-shadow: 0 0 14px rgba(255, 170, 0, 0.55);
}

.search-menu-item:hover .search-item-icon-box.auto-accent {
  background: rgba(0, 255, 194, 0.28);
  box-shadow: 0 0 14px rgba(0, 255, 194, 0.55);
}

.search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.search-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #FFF;
}

.search-item-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-action-area {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.search-item-check {
  font-size: 0.85rem;
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.search-menu-item[data-mode="premium"] .search-item-check {
  color: var(--neon-amber);
}

.search-item-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 170, 0, 0.18);
  border: 1px solid rgba(255, 170, 0, 0.5);
  color: var(--neon-amber);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.search-item-manage-btn:hover {
  background: rgba(255, 170, 0, 0.35);
  border-color: var(--neon-amber);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.6);
  transform: scale(1.05);
}

.search-item-manage-btn .manage-btn-text {
  font-size: 0.68rem;
  font-weight: 700;
}

.search-item-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 70, 70, 0.16);
  border: 1px solid rgba(255, 70, 70, 0.45);
  color: #ff6b6b;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.search-item-close-btn:hover {
  background: rgba(255, 70, 70, 0.35);
  border-color: #ff4d4d;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 70, 70, 0.6);
  transform: scale(1.06);
}

.search-item-close-btn .close-btn-text {
  font-size: 0.68rem;
  font-weight: 700;
}

/* ==================== WEB SEARCH HUD & REAL-TIME SOURCES ==================== */
.web-search-hud {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--neon-cyan);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
  animation: pulseCyan 1.5s infinite alternate;
  margin-bottom: 8px;
}

@keyframes pulseCyan {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

.msg-sources-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.25s ease;
}

.msg-sources-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a3adc2; /* Adjusted from #5c657a for >4.5:1 WCAG AA contrast ratio */
}

/* Specific high-contrast override for button spans identified in Lighthouse audit */
div.msg-sources-section button.msg-sources-title span {
  color: #a3adc2;
}

.msg-sources-toggle {
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  user-select: none;
  transition: color 0.15s ease;
}

.msg-sources-toggle:hover {
  color: var(--text-main);
}

.sources-toggle-label {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a3adc2;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.2s ease;
}

.msg-sources-toggle:hover .sources-toggle-label {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
}

.sources-toggle-chevron {
  font-size: 0.68rem;
  transition: transform 0.2s ease;
  color: var(--text-dim);
}

.msg-sources-section.collapsed .sources-toggle-chevron {
  transform: rotate(-90deg);
}

.msg-sources-section.collapsed .msg-sources-grid {
  display: none;
}

.msg-sources-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msg-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 16, 26, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  padding: 5px 10px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.78rem;
  transition: all 0.2s ease;
  max-width: 240px;
  cursor: pointer;
}

.msg-source-chip:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
  transform: translateY(-2px);
  color: #FFF;
}

.source-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.source-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: #FFF;
}

.source-domain {
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== CITATION BADGE & INTERACTIVE SOURCE LINKS ==================== */
.citation-ref-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: baseline;
  position: relative;
  top: -0.22em;
  margin: 0 2px;
  padding: 1px 6px;
  min-width: 18px;
  height: 18px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, 'Fira Code', monospace);
  line-height: 1;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan, #00f0ff) !important;
  border: 1px solid rgba(0, 240, 255, 0.35);
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 4px rgba(0, 240, 255, 0.1);
  user-select: none;
}

.citation-ref-badge:hover {
  background: var(--neon-cyan, #00f0ff);
  color: #0b0f19 !important;
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
  transform: translateY(-2px) scale(1.08);
}

/* ==================== GEOMETRIC PROPORTIONAL COMPACT THUMBNAIL MATRIX ==================== */
.attached-images-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  max-width: 100%;
}

.message-row.user .attached-images-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
  width: fit-content;
  margin-bottom: 4px;
}

.message-row.user .attached-docs-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-left: auto;
  width: fit-content;
  margin-bottom: 4px;
}

.attached-images-gallery.grid-1 .chat-img-thumb-wrap {
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  aspect-ratio: 1 / 1;
  border-radius: 13px;
}

.attached-images-gallery.grid-2 .chat-img-thumb-wrap {
  width: 80px;
  height: 80px;
  max-width: 80px;
  max-height: 80px;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
}

.attached-images-gallery.grid-multi .chat-img-thumb-wrap {
  width: 68px;
  height: 68px;
  max-width: 68px;
  max-height: 68px;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
}

.chat-img-thumb-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  background: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

.chat-img-thumb-wrap:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.28);
}

.chat-img-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  font-size: 1.1rem;
  transition: opacity 0.2s ease;
}

.chat-img-thumb-wrap:hover .chat-img-overlay,
.chat-img-thumb-wrap:focus-within .chat-img-overlay {
  opacity: 1;
}

/* Universal Zoomable Image in Chat (Lightbox preview) */
.chat-zoomable-img {
  cursor: zoom-in;
  max-width: 100%;
  border-radius: var(--radius-md, 8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.chat-zoomable-img:not(.image-result-img):not(.chat-img-thumb-wrap img):hover {
  transform: scale(1.015);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.25);
  filter: brightness(1.04);
}

/* ==================== FULL-SCREEN IMAGE LIGHTBOX MODAL ==================== */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightboxFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-content-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  z-index: 10;
}

.lightbox-counter {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 4px 14px;
  border-radius: 20px;
}

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

.lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFF;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.lightbox-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
  transform: scale(1.08);
}

.lightbox-btn.close-btn:hover {
  background: var(--neon-magenta);
  color: #FFF;
  border-color: var(--neon-magenta);
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.6);
}

.lightbox-image-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.lightbox-img-wrapper {
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-out;
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.85), 0 0 24px rgba(0, 240, 255, 0.2);
  transition: transform 0.25s ease;
  cursor: zoom-in;
}

.lightbox-img-wrapper.is-zoomed img {
  cursor: zoom-out;
  transform: scale(1.8);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(14, 18, 28, 0.88);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.lightbox-nav-btn.prev-btn {
  left: 24px;
}

.lightbox-nav-btn.next-btn {
  right: 24px;
}

.lightbox-nav-btn:hover {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .attached-images-gallery.grid-1 .chat-img-thumb-wrap {
    width: 82px;
    height: 82px;
    max-width: 82px;
    max-height: 82px;
    border-radius: 12px;
  }
  .attached-images-gallery.grid-2 .chat-img-thumb-wrap {
    width: 74px;
    height: 74px;
    max-width: 74px;
    max-height: 74px;
    border-radius: 10px;
  }
  .attached-images-gallery.grid-multi .chat-img-thumb-wrap {
    width: 62px;
    height: 62px;
    max-width: 62px;
    max-height: 62px;
    border-radius: 8px;
  }
  .lightbox-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .lightbox-nav-btn.prev-btn {
    left: 12px;
  }
  .lightbox-nav-btn.next-btn {
    right: 12px;
  }
  .lightbox-toolbar {
    padding: 12px 16px;
  }
}

/* ==================== LIVE MODEL CATALOG STYLES (WIDE & LARGE) ==================== */
.modal-catalog-card {
  max-width: 980px !important;
  width: 94vw !important;
  max-height: 90vh !important;
  height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(10, 13, 20, 0.96) !important;
  border: 1px solid rgba(0, 240, 255, 0.3) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.18) !important;
  backdrop-filter: blur(6px) !important;
}

@media (max-width: 768px) {
  .modal-catalog-card {
    width: 96vw !important;
    /* backdrop padding20px (40px total): 94vh + 40px melebihi100vh di layar
       pendek (browser chrome / keyboard terbuka) → baris bawah terpotong. */
    max-height: calc(100vh - 40px) !important;
    height: calc(100vh - 40px) !important;
    border-radius: var(--radius-md) !important;
  }
}

.catalog-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(13, 16, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  gap: 14px;
}

.catalog-model-row:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
  transform: translateX(3px);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.08);
}

.catalog-model-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  flex: 1;
}

.catalog-model-name {
  font-family: var(--font-code);
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFF;
  word-break: break-all;
}

.catalog-model-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.catalog-badge {
  font-size: 0.68rem;
  padding: 2.5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.catalog-badge.free {
  background: rgba(0, 255, 194, 0.15);
  color: var(--neon-teal);
  border-color: rgba(0, 255, 194, 0.35);
}

.catalog-badge.reasoning {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}

.catalog-badge.flagship {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.catalog-badge.fast {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.catalog-badge.coding {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.35);
}

.catalog-badge.context {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}

.catalog-badge.cloud {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.35);
}

.catalog-badge.local {
  background: rgba(255, 183, 3, 0.15);
  color: var(--neon-amber);
  border-color: rgba(255, 183, 3, 0.35);
}

.catalog-filter-pills-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.catalog-filter-pills-row::-webkit-scrollbar {
  display: none;
}

.catalog-filter-pill {
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.catalog-filter-pill:hover {
  background: rgba(0, 240, 255, 0.1);
  color: #fff;
  border-color: rgba(0, 240, 255, 0.3);
}

.catalog-filter-pill.active {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.catalog-filter-pill[data-catalog-filter="free"].active {
  background: rgba(0, 255, 194, 0.18);
  border-color: var(--neon-teal);
  color: var(--neon-teal);
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.2);
}

.catalog-filter-pill[data-catalog-filter="reasoning"].active {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.catalog-filter-pill[data-catalog-filter="fast"].active {
  background: rgba(34, 197, 94, 0.18);
  border-color: #4ade80;
  color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.catalog-filter-pill[data-catalog-filter="flagship"].active {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.catalog-filter-pill[data-catalog-filter="coding"].active {
  background: rgba(234, 179, 8, 0.18);
  border-color: #fde047;
  color: #fde047;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.catalog-select-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.catalog-select-btn:hover {
  background: var(--neon-cyan);
  color: #08090D;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
}

/* Model Dropdown Tabs di Header */
.dropdown-mode-tabs .dropdown-tab-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-mode-tabs .dropdown-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 600;
}

/* Inspector Tabs Mobile Responsiveness */
.inspector-tabs {
  scrollbar-width: thin;
}
.inspector-tabs .settings-tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .inspector-summary-bar {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  .inspector-summary-bar > div {
    font-size: 0.72rem !important;
  }
}

/* ==========================================================================
   AI IMAGE STUDIO: CREATION ANIMATION & HOLOMETRIC SYNTHESIS HUD
   ========================================================================== */

/* Keyframe Animations */
@keyframes laserScan {
  0% {
    top: 0%;
    opacity: 0.6;
    box-shadow: 0 0 10px #FF007F, 0 0 20px #FF007F;
  }
  50% {
    top: 96%;
    opacity: 1;
    box-shadow: 0 0 16px #00F0FF, 0 0 30px #00F0FF;
  }
  100% {
    top: 0%;
    opacity: 0.6;
    box-shadow: 0 0 10px #FF007F, 0 0 20px #FF007F;
  }
}

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

@keyframes quantumHoloPulse {
  0% {
    transform: scale(0.92) rotate(0deg);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.06) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.92) rotate(360deg);
    opacity: 0.75;
  }
}

@keyframes materializationGlow {
  0% {
    opacity: 0;
    filter: brightness(2.6) contrast(1.4) blur(16px);
    transform: scale(0.97);
  }
  60% {
    opacity: 0.92;
    filter: brightness(1.25) contrast(1.1) blur(4px);
  }
  100% {
    opacity: 1;
    filter: brightness(1) contrast(1) blur(0);
    transform: scale(1);
  }
}

@keyframes cyberShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Image Generation HUD Container */
.image-gen-hud {
  background: rgba(10, 12, 22, 0.94);
  border: 1px solid rgba(255, 0, 127, 0.45);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 0, 127, 0.15);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 540px;
  width: 100%;
  animation: fadeIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

.image-gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 0, 127, 0.2);
  padding-bottom: 8px;
}

.image-gen-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 0.86rem;
  color: #FF2E93;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.image-gen-badge {
  font-family: var(--font-code);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid rgba(255, 0, 127, 0.4);
  color: #FF66B2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* The Animated Holographic Canvas */
.image-gen-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  background: #06080F;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

/* Cyber Matrix Grid Backdrop */
.image-gen-canvas-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 0, 127, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center center;
  opacity: 0.85;
}

/* Laser Scanning Beam */
.image-gen-laser-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FF007F 20%, #00F0FF 50%, #FF007F 80%, transparent);
  box-shadow: 0 0 12px #FF007F, 0 0 24px #00F0FF;
  animation: laserScan 2.4s ease-in-out infinite;
  z-index: 2;
}

/* Central Quantum Hologram Indicator */
.image-gen-holo-center {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.image-gen-holo-icon-wrap {
  width: 72px;
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-gen-holo-ring {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  border-radius: 50%;
  animation: quantumHoloPulse 4s linear infinite;
  will-change: transform;
}

.image-gen-holo-core {
  font-size: 1.8rem;
  color: #FF007F;
  text-shadow: 0 0 16px rgba(255, 0, 127, 0.9);
  animation: pulseCyan 1.5s infinite alternate;
}

.image-gen-holo-label {
  font-family: var(--font-code);
  font-size: 0.72rem;
  color: var(--neon-cyan);
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Telemetry & Progress Indicator */
.image-gen-telemetry {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-gen-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.image-gen-status-text {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.image-gen-percent-text {
  font-family: var(--font-code);
  font-weight: 700;
  color: #FF2E93;
}

.image-gen-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.image-gen-progress-fill {
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, #FF007F, #9D00FF, #00F0FF);
  background-size: 200% 100%;
  animation: cyberShimmer 2s linear infinite;
  box-shadow: 0 0 10px #FF007F;
  transition: width 0.35s ease;
}

.image-gen-prompt-quote {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid #FF007F;
}

/* ==========================================================================
   AI IMAGE RESULT CARD & CONTROLS
   ========================================================================== */
.image-result-card {
  max-width: 540px;
  width: 100%;
  border-radius: var(--radius-md);
  background: rgba(13, 17, 28, 0.95);
  border: 1px solid rgba(255, 0, 127, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 0, 127, 0.12);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.image-result-card:hover {
  border-color: rgba(255, 0, 127, 0.7);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 28px rgba(255, 0, 127, 0.25);
}

.image-result-display-wrap {
  position: relative;
  width: 100%;
  background: #05060A;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.image-result-img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
  animation: materializationGlow 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.4s ease;
}

.image-result-card:hover .image-result-img {
  transform: scale(1.02);
}

/* Hover Action Overlay */
.image-result-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.25s ease;
  z-index: 5;
}

.image-result-card:hover .image-result-overlay,
.image-result-card:focus-within .image-result-overlay {
  opacity: 1;
  transform: translateY(0);
}

.image-action-btn {
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.image-action-btn:hover {
  background: rgba(255, 0, 127, 0.85);
  border-color: #FF007F;
  box-shadow: 0 0 12px #FF007F;
  transform: scale(1.08);
}

/* Image Meta & Controls Footer */
.image-result-footer {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(10, 13, 22, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.image-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.image-meta-badge {
  font-family: var(--font-code);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #8E99B0);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.image-meta-badge.model-badge {
  background: rgba(255, 0, 127, 0.12);
  border-color: rgba(255, 0, 127, 0.35);
  color: #FF66B2;
  font-weight: 600;
}

.image-meta-badge.latency-badge {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
}

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

.btn-image-action {
  font-size: 0.74rem;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

@media (max-width: 600px) {
  .image-result-overlay {
    opacity: 1;
    transform: translateY(0);
    top: 8px;
    right: 8px;
  }
  .image-action-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   AI MUSIC STUDIO & CYBER AUDIO PLAYER
   ========================================================================== */
.music-gen-hud {
  background: rgba(10, 14, 24, 0.94);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 540px;
  width: 100%;
  animation: fadeIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

.music-gen-hud {
  border: 1px solid rgba(0, 255, 194, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 255, 194, 0.15);
}

.music-gen-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--neon-teal);
  text-shadow: 0 0 10px rgba(0, 255, 194, 0.5);
}

/* Audio Player Card */
.cyber-audio-card {
  max-width: 540px;
  width: 100%;
  border-radius: var(--radius-md);
  background: rgba(11, 16, 28, 0.95);
  border: 1px solid rgba(0, 255, 194, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 194, 0.12);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.cyber-audio-card:hover {
  border-color: rgba(0, 255, 194, 0.7);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 255, 194, 0.25);
}

.cyber-audio-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cyber-audio-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cyber-audio-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cyber-audio-wave-wrap {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 255, 194, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.cyber-audio-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cyber-audio-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cyber-audio-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-teal), #00F0FF);
  border: none;
  color: #06080F;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 194, 0.5);
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cyber-audio-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(0, 255, 194, 0.8);
}

.cyber-audio-scrubber-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cyber-audio-scrubber {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.cyber-audio-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--neon-teal);
  box-shadow: 0 0 8px var(--neon-teal);
  cursor: pointer;
}

.cyber-audio-time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-code);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.cyber-audio-loop-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 255, 194, 0.25);
  color: var(--text-dim);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cyber-audio-loop-btn:hover {
  background: rgba(0, 255, 194, 0.15);
  color: #FFF;
  border-color: rgba(0, 255, 194, 0.5);
  transform: scale(1.06);
}

.cyber-audio-loop-btn.active {
  background: rgba(0, 255, 194, 0.2);
  border-color: var(--neon-teal);
  color: var(--neon-teal);
  box-shadow: 0 0 12px rgba(0, 255, 194, 0.45);
}

/* Sembunyikan ringkasan / lirik audio token sintetis Lyria yang tidak rapi */
.cyber-audio-ai-summary {
  display: none !important;
}

/* Video Player Card */
.cyber-video-card {
  max-width: 540px;
  width: 100%;
  border-radius: var(--radius-md);
  background: rgba(13, 15, 26, 0.95);
  border: 1px solid rgba(176, 38, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(176, 38, 255, 0.12);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.cyber-video-card:hover {
  border-color: rgba(176, 38, 255, 0.7);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 28px rgba(176, 38, 255, 0.25);
}

.cyber-video-wrap {
  position: relative;
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.cyber-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==================== PROVIDER REAL-TIME STATUS & CREDITS ==================== */
.provider-status-card {
  background: rgba(13, 16, 26, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 6px;
  margin-bottom: 14px;
  transition: all 0.25s ease;
}

.provider-status-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.provider-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-status-indicator-box,
.provider-status-header .status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  position: relative;
}

.pulse-dot.active {
  background: var(--neon-teal);
  box-shadow: 0 0 8px var(--neon-teal);
  animation: pulseNeon 2s infinite;
}

.pulse-dot.warning {
  background: var(--neon-amber);
  box-shadow: 0 0 8px var(--neon-amber);
  animation: pulseNeon 1.5s infinite;
}

.pulse-dot.error {
  background: var(--neon-magenta);
  box-shadow: 0 0 8px var(--neon-magenta);
}

@keyframes pulseNeon {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.balance-value {
  color: var(--neon-amber);
  font-family: var(--font-code);
  font-size: 0.86rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.balance-value:hover {
  text-shadow: 0 0 8px currentColor;
}

.balance-value.free-tier {
  color: var(--neon-teal);
}

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

.provider-status-meta {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.73rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-code);
}

.btn-xs {
  padding: 4px 9px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-main);
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-primary-neon {
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.25), rgba(255, 170, 0, 0.45));
  border: 1px solid var(--neon-amber);
  color: #FFF !important;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(255, 170, 0, 0.6);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.25);
}

.btn-primary-neon:hover {
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.4), rgba(255, 170, 0, 0.65));
  box-shadow: 0 0 18px rgba(255, 170, 0, 0.5);
  transform: translateY(-1px);
}

.btn-outline-teal {
  background: rgba(0, 255, 194, 0.1);
  border: 1px solid var(--neon-teal);
  color: var(--neon-teal) !important;
  font-weight: 600;
}

.btn-outline-teal:hover {
  background: rgba(0, 255, 194, 0.22);
  box-shadow: 0 0 14px rgba(0, 255, 194, 0.35);
  color: #FFF !important;
  transform: translateY(-1px);
}

/* ==================== CATALOG REAL-TIME BALANCE BANNER ==================== */
.catalog-balance-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 16, 26, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-balance-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

#catalogBalanceValue {
  font-family: var(--font-code);
  font-size: 0.86rem;
}

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

@media (max-width: 600px) {
  .provider-status-card {
    padding: 10px 12px;
  }
  .provider-status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .provider-status-indicator-box,
  .provider-status-header .status-indicator {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .provider-status-card .status-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
  }
  .provider-status-card .status-actions .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  .provider-status-meta {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .catalog-balance-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .catalog-balance-actions {
    width: 100%;
  }
  .catalog-balance-actions .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }
}

/* ==================== YOUTUBE OEMBED PREVIEW CARDS ==================== */
.msg-youtube-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}

.message-row.user .msg-youtube-cards-wrap {
  align-items: flex-end;
}

/* ==================== AI FILE STUDIO (kartu file buatan AI) ==================== */
.msg-file-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}

.message-row.user .msg-file-cards-wrap {
  align-items: flex-end;
}

.ai-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(14, 17, 27, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 240, 255, 0.10);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 620px;
  width: 100%;
  box-sizing: border-box;
}

.ai-file-card.is-pdf-card {
  border-color: rgba(239, 68, 68, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.42), 0 0 16px rgba(239, 68, 68, 0.08);
}

.ai-file-card.is-docx-card {
  border-color: rgba(59, 130, 246, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.42), 0 0 16px rgba(59, 130, 246, 0.08);
}

.ai-file-card.is-xlsx-card {
  border-color: rgba(16, 185, 129, 0.38);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.42), 0 0 16px rgba(16, 185, 129, 0.08);
}

.ai-file-card:hover {
  border-color: rgba(0, 255, 194, 0.5);
  transform: translateY(-2px);
}

.ai-file-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.16), rgba(0, 255, 194, 0.10));
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan, #00f0ff);
  font-size: 1.15rem;
}

.ai-file-icon.is-pdf {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.20), rgba(220, 38, 38, 0.10));
  border-color: rgba(239, 68, 68, 0.38);
  color: #f87171;
}

.ai-file-icon.is-docx {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.20), rgba(37, 99, 235, 0.10));
  border-color: rgba(59, 130, 246, 0.38);
  color: #60a5fa;
}

.ai-file-icon.is-xlsx {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.20), rgba(5, 150, 105, 0.10));
  border-color: rgba(16, 185, 129, 0.38);
  color: #34d399;
}

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

.ai-file-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  word-break: break-word;
}

.ai-file-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-code);
}

body.light-theme .ai-file-card {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

body.light-theme .ai-file-name {
  color: #0f172a;
}

.ai-file-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.10);
  color: var(--neon-cyan, #00f0ff);
  cursor: pointer;
  transition: all 0.18s ease;
}

.ai-file-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  transform: translateY(-1px);
}

.ai-file-btn.download {
  background: rgba(0, 255, 194, 0.12);
  border-color: rgba(0, 255, 194, 0.35);
  color: var(--neon-teal, #00ffc2);
}

.ai-file-btn.download:hover {
  background: rgba(0, 255, 194, 0.25);
}

@media (max-width: 768px) {
  .ai-file-card {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .ai-file-info {
    min-width: calc(100% - 56px);
  }
  .ai-file-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 6px;
    gap: 8px;
  }
  .ai-file-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 12px;
  }
}

/* ==================== AI FILE STUDIO MODAL ==================== */
.ai-file-studio-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 340px;
}

.ai-file-studio-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 8px;
}

.ai-file-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.ai-file-tab:hover {
  color: var(--neon-cyan, #00f0ff);
}

.ai-file-tab.active {
  color: #080b10;
  background: linear-gradient(135deg, var(--neon-cyan, #00f0ff), var(--neon-teal, #00ffc2));
  border-color: rgba(0, 255, 194, 0.4);
}

.ai-file-studio-card {
  max-width: 1080px;
  width: 96vw;
  height: 88vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.ai-file-studio-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: #0a0e1a;
}

.ai-file-studio-pane iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Masalah YANG SAMA dengan YouTube yang sudah diperbaiki: CSS author
   (position:absolute; width/height:100%) MENANG di atas UA stylesheet
   :-webkit-full-screen sehingga iframe pratinjau tampil kecil di layar hitam.
   Paksa dimensi fullscreen ke viewport. */
.ai-file-studio-pane iframe:fullscreen,
.ai-file-studio-pane iframe:-webkit-full-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border: 0 !important;
  margin: 0 !important;
  z-index: 2147483647;
}

.ai-file-studio-pane:fullscreen,
.ai-file-studio-pane:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

.ai-file-studio-pane:fullscreen iframe,
.ai-file-studio-pane:-webkit-full-screen iframe {
  width: 100% !important;
  height: 100% !important;
}

.ai-file-studio-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.5;
}

.ai-file-studio-placeholder.show {
  display: flex;
}

.ai-file-studio-code {
  display: none;
  width: 100%;
  height: 520px;
  max-height: 70vh;
  min-height: 380px;
  margin: 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-main, #9ad7ff);
  font-family: var(--font-code);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm, 6px);
}

.ai-file-studio-code.active {
  display: block;
}

.ai-file-studio-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-code);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-file-studio-pane.hidden,
.ai-file-studio-code.active ~ .ai-file-studio-pane {
  display: none;
}

/* ==================== NEURAL CANVAS STUDIO & INLINE CARDS ==================== */
/* 1. Inline Gemini Canvas Card in Chat Stream */
.gemini-canvas-card {
  width: 100%;
  max-width: 960px;
  margin: 14px 0 16px 0;
  background: #131418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}

.gemini-canvas-card:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 240, 255, 0.12);
}

.gemini-canvas-header,
.gemini-studio-header {
  position: relative !important;
  z-index: 100 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #181a20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-wrap: wrap;
  user-select: none;
}

.gemini-canvas-header-left,
.gemini-studio-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.gemini-canvas-title,
.gemini-studio-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.gemini-canvas-title {
  cursor: pointer;
  transition: color 0.18s ease;
}

.gemini-canvas-title:hover {
  color: var(--neon-cyan, #00f0ff);
  text-decoration: underline;
}

.gemini-canvas-status {
  display: inline-flex;
  align-items: center;
  position: relative;
  color: #38bdf8;
  font-size: 0.88rem;
  cursor: help;
  margin-right: 2px;
}

.gemini-canvas-status .gemini-status-check {
  font-size: 0.55rem;
  position: absolute;
  bottom: -2px;
  right: -3px;
  background: #131418;
  border-radius: 50%;
  padding: 1px;
  color: #22c55e;
}

.gemini-history-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Gemini Segmented Toggle [ Kode | Pratinjau ] */
.gemini-segmented-toggle {
  display: inline-flex;
  align-items: center;
  background: #23252b;
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.gemini-segmented-toggle .seg-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.80rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.gemini-segmented-toggle .seg-btn:hover {
  color: #f8fafc;
}

.gemini-segmented-toggle .seg-btn.active {
  background: #373a43;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gemini-canvas-header-right,
.gemini-studio-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gemini-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.80rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
  text-decoration: none;
}

.gemini-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.gemini-pill-btn.canvas-card-fullscreen-btn,
.gemini-pill-btn.gemini-primary-preview-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18) 0%, rgba(0, 255, 194, 0.22) 100%);
  border: 1px solid rgba(0, 240, 255, 0.55);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
}

.gemini-pill-btn.canvas-card-fullscreen-btn:hover,
.gemini-pill-btn.gemini-primary-preview-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.32) 0%, rgba(0, 255, 194, 0.38) 100%);
  border-color: rgba(0, 240, 255, 0.85);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.gemini-pill-btn .caret-icon {
  font-size: 0.70rem;
  opacity: 0.75;
}

.gemini-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.gemini-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.gemini-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Gemini Export Dropdown */
.gemini-dropdown-wrap {
  position: relative;
  display: inline-block;
  z-index: 120 !important;
}

.gemini-export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(20, 22, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 240, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 99999 !important;
  min-width: 220px;
  max-width: calc(100vw - 32px);
}

.gemini-export-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.80rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.gemini-export-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #00f0ff;
}

.gemini-export-item i {
  font-size: 0.92rem;
  width: 18px;
  text-align: center;
}

/* Stage & Iframe */
.gemini-canvas-stage {
  position: relative !important;
  z-index: 1 !important;
  width: 100%;
  height: 520px;
  min-height: 380px;
  background: #090a0d;
  overflow: hidden;
}

.gemini-canvas-preview-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gemini-canvas-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.gemini-canvas-code-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 16px 20px;
  background: #0e1015;
  box-sizing: border-box;
}

.gemini-canvas-code {
  margin: 0;
  font-family: var(--font-code);
  font-size: 0.80rem;
  line-height: 1.6;
  color: #9ad7ff;
  white-space: pre-wrap;
  word-break: break-word;
}

.gemini-canvas-warning-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 183, 3, 0.12);
  border-top: 1px solid rgba(255, 183, 3, 0.25);
  color: #ffb703;
  font-size: 0.78rem;
}

/* 2. Gemini Studio Modal Enhancements */
.gemini-studio-backdrop {
  z-index: 1050;
  padding: 0 !important;
}

.gemini-canvas-studio {
  background: #131418;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.gemini-studio-stage {
  padding: 0 !important;
  margin: 0 !important;
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.studio-workspace-area {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.gemini-studio-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
}

.gemini-studio-code {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: #0e1015;
  overflow: auto;
  padding: 16px 20px 100px 20px;
  box-sizing: border-box;
}

/* Studio Bottom Floating Composer (Glassmorphism & Floating Layout) */
.gemini-studio-footer {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  padding: 0 16px max(16px, env(safe-area-inset-bottom, 16px)) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
  z-index: 50 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  user-select: none !important;
}

.studio-composer-box,
.gemini-studio-composer {
  pointer-events: auto !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  background: rgba(14, 18, 28, 0.88) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  transform: translateZ(0);
  contain: paint;
  border: 1.5px solid rgba(0, 240, 255, 0.35) !important;
  border-radius: 18px !important;
  padding: 8px 14px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 10px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 240, 255, 0.12) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

.studio-composer-box:hover,
.gemini-studio-composer:hover {
  background: rgba(18, 23, 36, 0.82) !important;
  border-color: rgba(0, 240, 255, 0.65) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.7), 0 0 28px rgba(0, 240, 255, 0.22) !important;
}

.studio-composer-box:focus-within,
.gemini-studio-composer:focus-within {
  background: rgba(18, 24, 38, 0.90) !important;
  border-color: var(--neon-cyan, #00f0ff) !important;
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.25), 0 16px 45px rgba(0, 0, 0, 0.75) !important;
}

.studio-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: var(--radius-sm, 6px);
  padding: 5px 9px;
  color: var(--neon-cyan, #00f0ff);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  outline: none;
  height: 32px;
  box-sizing: border-box;
}

.studio-model-chip:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.6);
  transform: translateY(-1px);
}

.studio-model-chip .studio-chip-icon {
  font-size: 0.8rem;
}

.studio-model-chip .studio-model-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-model-chip .studio-chip-arrow {
  font-size: 0.65rem;
  opacity: 0.75;
}

.studio-prompt-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.45;
  resize: none;
  min-height: 24px;
  max-height: 140px;
  padding: 4px 0;
  box-sizing: border-box;
}

.studio-prompt-textarea::placeholder {
  color: #64748b;
  font-size: 0.86rem;
}

.studio-send-btn {
  flex-shrink: 0;
}

/* Studio Stage: Full Website Canvas with Floating Assistant Mini Popup */
.gemini-studio-stage {
  position: relative !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
}

.studio-workspace-area {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
}

.studio-workspace-area .ai-file-studio-pane {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #0a0e1a !important;
}

.studio-workspace-area .ai-file-studio-pane iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
}

.studio-workspace-area .ai-file-studio-code,
.studio-workspace-area .ai-file-studio-code.hljs,
#aiFileStudioCode,
#aiFileStudioCode.hljs {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 16px 20px !important;
  overflow: auto !important;
  background: #0e1015 !important;
  color: #E6EDF8 !important;
}

/* Studio Direct Code Editor & Edit Buttons */
.studio-edit-code-btn,
.canvas-card-edit-code-btn {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: var(--neon-teal) !important;
}

.studio-edit-code-btn:hover,
.canvas-card-edit-code-btn:hover {
  background: rgba(16, 185, 129, 0.24) !important;
  border-color: var(--neon-teal) !important;
  color: #ffffff !important;
}

.studio-edit-code-btn.active {
  background: rgba(0, 240, 255, 0.2) !important;
  border-color: var(--neon-cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3) !important;
}

.studio-code-editor-wrap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: none !important;
  flex-direction: column !important;
  background: #0b0e14 !important;
  z-index: 40 !important;
}

.studio-code-editor-wrap.is-editing {
  display: flex !important;
}

.studio-code-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(15, 20, 30, 0.96);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}

.studio-editor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
}

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

.studio-editor-undo-btn,
.studio-editor-redo-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #e2e8f0 !important;
}

.studio-editor-undo-btn:hover:not(:disabled),
.studio-editor-redo-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.studio-editor-undo-btn:disabled,
.studio-editor-redo-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

.studio-editor-save-btn {
  background: rgba(16, 185, 129, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #34d399 !important;
  font-weight: 600 !important;
}

.studio-editor-save-btn:hover {
  background: rgba(16, 185, 129, 0.35) !important;
  color: #ffffff !important;
}

.studio-editor-cancel-btn {
  background: rgba(244, 63, 94, 0.12) !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  color: #fda4af !important;
}

.studio-editor-cancel-btn:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  color: #ffffff !important;
}

.studio-editor-ai-btn {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(0, 240, 255, 0.22)) !important;
  border: 1px solid rgba(0, 240, 255, 0.5) !important;
  color: #67e8f9 !important;
  font-weight: 600 !important;
}

.studio-editor-ai-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(0, 240, 255, 0.38)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35) !important;
}

.studio-editor-sel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: #00f0ff;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

/* Colored Syntax-Highlighted Live Code Editor Stage */
.studio-code-editor-stage {
  flex: 1 1 auto !important;
  display: flex !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #090d16 !important;
  contain: strict !important;
}

.studio-editor-line-numbers {
  width: 44px !important;
  flex-shrink: 0 !important;
  padding: 14px 8px 92px 4px !important;
  margin: 0 !important;
  background: #060911 !important;
  border-right: 1px solid rgba(0, 240, 255, 0.14) !important;
  color: #475569 !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
  font-size: 13px !important;
  line-height: 20px !important;
  text-align: right !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  white-space: pre !important;
  contain: layout style paint !important;
}

.studio-editor-line-numbers .line-num-row {
  display: block;
  height: 20px;
  line-height: 20px;
  padding-right: 2px;
}

.studio-editor-line-numbers .line-num-row.is-ai-edited {
  color: #00f0ff !important;
  font-weight: 700 !important;
  background: rgba(0, 240, 255, 0.16) !important;
  border-radius: 3px;
}

.studio-editor-line-numbers .line-num-row.is-selected-line {
  color: #facc15 !important;
  background: rgba(250, 204, 21, 0.14) !important;
}

.studio-editor-canvas {
  flex: 1 1 auto !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #090d16 !important;
}

.studio-editor-highlight-pre,
.ai-file-studio-editor {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 14px 18px 92px 12px !important;
  border: none !important;
  outline: none !important;
  resize: none !important;
  box-sizing: border-box !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
  font-size: 13px !important;
  line-height: 20px !important;
  letter-spacing: 0px !important;
  font-variant-ligatures: none !important;
  tab-size: 2 !important;
  -moz-tab-size: 2 !important;
  white-space: pre !important;
  word-wrap: normal !important;
  overflow-wrap: normal !important;
  overflow: auto !important;
}

.studio-editor-highlight-pre {
  z-index: 1 !important;
  pointer-events: none !important;
  background: #090d16 !important;
  color: #e2e8f0 !important;
}

.studio-editor-highlight-code {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  white-space: pre !important;
  color: #e2e8f0 !important;
}

.ai-file-studio-editor {
  z-index: 2 !important;
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  caret-color: #00f0ff !important;
}

.ai-file-studio-editor::selection {
  background: rgba(0, 240, 255, 0.28) !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

/* IDE Syntax Highlighting Token Palette (Monospace Width-Invariant) */
.studio-editor-highlight-code .tok-comment {
  color: #64748b !important;
}
.studio-editor-highlight-code .tok-tag {
  color: #ff5874 !important;
}
.studio-editor-highlight-code .tok-attr {
  color: #ffcb6b !important;
}
.studio-editor-highlight-code .tok-str {
  color: #a3e635 !important;
}
.studio-editor-highlight-code .tok-kw {
  color: #c084fc !important;
}
.studio-editor-highlight-code .tok-fn {
  color: #38bdf8 !important;
}
.studio-editor-highlight-code .tok-prop {
  color: #67e8f9 !important;
}
.studio-editor-highlight-code .tok-num {
  color: #fb923c !important;
}
.studio-editor-highlight-code .tok-punc {
  color: #94a3b8 !important;
}
.studio-editor-highlight-code .studio-ai-edited-line {
  background: rgba(0, 240, 255, 0.16) !important;
  box-shadow: inset 3px 0 0 #00f0ff !important;
  display: inline-block;
  min-width: 100%;
}

/* ==================== STUDIO CODE SEARCH BAR (v479) ==================== */
.studio-editor-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(11, 15, 25, 0.96);
  border-bottom: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(0, 240, 255, 0.15);
  z-index: 20;
  flex-shrink: 0;
  animation: slideDownSearch 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-editor-search-bar.is-hidden {
  display: none !important;
}

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

.studio-search-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.studio-search-icon {
  color: var(--neon-cyan, #00f0ff) !important;
  font-size: 0.85rem !important;
  flex-shrink: 0 !important;
}

.studio-search-input {
  flex: 1 1 auto !important;
  min-width: 140px !important;
  height: 32px !important;
  padding: 4px 10px !important;
  background: rgba(18, 24, 38, 0.9) !important;
  border: 1px solid rgba(0, 240, 255, 0.3) !important;
  border-radius: 6px !important;
  color: #f8fafc !important;
  font-family: "JetBrains Mono", Consolas, monospace !important;
  font-size: 0.82rem !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.studio-search-input:focus {
  border-color: var(--neon-cyan, #00f0ff) !important;
  background: rgba(18, 24, 38, 1) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35) !important;
}

.studio-search-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-family: "JetBrains Mono", Consolas, monospace !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  user-select: none !important;
}

.studio-search-count-badge.is-found {
  background: rgba(0, 240, 255, 0.18) !important;
  border: 1px solid rgba(0, 240, 255, 0.5) !important;
  color: #00f0ff !important;
}

.studio-search-count-badge.is-none {
  background: rgba(244, 63, 94, 0.15) !important;
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  color: #fb7185 !important;
}

.studio-search-count-badge.is-empty {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

.studio-search-right {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.studio-search-nav-btn,
.studio-search-close-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 6px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #cbd5e1 !important;
  font-size: 0.78rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.studio-search-nav-btn:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.2) !important;
  border-color: rgba(0, 240, 255, 0.45) !important;
  color: #ffffff !important;
}

.studio-search-nav-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

.studio-search-close-btn:hover {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: rgba(244, 63, 94, 0.45) !important;
  color: #ffffff !important;
}

/* Active Line Indicator for Precise Code Search */
.studio-editor-active-line-indicator {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  height: 20px !important;
  background: rgba(0, 240, 255, 0.16) !important;
  border-left: 3px solid #00f0ff !important;
  box-shadow: inset 0 0 14px rgba(0, 240, 255, 0.22) !important;
  pointer-events: none !important;
  z-index: 1 !important;
  display: none;
  will-change: transform;
}

@keyframes searchMatchPulse {
  0% { transform: scale(0.92); filter: brightness(1.6); }
  50% { transform: scale(1.08); filter: brightness(2); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Header & Editor Search Buttons */
.studio-search-code-btn {
  background: rgba(0, 240, 255, 0.12) !important;
  border: 1px solid rgba(0, 240, 255, 0.35) !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
}

.studio-search-code-btn:hover {
  background: rgba(0, 240, 255, 0.24) !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3) !important;
}

.studio-editor-search-btn {
  background: rgba(0, 240, 255, 0.12) !important;
  border: 1px solid rgba(0, 240, 255, 0.35) !important;
  color: #67e8f9 !important;
  font-weight: 600 !important;
}

.studio-editor-search-btn:hover {
  background: rgba(0, 240, 255, 0.24) !important;
  color: #ffffff !important;
}

/* Highlight search match in line numbers */
.studio-editor-line-numbers .line-num-row.is-search-match {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.14) !important;
}

.studio-editor-line-numbers .line-num-row.is-active-search-match {
  color: #050811 !important;
  background: #00f0ff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px #00f0ff, 0 0 20px rgba(0, 240, 255, 0.6) !important;
  border-radius: 3px !important;
  animation: searchMatchPulse 0.35s ease-out !important;
}

/* Floating Bottom Control Bar (Hidden - all actions available on clean top editor bar) */
.studio-editor-bottom-bar {
  display: none !important;
}

.studio-bottom-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
  min-height: 38px !important;
}

.studio-bottom-action-btn.btn-search {
  background: rgba(0, 240, 255, 0.15) !important;
  border-color: rgba(0, 240, 255, 0.45) !important;
  color: #67e8f9 !important;
}
.studio-bottom-action-btn.btn-search:hover {
  background: rgba(0, 240, 255, 0.28) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35) !important;
}

.studio-bottom-action-btn.btn-ai-edit {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.32), rgba(0, 240, 255, 0.28)) !important;
  border-color: rgba(0, 240, 255, 0.55) !important;
  color: #67e8f9 !important;
}
.studio-bottom-action-btn.btn-ai-edit:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(0, 240, 255, 0.45)) !important;
  color: #ffffff !important;
}

.studio-bottom-action-btn.btn-undo {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e2e8f0 !important;
}
.studio-bottom-action-btn.btn-undo:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.studio-bottom-action-btn.btn-save {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(0, 240, 255, 0.4)) !important;
  border-color: var(--neon-teal) !important;
  color: #ffffff !important;
  padding: 8px 18px !important;
  font-weight: 700 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35) !important;
}
.studio-bottom-action-btn.btn-save:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.55), rgba(0, 240, 255, 0.55)) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.55) !important;
}

.studio-bottom-action-btn.btn-redo {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e2e8f0 !important;
}
.studio-bottom-action-btn.btn-redo:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

.studio-bottom-action-btn.btn-cancel {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(244, 63, 94, 0.35) !important;
  color: #fda4af !important;
}
.studio-bottom-action-btn.btn-cancel:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  color: #ffffff !important;
}

.studio-bottom-action-btn:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Studio AI Assistant: Compact Floating Mini Popup (Freely Draggable on Mobile & Desktop) */
.studio-assistant-panel {
  position: absolute !important;
  right: 14px;
  left: auto;
  top: 12px;
  bottom: auto;
  width: 288px !important;
  max-width: min(300px, calc(100vw - 24px)) !important;
  height: auto !important;
  max-height: min(360px, calc(100% - 28px)) !important;
  flex: 0 0 auto !important;
  background: rgba(11, 14, 22, 0.98) !important;
  border: 1px solid rgba(0, 240, 255, 0.45) !important;
  border-radius: 14px !important;
  display: none !important;
  flex-direction: column !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 240, 255, 0.2) !important;
  overflow: hidden !important;
  z-index: 120 !important;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  contain: layout style !important;
}

.studio-assistant-panel.is-open {
  display: flex !important;
}

.studio-assistant-panel.is-body-collapsed {
  max-height: none !important;
  height: auto !important;
}

.studio-assistant-panel.is-body-collapsed .studio-assistant-body,
.studio-assistant-panel.is-body-collapsed .studio-endocrine-status-bar {
  display: none !important;
}

.studio-floating-drag-pill {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 18px !important;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.06), rgba(0, 240, 255, 0.18), rgba(0, 240, 255, 0.06)) !important;
  border-bottom: 1px solid rgba(0, 240, 255, 0.14) !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  flex-shrink: 0 !important;
}

.studio-floating-drag-pill .drag-pill-bar {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.7);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.studio-floating-drag-pill .drag-pill-hint {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(0, 240, 255, 0.75);
}

.studio-assistant-panel.is-dragging {
  transition: none !important;
  animation: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 240, 255, 0.45) !important;
  will-change: transform;
}

body.is-assistant-dragging #aiFileStudioFrame {
  pointer-events: none !important;
}

/* Surgical Edit Summary Card inside Tanya AI Bubble */
.surgical-edit-summary-card {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.surgical-edit-summary-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #00f0ff;
}

.surgical-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.surgical-edit-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(0, 240, 255, 0.16);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.surgical-edit-btn:hover {
  background: rgba(0, 240, 255, 0.3);
  color: #ffffff;
}

body.is-assistant-dragging,
body.is-assistant-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.is-assistant-dragging iframe,
body.is-assistant-dragging #aiFileStudioFrame {
  pointer-events: none !important;
}

/* Endocrine Code Button inside Studio Assistant */
.studio-endocrine-toggle-btn {
  background: rgba(0, 240, 255, 0.08) !important;
  border: 1px solid rgba(0, 240, 255, 0.3) !important;
  color: var(--neon-cyan) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.studio-endocrine-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.18) !important;
  border-color: var(--neon-cyan) !important;
}

.studio-endocrine-toggle-btn.is-off {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--text-dim) !important;
}

/* Endocrine Diagnostic Bar in Studio Assistant */
.studio-endocrine-status-bar {
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding: 5px 12px;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.studio-endocrine-status-bar.has-error {
  background: rgba(244, 63, 94, 0.12);
  border-bottom-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.studio-endocrine-status-bar .endocrine-status-content {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Claude-Code Style Autonomous Web Agent Loop HUD */
.studio-agent-loop-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.16), rgba(0, 240, 255, 0.14));
  border-bottom: 1px solid rgba(0, 240, 255, 0.35);
  font-size: 0.74rem;
  color: #e2e8f0;
  animation: slideDownSearch 0.25s ease-out;
}

/* Claude-Code Parallel Agent Swarm Banner & Interactive Subagent Pills */
.claude-swarm-banner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.claude-swarm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.claude-swarm-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #e2e8f0;
}
.claude-swarm-subagents {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.swarm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  transition: all 0.25s ease;
}
.swarm-pill .pill-badge {
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0.85;
}
.swarm-pill.idle {
  opacity: 0.5;
  border-color: rgba(255, 255, 255, 0.08);
  color: #64748b;
}
.swarm-pill.active {
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.28);
}
.swarm-pill.winner {
  border-color: #10b981;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.swarm-pill.verified {
  border-color: #38bdf8;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.15);
}
.swarm-pill.error {
  border-color: #f43f5e;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.2);
}
.swarm-pill.pill-architect.active {
  border-color: #38bdf8;
  color: #38bdf8;
}
.swarm-pill.pill-coder.active {
  border-color: #a855f7;
  color: #c084fc;
}
.swarm-pill.pill-speculator.active {
  border-color: #fbbf24;
  color: #fde047;
}
.swarm-pill.pill-verifier.active {
  border-color: #34d399;
  color: #6ee7b7;
}

.studio-agent-loop-hud.is-error {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.2), rgba(168, 85, 247, 0.15));
  border-bottom-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.studio-agent-loop-hud.is-success {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(0, 240, 255, 0.15));
  border-bottom-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.agent-loop-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-loop-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  animation: agentPulse 1.2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes agentPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 14px #a855f7, 0 0 8px #00f0ff; }
}

.btn-cancel-agent-loop {
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 4px;
  color: #fda4af;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-cancel-agent-loop:hover {
  background: rgba(244, 63, 94, 0.35);
  color: #ffffff;
}

.btn-heal-studio-error {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 4px;
  color: #00f0ff;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-heal-studio-error:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(168, 85, 247, 0.45));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

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

/* Eliminate Floating Minimized Pill Button */
.studio-assistant-panel.is-minimized {
  display: none !important;
}

.studio-assistant-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.studio-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 240, 255, 0.08);
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
  cursor: grab;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  flex-shrink: 0;
}

.studio-assistant-panel.is-dragging .studio-assistant-header,
.studio-assistant-panel.is-dragging .studio-floating-drag-pill {
  cursor: grabbing !important;
}

.studio-drag-grip {
  color: var(--neon-cyan, #00f0ff);
  font-size: 0.85rem;
  margin-right: 2px;
  cursor: grab;
  touch-action: none !important;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.studio-assistant-header:hover .studio-drag-grip {
  opacity: 1;
  color: var(--neon-cyan, #00f0ff);
}

.studio-assistant-header button,
.studio-assistant-header .gemini-pill-btn,
.studio-assistant-header .gemini-icon-btn {
  cursor: pointer;
  touch-action: none !important;
}

.studio-assistant-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-cyan, #00f0ff);
  touch-action: none !important;
  white-space: nowrap;
}

.studio-history-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  letter-spacing: 0.3px;
}

.studio-history-mode-badge.is-edit-mode {
  background: rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.55);
  color: #67e8f9;
}

.studio-assistant-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  touch-action: none !important;
}

.studio-assistant-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.studio-assistant-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  height: auto;
  color: var(--text-dim, #94a3b8);
  padding: 10px 8px;
  font-size: 0.74rem;
  line-height: 1.35;
}

.studio-assistant-empty i {
  font-size: 1.35rem;
  color: rgba(0, 240, 255, 0.45);
}

.studio-msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.studio-msg-row.user {
  align-items: flex-end;
}

.studio-msg-row.assistant {
  align-items: flex-start;
}

.studio-msg-bubble {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font-reading);
  font-size: 0.98rem;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: break-word;
}

.studio-msg-bubble p {
  margin: 0 0 8px 0;
}

.studio-msg-bubble p:last-child {
  margin-bottom: 0;
}

.studio-msg-bubble ul,
.studio-msg-bubble ol {
  margin: 6px 0 8px 0;
  padding-left: 20px;
}

.studio-msg-bubble ul {
  list-style-type: disc;
}

.studio-msg-bubble ol {
  list-style-type: decimal;
}

.studio-msg-bubble li {
  margin-bottom: 4px;
}

.studio-msg-row.user .studio-msg-bubble {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(0, 160, 255, 0.22));
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.15);
}

.studio-msg-row.assistant .studio-msg-bubble {
  background: rgba(18, 24, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main, #f1f5f9);
  border-bottom-left-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.studio-msg-bubble code {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 1px 5px;
  border-radius: 4px;
  color: #a5f3fc;
}

.studio-msg-bubble pre {
  margin: 6px 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 6px;
  font-size: 0.74rem;
  overflow-x: auto;
}

/* Mandat Kaisar: Gelembung Tanya AI & Edit Kode Studio 100% Kedap Bocor dari Tag / Kartu Kode Mentah */
.studio-assistant-panel .studio-msg-bubble pre,
.studio-assistant-panel .studio-msg-bubble code,
.studio-assistant-panel .studio-msg-bubble .code-header,
.studio-assistant-panel .studio-msg-bubble .code-actions-group,
.studio-assistant-panel .studio-msg-bubble .code-block-card,
.studio-assistant-panel .studio-msg-bubble .code-block-wrapper,
#studioAssistantPanel .studio-msg-bubble pre,
#studioAssistantPanel .studio-msg-bubble code,
#studioAssistantPanel .studio-msg-bubble .code-header,
#studioAssistantPanel .studio-msg-bubble .code-actions-group,
#studioAssistantPanel .studio-msg-bubble .code-block-card,
#studioAssistantPanel .studio-msg-bubble .code-block-wrapper {
  display: none !important;
}

.studio-chat-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.28);
  color: var(--neon-cyan, #00f0ff);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.18s ease;
}

.studio-chat-toggle-btn:hover,
.studio-chat-toggle-btn.active {
  background: rgba(0, 240, 255, 0.18);
  border-color: rgba(0, 240, 255, 0.6);
  color: #ffffff;
}

.gemini-studio-footnote,
.composer-gemini-footnote {
  display: none !important;
}

/* Fullscreen studio expansions */
.ai-file-studio-card.gemini-canvas-studio.is-fullscreen,
.ai-file-studio-card.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 1000000 !important;
}

.ai-file-studio-card.gemini-canvas-studio.is-fullscreen .gemini-studio-stage,
.ai-file-studio-card.is-fullscreen .gemini-studio-stage,
.ai-file-studio-card.is-fullscreen .modal-body {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

.ai-file-studio-card.is-fullscreen .studio-workspace-area {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.ai-file-studio-card.is-fullscreen .ai-file-studio-pane,
.ai-file-studio-card.is-fullscreen .gemini-studio-pane,
.ai-file-studio-card.is-fullscreen .ai-file-studio-code,
.ai-file-studio-card.is-fullscreen .gemini-studio-code {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
}

.ai-file-studio-card.is-fullscreen .studio-assistant-panel {
  position: absolute !important;
  width: 320px !important;
  max-width: min(340px, calc(100vw - 24px)) !important;
  max-height: min(440px, calc(100% - 28px)) !important;
  z-index: 100 !important;
}

@media (max-width: 768px) {
  .gemini-canvas-header,
  .gemini-studio-header {
    padding: 8px 12px;
    gap: 8px;
  }
  .gemini-canvas-title,
  .gemini-studio-title {
    max-width: 160px;
    font-size: 0.86rem;
  }
  .gemini-canvas-stage {
    height: 380px;
  }
  .gemini-segmented-toggle .seg-btn {
    padding: 4px 10px;
    font-size: 0.74rem;
  }
  .gemini-studio-backdrop {
    padding: 0 !important;
  }
  #aiFileStudioCode {
    padding-bottom: 92px !important;
  }
  .gemini-studio-footer {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 0 12px max(14px, env(safe-area-inset-bottom, 14px)) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    z-index: 50 !important;
    margin: 0 !important;
  }
  .studio-composer-box {
    max-width: 100% !important;
    padding: 7px 12px !important;
    border-radius: 16px !important;
    margin: 0 !important;
    pointer-events: auto !important;
  }
  .gemini-export-menu {
    max-width: calc(100vw - 24px) !important;
  }
}

@media (min-width: 769px) {
  .gemini-canvas-header-right .gemini-export-menu,
  .gemini-studio-header-right .gemini-export-menu {
    left: auto;
    right: 0;
  }
}

.youtube-preview-card {
  display: flex;
  background: rgba(14, 17, 27, 0.92);
  border: 1px solid rgba(255, 0, 77, 0.35);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 0, 77, 0.12);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 540px;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.youtube-preview-card:hover {
  border-color: rgba(255, 0, 77, 0.65);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 0, 77, 0.25);
  transform: translateY(-2px);
}

.yt-card-thumb-wrap {
  position: relative;
  width: 150px;
  min-width: 150px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.youtube-preview-card:hover .yt-card-thumb {
  transform: scale(1.05);
}

.yt-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 0, 51, 0.9);
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.yt-card-info {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 6px;
}

.yt-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-card-channel {
  font-size: 0.75rem;
  color: var(--neon-cyan, #00f0ff);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.yt-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm, 6px);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}


.open-yt-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main, #E2E8F0);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.open-yt-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

/* Tombol putar video langsung di dalam percakapan */
.play-chat-btn {
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.92), rgba(176, 38, 255, 0.85));
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(255, 0, 51, 0.3);
}

.play-chat-btn:hover {
  background: linear-gradient(135deg, rgba(255, 0, 51, 1), rgba(176, 38, 255, 1));
  box-shadow: 0 4px 14px rgba(255, 0, 51, 0.5);
  transform: translateY(-1px);
}

/* Overlay play di atas thumbnail */
.yt-thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 0, 51, 0.92);
  color: #FFFFFF;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  opacity: 0.88;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.yt-thumb-play:hover {
  transform: translate(-50%, -50%) scale(1.08);
  opacity: 1;
}

/* Player embed inline di dalam kartu */
.youtube-preview-card.yt-card-playing {
  flex-direction: column;
  max-width: 480px;
}

.yt-embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 190px;
  background: #000000;
}

.yt-embed-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Video sematan universal (Vimeo, TikTok, Facebook, dll.) — poster placeholder tanpa thumbnail */
.video-embed-card .video-provider-badge {
  background: rgba(0, 240, 255, 0.88);
  color: #04121a;
}

.video-embed-poster-ph {
  background: linear-gradient(135deg, #0b1020 0%, #1b1f3a 55%, #12263a 100%);
  min-height: 110px;
}

.video-embed-poster-icon {
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.18);
}

.video-embed-card .yt-thumb-play {
  background: rgba(0, 240, 255, 0.92);
  color: #04121a;
}

.custom-direct-video-card .video-provider-badge {
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #04121a;
}

.custom-direct-video-card .yt-thumb-play {
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #04121a;
}

.custom-direct-video-card .play-chat-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.9), rgba(112, 0, 255, 0.85));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.3);
}

.custom-direct-video-card .play-chat-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 1), rgba(112, 0, 255, 1));
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.5);
}

/* Video vertikal (TikTok / Instagram Reels): tinggi lebih besar agar tidak terpotong */
.yt-embed-frame.yt-embed-portrait {
  aspect-ratio: 9 / 14;
  max-height: 560px;
  min-height: 360px;
}

.custom-direct-video-card .yt-embed-frame video {
  display: block;
}

/* ==================== FULLSCREEN VIDEO YOUTUBE (perbaikan video kecil) ====================
   Akar masalah: saat iframe video di-fullscreen, CSS author (position:absolute;
   width:100%; height:100%) MENANG di atas UA stylesheet :-webkit-full-screen, sehingga
   iframe tetap berukuran seukuran kartu/container (mis. 200px) di atas layar hitam.
   Paksa ulang dimensi fullscreen ke viewport. */
.yt-embed-frame iframe:fullscreen,
.yt-embed-frame iframe:-webkit-full-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border: 0 !important;
  margin: 0 !important;
  z-index: 2147483647;
}

@media (max-width: 600px) {
  .youtube-preview-card {
    flex-direction: column;
    max-width: 100%;
  }
  .yt-card-thumb-wrap {
    width: 100%;
    min-width: 100%;
    height: 140px;
  }
}

/* ==================== AUTONOMOUS WEB EXPLORER STATUS ==================== */
.autonomous-tool-hud {
  display: none !important;
}

.autonomous-search-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--neon-teal);
  margin: 6px 0;
  animation: toolHudGlow 2s ease-in-out infinite alternate;
}

@keyframes toolHudGlow {
  0% { opacity: 0.82; }
  100% { opacity: 1; }
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(50%);
  }
  100% {
    transform: translateX(200%);
  }
}




/* ==== Generator tools live in the Attachment menu; composer row stays clean for the prompt ==== */
.composer-btn.image-gen-toggle,
.composer-btn.music-gen-toggle {
  display: none !important;
}
.image-model-menu-wrapper,
.music-model-menu-wrapper {
  width: 0;
  height: 0;
  min-width: 0;
  overflow: visible;
  margin: 0;
  padding: 0;
}

/* ==================== AI REASONING / THOUGHT PROCESS BLOCK (ZOZ GEMINI-INSPIRED STEPPER) ==================== */
.reasoning-block {
  margin: 0 0 10px 0;
  border-radius: 10px;
  border: none;
  background: transparent;
  overflow: visible;
  transition: opacity 0.2s ease;
}

.reasoning-block[open] {
  border: none;
  background: transparent;
}

.reasoning-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 8px;
  margin: 0 0 2px -8px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 0.89rem;
  color: var(--text-main, #f0f4fc);
  font-weight: 500;
  list-style: none;
  gap: 8px;
  outline: none;
  background: transparent;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.reasoning-summary:hover {
  background: rgba(148, 163, 184, 0.12);
}

.reasoning-summary::-webkit-details-marker {
  display: none;
}

.reasoning-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.zoz-cot-spark-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--neon-cyan, #38bdf8);
  opacity: 0.92;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.zoz-cot-spark-icon.is-streaming {
  animation: zozSparkPulse 1.8s ease-in-out infinite;
}

@keyframes zozSparkPulse {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.zoz-cot-summary-meta {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
  opacity: 0.82;
}

.zoz-cot-chevron {
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  opacity: 0.78;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-left: 1px;
}

.reasoning-block[open] .zoz-cot-chevron {
  transform: rotate(90deg);
}

.reasoning-badge {
  display: none;
}

.reasoning-content {
  padding: 6px 0 6px 2px;
  border-top: none;
  font-family: var(--font-reading);
  font-size: 0.89rem;
  line-height: 1.56;
  color: var(--text-secondary, #cbd5e1);
  max-height: 460px;
  overflow-y: auto;
}

.reasoning-content p {
  margin: 4px 0;
}

/* ==================== COMPACT VERTICAL STEPPER RAIL (LIVE & EXPANDED) ==================== */
.zoz-cot-timeline,
.zoz-cot-timeline.zoz-claude-code-cot {
  margin: 0 0 8px 0;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  max-width: 100%;
}

body.light-theme .zoz-cot-timeline,
body.light-theme .zoz-cot-timeline.zoz-claude-code-cot {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.zoz-cc-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
  border: none;
  color: #fdba74;
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.light-theme .zoz-cc-engine-pill {
  background: rgba(255, 237, 213, 0.88);
  border: none;
  color: #c2410c;
}

.zoz-cc-subagent-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.14);
  border: none;
  color: #e9d5ff;
}

body.light-theme .zoz-cc-subagent-pill {
  background: rgba(243, 232, 255, 0.88);
  border: none;
  color: #7e22ce;
}

.zoz-cot-timeline[open] + .zoz-cot-live-rail {
  display: none;
}

.zoz-cot-live-rail {
  display: flex;
  flex-direction: column;
  margin: 2px 0 12px 2px;
  padding: 0;
}

.zoz-cot-rail-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 5px 0 9px 0;
  min-width: 0;
}

.zoz-cot-rail-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9.5px;
  top: 25px;
  bottom: -2px;
  width: 1.5px;
  background: rgba(148, 163, 184, 0.24);
  pointer-events: none;
}

.zoz-cot-rail-node {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.zoz-cot-rail-item.is-past {
  opacity: 0.56;
}

.zoz-cot-rail-item.is-active {
  opacity: 1;
}

.zoz-cot-rail-item.is-active .zoz-cot-rail-node {
  color: var(--neon-cyan, #38bdf8);
  animation: zozSparkPulse 1.6s ease-in-out infinite;
}

.zoz-cot-rail-item.is-running .zoz-cot-rail-node {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.12);
}

.zoz-cot-rail-item.is-running.is-weather .zoz-cot-rail-node {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.14);
}

.zoz-cot-rail-item.is-web .zoz-cot-rail-node {
  color: #38bdf8;
}

.zoz-cot-rail-item.is-memory .zoz-cot-rail-node {
  color: #a78bfa;
}

.zoz-cot-rail-item.is-code .zoz-cot-rail-node {
  color: #34d399;
}

.zoz-cot-rail-item.is-weather .zoz-cot-rail-node {
  color: #fbbf24;
}

.zoz-cot-rail-item.is-error-note .zoz-cot-rail-node {
  color: #f59e0b;
}

.zoz-cot-rail-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.46;
  color: var(--text-main, #f0f4fc);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.zoz-cot-rail-item.is-past .zoz-cot-rail-text {
  color: var(--text-secondary, #94a3b8);
}

.zoz-cot-rail-item.is-active .zoz-cot-rail-text {
  font-weight: 500;
}

/* Expanded Detailed Drawer: Sleek vertical spine instead of heavy card boxes */
.zoz-cot-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 2px;
}

.zoz-cot-step {
  position: relative;
  padding: 4px 4px 12px 26px;
  border: none;
  border-radius: 0;
  background: transparent;
}

.zoz-cot-step::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.78);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14);
}

.zoz-cot-step.is-interleaved::before {
  background: rgba(56, 189, 248, 0.88);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.zoz-cot-step.is-final::before {
  background: rgba(52, 211, 153, 0.88);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.zoz-cot-step.is-running-step::before {
  background: rgba(56, 189, 248, 0.96);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
  animation: zozSparkPulse 1.4s ease-in-out infinite;
}

.zoz-claude-code-cot .zoz-cot-step.is-running-step::before {
  background: rgba(251, 146, 60, 0.96);
  box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.22);
}

.zoz-cot-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 9.25px;
  top: 22px;
  bottom: -4px;
  width: 1.5px;
  background: rgba(148, 163, 184, 0.22);
}

.zoz-cot-step-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.zoz-cot-step-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #c4b5fd;
}

.zoz-cot-step.is-interleaved .zoz-cot-step-label {
  color: #7dd3fc;
}

.zoz-cot-step.is-final .zoz-cot-step-label {
  color: #6ee7b7;
}

.zoz-cot-step-phase {
  font-size: 0.69rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.zoz-cot-step-thought {
  font-size: 0.86rem;
  line-height: 1.56;
  color: var(--text-secondary, #cbd5e1);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.zoz-cot-step-thought p:first-child {
  margin-top: 0;
}

.zoz-cot-step-thought p:last-child {
  margin-bottom: 0;
}

.zoz-cot-step-tools {
  margin-top: 7px;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.zoz-cot-tool-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 0.78rem;
}

.zoz-cot-tool-call {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-main, #f0f4fc);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.zoz-cot-tool-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.71rem;
  color: var(--text-muted, #94a3b8);
  background: rgba(148, 163, 184, 0.1);
  border: none;
  padding: 1px 6px;
  border-radius: 5px;
  opacity: 0.88;
}

.zoz-cot-tool-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.zoz-cot-tool-status.is-running {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.zoz-cot-tool-status.is-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}

.zoz-cot-tool-status.is-error {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.zoz-cot-tool-outcome {
  position: relative;
  width: 100%;
  font-size: 0.74rem;
  line-height: 1.44;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  padding-left: 16px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.zoz-cot-tool-outcome:not(.zoz-z21-agent-finding-leaf)::before {
  content: '↳';
  position: absolute;
  left: 3px;
  top: 0;
  font-size: 0.72rem;
  opacity: 0.72;
}

body.light-theme .reasoning-summary {
  color: #0f172a;
}

body.light-theme .reasoning-summary:hover {
  background: rgba(15, 23, 42, 0.06);
}

body.light-theme .zoz-cot-spark-icon {
  color: #0284c7;
}

body.light-theme .zoz-cot-summary-meta,
body.light-theme .zoz-cot-chevron {
  color: #475569;
}

body.light-theme .zoz-cot-rail-item:not(:last-child)::after,
body.light-theme .zoz-cot-step:not(:last-child)::after {
  background: rgba(15, 23, 42, 0.14);
}

body.light-theme .zoz-cot-rail-text {
  color: #0f172a;
}

body.light-theme .zoz-cot-rail-item.is-past .zoz-cot-rail-text {
  color: #475569;
}

body.light-theme .zoz-cot-rail-item.is-active .zoz-cot-rail-node {
  color: #0284c7;
}

body.light-theme .zoz-cot-step {
  background: transparent;
}

body.light-theme .zoz-cot-step-label {
  color: #6d28d9;
}

body.light-theme .zoz-cot-step.is-interleaved .zoz-cot-step-label {
  color: #0369a1;
}

body.light-theme .zoz-cot-step.is-final .zoz-cot-step-label {
  color: #047857;
}

body.light-theme .zoz-cot-step-phase {
  background: rgba(15, 23, 42, 0.07);
  color: #475569;
}

body.light-theme .zoz-cot-step-thought {
  color: #1e293b;
}

body.light-theme .zoz-cot-tool-item {
  background: transparent;
  border: none;
}

body.light-theme .zoz-cot-tool-call {
  color: #0f172a;
}

body.light-theme .zoz-cot-tool-code {
  color: #475569;
}

body.light-theme .zoz-cot-tool-status.is-running {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
}

body.light-theme .zoz-cot-tool-status.is-ok {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

body.light-theme .zoz-cot-tool-status.is-error {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

body.light-theme .zoz-cot-tool-outcome {
  color: #475569;
}

.reasoning-only-notice {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.25);
  color: var(--neon-amber, #fbbf24);
  font-size: 0.94rem;
  line-height: 1.55;
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ==================== TOP NAV ACTIVE TOOL SELECTOR PILL ==================== */
.top-nav-active-tool-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  animation: fadeInToolPill 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

@keyframes fadeInToolPill {
  from {
    opacity: 0;
    transform: scale(0.92) translateX(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

.top-nav-active-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(14, 20, 36, 0.95), rgba(20, 28, 52, 0.98));
  border: 1px solid rgba(255, 0, 127, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 0, 127, 0.15);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  max-width: 280px;
}

.top-nav-active-tool-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 0, 127, 0.3);
}

.top-nav-active-tool-wrap.tool-theme-image .top-nav-active-tool-chip {
  border-color: rgba(255, 0, 127, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 0, 127, 0.2);
}
.top-nav-active-tool-wrap.tool-theme-image .top-nav-active-tool-chip:hover {
  border-color: #FF007F;
  box-shadow: 0 6px 18px rgba(255, 0, 127, 0.35);
}
.top-nav-active-tool-wrap.tool-theme-image .top-nav-tool-icon-wrap {
  color: #FF007F;
}

.top-nav-active-tool-wrap.tool-theme-photo .top-nav-active-tool-chip {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(168, 85, 247, 0.2);
}
.top-nav-active-tool-wrap.tool-theme-photo .top-nav-active-tool-chip:hover {
  border-color: #c084fc;
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.35);
}
.top-nav-active-tool-wrap.tool-theme-photo .top-nav-tool-icon-wrap {
  color: #c084fc;
}

.top-nav-active-tool-wrap.tool-theme-music .top-nav-active-tool-chip {
  border-color: rgba(0, 255, 194, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 255, 194, 0.2);
}
.top-nav-active-tool-wrap.tool-theme-music .top-nav-active-tool-chip:hover {
  border-color: var(--neon-teal);
  box-shadow: 0 6px 18px rgba(0, 255, 194, 0.35);
}
.top-nav-active-tool-wrap.tool-theme-music .top-nav-tool-icon-wrap {
  color: var(--neon-teal);
}


.top-nav-tool-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.top-nav-tool-name {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-main);
  white-space: nowrap;
}

.top-nav-tool-model-badge {
  font-family: var(--font-code);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav-tool-chevron {
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.top-nav-active-tool-chip[aria-expanded="true"] .top-nav-tool-chevron {
  transform: rotate(180deg);
}

.top-nav-tool-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.65rem;
}

.top-nav-tool-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.1);
}

/* Dropdown popups dropping down from top navbar */
.top-nav-active-tool-wrap .image-model-dropdown-popup,
.top-nav-active-tool-wrap .music-model-dropdown-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  bottom: auto;
  z-index: 950;
  min-width: 320px;
  max-width: 380px;
  max-height: min(520px, calc(86vh - 60px));
}

/* Hidden composer mode cards (model changer moved to top nav to avoid crowding prompt) */
.composer-active-mode-card {
  display: none !important;
}

/* Compact Partial-Width Floating Mini-Card for Photo Edit Reference */
.photo-edit-ref-card {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: min(360px, 92vw);
  align-self: flex-start;
  gap: 10px;
  margin: 0 0 8px 4px;
  padding: 5px 10px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: var(--radius-md, 12px);
  background: rgba(14, 18, 32, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(168, 85, 247, 0.18);
  animation: modeCardSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 10;
}

@keyframes modeCardSlideDown {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.photo-edit-ref-thumb-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.5);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.photo-edit-ref-thumb-wrap:hover {
  transform: scale(1.04);
}

.photo-edit-ref-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-edit-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #38bdf8;
  font-size: 0.8rem;
}

.photo-edit-ref-thumb-wrap:hover .photo-edit-thumb-overlay {
  opacity: 1;
}

.photo-edit-ref-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.photo-edit-title-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.02em;
}

.photo-edit-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.photo-edit-change-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.photo-edit-change-photo-btn:hover {
  background: rgba(56, 189, 248, 0.32);
  border-color: #7dd3fc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.photo-edit-change-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.photo-edit-change-model-btn:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: #d8b4fe;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.photo-edit-cancel-btn {
  background: transparent;
  border: 1px solid rgba(255, 85, 85, 0.35);
  color: var(--text-dim);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.18s ease;
  flex-shrink: 0;
  margin-left: 2px;
}

.photo-edit-cancel-btn:hover {
  background: rgba(255, 85, 85, 0.2);
  border-color: #ff5555;
  color: #ff5555;
  box-shadow: 0 0 8px rgba(255, 85, 85, 0.4);
}

@media (max-width: 768px) {
  .top-nav-tool-name {
    display: none;
  }
  .top-nav-tool-model-badge {
    max-width: 95px;
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-nav-active-tool-chip {
    padding: 3px 8px;
    gap: 5px;
    max-width: 140px;
    flex-shrink: 1;
    min-width: 0;
  }
  .top-nav-active-tool-wrap {
    flex-shrink: 1;
    min-width: 0;
    margin-left: 2px;
  }
  .top-nav-active-tool-wrap .image-model-dropdown-popup,
  .top-nav-active-tool-wrap .music-model-dropdown-popup {
    position: fixed;
    top: 50px;
    left: 10px;
    right: 10px;
    width: auto;
    min-width: 0;
    max-width: calc(100vw - 20px);
    max-height: min(520px, calc(100dvh - 76px));
    margin: 0 auto;
  }
  .photo-edit-change-photo-btn span,
  .photo-edit-change-model-btn span {
    display: none;
  }
}

@media (max-width: 600px) {
  .top-nav-right {
    gap: 4px;
    flex-shrink: 0;
  }
  .model-picker-chip {
    padding: 3px 6px;
    gap: 4px;
  }
  .current-model-name {
    max-width: 65px;
    font-size: 0.7rem;
  }
  .top-action-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

/* Chat Message Row Performance Containment (Only renders visible messages on screen) */
.message-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 90px;
}

/* Page Visibility Optimization (Zero battery & GPU drain when tab/app hidden) */
body.page-paused *,
body.page-paused *::before,
body.page-paused *::after {
  animation-play-state: paused !important;
}

/* ==================== VIDEO SEARCH & CUSTOM URL MENU ==================== */
.video-search-menu-wrapper {
  position: relative;
  display: none !important;
  align-items: center;
}

.video-search-toggle {
  position: relative;
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.video-search-toggle:hover {
  color: #FF0033;
  border-color: rgba(255, 0, 51, 0.4);
  background: rgba(255, 0, 51, 0.08);
}

.video-search-toggle.active {
  color: #FF0033;
  border-color: rgba(255, 0, 51, 0.6);
  background: rgba(255, 0, 51, 0.15);
  box-shadow: 0 0 12px rgba(255, 0, 51, 0.35);
}

.video-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #FF0033;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 0, 51, 0.6);
  line-height: 1.1;
  pointer-events: none;
}

.attach-item-action-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ==================== BIO-ENDOCRINE HORMONE TELEMETRY ==================== */
.endocrine-pulse-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.endocrine-pulse-btn #endocrineHeartIcon {
  font-size: 0.96rem;
  color: #00FFC2;
  transition: all 0.25s ease;
  display: inline-block;
  transform-origin: center center;
}

/* Happy / High Dopamine State (Healthy Green Heart Pulse) */
.endocrine-pulse-btn.status-happy {
  border: 1px solid rgba(0, 255, 194, 0.4) !important;
  background: rgba(0, 255, 194, 0.08) !important;
}
.endocrine-pulse-btn.status-happy:hover {
  background: rgba(0, 255, 194, 0.18) !important;
  box-shadow: 0 0 12px rgba(0, 255, 194, 0.4) !important;
}
.endocrine-pulse-btn.status-happy #endocrineHeartIcon {
  color: #00FFC2 !important;
  animation: organicPulseHappy 2.2s infinite ease-in-out;
  filter: drop-shadow(0 0 4px rgba(0, 255, 194, 0.6));
}

/* Stressed State (Elevated Cortisol / Amber Warning) */
.endocrine-pulse-btn.status-stressed {
  border: 1px solid rgba(255, 183, 3, 0.5) !important;
  background: rgba(255, 183, 3, 0.12) !important;
}
.endocrine-pulse-btn.status-stressed:hover {
  background: rgba(255, 183, 3, 0.22) !important;
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.5) !important;
}
.endocrine-pulse-btn.status-stressed #endocrineHeartIcon {
  color: #FFB703 !important;
  animation: organicPulseStressed 1.1s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(255, 183, 3, 0.7));
}

/* Critical / Severe Stress State (Bug / Crimson Heart Warning) */
.endocrine-pulse-btn.status-critical {
  border: 1px solid rgba(255, 0, 85, 0.7) !important;
  background: rgba(255, 0, 85, 0.18) !important;
  animation: criticalVibration 0.35s infinite alternate ease-in-out;
}
.endocrine-pulse-btn.status-critical:hover {
  background: rgba(255, 0, 85, 0.28) !important;
  box-shadow: 0 0 18px rgba(255, 0, 85, 0.7) !important;
}
.endocrine-pulse-btn.status-critical #endocrineHeartIcon {
  color: #FF0055 !important;
  animation: organicPulseCritical 0.55s infinite ease-in-out;
  filter: drop-shadow(0 0 8px rgba(255, 0, 85, 0.8));
}

@keyframes organicPulseHappy {
  0%, 100% { transform: scale(1); opacity: 0.88; filter: drop-shadow(0 0 3px rgba(0, 255, 194, 0.5)); }
  50% { transform: scale(1.24); opacity: 1; filter: drop-shadow(0 0 10px #00FFC2); }
}

@keyframes organicPulseStressed {
  0%, 100% { transform: scale(0.95); opacity: 0.8; filter: drop-shadow(0 0 4px rgba(255, 183, 3, 0.6)); }
  50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 12px #FFB703); }
}

@keyframes organicPulseCritical {
  0%, 100% { transform: scale(0.9); opacity: 0.7; filter: drop-shadow(0 0 6px rgba(255, 0, 85, 0.7)); }
  50% { transform: scale(1.4); opacity: 1; filter: drop-shadow(0 0 16px #FF0055); }
}

@keyframes criticalVibration {
  0% { transform: translateX(-1px); }
  100% { transform: translateX(1px); }
}

/* ==================== BIO-ENDOCRINE TELEMETRY UTILITARIAN UI (v341) ==================== */
.endocrine-modal-card {
  max-width: 768px !important;
  width: 100% !important;
  background: #0e1117 !important;
  border: 1px solid #27272a !important;
  border-radius: 8px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75) !important;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
  font-size: 12px !important;
  color: #d1d5db !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 90vh !important;
}

@media (max-width: 640px) {
  .endocrine-modal-card {
    max-width: calc(100vw - 16px) !important;
    max-height: 94vh !important;
    margin: 8px auto !important;
    font-size: 11px !important;
  }
}

.endocrine-modal-card * {
  box-sizing: border-box;
}

/* 1. Header */
.endocrine-util-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #131720;
  border-bottom: 1px solid #27272a;
  user-select: none;
}

.endocrine-util-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.endocrine-util-title {
  color: #f4f4f5;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 13px;
}

.endocrine-util-sep {
  color: #52525b;
}

.endocrine-util-status {
  color: #34d399;
  font-weight: 600;
  letter-spacing: 0.025em;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.endocrine-util-square {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #34d399;
}

.endocrine-util-close-btn {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid transparent;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.endocrine-util-close-btn:hover {
  color: #ffffff;
  background: #27272a;
  border-color: #3f3f46;
}

/* 2. Main Body */
.endocrine-util-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(90vh - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #0e1117;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .endocrine-util-body {
    padding: 12px 14px !important;
    gap: 12px !important;
  }
}

/* Tabs */
.endocrine-util-tabs {
  display: flex;
  align-items: stretch;
  border: 1px solid #27272a;
  background: #0a0d12;
  padding: 4px;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  user-select: none;
}

.endocrine-util-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  color: #a1a1aa;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.endocrine-util-tab:hover {
  color: #e4e4e7;
  background: rgba(24, 24, 27, 0.6);
}

.endocrine-util-tab.active {
  background: #27272a;
  color: #f4f4f5;
  border-color: rgba(63, 63, 70, 0.8);
}

.endocrine-util-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #52525b;
}

.endocrine-util-tab.active .endocrine-util-tab-dot {
  background: #34d399;
}

.endocrine-util-tab-badge {
  padding: 1px 6px;
  font-size: 10px;
  background: #18181b;
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: normal;
}

/* Sections */
.endocrine-util-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.endocrine-util-sec-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #71717a;
  font-weight: 600;
}

.endocrine-util-box {
  border: 1px solid #27272a;
  background: #0a0d12;
}

.endocrine-util-box.divide-y > * + * {
  border-top: 1px solid rgba(39, 39, 42, 0.8);
}

#endocrineIsolatedBox {
  border: 1px solid #27272a;
  background: #0a0d12;
  display: none;
  flex-direction: column !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 12px;
  gap: 12px;
  overflow: hidden;
}

#endocrineIsolatedBox.has-issues {
  display: flex !important;
  flex-direction: column !important;
}

/* Pipeline Rows */
.endocrine-util-pipeline-row {
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease;
}

@media (min-width: 640px) {
  .endocrine-util-pipeline-row {
    flex-direction: row;
    align-items: center;
  }
}

.endocrine-util-pipeline-row:hover {
  background: rgba(24, 24, 27, 0.4);
}

.pipeline-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-num {
  color: #34d399;
  font-weight: 700;
}

.pipeline-name {
  color: #e4e4e7;
  font-weight: 600;
}

.pipeline-desc {
  color: #71717a;
}

.pipeline-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: #a1a1aa;
  font-size: 11px;
}

.pipeline-right strong {
  color: #e4e4e7;
  font-weight: normal;
}

.pipeline-status {
  color: #34d399;
  font-weight: 600;
}

.pipeline-status.off {
  color: #71717a;
}

/* Gauges Grid */
.endocrine-util-gauges-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .endocrine-util-gauges-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.endocrine-util-gauge-card {
  padding: 12px;
  background: #0a0d12;
  border: 1px solid #27272a;
}

.gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.gauge-title {
  font-weight: 700;
  color: #e4e4e7;
}

.gauge-val-opt {
  color: #34d399;
  font-weight: 700;
}

.gauge-val-clear {
  color: #a1a1aa;
  font-weight: 700;
}

.gauge-val-warn {
  color: #fbbf24;
  font-weight: 700;
}

.gauge-val-crit {
  color: #f87171;
  font-weight: 700;
}

.ascii-gauge-bar {
  letter-spacing: 0.1em;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 0;
  user-select: none;
}

.ascii-gauge-bar.text-emerald {
  color: #34d399;
}

.ascii-gauge-bar.text-zinc {
  color: #52525b;
}

.ascii-gauge-bar.text-amber {
  color: #fbbf24;
}

.ascii-gauge-bar.text-rose {
  color: #f87171;
}

.gauge-caption {
  font-size: 11px;
  color: #71717a;
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Vitals Summary */
.endocrine-util-vitals-summary {
  padding: 10px 14px;
  background: #11141c;
  border: 1px solid #27272a;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #d1d5db;
}

.endocrine-util-vitals-summary strong,
.endocrine-util-vitals-summary span {
  font-weight: 600;
}

/* 5-Pillar List */
.endocrine-util-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-pass-badge {
  font-size: 11px;
  color: #34d399;
  font-weight: 600;
}

.endocrine-pillar-row {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.endocrine-pillar-row:hover {
  background: rgba(24, 24, 27, 0.4);
}

.pillar-name {
  color: #d1d5db;
}

.pillar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pillar-metric {
  color: #71717a;
  font-size: 11px;
}

.pillar-status {
  font-weight: 700;
  color: #34d399;
}

.pillar-status.status-warn {
  color: #fbbf24;
}

.pillar-status.status-crit {
  color: #f87171;
}

/* Footer */
.endocrine-util-footer {
  padding: 12px 16px;
  background: #131720;
  border-top: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

@media (min-width: 640px) {
  .endocrine-util-footer {
    flex-direction: row;
    align-items: center;
  }
}

.endocrine-footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a1a1aa;
  font-size: 11px;
  flex-wrap: wrap;
}

.endocrine-footer-status .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
  flex-shrink: 0;
}

.endocrine-footer-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.endocrine-util-btn {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-util-copy {
  background: #18181b;
  color: #d1d5db;
  border-color: #3f3f46;
}

.btn-util-copy:hover {
  background: #27272a;
  color: #ffffff;
}

.btn-util-heal {
  background: #18181b;
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.6);
  font-weight: 600;
}

.btn-util-heal:hover {
  background: #27272a;
  color: #fef08a;
}

.btn-util-close {
  background: #27272a;
  color: #e4e4e7;
  border-color: #52525b;
}

.btn-util-close:hover {
  background: #3f3f46;
  color: #ffffff;
}

.endocrine-gauges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .endocrine-gauges-grid {
    grid-template-columns: 1fr;
  }
}

.endocrine-gauge-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-dopamine {
  border-color: rgba(0, 255, 194, 0.25);
  background: linear-gradient(180deg, rgba(0, 255, 194, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.card-cortisol {
  border-color: rgba(255, 0, 85, 0.25);
  background: linear-gradient(180deg, rgba(255, 0, 85, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.gauge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gauge-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gauge-val {
  font-family: var(--font-code);
  font-size: 1.1rem;
  font-weight: 800;
}
.card-dopamine .gauge-val { color: #00FFC2; }
.card-cortisol .gauge-val { color: #FF4D4D; }

.gauge-track {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.gauge-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-dopamine {
  background: linear-gradient(90deg, #00F0FF, #00FFC2);
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.6);
}

.fill-cortisol {
  background: linear-gradient(90deg, #FFB703, #FF0055);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.6);
}

.gauge-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.endocrine-vitals-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.vital-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vital-label { color: var(--text-dim); }
.vital-item strong { color: #FFF; font-family: var(--font-code); }

/* ==================== BIO-ENDOCRINE 5-PILLAR DIAGNOSTIC SYSTEM ==================== */
.endocrine-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.endocrine-pillar-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.endocrine-pillar-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.endocrine-pillar-card .pillar-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.endocrine-pillar-card.status-healthy {
  border-color: rgba(0, 255, 194, 0.25);
}
.endocrine-pillar-card.status-healthy .pillar-icon {
  background: rgba(0, 255, 194, 0.12);
  color: #00FFC2;
}

.endocrine-pillar-card.status-warning {
  border-color: rgba(255, 183, 3, 0.35);
}
.endocrine-pillar-card.status-warning .pillar-icon {
  background: rgba(255, 183, 3, 0.15);
  color: #FFB703;
}

.endocrine-pillar-card.status-critical {
  border-color: rgba(255, 77, 77, 0.45);
}
.endocrine-pillar-card.status-critical .pillar-icon {
  background: rgba(255, 77, 77, 0.15);
  color: #FF4D4D;
}

.endocrine-pillar-card .pillar-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.endocrine-pillar-card .pillar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFF;
}

.endocrine-subtabs-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  width: 100% !important;
  margin: 4px 0 8px 0 !important;
}

.endocrine-subtab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #a1a1aa;
  font-size: 0.72rem;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.endocrine-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.endocrine-subtab-btn.active {
  background: rgba(0, 255, 194, 0.15);
  border-color: rgba(0, 255, 194, 0.5);
  color: #00FFC2;
  font-weight: 600;
}

.endocrine-diagnostic-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 4px !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.endocrine-issue-item {
  background: rgba(10, 13, 18, 0.75);
  border: 1px solid rgba(39, 39, 42, 0.9);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.btn-copy-issue-entry,
.btn-dismiss-issue-entry {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #a1a1aa;
  font-size: 10px;
  padding: 2px 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-copy-issue-entry:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-dismiss-issue-entry:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.endocrine-issue-item.severity-high {
  border-left: 3px solid #FF4D4D;
  background: rgba(255, 77, 77, 0.05);
}

.endocrine-issue-item.severity-medium {
  border-left: 3px solid #FFB703;
  background: rgba(255, 183, 3, 0.05);
}

.endocrine-issue-item.severity-low {
  border-left: 3px solid var(--neon-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.endocrine-issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.endocrine-issue-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-model { background: rgba(255, 82, 0, 0.2); color: var(--neon-amber); }
.badge-text { background: rgba(168, 85, 247, 0.2); color: #C084FC; }
.badge-tool { background: rgba(0, 242, 254, 0.2); color: #00F2FE; }
.badge-hallucination { background: rgba(244, 63, 94, 0.2); color: #FB7185; }
.badge-viewport { background: rgba(59, 130, 246, 0.2); color: #60A5FA; }
.badge-button { background: rgba(244, 63, 94, 0.2); color: #FB7185; }
.badge-connectome { background: rgba(20, 184, 166, 0.2); color: #2DD4BF; }
.badge-gateway { background: rgba(16, 185, 129, 0.2); color: #34D399; }

.endocrine-issue-time {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.endocrine-issue-body {
  color: var(--text-main);
  line-height: 1.4;
}

.endocrine-issue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.endocrine-issue-snippet {
  font-family: var(--font-code);
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: #FFD166;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.endocrine-isolated-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.endocrine-isolated-box.has-issues {
  border-color: rgba(255, 183, 3, 0.5);
  background: rgba(255, 183, 3, 0.08);
}

.isolated-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.isolated-status-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.tag-healthy {
  background: rgba(0, 255, 194, 0.15);
  color: #00FFC2;
  border: 1px solid rgba(0, 255, 194, 0.4);
}

.tag-warning {
  background: rgba(255, 183, 3, 0.18);
  color: #FFB703;
  border: 1px solid rgba(255, 183, 3, 0.5);
}

.isolated-box-content {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.endocrine-logs-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.endocrine-logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.endocrine-logs-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.endocrine-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
}

.endocrine-log-entry.log-dopamine {
  border-left-color: #00FFC2;
}

.endocrine-log-entry.log-cortisol {
  border-left-color: #FF0055;
  background: rgba(255, 0, 85, 0.06);
}

.endocrine-log-entry.log-endorphin {
  border-left-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.log-time {
  font-family: var(--font-code);
  color: var(--text-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.log-badge {
  font-weight: 700;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.log-dopamine .log-badge {
  background: rgba(0, 255, 194, 0.15);
  color: #00FFC2;
}
.log-cortisol .log-badge {
  background: rgba(255, 0, 85, 0.2);
  color: #FF4D4D;
}
.log-endorphin .log-badge {
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-cyan);
}

.log-msg {
  color: var(--text-main);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy-log-entry {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  margin-left: auto;
  opacity: 0.55;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  flex-shrink: 0;
}
.btn-copy-log-entry:hover {
  opacity: 1;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
}

.btn-copy-issue-entry {
  background: transparent;
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--neon-cyan);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  margin-left: auto;
  opacity: 0.85;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  flex-shrink: 0;
}
.btn-copy-issue-entry:hover {
  opacity: 1;
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
}

/* Dual-Channel Endocrine & ChatEndocrine V2 Styles */
.endocrine-channels-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 680px) {
  .endocrine-channels-bar {
    grid-template-columns: 1fr;
  }
}

.endocrine-channel-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.25s ease;
}

.endocrine-channel-card.active {
  border-color: rgba(0, 255, 194, 0.35);
  background: linear-gradient(135deg, rgba(0, 255, 194, 0.05) 0%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: 0 0 16px rgba(0, 255, 194, 0.08);
}

.endocrine-channel-card#cardChannelChat.active {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.07) 0%, rgba(0, 0, 0, 0.5) 100%);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.1);
}

.channel-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.channel-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.channel-icon-box.code-accent {
  background: rgba(0, 255, 194, 0.12);
  color: #00FFC2;
  border: 1px solid rgba(0, 255, 194, 0.3);
}

.channel-icon-box.chat-accent {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
  flex-wrap: wrap;
}

.channel-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}

.badge-code {
  background: rgba(0, 255, 194, 0.15);
  color: #00FFC2;
  border: 1px solid rgba(0, 255, 194, 0.3);
}

.badge-chat {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.channel-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Cyberpunk Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #888;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.switch-toggle input:checked + .slider-round {
  background-color: rgba(0, 255, 194, 0.25);
  border-color: #00FFC2;
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.3);
}

.switch-toggle input:checked + .slider-round:before {
  transform: translateX(20px);
  background-color: #00FFC2;
  box-shadow: 0 0 8px #00FFC2;
}

#cardChannelChat .switch-toggle input:checked + .slider-round {
  background-color: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

#cardChannelChat .switch-toggle input:checked + .slider-round:before {
  background-color: #f43f5e;
  box-shadow: 0 0 8px #f43f5e;
}

/* Tabs Navigation */
.endocrine-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.endocrine-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.endocrine-tab-btn:hover {
  color: #FFF;
  background: rgba(255, 255, 255, 0.04);
}

.endocrine-tab-btn.active {
  color: #FFF;
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.chat-endocrine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 6px #f43f5e;
  display: inline-block;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ChatEndocrine Gauge Cards */
.card-oxytocin {
  border-color: rgba(244, 63, 94, 0.25);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
}
.card-oxytocin .gauge-val { color: #f43f5e; }

.fill-oxytocin {
  background: linear-gradient(90deg, #ec4899, #f43f5e);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.card-chat-dopamine {
  border-color: rgba(245, 158, 11, 0.25);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
}
.card-chat-dopamine .gauge-val { color: #f59e0b; }

.fill-chat-dopamine {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* Synthetic Biological Emotional Nervous System Gauges (Sakit, Senang, Bahagia, Marah) */
.card-emotion-sakit {
  border-color: rgba(244, 63, 94, 0.3);
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.08) 0%, rgba(0, 0, 0, 0.45) 100%);
}
.card-emotion-sakit .gauge-val { color: #f43f5e; }
.fill-emotion-sakit {
  background: linear-gradient(90deg, #fb7185, #f43f5e);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
}

.card-emotion-senang {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(0, 0, 0, 0.45) 100%);
}
.card-emotion-senang .gauge-val { color: #f59e0b; }
.fill-emotion-senang {
  background: linear-gradient(90deg, #fcd34d, #f59e0b);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.card-emotion-bahagia {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(0, 0, 0, 0.45) 100%);
}
.card-emotion-bahagia .gauge-val { color: #10b981; }
.fill-emotion-bahagia {
  background: linear-gradient(90deg, #6ee7b7, #10b981);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.card-emotion-marah {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(0, 0, 0, 0.45) 100%);
}
.card-emotion-marah .gauge-val { color: #ef4444; }
.fill-emotion-marah {
  background: linear-gradient(90deg, #f87171, #ef4444);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Log Entries for ChatEndocrine */
.endocrine-log-entry.log-sakit {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.06);
}
.log-sakit .log-badge {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.endocrine-log-entry.log-senang {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}
.log-senang .log-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.endocrine-log-entry.log-bahagia {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}
.log-bahagia .log-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.endocrine-log-entry.log-marah {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}
.log-marah .log-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.endocrine-log-entry.log-oxytocin {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.06);
}
.log-oxytocin .log-badge {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.endocrine-log-entry.log-resonance {
  border-left-color: var(--neon-purple);
  background: rgba(189, 0, 255, 0.06);
}
.log-resonance .log-badge {
  background: rgba(189, 0, 255, 0.2);
  color: var(--neon-purple);
}

/* ==================== ABOUT DEVELOPER (Z21 rOuTer) ==================== */
.developer-about-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 2px;
}

.developer-hero-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.08) 50%, rgba(8, 10, 17, 0.95) 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.developer-logo-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 50%;
  margin: 0 auto;
}

.developer-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(251, 113, 133, 0.45));
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.developer-logo-wrap:hover .developer-logo-img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 24px rgba(251, 113, 133, 0.7));
}

.developer-pulse-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.3) 0%, transparent 70%);
  animation: devPulseRing 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes devPulseRing {
  0% { transform: scale(0.94); opacity: 0.25; }
  50% { transform: scale(1.08); opacity: 0.6; }
  100% { transform: scale(0.94); opacity: 0.25; }
}

.developer-brand-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

.developer-brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-code, monospace);
  letter-spacing: 0.02em;
}

.developer-brand-title .z21-accent {
  font-size: 2.1rem;
  font-weight: 800;
  color: #34d399;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.65);
  line-height: 1;
  font-family: var(--font-code, monospace);
}

.developer-brand-title .z21-name {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  line-height: 1;
  font-family: var(--font-code, monospace);
}

.developer-brand-tag {
  font-size: 0.85rem;
  color: #34d399;
  font-family: var(--font-code, monospace);
  letter-spacing: 0.22em;
  font-weight: 600;
  opacity: 0.95;
  text-align: center;
}

.developer-redirect-link {
  display: block;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(2, 6, 23, 0.95) 100%);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: inherit;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  cursor: pointer;
}

.developer-redirect-link:hover {
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(180deg, rgba(20, 32, 55, 0.9) 0%, rgba(4, 12, 30, 0.98) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.2), 0 0 12px rgba(52, 211, 153, 0.2);
}

.developer-info-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.developer-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.developer-redirect-link:hover .developer-avatar-box {
  background: rgba(16, 185, 129, 0.25);
  transform: scale(1.05);
}

.developer-info-meta {
  flex: 1;
  min-width: 0;
}

.developer-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.developer-role-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.developer-external-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-code, monospace);
}

.developer-name-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.developer-bio-text {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 16px;
}

.developer-bio-text p {
  margin: 0 0 10px;
}

.developer-link-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid #34d399;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}

.developer-link-hint i {
  color: #34d399;
  margin-top: 2px;
  flex-shrink: 0;
}

.developer-action-bar {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.developer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: var(--radius-md, 8px);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.developer-redirect-link:hover .developer-action-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(6, 182, 212, 0.35) 100%);
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.3);
}

.developer-action-btn .arrow-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.developer-redirect-link:hover .developer-action-btn .arrow-icon {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .developer-hero-badge {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }
  .developer-brand-title {
    justify-content: center;
  }
  .developer-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .developer-action-bar {
    justify-content: stretch;
  }
  .developer-action-btn {
    width: 100%;
    justify-content: center;
  }
}


/* Active Local Workspace Pill Above Composer */
.workspace-composer-pill {
  max-width: 920px;
  margin: 0 auto 6px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.08);
  animation: fadeIn 0.2s ease-out;
}

.workspace-pill-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.workspace-pill-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #fff;
}

.workspace-pill-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.workspace-pill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.workspace-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.workspace-pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Workspace Doc Created Card in Message */
.workspace-created-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 255, 194, 0.08);
  border: 1px solid rgba(0, 255, 194, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0;
  box-shadow: 0 2px 10px rgba(0, 255, 194, 0.08);
}

.created-card-icon {
  font-size: 1.4rem;
  color: var(--neon-teal);
  flex-shrink: 0;
}

.created-card-info {
  flex: 1;
  min-width: 0;
}

.created-card-info strong {
  display: block;
  font-size: 0.85rem;
  color: #fff;
  word-break: break-all;
}

.created-card-info span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.created-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Modal Doc Viewer */
.modal-doc-viewer-card {
  max-width: 720px;
  width: 95vw;
}

.doc-viewer-meta {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: var(--font-code);
}

.doc-viewer-content {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: #E0E7FF;
  max-height: 55vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.doc-viewer-editor {
  width: 100%;
  box-sizing: border-box;
  min-height: 320px;
  max-height: 55vh;
  padding: 12px;
  background: rgba(4, 8, 18, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-sm);
  color: #E0E7FF;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.doc-viewer-editor:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.file-workspace-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
  margin-left: 6px;
  vertical-align: middle;
}

.file-workspace-tag.file-approval-pending-tag {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #F59E0B;
}

.file-workspace-tag.file-edit-tag {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--neon-purple);
}

.file-workspace-tag.file-edited-tag {
  background: rgba(0, 255, 194, 0.15);
  border-color: rgba(0, 255, 194, 0.4);
  color: var(--neon-teal);
}

.file-workspace-tag.z21-artifact-tag {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #38bdf8;
}

.ai-file-btn.allow-pending {
  background: rgba(0, 255, 194, 0.15) !important;
  border-color: rgba(0, 255, 194, 0.4) !important;
  color: var(--neon-teal) !important;
  font-weight: 600;
}

.ai-file-btn.allow-pending:hover {
  background: rgba(0, 255, 194, 0.3) !important;
  box-shadow: 0 0 8px rgba(0, 255, 194, 0.3);
}

.ai-file-btn.open-workspace-doc {
  background: rgba(168, 85, 247, 0.15) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  color: #c084fc !important;
}

.ai-file-btn.open-workspace-doc:hover {
  background: rgba(168, 85, 247, 0.3) !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.ai-file-btn.reject-pending {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  font-weight: 600;
}

.ai-file-btn.reject-pending:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.file-workspace-tag.file-rejected-tag {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ==================== INTERACTIVE MERMAID DIAGRAM VIEWER ==================== */
.mermaid-diagram-card {
  margin: 14px 0;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mermaid-diagram-card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 6px 24px rgba(0, 240, 255, 0.15);
}

.mermaid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(22, 27, 34, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-main);
  flex-wrap: wrap;
  gap: 8px;
}

.mermaid-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--neon-cyan);
}

.mermaid-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mermaid-zoom-level {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  min-width: 44px;
  text-align: center;
}

.mermaid-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mermaid-tool-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.mermaid-viewport {
  position: relative;
  overflow: auto;
  max-height: 620px;
  min-height: 180px;
  padding: 24px;
  display: flex;
  background: radial-gradient(circle at center, rgba(16, 24, 39, 0.85) 0%, rgba(10, 14, 20, 0.98) 100%);
  cursor: grab;
  user-select: none;
}

.mermaid-viewport:active {
  cursor: grabbing;
}

.mermaid-svg-stage {
  margin: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.15s ease-out;
  transform-origin: top center;
  padding: 8px;
}

.mermaid-svg-stage svg,
.mermaid-sheet svg {
  max-width: none;
  height: auto;
  overflow: visible !important;
  display: block;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  letter-spacing: 0.01em;
}

.mermaid-svg-stage svg foreignObject,
.mermaid-svg-stage svg foreignObject > div,
.mermaid-svg-stage svg foreignObject span,
.mermaid-svg-stage svg .nodeLabel,
.mermaid-svg-stage svg .edgeLabel,
.mermaid-sheet svg foreignObject,
.mermaid-sheet svg foreignObject > div,
.mermaid-sheet svg foreignObject span,
.mermaid-sheet svg .nodeLabel,
.mermaid-sheet svg .edgeLabel {
  overflow: visible !important;
  max-width: none !important;
}

.mermaid-customize-ai-btn,
.ai-file-btn.customize-ai {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(56, 189, 248, 0.22)) !important;
  border-color: rgba(168, 85, 247, 0.55) !important;
  color: #e9d5ff !important;
  font-weight: 600 !important;
  gap: 5px;
}

.mermaid-customize-ai-btn:hover,
.ai-file-btn.customize-ai:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.38), rgba(56, 189, 248, 0.35)) !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

/* Kotak & Bentuk Node: Sudut tumpul halus, drop shadow lembut, border tegas */
.mermaid-svg-stage svg .node rect,
.mermaid-svg-stage svg .node polygon,
.mermaid-svg-stage svg .node circle,
.mermaid-svg-stage svg .node ellipse,
.mermaid-svg-stage svg .node path,
.mermaid-svg-stage svg .actor,
.mermaid-svg-stage svg .note rect,
.mermaid-sheet svg .node rect,
.mermaid-sheet svg .node polygon,
.mermaid-sheet svg .node circle,
.mermaid-sheet svg .node ellipse,
.mermaid-sheet svg .node path {
  rx: 8px;
  ry: 8px;
  stroke-width: 1.8px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  transition: all 0.2s ease;
}

.mermaid-svg-stage svg .node:hover rect,
.mermaid-svg-stage svg .node:hover polygon,
.mermaid-svg-stage svg .node:hover circle,
.mermaid-svg-stage svg .node:hover ellipse,
.mermaid-svg-stage svg .node:hover path,
.mermaid-sheet svg .node:hover rect {
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.5));
  stroke-width: 2.2px;
}

/* Tipografi Teks di Dalam Kotak & Simbol (Tanpa !important pada color/fill agar warna kustom AI & Pengguna tampil 100%) */
.mermaid-svg-stage svg .node .label,
.mermaid-svg-stage svg .node text,
.mermaid-svg-stage svg text.actor,
.mermaid-svg-stage svg .labelText,
.mermaid-svg-stage svg .messageText,
.mermaid-svg-stage svg .noteText,
.mermaid-svg-stage svg .loopText,
.mermaid-sheet svg .node .label {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.42 !important;
  text-align: center !important;
  color: #f8fafc;
  fill: #f8fafc;
}

.mermaid-svg-stage svg .actor-line {
  stroke: rgba(56, 189, 248, 0.45);
  stroke-dasharray: 4, 4;
}

.mermaid-svg-stage svg .messageLine0,
.mermaid-svg-stage svg .messageLine1 {
  stroke: #38bdf8;
  stroke-width: 1.8px;
}

.mermaid-svg-stage svg .node .label b,
.mermaid-svg-stage svg .node .label strong,
.mermaid-sheet svg .node .label b,
.mermaid-sheet svg .node .label strong {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: inherit;
  fill: inherit;
  letter-spacing: 0.01em;
}

/* Garis Panah Konektor: Mendukung linkStyle warna kustom AI/Pengguna */
.mermaid-svg-stage svg .edgePath path,
.mermaid-sheet svg .edgePath path {
  stroke: #38bdf8;
  stroke-width: 1.8px;
  filter: drop-shadow(0 1px 3px rgba(0, 240, 255, 0.2));
}

.mermaid-svg-stage svg .marker,
.mermaid-sheet svg .marker {
  fill: #38bdf8;
  stroke: #38bdf8;
}

/* Label pada Panah: Badge Pill Gelap Kontras agar tidak tertimpa garis */
.mermaid-svg-stage svg .edgeLabel,
.mermaid-sheet svg .edgeLabel {
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #e2e8f0;
}

.mermaid-svg-stage svg .edgeLabel rect,
.mermaid-sheet svg .edgeLabel rect {
  fill: #0b1120;
  stroke: rgba(56, 189, 248, 0.35);
  stroke-width: 1px;
  rx: 4px;
  ry: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* Kluster / Subgraph: Mendukung warna style Subgraph kustom dari AI / Pengguna */
.mermaid-svg-stage svg .cluster rect,
.mermaid-sheet svg .cluster rect {
  rx: 12px;
  ry: 12px;
  fill: rgba(15, 23, 42, 0.65);
  stroke: rgba(56, 189, 248, 0.45);
  stroke-width: 1.5px;
  stroke-dasharray: 4, 4;
}

.mermaid-svg-stage svg .cluster .nodeLabel,
.mermaid-sheet svg .cluster .nodeLabel {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #38bdf8;
  letter-spacing: 0.03em;
}

.mermaid-raw-code {
  margin: 0 !important;
  border-radius: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.mermaid-render-error {
  padding: 16px;
  color: #f87171;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
}

/* Fullscreen mode for Mermaid Diagram (v267) */
.message-row.has-mermaid-fullscreen,
.message-row:has(.mermaid-fullscreen),
.message-bubble.has-mermaid-fullscreen,
.message-bubble:has(.mermaid-fullscreen),
.chat-messages:has(.mermaid-fullscreen),
.chat-messages-container:has(.mermaid-fullscreen),
.chat-viewport:has(.mermaid-fullscreen),
.chat-main:has(.mermaid-fullscreen),
.main-content:has(.mermaid-fullscreen),
.app-container:has(.mermaid-fullscreen) {
  content-visibility: visible !important;
  contain: none !important;
  transform: none !important;
  filter: none !important;
  z-index: 9999999 !important;
}

.mermaid-diagram-card.mermaid-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 10000000 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #090d16 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: none !important;
}

.mermaid-diagram-card.mermaid-fullscreen .mermaid-toolbar {
  background: #111827 !important;
  padding: 12px 18px !important;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25) !important;
}

.mermaid-diagram-card.mermaid-fullscreen .mermaid-viewport {
  flex: 1 1 auto !important;
  height: calc(100vh - 58px) !important;
  max-height: none !important;
  padding: 30px !important;
  background: radial-gradient(circle at center, #0f172a 0%, #030712 100%) !important;
}

.mermaid-diagram-card.mermaid-fullscreen .mermaid-code-view {
  flex: 1 1 auto !important;
  height: calc(100vh - 58px) !important;
  overflow: auto !important;
}

.mermaid-fullscreen-btn {
  background: rgba(0, 240, 255, 0.12) !important;
  border-color: rgba(0, 240, 255, 0.4) !important;
  color: var(--neon-cyan) !important;
  font-weight: 600 !important;
  gap: 5px;
}

.mermaid-fullscreen-btn:hover {
  background: rgba(0, 240, 255, 0.25) !important;
}

body.mermaid-has-fullscreen {
  overflow: hidden !important;
}

/* Inline Mermaid Container inside chat bubble */
.inline-mermaid-chat-container {
  width: 100%;
  margin: 12px 0 16px 0;
}

/* Mobile full screen optimization for Studio */
@media (max-width: 768px) {
  .ai-file-studio-card {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .ai-file-studio-card .modal-body,
  .ai-file-studio-card .gemini-studio-stage {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    background: #ffffff !important;
  }
  .ai-file-studio-card .studio-workspace-area {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
  }
  .ai-file-studio-card .ai-file-studio-pane {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    background: #ffffff !important;
  }
  .ai-file-studio-card .ai-file-studio-code,
  .ai-file-studio-card .ai-file-studio-code.hljs {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    background: #0e1015 !important;
    color: #E6EDF8 !important;
  }
  .studio-assistant-panel,
  #aiFileStudioModal #studioAssistantPanel.studio-assistant-panel {
    position: absolute !important;
    right: 8px;
    left: auto;
    top: 8px;
    bottom: auto !important;
    width: min(320px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: min(380px, calc(100% - 20px), 55vh) !important;
    flex: 0 0 auto !important;
    border-radius: 14px !important;
    border: 1px solid rgba(0, 240, 255, 0.48) !important;
    display: none !important;
    z-index: 120 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.92), 0 0 24px rgba(0, 240, 255, 0.3) !important;
  }
  .studio-assistant-panel.is-open,
  #aiFileStudioModal #studioAssistantPanel.studio-assistant-panel.is-open {
    display: flex !important;
  }
  .studio-assistant-panel.is-body-collapsed,
  #aiFileStudioModal #studioAssistantPanel.studio-assistant-panel.is-body-collapsed {
    max-height: none !important;
    height: auto !important;
  }
  .studio-assistant-header {
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .studio-assistant-title {
    font-size: 0.74rem !important;
    gap: 4px !important;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .studio-history-mode-badge {
    font-size: 0.58rem !important;
    padding: 1px 4px !important;
  }
  .studio-endocrine-toggle-btn {
    padding: 2px 5px !important;
    font-size: 0.62rem !important;
    white-space: nowrap !important;
  }
  .studio-assistant-controls {
    gap: 2px !important;
  }
  .studio-assistant-controls .gemini-icon-btn {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.72rem !important;
  }
  .studio-code-editor-bar {
    padding: 6px 10px !important;
    gap: 6px !important;
  }
  .studio-editor-actions {
    gap: 5px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .studio-editor-actions::-webkit-scrollbar {
    display: none !important;
  }
  .studio-editor-actions .gemini-pill-btn {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
  }
  .studio-editor-bottom-bar {
    display: none !important;
  }
  .studio-editor-search-bar {
    flex-wrap: nowrap !important;
    padding: 5px 8px !important;
    gap: 6px !important;
  }
  .studio-editor-search-bar.is-hidden {
    display: none !important;
  }
  .studio-search-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    margin-bottom: 0 !important;
    gap: 6px !important;
  }
  .studio-search-input {
    min-width: 60px !important;
    font-size: 0.78rem !important;
    height: 30px !important;
  }
  .studio-search-right {
    flex: 0 0 auto !important;
    width: auto !important;
    justify-content: flex-end !important;
    gap: 4px !important;
  }
  .studio-search-nav-btn,
  .studio-search-close-btn {
    width: 28px !important;
    height: 28px !important;
  }
}

/* ==================== INTERACTIVE TASK TRACKER & FILE SNAPSHOTS (v257) ==================== */

/* Task Tracker Floating Card */
.task-tracker-card {
  background: rgba(13, 15, 23, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  margin: 6px auto 8px auto;
  width: 100%;
  max-width: 820px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(168, 85, 247, 0.15);
  animation: slideDownIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.task-tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(168, 85, 247, 0.08);
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.task-tracker-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.task-tracker-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.task-progress-badge {
  font-size: 0.68rem;
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 1px 7px;
  border-radius: 12px;
  font-family: var(--font-code);
  font-weight: 600;
}

.task-tracker-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-task-header-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.76rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-task-header-action:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.task-progress-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.task-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  transition: width 0.3s ease;
}

.task-tracker-body {
  padding: 6px 10px;
  max-height: 220px;
  overflow-y: auto;
}

.task-tracker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-tracker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.task-tracker-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.task-tracker-item.status-completed {
  border-color: rgba(0, 255, 194, 0.2);
  background: rgba(0, 255, 194, 0.03);
}

.task-tracker-item.status-completed .task-subject {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-tracker-item.status-in_progress {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.06);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

.task-tracker-item.status-waiting_approval {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
  flex-wrap: wrap;
}

.task-status-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.task-tracker-item.status-completed .task-status-btn {
  color: var(--neon-teal);
}

.task-tracker-item.status-in_progress .task-status-btn {
  color: var(--neon-cyan);
  animation: pulseGlow 1.5s infinite;
}

.task-tracker-item.status-waiting_approval .task-status-btn {
  color: #F59E0B;
  animation: pulseGlow 1.5s infinite;
}

.task-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-subject {
  font-size: 0.8rem;
  color: var(--text-main);
  word-break: break-word;
}

.task-active-form {
  font-size: 0.7rem;
  color: var(--neon-cyan);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-active-form.approval-wait-tag {
  color: #F59E0B !important;
  font-weight: 600;
}

.task-approval-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 5px;
  margin-top: 4px;
  border-top: 1px dashed rgba(245, 158, 11, 0.25);
}

.btn-approval-allow {
  background: rgba(0, 255, 194, 0.15);
  border: 1px solid rgba(0, 255, 194, 0.4);
  color: var(--neon-teal);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-approval-allow:hover {
  background: rgba(0, 255, 194, 0.3);
  border-color: var(--neon-teal);
  box-shadow: 0 0 8px rgba(0, 255, 194, 0.3);
}

.btn-approval-reject {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ff6b6b;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-approval-reject:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ff4d4d;
  color: #fff;
}

.task-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.7rem;
  opacity: 0.4;
  transition: all 0.15s;
}

.task-tracker-item:hover .task-delete-btn {
  opacity: 1;
}

.task-delete-btn:hover {
  color: #ff4d6d;
}

.task-tracker-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Snapshots & Rollback UI */
.file-snapshot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s;
}

.file-snapshot-badge:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #c084fc;
  color: #fff;
}

.doc-viewer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-snapshots-panel {
  background: rgba(13, 15, 23, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.snapshots-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #d8b4fe;
}

.snapshots-panel-header small {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.snapshots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.snapshot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.76rem;
  transition: all 0.15s;
}

.snapshot-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.3);
}

.snapshot-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.snapshot-version-tag {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.snapshot-time {
  color: var(--text-muted);
}

.snapshot-author {
  font-size: 0.68rem;
  color: var(--neon-teal);
  background: rgba(0, 255, 194, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
}

.snapshot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snapshot-empty {
  font-size: 0.76rem;
  color: var(--text-dim);
  text-align: center;
  padding: 10px;
  font-style: italic;
}

/* ==================== DUAL FORMAT DIAGRAM DOWNLOAD DROPDOWN (v268: SVG & JPEG) ==================== */
.mermaid-dropdown-wrap,
.studio-download-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mermaid-download-toggle-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.mermaid-dropdown-menu,
.studio-download-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: rgba(10, 15, 29, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateZ(0);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.15);
  padding: 6px;
  z-index: 10000005;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-download-menu {
  bottom: calc(100% + 6px);
  top: auto;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mermaid-download-item,
.studio-download-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main, #e2e8f0);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
  font-family: inherit;
}

.mermaid-download-item:hover,
.studio-download-item:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateX(2px);
}

.mermaid-download-item i,
.studio-download-item i {
  font-size: 1.15rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.mermaid-download-item .menu-desc-text,
.studio-download-item .menu-desc-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mermaid-download-item .fmt-title,
.studio-download-item .fmt-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
}

.mermaid-download-item .fmt-sub,
.studio-download-item .fmt-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.25;
}

/* Dual download buttons on .ai-file-card */
.ai-file-btn.download-svg {
  background: rgba(0, 240, 255, 0.12) !important;
  color: var(--neon-cyan) !important;
  border: 1px solid rgba(0, 240, 255, 0.35) !important;
}
.ai-file-btn.download-svg:hover {
  background: rgba(0, 240, 255, 0.25) !important;
}
.ai-file-btn.download-jpeg {
  background: rgba(255, 183, 3, 0.12) !important;
  color: var(--neon-amber) !important;
  border: 1px solid rgba(255, 183, 3, 0.35) !important;
}
.ai-file-btn.download-jpeg:hover {
  background: rgba(255, 183, 3, 0.25) !important;
}
.ai-file-btn.download-pdf {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.ai-file-btn.download-pdf:hover {
  background: rgba(239, 68, 68, 0.25) !important;
}
.ai-file-btn.download-docx {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}
.ai-file-btn.download-docx:hover {
  background: rgba(59, 130, 246, 0.25) !important;
}
.ai-file-btn.download-xlsx {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.38) !important;
}
.ai-file-btn.download-xlsx:hover {
  background: rgba(16, 185, 129, 0.28) !important;
}
.ai-file-btn.view-code {
  background: rgba(168, 85, 247, 0.12) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
}
.ai-file-btn.view-code:hover {
  background: rgba(168, 85, 247, 0.25) !important;
}

/* ==========================================================================
   WEBSITE & DOCUMENT OUTPUT MODE SELECTION MODALS
   ========================================================================== */
.website-mode-card,
.doc-mode-card {
  user-select: none;
}
.website-mode-card:hover,
.doc-mode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
#optWebsiteModePreview:hover {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.14) !important;
}
#optWebsiteModeCode:hover {
  border-color: #c084fc !important;
  background: rgba(168, 85, 247, 0.12) !important;
}
#optDocModePdf:hover {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}
#optDocModeDocx:hover {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.14) !important;
}
.website-mode-card:active,
.doc-mode-card:active {
  transform: translateY(0);
}

/* =========================================================================
   TERMINAL NEURAL // CLI CONSOLE (In-Tab Interactive Multi-Shell Console)
   Inspired by terminal-extension (Aura Es / Aura Api Cyberpunk Styling)
   ========================================================================= */

.terminal-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 13, 0.94);
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
  contain: layout style;
}

.terminal-modal-backdrop.show {
  display: flex !important;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-modal-card {
  position: relative;
  width: min(98vw, 1520px);
  max-width: 98vw;
  height: min(93vh, 900px);
  max-height: 93vh;
  box-sizing: border-box;
  background: #070c14;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72);
  transform: translateZ(0);
  contain: layout style;
}

/* Fullscreen Terminal Mode */
.terminal-modal-backdrop.fullscreen {
  padding: 0 !important;
}

.terminal-modal-card.is-fullscreen,
.terminal-modal-backdrop.fullscreen .terminal-modal-card {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

/* ── Ambient Aura: Corner Glows ── */
.term-ambient-aura {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.term-flame {
  position: absolute;
  width: 36vmax;
  height: 36vmax;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(0, 240, 255, 0.25) 0%,
    rgba(0, 255, 194, 0.14) 25%,
    rgba(0, 160, 255, 0.06) 50%,
    transparent 75%);
  opacity: 0.55;
}

.term-flame.tl { top: -16vmax; left: -16vmax; }
.term-flame.tr { top: -16vmax; right: -16vmax; }
.term-flame.bl { bottom: -16vmax; left: -16vmax; }
.term-flame.br { bottom: -16vmax; right: -16vmax; }

/* Aura Api (Fire Red / Amber) Theme */
.terminal-modal-backdrop.theme-api .terminal-modal-card,
.terminal-modal-card.theme-aura-api {
  background: #110707;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 32px rgba(239, 68, 68, 0.2);
}

.terminal-modal-backdrop.theme-api .term-flame,
.terminal-modal-card.theme-aura-api .term-flame {
  background: radial-gradient(circle,
    rgba(255, 158, 66, 0.28) 0%,
    rgba(239, 68, 68, 0.16) 25%,
    rgba(185, 28, 28, 0.06) 50%,
    transparent 75%);
}

.terminal-modal-backdrop.theme-api .term-prompt-cwd,
.terminal-modal-card.theme-aura-api .term-prompt-cwd {
  color: #f87171 !important;
}

.terminal-modal-backdrop.theme-api .terminal-tab-item.active,
.terminal-modal-card.theme-aura-api .terminal-tab-item.active {
  border-bottom-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* ── Top Toolbar ── */
.terminal-toolbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
  height: 48px;
  background: rgba(10, 16, 26, 0.92);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  user-select: none;
}

.terminal-title .bolt {
  font-size: 1rem;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.75);
}

.tb-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tb-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.tb-btn:active {
  transform: scale(0.96);
}

.tb-btn.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.tb-btn.icon-only {
  padding: 6px 9px;
  min-width: 30px;
  justify-content: center;
  flex-shrink: 0;
}

.tb-btn-mobile-connect {
  display: none;
}

.tb-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px 4px;
}

.tb-group .tb-btn {
  border: none;
  background: transparent;
  padding: 4px 6px;
}

#termFontSizeLabel {
  font-size: 0.72rem;
  font-family: var(--font-code);
  color: #94a3b8;
  min-width: 32px;
  text-align: center;
  font-weight: 600;
}

.terminal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Shell Dropdown Menu */
.terminal-shell-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  background: rgba(11, 16, 26, 0.98);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.15);
  padding: 6px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 3px;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-shell-dropdown.show {
  display: flex !important;
}

.shell-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shell-opt:hover {
  background: rgba(0, 240, 255, 0.12);
}

.shell-opt.active {
  background: rgba(0, 240, 255, 0.18);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.shell-opt-icon {
  font-size: 1.1rem;
}

.shell-opt-info {
  display: flex;
  flex-direction: column;
}

.shell-opt-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}

.shell-opt-desc {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* ── Multi-Tab Strip ── */
.terminal-tabs-strip {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(8, 12, 20, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 38px;
  flex-shrink: 0;
  overflow-x: auto;
}

.terminal-tabs-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.terminal-tabs-list::-webkit-scrollbar {
  display: none;
}

.terminal-tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.terminal-tab-item:hover {
  background: rgba(0, 240, 255, 0.08);
  color: #ffffff;
}

.terminal-tab-item.active {
  background: rgba(0, 240, 255, 0.14);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.35);
  border-bottom-color: var(--neon-cyan);
  font-weight: 600;
}

.tab-shell-icon {
  font-size: 0.85rem;
}

.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.tab-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab-close-btn:hover {
  color: #ff5200;
  background: rgba(255, 82, 0, 0.15);
}

.terminal-add-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.terminal-add-tab-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

/* ── Terminal Workspace ── */
.terminal-workspace {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: rgba(6, 10, 16, 0.85);
}

.terminal-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  background: rgba(7, 11, 18, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

.terminal-pane.active {
  background: rgba(8, 13, 22, 0.98);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.3);
}

.terminal-pane.active .terminal-pane-header {
  background: rgba(14, 22, 34, 0.98);
  border-bottom-color: rgba(0, 240, 255, 0.35);
}

.terminal-pane.active .pane-title-badge {
  color: var(--neon-cyan, #00f0ff);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.terminal-pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(12, 18, 28, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  user-select: none;
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.tl-dot.red { background: #ef4444; }
.tl-dot.yellow { background: #eab308; }
.tl-dot.green { background: #22c55e; }
.tl-dot.disabled { opacity: 0.45; cursor: default; }
.tl-dot.clickable { cursor: pointer; opacity: 0.9; }
.tl-dot.clickable:hover { transform: scale(1.2); box-shadow: 0 0 8px #ef4444; }

.pane-title-badge {
  font-weight: 700;
  color: #e2e8f0;
}

.pane-shell-tag {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-family: var(--font-code);
  font-weight: 600;
}

.pane-cwd-indicator {
  color: #64748b;
  font-family: var(--font-code);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.pane-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  margin-right: 8px;
}

.pane-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.pane-mini-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.pane-mini-btn:active {
  transform: scale(0.96);
}

.pane-mini-btn.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--neon-amber, #fbbf24);
  color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.btn-pane-endorphin:hover {
  background: rgba(0, 255, 194, 0.16);
  border-color: rgba(0, 255, 194, 0.45);
  color: #00FFC2;
}

.term-context-menu {
  position: absolute;
  z-index: 10050;
  min-width: 210px;
  padding: 6px;
  background: rgba(11, 18, 30, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  gap: 2px;
  user-select: none;
}

.term-ctx-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.term-ctx-item:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.18);
  color: #ffffff;
}

.term-ctx-item:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.term-ctx-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.term-ctx-left i {
  width: 14px;
  text-align: center;
  color: #38bdf8;
}

.term-ctx-item:disabled .term-ctx-left i {
  color: #64748b;
}

.term-ctx-shortcut {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.term-ctx-divider {
  height: 1px;
  margin: 3px 4px;
  background: rgba(148, 163, 184, 0.18);
}

.term-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(10, 14, 24, 0.96);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  z-index: 25;
}

.term-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
  max-width: 360px;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  padding: 0 8px;
}

.term-search-input-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.term-search-icon {
  font-size: 0.72rem;
  color: #64748b;
  margin-right: 6px;
}

.term-search-input {
  flex: 1;
  min-width: 60px;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-family: "JetBrains Mono", Consolas, monospace;
  padding: 4px 0;
}

.term-search-count {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: "JetBrains Mono", Consolas, monospace;
  margin-left: 6px;
  white-space: nowrap;
}

.term-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.72);
  color: #cbd5e1;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.term-search-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.term-search-btn.active {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #ffffff;
}

.term-chip-endorphin {
  background: rgba(0, 255, 194, 0.08) !important;
  color: #00FFC2 !important;
  border-color: rgba(0, 255, 194, 0.35) !important;
}

.term-chip-endorphin:hover {
  background: rgba(0, 255, 194, 0.22) !important;
  border-color: #00FFC2 !important;
  box-shadow: 0 0 10px rgba(0, 255, 194, 0.35);
}

.endorphin-key {
  color: #00FFC2 !important;
  border-color: rgba(0, 255, 194, 0.3) !important;
}

.endorphin-key:active {
  background: rgba(0, 255, 194, 0.25) !important;
}

.pane-status-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pane-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.pane-status-label {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* ── Terminal Screen / Output ── */
.terminal-screen {
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--font-code, 'Fira Code', monospace);
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
  background: transparent;
  user-select: text;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-screen.xterm-mode {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  white-space: normal;
  word-break: normal;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
  position: relative !important;
  background: #000000 !important;
  align-items: center !important;
}

.xterm-pane-container {
  flex: 1 1 0% !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding: 2px 4px 6px 4px !important;
  background: #000000 !important;
  transition: none !important;
  contain: style;
}

.xterm-pane-container .xterm {
  height: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  position: relative !important;
}

.xterm-pane-container .xterm-rows {
  contain: style;
}

.xterm-pane-container .xterm-viewport {
  background-color: transparent !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.xterm-pane-container .xterm-viewport::-webkit-scrollbar {
  width: 6px !important;
}

.xterm-pane-container .xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4) !important;
  border-radius: 4px !important;
}

.xterm-pane-container .xterm-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.75) !important;
}

.xterm-pane-container .xterm-screen {
  background-color: transparent !important;
  touch-action: none !important;
}

/* Eliminasi total floating composition view bawaan xterm yang memicu kedipan saat kata di-commit via spasi di mobile IME */
.xterm .composition-view,
.xterm .composition-view.active {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Kunci posisi helper textarea xterm di (0,0) secara statis fixed agar browser mobile tidak mencoba scroll-into-view saat kursor berpindah */
.xterm .xterm-helper-textarea {
  position: fixed !important;
  opacity: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  color: transparent !important;
  pointer-events: none !important;
  resize: none !important;
  overflow: hidden !important;
  z-index: -10 !important;
}

.terminal-screen::-webkit-scrollbar {
  width: 6px;
}

.terminal-screen::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 3px;
}

.terminal-screen .term-banner {
  color: var(--neon-cyan);
  margin-bottom: 12px;
  line-height: 1.35;
}

.terminal-screen .term-cmd-echo {
  color: #ffffff;
  font-weight: 600;
  margin: 6px 0 3px 0;
}

.terminal-screen .term-cmd-echo .term-prompt {
  color: var(--neon-teal);
  margin-right: 6px;
}

.terminal-screen .term-output-block {
  margin-bottom: 8px;
  color: #cbd5e1;
}

.terminal-screen .term-err {
  color: #f87171;
}

.terminal-screen .term-success {
  color: #4ade80;
}

.terminal-screen .term-warn {
  color: #facc15;
}

.terminal-screen .term-info {
  color: #38bdf8;
}

.terminal-screen .term-dim {
  color: #64748b;
}

/* ── Command Input Row ── */
/* Disembunyikan secara permanen baik desktop maupun mobile agar pengetikan dilakukan
   langsung di dalam layar terminal interaktif (xterm PTY) */
.terminal-input-row {
  display: none !important;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(10, 16, 26, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}

.term-prompt-cwd {
  font-family: var(--font-code);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neon-teal);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.term-cli-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-code);
  font-size: 0.84rem;
  padding: 4px 6px;
}

.term-cli-input::placeholder {
  color: #475569;
  font-size: 0.78rem;
}

.term-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 6px;
  color: var(--neon-cyan);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.term-send-btn:hover {
  background: var(--neon-cyan);
  color: #070a12;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* ── Split Mode Resizer ── */
.terminal-resizer {
  width: 4px;
  background: rgba(0, 240, 255, 0.2);
  cursor: col-resize;
  transition: background 0.15s;
  flex-shrink: 0;
}

.terminal-resizer:hover {
  background: var(--neon-cyan);
}

/* ── Quick Chips Bar ── */
/* Disembunyikan di desktop, dipertahankan di perangkat seluler */
.terminal-quick-chips {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(8, 12, 20, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.terminal-quick-chips::-webkit-scrollbar {
  display: none;
}

.terminal-quick-chips .quick-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #cbd5e1;
  font-family: var(--font-code);
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.term-chip:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--neon-cyan);
}

/* Dual-Device Dimension Sync Mode Button */
.tb-btn-dimension-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 165, 233, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  color: #38bdf8 !important;
  font-size: 0.74rem !important;
  font-weight: 700;
  padding: 4px 9px !important;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tb-btn-dimension-sync:hover {
  background: rgba(14, 165, 233, 0.28) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Auto Y Automation Button in Toolbar */
.tb-btn-auto-enter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
  font-size: 0.74rem !important;
  font-weight: 700;
  padding: 4px 9px !important;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tb-btn-auto-enter:hover {
  background: rgba(245, 158, 11, 0.25) !important;
  border-color: #f59e0b !important;
  color: #fef08a !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}
.tb-btn-auto-enter.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.45)) !important;
  border-color: #fbbf24 !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5) !important;
}

/* Quick Chips Auto Y Chip */
.term-chip.term-chip-auto-enter {
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}
.term-chip.term-chip-auto-enter:hover {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: #f59e0b !important;
}
.term-chip.term-chip-auto-enter.active {
  background: rgba(245, 158, 11, 0.35) !important;
  border-color: #fbbf24 !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5) !important;
}

/* Mobile Responsiveness - Termux Native Layout Architecture */
@media (max-width: 768px) {
  .terminal-modal-backdrop {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    max-height: 100% !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
  }
  .terminal-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100%;
    max-height: 100%;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    transition: none !important; /* CRITICAL: Meniadakan animasi 0.25s agar ResizeObserver tidak spam & keyboard stabil */
    background: #000000 !important; /* Termux Pure OLED Black */
    box-shadow: none !important;
  }
  /* Ultra-Sleek Toolbar for Mobile (Termux style: ringkas, 32px) */
  .terminal-toolbar {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 4px !important;
    gap: 3px !important;
    background: #070c14 !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .terminal-toolbar::-webkit-scrollbar {
    display: none !important;
  }
  .terminal-toolbar-left,
  .terminal-toolbar-right {
    flex-shrink: 0 !important;
  }
  .terminal-toolbar .tb-btn {
    flex-shrink: 0 !important;
  }
  .terminal-title .term-title-text {
    display: none !important;
  }
  .terminal-title::after {
    display: none !important;
  }
  .tb-divider {
    display: none !important;
  }
  .terminal-shell-wrap button#btnTerminalShell {
    padding: 2px 5px !important;
    font-size: 0.68rem !important;
    gap: 3px !important;
    height: 24px !important;
  }
  #btnTermQuickFolder,
  #btnTermSearch {
    display: inline-flex !important;
    padding: 2px 6px !important;
    min-width: 26px !important;
    height: 24px !important;
    font-size: 0.72rem !important;
    border-radius: 5px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .terminal-toolbar-left .tb-group {
    padding: 0 2px !important;
    height: 24px !important;
    gap: 1px !important;
    flex-shrink: 0 !important;
  }
  .terminal-toolbar-left .tb-group .tb-btn {
    padding: 2px 4px !important;
    font-size: 0.65rem !important;
    height: 20px !important;
    min-width: 18px !important;
  }
  .terminal-toolbar-left #termFontSizeLabel {
    min-width: 24px !important;
    font-size: 0.62rem !important;
  }
  #btnTermOpenQrScanner #labelTermOpenQrScanner,
  .tb-btn-wa-switch span {
    display: none !important;
  }
  .tb-btn-wa-switch {
    padding: 2px 6px !important;
    min-width: 26px !important;
    height: 24px !important;
    justify-content: center !important;
  }
  /* Tombol Toggle Mode Layar HP / Laptop di Toolbar Mobile */
  .tb-btn-dimension-sync {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    height: 24px !important;
    border-radius: 5px !important;
  }
  .tb-btn-auto-enter {
    display: inline-flex !important;
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    height: 24px !important;
    border-radius: 5px !important;
    flex-shrink: 0 !important;
  }
  /* Sembunyikan kontrol desktop berlebih pada mobile, namun tampilkan kontrol ukuran font */
  #btnTermSyncWindows,
  #btnTermSplit,
  #btnTermFullscreen,
  #btnTermTheme,
  #btnTermRemoteTunnel,
  #btnTermClear {
    display: none !important;
  }
  #btnTermOpenQrScanner {
    display: inline-flex !important;
    padding: 2px 6px !important;
    min-width: 26px !important;
    font-size: 0.68rem !important;
    height: 24px !important;
    border-radius: 5px !important;
    background: rgba(34, 211, 238, 0.15) !important;
    border: 1px solid rgba(34, 211, 238, 0.4) !important;
    color: #22d3ee !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0 !important;
  }
  .terminal-toolbar-right .tb-group {
    display: none !important;
  }
  .terminal-toolbar-left {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    gap: 3px !important;
  }
  .terminal-toolbar-left::-webkit-scrollbar {
    display: none !important;
  }
  /* Tombol Mobile Remote Connect di Toolbar */
  .tb-btn-mobile-connect {
    display: inline-flex !important;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(56, 189, 248, 0.2)) !important;
    border: 1px solid rgba(56, 189, 248, 0.65) !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    font-size: 0.66rem !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35) !important;
    height: 24px !important;
    align-items: center;
    gap: 4px;
    border-radius: 5px;
    flex-shrink: 0 !important;
  }
  .tb-btn-mobile-connect.connected {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(52, 211, 153, 0.2)) !important;
    border-color: rgba(52, 211, 153, 0.65) !important;
    color: #34d399 !important;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.35) !important;
  }
  .tb-btn-mobile-connect.connecting {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(251, 191, 36, 0.2)) !important;
    border-color: rgba(251, 191, 36, 0.65) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.35) !important;
  }
  .tb-btn-minimize,
  .tb-btn-close {
    display: inline-flex !important;
    padding: 2px 6px !important;
    min-width: 26px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 5px !important;
    color: #f1f5f9 !important;
    font-size: 0.78rem !important;
    height: 24px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .tb-btn-minimize:hover,
  .tb-btn-minimize:active {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
  }
  .tb-btn-close:hover,
  .tb-btn-close:active {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
  }
  .terminal-toolbar-right {
    gap: 4px !important;
    margin-left: auto !important;
  }
  /* Compact tab strip */
  .terminal-tabs-strip {
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 4px !important;
    gap: 3px !important;
    background: #04070e !important;
  }
  .terminal-tab-item {
    padding: 2px 6px !important;
    font-size: 0.68rem !important;
    height: 22px !important;
  }
  .terminal-add-tab-btn {
    padding: 2px 5px !important;
    font-size: 0.68rem !important;
    height: 20px !important;
  }
  /* Sembunyikan header pane desktop & connect banner redundant pada layar mobile demi ruang vertikal maksimal Termux */
  .terminal-pane-header {
    display: none !important;
  }
  .term-mobile-connect-banner {
    display: none !important;
  }
  .terminal-input-row {
    display: none !important;
  }
  .terminal-quick-chips {
    display: none !important;
  }
  .term-prompt-cwd {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .terminal-workspace {
    flex-direction: column;
    background: #000000 !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
  }
  .terminal-resizer {
    display: none !important;
  }
  .terminal-screen {
    padding: 0 !important;
    background: #000000 !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
  }
  .terminal-screen.xterm-mode {
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .xterm-pane-container {
    padding: 0 !important;
    margin: 0 !important;
    background: #000000 !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative !important;
  }
  .xterm-pane-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }
  .xterm-pane-container .xterm-screen {
    transition: none !important;
    will-change: auto !important;
  }
  .xterm .composition-view,
  .xterm .composition-view.active {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .xterm .xterm-helper-textarea {
    position: fixed !important;
    opacity: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: transparent !important;
    pointer-events: none !important;
    resize: none !important;
    overflow: hidden !important;
    z-index: -10 !important;
  }
  /* Mobile Keybar Termux 9-Kolom 2-Baris Presisi */
  .terminal-mobile-keybar {
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    gap: 2px !important;
    padding: 3px 4px !important;
    padding-bottom: max(3px, env(safe-area-inset-bottom, 3px)) !important;
    background: #000000 !important;
    border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  }
  .term-touch-key {
    height: 29px !important;
    font-size: 0.7rem !important;
    padding: 0 1px !important;
    border-radius: 4px !important;
  }
}

/* Mobile Connection Prompt Banner */
.term-mobile-connect-banner {
  position: relative;
  z-index: 15;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.14), rgba(15, 23, 42, 0.96), rgba(14, 165, 233, 0.08));
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
  padding: 8px 12px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.term-mobile-connect-banner.connected {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.14), rgba(15, 23, 42, 0.96), rgba(34, 197, 94, 0.08));
  border-bottom-color: rgba(34, 197, 94, 0.35);
}
.term-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.term-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.term-banner-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.term-banner-pulse-dot.disconnected {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.85);
}
.term-banner-pulse-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}
.term-banner-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.term-banner-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-banner-sub {
  font-size: 0.67rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.term-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.term-banner-btn.primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.term-banner-btn.primary:active {
  transform: scale(0.95);
  background: #0284c7;
}
.term-banner-btn.secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}
.term-banner-btn.secondary:active {
  transform: scale(0.95);
  background: rgba(51, 65, 85, 0.9);
}
.term-touch-key.chip-key {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  font-style: italic;
}

/* =========================================================================
   CLOUDFLARE TUNNEL REMOTE ACCESS & MOBILE ERGONOMICS (v335)
   ========================================================================= */

/* Mobile Touch Keybar (Termux Architecture: 2-Row 9-Column Grid) */
.terminal-mobile-keybar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.98);
  border-top: 1px solid rgba(56, 189, 248, 0.28);
  align-items: center;
  z-index: 10;
  flex-shrink: 0;
}
.term-touch-key {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 0 2px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 5px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.1s ease;
}
.term-touch-key:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.term-touch-key:active {
  transform: scale(0.94);
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}
.term-touch-key.slash-key {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.85rem;
}
.term-touch-key.danger-key {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  font-weight: 800;
}
.term-touch-key.danger-key:active {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}
.term-touch-key.primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(2, 132, 199, 0.45));
  border-color: rgba(56, 189, 248, 0.65);
  color: #38bdf8;
  font-weight: 700;
}
.term-touch-key.primary:active {
  background: #0284c7;
  color: #fff;
}
.term-touch-key.auto-enter-key {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.5);
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.65rem;
}
.term-touch-key.auto-enter-key.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5)) !important;
  border-color: #f59e0b !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6) !important;
}
.term-touch-key.auto-enter-key:active {
  transform: scale(0.94);
  background: #d97706 !important;
  color: #ffffff !important;
}

/* Touch Keybar Modifiers (CTRL, ALT sticky latch) */
.term-touch-key.term-mod-key {
  font-weight: 800;
  letter-spacing: 0.2px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.term-touch-key.shift-modifier-key.active {
  background: rgba(168, 85, 247, 0.38) !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.7) !important;
  animation: ctrlPulse 1.2s infinite ease-in-out;
}

.term-touch-key.ctrl-modifier-key.active {
  background: rgba(0, 240, 255, 0.35) !important;
  border-color: var(--neon-cyan, #00f0ff) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.7) !important;
  animation: ctrlPulse 1.2s infinite ease-in-out;
}

.term-touch-key.alt-modifier-key.active {
  background: rgba(245, 158, 11, 0.35) !important;
  border-color: var(--neon-amber, #fbbf24) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7) !important;
  animation: ctrlPulse 1.2s infinite ease-in-out;
}

@keyframes ctrlPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.25); }
}

/* Floating "Scroll to Bottom" Quick Button (Muncul saat digulir ke atas) */
.term-scroll-bottom-btn {
  position: absolute;
  right: 18px;
  bottom: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.6);
  border-radius: 20px;
  color: #38bdf8;
  font-family: var(--font-code, monospace);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 12px rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.15s ease;
  animation: bounceSoft 1.5s infinite ease-in-out;
}
.term-scroll-bottom-btn:hover {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
  color: #fff;
}
.term-scroll-bottom-btn:active {
  transform: scale(0.94);
}
@keyframes bounceSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Minimized Terminal Dock Badge (In Header, to the Left of Model Picker) */
.terminal-minimized-dock {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 50;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  margin: 0;
}

.terminal-minimized-dock .dock-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  height: 28px;
  background: rgba(10, 16, 26, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.terminal-minimized-dock:hover .dock-inner {
  border-color: var(--neon-cyan, #00f0ff);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
  background: rgba(14, 22, 36, 0.98);
}

.dock-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 1.8s infinite;
  flex-shrink: 0;
}

.dock-icon {
  font-size: 0.72rem;
  color: var(--neon-cyan, #00f0ff);
  flex-shrink: 0;
}

.dock-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.dock-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1;
}

.dock-sub {
  font-size: 0.58rem;
  color: #94a3b8;
  font-family: var(--font-code);
  line-height: 1;
  max-width: 65px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dock-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.65rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.dock-action-btn.restore:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.dock-action-btn.close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fca5a5;
}

@media (max-width: 768px) {
  .terminal-minimized-dock {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    margin: 0 !important;
  }

  .terminal-minimized-dock .dock-inner {
    height: 26px !important;
    padding: 2px 6px !important;
    gap: 4px !important;
  }

  .terminal-minimized-dock .dock-sub {
    display: none !important;
  }

  .terminal-minimized-dock .dock-action-btn.restore {
    display: none !important;
  }

  .terminal-minimized-dock .dock-action-btn {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Mobile Remote Connection Overlay Card */
.term-remote-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(8px);
  padding: 16px;
}
.term-remote-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 15, 28, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(56, 189, 248, 0.15);
  padding: 22px;
  color: #f1f5f9;
}
.term-remote-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.term-remote-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #38bdf8;
  flex-shrink: 0;
}
.term-remote-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #f8fafc;
}
.term-remote-card-sub {
  margin: 4px 0 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}
.term-remote-input-group {
  margin-bottom: 14px;
}
.term-remote-input-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}
.term-remote-input-group label i {
  color: #38bdf8;
  margin-right: 4px;
}
.term-remote-input,
#inputTermRemoteHost,
#inputTermRemotePin {
  width: 100%;
  padding: 9px 12px;
  background-color: #0b1120 !important;
  background: #0b1120 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 6px !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #38bdf8 !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color-scheme: dark;
}
.term-remote-input::placeholder,
#inputTermRemoteHost::placeholder,
#inputTermRemotePin::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
  opacity: 1 !important;
}
.term-remote-input:focus,
#inputTermRemoteHost:focus,
#inputTermRemotePin:focus {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}
.term-remote-input.pin-input,
#inputTermRemotePin {
  letter-spacing: 6px;
  font-size: 1.15rem;
  text-align: center;
  font-weight: 700;
  color: #38bdf8 !important;
  -webkit-text-fill-color: #38bdf8 !important;
}
.term-remote-hint {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 4px;
}
.term-remote-msg {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  margin-bottom: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.term-remote-msg.success {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}
.term-remote-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.term-remote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.term-remote-btn.primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.term-remote-btn.primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}
.term-remote-btn.secondary {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}
.term-remote-btn.secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
}

/* Modal Cloudflare Tunnel Host Broadcaster (Desktop Mode) */
#termRemoteTunnelModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100050 !important;
  background: rgba(3, 7, 18, 0.82) !important;
  backdrop-filter: blur(10px) !important;
  display: none;
  align-items: center;
  justify-content: center;
}
#termRemoteTunnelModal.show {
  display: flex !important;
  animation: fadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.term-tunnel-dialog {
  max-width: 480px;
  width: 92%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  color: #f1f5f9;
}
.term-tunnel-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
}
.term-tunnel-body {
  padding: 10px 14px;
  overflow-y: auto;
  max-height: calc(82vh - 48px);
}
.term-tunnel-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  margin-bottom: 10px;
}
.term-tunnel-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.term-tunnel-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}
.term-tunnel-status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}
.term-tunnel-status-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}
.term-tunnel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  transition: all 0.15s ease;
}
.term-tunnel-btn:hover {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
}
.term-tunnel-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}
.term-tunnel-btn.small {
  padding: 5px 10px;
  font-size: 0.74rem;
}
.term-tunnel-section {
  margin-bottom: 14px;
}
.term-tunnel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.term-tunnel-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}
.term-tunnel-label i {
  color: #38bdf8;
  margin-right: 4px;
}
.term-tunnel-input-copy {
  display: flex;
  gap: 6px;
}
.term-tunnel-input-copy input,
#termTunnelUrlInput {
  flex: 1;
  padding: 8px 10px;
  background-color: #0b1120 !important;
  background: #0b1120 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 6px !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  outline: none !important;
  color-scheme: dark;
}
.term-tunnel-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.term-tunnel-copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}
.term-tunnel-mini-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}
.term-tunnel-mini-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}
.term-tunnel-pin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.term-tunnel-pin-digits {
  flex: 1;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.4rem;
  letter-spacing: 8px;
  font-weight: 700;
  color: #38bdf8;
  text-align: center;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 6px;
}
.term-tunnel-note {
  font-size: 0.71rem;
  color: #94a3b8;
  margin: 6px 0 0 0;
  line-height: 1.35;
}
.term-tunnel-qr-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  text-align: left;
}
.term-tunnel-qr-box {
  width: 140px;
  height: 140px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.2);
}
.term-tunnel-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.term-tunnel-qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.65rem;
  padding: 4px;
}
.term-tunnel-qr-desc {
  flex: 1;
}
.term-tunnel-qr-desc p {
  font-size: 0.74rem;
  color: #cbd5e1;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

/* QR Code Camera Scanner Modal & Reticle Viewport */
#termQrScannerModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100060 !important;
  background: rgba(3, 7, 18, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  display: none;
  align-items: center;
  justify-content: center;
}
#termQrScannerModal.show {
  display: flex !important;
  animation: fadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.term-qr-scanner-dialog {
  width: 92vw;
  max-width: 440px;
  background: rgba(13, 20, 36, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.term-qr-scanner-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.term-qr-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.term-qr-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.term-qr-reticle {
  position: absolute;
  inset: 18%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 7, 18, 0.55);
}
.term-qr-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #38bdf8;
}
.term-qr-corner.top-left { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.term-qr-corner.top-right { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.term-qr-corner.bottom-left { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.term-qr-corner.bottom-right { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

.term-qr-laser-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #22d3ee, transparent);
  box-shadow: 0 0 8px #38bdf8;
  animation: qrLaserScan 2s ease-in-out infinite alternate;
}
@keyframes qrLaserScan {
  0% { top: 4px; }
  100% { top: calc(100% - 6px); }
}
.term-qr-status-msg {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  text-align: center;
  font-size: 0.72rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.term-qr-actions-row {
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.term-qr-file-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.term-qr-file-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}
.term-qr-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.term-qr-action-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Button Scan QR in Remote Overlay Card */
.term-remote-btn.qr-scan {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(56, 189, 248, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 6px;
}
.term-remote-btn.qr-scan:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(56, 189, 248, 0.3));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}
.term-remote-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-size: 0.72rem;
  margin: 6px 0 10px 0;
  width: 100%;
}
.term-remote-divider::before,
.term-remote-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.term-remote-divider span {
  padding: 0 10px;
}

/* ==================== Z21 NEW UI ENHANCEMENTS ==================== */
/* Subtle radial backdrop ambient lighting */
.bg-mesh-radial {
  background-image: 
    radial-gradient(circle at 50% 40%, rgba(0, 242, 254, 0.04) 0%, transparent 60%),
    radial-gradient(circle at 10% 20%, rgba(0, 229, 163, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(138, 43, 226, 0.025) 0%, transparent 50%);
}

/* Glassmorphism panel styling */
.glass-panel {
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 242, 254, 0.16);
}

/* Glow Shadows */
.shadow-glow-cyan {
  box-shadow: 0 0 28px -5px rgba(0, 242, 254, 0.35);
}
.shadow-glow-emerald {
  box-shadow: 0 0 24px -6px rgba(0, 229, 163, 0.35);
}
.shadow-glow-subtle {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
}

/* Smooth toggle animation for prompt bar */
.prompt-dock-wrapper {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible !important;
}

/* Auto Router Hero Button Styling */
#heroAutoRouterBtn {
  transition: all 0.25s ease;
}

#heroAutoRouterBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
}

#heroAutoRouterBtn.active {
  background: rgba(0, 242, 254, 0.12) !important;
  border-color: rgba(0, 242, 254, 0.6) !important;
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.45) !important;
  color: #fff !important;
}

#heroAutoRouterBtn.active .auto-router-quantum-dot {
  background-color: #22d3ee !important;
  box-shadow: 0 0 10px #22d3ee, 0 0 20px #22d3ee !important;
  animation: pulseTeal 1.8s infinite alternate;
}

/* Responsive Mobile Enhancements (DeepSeek Style Chat Interface) */
@media (max-width: 640px) {
  /* Header: Clean & Uncluttered like DeepSeek */
  #terminalToggleBtn {
    display: none !important;
  }

  .top-nav {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .model-picker-chip {
    max-width: 142px !important;
    padding: 4px 7px 4px 9px !important;
  }

  .model-kebab-btn {
    width: 26px !important;
    padding: 0 7px 0 5px !important;
  }

  .model-picker-chip .current-model-name {
    max-width: 78px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Prompt Dock & Container */
  #promptDockWrapper,
  .prompt-dock-wrapper {
    padding-left: 10px !important;
    padding-right: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

#promptDockWrapper.dock-collapsed,
.prompt-dock-wrapper.dock-collapsed,
.composer-container.composer-collapsed #promptDockWrapper,
.composer-container.composer-collapsed .prompt-dock-wrapper {
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(28px) scale(0.97) !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 640px) {

  .composer-container {
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px)) !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Floating Translucent Borderless Composer Dock (Mobile — preserve .studio-composer-box styling) */
  .composer-box:not(.studio-composer-box),
  .composer-box:not(.studio-composer-box):hover,
  .composer-box:not(.studio-composer-box):focus-within {
    background: rgba(18, 22, 34, 0.68) !important;
    border: none !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  }
  .composer-box:not(.studio-composer-box) {
    padding: 10px 14px !important;
    border-radius: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .composer-box > .flex {
    flex-wrap: wrap !important;
    row-gap: 6px !important;
  }

  /* Top Row: Full-width Textarea with clear contrast */
  .composer-box .input-field-wrap {
    order: 1 !important;
    width: 100% !important;
    flex-basis: 100% !important;
  }

  .composer-box #promptInput {
    font-size: 14.5px !important;
    min-height: 44px !important;
    line-height: 1.45 !important;
    color: #f8fafc !important;
    padding: 2px 2px !important;
    width: 100% !important;
  }

  .composer-box #promptInput::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
    font-size: 13.5px !important;
  }

  /* Bottom Row: Tools on Left, Send Button on Right */
  .composer-box .composer-tools-left {
    order: 2 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .composer-box .composer-tools-right {
    order: 3 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Off-canvas mobile sidebar & full-width chat guarantee */
  #sidebar,
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 288px !important;
    max-width: 82vw !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
  }

  #sidebar.open,
  .sidebar.open {
    transform: translateX(0) !important;
  }

  #appContainer,
  #mainContent,
  #chatViewport {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  #singleChatContainer,
  #welcomeHero {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 440px) {
  .top-nav {
    gap: 4px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .top-nav-left {
    gap: 4px !important;
    overflow: hidden !important;
  }
  .model-picker-chip {
    max-width: 112px !important;
    padding: 3px 5px 3px 7px !important;
  }
  .model-picker-chip .current-model-name {
    max-width: 62px !important;
  }
  .top-nav-active-tool-chip {
    max-width: 102px !important;
    padding: 3px 6px !important;
  }
}

/* =========================================================================
   DUAL MODE (AI vs WHATSAPP) & WHATSAPP GATEWAY STYLES
   ========================================================================= */

/* Top Nav Mode Switcher Pill */
.chat-mode-pill-toggle {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

.chat-mode-pill-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chat-mode-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.chat-mode-pill-btn.active#btnChatModeAi {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.chat-mode-pill-btn.active#btnChatModeWa {
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.45);
  color: #25D366;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.25);
}

.wa-unread-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 0 8px #25D366;
}

/* QR Modal Tabs (Terminal Remote vs WhatsApp Gateway) */
.qr-modal-tabs-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  background: rgba(10, 16, 26, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  margin-bottom: 10px;
}

.qr-modal-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

/* Quick Switch to WhatsApp Mode Button in Terminal Toolbar */
.tb-btn-wa-switch {
  display: inline-flex !important;
  background: rgba(37, 211, 102, 0.12) !important;
  border: 1px solid rgba(37, 211, 102, 0.45) !important;
  color: #25D366 !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  height: 24px !important;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tb-btn-wa-switch:hover {
  background: rgba(37, 211, 102, 0.22) !important;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.3) !important;
}

.qr-modal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.qr-modal-tab-btn.active#tabQrTerminal {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.qr-modal-tab-btn.active#tabQrWhatsApp {
  background: rgba(37, 211, 102, 0.14);
  border-color: rgba(37, 211, 102, 0.45);
  color: #25D366;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.2);
}

.wa-status-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25D366;
}

/* WhatsApp Connected Card in Modal */
.wa-connected-card {
  padding: 16px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.wa-avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.2);
  border: 1px solid rgba(37, 211, 102, 0.5);
  color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.wa-details .wa-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #25D366;
  margin: 0;
}

.wa-details .wa-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 2px 0 0 0;
}

.wa-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

@media (max-width: 640px) {
  .wa-contact-form-grid {
    grid-template-columns: 1fr;
  }
}

.term-tunnel-inline-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
}
.term-tunnel-inline-input:focus {
  border-color: #25D366;
}

/* Sidebar History Mode Tabs */
.sidebar-history-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px;
  gap: 3px;
  margin-bottom: 8px;
}

.sidebar-hist-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-hist-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-hist-tab.active#tabSidebarAiHistory {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
}

.sidebar-hist-tab.active#tabSidebarWaHistory {
  background: rgba(37, 211, 102, 0.14);
  border-color: rgba(37, 211, 102, 0.4);
  color: #25D366;
}

.sidebar-wa-unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25D366;
  position: absolute;
  top: 5px;
  right: 6px;
}

/* WhatsApp Contact Item in Sidebar */
.wa-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  width: 100%;
  height: auto;
  min-height: 54px;
  flex: 0 0 auto;
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.wa-chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.wa-chat-item.active {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.35);
}

.wa-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.wa-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.wa-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.wa-dropdown-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.16);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.wa-contact-picker-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0;
  max-width: 245px;
  padding-left: 8px !important;
  padding-right: 10px !important;
}

.wa-chip-avatar-slot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(37, 211, 102, 0.14);
}

.wa-chip-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.wa-chip-name-label {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  line-height: 1.3;
}

.wa-chip-file-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  font-size: 0.6rem;
  flex-shrink: 0;
}

.wa-chip-avatar-slot.is-profile-trigger {
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wa-chip-avatar-slot.is-profile-trigger:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.55);
}

.wa-contact-dropdown-menu .wa-contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(380px, 60vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

.wa-contact-dropdown-menu .image-model-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 54px;
  padding: 8px 10px !important;
  flex: 0 0 auto;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.wa-contact-dropdown-menu .image-model-info {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.wa-contact-dropdown-menu .image-model-title-row {
  justify-content: flex-start;
  min-width: 0;
  gap: 6px;
}

.wa-contact-dropdown-menu .image-model-title {
  flex: 1 1 auto;
  min-width: 0;
}

.wa-contact-dropdown-menu .wa-file-badge-red {
  flex-shrink: 0;
}

.wa-contact-dropdown-menu .wa-chat-unread {
  flex-shrink: 0;
  margin-left: auto;
}

.wa-chat-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.16);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.wa-chat-header-about {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* ==================== WHATSAPP AI AGENT UI ==================== */
.wa-agent-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 211, 102, 0.32);
  background: rgba(16, 185, 129, 0.1);
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.wa-agent-top-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(37, 211, 102, 0.6);
  color: #ffffff;
}

.wa-agent-top-btn.is-active {
  border-color: rgba(37, 211, 102, 0.75);
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.24);
}

.wa-agent-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.wa-agent-status-pill.is-on {
  background: #25D366;
  color: #022c22;
}

.wa-agent-modal-card {
  width: 96vw;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: #090d16;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 28px rgba(16, 185, 129, 0.15);
}

.wa-agent-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wa-agent-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.wa-agent-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-agent-master-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wa-agent-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-agent-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.wa-agent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wa-agent-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  transition: 0.2s ease;
}

.wa-agent-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.2s ease;
}

.wa-agent-switch input:checked + .wa-agent-slider {
  background: #10b981;
}

.wa-agent-switch input:checked + .wa-agent-slider::before {
  transform: translateX(22px);
}

.wa-agent-safety-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #fde68a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.wa-agent-safety-banner i {
  color: #fbbf24;
  margin-top: 2px;
  flex-shrink: 0;
}

.wa-agent-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 14px;
}

.wa-agent-settings-card {
  display: block;
  margin-top: 12px;
}

.wa-agent-settings-inner {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-agent-settings-card .wa-agent-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.wa-agent-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

body.light-theme .wa-agent-settings-actions {
  border-top-color: rgba(15, 23, 42, 0.1);
}

.wa-agent-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wa-agent-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-agent-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.wa-agent-label-row label {
  font-size: 0.79rem;
  font-weight: 700;
  color: #e2e8f0;
}

.wa-agent-hint {
  font-size: 0.7rem;
  color: #64748b;
}

.wa-agent-input,
.wa-agent-select,
.wa-agent-textarea {
  width: 100%;
  font-size: 0.8rem;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #f1f5f9;
}

.wa-agent-textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.45;
}

.wa-agent-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wa-agent-preset-btn,
.wa-agent-mini-btn {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-agent-preset-btn:hover,
.wa-agent-mini-btn:hover {
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.wa-agent-model-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.wa-agent-params-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.wa-agent-params-row label {
  display: block;
  font-size: 0.69rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.wa-agent-checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.73rem;
  color: #cbd5e1;
  cursor: pointer;
  margin-top: 2px;
}

.wa-agent-count-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.wa-agent-manual-add-row,
.wa-agent-sim-input-row {
  display: flex;
  gap: 6px;
}

.wa-agent-search-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wa-agent-search-actions input {
  flex: 1 1 160px;
}

.wa-agent-contact-checklist {
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}

.wa-agent-contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(2, 6, 23, 0.55);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wa-agent-contact-item:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.wa-agent-contact-item.is-selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
}

.wa-agent-contact-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.wa-agent-contact-name {
  font-size: 0.79rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-agent-contact-phone {
  font-size: 0.69rem;
  font-family: monospace;
  color: #94a3b8;
}

.wa-agent-groups-note {
  font-size: 0.7rem;
  color: #f59e0b;
  padding-top: 2px;
}

.wa-agent-test-result {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.76rem;
  color: #e2e8f0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.wa-agent-activity-log {
  max-height: 175px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-agent-log-item {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.wa-agent-log-item.is-replied {
  border-left: 3px solid #10b981;
}

.wa-agent-log-item.is-skipped {
  border-left: 3px solid #f59e0b;
}

.wa-agent-log-item.is-error {
  border-left: 3px solid #ef4444;
}

.wa-agent-log-empty {
  font-size: 0.74rem;
  color: #64748b;
  text-align: center;
  padding: 12px 6px;
}

.wa-agent-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.wa-agent-save-feedback {
  font-size: 0.75rem;
  color: #34d399;
}

.wa-agent-chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.64rem;
  font-weight: 700;
  flex-shrink: 0;
}

body.light-theme .wa-agent-top-btn {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.45);
}

body.light-theme .wa-agent-modal-card {
  background: #ffffff;
  color: #0f172a;
}

body.light-theme .wa-agent-modal-header,
body.light-theme .wa-agent-modal-footer {
  border-color: rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

body.light-theme #waAiAgentModalTitle,
body.light-theme .wa-agent-label-row label,
body.light-theme .wa-agent-contact-name,
body.light-theme .wa-agent-master-bar strong {
  color: #0f172a;
}

body.light-theme .wa-agent-section,
body.light-theme .wa-agent-master-bar {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .wa-agent-input,
body.light-theme .wa-agent-select,
body.light-theme .wa-agent-textarea,
body.light-theme .wa-agent-contact-item,
body.light-theme .wa-agent-log-item,
body.light-theme .wa-agent-test-result {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .wa-agent-safety-banner {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

@media (max-width: 780px) {
  .wa-agent-grid {
    grid-template-columns: 1fr;
  }
  .wa-agent-btn-label {
    display: none;
  }
}

.wa-sidebar-sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px;
  margin-bottom: 4px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wa-avatar-badge.has-photo {
  padding: 0;
  overflow: hidden;
  border: 1.5px solid rgba(37, 211, 102, 0.55);
}

/* WhatsApp Profile Detail & Theme Preview Modal */
.wa-profile-modal-dialog {
  position: relative;
  isolation: isolate;
  max-width: 495px;
  width: 94%;
  max-height: calc(100vh - 28px);
  background: #08101c;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wa-profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 12, 24, 0.42);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

#btnCloseWaProfileModal {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

#btnCloseWaProfileModal:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.wa-profile-theme-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.62);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-profile-theme-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.wa-profile-theme-toggle-pill.is-active {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #a7f3d0;
}

.wa-profile-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.wa-profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 12, 24, 0.46);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.wa-profile-avatar-stage {
  position: relative;
  width: 152px;
  height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-profile-hero-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.18);
  border: 2.5px solid rgba(52, 211, 153, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.48), 0 0 18px var(--produce-glow, rgba(16, 185, 129, 0.28));
  color: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.wa-profile-hero-title-wrap {
  min-width: 0;
  flex: 1;
}

.wa-profile-type-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.wa-profile-hero-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-word;
}

.wa-profile-hero-phone {
  margin-top: 3px;
  font-size: 0.8rem;
  color: #94a3b8;
  font-family: var(--font-code);
}

.wa-profile-info-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-profile-info-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wa-profile-info-label {
  font-size: 0.7rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-profile-info-value {
  margin: 0;
  font-size: 0.84rem;
  color: #e2e8f0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.wa-profile-mono {
  font-family: var(--font-code);
  font-size: 0.74rem;
  color: #94a3b8;
}

.wa-profile-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wa-profile-actions-bar .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.wa-chat-info {
  flex: 1;
  min-width: 0;
}

.wa-chat-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wa-chat-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-time {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: monospace;
}

.wa-chat-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.wa-chat-preview {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.wa-chat-file-pill,
.wa-file-badge-red {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.wa-chat-unread {
  flex-shrink: 0;
  background: #25D366;
  color: #07090e;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}

/* WhatsApp Message Row in Chat */
.wa-chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 12px;
  margin: 8px 12px 14px;
}

.wa-chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-chat-header-name {
  font-weight: 700;
  color: #25D366;
  font-size: 0.88rem;
}

.wa-chat-header-phone {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: monospace;
}

.wa-chat-header-actions button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.wa-chat-header-actions button:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.wa-bubble-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  max-width: 82%;
}

.wa-bubble-sent {
  align-self: flex-end;
  margin-left: auto;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 14px 14px 2px 14px;
  padding: 10px 14px;
  color: #f1f5f9;
}

.wa-bubble-received {
  align-self: flex-start;
  margin-right: auto;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 14px 2px;
  padding: 10px 14px;
  color: #f1f5f9;
}

.wa-bubble-sender {
  font-size: 0.7rem;
  font-weight: 700;
  color: #25D366;
  margin-bottom: 3px;
}

.wa-bubble-text {
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
}

.wa-bubble-meta i {
  color: #38bdf8;
}

/* WhatsApp Media & Photo Bubble */
.wa-bubble-image-wrap {
  margin: 4px 0 6px 0;
  border-radius: 10px;
  overflow: hidden;
  max-width: 320px;
  cursor: pointer;
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.wa-chat-img-thumb {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-bubble-image-wrap:hover .wa-chat-img-thumb {
  transform: scale(1.025);
}

/* WhatsApp Sticker Bubble */
.wa-bubble-sticker-wrap {
  margin: 4px 0 4px 0;
  width: 136px;
  max-width: 48vw;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border-radius: 10px;
  overflow: visible;
}

.wa-chat-sticker-img {
  width: 136px;
  max-width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-bubble-sticker-wrap:hover .wa-chat-sticker-img {
  transform: scale(1.05);
}

.wa-bubble-sticker-pending {
  margin: 4px 0 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(56, 189, 248, 0.42);
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.wa-bubble-sticker-pending:hover {
  border-color: rgba(45, 212, 191, 0.7);
  background: rgba(45, 212, 191, 0.08);
}

.wa-bubble-video-wrap {
  margin: 6px 0 4px 0;
  max-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
}

/* WhatsApp File Message: Red Profile Accent (Tandai Merah Profil Pengirim Berkas) */
.wa-bubble-wrap.wa-bubble-has-file {
  border-left: 3.5px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

.wa-sender-red {
  color: #f87171 !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-bottom: 4px !important;
}

.wa-sender-red .wa-sender-avatar-red-dot {
  font-size: 0.65rem;
  line-height: 1;
  display: inline-block;
  animation: pulseRedDot 2s infinite ease-in-out;
}

.wa-sender-red .wa-file-badge-red {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.38);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wa-bubble-sender-me.wa-sender-red {
  display: flex !important;
  justify-content: flex-end !important;
  margin-bottom: 4px !important;
}

.wa-contact-file-dot-red {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #0f172a;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.85);
  display: inline-block;
}

.wa-active-contact-file-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

@keyframes pulseRedDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

.wa-media-placeholder-badge {
  padding: 12px 16px;
  font-size: 0.8rem;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
}

/* WhatsApp Document Card */
.wa-doc-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  max-width: 340px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.18s ease;
}

.wa-doc-card:hover {
  border-color: rgba(37, 211, 102, 0.35);
}

.wa-doc-card-top,
.wa-doc-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-doc-details,
.wa-doc-info {
  flex: 1;
  min-width: 0;
}

.wa-doc-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.wa-doc-card:hover .wa-doc-icon-box {
  transform: scale(1.05);
}

/* Badge accents by file type */
.wa-doc-badge-pdf .wa-doc-icon-box {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.wa-doc-badge-word .wa-doc-icon-box {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.wa-doc-badge-excel .wa-doc-icon-box {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.wa-doc-badge-img .wa-doc-icon-box {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.wa-doc-badge-zip .wa-doc-icon-box {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.wa-doc-badge-generic .wa-doc-icon-box {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.wa-doc-details {
  flex: 1;
  min-width: 0;
}

.wa-doc-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.wa-doc-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-doc-card-actions,
.wa-doc-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-wa-doc-preview,
.btn-wa-doc-download {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-wa-doc-preview {
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25D366;
}

.btn-wa-doc-preview:hover {
  background: rgba(37, 211, 102, 0.26);
  color: #4ade80;
  border-color: #25D366;
  transform: translateY(-1px);
}

.btn-wa-doc-download {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.btn-wa-doc-download:hover {
  background: rgba(56, 189, 248, 0.26);
  color: #7dd3fc;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* WhatsApp In-Modal Direct Document Viewer */
.wa-docx-paper-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-docx-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.wa-docx-sheet {
  background: #ffffff;
  color: #1e293b;
  padding: 32px 36px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.96rem;
  line-height: 1.75;
  overflow-x: auto;
  user-select: text;
}

.wa-docx-sheet h1,
.wa-docx-sheet h2,
.wa-docx-sheet h3 {
  color: #0f172a;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  font-weight: 700;
  line-height: 1.3;
}

.wa-docx-sheet h1 { font-size: 1.5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }
.wa-docx-sheet h2 { font-size: 1.3rem; }
.wa-docx-sheet h3 { font-size: 1.15rem; }

.wa-docx-sheet p {
  margin: 0 0 10px 0;
  color: #334155;
}

.wa-docx-sheet table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.9rem;
}

.wa-docx-sheet table th,
.wa-docx-sheet table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
}

.wa-docx-sheet table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}

.wa-docx-sheet table tr:nth-child(even) td {
  background: #f8fafc;
}

.wa-thumb-blurred {
  filter: blur(4px);
  transform: scale(1.05);
}

.wa-img-load-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 1.2rem;
  backdrop-filter: blur(4px);
  transition: transform 0.15s ease, background 0.15s ease;
}

.wa-bubble-image-wrap:hover .wa-img-load-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0, 0, 0, 0.85);
}

.btn-wa-doc-download:hover {
  background: rgba(56, 189, 248, 0.26);
  color: #7dd3fc;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* WhatsApp Pairing Method Switcher (QR vs Phone Code) */
.wa-pair-method-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
  gap: 3px;
  margin-bottom: 12px;
}

.wa-pair-method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-pair-method-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.wa-pair-method-btn.active {
  background: rgba(37, 211, 102, 0.16);
  border-color: rgba(37, 211, 102, 0.45);
  color: #25D366;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

/* WhatsApp Pairing Code Box */
.wa-pairing-code-box {
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 12px;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(37, 211, 102, 0.05);
}

.wa-pairing-code-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.wa-pairing-code-display {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #25D366;
  text-shadow: 0 0 16px rgba(37, 211, 102, 0.45);
  padding: 10px 0;
  background: rgba(37, 211, 102, 0.06);
  border-radius: 8px;
  border: 1px dashed rgba(37, 211, 102, 0.4);
  margin-bottom: 12px;
  user-select: all;
}

.wa-pairing-instructions {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: left;
}

/* ==================== REAL-TIME LIVE PREVIEW STREAM HUD (v485) ==================== */
.studio-preview-stream-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 14px rgba(0, 240, 255, 0.25);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.studio-preview-stream-hud.is-success {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 14px rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.stream-hud-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  animation: hudPulse 1.3s ease-in-out infinite;
}

.studio-preview-stream-hud.is-success .stream-hud-pulse {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: none;
}

@keyframes hudPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.3); }
}












/* =========================================================================
   WHATSAPP THREE-DOTS MENU, CONSENT GATE & AI SUMMARY POP-UP
   ========================================================================= */
.wa-contact-dots-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.55);
    color: #94a3b8;
    font-size: 0.78rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.16s ease;
    margin-left: 4px;
}

.wa-contact-dots-btn:hover,
.wa-contact-dots-btn.active {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.wa-contact-dots-menu {
    position: fixed;
    z-index: 99999;
    min-width: 195px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
    padding: 6px;
    backdrop-filter: blur(14px);
    animation: waDotsMenuFadeIn 0.14s ease-out;
}

@keyframes waDotsMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wa-dots-menu-header {
    padding: 6px 10px 7px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.wa-dots-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}

.wa-dots-menu-item:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.wa-dots-menu-item.danger {
    color: #fca5a5;
}

.wa-dots-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #fecaca;
}

.wa-consent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.65);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.wa-consent-item:hover {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.07);
}

.wa-consent-item.selected {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.13);
}

.wa-consent-checkbox {
    width: 17px;
    height: 17px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

/* =========================================================================
   WHATSAPP SUMMARY MODAL - PURE BLACK PROFESSIONAL MINIMALIST THEME
   ========================================================================= */
#modalWaSummaryResult {
    background: rgba(0, 0, 0, 0.82) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

#modalWaSummaryResult .modal-dialog {
    background: #000000 !important;
    border: 1px solid #222222 !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.98), 0 0 1px rgba(255, 255, 255, 0.12) !important;
}

#modalWaSummaryResult .modal-header {
    background: #050505 !important;
    border-bottom: 1px solid #1a1a1a !important;
}

#modalWaSummaryResult .modal-footer {
    background: #050505 !important;
    border-top: 1px solid #1a1a1a !important;
}

.wa-summary-active-model-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #09090b;
    border: 1px solid #222222;
    border-radius: 6px;
    font-size: 0.74rem;
}

.wa-summary-active-model-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #a1a1aa;
}

.wa-summary-active-model-name {
    color: #ffffff;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #18181b;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #27272a;
}

#btnStartWaSummary {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}

#btnStartWaSummary:hover {
    background: #f4f4f5 !important;
    color: #000000 !important;
}

#btnStartWaSummary:active {
    transform: scale(0.97);
    background: #e4e4e7 !important;
    opacity: 0.9;
}

#btnCopyWaSummaryOutput,
#btnSendWaSummaryToAiChat,
.wa-summary-close-btn,
.wa-contact-dots-btn,
.wa-contact-action-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}

#btnCopyWaSummaryOutput:active,
#btnSendWaSummaryToAiChat:active,
.wa-summary-close-btn:active,
.wa-contact-dots-btn:active,
.wa-contact-action-item:active {
    transform: scale(0.96);
    opacity: 0.85;
}

.wa-summary-content-box {
    font-family: var(--font-reading);
    color: #e2e8f0;
    line-height: 1.72;
    font-size: 1.08rem;
}

.wa-summary-content-box h1,
.wa-summary-content-box h2,
.wa-summary-content-box h3,
.wa-summary-content-box h4 {
    color: #ffffff !important;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.wa-summary-content-box h1 { font-size: 1.4em; }
.wa-summary-content-box h2 { font-size: 1.25em; }
.wa-summary-content-box h3 { font-size: 1.12em; }

.wa-summary-content-box p {
    margin: 10px 0;
    color: #e4e4e7;
}

.wa-summary-content-box strong {
    color: #ffffff;
    font-weight: 700;
}

.wa-summary-content-box ul,
.wa-summary-content-box ol {
    margin: 8px 0 14px;
    padding-left: 22px;
    color: #e2e8f0;
}

.wa-summary-content-box ul {
    list-style-type: disc;
}

.wa-summary-content-box ol {
    list-style-type: decimal;
}

.wa-summary-content-box li {
    margin-bottom: 5px;
}

.wa-summary-content-box code {
    background: #18181b;
    border: 1px solid #27272a;
    color: #f4f4f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.82em;
}

.wa-summary-content-box blockquote {
    border-left: 3px solid #3f3f46;
    background: #09090b;
    padding: 8px 12px;
    margin: 10px 0;
    color: #a1a1aa;
    border-radius: 0 6px 6px 0;
}

#waSummaryContactSelect option {
    background-color: #09090b;
    color: #f4f4f5;
    padding: 8px 12px;
}

/* =========================================================================
   GROUNDED CONVERSATIONAL IMAGE DISPLAY (single | gallery | collage)
   ========================================================================= */
.zoz-grounded-image-display {
    margin: 14px 0 16px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(13, 18, 30, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.18);
    box-shadow: 0 8px 26px -8px rgba(0, 0, 0, 0.55);
}

.zoz-grounded-grid {
    display: grid;
    gap: 12px;
}

.zoz-grounded-image-display.zoz-layout-single .zoz-grounded-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 640px;
}

.zoz-grounded-image-display.zoz-layout-gallery .zoz-grounded-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.zoz-grounded-image-display.zoz-layout-collage[data-count="2"] .zoz-grounded-grid {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16 / 9;
}

.zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-grid {
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    max-height: 420px;
}

.zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-figure {
    height: 100%;
}

.zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-img-frame {
    height: 100%;
    min-height: 0;
}

.zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-figure:first-child {
    grid-row: 1 / span 2;
}

/* Sembunyikan caption internal kartu thumbnail pendukung agar kolase bersih ala ChatGPT */
.zoz-grounded-image-display.zoz-layout-collage[data-count="3"] .zoz-grounded-figure:not(:first-child) .zoz-grounded-figcaption {
    display: none;
}
.zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-figure:first-child .zoz-grounded-figcaption {
    padding: 6px 10px;
    font-size: 0.72rem;
}

/* Badge Counter Editorial ala ChatGPT (+N Foto atau Total Foto) */
.zoz-grounded-more-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.02em;
}

/* Tampilan Mobile: Pertahankan Kolase 2 Kolom Proporsional ala ChatGPT */
@media (max-width: 640px) {
    .zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-grid {
        grid-template-columns: 1.25fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 6px !important;
        max-height: 280px;
    }
    .zoz-grounded-image-display.zoz-layout-collage .zoz-grounded-figure:first-child {
        grid-row: 1 / span 2 !important;
    }
}

.zoz-grounded-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(8, 11, 19, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.zoz-grounded-img-frame {
    position: relative;
    width: 100%;
    min-height: 150px;
    max-height: 440px;
    background: linear-gradient(110deg, rgba(30, 41, 59, 0.55) 25%, rgba(51, 65, 85, 0.45) 37%, rgba(30, 41, 59, 0.55) 63%);
    background-size: 200% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zoz-grounded-figure[data-render-state="rendered"] .zoz-grounded-img-frame {
    background: rgba(7, 10, 18, 0.92);
}

.zoz-grounded-img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    border-radius: 0 !important;
    cursor: zoom-in;
    transition: transform 0.22s ease, opacity 0.2s ease;
}

.zoz-grounded-image-display.zoz-layout-single .zoz-grounded-img {
    object-fit: contain;
    background: rgba(5, 8, 15, 0.95);
}

.zoz-grounded-img:hover {
    transform: scale(1.015);
}

.zoz-grounded-figcaption {
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.76rem;
    line-height: 1.4;
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.zoz-grounded-caption-title {
    font-weight: 600;
    color: #f1f5f9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zoz-grounded-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.71rem;
    color: #94a3b8;
}

.zoz-grounded-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.zoz-grounded-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.32);
    color: #7dd3fc;
}

.zoz-grounded-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.zoz-grounded-category-pill.cat-ai {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.38);
    color: #fcd34d;
}

.zoz-grounded-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.zoz-grounded-links a,
.zoz-grounded-credit-text a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

.zoz-grounded-links a:hover,
.zoz-grounded-credit-text a:hover {
    text-decoration: underline;
}

.zoz-grounded-fallback-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(30, 41, 59, 0.5);
    color: #cbd5e1;
    font-size: 0.78rem;
}

.zoz-grounded-fallback-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fbbf24;
    font-weight: 600;
}

/* ==================== JOZZ MEMORY & INCOGNITO UI (HYBRID STORAGE & KNOWLEDGE GRAPH) ==================== */
.top-action-btn.incognito-active {
  background: rgba(192, 132, 252, 0.22) !important;
  color: #c084fc !important;
  border: 1px solid rgba(192, 132, 252, 0.55) !important;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.4) !important;
}

.memory-receipts-badge-wrap {
  display: flex;
  margin-top: 8px;
  margin-bottom: 2px;
}

.memory-receipts-badge-wrap.in-meta {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.memory-receipts-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 9999px;
  color: var(--neon-cyan);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.memory-receipts-badge-wrap.in-meta .memory-receipts-badge {
  gap: 5px;
  padding: 2px 9px;
  font-size: 0.67rem;
  line-height: 1.3;
}

.memory-receipts-badge:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

/* ==================== PENCARIAN RIWAYAT OBROLAN (CITATIONS & JUMP HIGHLIGHT) ==================== */
.chat-history-refs-wrap {
  margin-top: 10px;
  padding: 8px 11px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-history-refs-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.chat-history-refs-header i {
  color: var(--neon-cyan);
}

.chat-history-refs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-history-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 9999px;
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.chat-history-ref-chip:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.28);
  transform: translateY(-1px);
}

.chat-history-ref-chip i.fa-message,
.chat-history-ref-chip i.fa-comments {
  color: var(--neon-cyan);
  font-size: 0.68rem;
  flex-shrink: 0;
}

.chat-history-ref-title {
  font-weight: 600;
  color: var(--neon-cyan);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-ref-age {
  font-size: 0.66rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-history-ref-jump {
  font-size: 0.63rem;
  color: #7dd3fc;
  opacity: 0.78;
  flex-shrink: 0;
}

@keyframes zozHistoryPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.55);
    background-color: rgba(0, 240, 255, 0.12);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(0, 240, 255, 0.18);
    background-color: rgba(0, 240, 255, 0.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
    background-color: transparent;
  }
}

.message-row.chat-history-jump-highlight {
  border-radius: 12px;
  animation: zozHistoryPulse 2.4s ease-out forwards;
}

body.light-theme .chat-history-refs-wrap {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(14, 116, 144, 0.25);
}

body.light-theme .chat-history-refs-header,
body.light-theme .chat-history-ref-age {
  color: #475569;
}

body.light-theme .chat-history-ref-chip {
  background: rgba(14, 116, 144, 0.08);
  border-color: rgba(14, 116, 144, 0.25);
  color: #0f172a;
}

body.light-theme .chat-history-ref-title {
  color: #0e7490;
}

@media (max-width: 640px) {
  .chat-history-ref-chip {
    max-width: 100%;
    padding: 5px 9px;
  }
  .chat-history-ref-title {
    max-width: 155px;
  }
}

.jozz-cat-pill {
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
}

.jozz-cat-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.jozz-cat-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.jozz-tab-btn.active {
  background: rgba(0, 240, 255, 0.15) !important;
  color: var(--neon-cyan) !important;
}

.jozz-memory-item-card {
  background: rgba(13, 19, 33, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.jozz-memory-item-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.jozz-mem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.jozz-mem-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.jozz-mem-tag.preference {
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #d8b4fe;
}

.jozz-mem-tag.technical_stack {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.jozz-mem-tag.project_context {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.jozz-mem-tag.general_fact,
.jozz-mem-tag.fact,
.jozz-mem-tag.general {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.jozz-mem-tag.instruction {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #38bdf8;
}

.jozz-mem-tag.error_lesson {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.jozz-mem-tag.episodic_context {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.jozz-mem-content {
  color: #f1f5f9;
  font-size: 0.83rem;
  line-height: 1.55;
  word-break: break-word;
}

.jozz-mem-meta-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.jozz-mem-actions {
  display: flex;
  gap: 8px;
}

.jozz-mem-action-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.18s ease;
}

.jozz-mem-action-btn.edit:hover {
  color: var(--neon-cyan);
}

.jozz-mem-action-btn.delete:hover {
  color: #f87171;
}

.jozz-insight-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.jozz-insight-metric-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jozz-insight-metric-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--neon-cyan);
}

.jozz-insight-metric-lbl {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ==================== NEW CHAT MODE POPUP & SESSION INDICATOR ==================== */
.new-chat-mode-card {
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.new-chat-mode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

#btnSelectNormalChat:hover {
  background: rgba(0, 240, 255, 0.08) !important;
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25) !important;
}

#btnSelectIncognitoChat:hover {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: #c084fc !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25) !important;
}

.session-mode-badge {
  user-select: none;
}

.session-mode-badge:hover {
  filter: brightness(1.2);
}

.session-mode-badge.incognito {
  background: rgba(168, 85, 247, 0.16) !important;
  border-color: rgba(168, 85, 247, 0.45) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3) !important;
}

.session-mode-badge.incognito i {
  color: #c084fc !important;
}

.session-mode-badge.incognito span {
  color: #e9d5ff !important;
}

/* ==================== KATEX & MATHEMATICAL EQUATION RENDERING ==================== */
.katex-display {
  display: block;
  margin: 0.85rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0.25rem;
  max-width: 100%;
  scrollbar-width: thin;
}

.katex-display > .katex {
  white-space: normal;
  text-align: center;
}

.katex {
  font-size: 1.12em;
  text-rendering: auto;
  color: #f1f5f9;
}

html:not(.katex-css-ok) .katex .katex-html {
  display: none !important;
}

html:not(.katex-css-ok) .katex .katex-mathml math {
  font-family: 'Cambria Math', 'Latin Modern Math', 'STIX Two Math', serif;
}

html.katex-css-ok .katex .katex-html {
  display: inline-block;
}

html.katex-css-ok .katex .katex-mathml {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
}

.zoz-math-formula {
  font-family: 'KaTeX_Math', 'Cambria Math', 'Times New Roman', serif;
}

.zoz-math-formula.display-math {
  display: block;
  margin: 0.9rem 0;
  overflow-x: auto;
  text-align: center;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  font-size: 1.12em;
}

.zoz-math-formula.inline-math {
  display: inline;
  padding: 0.12em 0.38em;
  margin: 0 0.12em;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  font-size: 1.02em;
}

/* =====================================================================
   PROFILE & CONTACT PREVIEW SCENES (AURORA / STARLIGHT / OCEAN) & PRODUCE HALO
   ===================================================================== */

.wa-chat-header-avatar.is-profile-trigger,
.wa-chat-header-name.is-profile-trigger,
.wa-chat-avatar.is-profile-trigger,
.wa-dropdown-avatar.is-profile-trigger {
  cursor: pointer;
}

.wa-chat-header-avatar.is-profile-trigger:hover,
.wa-chat-avatar.is-profile-trigger:hover,
.wa-dropdown-avatar.is-profile-trigger:hover {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.6);
}

.wa-chat-header-name.is-profile-trigger:hover {
  color: #6ee7b7;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Scene Layer Base on Profile & Contact Preview Modal */
.wa-profile-scene-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 24%, rgba(16, 185, 129, 0.16), rgba(8, 15, 28, 0.98) 74%);
}

.wa-call-scene-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}

/* Scene 1: Kristal Aurora Borealis */
.wa-profile-modal-dialog[data-scene="aurora"] .wa-profile-scene-bg {
  background: linear-gradient(160deg, #031521 0%, #052635 45%, #0e102d 100%);
}

.wa-profile-modal-dialog[data-scene="aurora"] .wa-call-scene-aurora {
  opacity: 1;
}

.wa-aurora-ribbon {
  position: absolute;
  inset: -35%;
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.wa-aurora-r1 {
  background: radial-gradient(ellipse 65% 32% at 30% 28%, rgba(45, 212, 191, 0.72), transparent 72%),
              radial-gradient(ellipse 55% 28% at 75% 42%, rgba(56, 189, 248, 0.55), transparent 72%);
  animation: waAuroraDriftA 11s ease-in-out infinite alternate;
}

.wa-aurora-r2 {
  background: radial-gradient(ellipse 60% 30% at 68% 24%, rgba(168, 85, 247, 0.58), transparent 70%),
              radial-gradient(ellipse 50% 26% at 24% 62%, rgba(52, 211, 153, 0.55), transparent 72%);
  animation: waAuroraDriftB 14s ease-in-out infinite alternate;
}

.wa-aurora-r3 {
  background: conic-gradient(from 120deg at 50% 42%, rgba(103, 232, 249, 0.22), rgba(192, 132, 252, 0.2), rgba(110, 231, 183, 0.25), rgba(103, 232, 249, 0.22));
  animation: waAuroraSpin 20s linear infinite;
}

.wa-aurora-crystal-facets {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 26%, transparent 27%),
    linear-gradient(235deg, rgba(165, 243, 252, 0.15) 0%, transparent 32%),
    linear-gradient(35deg, transparent 58%, rgba(216, 180, 254, 0.14) 76%, rgba(255, 255, 255, 0.2) 100%),
    linear-gradient(305deg, transparent 62%, rgba(110, 231, 183, 0.14) 84%, transparent 100%);
}

@keyframes waAuroraDriftA {
  0% { transform: translate(-4%, -3%) rotate(-4deg) scale(1); }
  100% { transform: translate(5%, 4%) rotate(5deg) scale(1.08); }
}

@keyframes waAuroraDriftB {
  0% { transform: translate(4%, 3%) rotate(4deg) scale(1.04); }
  100% { transform: translate(-5%, -4%) rotate(-6deg) scale(0.96); }
}

@keyframes waAuroraSpin {
  from { transform: rotate(0deg) scale(1.1); }
  to { transform: rotate(360deg) scale(1.1); }
}

/* Scene 2: Gelap Disinari Bintang Kecil */
.wa-profile-modal-dialog[data-scene="starlight"] .wa-profile-scene-bg {
  background: radial-gradient(ellipse at 50% 18%, #0f172a 0%, #050814 55%, #020308 100%);
}

.wa-profile-modal-dialog[data-scene="starlight"] .wa-call-scene-starlight {
  opacity: 1;
}

.wa-starfield {
  position: absolute;
  inset: 0;
}

.wa-starfield-sm {
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.92), transparent),
    radial-gradient(1px 1px at 26% 64%, rgba(224, 242, 254, 0.85), transparent),
    radial-gradient(1px 1px at 41% 12%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 58% 36%, rgba(191, 219, 254, 0.95), transparent),
    radial-gradient(1px 1px at 73% 19%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 88% 52%, rgba(254, 249, 195, 0.88), transparent),
    radial-gradient(1px 1px at 18% 84%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 64% 78%, rgba(224, 242, 254, 0.82), transparent),
    radial-gradient(1px 1px at 91% 86%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 34% 44%, rgba(255, 255, 255, 0.75), transparent);
  background-size: 210px 210px;
  animation: waStarTwinkleA 3.6s ease-in-out infinite alternate;
}

.wa-starfield-md {
  background-image:
    radial-gradient(1.6px 1.6px at 8% 34%, rgba(255, 255, 255, 0.96), transparent),
    radial-gradient(1.5px 1.5px at 47% 28%, rgba(186, 230, 253, 0.95), transparent),
    radial-gradient(1.8px 1.8px at 82% 14%, rgba(254, 240, 138, 0.95), transparent),
    radial-gradient(1.5px 1.5px at 22% 72%, rgba(255, 255, 255, 0.92), transparent),
    radial-gradient(1.6px 1.6px at 77% 68%, rgba(224, 242, 254, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 53% 90%, rgba(255, 255, 255, 0.94), transparent);
  background-size: 270px 270px;
  animation: waStarTwinkleB 5.2s ease-in-out infinite alternate;
}

.wa-starfield-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 34%, rgba(147, 197, 253, 0.14), transparent 58%);
}

@keyframes waStarTwinkleA {
  0% { opacity: 0.52; transform: translateY(0); }
  100% { opacity: 0.98; transform: translateY(-2px); }
}

@keyframes waStarTwinkleB {
  0% { opacity: 0.88; transform: scale(1); }
  100% { opacity: 0.42; transform: scale(1.02); }
}

/* Scene 3: Air Laut */
.wa-profile-modal-dialog[data-scene="ocean"] .wa-profile-scene-bg {
  background: linear-gradient(180deg, #063852 0%, #05516d 38%, #033349 74%, #021d2b 100%);
}

.wa-profile-modal-dialog[data-scene="ocean"] .wa-call-scene-ocean {
  opacity: 1;
}

.wa-ocean-caustics {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 46% 24% at 32% 18%, rgba(103, 232, 249, 0.28), transparent 70%),
    radial-gradient(ellipse 52% 28% at 72% 24%, rgba(56, 189, 248, 0.24), transparent 72%),
    radial-gradient(ellipse 44% 20% at 48% 58%, rgba(45, 212, 191, 0.18), transparent 70%);
  animation: waOceanCausticDrift 9s ease-in-out infinite alternate;
}

.wa-ocean-wave {
  position: absolute;
  left: -25%;
  right: -25%;
  height: 180px;
  border-radius: 45%;
  background: rgba(56, 189, 248, 0.11);
  border-top: 1px solid rgba(165, 243, 252, 0.24);
}

.wa-ocean-w1 {
  bottom: -90px;
  animation: waOceanWaveFloat 7s ease-in-out infinite alternate;
}

.wa-ocean-w2 {
  bottom: -115px;
  background: rgba(34, 211, 238, 0.12);
  animation: waOceanWaveFloat 10s ease-in-out infinite alternate-reverse;
}

.wa-ocean-bubbles span {
  position: absolute;
  bottom: -18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(165, 243, 252, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: waOceanBubbleRise 7s linear infinite;
}

.wa-ocean-bubbles span:nth-child(1) { left: 10%; width: 7px; height: 7px; animation-duration: 6.2s; animation-delay: 0s; }
.wa-ocean-bubbles span:nth-child(2) { left: 22%; width: 11px; height: 11px; animation-duration: 8.1s; animation-delay: 1.4s; }
.wa-ocean-bubbles span:nth-child(3) { left: 37%; width: 6px; height: 6px; animation-duration: 5.5s; animation-delay: 2.3s; }
.wa-ocean-bubbles span:nth-child(4) { left: 52%; width: 10px; height: 10px; animation-duration: 7.4s; animation-delay: 0.7s; }
.wa-ocean-bubbles span:nth-child(5) { left: 66%; width: 8px; height: 8px; animation-duration: 6.7s; animation-delay: 3.1s; }
.wa-ocean-bubbles span:nth-child(6) { left: 78%; width: 12px; height: 12px; animation-duration: 8.6s; animation-delay: 1.9s; }
.wa-ocean-bubbles span:nth-child(7) { left: 89%; width: 7px; height: 7px; animation-duration: 5.9s; animation-delay: 4.0s; }
.wa-ocean-bubbles span:nth-child(8) { left: 45%; width: 5px; height: 5px; animation-duration: 5.1s; animation-delay: 2.8s; }

@keyframes waOceanCausticDrift {
  0% { transform: translate(-2%, 0) scale(1); }
  100% { transform: translate(3%, 2%) scale(1.06); }
}

@keyframes waOceanWaveFloat {
  0% { transform: translateX(-4%) rotate(-2deg); }
  100% { transform: translateX(4%) rotate(2deg); }
}

@keyframes waOceanBubbleRise {
  0% { transform: translateY(0) scale(0.75); opacity: 0; }
  15% { opacity: 0.75; }
  85% { opacity: 0.65; }
  100% { transform: translateY(-480px) scale(1.15); opacity: 0; }
}

/* Top Bar inside Call Modal */
.wa-produce-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.wa-produce-orbit-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: rgba(10, 18, 32, 0.84);
  border: 1.5px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.52), 0 0 12px var(--produce-glow, rgba(255, 255, 255, 0.22));
  backdrop-filter: blur(4px);
  transform: translate(var(--orbit-tx, 0px), var(--orbit-ty, 0px));
  animation: waProduceBob 3.4s ease-in-out infinite alternate;
  animation-delay: var(--orbit-delay, 0s);
}

@keyframes waProduceBob {
  0% { transform: translate(var(--orbit-tx, 0px), var(--orbit-ty, 0px)) scale(0.95) rotate(-5deg); }
  100% { transform: translate(var(--orbit-tx, 0px), calc(var(--orbit-ty, 0px) - 3px)) scale(1.07) rotate(6deg); }
}

/* Produce Theme Glow Accents */
[data-produce="apple"] {
  --produce-glow: rgba(248, 113, 113, 0.55);
}
[data-produce="apple"] .wa-profile-hero-avatar {
  border-color: rgba(248, 113, 113, 0.85);
}

[data-produce="carrot"] {
  --produce-glow: rgba(251, 146, 60, 0.58);
}
[data-produce="carrot"] .wa-profile-hero-avatar {
  border-color: rgba(251, 146, 60, 0.88);
}

[data-produce="banana"] {
  --produce-glow: rgba(250, 204, 21, 0.58);
}
[data-produce="banana"] .wa-profile-hero-avatar {
  border-color: rgba(250, 204, 21, 0.88);
}

[data-produce="broccoli"] {
  --produce-glow: rgba(74, 222, 128, 0.58);
}
[data-produce="broccoli"] .wa-profile-hero-avatar {
  border-color: rgba(74, 222, 128, 0.88);
}

[data-produce="garden"] {
  --produce-glow: rgba(45, 212, 191, 0.56);
}
[data-produce="garden"] .wa-profile-hero-avatar {
  border-color: rgba(45, 212, 191, 0.88);
}

/* Customizer Panel inside Profile Preview */
.wa-profile-customizer-panel {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wa-profile-info-card {
  background: rgba(6, 12, 24, 0.52) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
}

.wa-customizer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-customizer-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-theme-pills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.wa-theme-pill,
.wa-produce-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.wa-theme-pill:hover,
.wa-produce-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.34);
}

.wa-theme-pill.is-active,
.wa-produce-pill.is-active {
  background: rgba(16, 185, 129, 0.24);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.wa-theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.wa-swatch-aurora {
  background: linear-gradient(135deg, #2dd4bf, #38bdf8, #c084fc);
}

.wa-swatch-starlight {
  background: radial-gradient(circle at 35% 35%, #ffffff 1.5px, #020617 3px);
}

.wa-swatch-ocean {
  background: linear-gradient(160deg, #06b6d4, #0369a1);
}

.wa-swatch-default {
  background: #0f172a;
}

.wa-produce-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wa-theme-sync-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.wa-theme-sync-toggle input {
  accent-color: #10b981;
}

/* Scenic Contact Preview Chat Backdrop when Enabled */
#mainContent.wa-chat-themed[data-wa-scene="aurora"] {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0%, transparent 32%),
    linear-gradient(155deg, rgba(6, 78, 59, 0.42), rgba(14, 116, 144, 0.34) 52%, rgba(88, 28, 135, 0.38)) !important;
}

#mainContent.wa-chat-themed[data-wa-scene="starlight"] {
  background-color: #030612 !important;
  background-image:
    radial-gradient(1.2px 1.2px at 14% 22%, rgba(255, 255, 255, 0.72), transparent),
    radial-gradient(1px 1px at 42% 68%, rgba(191, 219, 254, 0.65), transparent),
    radial-gradient(1.4px 1.4px at 78% 32%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.1px 1.1px at 89% 74%, rgba(254, 249, 195, 0.6), transparent),
    linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(15, 23, 42, 0.68)) !important;
  background-size: 240px 240px, 240px 240px, 240px 240px, 240px 240px, 100% 100% !important;
}

#mainContent.wa-chat-themed[data-wa-scene="ocean"] {
  background:
    radial-gradient(ellipse 60% 25% at 30% 15%, rgba(103, 232, 249, 0.18), transparent 70%),
    linear-gradient(180deg, #042b40 0%, #06445e 52%, #022030 100%) !important;
}

@media (max-width: 540px) {
  .wa-theme-pills-grid {
    grid-template-columns: 1fr;
  }
  .wa-profile-hero {
    flex-direction: column;
    text-align: center;
  }
  .wa-profile-avatar-stage {
    width: 136px;
    height: 136px;
  }
  .wa-profile-hero-avatar {
    width: 70px;
    height: 70px;
  }
}

/* =========================================================================
   ZERO-FOUC & OFFLINE-RESILIENT CORE UI RULES
   Guarantees crisp layout, buttons, icons, and flex containers even before
   Tailwind CDN executes or when running offline / LAN-only.
   ========================================================================= */
body {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-1 {
  flex: 1 1 0%;
}

.shrink-0 {
  flex-shrink: 0;
}

.min-h-0 {
  min-height: 0;
}

.min-w-0 {
  min-width: 0;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* SVG / Lucide Icon Explicit Sizing Fallbacks */
svg.lucide,
.w-4.h-4 {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.w-3.h-3 {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.w-3\.5.h-3\.5 {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.w-5.h-5 {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.w-6.h-6 {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Top Nav Action Buttons (#terminalToggleBtn, #btnTopBarRemoteQr, #endocrineMonitorBtn) */
.top-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.top-action-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
}

#endocrineMonitorBtn.top-action-btn {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

#endocrineMonitorBtn.top-action-btn:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #a7f3d0;
}

/* Sidebar WhatsApp Chat Top Button (Matches .terminal-top-btn) */
.wa-top-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08);
}

.wa-top-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(5, 150, 105, 0.16));
  border-color: #34d399;
  color: #ecfdf5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22);
}

/* Search History Box SVG Alignment (Matches .search-history-box i) */
.search-history-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* Sidebar Brand Row & Mobile Close Button Fallbacks */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 6px;
}

#sidebarBrandLogoBtn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

#sidebarBrandLogoBtn img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

#closeMobileSidebarBtn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 768px) {
  #closeMobileSidebarBtn {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .terminal-toolbar .terminal-title {
    display: none !important;
  }
  #btnTermMobileConnect .mobile-connect-label {
    display: none !important;
  }
}

.status-item > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#heroAutoRouterBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

/* =========================================================================
   AI CHAT FRUIT & NATURE THEMES + TOP-BAR THEME PICKER (v20261117_v788)
   ========================================================================= */

.ai-theme-picker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.model-options-theme-section {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.action-item-icon.theme-icon-box {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}

.ai-theme-trigger-trail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.action-item-badge.theme-active-badge {
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-theme-submenu-trigger {
  align-items: center;
}

#btnAiChatTheme.is-nature-active {
  background: rgba(16, 185, 129, 0.07);
  border-color: transparent;
}

#btnAiChatTheme.is-nature-active .action-item-badge.theme-active-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.28);
}

.ai-theme-chevron {
  font-size: 0.68rem;
  color: #7c8ba1;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

#btnAiChatTheme[aria-expanded="true"] .ai-theme-chevron {
  transform: rotate(180deg);
  color: #6ee7b7;
}

.ai-chat-theme-menu {
  position: static;
  width: 100%;
  margin-top: 5px;
  background: rgba(7, 10, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 5px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ai-chat-theme-menu-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 6px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6ee7b7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 3px;
}

.ai-chat-theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ai-chat-theme-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ai-chat-theme-option.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.42);
}

.ai-theme-swatch-pair {
  width: 30px;
  height: 22px;
  border-radius: 7px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ai-theme-opt-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ai-theme-opt-text strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.25;
}

.ai-theme-opt-text small {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-theme-check {
  font-size: 0.75rem;
  color: #34d399;
  opacity: 0;
  flex-shrink: 0;
}

.ai-chat-theme-option.active .ai-theme-check {
  opacity: 1;
}

/* Wallpaper-Only Botanical Fruit & Nature Backdrop for AI Chat Container
   (All themes keep exact default ZOZ conversation output, code blocks, typography, and composer styling) */
#mainContent.ai-nature-themed {
  --nature-bg: #08120e;
  --nature-bottom-fade: rgba(8, 18, 14, 0.34);
  --nature-motif-opacity: 0.075;
  --nature-motif-size: 220px 220px;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M86 64c9-10 24-6 24 6-1 12-16 18-24 10 2-6 4-11 0-16z' fill='%2310b981' fill-opacity='0.24' stroke='%2334d399' stroke-opacity='0.48' stroke-width='1.5'/%3E%3Cpath d='M86 80l12-10' stroke='%236ee7b7' stroke-opacity='0.48' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
  background-color: var(--nature-bg) !important;
  position: relative;
}

#mainContent.ai-nature-themed::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--nature-motif-opacity, 0.075);
  background-color: transparent;
  background-image: var(--nature-motif-svg);
  background-size: var(--nature-motif-size, 220px 220px);
  background-repeat: repeat;
  z-index: 0;
}

#mainContent.ai-nature-themed > #chatViewport {
  position: relative;
  z-index: 1;
}

#mainContent.ai-nature-themed > footer {
  position: relative;
  z-index: 210;
}

/* Variant 1: Senja Mangga & Jeruk (Subtle Backdrop Only) */
#mainContent.ai-nature-themed[data-ai-chat-theme="mango-citrus"] {
  --nature-bg: #120c08;
  --nature-bottom-fade: rgba(14, 9, 6, 0.34);
  --nature-motif-opacity: 0.075;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M38 28c15-6 30 4 27 21-2 15-16 25-26 23-9-2-10-12-5-21 4-8-2-17 4-23z' fill='%23f59e0b' fill-opacity='0.28' stroke='%23fb923c' stroke-opacity='0.58' stroke-width='1.6'/%3E%3Cpath d='M44 35c9-1 15 5 14 14' fill='none' stroke='%23ea580c' stroke-opacity='0.48' stroke-width='1.4'/%3E%3Cpath d='M46 27c1-5 4-8 7-9' fill='none' stroke='%23a16207' stroke-opacity='0.6' stroke-width='1.6'/%3E%3Cpath d='M48 25c7-8 17-7 20 0-5 6-14 6-20 0z' fill='%2322c55e' fill-opacity='0.34' stroke='%234ade80' stroke-opacity='0.56' stroke-width='1.4'/%3E%3Ccircle cx='164' cy='54' r='22' fill='%23fb923c' fill-opacity='0.22' stroke='%23fdba74' stroke-opacity='0.55' stroke-width='1.8'/%3E%3Ccircle cx='164' cy='54' r='16' fill='%23f59e0b' fill-opacity='0.26' stroke='%23fef3c7' stroke-opacity='0.38' stroke-width='1.1'/%3E%3Cpath d='M164 38v32M148 54h32M153 43l22 22M175 43l-22 22' stroke='%23fef3c7' stroke-opacity='0.38' stroke-width='1.2'/%3E%3Ccircle cx='56' cy='164' r='20' fill='%23ea580c' fill-opacity='0.26' stroke='%23fb923c' stroke-opacity='0.55' stroke-width='1.6'/%3E%3Cpath d='M45 156c2-4 6-7 11-7' fill='none' stroke='%23fed7aa' stroke-opacity='0.42' stroke-width='1.3'/%3E%3Ccircle cx='50' cy='171' r='1.2' fill='%23fde047' fill-opacity='0.5'/%3E%3Ccircle cx='63' cy='163' r='1.2' fill='%23fde047' fill-opacity='0.5'/%3E%3Ccircle cx='58' cy='174' r='1.2' fill='%23fde047' fill-opacity='0.5'/%3E%3Cpath d='M57 143c5-7 15-7 18 0-4 6-13 6-18 0z' fill='%2322c55e' fill-opacity='0.34' stroke='%234ade80' stroke-opacity='0.56' stroke-width='1.4'/%3E%3Cpath d='M154 146c12-4 24 4 21 19-2 12-13 21-22 18-7-2-8-10-4-17 4-6-1-14 5-20z' fill='%23fbbf24' fill-opacity='0.25' stroke='%23f59e0b' stroke-opacity='0.54' stroke-width='1.5'/%3E%3Cpath d='M161 143c5-7 14-6 17 0-4 5-12 5-17 0z' fill='%2316a34a' fill-opacity='0.32' stroke='%234ade80' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='110' cy='110' r='11' fill='%23a3e635' fill-opacity='0.2' stroke='%23bef264' stroke-opacity='0.48' stroke-width='1.4'/%3E%3Cpath d='M110 99v22M99 110h22' stroke='%23ecfccb' stroke-opacity='0.35' stroke-width='1.1'/%3E%3Ccircle cx='112' cy='46' r='2.8' fill='%23fde047' fill-opacity='0.42'/%3E%3Cpath d='M112 39c2.5 0 4 2 2.5 4M119 46c0 2.5-2 4-4 2.5M112 53c-2.5 0-4-2-2.5-4M105 46c0-2.5 2-4 4-2.5' fill='none' stroke='%23fef3c7' stroke-opacity='0.4' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  background-color: #120c08 !important;
  background-image:
    radial-gradient(ellipse 65% 45% at 15% 15%, rgba(251, 146, 60, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 45% at 85% 80%, rgba(245, 158, 11, 0.06), transparent 65%),
    linear-gradient(180deg, #130d09 0%, #0b0806 100%) !important;
}

/* Variant 2: Taman Stroberi & Sakura (Subtle Backdrop Only) */
#mainContent.ai-nature-themed[data-ai-chat-theme="strawberry-sakura"] {
  --nature-bg: #12090e;
  --nature-bottom-fade: rgba(14, 7, 11, 0.34);
  --nature-motif-opacity: 0.075;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 36c-12 0-20 8-18 20 2 13 11 26 18 28 7-2 16-15 18-28 2-12-6-20-18-20z' fill='%23f43f5e' fill-opacity='0.28' stroke='%23fb7185' stroke-opacity='0.58' stroke-width='1.6'/%3E%3Cpath d='M50 36c-5-6-13-6-16-1 4 3 10 3 16 1zm0 0c5-6 13-6 16-1-4 3-10 3-16 1zm0 0l-4-9 4 4 4-4-4 9z' fill='%2322c55e' fill-opacity='0.36' stroke='%234ade80' stroke-opacity='0.58' stroke-width='1.2'/%3E%3Ccircle cx='43' cy='47' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Ccircle cx='50' cy='45' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Ccircle cx='57' cy='47' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Ccircle cx='46' cy='57' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Ccircle cx='54' cy='57' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Ccircle cx='50' cy='67' r='1.2' fill='%23fde047' fill-opacity='0.6'/%3E%3Cpath d='M164 42c-3-9-9-11-11-3-8-2-12 3-7 10-7 5-6 11 2 12-1 8 5 11 11 5 6 6 12 3 11-5 8-1 9-7 2-12 5-7 1-12-8-7z' fill='%23f9a8d4' fill-opacity='0.28' stroke='%23fbcfe8' stroke-opacity='0.55' stroke-width='1.3'/%3E%3Ccircle cx='164' cy='55' r='3.6' fill='%23fef08a' fill-opacity='0.56'/%3E%3Cpath d='M166 146c-11 0-18 7-16 18 2 12 10 23 16 25 6-2 14-13 16-25 2-11-5-18-16-18z' fill='%23e11d48' fill-opacity='0.28' stroke='%23fda4af' stroke-opacity='0.56' stroke-width='1.5'/%3E%3Cpath d='M166 146c-4-5-11-5-14-1 3 3 9 3 14 1zm0 0c4-5 11-5 14-1-3 3-9 3-14 1zm0 0l-3-8 3 4 3-4-3 8z' fill='%2322c55e' fill-opacity='0.34' stroke='%234ade80' stroke-opacity='0.55' stroke-width='1.1'/%3E%3Ccircle cx='161' cy='156' r='1.1' fill='%23fde047' fill-opacity='0.58'/%3E%3Ccircle cx='171' cy='156' r='1.1' fill='%23fde047' fill-opacity='0.58'/%3E%3Ccircle cx='166' cy='166' r='1.1' fill='%23fde047' fill-opacity='0.58'/%3E%3Ccircle cx='166' cy='175' r='1.1' fill='%23fde047' fill-opacity='0.58'/%3E%3Cpath d='M56 154c-3-8-8-10-10-2-7-2-10 3-6 9-6 4-5 10 2 11-1 7 4 10 10 4 5 6 11 3 10-4 7-1 8-7 2-11 4-6 1-11-8-7z' fill='%23f472b6' fill-opacity='0.26' stroke='%23fbcfe8' stroke-opacity='0.52' stroke-width='1.2'/%3E%3Ccircle cx='56' cy='165' r='3.2' fill='%23fef08a' fill-opacity='0.55'/%3E%3Cpath d='M110 104c5-7 13-3 11 5-2 7-10 9-14 4 2-3 2-6 3-9z' fill='%23f9a8d4' fill-opacity='0.28' stroke='%23fbcfe8' stroke-opacity='0.48' stroke-width='1.1'/%3E%3Cpath d='M104 122c5-6 12-5 15 1-4 5-11 5-15-1z' fill='%234ade80' fill-opacity='0.24' stroke='%2386efac' stroke-opacity='0.48' stroke-width='1.1'/%3E%3C/g%3E%3C/svg%3E");
  background-color: #12090e !important;
  background-image:
    radial-gradient(ellipse 65% 45% at 80% 18%, rgba(244, 114, 182, 0.08), transparent 65%),
    radial-gradient(ellipse 60% 45% at 20% 82%, rgba(225, 29, 72, 0.06), transparent 65%),
    linear-gradient(180deg, #13090f 0%, #0b0509 100%) !important;
}

/* Variant 3: Kebun Apel Zamrud (Dark Orchard Backdrop Only) */
#mainContent.ai-nature-themed[data-ai-chat-theme="apple-orchard"] {
  --nature-bg: #07130c;
  --nature-bottom-fade: rgba(5, 14, 9, 0.34);
  --nature-motif-opacity: 0.08;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 40c-4-4-12-4-16 1-7 7-6 21 0 30 4 7 10 9 14 7 1-1 3-1 4 0 4 2 10 0 14-7 6-9 7-23 0-30-4-5-12-5-16-1z' fill='%23ef4444' fill-opacity='0.24' stroke='%23f87171' stroke-opacity='0.52' stroke-width='1.6'/%3E%3Cpath d='M40 48c-2 4-2 9 0 13' fill='none' stroke='%23fecaca' stroke-opacity='0.52' stroke-width='1.4'/%3E%3Cpath d='M50 40c0-6 2-10 5-12' fill='none' stroke='%23a16207' stroke-opacity='0.65' stroke-width='1.6'/%3E%3Cpath d='M52 34c5-7 14-7 17-1-4 6-12 6-17 1z' fill='%2322c55e' fill-opacity='0.34' stroke='%234ade80' stroke-opacity='0.56' stroke-width='1.3'/%3E%3Cpath d='M166 42c-4-4-12-4-16 1-7 7-6 21 0 30 4 7 10 9 14 7 1-1 3-1 4 0 4 2 10 0 14-7 6-9 7-23 0-30-4-5-12-5-16-1z' fill='%2322c55e' fill-opacity='0.24' stroke='%234ade80' stroke-opacity='0.54' stroke-width='1.6'/%3E%3Cpath d='M166 42c0-6 2-10 5-12' fill='none' stroke='%23a16207' stroke-opacity='0.65' stroke-width='1.6'/%3E%3Cpath d='M168 36c5-7 14-7 17-1-4 6-12 6-17 1z' fill='%2386efac' fill-opacity='0.36' stroke='%234ade80' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Cpath d='M54 152c-3-4-11-4-15 1-6 6-5 19 0 27 4 6 9 8 13 6 1-1 3-1 4 0 4 2 9 0 13-6 5-8 6-21 0-27-4-5-12-5-15-1z' fill='%23fef08a' fill-opacity='0.26' stroke='%23f87171' stroke-opacity='0.48' stroke-width='1.6'/%3E%3Cellipse cx='51' cy='166' rx='1.4' ry='2.4' transform='rotate(-15 51 166)' fill='%23fde047' fill-opacity='0.65'/%3E%3Cellipse cx='57' cy='166' rx='1.4' ry='2.4' transform='rotate(15 57 166)' fill='%23fde047' fill-opacity='0.65'/%3E%3Cpath d='M54 152v-8' stroke='%23a16207' stroke-opacity='0.65' stroke-width='1.5'/%3E%3Cpath d='M164 152c-4-4-11-4-15 1-6 6-5 19 0 27 4 6 9 8 13 6 1-1 3-1 4 0 4 2 9 0 13-6 5-8 6-21 0-27-4-5-11-5-15-1z' fill='%23ef4444' fill-opacity='0.22' stroke='%23f87171' stroke-opacity='0.5' stroke-width='1.5'/%3E%3Cpath d='M164 152c0-5 2-9 5-11' fill='none' stroke='%23a16207' stroke-opacity='0.65' stroke-width='1.5'/%3E%3Cpath d='M166 146c5-6 13-6 15-1-3 5-11 5-15 1z' fill='%2322c55e' fill-opacity='0.34' stroke='%234ade80' stroke-opacity='0.54' stroke-width='1.2'/%3E%3Ccircle cx='110' cy='110' r='3.2' fill='%23facc15' fill-opacity='0.6'/%3E%3Cpath d='M110 101c3 0 5 2 3 5M119 110c0 3-2 5-5 3M110 119c-3 0-5-2-3-5M101 110c0-3 2-5 5-3' fill='%23fbcfe8' fill-opacity='0.38' stroke='%23f472b6' stroke-opacity='0.46' stroke-width='1.1'/%3E%3C/g%3E%3C/svg%3E");
  background-color: #07130c !important;
  background-image:
    radial-gradient(ellipse 65% 45% at 15% 15%, rgba(74, 222, 128, 0.08), transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 80%, rgba(248, 113, 113, 0.06), transparent 65%),
    linear-gradient(180deg, #08150e 0%, #050c08 100%) !important;
}

/* Variant 4: Hutan Tropis & Anggur (Subtle Backdrop Only) */
#mainContent.ai-nature-themed[data-ai-chat-theme="emerald-forest"] {
  --nature-bg: #07120e;
  --nature-bottom-fade: rgba(5, 13, 10, 0.34);
  --nature-motif-opacity: 0.075;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M50 32v-8M50 26c-5-4-11-3-12 2 0 4 4 6 7 4M52 30c6-7 16-6 18 1-5 5-13 5-18-1z' fill='%2310b981' fill-opacity='0.28' stroke='%2334d399' stroke-opacity='0.54' stroke-width='1.4'/%3E%3Ccircle cx='40' cy='42' r='6' fill='%23a855f7' fill-opacity='0.28' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='50' cy='42' r='6' fill='%23a855f7' fill-opacity='0.32' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='60' cy='42' r='6' fill='%239333ea' fill-opacity='0.28' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='45' cy='51' r='6' fill='%239333ea' fill-opacity='0.32' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='55' cy='51' r='6' fill='%23a855f7' fill-opacity='0.28' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='42' cy='60' r='5.8' fill='%23a855f7' fill-opacity='0.28' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='58' cy='60' r='5.8' fill='%239333ea' fill-opacity='0.28' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='50' cy='61' r='6' fill='%23c084fc' fill-opacity='0.32' stroke='%23e9d5ff' stroke-opacity='0.56' stroke-width='1.3'/%3E%3Ccircle cx='50' cy='71' r='5.5' fill='%239333ea' fill-opacity='0.32' stroke='%23d8b4fe' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Cpath d='M164 78V32M164 46c-8-7-16-7-20-2M164 46c8-7 16-7 20-2M164 58c-9-7-18-6-22 0M164 58c9-7 18-6 22 0M164 70c-8-6-16-5-19 1M164 70c8-6 16-5 19 1' fill='none' stroke='%2334d399' stroke-opacity='0.54' stroke-width='1.6'/%3E%3Cpath d='M164 32c-5 5-6 12 0 15 6-3 5-10 0-15z' fill='%2310b981' fill-opacity='0.28' stroke='%236ee7b7' stroke-opacity='0.52' stroke-width='1.3'/%3E%3Cpath d='M166 142v-7M168 140c5-6 14-5 16 1-4 5-11 5-16-1z' fill='%2310b981' fill-opacity='0.3' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='157' cy='151' r='5.5' fill='%2334d399' fill-opacity='0.26' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='166' cy='151' r='5.5' fill='%2310b981' fill-opacity='0.3' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='175' cy='151' r='5.5' fill='%2334d399' fill-opacity='0.26' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='161.5' cy='160' r='5.5' fill='%2310b981' fill-opacity='0.3' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='170.5' cy='160' r='5.5' fill='%2334d399' fill-opacity='0.26' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Ccircle cx='166' cy='169' r='5.5' fill='%2310b981' fill-opacity='0.3' stroke='%236ee7b7' stroke-opacity='0.54' stroke-width='1.3'/%3E%3Cpath d='M36 178l18-30 18 30h-12l10 14h-32l10-14z' fill='%23059669' fill-opacity='0.26' stroke='%2334d399' stroke-opacity='0.52' stroke-width='1.5'/%3E%3Cpath d='M100 108c9-10 22-6 21 6-1 11-15 16-22 9 2-5 3-10 1-15z' fill='%2310b981' fill-opacity='0.26' stroke='%236ee7b7' stroke-opacity='0.52' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
  background-color: #07120e !important;
  background-image:
    radial-gradient(ellipse 65% 45% at 25% 20%, rgba(16, 185, 129, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 40% at 82% 82%, rgba(139, 92, 246, 0.05), transparent 65%),
    linear-gradient(180deg, #07120e 0%, #040b08 100%) !important;
}

/* Variant 5: Aurora Pegunungan & Samudra (Subtle Backdrop Only) */
#mainContent.ai-nature-themed[data-ai-chat-theme="aurora-mountain"] {
  --nature-bg: #08101c;
  --nature-bottom-fade: rgba(6, 12, 22, 0.34);
  --nature-motif-opacity: 0.075;
  --nature-motif-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 72l24-34 16 20 12-14 18 28z' fill='%230ea5e9' fill-opacity='0.22' stroke='%2338bdf8' stroke-opacity='0.54' stroke-width='1.5'/%3E%3Cpath d='M38 49l8-11 8 11-5-2-3 4-3-4z' fill='%23e0f2fe' fill-opacity='0.28'/%3E%3Cpath d='M132 42c10-12 22-12 32 0s22 12 32 0' fill='none' stroke='%232dd4bf' stroke-opacity='0.48' stroke-width='2.2'/%3E%3Cpath d='M136 53c10-10 20-10 30 0s20 10 30 0' fill='none' stroke='%23a78bfa' stroke-opacity='0.4' stroke-width='1.9'/%3E%3Cpath d='M36 178l16-28 16 28h-10l8 12h-28l8-12z' fill='%2314b8a6' fill-opacity='0.26' stroke='%235eead4' stroke-opacity='0.54' stroke-width='1.4'/%3E%3Cpath d='M138 184l22-32 14 18 10-12 16 26z' fill='%230284c7' fill-opacity='0.22' stroke='%237dd3fc' stroke-opacity='0.54' stroke-width='1.5'/%3E%3Cpath d='M104 96c-6 2-9 9-6 15 3 5 10 8 16 5-5 1-9-2-10-7-2-5 0-10 0-13z' fill='%23bae6fd' fill-opacity='0.34' stroke='%23e0f2fe' stroke-opacity='0.52' stroke-width='1.2'/%3E%3Cpath d='M120 82l2 5 5 2-5 2-2 5-2-5-5-2 5-2z' fill='%235eead4' fill-opacity='0.52'/%3E%3Ccircle cx='88' cy='132' r='1.6' fill='%23bae6fd' fill-opacity='0.52'/%3E%3Ccircle cx='182' cy='96' r='1.8' fill='%2399f6e4' fill-opacity='0.5'/%3E%3C/g%3E%3C/svg%3E");
  background-color: #08101c !important;
  background-image:
    linear-gradient(125deg, rgba(255, 255, 255, 0.025) 0%, transparent 32%),
    radial-gradient(ellipse 70% 45% at 50% 10%, rgba(20, 184, 166, 0.1), transparent 65%),
    linear-gradient(160deg, #06181a 0%, #091827 52%, #0d1329 100%) !important;
}

/* Subtle bottom blend so themed backdrop remains clean behind the untouched default composer dock */
#mainContent.ai-nature-themed .composer-container {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--nature-bottom-fade, rgba(7, 8, 12, 0.24)) 100%) !important;
}

/* ==================== ZOZ FORGE (v801) ==================== */
/* 1. Compact In-Chat Launch Card */
.gemini-canvas-card.zoz-forge-card {
  width: 100%;
  max-width: 520px;
  margin: 4px 0 14px 0;
  padding: 16px 18px;
  background: linear-gradient(155deg, rgba(16, 20, 30, 0.96) 0%, rgba(10, 13, 20, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: visible;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gemini-canvas-card.zoz-forge-card:hover {
  border-color: rgba(0, 229, 163, 0.42);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58), 0 0 22px rgba(0, 229, 163, 0.14);
}

.zoz-forge-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.zoz-forge-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 163, 0.08);
  border: 1px solid rgba(0, 229, 163, 0.26);
  color: #00f2fe;
}

.zoz-forge-card-info {
  flex: 1 1 auto;
  min-width: 0;
}

.gemini-canvas-title.zoz-forge-card-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.38;
  max-width: none;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none !important;
}

.gemini-canvas-card.zoz-forge-card:hover .gemini-canvas-title.zoz-forge-card-title {
  color: #ffffff;
  text-decoration: none !important;
}

.zoz-forge-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #8c9bb0;
}

.zoz-forge-badge {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #00e5a3;
  background: rgba(0, 229, 163, 0.1);
  border: 1px solid rgba(0, 229, 163, 0.28);
  padding: 1px 7px;
  border-radius: 9999px;
}

.zoz-forge-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.zoz-forge-card-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.zoz-forge-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.zoz-forge-tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 242, 254, 0.35);
  color: #f8fafc;
}

.zoz-forge-continue-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 183, 3, 0.45);
  background: rgba(255, 183, 3, 0.14);
  color: #ffd166;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.zoz-forge-continue-pill:hover {
  background: rgba(255, 183, 3, 0.24);
  color: #ffffff;
}

.zoz-forge-open-btn {
  min-width: 84px;
  height: 36px;
  padding: 0 22px;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, #00e5a3 0%, #00c8f0 100%);
  color: #04131a;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 229, 163, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  flex-shrink: 0;
}

.zoz-forge-open-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 22px rgba(0, 242, 254, 0.38);
}

.zoz-forge-open-btn:active {
  transform: translateY(0);
}

/* Compact Live Forging Card during SSE streaming */
.zoz-forge-live-build {
  width: 100%;
  max-width: 520px;
  margin: 6px 0 12px 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(16, 20, 30, 0.94) 0%, rgba(10, 13, 20, 0.97) 100%);
  border: 1px solid rgba(0, 229, 163, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 18px rgba(0, 229, 163, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zoz-forge-live-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoz-forge-live-spinner {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 229, 163, 0.1);
  border: 1px solid rgba(0, 229, 163, 0.28);
  color: #00f2fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.zoz-forge-live-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.zoz-forge-live-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoz-forge-live-sub {
  font-size: 0.72rem;
  color: #8c9bb0;
  margin-top: 2px;
}

.zoz-forge-live-bar {
  width: 100%;
  height: 3px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  position: relative;
}

.zoz-forge-live-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent, #00e5a3, #00f2fe, transparent);
  animation: forgeShimmerSlide 1.3s ease-in-out infinite;
}

@keyframes forgeShimmerSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

/* 2. Full-Screen Rounded ZOZ FORGE Studio Viewport */
#aiFileStudioModal.zoz-forge-backdrop {
  padding: 0 !important;
  background: rgba(3, 5, 9, 0.92);
}

#aiFileStudioModal .ai-file-studio-card.gemini-canvas-studio.zoz-forge-studio {
  width: 100vw !important;
  height: var(--studio-vv-height, 100vh) !important;
  height: var(--studio-vv-height, 100dvh) !important;
  max-width: 100vw !important;
  max-height: var(--studio-vv-height, 100dvh) !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  background: #05070b !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#aiFileStudioModal .gemini-studio-header {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: max(8px, env(safe-area-inset-top, 8px)) 14px 8px 14px !important;
  background: #05070b !important;
  border-bottom: none !important;
  flex-wrap: nowrap !important;
  z-index: 260 !important;
}

#aiFileStudioModal .gemini-studio-header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

#aiFileStudioModal .gemini-studio-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

#aiFileStudioModal .gemini-studio-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.forge-quick-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(0, 240, 255, 0.14));
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.forge-quick-dl-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.34), rgba(0, 240, 255, 0.22));
  border-color: rgba(52, 211, 153, 0.72);
  color: #ffffff;
  transform: translateY(-1px);
}

@media (max-width: 540px) {
  .forge-quick-dl-btn {
    padding: 0 10px;
    font-size: 0.75rem;
  }
}

.forge-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  flex-shrink: 0;
}

.forge-circle-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(0, 229, 163, 0.38);
  color: #ffffff;
}

#aiFileStudioTitle.gemini-studio-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: clamp(130px, 26vw, 320px);
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forge-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5a3 0%, #00f2fe 100%);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.55);
  flex-shrink: 0;
}

.forge-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forge-segmented-toggle {
  background: #12151e !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  padding: 4px !important;
  border-radius: 9999px !important;
  gap: 2px !important;
}

.forge-segmented-toggle .seg-btn {
  padding: 6px 18px !important;
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  border-radius: 9999px !important;
  background: transparent;
}

.forge-segmented-toggle .seg-btn.active {
  background: #272c38 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Rounded Stage Viewport (wins cascade over earlier and @media 768px white-bg overrides) */
#aiFileStudioModal .gemini-studio-stage {
  flex: 1 1 auto !important;
  position: relative !important;
  min-height: 0 !important;
  padding: 4px 12px max(16px, env(safe-area-inset-bottom, 16px)) 12px !important;
  background: #05070b !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#aiFileStudioModal .studio-workspace-area {
  position: relative !important;
  inset: auto !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  background: #0b0f17 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65) !important;
}

#aiFileStudioModal .ai-file-studio-pane.gemini-studio-pane {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #0b0f17 !important;
  border-radius: 21px !important;
  overflow: hidden !important;
}

#aiFileStudioModal #aiFileStudioCode.gemini-studio-code {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #0b0f17 !important;
  border: none !important;
  padding: 18px 20px 92px 20px !important;
}

#aiFileStudioModal .ai-file-studio-card.is-fullscreen .gemini-studio-stage {
  padding: 0 !important;
}

#aiFileStudioModal .ai-file-studio-card.is-fullscreen .studio-workspace-area {
  border-radius: 0 !important;
  border: none !important;
}

#aiFileStudioModal .ai-file-studio-card.is-fullscreen .ai-file-studio-pane.gemini-studio-pane {
  border-radius: 0 !important;
}

/* Overflow Action Popover Menu */
.forge-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 140;
}

.forge-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(290px, calc(100vw - 24px));
  max-height: min(74dvh, 520px);
  overflow-y: auto;
  background: rgba(13, 17, 26, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 229, 163, 0.08);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forge-more-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
}

.forge-more-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.forge-more-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00e5a3;
}

.forge-more-filename {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forge-more-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.81rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.forge-more-item i {
  width: 18px;
  text-align: center;
  font-size: 0.88rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.forge-more-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.forge-more-item:hover i {
  color: #00f2fe;
}

.forge-more-item.active {
  background: rgba(0, 229, 163, 0.12);
  color: #00e5a3;
}

.forge-more-item.active i {
  color: #00e5a3;
}

#forgeStudioMoreMenu .forge-more-item.studio-edit-code-btn,
#forgeStudioMoreMenu .forge-more-item.studio-search-code-btn {
  background: transparent !important;
  border: none !important;
  color: #e2e8f0 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

#forgeStudioMoreMenu .forge-more-item.studio-edit-code-btn:hover,
#forgeStudioMoreMenu .forge-more-item.studio-search-code-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

#forgeStudioMoreMenu .forge-more-item.studio-edit-code-btn.active {
  background: rgba(0, 229, 163, 0.14) !important;
  color: #5eead4 !important;
}

.forge-more-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 6px;
}

.forge-more-export-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forge-more-export-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px 3px 10px;
  border: none;
  background: transparent;
  color: #7c8ca3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.forge-more-export-list.is-inline-export-list {
  position: static !important;
  inset: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: auto !important;
}

.forge-more-export-list.is-inline-export-list.is-collapsed {
  display: none !important;
}

.forge-more-export-list.is-inline-export-list .gemini-export-item {
  padding: 8px 10px;
  border-radius: 10px;
}

.studio-hud-stop-btn {
  pointer-events: auto;
  width: 24px;
  height: 24px;
  margin-left: 2px;
  border-radius: 50%;
  border: 1px solid rgba(244, 63, 94, 0.48);
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.studio-hud-stop-btn:hover {
  background: rgba(244, 63, 94, 0.34);
  border-color: rgba(251, 113, 133, 0.85);
  color: #ffffff;
  transform: scale(1.06);
}

/* Floating Bottom-Center ZOZ FORGE AI Orb & Expandable Prompt Dock */
#aiFileStudioModal #geminiStudioFooter.gemini-studio-footer {
  bottom: max(18px, env(safe-area-inset-bottom, 18px)) !important;
  padding: 0 14px !important;
  z-index: 65 !important;
}

#aiFileStudioModal.is-code-editing #geminiStudioFooter:not(.is-composer-open) #btnForgePromptOrb,
#aiFileStudioModal:has(#studioCodeEditorWrap.is-editing) #geminiStudioFooter:not(.is-composer-open) #btnForgePromptOrb {
  display: none !important;
}

#aiFileStudioModal #geminiStudioFooter:not(.is-composer-open) #studioComposerBox {
  display: none !important;
}

#aiFileStudioModal #geminiStudioFooter.is-composer-open #btnForgePromptOrb {
  display: none !important;
}

#aiFileStudioModal #geminiStudioFooter.is-composer-open #studioComposerBox {
  display: flex !important;
  animation: forgeComposerPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.forge-prompt-orb {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 163, 0.36);
  background: radial-gradient(circle at 35% 30%, #1c2231 0%, #0f141e 72%, #080b12 100%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.72), 0 0 22px rgba(0, 229, 163, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.forge-prompt-orb:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: rgba(0, 242, 254, 0.72);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.8), 0 0 28px rgba(0, 242, 254, 0.38);
}

.forge-prompt-orb:active {
  transform: scale(0.97);
}

.forge-prompt-orb.is-forging {
  border-color: rgba(0, 242, 254, 0.85);
  animation: forgeOrbPulse 1.5s ease-in-out infinite;
}

.forge-prompt-orb.is-forging .forge-orb-emblem {
  animation: forgeEmblemSpin 3s linear infinite;
}

@keyframes forgeOrbPulse {
  0%, 100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 18px rgba(0, 229, 163, 0.3);
  }
  50% {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.78), 0 0 34px rgba(0, 242, 254, 0.62);
  }
}

@keyframes forgeEmblemSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.forge-collapse-composer-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.16s ease;
}

.forge-collapse-composer-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

@media (max-width: 768px) {
  #aiFileStudioTitle.gemini-studio-title {
    display: none !important;
  }
  #aiFileStudioModal .gemini-studio-stage {
    padding: 4px 8px max(12px, env(safe-area-inset-bottom, 12px)) 8px !important;
  }
  #aiFileStudioModal .gemini-studio-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: max(8px, env(safe-area-inset-top, 8px)) 10px 8px 10px !important;
  }
  #aiFileStudioModal .gemini-studio-header-center {
    min-width: 0;
    justify-content: center;
    overflow: hidden;
  }
  #aiFileStudioModal .gemini-studio-header-right {
    flex-shrink: 0;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  #aiFileStudioModal #btnToggleStudioFullscreen {
    display: none !important;
  }
  .forge-quick-dl-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 0.74rem;
    gap: 5px;
  }
  .forge-circle-btn {
    width: 34px;
    height: 34px;
    font-size: 0.82rem;
  }
  .forge-segmented-toggle {
    padding: 3px !important;
  }
  .forge-segmented-toggle .seg-btn {
    padding: 5px 10px !important;
    font-size: 0.76rem !important;
  }
}

@media (max-width: 400px) {
  #aiFileStudioModal .gemini-studio-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px;
    padding: max(6px, env(safe-area-inset-top, 6px)) 8px 6px 8px !important;
  }
  .forge-quick-dl-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 0.71rem;
    gap: 4px;
  }
  .forge-circle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  .forge-segmented-toggle .seg-btn {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }
}

/* ==================== DUAL PLAN: VERTICAL DRAGON-SCALE PILLARS ZOZ (BLUE) & Z21 (RED) (v803) ==================== */
.composer-container {
  user-select: none;
}

.composer-container textarea,
.composer-container input {
  user-select: text;
}

.composer-plan-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.composer-plan-stage:not(.is-empty-chat) .plan-dragon-card {
  display: none !important;
}

.composer-container.composer-collapsed .plan-dragon-card {
  display: none !important;
}

.composer-plan-stage.is-empty-chat {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.composer-plan-stage.is-empty-chat #promptDockWrapper {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (min-width: 768px) {
  .composer-plan-stage.is-empty-chat {
    max-width: 790px;
    margin: 0 auto;
    padding: 0 16px;
    gap: 12px;
  }

  .composer-plan-stage.is-empty-chat #promptDockWrapper {
    max-width: 660px !important;
  }

  .composer-plan-stage.is-empty-chat .plan-dragon-card {
    width: 44px;
    height: 82px;
    min-height: 74px;
    border-radius: 16px;
    padding: 10px 4px;
    flex-shrink: 0;
  }
}

@media (max-width: 767px) {
  .composer-plan-stage.is-empty-chat {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
    gap: 7px;
  }

  .composer-plan-stage.is-empty-chat #promptDockWrapper {
    max-width: 100% !important;
  }

  .composer-plan-stage.is-empty-chat .plan-dragon-card {
    width: 34px;
    height: 68px;
    min-height: 62px;
    border-radius: 14px;
    padding: 8px 2px;
    flex-shrink: 0;
  }

  .plan-dragon-code {
    font-size: 0.68rem !important;
    letter-spacing: 0.04em !important;
  }
}

@media (max-width: 640px) {
  .composer-plan-stage.is-empty-chat {
    padding: 0;
  }
}

.plan-dragon-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  align-self: center;
  max-height: 108px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dragon-scale-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

.dragon-edge-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0%, transparent 38%, transparent 62%, rgba(0, 0, 0, 0.34) 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.18),
    inset 0 -3px 5px rgba(0, 0, 0, 0.45);
}

.plan-dragon-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.plan-dragon-gem {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  opacity: 0.55;
}

.plan-dragon-code {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: 'Space Grotesk', 'JetBrains Mono', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  line-height: 1;
}

/* ZOZ Pillar — Biru Safir Sisik Naga */
.plan-dragon-zoz {
  background: linear-gradient(180deg, #061b3a 0%, #0b376f 52%, #051329 100%);
  border: 1px solid rgba(56, 189, 248, 0.34);
  opacity: 0.72;
  box-shadow: 0 6px 20px rgba(2, 18, 44, 0.55);
}

.plan-dragon-zoz .plan-dragon-gem {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.55);
}

.plan-dragon-zoz .dragon-scale-layer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='18' viewBox='0 0 20 18'%3E%3Cpath d='M0 9Q5 9 5 0Q5 9 10 9Q15 9 15 0Q15 9 20 9V18Q15 18 15 9Q15 18 10 18Q5 18 5 9Q5 18 0 18Z' fill='%230ea5e9' fill-opacity='0.14' stroke='%2338bdf8' stroke-opacity='0.44' stroke-width='1'/%3E%3Cpath d='M5 4.5Q10 7.5 15 4.5' fill='none' stroke='%23bae6fd' stroke-opacity='0.28' stroke-width='0.8'/%3E%3Cpath d='M0 13.5Q5 16.5 10 13.5Q15 16.5 20 13.5' fill='none' stroke='%237dd3fc' stroke-opacity='0.24' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 20px 18px;
}

.plan-dragon-zoz:hover,
.plan-dragon-zoz.is-selected {
  opacity: 1;
  border-color: rgba(56, 189, 248, 0.88);
  box-shadow:
    0 10px 28px rgba(2, 132, 199, 0.36),
    0 0 22px rgba(56, 189, 248, 0.34),
    inset 0 1px 0 rgba(186, 230, 253, 0.4);
  transform: translateY(-1px);
}

.plan-dragon-zoz.is-selected .dragon-scale-layer {
  opacity: 0.96;
}

.plan-dragon-zoz.is-selected .plan-dragon-gem {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.95);
}

.plan-dragon-zoz.is-selected .plan-dragon-code {
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.65);
}

/* Z21 Pillar — Merah Crimson Sisik Naga */
.plan-dragon-z21 {
  background: linear-gradient(180deg, #320710 0%, #700f23 52%, #1d0409 100%);
  border: 1px solid rgba(244, 63, 94, 0.36);
  opacity: 0.72;
  box-shadow: 0 6px 20px rgba(45, 5, 14, 0.58);
}

.plan-dragon-z21 .plan-dragon-gem {
  background: #fb7185;
  box-shadow: 0 0 6px rgba(251, 113, 133, 0.55);
}

.plan-dragon-z21 .dragon-scale-layer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='18' viewBox='0 0 20 18'%3E%3Cpath d='M0 9Q5 9 5 0Q5 9 10 9Q15 9 15 0Q15 9 20 9V18Q15 18 15 9Q15 18 10 18Q5 18 5 9Q5 18 0 18Z' fill='%23ef4444' fill-opacity='0.16' stroke='%23fb7185' stroke-opacity='0.46' stroke-width='1'/%3E%3Cpath d='M5 4.5Q10 7.5 15 4.5' fill='none' stroke='%23fecdd3' stroke-opacity='0.3' stroke-width='0.8'/%3E%3Cpath d='M0 13.5Q5 16.5 10 13.5Q15 16.5 20 13.5' fill='none' stroke='%23fda4af' stroke-opacity='0.24' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 20px 18px;
}

.plan-dragon-z21:hover,
.plan-dragon-z21.is-selected {
  opacity: 1;
  border-color: rgba(251, 113, 133, 0.9);
  box-shadow:
    0 10px 28px rgba(185, 28, 28, 0.42),
    0 0 24px rgba(244, 63, 94, 0.4),
    inset 0 1px 0 rgba(254, 205, 211, 0.38);
  transform: translateY(-1px);
}

.plan-dragon-z21.is-selected .dragon-scale-layer {
  opacity: 0.98;
}

.plan-dragon-z21.is-selected .plan-dragon-gem {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.95);
}

.plan-dragon-z21.is-selected .plan-dragon-code {
  text-shadow: 0 0 14px rgba(251, 113, 133, 0.72);
}

/* Z21 Subtle Composer Ring & Sidebar History Badge */
#mainContent:not(.wa-chat-themed) #composerPlanStage[data-active-plan="z21"] .composer-box:not(.studio-composer-box):not(.image-mode-active):not(.music-mode-active),
#mainContent:not(.wa-chat-themed) #composerPlanStage[data-active-plan="z21"] .composer-box:not(.studio-composer-box):not(.image-mode-active):not(.music-mode-active):hover,
#mainContent:not(.wa-chat-themed) #composerPlanStage[data-active-plan="z21"] .composer-box:not(.studio-composer-box):not(.image-mode-active):not(.music-mode-active):focus-within {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(244, 63, 94, 0.44) !important;
}

.history-plan-z21-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  margin-left: 5px;
  border-radius: 9999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffe4e6;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.55) 0%, rgba(159, 18, 57, 0.65) 100%);
  border: 1px solid rgba(251, 113, 133, 0.45);
  flex-shrink: 0;
}

/* Z21 Red-Dragon Accent Variation for In-Chat Launch Card & Streaming Card */
.gemini-canvas-card.zoz-forge-card.z21-card {
  background: linear-gradient(155deg, rgba(28, 10, 16, 0.96) 0%, rgba(12, 7, 11, 0.98) 100%);
  border-color: rgba(244, 63, 94, 0.24);
}

.gemini-canvas-card.zoz-forge-card.z21-card:hover {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58), 0 0 22px rgba(244, 63, 94, 0.18);
}

.gemini-canvas-card.zoz-forge-card.z21-card .zoz-forge-card-icon {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.36);
  color: #fb7185;
}

.gemini-canvas-card.zoz-forge-card.z21-card .zoz-forge-badge {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.38);
}

.gemini-canvas-card.zoz-forge-card.z21-card .zoz-forge-open-btn {
  background: linear-gradient(135deg, #f43f5e 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.34);
}

.gemini-canvas-card.zoz-forge-card.z21-card .zoz-forge-open-btn:hover {
  box-shadow: 0 6px 22px rgba(244, 63, 94, 0.5);
}

.zoz-forge-live-build.z21-live-build {
  background: linear-gradient(155deg, rgba(28, 10, 16, 0.94) 0%, rgba(12, 7, 11, 0.98) 100%);
  border-color: rgba(244, 63, 94, 0.35);
}

.zoz-forge-live-build.z21-live-build .zoz-forge-live-spinner {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.36);
  color: #fb7185;
}

.zoz-forge-live-build.z21-live-build .zoz-forge-live-bar::after {
  background: linear-gradient(90deg, transparent, #f43f5e, #fb7185, transparent);
}

/* =========================================================================
   EXECUTIVE PERSONA STUDIO (NON-CUSTOM: AI FORMAL ONLY + CUSTOM PERSONA)
   ========================================================================= */

/* 1. Sidebar-Adjacent Vertical Persona Dock (Visible Only When Sidebar Open) */
.zoz-persona-vertical-dock {
  position: absolute;
  left: calc(var(--sidebar-width) + 10px);
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 105;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  visibility: visible;
  max-height: calc(100dvh - 24px);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease,
              left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.sidebar-collapsed .zoz-persona-vertical-dock,
.sidebar.collapsed ~ .zoz-persona-vertical-dock,
.zoz-persona-vertical-dock.is-sidebar-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-14px, -50%) scale(0.92) !important;
}

.app-container.sidebar-collapsed .zoz-persona-vertical-dock .zoz-persona-vertical-capsule,
.sidebar.collapsed ~ .zoz-persona-vertical-dock .zoz-persona-vertical-capsule,
.zoz-persona-vertical-dock.is-sidebar-hidden .zoz-persona-vertical-capsule,
.app-container.sidebar-collapsed .zoz-persona-vertical-dock .zoz-auto-aloud-vertical-capsule,
.sidebar.collapsed ~ .zoz-persona-vertical-dock .zoz-auto-aloud-vertical-capsule,
.zoz-persona-vertical-dock.is-sidebar-hidden .zoz-auto-aloud-vertical-capsule {
  pointer-events: none !important;
}

#mainContent.wa-chat-themed .zoz-persona-vertical-dock,
#mainContent.is-wa-chat-mode .zoz-persona-vertical-dock,
#appContainer.is-wa-chat-mode .zoz-persona-vertical-dock,
body[data-chat-mode="whatsapp"] .zoz-persona-vertical-dock {
  display: none !important;
}

.zoz-persona-vertical-capsule {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  padding: 4px 3px;
  gap: 5px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(11, 16, 29, 0.92) 0%, rgba(7, 10, 18, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.62), 0 0 18px rgba(14, 165, 233, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoz-persona-vertical-capsule:hover {
  border-color: rgba(56, 189, 248, 0.58);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.72), 0 0 22px rgba(14, 165, 233, 0.24);
}

.zoz-persona-vertical-dock.is-custom-mode .zoz-persona-vertical-capsule {
  border-color: rgba(167, 139, 250, 0.48);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(139, 92, 246, 0.22);
}

.zoz-persona-vertical-dock.is-custom-mode .zoz-persona-vertical-capsule:hover {
  border-color: rgba(196, 181, 253, 0.78);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.74), 0 0 24px rgba(139, 92, 246, 0.34);
}

.zoz-persona-vertical-dock.is-off-mode .zoz-persona-vertical-capsule {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(9, 13, 22, 0.86) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
}

/* 1b. Sidebar-Adjacent Vertical Auto Read Aloud ON/OFF Capsule (Stacked Above Persona) */
.zoz-auto-aloud-vertical-capsule {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  padding: 4px 3px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(11, 16, 29, 0.92) 0%, rgba(7, 10, 18, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.zoz-auto-aloud-vertical-capsule.is-off-mode {
  border-color: rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(9, 13, 22, 0.86) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
}

.zoz-auto-aloud-vertical-capsule.is-on-mode {
  border-color: rgba(16, 185, 129, 0.56);
  background: linear-gradient(180deg, rgba(6, 30, 34, 0.94) 0%, rgba(7, 16, 24, 0.96) 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(16, 185, 129, 0.26);
}

.zoz-auto-aloud-vertical-capsule:hover {
  border-color: rgba(0, 242, 254, 0.58);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72), 0 0 22px rgba(0, 242, 254, 0.22);
}

.zoz-auto-aloud-vert-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 26px;
  padding: 2px 0 8px;
  border-radius: 9999px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.zoz-auto-aloud-vert-btn.is-on-mode {
  color: #a7f3d0;
}

.zoz-auto-aloud-vert-power {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-size: 0.68rem;
  transition: all 0.18s ease;
}

.zoz-auto-aloud-vert-btn.is-on-mode .zoz-auto-aloud-vert-power {
  border-color: rgba(16, 185, 129, 0.62);
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.34);
}

.zoz-auto-aloud-vert-btn.is-speaking .zoz-auto-aloud-vert-power {
  border-color: rgba(0, 242, 254, 0.85);
  background: rgba(0, 242, 254, 0.22);
  color: #67e8f9;
  animation: zozAutoAloudPulse 1.4s ease-in-out infinite;
}

@keyframes zozAutoAloudPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 242, 254, 0.35); transform: scale(1); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.72); transform: scale(1.06); }
}

.zoz-auto-aloud-vert-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #475569;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.zoz-auto-aloud-vert-btn.is-on-mode .zoz-auto-aloud-vert-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
}

.zoz-auto-aloud-vert-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  max-height: 76px;
  max-inline-size: 76px;
  max-width: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.zoz-persona-vert-power-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.zoz-persona-vert-power-btn:hover {
  transform: scale(1.07);
  background: rgba(16, 185, 129, 0.26);
  border-color: rgba(52, 211, 153, 0.8);
  color: #ecfdf5;
}

.zoz-persona-vert-power-btn.is-custom-mode {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.32);
}

.zoz-persona-vert-power-btn.is-custom-mode:hover {
  background: rgba(139, 92, 246, 0.34);
  border-color: rgba(196, 181, 253, 0.85);
  color: #ffffff;
}

.zoz-persona-vert-power-btn.is-persona-off {
  border-color: rgba(244, 63, 94, 0.38);
  background: rgba(244, 63, 94, 0.13);
  color: #fb7185;
  box-shadow: none;
}

.zoz-persona-vert-power-btn.is-persona-off:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.65);
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.composer-btn.zoz-persona-composer-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto !important;
  min-width: 26px;
  max-width: 26px;
  height: auto !important;
  padding: 8px 2px;
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.composer-btn.zoz-persona-composer-btn:hover {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.18);
}

.composer-btn.zoz-persona-composer-btn .zoz-persona-btn-icon {
  font-size: 0.72rem;
  color: #38bdf8;
  transition: color 0.18s ease;
}

.composer-btn.zoz-persona-composer-btn .zoz-persona-btn-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  max-height: 112px;
  max-inline-size: 112px;
  max-width: 22px;
  padding: 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.composer-btn.zoz-persona-composer-btn .zoz-persona-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
  flex-shrink: 0;
}

.composer-btn.zoz-persona-composer-btn.is-custom-mode {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(167, 139, 250, 0.48);
  color: #ede9fe;
}

.composer-btn.zoz-persona-composer-btn.is-custom-mode:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(196, 181, 253, 0.75);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.28);
}

.composer-btn.zoz-persona-composer-btn.is-custom-mode .zoz-persona-btn-icon {
  color: #c4b5fd;
}

.composer-btn.zoz-persona-composer-btn.is-custom-mode .zoz-persona-btn-dot {
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.85);
}

.composer-btn.zoz-persona-composer-btn.is-off-mode {
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(148, 163, 184, 0.24);
  color: #94a3b8;
}

.composer-btn.zoz-persona-composer-btn.is-off-mode:hover {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  box-shadow: none;
}

.composer-btn.zoz-persona-composer-btn.is-off-mode .zoz-persona-btn-icon {
  color: #64748b;
}

.composer-btn.zoz-persona-composer-btn.is-off-mode .zoz-persona-btn-dot {
  background: #475569;
  box-shadow: none;
}

/* Dark Nature Themes (seluruh backdrop [data-ai-chat-theme] bernuansa gelap; hanya body.light-theme memakai teks/kapsul terang) */
body.light-theme .zoz-auto-aloud-vertical-capsule {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.97) 100%);
  border-color: rgba(100, 116, 139, 0.35);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

body.light-theme .zoz-auto-aloud-vertical-capsule.is-on-mode {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.97) 0%, rgba(209, 250, 229, 0.96) 100%);
  border-color: rgba(16, 185, 129, 0.55);
}

body.light-theme .zoz-auto-aloud-vert-btn {
  color: #475569;
}

body.light-theme .zoz-auto-aloud-vert-btn.is-on-mode {
  color: #065f46;
}

body.light-theme .zoz-auto-aloud-vert-btn.is-on-mode .zoz-auto-aloud-vert-power {
  color: #059669;
  background: rgba(16, 185, 129, 0.16);
}

@media (max-width: 768px) {
  .zoz-persona-vertical-capsule {
    background: linear-gradient(180deg, rgba(11, 16, 29, 0.97) 0%, rgba(7, 10, 18, 0.98) 100%);
  }
  .zoz-persona-vertical-dock.is-off-mode .zoz-persona-vertical-capsule {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(9, 13, 22, 0.97) 100%);
  }
}

/* 2. Topbar Model Options Menu Entry */
.zoz-persona-opt-icon {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.zoz-persona-opt-trigger.is-custom-mode .zoz-persona-opt-icon {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.zoz-persona-opt-trigger.is-off-mode .zoz-persona-opt-icon {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.zoz-persona-opt-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #34d399;
}

.zoz-persona-opt-trigger.is-custom-mode .zoz-persona-opt-badge {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
}

.zoz-persona-opt-trigger.is-off-mode .zoz-persona-opt-badge {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

/* 3. Executive Persona Modal Card */
.zoz-persona-modal-card {
  max-width: 660px;
  width: 94%;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(165deg, #0b101d 0%, #070a12 100%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), 0 0 32px rgba(14, 165, 233, 0.12);
}

.zoz-persona-modal-header {
  padding: 16px 20px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zoz-persona-header-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.zoz-persona-header-emblem {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.zoz-persona-header-emblem.is-custom {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(56, 189, 248, 0.14) 100%);
  border-color: rgba(167, 139, 250, 0.48);
  color: #c4b5fd;
}

.zoz-persona-header-emblem.is-off {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(248, 113, 113, 0.35);
  color: #94a3b8;
}

.zoz-persona-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.zoz-persona-power-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.38);
  color: #fda4af;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.zoz-persona-power-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(251, 113, 133, 0.65);
  color: #ffe4e6;
}

.zoz-persona-power-btn.is-persona-off {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.zoz-persona-power-btn.is-persona-off:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(52, 211, 153, 0.72);
  color: #d1fae5;
}

.zoz-persona-header-titles {
  min-width: 0;
}

.zoz-persona-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.zoz-persona-title-line .modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.zoz-persona-live-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.42);
  color: #34d399;
}

.zoz-persona-live-pill.is-custom {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.48);
  color: #ddd6fe;
}

.zoz-persona-live-pill.is-off {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(248, 113, 113, 0.34);
  color: #cbd5e1;
}

.zoz-persona-off-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.32);
}

.off-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.off-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.36);
  color: #fda4af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.off-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.off-banner-text strong {
  font-size: 0.8rem;
  color: #fecdd3;
}

.off-banner-text span {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
}

.zoz-persona-header-sub {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.zoz-persona-modal-body {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Segmented Mode Switcher: Non-Custom vs Custom */
.zoz-persona-mode-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(6, 9, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.zoz-persona-mode-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.zoz-persona-mode-tab:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
}

.zoz-persona-mode-tab.is-active[data-persona-mode="formal"] {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.12);
}

.zoz-persona-mode-tab.is-active[data-persona-mode="custom"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(56, 189, 248, 0.08) 100%);
  border-color: rgba(167, 139, 250, 0.5);
  color: #f8fafc;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.14);
}

.zoz-persona-mode-tab .mode-tab-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.zoz-persona-mode-tab .mode-tab-icon.formal {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.zoz-persona-mode-tab .mode-tab-icon.custom {
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.zoz-persona-mode-tab .mode-tab-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.zoz-persona-mode-tab .mode-tab-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: inherit;
}

.zoz-persona-mode-tab .mode-tab-sub {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoz-persona-mode-tab.is-active .mode-tab-sub {
  color: #94a3b8;
}

.zoz-persona-mode-tab .mode-tab-check {
  font-size: 0.9rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.18s ease;
  color: #38bdf8;
}

.zoz-persona-mode-tab[data-persona-mode="custom"] .mode-tab-check {
  color: #c4b5fd;
}

.zoz-persona-mode-tab.is-active .mode-tab-check {
  opacity: 1;
  transform: scale(1);
}

/* Pane 1: Non-Custom (AI Formal Exclusive Card) */
.zoz-formal-executive-card {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.75) 0%, rgba(9, 14, 26, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.formal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.formal-card-badge-wrap {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.formal-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22) 0%, rgba(16, 185, 129, 0.18) 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

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

.formal-card-title-row h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #f8fafc;
}

.formal-exclusive-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.formal-card-heading p {
  margin: 4px 0 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}

.formal-active-indicator {
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  flex-shrink: 0;
}

.formal-active-indicator.is-inactive {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.formal-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.formal-spec-item {
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(6, 10, 19, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.formal-spec-item .spec-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.formal-spec-item .spec-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.formal-spec-item .spec-info strong {
  font-size: 0.77rem;
  color: #e2e8f0;
}

.formal-spec-item .spec-info span {
  font-size: 0.71rem;
  color: #94a3b8;
  line-height: 1.4;
}

.formal-directive-preview {
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(2, 6, 14, 0.72);
  border: 1px dashed rgba(56, 189, 248, 0.28);
}

.directive-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #38bdf8;
  margin-bottom: 5px;
}

.directive-preview-code {
  margin: 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.5;
  font-family: var(--font-mono, monospace);
}

/* Pane 2: Custom Persona Studio */
.zoz-custom-studio-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.custom-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.custom-field-label-row label {
  font-size: 0.79rem;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.custom-field-label-row label i {
  color: #c4b5fd;
}

.custom-field-hint {
  font-size: 0.69rem;
  color: #64748b;
}

.zoz-persona-input,
.zoz-persona-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(6, 10, 19, 0.85);
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: #f8fafc;
  font-size: 0.81rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.zoz-persona-input:focus,
.zoz-persona-textarea:focus {
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.18);
}

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

.zoz-tone-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}

.zoz-tone-pill:hover {
  background: rgba(139, 92, 246, 0.1);
  color: #e2e8f0;
}

.zoz-tone-pill.is-selected {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.55);
  color: #ede9fe;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.16);
}

.zoz-tone-pill i {
  color: #c4b5fd;
  font-size: 0.78rem;
}

.custom-char-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-char-counter {
  font-size: 0.69rem;
  font-family: var(--font-mono, monospace);
  color: #64748b;
}

.custom-clear-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #f87171;
  cursor: pointer;
}

.custom-clear-link:hover {
  text-decoration: underline;
}

.zoz-persona-helper-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.helper-bar-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}

.zoz-helper-chip {
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: #ddd6fe;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoz-helper-chip:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(196, 181, 253, 0.55);
}

/* Saved Custom Profiles Vault */
.zoz-custom-saved-vault {
  padding: 12px;
  border-radius: 11px;
  background: rgba(6, 10, 19, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.saved-vault-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-vault-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.saved-vault-title i {
  color: #c4b5fd;
}

.zoz-custom-saved-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.zoz-saved-profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.zoz-saved-profile-item.is-active-profile {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.12);
}

.zoz-saved-profile-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zoz-saved-profile-info strong {
  font-size: 0.76rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoz-saved-profile-info span {
  font-size: 0.69rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoz-saved-profile-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.zoz-persona-modal-footer {
  padding: 13px 20px;
  flex-shrink: 0;
  background: rgba(6, 9, 16, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.zoz-persona-off-btn {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fca5a5;
}

.zoz-persona-off-btn:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.68);
  color: #ffe4e6;
}

.zoz-persona-off-btn.is-already-off,
.zoz-persona-off-btn:disabled {
  border-color: rgba(148, 163, 184, 0.25);
  color: #64748b;
  background: rgba(15, 23, 42, 0.4);
  cursor: default;
  opacity: 0.8;
}

.zoz-persona-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 4. Settings Modal Persona Overview Tab */
.zoz-persona-settings-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zoz-persona-settings-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.zoz-persona-settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.zoz-persona-settings-icon.is-custom {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.zoz-persona-settings-icon.is-off {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(248, 113, 113, 0.34);
  color: #94a3b8;
}

.zoz-persona-settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.zoz-persona-settings-title-row h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
}

.zoz-persona-status-chip {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.zoz-persona-status-chip.is-custom {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
}

.zoz-persona-status-chip.is-off {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(248, 113, 113, 0.36);
  color: #cbd5e1;
}

.zoz-persona-settings-title-wrap p {
  margin: 4px 0 0 0;
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.45;
}

.zoz-persona-settings-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.zoz-persona-quick-card {
  padding: 13px;
  border-radius: 12px;
  background: rgba(9, 14, 26, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.zoz-persona-quick-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.85);
}

.zoz-persona-quick-card.is-selected[data-persona-quick="off"] {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(244, 63, 94, 0.08);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.12);
}

.zoz-persona-quick-card.is-selected[data-persona-quick="formal"] {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(14, 165, 233, 0.1);
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.12);
}

.zoz-persona-quick-card.is-selected[data-persona-quick="custom"] {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.14);
}

.zoz-persona-quick-card .quick-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.zoz-persona-quick-card .quick-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.zoz-persona-quick-card .quick-card-icon.off {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}

.zoz-persona-quick-card .quick-card-icon.formal {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
}

.zoz-persona-quick-card .quick-card-icon.custom {
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
}

.zoz-persona-quick-card .quick-card-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.zoz-persona-quick-card strong {
  font-size: 0.85rem;
  color: #f8fafc;
}

.zoz-persona-quick-card > span {
  font-size: 0.73rem;
  color: #94a3b8;
  line-height: 1.4;
}

.zoz-persona-settings-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .zoz-persona-settings-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .zoz-persona-modal-card {
    width: 96%;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
  }
  .zoz-persona-modal-header {
    padding: 12px 14px;
  }
  .zoz-persona-header-sub {
    display: none;
  }
  .zoz-persona-modal-body {
    padding: 14px;
    gap: 12px;
  }
  .zoz-persona-modal-footer {
    padding: 11px 14px;
  }
  .zoz-persona-vertical-dock {
    position: fixed !important;
    left: min(calc(min(290px, 85vw) + 8px), calc(100vw - 36px)) !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1005 !important;
    gap: 6px !important;
  }
  #sidebar:not(.open) ~ .zoz-persona-vertical-dock,
  body:not(.mobile-sidebar-open) .zoz-persona-vertical-dock,
  .zoz-persona-vertical-dock.is-sidebar-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate(-18px, -50%) scale(0.9) !important;
  }
  #sidebar:not(.open) ~ .zoz-persona-vertical-dock .zoz-persona-vertical-capsule,
  body:not(.mobile-sidebar-open) .zoz-persona-vertical-dock .zoz-persona-vertical-capsule,
  .zoz-persona-vertical-dock.is-sidebar-hidden .zoz-persona-vertical-capsule,
  #sidebar:not(.open) ~ .zoz-persona-vertical-dock .zoz-auto-aloud-vertical-capsule,
  body:not(.mobile-sidebar-open) .zoz-persona-vertical-dock .zoz-auto-aloud-vertical-capsule,
  .zoz-persona-vertical-dock.is-sidebar-hidden .zoz-auto-aloud-vertical-capsule {
    pointer-events: none !important;
  }
  .zoz-auto-aloud-vertical-capsule {
    width: 30px;
    padding: 3px 2px;
  }
  .zoz-auto-aloud-vert-btn {
    width: 22px;
    gap: 4px;
    padding: 2px 0 6px;
    font-size: 0.62rem;
  }
  .zoz-auto-aloud-vert-power {
    width: 22px;
    height: 22px;
    font-size: 0.64rem;
  }
  .zoz-auto-aloud-vert-label {
    font-size: 0.62rem;
    max-height: 62px;
    max-inline-size: 62px;
  }
  .zoz-persona-vertical-capsule {
    width: 30px;
    padding: 3px 2px;
    gap: 4px;
  }
  .zoz-persona-vert-power-btn {
    width: 22px;
    height: 22px;
    font-size: 0.64rem;
  }
  .composer-btn.zoz-persona-composer-btn {
    width: auto !important;
    min-width: 22px;
    max-width: 24px;
    height: auto !important;
    padding: 6px 2px;
    gap: 5px;
  }
  .composer-btn.zoz-persona-composer-btn .zoz-persona-btn-label {
    max-height: 82px;
    max-inline-size: 82px;
    max-width: 18px;
    font-size: 0.64rem;
  }
  .zoz-persona-power-btn span {
    display: none;
  }
  .formal-specs-grid,
  .zoz-persona-tone-grid,
  .zoz-persona-settings-cards {
    grid-template-columns: 1fr;
  }
  .zoz-persona-mode-switcher {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .zoz-persona-vertical-dock {
    left: min(calc(min(288px, 82vw) + 8px), calc(100vw - 36px)) !important;
  }
}

@media (max-height: 500px) {
  .zoz-persona-vertical-dock {
    gap: 4px !important;
  }
  .zoz-auto-aloud-vert-label {
    max-height: 52px;
    max-inline-size: 52px;
  }
  .composer-btn.zoz-persona-composer-btn .zoz-persona-btn-label {
    max-height: 64px;
    max-inline-size: 64px;
  }
}

/* Missing UI Entrance Keyframes (v811 Bugfix) */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dropdownSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   LOCATION CONSENT GATE & REAL-TIME WEATHER VISUALIZATION CARD
   ========================================================================= */
.zoz-location-consent-card {
  max-width: 470px;
  background: linear-gradient(160deg, rgba(13, 18, 30, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(0, 240, 255, 0.34);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 28px rgba(0, 240, 255, 0.14);
}

.zoz-location-consent-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
  font-size: 0.92rem;
}

.zoz-location-consent-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zoz-location-consent-question {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.5;
}

.zoz-location-consent-reason {
  font-size: 0.84rem;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
}

.zoz-location-consent-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: #5eead4;
  line-height: 1.45;
}

.zoz-location-consent-privacy i {
  margin-top: 2px;
  flex-shrink: 0;
}

.zoz-location-consent-status {
  font-size: 0.82rem;
  border-radius: 9px;
  padding: 9px 12px;
  line-height: 1.45;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.zoz-location-consent-status.is-error {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fecdd3;
}

.zoz-location-manual-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.22);
}

.zoz-location-manual-label {
  font-size: 0.76rem;
  color: #94a3b8;
}

.zoz-location-manual-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.zoz-location-manual-input {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  padding: 8px 10px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
}

.zoz-location-manual-btn {
  white-space: nowrap;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
}

.zoz-location-manual-btn:hover {
  border-color: var(--neon-cyan);
  color: #fff;
}

.zoz-location-consent-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.zoz-location-deny-btn {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 600;
}

.zoz-location-deny-btn:hover {
  background: rgba(244, 63, 94, 0.22);
  color: #fff;
}

.zoz-location-allow-btn {
  padding: 8px 16px;
  font-weight: 700;
  border-radius: 8px;
}

/* Weather Visualization Widget inside Assistant Bubble */
.zoz-weather-display {
  position: relative;
  margin: 14px 0 16px;
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.65);
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #0f172a 100%);
  isolation: isolate;
}

.zoz-weather-display.zoz-weather-theme-sunny {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 54%, #1e40af 100%);
  border-color: rgba(125, 211, 252, 0.38);
}

.zoz-weather-display.zoz-weather-theme-partly_cloudy {
  background: linear-gradient(135deg, #1e40af 0%, #334155 56%, #0f172a 100%);
  border-color: rgba(147, 197, 253, 0.3);
}

.zoz-weather-display.zoz-weather-theme-cloudy {
  background: linear-gradient(135deg, #334155 0%, #475569 52%, #1e293b 100%);
  border-color: rgba(148, 163, 184, 0.3);
}

.zoz-weather-display.zoz-weather-theme-rain {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 48%, #475569 100%);
  border-color: rgba(56, 189, 248, 0.32);
}

.zoz-weather-display.zoz-weather-theme-storm {
  background: linear-gradient(135deg, #090d16 0%, #312e81 52%, #1e1b4b 100%);
  border-color: rgba(168, 85, 247, 0.38);
}

.zoz-weather-display.zoz-weather-theme-fog {
  background: linear-gradient(135deg, #1e293b 0%, #475569 52%, #64748b 100%);
  border-color: rgba(203, 213, 225, 0.3);
}

.zoz-weather-display.zoz-weather-theme-snow {
  background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 55%, #334155 100%);
  border-color: rgba(186, 230, 253, 0.42);
}

.zoz-weather-display.zoz-weather-theme-night {
  background: linear-gradient(135deg, #070b14 0%, #172554 54%, #1e1b4b 100%);
  border-color: rgba(99, 102, 241, 0.35);
}

.zoz-weather-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.zoz-weather-fx-glow {
  position: absolute;
  top: -45px;
  right: -35px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
}

.zoz-weather-theme-rain .zoz-weather-fx-rain {
  position: absolute;
  inset: -40px 0 0 0;
  background-image: repeating-linear-gradient(
    105deg,
    transparent,
    transparent 18px,
    rgba(186, 230, 253, 0.14) 18px,
    rgba(186, 230, 253, 0.14) 19.5px
  );
  animation: zozWeatherRainStreak 1.3s linear infinite;
  opacity: 0.55;
}

.zoz-weather-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zoz-weather-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.zoz-weather-location-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  backdrop-filter: blur(8px);
  max-width: 100%;
}

.zoz-weather-location-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoz-weather-time-meta {
  font-size: 0.75rem;
  color: rgba(241, 245, 249, 0.88);
  font-weight: 600;
  white-space: nowrap;
}

.zoz-weather-day-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.zoz-weather-day-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(226, 232, 240, 0.88);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.zoz-weather-day-tab:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.zoz-weather-day-tab.is-active {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.75);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.zoz-weather-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zoz-weather-hero-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zoz-weather-temp-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.zoz-weather-temp-main {
  font-family: var(--font-display, sans-serif);
  font-size: 2.65rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.zoz-weather-hilow {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.85);
}

.zoz-weather-condition-label {
  font-size: 1.04rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

.zoz-weather-feels-like {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.86);
}

.zoz-weather-hero-icon {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.32));
}

.zoz-weather-svg-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.zoz-weather-anim-sun {
  transform-origin: center;
  animation: zozWeatherSunSpin 18s linear infinite;
}

.zoz-weather-anim-cloud {
  animation: zozWeatherCloudFloat 4s ease-in-out infinite;
}

.zoz-weather-anim-drop {
  animation: zozWeatherRainDrop 1.25s ease-in infinite;
}

.zoz-weather-anim-drop.delay-1 {
  animation-delay: 0.35s;
}

.zoz-weather-anim-drop.delay-2 {
  animation-delay: 0.7s;
}

.zoz-weather-anim-bolt {
  animation: zozWeatherBoltPulse 2.2s ease-in-out infinite;
}

.zoz-weather-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.zoz-weather-metric-item {
  background: rgba(15, 23, 42, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(6px);
}

.zoz-weather-metric-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(226, 232, 240, 0.78);
  display: flex;
  align-items: center;
  gap: 5px;
}

.zoz-weather-metric-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.zoz-weather-forecast-box {
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zoz-weather-forecast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: rgba(241, 245, 249, 0.9);
  letter-spacing: 0.02em;
}

.zoz-weather-sparkline-wrap {
  width: 100%;
  height: 44px;
}

.zoz-weather-sparkline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.zoz-weather-hourly-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 6px;
}

.zoz-weather-hour-slot {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.zoz-weather-hour-slot.is-now {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(125, 211, 252, 0.48);
}

.zoz-weather-hour-time {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.88);
}

.zoz-weather-hour-icon {
  width: 24px;
  height: 24px;
}

.zoz-weather-hour-temp {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
}

.zoz-weather-hour-rain {
  font-size: 0.66rem;
  color: #bae6fd;
}

.zoz-weather-advice-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.92);
  background: rgba(15, 23, 42, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@keyframes zozWeatherSunSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes zozWeatherRainDrop {
  0% { transform: translateY(-3px); opacity: 0.25; }
  65% { opacity: 1; }
  100% { transform: translateY(5px); opacity: 0; }
}

@keyframes zozWeatherRainStreak {
  0% { transform: translateY(-20px); }
  100% { transform: translateY(20px); }
}

@keyframes zozWeatherBoltPulse {
  0%, 70%, 100% { opacity: 0.35; }
  75%, 85% { opacity: 1; }
}

@media (max-width: 640px) {
  .zoz-location-consent-card {
    width: 95%;
  }
  .zoz-location-manual-row {
    flex-direction: column;
    align-items: stretch;
  }
  .zoz-weather-display {
    padding: 14px;
  }
  .zoz-weather-temp-main {
    font-size: 2.15rem;
  }
  .zoz-weather-hero-icon {
    width: 64px;
    height: 64px;
  }
  .zoz-weather-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .zoz-weather-hourly-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==================== Z21 COMMANDER SWARM TELEMETRY CARD ==================== */
.zoz-z21-swarm-card {
  margin: 8px 0 12px 0;
  border: 1px solid rgba(244, 63, 94, 0.34);
  background: linear-gradient(160deg, rgba(24, 12, 22, 0.86) 0%, rgba(12, 16, 29, 0.92) 100%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.zoz-z21-swarm-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fecdd3;
}

.zoz-z21-swarm-summary::-webkit-details-marker {
  display: none;
}

.zoz-z21-swarm-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.zoz-z21-swarm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fda4af;
  flex-shrink: 0;
}

.zoz-z21-swarm-meta {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 500;
  white-space: nowrap;
}

.zoz-z21-swarm-chevron {
  font-size: 0.72rem;
  color: #fda4af;
  transition: transform 0.2s ease;
  margin-left: 4px;
}

.zoz-z21-swarm-card[open] .zoz-z21-swarm-chevron {
  transform: rotate(180deg);
}

.zoz-z21-swarm-body {
  padding: 0 14px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.zoz-z21-wave-block {
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoz-z21-wave-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: #e2e8f0;
  font-weight: 600;
}

.zoz-z21-wave-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.zoz-z21-wave-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f43f5e, #fb923c, #34d399);
  transition: width 0.2s ease;
}

.zoz-z21-agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zoz-z21-agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.72rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  max-width: 100%;
}

.zoz-z21-agent-chip.is-running {
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.zoz-z21-agent-chip.is-done {
  border-color: rgba(16, 185, 129, 0.42);
  color: #6ee7b7;
}

.zoz-z21-agent-chip.is-error {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.zoz-z21-agent-role {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

body.light-theme .zoz-z21-swarm-card {
  background: linear-gradient(160deg, rgba(255, 241, 242, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-color: rgba(244, 63, 94, 0.3);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

body.light-theme .zoz-z21-swarm-summary,
body.light-theme .zoz-z21-wave-header {
  color: #0f172a;
}

body.light-theme .zoz-z21-swarm-meta {
  color: #475569;
}

body.light-theme .zoz-z21-agent-chip {
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
}

@media (max-width: 768px) {
  .zoz-z21-swarm-summary {
    flex-wrap: wrap;
    padding: 9px 11px;
  }
  .zoz-z21-agent-role {
    max-width: 130px;
  }
}

/* Normalisasi subskrip/superskrip inline agar tidak meregangkan tinggi baris paragraf */
.message-content sub,
.message-content sup,
.ai-markdown-body sub,
.ai-markdown-body sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
.message-content sup,
.ai-markdown-body sup { top: -0.45em; }
.message-content sub,
.ai-markdown-body sub { bottom: -0.22em; }
.z21-eq-note {
  margin-top: 5px;
  font-size: 12.5px;
  color: #475569;
  font-style: italic;
}

/* ==================== v842 Z21 HITL COMMAND APPROVAL CARD ==================== */
.zoz-z21-cmd-approval-card {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.88));
  color: #e2e8f0;
  font-size: 13px;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.35);
}

.zoz-z21-cmd-approval-card.is-resolved-approved {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(6, 78, 59, 0.28);
}

.zoz-z21-cmd-approval-card.is-resolved-denied {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(76, 5, 25, 0.28);
}

.zoz-z21-cmd-approval-card.is-dismissed {
  display: none !important;
}

.zoz-z21-cmd-approval-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.zoz-z21-cmd-approval-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #7dd3fc;
}

.zoz-z21-cmd-approval-meta {
  font-size: 11.5px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.zoz-z21-cmd-approval-code {
  margin: 6px 0 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.zoz-z21-cmd-approval-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.zoz-z21-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
}

.zoz-z21-cmd-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.zoz-z21-cmd-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.zoz-z21-cmd-btn-approve {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.zoz-z21-cmd-btn-deny {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.zoz-z21-cmd-btn-allowlist {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.42);
  color: #7dd3fc;
}

.zoz-z21-cmd-sandbox-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

body.light-theme .zoz-z21-cmd-approval-card {
  background: rgba(248, 250, 252, 0.96);
  color: #1e293b;
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

body.light-theme .zoz-z21-cmd-approval-title {
  color: #0369a1;
}

body.light-theme .zoz-z21-cmd-approval-code {
  background: #0f172a;
  color: #f1f5f9;
}

body.light-theme .zoz-z21-cmd-sandbox-toggle {
  color: #334155;
}

.zoz-z21-preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}

.zoz-z21-preset-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-right: 2px;
}

.zoz-z21-preset-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.5);
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.zoz-z21-preset-pill.is-active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.65);
  color: #7dd3fc;
}

body.light-theme .zoz-z21-preset-label {
  color: #475569;
}

body.light-theme .zoz-z21-preset-pill {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.45);
  color: #334155;
}

body.light-theme .zoz-z21-preset-pill.is-active {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.6);
  color: #0369a1;
}

/* ==================== Z21 AGENT THINKING EFFORT CARD IN SETTINGS (LOW / HIGH / MAX) ==================== */
.zoz-z21-thinking-effort-bar {
  display: block;
  margin-top: 12px;
}

.zoz-z21-effort-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.zoz-z21-effort-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fda4af;
}

.zoz-z21-effort-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 4px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.zoz-z21-effort-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoz-z21-effort-pill:hover:not(.is-locked) {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.zoz-z21-effort-pill.is-active[data-z21-effort="low"] {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

.zoz-z21-effort-pill.is-active[data-z21-effort="high"] {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.28), rgba(245, 158, 11, 0.24));
  border-color: rgba(251, 113, 133, 0.72);
  color: #ffe4e6;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.25);
}

.zoz-z21-effort-pill.is-active[data-z21-effort="max"] {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.28), rgba(239, 68, 68, 0.28));
  border-color: rgba(251, 146, 60, 0.75);
  color: #ffedd5;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.26);
}

.zoz-z21-effort-pill.is-active[data-z21-engine="claude_code"] {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(251, 146, 60, 0.62);
  color: #fdba74;
}

.zoz-z21-effort-pill.is-active[data-z21-engine="native"] {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

.zoz-z21-engine-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.zoz-z21-engine-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
}

body.light-theme .zoz-z21-engine-label {
  color: #334155;
}

body.light-theme .zoz-z21-effort-pill.is-active[data-z21-effort="max"],
body.light-theme .zoz-z21-effort-pill.is-active[data-z21-engine="claude_code"] {
  background: rgba(255, 237, 213, 0.92);
  border-color: rgba(234, 88, 12, 0.58);
  color: #c2410c;
}

body.light-theme .zoz-z21-effort-pill.is-active[data-z21-engine="native"] {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.55);
  color: #0369a1;
}

.zoz-z21-effort-pill.is-locked {
  opacity: 0.48;
  cursor: not-allowed;
  color: #64748b;
}

.zoz-z21-effort-summary-badge {
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  white-space: nowrap;
}

.zoz-z21-effort-summary-badge.is-high {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

body.light-theme .zoz-z21-thinking-effort-bar {
  background: rgba(255, 241, 242, 0.85);
  border-color: rgba(244, 63, 94, 0.32);
}

body.light-theme .zoz-z21-effort-label {
  color: #be123c;
}

body.light-theme .zoz-z21-effort-pills {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

body.light-theme .zoz-z21-effort-pill {
  color: #475569;
}

body.light-theme .zoz-z21-effort-pill.is-active[data-z21-effort="low"] {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.55);
  color: #0369a1;
}

body.light-theme .zoz-z21-effort-pill.is-active[data-z21-effort="high"] {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(225, 29, 72, 0.55);
  color: #be123c;
}

body.light-theme .zoz-z21-effort-summary-badge {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.4);
  color: #334155;
}

body.light-theme .zoz-z21-effort-summary-badge.is-high {
  background: rgba(255, 228, 230, 0.95);
  border-color: rgba(244, 63, 94, 0.45);
  color: #be123c;
}

/* ==================== POHON AKAR PEMIKIRAN AGEN PARALEL Z21 TERINTEGRASI DI DALAM ALUR PENALARAN ==================== */
/* Cabang Agen Paralel di Live Streaming Rail (.zoz-cot-live-rail) agar proses kerjanya tampak bersama dengan tool utama */
.zoz-cot-rail-item.is-agent-branch {
  padding-left: 24px;
  padding-top: 3px;
  padding-bottom: 6px;
}

.zoz-cot-rail-item.is-agent-branch:not(:last-child)::after {
  top: 0;
}

.zoz-cot-rail-item.is-agent-branch::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 13px;
  width: 14px;
  height: 1.5px;
  background: rgba(168, 85, 247, 0.42);
  pointer-events: none;
}

.zoz-cot-rail-item.is-agent-branch .zoz-cot-rail-node {
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  color: #c4b5fd;
}

.zoz-cot-rail-item.is-agent-branch .zoz-cot-rail-text {
  font-size: 0.82rem;
  line-height: 1.42;
}

.zoz-cot-rail-agent-role {
  color: #c4b5fd;
  font-weight: 600;
}

body.light-theme .zoz-cot-rail-agent-role {
  color: #6d28d9;
}

/* Akar sekunder turun ke bawah dari Langkah Gelombang ke daftar Agen Paralel di dalam .zoz-cot-steps */
.zoz-cot-step-tools.zoz-z21-root-tree.zoz-z21-agent-root-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin-top: 7px;
  padding-top: 4px;
  padding-left: 3px;
}

/* Simpul tiap Agen: menyatu 100% sebagai .zoz-cot-tool-item dengan akar bercabang ke kanan & ke bawah */
.zoz-cot-tool-item.zoz-z21-agent-root-node {
  position: relative;
  padding-left: 13px;
  padding-bottom: 6px;
}

.zoz-cot-tool-item.zoz-z21-agent-root-node:not(:last-child) {
  border-left: 1.5px solid rgba(168, 85, 247, 0.48);
}

.zoz-cot-tool-item.zoz-z21-agent-root-node:last-child {
  padding-left: 14.5px;
  padding-bottom: 0;
  background-image: linear-gradient(180deg, rgba(168, 85, 247, 0.48), rgba(52, 211, 153, 0.42));
  background-size: 1.5px 14px;
  background-position: 0 0;
  background-repeat: no-repeat;
}

.zoz-cot-tool-item.zoz-z21-agent-root-node::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  width: 11px;
  height: 1.5px;
  background: rgba(168, 85, 247, 0.45);
}

.zoz-cot-tool-item.zoz-z21-agent-root-node:last-child::before {
  left: 1.5px;
}

.zoz-cot-tool-item.zoz-z21-agent-root-node::after {
  content: '';
  position: absolute;
  top: 11.5px;
  left: -3.75px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.16);
}

.zoz-cot-tool-item.zoz-z21-agent-root-node:last-child::after {
  left: -2.25px;
}

.zoz-cot-tool-item.zoz-z21-agent-root-node .zoz-z21-agent-chip {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--text-main, #f0f4fc);
  max-width: 100%;
}

/* Akar daun ke bawah & ke kanan untuk temuan/ringkasan tiap agen */
.zoz-cot-tool-outcome.zoz-z21-agent-finding-leaf {
  position: relative;
  margin-left: 4px;
  padding: 2px 0 1px 14px;
  font-size: 0.74rem;
  line-height: 1.44;
  color: var(--text-muted, #94a3b8);
  border-left: 1.5px dashed rgba(148, 163, 184, 0.28);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.zoz-cot-tool-outcome.zoz-z21-agent-finding-leaf::before {
  content: '↳';
  position: absolute;
  left: 2px;
  top: 1px;
  font-size: 10px;
  color: #7dd3fc;
}

body.light-theme .zoz-cot-tool-item.zoz-z21-agent-root-node {
  background: transparent;
  border-left-color: rgba(15, 23, 42, 0.18);
}

body.light-theme .zoz-cot-tool-item.zoz-z21-agent-root-node .zoz-z21-agent-chip {
  color: #0f172a;
}

body.light-theme .zoz-cot-tool-outcome.zoz-z21-agent-finding-leaf {
  color: #475569;
  border-left-color: rgba(15, 23, 42, 0.22);
}

/* ==================== DYNAMIC MIC / SEND COMPOSER ACTION & WEB SPEECH API ==================== */
#sendPromptBtn .composer-action-icon {
  display: none;
  pointer-events: none;
  flex-shrink: 0;
}

#sendPromptBtn[data-composer-action="mic"] .composer-icon-mic,
#sendPromptBtn.is-mic-mode .composer-icon-mic {
  display: inline-flex;
}

#sendPromptBtn[data-composer-action="listening"] .composer-icon-listening,
#sendPromptBtn.is-listening .composer-icon-listening {
  display: inline-flex;
}

#sendPromptBtn[data-composer-action="send"] .composer-icon-send,
#sendPromptBtn.is-send-mode .composer-icon-send,
#sendPromptBtn:not([data-composer-action]):not(.is-mic-mode):not(.is-listening) .composer-icon-send {
  display: inline-flex;
}

body #mainContent .composer-box .send-btn.is-mic-mode {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: none !important;
}

body #mainContent .composer-box .send-btn.is-mic-mode:hover {
  background: rgba(45, 212, 191, 0.2) !important;
  color: #5eead4 !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.24) !important;
}

body.light-theme #mainContent .composer-box .send-btn.is-mic-mode {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.18) !important;
  box-shadow: none !important;
}

body.light-theme #mainContent .composer-box .send-btn.is-mic-mode:hover {
  background: rgba(13, 148, 136, 0.14) !important;
  color: #0f766e !important;
  border-color: rgba(13, 148, 136, 0.35) !important;
}

body #mainContent .composer-box .send-btn.is-listening {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  color: #ffffff !important;
  border: 1px solid rgba(251, 113, 133, 0.7) !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.48) !important;
}

body #mainContent .composer-box .send-btn.is-listening:hover {
  background: linear-gradient(135deg, #fb7185, #f43f5e) !important;
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.65) !important;
}

@media (prefers-reduced-motion: no-preference) {
  body #mainContent .composer-box .send-btn.is-listening {
    animation: zozVoiceListeningPulse 1.5s ease-in-out infinite;
  }

  .voice-speech-dot {
    animation: zozVoiceDotPulse 1.3s ease-in-out infinite;
  }
}

@keyframes zozVoiceListeningPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 0 22px rgba(244, 63, 94, 0.72);
  }
}

@keyframes zozVoiceDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

#sendPromptBtn:focus-visible,
.voice-lang-toggle-btn:focus-visible,
.voice-stop-action-btn:focus-visible {
  outline: 2.5px solid #2dd4bf !important;
  outline-offset: 2px !important;
}

body #mainContent .composer-box.voice-listening-active {
  box-shadow: 0 8px 34px rgba(244, 63, 94, 0.22), inset 0 0 0 1.5px rgba(244, 63, 94, 0.45) !important;
}

.voice-speech-bar {
  order: -1;
  width: 100%;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.34);
  font-size: 0.76rem;
  color: #fecdd3;
}

.voice-speech-bar.is-refining {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(45, 212, 191, 0.42);
  color: #99f6e4;
}

.voice-speech-bar.is-refining .voice-speech-dot {
  background: #2dd4bf;
}

body.light-theme .voice-speech-bar.is-refining {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.35);
  color: #0f766e;
}

.voice-speech-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.voice-speech-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fb7185;
  flex-shrink: 0;
}

.voice-speech-status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.voice-speech-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.voice-lang-toggle-btn,
.voice-stop-action-btn {
  min-height: 24px;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.voice-lang-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

.voice-lang-toggle-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.5);
}

.voice-stop-action-btn {
  background: rgba(244, 63, 94, 0.24);
  border: 1px solid rgba(251, 113, 133, 0.55);
  color: #ffffff;
}

.voice-stop-action-btn:hover {
  background: rgba(244, 63, 94, 0.42);
}

body.light-theme .voice-speech-bar {
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.26);
  color: #9f1239;
}

body.light-theme .voice-lang-toggle-btn {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

body.light-theme .voice-stop-action-btn {
  background: #e11d48;
  border-color: #be123c;
  color: #ffffff;
}

/* Mencegah flicker Welcome Hero AI sesaat sebelum app.js (defer) selesai inisialisasi saat refresh di mode WhatsApp localhost */
html[data-boot-chat-mode="whatsapp"] #welcomeHero {
  display: none !important;
}

/* ==================== INTERACTIVE AI WORKING DIRECTORY PICKER (v876) ==================== */
.zoz-workdir-composer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  max-width: 152px;
}

.zoz-workdir-composer-btn:hover {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(45, 212, 191, 0.08);
}

.zoz-workdir-composer-btn.has-custom-workdir {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(20, 184, 166, 0.13);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.14);
}

.zoz-workdir-btn-icon {
  font-size: 0.76rem;
  flex-shrink: 0;
}

.zoz-workdir-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 112px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.69rem;
}

.zoz-settings-workdir-badge {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.zoz-workdir-modal-card {
  width: 96vw;
  max-width: 660px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: #0b0f19;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 28px rgba(45, 212, 191, 0.14);
}

.zoz-workdir-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zoz-workdir-modal-header .modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  color: #f1f5f9;
}

.zoz-workdir-modal-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.38);
  color: #2dd4bf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zoz-workdir-modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zoz-workdir-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.zoz-workdir-native-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
}

.zoz-workdir-native-btn:hover {
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
}

.zoz-workdir-active-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 9px;
  border-radius: 999px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoz-workdir-path-row,
.zoz-workdir-newfolder-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoz-workdir-path-input,
.zoz-workdir-newfolder-input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

.zoz-workdir-path-input:focus,
.zoz-workdir-newfolder-input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.65);
}

.zoz-workdir-quick-roots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zoz-workdir-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoz-workdir-quick-chip:hover,
.zoz-workdir-quick-chip.is-active {
  border-color: rgba(45, 212, 191, 0.55);
  color: #5eead4;
  background: rgba(20, 184, 166, 0.14);
}

.zoz-workdir-browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.zoz-workdir-browser-current {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.zoz-workdir-folder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 230px;
  min-height: 110px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.zoz-workdir-folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.zoz-workdir-folder-item:hover {
  background: rgba(45, 212, 191, 0.09);
  border-color: rgba(45, 212, 191, 0.28);
  color: #f8fafc;
}

.zoz-workdir-folder-item.is-hidden-dir {
  opacity: 0.72;
}

.zoz-workdir-folder-empty {
  padding: 20px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
}

.zoz-workdir-autocheck {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #94a3b8;
  cursor: pointer;
}

.zoz-workdir-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(6, 9, 16, 0.9);
}

@media (max-width: 640px) {
  .zoz-workdir-btn-label {
    max-width: 68px;
  }
  .zoz-workdir-path-row,
  .zoz-workdir-newfolder-row {
    flex-wrap: wrap;
  }
}

body.light-theme .zoz-workdir-composer-btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
}

body.light-theme .zoz-workdir-composer-btn.has-custom-workdir {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.45);
  background: rgba(20, 184, 166, 0.12);
}












