@import url('studio.css');
/* 
 * Horizon AI Launcher - Core Style System
 * Theme: Dark Futuristic / Glassmorphism
 */

:root {
  /* Color System */
  --bg-primary: #0B0E14;
  --bg-secondary: #111520;
  --bg-tertiary: #1A1F2C;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.10);
  --glass-bg: rgba(255, 255, 255, 0.04);

  --accent-primary: #06B6D4;
  --accent-secondary: #8B5CF6;
  --color-success: #22C55E;
  --color-danger: #EF4444;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Layout & Glassmorphism Properties */
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 8px;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);
  --shadow-elevated: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 24px rgba(6, 182, 212, 0.25);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* OS-like feel */
  /* Premium futuristic background gradient */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.08), transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.08), transparent 30%);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-small {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* View Containers */
.view-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  animation: fadeIn 0.5s ease-out;
}

.app-view {
  display: flex;
}

/* 1. Loading Screen */
#loading-view {
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
  background: var(--bg-primary);
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 400px;
}

.giant-text {
  font-size: 3rem;
}

.loading-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 2rem 0;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--accent-primary);
}

.loading-status {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* 2. Login Screen */
#login-view {
  justify-content: center;
  align-items: center;
  z-index: 900;
  background: var(--bg-primary);
}

.premium-login {
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 20px rgba(6, 182, 212, 0.05);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header { margin-bottom: 1rem; }
.large-text { font-size: 2.2rem; }
.login-subtitle { color: var(--text-secondary); margin-top: 0.5rem; }

.auth-tabs {
  display: flex;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 1rem;
}
.auth-tab {
  flex: 1;
  padding: 0.8rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.auth-tab.active {
  background: rgba(255,255,255,0.1);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }
.input-group { position: relative; }
.input-group input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: var(--glass-border);
  color: white;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
}
.input-group input:focus { 
  border-color: var(--accent-primary); 
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15); 
  background: rgba(0,0,0,0.5);
}
.btn-toggle-password {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 1.2rem;
  transition: color 0.2s;
}
.btn-toggle-password:hover { color: white; }

.password-strength {
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px;
  overflow: hidden; margin-top: -0.5rem; margin-bottom: 0.5rem;
}
.strength-bar { height: 100%; width: 0%; transition: all 0.3s ease; }

.full-width { width: 100%; padding: 1rem; border-radius: 12px; font-size: 1rem; }

.divider {
  display: flex; align-items: center; color: var(--text-secondary); font-size: 0.9rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1); margin: 0 10px;
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.9rem;
}

.btn-loader {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-google {
  background: white; color: #333; border: none;
  padding: 0.8rem; border-radius: 8px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  cursor: pointer; transition: all 0.3s ease;
}
.btn-google:hover { background: #f0f0f0; transform: translateY(-2px); }

.login-footer { font-size: 0.8rem; color: var(--text-secondary); opacity: 0.7; margin-top: 1rem; }

/* Logo Text (Gradient) */
.logo-text {
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}


/* App Container (Next to sidebar) */
.app-container, .launcher-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  height: 100vh;
  overflow-y: auto;
}

/* Top Header */
.launcher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(11, 16, 32, 0.4);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}


/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

/* Individual Card */
.app-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: var(--border-radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.app-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(6, 182, 212, 0.4);
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid rgba(6, 182, 212, 0.3);
  transition: all 0.3s ease;
}

.app-card:hover .card-icon {
  box-shadow: 0 0 15px var(--accent-primary);
  transform: scale(1.1);
}

.card-content { display: flex; flex-direction: column; gap: 0.5rem; }
.card-title { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.card-description { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }


/* Buttons & Selects */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover { box-shadow: var(--shadow-glow); transform: translateY(-2px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: var(--glass-border);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.btn-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-icon:hover { box-shadow: var(--shadow-glow); transform: scale(1.05); }

.modern-select {
  background: rgba(11, 16, 32, 0.6);
  border: var(--glass-border);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  outline: none;
  font-family: inherit;
}


/* Independent App Content Areas */
.app-content-area {
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.center-content {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
}


/* Input Area */
.chat-input-area {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  padding: 0.75rem 1rem;
  border-radius: 30px;
}

.chat-input-area input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  outline: none;
  padding: 0 1rem;
}


/* Chat specific */
.chat-message {
  max-width: 80%;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
  line-height: 1.5;
  animation: slideUp 0.3s ease-out;
}
.ai-message {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}
.user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-bottom-right-radius: 4px;
}


/* Code specific */
.code-example {
  background: rgba(0,0,0,0.4);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  border: var(--glass-border);
  text-align: left;
  width: 100%;
  max-width: 600px;
}
.code-example pre {
  margin: 0;
  color: var(--color-success);
  font-family: 'Courier New', Courier, monospace;
}

/* Vision specific */
.upload-area {
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: var(--border-radius-lg);
  padding: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}
.upload-area:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent-primary);
}
.upload-icon {
  font-size: 3rem;
  color: var(--accent-primary);
}

/* Tools specific */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  width: 100%;
}
.tool-card {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  border: var(--glass-border);
  cursor: pointer;
}
.tool-card:hover {
  background: rgba(255,255,255,0.1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Thinking Animation */
.thinking-animation span {
  animation: blink 1.4s infinite both;
}
.thinking-animation span:nth-child(2) { animation-delay: 0.2s; }
.thinking-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* Markdown Rendering Styles */
.chat-message h2, .chat-message h3, .chat-message h4 {
  color: var(--accent-primary);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.chat-message h2:first-child, .chat-message h3:first-child, .chat-message h4:first-child {
  margin-top: 0;
}
.chat-message p { margin-bottom: 0.75rem; }
.chat-message ul, .chat-message ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.chat-message li { margin-bottom: 0.25rem; }
.chat-message strong { color: white; font-weight: 600; }
.chat-message em { color: var(--text-secondary); font-style: italic; }
.chat-message blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 1rem;
  margin-left: 0;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  padding: 0.5rem 1rem;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}
.chat-message .code-example {
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
}
.chat-message .inline-code {
  background: rgba(0,0,0,0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  color: var(--color-success);
}

/* Profile & Header */
.profile-container { position: relative; }
.profile-trigger {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.2s;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}
.profile-trigger:hover { transform: scale(1.05); }

.dynamic-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; color: white;
}

.profile-avatar-large {
  width: 60px; height: 60px;
  border-radius: 50%;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.profile-menu {
  position: absolute; top: 120%; right: 0;
  width: 260px;
  background: rgba(11, 16, 32, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow-y: auto; z-index: 1000;
  max-height: 80vh;
  animation: fadeIn 0.2s ease-out;
}
.profile-menu-header {
  padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.profile-menu-header h4 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.highlight { color: var(--accent-primary); margin-top: 0.5rem; font-weight: 600; }

.profile-menu-items { display: flex; flex-direction: column; padding: 0.5rem 0; }
.btn-menu {
  background: none; border: none; color: white;
  padding: 0.8rem 1.5rem; text-align: left; width: 100%;
  font-family: inherit; font-size: 0.9rem;
  cursor: pointer; transition: background 0.2s;
}
.btn-menu:hover { background: rgba(255,255,255,0.05); }
.menu-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 0.5rem 0; }
.text-danger { color: #EF4444 !important; }

/* Cursor fix for all interactive elements */
.tool-card, .auth-tab, .project-header, .upload-area, .btn-icon {
  cursor: pointer;
}

/* Credits Badge */
.credits-badge {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.credits-badge:hover { background: rgba(0,0,0,0.6); transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* New Sidebar Styles */
.sidebar-top-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}
.sidebar-section-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0 0.5rem 0.5rem;
}
.sidebar-chat-item {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-chat-item:hover, .sidebar-chat-item.active {
  background: rgba(255,255,255,0.05);
  color: white;
}
.sidebar-bottom-section {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: white;
}
.sidebar-profile-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.model-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  gap: 0.4rem;
}

/* Genexts AI Redesign Core */
.genexts-main-layout {
    display: flex;
    height: 100vh;
}

.genexts-centered-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.genexts-header {
    display: flex;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
}

.genexts-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.genexts-icon-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.genexts-icon-btn:hover {
    opacity: 1;
}

.genexts-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.genexts-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.genexts-greeting-area {
    width: 100%;
    text-align: left;
    margin-bottom: 4rem;
}

.genexts-greeting {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.genexts-sub-greeting {
    font-size: 1rem;
    color: var(--text-secondary);
}

.genexts-center-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.genexts-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-top: 1rem;
    letter-spacing: -0.5px;
}

.genexts-prompt-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.genexts-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

#genexts-global-input {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 30px;
    padding: 1.2rem 4rem 1.2rem 1.5rem;
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#genexts-global-input:focus {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.1);
}

#genexts-global-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.genexts-mic-btn {
    position: absolute;
    right: 3.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.genexts-send-btn {
    position: absolute;
    right: 0.5rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.genexts-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.genexts-quick-actions {
    display: flex;
    gap: 1rem;
}

.genexts-pill {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.genexts-pill:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.genexts-app-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Sidebar Step 1 Refinement START */
.sidebar {
    width: 250px !important;
    background-color: var(--bg-primary) !important;
    border-right: 1px solid rgba(255,255,255,0.05) !important;
    padding: 1.5rem 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.2rem !important;
    transition: width 0.3s ease !important;
    overflow-x: hidden !important;
    z-index: 100 !important;
}

.sidebar.collapsed {
    width: 72px !important;
    align-items: center !important;
}

.genexts-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.genexts-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .genexts-sidebar-brand {
    opacity: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    display: none !important;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-text .brand-name {
    font-weight: 600; 
    font-size: 1.1rem; 
    letter-spacing: 0.5px; 
    color: #fff;
}

.sidebar-brand-text .brand-tagline {
    font-size: 0.65rem; 
    color: #64748b; 
    margin-top: -2px;
}

.sidebar-toggle-btn {
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    padding: 0.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 8px; 
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.05); 
    color: #fff;
}

.sidebar-nav-items {
    display: flex; 
    flex-direction: column; 
    gap: 0.2rem;
    width: 100%;
}

.sidebar-item {
    display: flex !important; 
    align-items: center !important; 
    justify-content: flex-start !important;
    padding: 0.8rem 1rem !important; 
    border-radius: 8px !important; 
    color: var(--text-secondary) !important; 
    font-size: 0.95rem !important; 
    gap: 1rem !important; 
    cursor: pointer; 
    position: relative; 
    border-left: 3px solid transparent; 
    transition: all 0.2s ease;
    width: 100% !important;
    height: auto !important;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center !important;
    padding: 0.8rem !important;
}

.sidebar-item .icon {
    font-size: 1.2rem; 
    min-width: 24px; 
    text-align: center;
}

.sidebar-item .label {
    white-space: nowrap !important;
    opacity: 1 !important;
    width: auto !important;
    display: inline !important;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-item .label {
    display: none !important;
    opacity: 0 !important; 
    width: 0 !important; 
}

.sidebar-item:hover, .sidebar-item.active {
    background-color: rgba(255,255,255,0.03) !important; 
    color: #fff !important;
}

.sidebar-item.active {
    border-left: 3px solid var(--accent-primary) !important;
    box-shadow: inset 20px 0 30px -20px rgba(6, 182, 212, 0.15), inset 40px 0 40px -30px rgba(139, 92, 246, 0.1) !important;
}

/* Tooltips */
.sidebar.collapsed .sidebar-item::after {
    content: attr(title);
    position: absolute;
    left: 75px;
    background: var(--bg-tertiary);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(-10px);
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sidebar.collapsed .sidebar-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-profile-card {
    margin-top: auto;
    padding: 0.8rem;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.sidebar.collapsed .profile-info, .sidebar.collapsed .profile-chevron {
    display: none !important;
}

.sidebar.collapsed .sidebar-profile-card {
    justify-content: center;
    padding: 0.5rem;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    background-size: cover;
    background-position: center;
}
/* Sidebar Step 1 Refinement END */

/* Voice Assistant Button */
.voice-assistant-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(157, 0, 255, 0.1));
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.05);
    flex-shrink: 0;
}
.voice-assistant-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(157, 0, 255, 0.2));
    border-color: rgba(6, 182, 212, 0.5);
    transform: scale(1.05);
}
.voice-assistant-btn.listening {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border-color: transparent;
    animation: voice-pulse 1.5s infinite alternate;
}
@keyframes voice-pulse {
    0% {
        box-shadow: 0 0 10px rgba(6, 182, 212, 0.4), 0 0 20px rgba(157, 0, 255, 0.2);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.8), 0 0 40px rgba(157, 0, 255, 0.4);
        transform: scale(1.1);
    }
}

/* Voice Panel Styles */
.voice-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: 320px;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}
.voice-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateX(20px);
}
.voice-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.voice-header-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.voice-header-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.voice-header-title p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}
.voice-selection-area {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.voice-select-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}
.voice-dropdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}
.voice-more-voices {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.voice-more-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}
.voice-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.8rem;
    cursor: pointer;
}
.voice-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}
.voice-radio.active {
    border-color: var(--accent-primary);
}
.voice-radio.active::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
}
.voice-info h4 {
    margin: 0 0 0.2rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}
.voice-info p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}
.voice-play-btn {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.voice-action-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.voice-main-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(6, 182, 212, 0.5);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}
.voice-main-btn:hover {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
    border-color: var(--accent-primary);
}
.voice-main-btn.listening {
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.4);
    animation: voice-panel-pulse 1.5s infinite alternate;
}
.voice-main-btn.thinking {
    background: rgba(255, 204, 0, 0.1);
    border-color: #ffcc00;
    color: #ffcc00;
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.3);
    animation: voice-panel-thinking 1s infinite alternate;
}
.voice-main-btn.speaking {
    background: rgba(0, 255, 128, 0.1);
    border-color: #00ff80;
    color: #00ff80;
    box-shadow: 0 0 40px rgba(0, 255, 128, 0.3);
    animation: voice-panel-speaking 0.8s infinite alternate;
}

@keyframes voice-panel-pulse {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(6, 182, 212, 0.2); }
    100% { transform: scale(1.05); box-shadow: 0 0 50px rgba(6, 182, 212, 0.6); }
}
@keyframes voice-panel-thinking {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.02); opacity: 1; }
}
@keyframes voice-panel-speaking {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 255, 128, 0.2); }
    100% { transform: scale(1.1); box-shadow: 0 0 60px rgba(0, 255, 128, 0.6); }
}

#voice-status-text {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}
#voice-sub-text {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.voice-privacy-area {
    margin: 1.2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    color: rgba(255, 255, 255, 0.6);
}
.voice-privacy-area svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.privacy-text h4 {
    margin: 0 0 0.3rem 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}
.privacy-text p {
    margin: 0;
    font-size: 0.7rem;
    line-height: 1.4;
}

/* ===== Canvas View (separate from Chat) ===== */
.cv-shell { flex: 1; display: flex; flex-direction: column; height: 100vh; min-width: 0; padding: 1.25rem 1.5rem; gap: 1rem; }
.cv-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cv-title { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.cv-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem;
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(139,92,246,0.25)); border: 1px solid rgba(139,92,246,0.35); flex-shrink: 0; }
.cv-title h2 { font-size: 1.15rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-title p { font-size: 0.8rem; color: var(--text-secondary); margin: 0.1rem 0 0; }
.cv-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.cv-ghost-btn { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text-primary);
  padding: 0.5rem 0.9rem; border-radius: 10px; font-size: 0.85rem; cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.cv-ghost-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); }

.cv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 1rem; }
.cv-left, .cv-right { min-height: 0; display: flex; flex-direction: column; background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 16px; overflow: hidden; }

/* Thread */
.cv-thread { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.cv-welcome h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.cv-welcome > p { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 1rem; }
.cv-roster { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.cv-roster-item { display: grid; grid-template-columns: 10px 110px 1fr; align-items: center; gap: 0.6rem; font-size: 0.82rem;
  padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(255,255,255,0.03); }
.cv-roster-item span:last-child { color: var(--text-secondary); }
.cv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.cv-suggestions { display: flex; flex-direction: column; gap: 0.4rem; }
.cv-suggestion { text-align: left; background: transparent; border: 1px dashed rgba(255,255,255,0.12); color: var(--text-secondary);
  padding: 0.6rem 0.75rem; border-radius: 10px; font-size: 0.82rem; cursor: pointer; transition: all 0.15s; }
.cv-suggestion:hover { color: var(--text-primary); border-color: rgba(6,182,212,0.5); background: rgba(6,182,212,0.05); }

.cv-user-msg { align-self: flex-end; max-width: 90%; background: linear-gradient(135deg, rgba(6,182,212,0.14), rgba(139,92,246,0.14));
  border: 1px solid rgba(6,182,212,0.25); padding: 0.65rem 0.9rem; border-radius: 14px 14px 4px 14px; font-size: 0.88rem; line-height: 1.45; }
.cv-run { display: flex; flex-direction: column; gap: 0.35rem; }
.cv-step { display: grid; grid-template-columns: 26px 1fr; gap: 0.6rem; align-items: start; padding: 0.5rem 0.55rem; border-radius: 10px;
  animation: slideUp 0.25s ease-out; }
.cv-step:hover { background: rgba(255,255,255,0.025); }
.cv-avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 0.68rem; font-weight: 700;
  color: #0b0e14; background: var(--c, #64748b); }
.cv-step-head { font-size: 0.83rem; }
.cv-step-head b { color: var(--text-primary); font-weight: 600; }
.cv-step-head span { color: var(--text-secondary); }
.cv-step-detail { font-size: 0.76rem; color: var(--text-secondary); margin-top: 0.1rem; word-break: break-word; }
.cv-step.pending { opacity: 0.45; }
.cv-step.pending .cv-avatar { animation: cvPulse 1.2s ease-in-out infinite; }
.cv-step.warn .cv-step-detail { color: #f59e0b; }
.cv-step.ok .cv-step-detail { color: #22c55e; }
.cv-step.err .cv-step-detail { color: var(--color-danger); }
@keyframes cvPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.cv-run-foot { font-size: 0.75rem; color: var(--text-secondary); padding: 0.25rem 0.55rem; }

/* Composer */
.cv-composer { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.06); }
#cv-input { flex: 1; resize: none; max-height: 160px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary); border-radius: 12px; padding: 0.7rem 0.9rem; font: inherit; font-size: 0.9rem; outline: none; transition: border-color 0.15s; }
#cv-input:focus { border-color: rgba(6,182,212,0.5); }
.cv-send { width: 40px; height: 40px; border-radius: 12px; border: none; cursor: pointer; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); display: grid; place-items: center; transition: transform 0.15s, opacity 0.15s; }
.cv-send:hover { transform: translateY(-1px); }
.cv-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Right: preview / code */
.cv-tabbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); min-width: 0; }
.cv-seg { display: flex; background: rgba(0,0,0,0.25); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.cv-seg-btn { background: transparent; border: none; color: var(--text-secondary); padding: 0.4rem 0.85rem; border-radius: 8px; font-size: 0.82rem; cursor: pointer; }
.cv-seg-btn.active { background: rgba(255,255,255,0.09); color: var(--text-primary); }
.cv-file-tabs { display: flex; gap: 0.35rem; overflow-x: auto; min-width: 0; }
.cv-file-tab { background: transparent; border: 1px solid transparent; color: var(--text-secondary); font-family: monospace; font-size: 0.76rem;
  padding: 0.3rem 0.6rem; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.cv-file-tab:hover { color: var(--text-primary); }
.cv-file-tab.active { border-color: rgba(6,182,212,0.4); color: var(--accent-primary); background: rgba(6,182,212,0.08); }
.cv-stage { flex: 1; min-height: 0; position: relative; }
.cv-empty-stage { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--text-secondary); font-size: 0.85rem; }
.cv-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cv-preview { width: 100%; height: 100%; border: none; background: #fff; display: block; }
.cv-code { margin: 0; height: 100%; overflow: auto; padding: 1rem 1.1rem; font-size: 0.8rem; line-height: 1.55; background: #0d1117; color: #e6edf3; }

@media (max-width: 900px) {
  .cv-body { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 1fr) minmax(320px, 1fr); }
  .cv-shell { height: auto; min-height: 100vh; overflow-y: auto; }
}

/* Genexts Studio Tabs */
.studio-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}
.studio-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.studio-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
.studio-tab.active {
    color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
    font-weight: 500;
}
.studio-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.studio-tab-content.hidden {
    display: none !important;
}

/* --- Premium Project Workspace Styles --- */
.project-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: rgba(11, 16, 32, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.project-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-clean {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.btn-clean:hover {
    color: var(--text-primary);
}

.project-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-icon-box {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

#active-project-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.project-nav-container {
    padding: 1rem 0.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.project-nav-item svg {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.project-nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.project-nav-item:hover svg {
    opacity: 1;
}

.project-nav-item.active {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
    font-weight: 500;
}

.project-nav-item.active svg {
    opacity: 1;
    color: var(--accent-primary);
}

.project-main-area {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, rgba(20, 25, 45, 1) 0%, var(--bg-primary) 100%);
    overflow: hidden;
}

.project-tab-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: rgba(11, 16, 32, 0.3);
}

.project-header-info h2 {
    font-size: 1.75rem;
    margin: 0 0 0.25rem 0;
    font-weight: 700;
}

.project-header-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.project-content-grid {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.empty-state-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    margin-top: 4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.empty-state-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.empty-state-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* --- Tools & Integrations Hub Styles --- */
.integrations-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 4rem;
}

.integrations-header {
    text-align: center;
    margin-bottom: 1rem;
}

.integrations-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.integrations-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.integration-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(6, 182, 212, 0.1);
}

.integration-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.integration-icon {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.integration-card h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.integration-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
    flex: 1;
}

.btn-connect {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-connect:hover {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
}

.integration-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ====== NEW LANDSCAPE & SHARED UI ====== */
.landscape-layout {
    flex: 1;
    overflow-y: auto;
    flex: 1;
    display: flex;
    width: 100%;
    height: 100%;
    padding: 30px;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.settings-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.settings-tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #888;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.settings-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.settings-tab.active {
    color: #fff;
    background: rgba(0, 242, 254, 0.1);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 8px 8px 0;
}

.settings-content {
    flex-grow: 1;
    background: rgba(20, 20, 25, 0.4);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

.setting-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

/* ====== HISTORY UI ====== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 242, 254, 0.3);
}

.history-info h4 {
    color: #fff;
    margin: 0 0 6px 0;
    font-weight: 500;
}

.history-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ====== MEMORY UI ====== */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.memory-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.5;
}

.memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.memory-badge {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Credits & Subscriptions ===== */
.bill-page { overflow-y: auto; padding: 2rem 2.5rem 3rem; }
.bill-inner { max-width: 1180px; margin: 0 auto; width: 100%; }
.bill-hero { text-align: center; margin: 0.5rem auto 2.25rem; max-width: 640px; }
.bill-hero.left { text-align: left; margin-left: 0; max-width: none; }
.bill-eyebrow { display: inline-block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  color: var(--accent-primary); background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.25); padding: 0.3rem 0.7rem; border-radius: 999px; }
.bill-hero h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; margin: 0.9rem 0 0.6rem; }
.bill-hero p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }
.bill-section-title { font-size: 1.1rem; font-weight: 600; margin: 2.5rem 0 1rem; }
.bill-note { color: var(--text-secondary); font-size: 0.8rem; text-align: center; margin-top: 1.75rem; line-height: 1.6; }

/* Plan cards */
.pl-hero { text-align: center; margin: 1.5rem auto 2.5rem; }
.pl-hero h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.pl-hero p { color: var(--text-secondary); font-size: 1.05rem; margin: 0.6rem 0 0; }

.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; padding: 1.75rem 1.6rem 1.6rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)); border: 1px solid rgba(255,255,255,0.07);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.plan-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--plan) 40%, transparent); }
.plan-card.popular { border-color: color-mix(in srgb, var(--plan) 60%, transparent);
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--plan) 70%, transparent), inset 0 1px 0 rgba(255,255,255,0.06); }
.plan-wave { position: absolute; inset: 0 0 auto 0; height: 110px; pointer-events: none; }
.plan-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; min-height: 26px; }
.plan-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.plan-badge { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--plan); color: #fff; }
.plan-badge.ghost { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.plan-tag { position: relative; font-size: 0.86rem; color: var(--text-secondary); margin-top: 0.35rem; }
.plan-price { position: relative; display: flex; align-items: baseline; gap: 0.35rem; margin-top: 1.6rem; }
.plan-price b { font-size: 2.9rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.plan-price span { color: var(--text-secondary); font-size: 0.9rem; }
.plan-stat { margin-top: 1.4rem; padding: 0.9rem 1rem; border-radius: 16px;
  background: color-mix(in srgb, var(--plan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--plan) 22%, transparent); }
.plan-stat b { display: block; font-size: 1.35rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; letter-spacing: -0.02em; }
.plan-stat b small { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0; }
.plan-stat span { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.plan-benefits { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.plan-benefits li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9rem; line-height: 1.4; color: #d5dbe5; }
.plan-benefits li svg { flex-shrink: 0; margin-top: 0.15rem; color: var(--plan); }
.plan-cta { margin-top: 1.6rem; padding: 0.85rem; border-radius: 14px; font-weight: 600; font-size: 0.92rem; cursor: pointer; width: 100%;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: var(--text-primary); transition: all 0.15s; }
.plan-cta:hover { background: rgba(255,255,255,0.1); border-color: color-mix(in srgb, var(--plan) 50%, transparent); }
.plan-card.popular .plan-cta { background: var(--plan); color: #fff; border-color: transparent; }
.plan-card.popular .plan-cta:hover { filter: brightness(1.12); }
.plan-cta:disabled { cursor: default; background: transparent; color: var(--text-secondary); border-color: rgba(255,255,255,0.08); }
.plan-cta:disabled:hover { filter: none; }

.pl-credit-hint { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 1.75rem; font-size: 0.86rem; color: var(--text-secondary); }
.pl-credit-dot { color: var(--accent-primary); }

.pl-compare { margin-top: 2.25rem; display: flex; flex-direction: column; align-items: center; }
.pl-compare-toggle { display: inline-flex; align-items: center; gap: 0.4rem; background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary); padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.pl-compare-toggle:hover { background: rgba(255,255,255,0.05); }
.pl-compare-toggle svg { transition: transform 0.2s ease; }
.pl-compare-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.pl-compare-body { width: 100%; margin-top: 1.25rem; animation: fadeIn 0.25s ease-out; }
.pl-table-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); }
.pl-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
.pl-table th, .pl-table td { padding: 0.9rem 1.2rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.pl-table th:first-child, .pl-table td:first-child { text-align: left; color: var(--text-secondary); }
.pl-table thead th { font-weight: 600; color: var(--text-primary); }
.pl-table tbody tr:last-child td { border-bottom: none; }
.pl-table .yes { color: #22c55e; font-weight: 700; }
.pl-table .no { color: rgba(255,255,255,0.2); }

.pl-trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 2.5rem 0 1rem; font-size: 0.82rem; color: var(--text-secondary); }

/* Credits page */
.cr-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 1rem; }
.cr-balance-card { position: relative; overflow: hidden; border-radius: 22px; padding: 1.6rem 1.7rem 1.4rem;
  background: radial-gradient(120% 140% at 0% 0%, rgba(6,182,212,0.16), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(139,92,246,0.16), transparent 55%), rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08); }
.cr-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cr-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.cr-plan-badge { font-size: 0.72rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); }
.cr-amount { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.5rem; }
.cr-amount b { font-size: 3.4rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.cr-amount span { color: var(--text-secondary); font-size: 0.95rem; }
.cr-sub { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.45rem; }
.cr-chart { display: block; width: 100%; height: 150px; margin-top: 1.1rem; overflow: visible; }
.cr-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; }
.cr-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }
.cr-btn { padding: 0.7rem 1.15rem; border-radius: 12px; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: var(--text-primary); transition: all 0.15s; }
.cr-btn:hover { background: rgba(255,255,255,0.1); }
.cr-btn.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); }
.cr-btn.primary:hover { filter: brightness(1.1); }
.cr-stats { display: flex; flex-direction: column; gap: 1rem; }
.cr-stat { flex: 1; border-radius: 18px; padding: 1.1rem 1.2rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; justify-content: center; }
.cr-stat-label { font-size: 0.76rem; color: var(--text-secondary); }
.cr-stat-value { font-size: 1.45rem; font-weight: 700; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.cr-stat-value small { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.cr-meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); margin-top: 0.6rem; overflow: hidden; }
.cr-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary)); transition: width 0.5s ease; }

.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.pack-card { position: relative; border-radius: 18px; padding: 1.3rem 1.3rem 1.2rem; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07); display: flex; flex-direction: column; gap: 0.25rem; transition: border-color 0.2s, transform 0.2s; }
.pack-card:hover { transform: translateY(-2px); border-color: rgba(6,182,212,0.4); }
.pack-card.popular { border-color: rgba(6,182,212,0.45); }
.pack-name { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.pack-credits { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.pack-credits span { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.pack-meta { font-size: 0.76rem; color: var(--text-muted); }
.pack-card .cr-btn { margin-top: 0.85rem; width: 100%; }
.pack-card .plan-badge { position: absolute; top: 1rem; right: 1rem; background: var(--accent-primary); }

.cr-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.cr-panel { border-radius: 18px; padding: 1.3rem 1.4rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.cr-panel h3 { font-size: 0.98rem; font-weight: 600; margin: 0 0 0.9rem; }
.cr-cost-row, .cr-activity-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.84rem; }
.cr-cost-row:last-child, .cr-activity-row:last-child { border-bottom: none; }
.cr-cost-row span:last-child { color: var(--text-secondary); white-space: nowrap; }
.cr-activity-row .what { min-width: 0; }
.cr-activity-row .what div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-activity-row .what small { color: var(--text-muted); font-size: 0.72rem; }
.cr-activity-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-activity-row .amt.plus { color: #22c55e; }
.cr-activity-row .amt.minus { color: #f87171; }
.cr-empty { color: var(--text-secondary); font-size: 0.84rem; }

/* Sidebar credits card */
.sb-credits { margin: 0 0 0.75rem; padding: 0.9rem 0.9rem 0.8rem; border-radius: 16px; position: relative; overflow: hidden;
  background: radial-gradient(140% 120% at 0% 0%, rgba(6,182,212,0.14), transparent 60%), rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.sb-credits-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.sb-credits-label { font-size: 0.72rem; color: var(--text-secondary); }
.sb-plan-name { font-size: 0.65rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 999px; background: rgba(255,255,255,0.07); color: var(--text-secondary); white-space: nowrap; }
.sb-balance { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
.sb-curve { display: block; width: 100%; height: 34px; margin: 0.25rem 0 0.65rem; }
.sb-btn { display: block; width: 100%; padding: 0.5rem 0.6rem; border-radius: 10px; font-size: 0.76rem; font-weight: 600; cursor: pointer;
  background: rgba(255,255,255,0.05); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.09); transition: background 0.15s; }
.sb-btn + .sb-btn { margin-top: 0.4rem; }
.sb-btn:hover { background: rgba(255,255,255,0.1); }
.sb-btn.primary { border-color: transparent; background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #fff; }
.sidebar.collapsed .sb-credits { display: none; }

@media (max-width: 1100px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-grid, .cr-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .plan-grid, .pack-grid { grid-template-columns: 1fr; }
  .bill-page { padding: 1.25rem; }
}

/* ===== Brand wordmark (logo PNG has a black background; screen blend drops it) ===== */
.brand-wordmark { display: block; mix-blend-mode: screen; user-select: none; -webkit-user-drag: none; }
.sidebar-wordmark { height: 24px; width: auto; }
.sidebar.collapsed .sidebar-wordmark { display: none; }

/* ===== Home ===== */
.home-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 1.5rem 4rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.home-logo { width: 190px; margin-bottom: 2.25rem; opacity: 0.95; }
.home-greeting { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.home-greeting .highlight { background: linear-gradient(90deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand, #2ee6b6); margin-top: 0; font-weight: 700; }
.home-sub { color: var(--text-secondary); font-size: 1.05rem; margin: 0.6rem 0 2rem; }
.home-composer { width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.45rem 0.45rem 1.3rem; border-radius: 20px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 20px 50px -25px rgba(0,0,0,0.7);
  transition: border-color 0.2s, box-shadow 0.2s; }
.home-composer:focus-within { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); box-shadow: 0 20px 50px -25px rgba(0,0,0,0.7), 0 0 0 4px rgba(var(--brand-rgb, 46, 230, 182), 0.08); }
.home-composer input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text-primary); font: inherit; font-size: 1rem; padding: 0.75rem 0; }
.home-composer input::placeholder { color: rgba(255,255,255,0.35); }
.home-send { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; border: none; cursor: pointer; color: #0b0e14;
  background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); display: grid; place-items: center; transition: transform 0.15s, filter 0.15s; }
.home-send:hover { transform: translateY(-1px); filter: brightness(1.08); }
.home-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.25rem; }
.home-action { display: flex; align-items: center; gap: 0.75rem; text-align: left; padding: 0.9rem 1rem; border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07); color: var(--text-primary); font: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.home-action:hover { background: rgba(255,255,255,0.05); border-color: color-mix(in srgb, var(--c) 40%, transparent); transform: translateY(-2px); }
.home-action-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem;
  background: color-mix(in srgb, var(--c) 14%, transparent); }
.home-action-text { display: flex; flex-direction: column; min-width: 0; }
.home-action-text b { font-size: 0.9rem; font-weight: 600; }
.home-action-text small { font-size: 0.76rem; color: var(--text-secondary); margin-top: 0.1rem; }
@media (max-width: 720px) { .home-actions { grid-template-columns: 1fr; } .home-greeting { font-size: 1.8rem; } }

/* ===== Credits page (simplified) ===== */
.cr-inner { max-width: 880px; }
.cr-inner .cr-balance-card { padding: 1.8rem 1.9rem 1.6rem; }
.cr-inner .pl-hero { margin-bottom: 2rem; }

/* Compact sidebar credits card */
.sb-credits { padding: 0.8rem 0.85rem 0.75rem; }
.sb-balance { font-size: 1.4rem; }
.sb-curve { height: 26px; margin: 0.2rem 0 0.6rem; }
.sb-btn { padding: 0.45rem 0.6rem; }
.sb-btn:not(.primary) { background: transparent; border-color: transparent; color: var(--text-secondary); font-weight: 500; }
.sb-btn:not(.primary):hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.sb-btn + .sb-btn { margin-top: 0.25rem; }

/* ===== Chat (redesign) ===== */
.chat-shell { position: relative; display: flex; flex-direction: column; height: 100vh; padding: 0; overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.chat-header-left { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.chat-title { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.chat-icon-btn { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; border: none;
  background: transparent; color: var(--text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s; }
.chat-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.chat-icon-btn.active { color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); }
#btn-voice-chat.listening { color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.15); animation: voice-pulse 1.5s infinite alternate; }
.chat-pill-select { appearance: none; -webkit-appearance: none; max-width: 210px; cursor: pointer; font: inherit; font-size: 0.84rem;
  color: var(--text-primary); border-radius: 999px; padding: 0.45rem 1.9rem 0.45rem 0.85rem; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  transition: border-color 0.15s, background-color 0.15s; }
.chat-pill-select:hover { border-color: rgba(255,255,255,0.16); background-color: rgba(255,255,255,0.07); }
.chat-pill-select:focus { outline: none; border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); }
.chat-pill-select option { background: #111520; color: var(--text-primary); }
.chat-more { position: relative; }
.chat-more-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 0.35rem; border-radius: 14px; z-index: 60;
  background: #111520; border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 18px 40px rgba(0,0,0,0.5); display: flex; flex-direction: column; }
.chat-more-menu button { text-align: left; background: transparent; border: none; color: var(--text-primary); padding: 0.6rem 0.75rem;
  border-radius: 10px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.chat-more-menu button:hover { background: rgba(255,255,255,0.06); }

.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.5rem; }
.chat-empty-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; color: var(--brand, #2ee6b6);
  background: rgba(var(--brand-rgb, 46, 230, 182), 0.1); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); margin-bottom: 1.1rem; }
.chat-empty h2 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.5rem; }
.chat-suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 0.6rem; }
.chat-suggestion { text-align: left; padding: 0.8rem 1rem; border-radius: 14px; cursor: pointer; font: inherit; font-size: 0.86rem;
  color: var(--text-secondary); background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07); transition: all 0.15s; }
.chat-suggestion:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.35); }

#chat-history.chat-history { flex: 1; min-height: 0; overflow-y: auto; padding: 2rem 1.5rem 1rem; display: flex; flex-direction: column;
  gap: 1.6rem; background: none; border: none; border-radius: 0; margin: 0; }
#chat-history.chat-history:empty { display: none; }
#chat-history .chat-message { width: 100%; max-width: 780px; margin: 0 auto; padding: 0; border: none; background: none;
  border-radius: 0; box-shadow: none; color: #e5e7eb; font-size: 0.97rem; line-height: 1.7; animation: slideUp 0.25s ease-out; }
#chat-history .chat-message.user-message { width: fit-content; max-width: min(620px, 80%); align-self: auto;
  margin-left: auto; margin-right: max(calc((100% - 780px) / 2), 0px); padding: 0.7rem 1.05rem; border-radius: 18px 18px 6px 18px;
  background: rgba(255,255,255,0.07); color: #fff; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
#chat-history .chat-message.ai-message { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0.9rem; }
.ai-avatar { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 0.8rem; color: #0b0e14;
  background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); margin-top: 0.15rem; }
.ai-content { min-width: 0; }
.ai-content .markdown-body { overflow-x: auto; }
.ai-content .markdown-body p:last-child { margin-bottom: 0; }
#chat-history .model-tag { display: block; font-size: 0.74rem; font-weight: 500; color: var(--text-secondary); background: none;
  border: none; padding: 0; margin: 0 0 0.2rem; }
#chat-history .model-tag + br, #chat-history .model-tag + br + br { display: none; }
.msg-actions { display: flex; gap: 0.25rem; margin-top: 0.45rem; opacity: 0; transition: opacity 0.15s; }
#chat-history .chat-message:hover .msg-actions, #chat-history .chat-message:last-child .msg-actions { opacity: 1; }
.msg-action { display: inline-flex; align-items: center; gap: 0.35rem; background: transparent; border: none; color: var(--text-secondary);
  font: inherit; font-size: 0.76rem; padding: 0.3rem 0.5rem; border-radius: 8px; cursor: pointer; }
.msg-action:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.chat-composer-wrap { padding: 0.6rem 1.5rem 1rem; flex-shrink: 0; }
.chat-composer { max-width: 780px; margin: 0 auto; display: flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.45rem 0.4rem 0.45rem;
  border-radius: 20px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 20px 50px -25px rgba(0,0,0,0.7); transition: border-color 0.2s, box-shadow 0.2s; }
.chat-composer:focus-within { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); box-shadow: 0 20px 50px -25px rgba(0,0,0,0.7), 0 0 0 4px rgba(var(--brand-rgb, 46, 230, 182), 0.08); }
#chat-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text-primary);
  font: inherit; font-size: 0.98rem; padding: 0.7rem 0.35rem; }
#chat-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-send { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; border: none; cursor: pointer; display: grid; place-items: center;
  color: #0b0e14; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); transition: transform 0.15s, filter 0.15s; }
.chat-send:hover { transform: translateY(-1px); filter: brightness(1.08); }
.chat-send.stop { background: rgba(239,68,68,0.15); color: #f87171; }
.chat-footnote { text-align: center; font-size: 0.72rem; color: var(--text-muted); margin: 0.55rem 0 0; }

@media (max-width: 760px) {
  .chat-pill-select { max-width: 130px; }
  .chat-suggestions { grid-template-columns: 1fr; }
}

/* ===== Canvas (compact preview layout) ===== */
#canvas-view .cv-shell { padding: 0; gap: 0; height: 100vh; overflow: hidden; }
.cv-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0;
  background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.3); margin-right: 0.35rem; }
.cv-heading { display: flex; flex-direction: column; min-width: 0; }
.cv-sub { font-size: 0.76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cv-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.cv-main { min-height: 0; display: flex; flex-direction: column; }
#canvas-view .cv-thread { flex: 1; min-height: 0; overflow-y: auto; gap: 1.1rem;
  padding: 2rem max(1.5rem, calc((100% - 720px) / 2)) 1rem; }

#canvas-view .cv-welcome { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
#canvas-view .cv-welcome h2 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
#canvas-view .cv-welcome > p { color: var(--text-secondary); font-size: 0.92rem; margin: 0.45rem 0 0; }
#canvas-view .cv-roster { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 1.4rem 0 1.4rem; }
#canvas-view .cv-roster-item { display: grid; grid-template-columns: 10px 1fr; grid-template-rows: auto auto; column-gap: 0.55rem; row-gap: 0.1rem;
  align-items: center; text-align: left; padding: 0.6rem 0.75rem; border-radius: 12px; background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06); font-size: 0.8rem; }
#canvas-view .cv-roster-item .cv-dot { grid-row: 1 / span 2; }
#canvas-view .cv-roster-item b { font-weight: 600; }
#canvas-view .cv-roster-item span:last-child { color: var(--text-secondary); font-size: 0.74rem; }
#canvas-view .chat-suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }

#canvas-view .chat-composer #cv-input { flex: 1; min-width: 0; resize: none; max-height: 160px; background: transparent; border: none;
  border-radius: 0; outline: none; color: var(--text-primary); font: inherit; font-size: 0.98rem; padding: 0.65rem 0.5rem 0.65rem 0.6rem; }
#canvas-view .chat-composer #cv-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
#canvas-view .chat-composer-wrap { padding-left: max(1.5rem, calc((100% - 720px) / 2)); padding-right: max(1.5rem, calc((100% - 720px) / 2)); }

.cv-open-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.45rem; margin: 0.25rem 0 0 0.55rem; padding: 0.5rem 0.85rem;
  border-radius: 999px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--brand, #2ee6b6);
  background: rgba(var(--brand-rgb, 46, 230, 182), 0.1); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.3); transition: background 0.15s; }
.cv-open-btn:hover { background: rgba(var(--brand-rgb, 46, 230, 182), 0.18); }

/* Compact preview card */
.cv-panel { align-self: start; margin: 1rem 1rem 1rem 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); box-shadow: 0 20px 50px -30px rgba(0,0,0,0.8); }
.cv-panel-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.5rem 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
.cv-panel .cv-stage { flex: none; height: 260px; position: relative; }
.cv-panel .cv-empty-stage p { margin: 0; font-size: 0.82rem; }
.cv-panel .cv-empty-icon { font-size: 1.5rem; }
.cv-panel .cv-file-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.6rem; border-top: 1px solid rgba(255,255,255,0.06); overflow: visible; }
.cv-panel .cv-file-tabs:empty { display: none; }
.cv-panel .i-collapse { display: none; }

/* Full screen */
.cv-panel.expanded { position: fixed; inset: 3vh 3vw; margin: 0; z-index: 300; align-self: stretch; justify-self: stretch; background: #0f131c; border-color: rgba(255,255,255,0.1);
  box-shadow: 0 40px 120px rgba(0,0,0,0.7); animation: fadeIn 0.2s ease-out; }
.cv-panel.expanded .cv-stage { flex: 1; height: auto; }
.cv-panel.expanded .i-expand { display: none; }
.cv-panel.expanded .i-collapse { display: block; }
.cv-backdrop { position: fixed; inset: 0; z-index: 290; background: rgba(5,7,12,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

@media (max-width: 1000px) {
  .cv-layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .cv-panel:not(.expanded) { margin: 0 1rem 1rem; }
  .cv-panel:not(.expanded) .cv-stage { height: 200px; }
  #canvas-view .cv-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ====== Projects, History, Settings ====== */
.ws-page { overflow-y: auto; padding: 2.5rem 2.5rem 4rem; }
.ws-inner { max-width: 1080px; margin: 0 auto; width: 100%; animation: ws-in 0.35s ease both; }
.ws-inner.narrow { max-width: 780px; }
@keyframes ws-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.ws-head h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.ws-head p { color: var(--text-secondary); font-size: 0.95rem; margin: 0.4rem 0 0; }
.ws-head-actions { display: flex; align-items: center; gap: 0.35rem; }

.ws-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1rem; border-radius: 11px; font: inherit; font-size: 0.86rem;
  font-weight: 600; cursor: pointer; color: var(--text-primary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, filter 0.15s; white-space: nowrap; }
.ws-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.16); }
.ws-btn:disabled { opacity: 0.55; cursor: default; }
.ws-btn.primary { color: #0b0e14; border-color: transparent; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); }
.ws-btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ws-btn.danger { color: #f87171; border-color: rgba(248,113,113,0.25); background: rgba(248,113,113,0.06); }
.ws-btn.danger:hover { background: rgba(248,113,113,0.12); }
.chat-icon-btn.danger:hover { color: #f87171; background: rgba(248,113,113,0.1); }

.ws-back { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0 0 1rem -0.4rem; padding: 0.35rem 0.6rem 0.35rem 0.4rem; border-radius: 9px;
  border: none; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.86rem; cursor: pointer; }
.ws-back:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.ws-empty { text-align: center; padding: 3.5rem 1.5rem; border: 1px dashed rgba(255,255,255,0.09); border-radius: 18px; }
.ws-empty.small { padding: 2rem 1rem; }
.ws-empty-icon { width: 52px; height: 52px; margin: 0 auto 1rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem;
  background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.18); }
.ws-empty h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.35rem; }
.ws-empty p { color: var(--text-secondary); font-size: 0.88rem; margin: 0 auto 1.25rem; max-width: 360px; line-height: 1.55; }
.ws-empty.small p { margin-bottom: 0; }
.ws-empty-hint { color: var(--text-secondary); font-size: 0.86rem; line-height: 1.55; }
.ws-skeleton { height: 150px; border-radius: 18px; background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  background-size: 200% 100%; animation: ws-shimmer 1.2s linear infinite; }
.ws-skeleton.row { height: 62px; border-radius: 14px; margin-bottom: 0.5rem; }
@keyframes ws-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Projects */
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.pj-grid > .ws-empty-hint { grid-column: 1 / -1; text-align: center; margin-top: 0.5rem; }
.pj-card { --c: var(--brand, #2ee6b6); position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-height: 168px;
  padding: 1.3rem; text-align: left; font: inherit; color: var(--text-primary); cursor: pointer; border-radius: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); transition: border-color 0.18s, background 0.18s, transform 0.18s; }
.pj-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.pj-icon { --c: var(--brand, #2ee6b6); width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 1rem;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); margin-bottom: 0.5rem; }
.pj-icon.large { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 14px; margin: 0; }
.pj-name { font-weight: 600; font-size: 1rem; }
.pj-desc { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-meta { margin-top: auto; padding-top: 0.6rem; color: var(--text-secondary); font-size: 0.76rem; opacity: 0.8; }
.pj-new { align-items: center; justify-content: center; gap: 0.6rem; color: var(--text-secondary); background: transparent; border-style: dashed; border-color: rgba(255,255,255,0.12); }
.pj-new:hover { color: var(--brand, #2ee6b6); border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); background: rgba(var(--brand-rgb, 46, 230, 182), 0.04); }
.pj-new-plus { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255,255,255,0.05); }
.pj-head { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.pj-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-mem-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.pj-mem-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 0.6rem 0.7rem 1rem; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); font-size: 0.9rem; }

.ws-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; margin-bottom: 1.25rem; width: fit-content; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.ws-tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.95rem; border-radius: 9px; border: none; background: transparent;
  color: var(--text-secondary); font: inherit; font-size: 0.86rem; font-weight: 500; cursor: pointer; transition: background 0.15s, color 0.15s; }
.ws-tab:hover { color: var(--text-primary); }
.ws-tab.active { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.ws-tab-count:empty { display: none; }
.ws-tab-count { font-size: 0.72rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: rgba(var(--brand-rgb, 46, 230, 182), 0.14); color: var(--brand, #2ee6b6); }
.ws-textarea { width: 100%; box-sizing: border-box; margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 12px; resize: vertical; min-height: 160px;
  font: inherit; font-size: 0.92rem; line-height: 1.6; color: var(--text-primary); background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08); }
.ws-textarea:focus { outline: none; border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); }
.ws-row-end { display: flex; justify-content: flex-end; margin-top: 0.9rem; }

/* History */
.hs-toolbar { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; }
.hs-search { flex: 1; display: flex; align-items: center; gap: 0.6rem; padding: 0 0.95rem; border-radius: 12px; color: var(--text-secondary);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); transition: border-color 0.15s; }
.hs-search:focus-within { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.45); }
.hs-search input { flex: 1; min-width: 0; padding: 0.7rem 0; border: none; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.92rem; }
.hs-toolbar .chat-pill-select { border-radius: 12px; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.history-list { gap: 0; }
.hs-group-label { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary);
  margin: 1.4rem 0 0.5rem 0.25rem; opacity: 0.85; }
.hs-group-label:first-child { margin-top: 0; }
.hs-group { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); }
.hs-group:empty { display: none; }
#project-chat-list { background: transparent; border: none; border-radius: 0; overflow: visible; }
#project-chat-list .hs-row { border-radius: 14px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 0.5rem; }
.hs-row { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0.75rem 0.85rem 1.1rem; cursor: pointer; transition: background 0.15s, opacity 0.2s;
  border-top: 1px solid rgba(255,255,255,0.05); }
.hs-row:first-child { border-top: none; }
.hs-row:hover { background: rgba(255,255,255,0.04); }
.hs-row.removing { opacity: 0.3; pointer-events: none; }
.hs-row-main { flex: 1; min-width: 0; }
.hs-row-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-weight: 500; font-size: 0.93rem; }
.hs-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-row-preview { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-badge { --c: var(--brand, #2ee6b6); flex-shrink: 0; font-size: 0.7rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 999px; max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.hs-row-time { flex-shrink: 0; color: var(--text-secondary); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.hs-row-actions { display: flex; gap: 0.1rem; opacity: 0; transition: opacity 0.15s; }
.hs-row:hover .hs-row-actions, .hs-row:focus-within .hs-row-actions { opacity: 1; }
.hs-row-actions .chat-icon-btn { width: 32px; height: 32px; border-radius: 9px; }

/* Settings */
.st-section-label { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary);
  margin: 1.9rem 0 0.6rem 0.25rem; opacity: 0.85; }
.ws-head + .st-section-label { margin-top: 0; }
.st-card { border-radius: 18px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); overflow: hidden; }
.st-card.pad { padding: 1.4rem; }
.st-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.st-card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.st-card-sub { color: var(--text-secondary); font-size: 0.86rem; margin: 0.3rem 0 0; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.06); }
.st-row:first-child { border-top: none; }
.st-row.column { flex-direction: column; align-items: stretch; gap: 0.6rem; }
.st-row-text { min-width: 0; }
.st-row-title { font-size: 0.92rem; font-weight: 500; }
.st-row-title.danger { color: #f87171; }
.st-row-sub { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.2rem; line-height: 1.5; }
.st-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.st-row .chat-pill-select { max-width: 230px; flex-shrink: 0; }
.st-profile { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.st-avatar { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem;
  color: #0b0e14; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-profile-text { flex: 1; min-width: 0; }
.st-profile-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1.05rem; }
.st-profile-email { color: var(--text-secondary); font-size: 0.86rem; margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; }
.st-badge { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.st-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.st-stat { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.15rem 1.25rem; border-left: 1px solid rgba(255,255,255,0.06); }
.st-stat:first-child { border-left: none; }
.st-stat-label { color: var(--text-secondary); font-size: 0.78rem; }
.st-stat-value { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.st-stat-value.accent { background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-stats + .st-row { border-top: 1px solid rgba(255,255,255,0.06); }
.st-usage-head { display: flex; justify-content: space-between; align-items: baseline; }
.st-usage-head .st-row-sub { margin: 0; font-variant-numeric: tabular-nums; }
.st-usage-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.st-usage-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); transition: width 0.5s ease; }

@media (max-width: 720px) {
  .ws-page { padding: 1.5rem 1rem 3rem; }
  .ws-head h1 { font-size: 1.6rem; }
  .hs-toolbar { flex-direction: column; }
  .hs-row-actions { opacity: 1; }
  .hs-row-time { display: none; }
  .st-row { flex-direction: column; align-items: flex-start; }
  .st-row .chat-pill-select { max-width: 100%; }
  .st-stats { grid-template-columns: 1fr; }
  .st-stat { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); }
  .st-stat:first-child { border-top: none; }
}

/* ====== Gmail connector ====== */
.st-conn { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.st-conn-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: #fff; }
.st-conn-badge { margin-left: 0.4rem; font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; vertical-align: middle;
  color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.st-conn-badge[hidden] { display: none; }
.gm-status { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 0.9rem; }
.gm-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); border-top-color: var(--brand, #2ee6b6); animation: gm-spin 0.8s linear infinite; }
@keyframes gm-spin { to { transform: rotate(360deg); } }
.gm-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 999px;
  color: var(--text-secondary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.gm-icon { flex-shrink: 0; }
.gm-draft-head { display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem 1rem; font-weight: 600; font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); }
.gm-draft-state { margin-left: auto; font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px;
  color: var(--text-secondary); background: rgba(255,255,255,0.06); }
.gm-field { display: flex; align-items: center; gap: 0.75rem; padding: 0 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.gm-field span { width: 56px; flex-shrink: 0; color: var(--text-secondary); font-size: 0.82rem; }
.gm-field input { flex: 1; min-width: 0; padding: 0.7rem 0; border: none; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.9rem; }
.gm-draft-actions { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid rgba(255,255,255,0.06); }
.gm-draft-note { margin-right: auto; color: var(--text-secondary); font-size: 0.78rem; }
.gm-connect { display: flex; align-items: center; gap: 0.9rem; margin: 0.8rem 0 0.3rem; max-width: 560px; padding: 0.9rem 1rem; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09); }
.gm-connect .gm-icon { width: 22px; height: 22px; }
.gm-connect-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.86rem; }
.gm-connect-text span { color: var(--text-secondary); font-size: 0.8rem; }

/* ====== Google Drive cards & Tools Hub ====== */
.gw-card { margin: 0.9rem 0 0.4rem; max-width: 640px; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09); }
.gw-card.sent .gm-draft-state { color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); }
.gw-card .gm-draft-head svg, .gm-connect-icon svg { flex-shrink: 0; }
.gw-card a.ws-btn { text-decoration: none; }
.gm-connect-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: #fff; }

.th-search { flex: 0 1 280px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 1rem; }
.th-card { position: relative; display: flex; flex-direction: column; gap: 0.45rem; padding: 1.25rem; border-radius: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); transition: border-color 0.18s, background 0.18s, transform 0.18s; }
.th-card:hover { background: rgba(255,255,255,0.045); border-color: rgba(255,255,255,0.13); }
.th-card.connected { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.28); }
.th-card[hidden] { display: none; }
.th-card.soon { opacity: 0.6; }
.th-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.th-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #fff; }
.th-card.soon .th-icon { background: rgba(255,255,255,0.08); }
.th-card h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.th-card p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; margin: 0; }
.th-via { color: var(--text-secondary); opacity: 0.75; }
.th-pill { font-size: 0.7rem; font-weight: 600; padding: 0.18rem 0.6rem; border-radius: 999px; color: var(--text-secondary); background: rgba(255,255,255,0.07); }
.th-pill.on { color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.th-tries { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
.th-try { text-align: left; font: inherit; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; padding: 0.45rem 0.65rem; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); transition: color 0.15s, border-color 0.15s; }
.th-try:hover { color: var(--text-primary); border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.35); }
.th-card-foot { margin-top: auto; padding-top: 0.75rem; display: flex; justify-content: flex-end; }
.th-none { text-align: center; margin-top: 1.5rem; }
.md-table-wrap { overflow-x: auto; margin: 0.6rem 0; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); }
.md-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.md-table th, .md-table td { padding: 0.55rem 0.8rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
.md-table th { font-weight: 600; background: rgba(255,255,255,0.04); }
.md-table tr:last-child td { border-bottom: none; }
.th-error { color: #f87171; font-size: 0.8rem; line-height: 1.45; margin-top: 0.4rem; }
.st-row > .th-error { flex-basis: 100%; }
.st-row:has(> .th-error) { flex-wrap: wrap; }
.gm-draft-note.error, .gm-connect-text span.error { color: #f87171; }
.th-card-foot .th-via { font-size: 0.8rem; }
.gw-text { display: block; width: 100%; box-sizing: border-box; padding: 0.9rem 1rem; border: none; outline: none; resize: vertical; background: transparent;
  color: var(--text-primary); font: inherit; font-size: 0.9rem; line-height: 1.6; min-height: 110px; }
.gw-code { margin: 0; max-height: 280px; overflow: auto; padding: 0.9rem 1rem; font-size: 0.8rem; line-height: 1.5; background: rgba(0,0,0,0.25); white-space: pre; }
.gm-field input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--brand, #2ee6b6); margin: 0.75rem 0; }
.th-icon, .st-conn-icon, .gm-connect-icon { color: #1f2328; }
.gm-field select { flex: 1; min-width: 0; padding: 0.65rem 0; border: none; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.9rem; cursor: pointer; }
.gm-field select option { background: #111827; }
.gw-card .gm-draft-actions a.ws-btn + a.ws-btn { margin-left: 0.25rem; }
.canva-ai-toggle em { font-style: normal; color: var(--text-secondary); font-size: 0.82rem; }
.gw-image-prompt { min-height: 70px; border-top: 1px solid rgba(255,255,255,0.06); }
.gw-card.sent .gw-image-prompt, .gw-card:has(.gw-ai:not(:checked)) .gw-image-prompt { display: none; }
.canva-preview { padding: 0.75rem 1rem 0; }
.canva-preview img { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); }

/* ====== Model picker (Canvas) ====== */
.mp { position: relative; }
.mp-btn { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 260px; padding: 0.42rem 0.75rem 0.42rem 0.85rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.84rem; color: var(--text-primary); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); transition: border-color 0.15s, background 0.15s; }
.mp-btn:hover, .mp-btn[aria-expanded="true"] { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.07); }
.mp-btn svg { color: var(--text-secondary); flex-shrink: 0; }
.mp-btn-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-badge { flex-shrink: 0; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.12rem 0.45rem; border-radius: 999px; }
.mp-badge.free { color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.3); }
.mp-badge.credits { color: #fbbf24; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3); }
.mp-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 340px; max-height: min(70vh, 560px); overflow-y: auto; padding: 0.4rem;
  border-radius: 16px; background: #0f141d; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 18px 50px rgba(0,0,0,0.5); }
.mp-group { padding: 0.6rem 0.65rem 0.3rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.mp-item { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.65rem; border: none; border-radius: 10px; text-align: left; cursor: pointer;
  background: transparent; color: var(--text-primary); font: inherit; transition: background 0.12s; }
.mp-item:hover { background: rgba(255,255,255,0.05); }
.mp-item[aria-selected="true"] { background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.mp-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.mp-item-text b { font-size: 0.88rem; font-weight: 600; }
.mp-item-text span { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4; }
@media (max-width: 720px) { .mp-pop { width: min(340px, calc(100vw - 32px)); } }

/* ====== Canvas: Save to GitHub ====== */
.cv-gh-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.42rem 0.8rem; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.82rem;
  font-weight: 600; color: var(--text-primary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); transition: background 0.15s, border-color 0.15s; }
.cv-gh-btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.2); }
.cv-gh-btn.hidden { display: none; }
.gh-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; background: #0f141d; color: var(--text-primary);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.gh-dialog::backdrop { background: rgba(3,6,12,0.7); backdrop-filter: blur(4px); }
.gh-dialog form { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; }
.gh-dialog-head { display: flex; gap: 0.9rem; align-items: flex-start; }
.gh-dialog-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; background: #fff; color: #1f2328; }
.gh-dialog h2 { margin: 0; font-size: 1.15rem; }
.gh-dialog-head p { margin: 0.3rem 0 0; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }
.gh-field { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.84rem; font-weight: 600; }
.gh-field em { font-style: normal; font-weight: 400; color: var(--text-secondary); }
.gh-field input:not([type="radio"]) { font: inherit; font-weight: 400; font-size: 0.92rem; padding: 0.65rem 0.8rem; border-radius: 10px; color: var(--text-primary);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); outline: none; }
.gh-field input:focus { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.5); }
.gh-field small { font-weight: 400; color: var(--text-secondary); font-size: 0.76rem; }
.gh-visibility { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.gh-vis { position: relative; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0.85rem; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); font-weight: 400; }
.gh-vis input { position: absolute; opacity: 0; }
.gh-vis b { font-size: 0.9rem; }
.gh-vis small { color: var(--text-secondary); font-size: 0.76rem; line-height: 1.4; }
.gh-vis:has(input:checked) { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.5); background: rgba(var(--brand-rgb, 46, 230, 182), 0.07); }
.gh-vis:has(input:focus-visible) { outline: 2px solid var(--brand, #2ee6b6); outline-offset: 2px; }
.gh-consent { margin: 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.gh-error { margin: 0; font-size: 0.82rem; color: #f87171; line-height: 1.5; }
.gh-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.cv-gh-saved { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.75rem 0; padding: 0.8rem 0.9rem; border-radius: 14px;
  font-size: 0.86rem; background: rgba(var(--brand-rgb, 46, 230, 182), 0.06); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.cv-gh-saved a { text-decoration: none; flex-shrink: 0; }
.gh-dialog[open] { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 32px); overflow-y: auto; }

/* ====== Login ====== */
#login-view:not(.hidden) { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; box-sizing: border-box;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(var(--brand-rgb, 46, 230, 182), 0.12), transparent 60%), var(--bg-primary, #0b0e14); }
.lg-shell { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lg-card { width: 100%; box-sizing: border-box; padding: 2rem 1.75rem 1.5rem; border-radius: 22px; background: rgba(15,20,29,0.85);
  border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 30px 80px rgba(0,0,0,0.45); backdrop-filter: blur(12px); animation: ws-in 0.35s ease both; }
.lg-logo { display: block; width: 150px; margin: 0 auto 1.25rem; }
.lg-title { margin: 0; text-align: center; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.lg-sub { margin: 0.4rem 0 1.4rem; text-align: center; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; }
.lg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; padding: 0.25rem; margin-bottom: 1.2rem; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.lg-tabs[hidden] { display: none; }
.lg-tab { padding: 0.55rem; border: none; border-radius: 9px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.lg-tab.active { background: rgba(255,255,255,0.09); color: var(--text-primary); }
.lg-providers { display: grid; gap: 0.55rem; }
.lg-providers[hidden], .lg-divider[hidden] { display: none; }
.lg-provider { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.7rem; border-radius: 12px; cursor: pointer; font: inherit;
  font-size: 0.9rem; font-weight: 600; color: var(--text-primary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); transition: background 0.15s, border-color 0.15s; }
.lg-provider:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.18); }
.lg-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0; color: var(--text-secondary); font-size: 0.78rem; }
.lg-divider::before, .lg-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.lg-alert { margin-bottom: 0.9rem; padding: 0.7rem 0.85rem; border-radius: 10px; font-size: 0.84rem; line-height: 1.5; }
.lg-alert.error { color: #fca5a5; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.3); }
.lg-alert.success { color: #6ee7c8; background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.3); }
.lg-form { display: flex; flex-direction: column; gap: 0.85rem; }
.lg-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; }
.lg-field[hidden] { display: none; }
.lg-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.lg-field input { font: inherit; font-size: 0.92rem; font-weight: 400; padding: 0.7rem 0.85rem; border-radius: 11px; color: var(--text-primary);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); outline: none; width: 100%; box-sizing: border-box; transition: border-color 0.15s; }
.lg-field input:focus { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.55); }
.lg-input-wrap { position: relative; display: block; }
.lg-input-wrap input { padding-right: 2.6rem; }
.lg-eye { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: none; border-radius: 8px;
  background: transparent; color: var(--text-secondary); cursor: pointer; }
.lg-eye:hover, .lg-eye.on { color: var(--text-primary); }
.lg-checks { list-style: none; margin: -0.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.78rem; color: var(--text-secondary); }
.lg-checks[hidden] { display: none; }
.lg-checks li::before { content: "○ "; }
.lg-checks li.ok { color: var(--brand, #2ee6b6); }
.lg-checks li.ok::before { content: "✓ "; }
.lg-submit { margin-top: 0.3rem; display: flex; align-items: center; justify-content: center; min-height: 46px; border: none; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 700; color: #0b0e14; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); transition: filter 0.15s, transform 0.15s; }
.lg-submit:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.lg-submit:disabled { opacity: 0.7; cursor: default; }
.lg-link { border: none; background: none; padding: 0; color: var(--brand, #2ee6b6); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.lg-link:hover { text-decoration: underline; }
.lg-link[hidden] { display: none; }
.lg-back { align-self: center; font-size: 0.85rem; }
.lg-legal { margin: 1.2rem 0 0; text-align: center; color: var(--text-secondary); font-size: 0.76rem; line-height: 1.55; }
.lg-legal .lg-link { font-size: inherit; }
.lg-foot { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--text-secondary); font-size: 0.76rem; opacity: 0.8; }

/* ====== Privacy Policy ====== */
#privacy-view:not(.hidden) { display: block; min-height: 100vh; overflow-y: auto; background: var(--bg-primary, #0b0e14); }
.pv-page { padding: 2.5rem 1.25rem 4rem; }
.pv-inner { max-width: 760px; margin: 0 auto; line-height: 1.65; font-size: 0.95rem; }
.pv-logo { display: block; width: 130px; margin: 1rem 0 1.5rem; }
.pv-inner h1 { font-size: 2rem; margin: 0; letter-spacing: -0.02em; }
.pv-date { color: var(--text-secondary); margin: 0.3rem 0 1.75rem; font-size: 0.86rem; }
.pv-inner h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
.pv-inner ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.pv-inner li { margin: 0.35rem 0; }
.pv-inner p { margin: 0.5rem 0; }
.pv-inner a { color: var(--brand, #2ee6b6); }
.pv-summary { padding: 1.1rem 1.3rem; border-radius: 16px; background: rgba(var(--brand-rgb, 46, 230, 182), 0.06); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.22); }
.pv-summary h2 { margin-top: 0; }
.pv-note { padding: 0.8rem 1rem; border-radius: 12px; background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.25); }

/* ====== Settings: security & privacy ====== */
.st-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; cursor: pointer; }
.st-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,0.14); transition: background 0.2s; }
.st-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.st-switch input:checked + span { background: var(--brand, #2ee6b6); }
.st-switch input:checked + span::after { transform: translateX(18px); }
.st-switch input:focus-visible + span { outline: 2px solid var(--brand, #2ee6b6); outline-offset: 2px; }
.st-badge[hidden] { display: none; }
.st-badge.warn { color: #fbbf24; background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.3); }
.del-icon { background: rgba(248,113,113,0.15) !important; color: #f87171 !important; font-weight: 800; font-size: 1.3rem; }
.verify-banner { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin: 0 auto 1rem; padding: 0.6rem 1rem; border-radius: 12px; font-size: 0.86rem;
  color: #fde68a; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); width: fit-content; max-width: 100%; }
.verify-banner[hidden] { display: none; }

/* ====== User-added connectors ====== */
.th-section-sub { margin: -0.3rem 0 0.9rem; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.5; }
.th-meta { font-size: 0.76rem !important; color: var(--text-secondary); opacity: 0.85; }
.th-tools { font-size: 0.8rem; color: var(--text-secondary); }
.th-tools summary { cursor: pointer; font-weight: 600; }
.th-tools ul { margin: 0.4rem 0 0; padding-left: 1rem; max-height: 160px; overflow-y: auto; }
.th-tools li { margin-bottom: 0.35rem; }
.th-tools em { font-style: normal; color: var(--brand, #2ee6b6); font-size: 0.72rem; }
.th-card-foot { flex-wrap: wrap; gap: 0.4rem; }
.th-add { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.3rem; cursor: pointer; font: inherit; color: inherit;
  border-style: dashed !important; background: transparent; min-height: 180px; }
.th-add:hover { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.5) !important; }
.th-add-plus { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.6rem; background: rgba(var(--brand-rgb, 46, 230, 182), 0.1); color: var(--brand, #2ee6b6); }
.gh-select { font: inherit; font-weight: 400; font-size: 0.92rem; padding: 0.65rem 0.8rem; border-radius: 10px; color: var(--text-primary);
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); }
.gh-select option { background: #0f141d; }
.gh-field[hidden] { display: none; }

/* ====== AI Combined Answer ====== */
.cb-progress { padding: 0.9rem 1rem; border-radius: 14px; background: rgba(var(--brand-rgb, 46, 230, 182), 0.05); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.2); }
.cb-head { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.92rem; }
.cb-head .btn-loader { width: 14px; height: 14px; margin: 0; }
.cb-models { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.35rem 1rem; font-size: 0.84rem; }
.cb-models li { display: flex; gap: 0.45rem; align-items: center; color: var(--text-secondary); }
.cb-models li span { width: 1rem; text-align: center; }
.cb-models .cb-ok { color: var(--text-primary); }
.cb-models .cb-ok span { color: var(--brand, #2ee6b6); }
.cb-models .cb-fail span { color: #f87171; }
.cb-note { margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-secondary); }
.cb-how { margin-top: 1rem; font-size: 0.82rem; color: var(--text-secondary); border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.6rem; }
.cb-how summary { cursor: pointer; font-weight: 600; }
.cb-how div { margin-top: 0.4rem; line-height: 1.6; }

/* Canvas sessions reopened from History */
.cv-run-saved { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; }

/* ====== Veo 3.1 video card ====== */
.veo-card { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.88rem; }
.veo-card p { margin: 0; color: var(--text-secondary); }
.veo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.veo-head span { font-size: 0.78rem; color: var(--text-secondary); }
.veo-prompt { font-style: italic; }
.veo-opts { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.veo-opts label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--text-secondary); }
.veo-opts select { font: inherit; font-size: 0.85rem; padding: 0.45rem 0.6rem; border-radius: 8px; color: var(--text-primary); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); }
.veo-opts select option { background: #0f141d; }
.veo-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.veo-bal { font-size: 0.76rem; color: var(--text-secondary); max-width: 340px; }

.lg-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ====== Canvas: Team / Agent mode ====== */
.cv-mode { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.cv-mode button { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.35rem 0.7rem; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.cv-mode button.on { background: rgba(var(--brand-rgb, 46, 230, 182), 0.15); color: var(--text-primary); }
.ag-diff { margin: 0.25rem 0 0.5rem 2.6rem; font-size: 0.78rem; }
.ag-diff summary { cursor: pointer; color: var(--text-secondary); }
.ag-lines { margin-top: 0.4rem; max-height: 320px; overflow: auto; border-radius: 8px; background: rgba(0,0,0,0.35); padding: 0.5rem 0.6rem; font-family: 'JetBrains Mono', ui-monospace, monospace; white-space: pre; }
.ag-add { color: #4ade80; }
.ag-del { color: #f87171; }
.ag-same { color: var(--text-secondary); opacity: 0.6; font-style: italic; }
.ag-summary { white-space: pre-wrap; line-height: 1.5; }

/* ====== Agent: workspace + internet ====== */
.cv-agent-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 0.5rem; font-size: 0.82rem; color: var(--text-secondary); }
.cv-agent-bar select { font: inherit; font-size: 0.82rem; margin-left: 0.3rem; padding: 0.3rem 0.5rem; border-radius: 8px; color: var(--text-primary); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); }
.cv-agent-bar select option { background: #0f141d; }
.cv-net { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.cv-ws-status { display: inline-flex; align-items: center; gap: 0.4rem; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; display: inline-block; }
.ws-dot.on { background: var(--brand, #2ee6b6); box-shadow: 0 0 8px rgba(var(--brand-rgb, 46, 230, 182), 0.7); }
.cv-link { font: inherit; background: none; border: 0; padding: 0; color: var(--brand, #2ee6b6); cursor: pointer; text-decoration: underline; }
.ws-pair p { margin: 0.4rem 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.ws-cmd { white-space: pre-wrap; word-break: break-all; font-size: 0.78rem; background: rgba(0,0,0,0.4); padding: 0.6rem 0.7rem; border-radius: 8px; margin: 0.4rem 0; }
.ws-pair-actions { display: flex; gap: 0.5rem; margin: 0.4rem 0; }
.ws-small { font-size: 0.76rem; color: var(--text-secondary); margin-top: 0.4rem; }
.ag-links { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.35rem; font-size: 0.78rem; }
.ag-links a { color: var(--brand, #2ee6b6); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ====== Spot Bots page ====== */
#bots-view .ws-inner { max-width: 1120px; }
.bt-count { align-self: center; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); padding: 0.35rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.bt-boss { display: flex; gap: 1.4rem; align-items: center; padding: 1.5rem 1.6rem; margin: 0.5rem 0 1.5rem; border-radius: 24px;
  background: radial-gradient(600px 220px at 0% 0%, rgba(var(--brand-rgb, 46, 230, 182), 0.16), transparent 70%), linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.22); box-shadow: 0 20px 50px rgba(0,0,0,0.25); }
.bt-boss-face { flex-shrink: 0; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 28px; background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.2); }
.bt-boss-main { flex: 1; min-width: 0; }
.bt-boss-main h2 { margin: 0; font-size: 1.35rem; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.bt-boss-tag { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; color: #fde68a; background: rgba(250,204,21,0.12); border: 1px solid rgba(250,204,21,0.3); }
.bt-boss-main > p { margin: 0.35rem 0 0.9rem; color: var(--text-secondary); font-size: 0.92rem; }
.bt-boss-input { display: flex; gap: 0.6rem; align-items: stretch; }
.bt-boss-input textarea { flex: 1; resize: none; font: inherit; font-size: 0.95rem; line-height: 1.45; padding: 0.8rem 1rem; border-radius: 14px; color: var(--text-primary);
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.12); outline: none; min-height: 52px; }
.bt-boss-input textarea:focus { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.55); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 46, 230, 182), 0.12); }
.bt-boss-input .ws-btn { white-space: nowrap; padding: 0 1.2rem; border-radius: 14px; }
.bt-boss-msg { margin-top: 0.6rem; font-size: 0.85rem; color: var(--text-secondary); min-height: 1.2em; }
@media (max-width: 640px) { .bt-boss { flex-direction: column; align-items: flex-start; } .bt-boss-input { flex-direction: column; } .bt-boss-input .ws-btn { padding: 0.75rem; } }

.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.bt-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.4rem 1.1rem 1.1rem; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.08); transition: transform .18s, border-color .18s, box-shadow .18s; }
.bt-card:hover { transform: translateY(-3px); border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.35); box-shadow: 0 18px 40px rgba(0,0,0,0.3); }
.bt-card-face { width: 100px; height: 100px; display: grid; place-items: center; border-radius: 30px; background: rgba(255,255,255,0.04); margin-bottom: 0.7rem; }
.bt-card h3 { margin: 0; font-size: 1.15rem; }
.bt-job { margin: 0.3rem 0 0.7rem; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; min-height: 2.9em; }
.bt-card-tags { display: flex; gap: 0.35rem; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 0.85rem; margin-bottom: 0.9rem; }
.bt-pers { font-size: 0.72rem; font-weight: 600; text-transform: capitalize; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(167,139,250,0.14); color: #c4b5fd; }
.bt-card-actions { display: flex; gap: 0.35rem; width: 100%; margin-top: auto; }
.bt-card-actions .ws-btn { padding: 0.5rem 0.6rem; border-radius: 11px; font-size: 0.85rem; }
.bt-card-actions .ws-btn.primary { flex: 1; }
.bt-empty-face { margin-bottom: 0.4rem; }

/* editor */
.bt-editor { padding: 1.4rem; margin-bottom: 1.5rem; border-radius: 24px; background: rgba(255,255,255,0.035); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); animation: btIn .25s ease; }
@keyframes btIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bt-intro { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; margin-bottom: 1.1rem; border-radius: 14px; background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); font-size: 0.92rem; }
.bt-mini { display: inline-flex; }
.bt-editor-grid { display: grid; grid-template-columns: 260px 1fr; gap: 1.6rem; }
@media (max-width: 760px) { .bt-editor-grid { grid-template-columns: 1fr; } }
.bt-face-col { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.bt-face-big { width: 190px; height: 190px; display: grid; place-items: center; border-radius: 44px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.09), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.08); }
.bt-face-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; width: 100%; }
.bt-face-opts label, .bt-fields label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); }
.bt-face-opts select, .bt-fields input, .bt-fields select, .bt-fields textarea { font: inherit; font-size: 0.88rem; font-weight: 400; padding: 0.55rem 0.7rem; border-radius: 10px; color: var(--text-primary);
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.12); outline: none; }
.bt-fields textarea { resize: vertical; line-height: 1.45; }
.bt-face-opts select option, .bt-fields select option, .bt-fields select optgroup { background: #0f141d; }
.bt-face-opts .bt-check { flex-direction: row; align-items: center; gap: 0.4rem; grid-column: span 2; }
.bt-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.bt-swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid transparent; cursor: pointer; }
.bt-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(var(--brand-rgb, 46, 230, 182), 0.6); }
.bt-fields { display: flex; flex-direction: column; gap: 0.75rem; }
.bt-fields .bt-starter { margin-top: 0.3rem; }
.bt-tools { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.bt-tool { flex-direction: row !important; align-items: center; gap: 0.35rem !important; padding: 0.45rem 0.7rem; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; font-size: 0.82rem !important; color: var(--text-primary) !important; }
.bt-tool:has(input:checked) { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.5); background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); }
.bt-editor-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.2rem; flex-wrap: wrap; }

/* face animation */
.bot-face.bf-anim .bf-eyes { transform-origin: 60px 58px; animation: bfBlink 4.5s infinite; }
.bot-face.bf-anim { animation: bfBob 3.2s ease-in-out infinite; }
@keyframes bfBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes bfBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bot-face.bf-anim, .bot-face.bf-anim .bf-eyes { animation: none; } }

/* bots in Chat and History */
.chat-bot-chip { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; padding: 0.3rem 0.4rem 0.3rem 0.35rem; border-radius: 999px; font-size: 0.82rem;
  background: rgba(var(--brand-rgb, 46, 230, 182), 0.08); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.chat-bot-chip .cbc-face { display: inline-flex; }
.chat-bot-chip button { background: none; border: 0; color: var(--text-secondary); cursor: pointer; font-size: 0.85rem; padding: 0 0.35rem; }
.bot-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3rem 1rem 1rem; }
.bot-welcome h2 { margin: 0.6rem 0 0.2rem; }
.bot-welcome p { margin: 0 0 1rem; color: var(--text-secondary); max-width: 460px; }
.hs-bot { display: inline-flex; align-items: center; gap: 0.25rem; }
.hs-bot-face { display: inline-flex; }

/* Bot Desk (on the Bots page) */
.bt-desk { padding: 1.3rem; margin-bottom: 1.5rem; border-radius: 24px; background: rgba(255,255,255,0.035); border: 1px solid rgba(167,139,250,0.3); animation: btIn .25s ease; }
.bt-desk-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.bt-desk-head h2 { margin: 0; font-size: 1.15rem; }
.bt-desk-head p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-secondary); }
.bt-desk-head .ws-btn { margin-left: auto; }
.bt-desk-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .bt-desk-grid { grid-template-columns: 1fr; } }
.bt-desk-task { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.bt-desk-task textarea { flex: 1; resize: none; font: inherit; font-size: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 12px; color: var(--text-primary); background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.12); outline: none; }
.bt-desk-log { display: flex; flex-direction: column; gap: 0.35rem; max-height: 420px; overflow-y: auto; font-size: 0.85rem; }
.bt-step { display: flex; gap: 0.5rem; padding: 0.45rem 0.6rem; border-radius: 10px; background: rgba(255,255,255,0.03); }
.bt-step.err { background: rgba(248,113,113,0.08); }
.bt-step small { display: block; color: var(--text-secondary); }
.bt-step a { color: var(--brand, #2ee6b6); }
.bt-desk-side { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.bt-desk-files { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bt-desk-files button { font: inherit; font-size: 0.78rem; padding: 0.3rem 0.6rem; border-radius: 8px; color: var(--text-primary); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; }
.bt-desk-view { min-height: 260px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,0.1); }
.bt-desk-view iframe { width: 100%; height: 320px; border: 0; display: block; }
.bt-desk-view pre { margin: 0; padding: 0.8rem; height: 320px; overflow: auto; background: #0b0f16; color: #e5e7eb; font-size: 0.78rem; white-space: pre-wrap; }

/* ====== Sidebar refresh: grouped, tighter, softer active pill ====== */
.sidebar-group-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-secondary); opacity: 0.6; padding: 0.9rem 1rem 0.3rem; }
.sidebar-group-label:first-child { padding-top: 0.2rem; }
.sidebar.collapsed .sidebar-group-label { font-size: 0; padding: 0.5rem 0; margin: 0.4rem 1.2rem 0; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-item { padding: 0.62rem 0.9rem !important; border-radius: 12px !important; font-size: 0.92rem !important; gap: 0.8rem !important; border-left: 0 !important; }
.sidebar-item .icon { font-size: 1.05rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,0.04); transition: background .2s, transform .2s; }
.sidebar-item:hover .icon { transform: scale(1.06); }
.sidebar-item.active { background: linear-gradient(90deg, rgba(var(--brand-rgb, 46, 230, 182), 0.14), rgba(139,92,246,0.06)) !important; border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.22) !important; box-shadow: none !important; color: #fff !important; }
.sidebar-item.active .icon { background: rgba(var(--brand-rgb, 46, 230, 182), 0.18); }
.sidebar-new { margin-left: auto; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.12rem 0.45rem; border-radius: 999px; color: #0b0e14; background: linear-gradient(90deg, var(--brand, #2ee6b6), #a78bfa); }
.sidebar.collapsed .sidebar-new { display: none; }

/* ====== Web image results in Chat ====== */
.web-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.web-gallery a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.web-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.web-gallery a:hover img { transform: scale(1.05); }
.web-gallery-note { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.35rem; }
.bt-head-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; align-self: center; }
.bt-tg { border-color: rgba(56,189,248,0.4) !important; color: #7dd3fc !important; }

/* ====== Installable app ====== */
.sb-install { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; margin-bottom: 0.7rem; padding: 0.65rem 0.8rem; border-radius: 12px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  color: var(--text-primary); background: linear-gradient(90deg, rgba(var(--brand-rgb, 46, 230, 182), 0.14), rgba(0,194,255,0.12)); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.35); }
.sb-install:hover { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.7); }
.sb-install[hidden] { display: none; }
.sidebar.collapsed .sb-install .label { display: none; }
.install-sheet { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: end center; background: rgba(3,6,12,0.65); backdrop-filter: blur(4px); padding: 1rem; }
.install-card { width: min(420px, 100%); background: #0f141d; border: 1px solid rgba(255,255,255,0.1); border-radius: 22px; padding: 1.4rem; text-align: center; color: var(--text-primary); margin-bottom: env(safe-area-inset-bottom); }
.install-card img { border-radius: 16px; }
.install-card h3 { margin: 0.7rem 0 0.5rem; }
.install-card ol { text-align: left; margin: 0 0 0.6rem; padding-left: 1.3rem; line-height: 1.8; }
.install-card p { font-size: 0.8rem; color: var(--text-secondary); }
/* Running as an installed app: respect the phone's notch and home bar */
.is-installed-app body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* ====== PDF cards in Chat ====== */
.pdf-card { display: flex; align-items: center; gap: 0.9rem; margin: 0.8rem 0; padding: 0.85rem 1rem; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; }
.pdf-card.writing { opacity: 0.75; }
.pdf-icon { flex-shrink: 0; width: 44px; height: 54px; display: grid; place-items: center; border-radius: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; color: #fff; background: linear-gradient(160deg, #f43f5e, #e11d48); box-shadow: 0 6px 16px rgba(225,29,72,0.3); }
.pdf-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.2rem; }
.pdf-info b { font-size: 0.95rem; }
.pdf-info span { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }
.pdf-actions { display: flex; gap: 0.4rem; }

/* ====== Genexts Docs, Sheets & Slides ====== */
.of-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin: 0.4rem 0 1.6rem; }
.of-new-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 1.1rem 1.2rem; border-radius: 18px; cursor: pointer; font: inherit; text-align: left; color: var(--text-primary);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(255,255,255,0.02)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); transition: transform .15s, border-color .15s; }
.of-new-card:hover { transform: translateY(-2px); border-color: var(--c); }
.of-new-card span { font-size: 1.6rem; }
.of-new-card b { font-size: 1rem; }
.of-new-card small { color: var(--text-secondary); font-size: 0.8rem; }
.of-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.of-file { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 14px; cursor: pointer; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
.of-file:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); background: rgba(255,255,255,0.05); }
.of-file-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; font-size: 1.2rem; background: color-mix(in srgb, var(--c) 18%, transparent); }
.of-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.of-file-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-file-info span { font-size: 0.78rem; color: var(--text-secondary); }
.of-del { opacity: 0.5; }
.of-file:hover .of-del { opacity: 1; }

.of-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.of-editor[hidden] { display: none; }
.of-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.of-bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.of-title { font: inherit; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0.2rem 0.4rem; outline: none; min-width: 0; }
.of-title:hover, .of-title:focus { border-color: rgba(255,255,255,0.15); }
.of-meta { font-size: 0.74rem; color: var(--text-secondary); padding-left: 0.45rem; }
.of-export-wrap { position: relative; }
.of-export-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 170px; padding: 0.35rem; border-radius: 12px; background: #111827; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 16px 40px rgba(0,0,0,0.4); display: flex; flex-direction: column; }
.of-export-menu[hidden] { display: none; }
.of-export-menu button { font: inherit; font-size: 0.85rem; text-align: left; padding: 0.55rem 0.7rem; border-radius: 8px; border: 0; background: none; color: var(--text-primary); cursor: pointer; }
.of-export-menu button:hover { background: rgba(255,255,255,0.07); }
.of-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.5rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); }
.of-toolbar button { font: inherit; font-size: 0.85rem; min-width: 34px; height: 32px; padding: 0 0.6rem; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-primary); cursor: pointer; }
.of-toolbar button:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); }
.of-toolbar .of-present { background: linear-gradient(90deg, #f59e0b, #f97316); color: #1c1003; font-weight: 700; }
.of-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.12); margin: 0 0.3rem; }
.of-theme { font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; }
.of-theme select { font: inherit; font-size: 0.8rem; padding: 0.25rem 0.4rem; border-radius: 7px; background: rgba(0,0,0,0.3); color: var(--text-primary); border: 1px solid rgba(255,255,255,0.12); text-transform: capitalize; }
.of-body { flex: 1; min-height: 0; overflow: auto; }

/* Docs: a white page */
.of-page { max-width: 860px; margin: 1.5rem auto 3rem; background: #fff; color: #111827; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.35); }
.of-doc { min-height: 70vh; padding: 3.5rem 4rem; outline: none; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.7; }
@media (max-width: 700px) { .of-doc { padding: 2rem 1.3rem; } .of-page { margin: 0.6rem; } }
.of-doc h1, .of-doc h2, .of-doc h3 { font-family: Inter, system-ui, sans-serif; color: #0f172a; line-height: 1.25; }
.of-doc h1 { font-size: 2rem; } .of-doc h2 { font-size: 1.45rem; } .of-doc h3 { font-size: 1.15rem; }
.of-doc a { color: #2563eb; }
.of-doc blockquote { border-left: 4px solid #cbd5e1; margin: 1rem 0; padding: 0.2rem 1rem; color: #475569; }
.of-doc table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-family: Inter, system-ui, sans-serif; font-size: 0.92rem; }
.of-doc th, .of-doc td { border: 1px solid #cbd5e1; padding: 0.45rem 0.6rem; text-align: left; }
.of-doc th { background: #f1f5f9; }
.of-doc hr { border: 0; border-top: 1px solid #e2e8f0; margin: 1.5rem 0; }

/* Sheets */
.of-cellname { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.8rem; min-width: 44px; text-align: center; padding: 0.3rem 0.4rem; border-radius: 6px; background: rgba(255,255,255,0.06); }
.of-fx { flex: 1; min-width: 200px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.85rem; padding: 0.4rem 0.6rem; border-radius: 8px; color: var(--text-primary); background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.12); outline: none; }
.of-sheet-wrap { overflow: auto; height: 100%; }
.of-sheet { border-collapse: collapse; font-size: 0.85rem; background: #fff; color: #111827; }
.of-sheet th { position: sticky; top: 0; background: #f1f5f9; color: #475569; font-weight: 600; font-size: 0.75rem; padding: 0.3rem; border: 1px solid #e2e8f0; min-width: 40px; z-index: 2; }
.of-sheet tbody th { position: sticky; left: 0; z-index: 1; }
.of-sheet td { border: 1px solid #e2e8f0; padding: 0; }
.of-sheet input { width: 110px; height: 28px; border: 0; padding: 0 0.45rem; font: inherit; font-size: 0.85rem; background: transparent; color: #111827; outline: none; }
.of-sheet input:focus { outline: 2px solid #2563eb; outline-offset: -2px; background: #eff6ff; }
.of-sheet input.num { text-align: right; }
.of-sheet input.formula { color: #065f46; }
.of-sheet input.err { color: #dc2626; }

/* Slides */
.of-slides { display: grid; grid-template-columns: 190px 1fr; height: 100%; min-height: 0; }
@media (max-width: 760px) { .of-slides { grid-template-columns: 1fr; } .of-thumbs { flex-direction: row; overflow-x: auto; } }
.of-thumbs { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem; overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.07); }
.of-thumb { position: relative; flex-shrink: 0; aspect-ratio: 16 / 9; width: 100%; min-width: 140px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font: inherit; text-align: left; padding: 0.5rem; background: var(--bg); color: var(--fg); overflow: hidden; }
.of-thumb.on { border-color: var(--ac); }
.of-thumb span { position: absolute; right: 6px; bottom: 4px; font-size: 0.65rem; opacity: 0.7; }
.of-thumb b { font-size: 0.7rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.of-stage-wrap { padding: 1.4rem; overflow: auto; }
.of-stage { aspect-ratio: 16 / 9; max-width: 1000px; margin: 0 auto; border-radius: 10px; padding: 6% 7%; background: var(--bg); color: var(--fg); box-shadow: 0 16px 50px rgba(0,0,0,0.4); display: flex; flex-direction: column; gap: 1.2rem; overflow: hidden; }
.of-slide-title { font-size: clamp(1.4rem, 3.2vw, 2.6rem); font-weight: 800; line-height: 1.15; outline: none; border-top: 5px solid var(--ac); padding-top: 0.8rem; }
.of-slide-body { flex: 1; font-size: clamp(0.95rem, 1.7vw, 1.35rem); line-height: 1.6; white-space: pre-wrap; color: var(--sub); outline: none; overflow: auto; }
.of-slide-title:empty::before, .of-slide-body:empty::before { content: attr(data-placeholder); opacity: 0.4; }
.of-hint { text-align: center; font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.8rem; }
.of-present-overlay { position: fixed; inset: 0; z-index: 10000; background: #000; display: grid; place-items: center; cursor: pointer; }
.of-show-slide { width: min(100vw, 177.78vh); aspect-ratio: 16 / 9; background: var(--bg); color: var(--fg); padding: 6% 7%; box-sizing: border-box; display: flex; flex-direction: column; gap: 4%; }
.of-show-slide h1 { margin: 0; font-size: 4.6vmin; line-height: 1.15; border-top: 0.7vmin solid var(--ac); padding-top: 2vmin; }
.of-show-slide div { font-size: 3vmin; line-height: 1.6; color: var(--sub); }
.of-show-slide li { margin-bottom: 1.2vmin; }
.of-present-bar { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); font-size: 0.75rem; color: rgba(255,255,255,0.55); }

/* Cards in Chat */
.of-card { display: flex; align-items: center; gap: 0.9rem; margin: 0.8rem 0; padding: 0.85rem 1rem; border-radius: 16px; flex-wrap: wrap;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(255,255,255,0.02)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.of-card-icon { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 20%, transparent); }
.of-card-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 0.15rem; }
.of-card-info span { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }
.of-doc p { margin: 0 0 0.85em; }
.of-doc ul, .of-doc ol { margin: 0 0 0.9em; padding-left: 1.4em; }
.of-doc h1, .of-doc h2, .of-doc h3 { margin: 1.1em 0 0.45em; }
.of-doc > :first-child { margin-top: 0; }

/* ====== Ask AI panel (bottom of the editors) ====== */
.of-ai-panel { border-top: 1px solid rgba(255,255,255,0.08); background: linear-gradient(180deg, rgba(15,20,29,0.96), #0b0e14); padding: 0.6rem 1.2rem 0.9rem; }
.of-ai-log { max-height: 30vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.45rem; padding: 0.3rem 0 0.7rem; }
.of-ai-log[hidden] { display: none; }
.of-ai-msg { max-width: 78%; padding: 0.55rem 0.8rem; border-radius: 14px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; }
.of-ai-msg.me { align-self: flex-end; background: rgba(var(--brand-rgb, 46, 230, 182), 0.14); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.of-ai-msg.ai { align-self: flex-start; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.of-ai-msg.pending { opacity: 0.7; font-style: italic; }
.of-ai-msg.error { border-color: rgba(248,113,113,0.4); color: #fca5a5; }
.of-ai-who { display: block; font-size: 0.7rem; font-weight: 700; color: #a78bfa; margin-bottom: 0.15rem; }
.of-ai-changed { margin-top: 0.4rem; font-size: 0.78rem; color: var(--brand, #2ee6b6); font-style: normal; }
.of-ai-bar { display: flex; align-items: flex-end; gap: 0.55rem; padding: 0.45rem 0.45rem 0.45rem 0.8rem; border-radius: 16px; background: rgba(255,255,255,0.05); border: 1px solid rgba(167,139,250,0.35); }
.of-ai-bar:focus-within { border-color: rgba(167,139,250,0.75); box-shadow: 0 0 0 3px rgba(167,139,250,0.12); }
.of-ai-spark { padding-bottom: 0.45rem; }
.of-ai-bar textarea { flex: 1; resize: none; font: inherit; font-size: 0.92rem; line-height: 1.45; padding: 0.4rem 0; border: 0; outline: none; background: transparent; color: var(--text-primary); max-height: 140px; }
.of-ai-bar .ws-btn { border-radius: 11px; }
.st-voice-ctl { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.st-voice-ctl select { max-width: 220px; }

/* ---------- Spot Bots, part 2: boss hand-off, memory, jobs, inbox, share page, bot avatars ---------- */
.bt-handoff { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; animation: btPop .35s ease; }
@keyframes btPop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.bt-memory { margin-top: 14px; padding: 12px; border: 1px solid var(--border-color, rgba(148,163,184,.25)); border-radius: 12px; }
.bt-mem-head { font-weight: 600; margin-bottom: 8px; }
.bt-mem-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(148,163,184,.1); margin-bottom: 6px; font-size: 14px; }
.bt-mem-note button { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; }
.bt-mem-note button:hover { opacity: 1; }
.bt-mem-empty { opacity: .7; font-size: 14px; margin: 4px 0; }
.bt-mem-all { margin-top: 4px; font-size: 13px; }
.bt-jobs textarea { width: 100%; box-sizing: border-box; margin: 10px 0 8px; border-radius: 10px; padding: 10px; background: transparent; color: inherit; border: 1px solid var(--border-color, rgba(148,163,184,.3)); font: inherit; }
.bt-job-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bt-job-row select, .bt-job-row input[type=time] { padding: 8px; border-radius: 8px; background: transparent; color: inherit; border: 1px solid var(--border-color, rgba(148,163,184,.3)); }
.bt-job-days { display: inline-flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.bt-job-days label { display: inline-flex; gap: 3px; align-items: center; }
.bt-job-list { margin-top: 12px; }
.bt-job { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(148,163,184,.08); margin-bottom: 6px; }
.bt-job small { display: block; opacity: .7; font-size: 12px; }
.bt-inbox { margin: 14px 0; }
.bt-inbox-head { width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-color, rgba(148,163,184,.25)); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.bt-inbox-head small { opacity: .6; font-weight: 400; }
.bt-badge { background: var(--brand, #2ee6b6); color: #062; border-radius: 99px; padding: 1px 8px; font-size: 12px; }
#bt-inbox-list { margin-top: 8px; }
.bt-inbox-item { border: 1px solid var(--border-color, rgba(148,163,184,.2)); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.bt-inbox-item.new { border-color: var(--brand, #2ee6b6); }
.bt-inbox-item summary { display: flex; gap: 8px; align-items: center; cursor: pointer; flex-wrap: wrap; }
.bt-inbox-task { flex: 1; min-width: 120px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-inbox-item summary small { opacity: .6; font-size: 12px; }
.bt-inbox-item .markdown-body { padding: 10px 2px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.bt-inbox-actions { display: flex; gap: 6px; justify-content: flex-end; }
.bt-share-page { position: fixed; inset: 0; z-index: 9999; background: rgba(2,6,23,.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: btPop .25s ease; }
.bt-share-card { position: relative; width: min(420px, 100%); background: var(--bg-primary, #0f172a); color: inherit; border-radius: 24px; padding: 28px 22px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bt-share-card h2 { margin: 2px 0 0; font-size: 26px; }
.bt-share-card p { margin: 0; opacity: .8; }
.bt-share-card small { opacity: .6; font-size: 12px; }
.bt-share-tag { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand, #2ee6b6); font-weight: 700; }
.bt-share-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; opacity: .6; }
.bt-share-starters { display: flex; flex-direction: column; gap: 6px; width: 100%; margin: 6px 0; }
.bt-share-go { width: 100%; padding: 12px; font-size: 16px; margin-top: 4px; }
.ai-avatar.bot-av { background: none; padding: 0; overflow: visible; }
.ai-avatar.bot-av svg { width: 30px; height: 30px; display: block; }
.bot-typing .ai-avatar.bot-av svg { animation: botWiggle .6s ease-in-out infinite; }
@keyframes botWiggle { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-8deg) translateY(-2px); } 75% { transform: rotate(8deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .bot-typing .ai-avatar.bot-av svg, .bt-handoff, .bt-share-page { animation: none; } }

/* ===== Menu that fits every screen (phone drawer, tablet icon strip) + clean Chat ===== */
.mobile-nav-btn, .chat-nav-btn, .nav-backdrop { display: none; }
.sidebar { overflow-y: auto !important; scrollbar-width: none; flex-shrink: 0; }
.sidebar::-webkit-scrollbar { display: none; }
/* Use the real visible height on phones (the browser's address bar no longer hides the message box). */
@supports (height: 100dvh) {
  .view-container, .genexts-main-layout, .chat-shell, .app-container, .launcher-container { height: 100dvh; }
}

/* "hidden" always wins (a few button styles used to override it, e.g. Resend verification email). */
[hidden] { display: none !important; }

/* Chat on every screen: the menu hides itself. ☰ in the chat bar opens it over the chat; on a
   computer, moving the mouse to the left edge opens it too. It closes again on its own. */
body.in-chat .sidebar, body.in-chat .sidebar.collapsed {
  position: fixed !important; top: 0; left: 0; bottom: 0; height: 100vh !important; height: 100dvh !important;
  width: min(290px, 84vw) !important; align-items: stretch !important;
  transform: translateX(-105%); transition: transform 0.22s ease !important; z-index: 1200 !important;
  background-color: #0b0e14 !important; box-shadow: 18px 0 50px rgba(0,0,0,0.55);
}
body.in-chat.nav-open .sidebar { transform: none; }
body.in-chat.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1150; background: rgba(0,0,0,0.35); animation: fadeIn 0.2s ease-out; }
body.in-chat .chat-nav-btn { display: grid; }
body.in-chat #chat-view .chat-header .btn-back { display: none; }
.nav-edge { display: none; }
@media (hover: hover) and (min-width: 769px) { body.in-chat .nav-edge { display: block; position: fixed; top: 0; left: 0; bottom: 0; width: 10px; z-index: 1100; } }
body.in-chat .sidebar .sb-credits, body.in-chat .sidebar .sb-install { display: none !important; }

@media (max-width: 768px) {
  /* The menu slides in from the left, over the page. */
  .sidebar, .sidebar.collapsed {
    position: fixed !important; top: 0; left: 0; bottom: 0; height: 100vh !important; height: 100dvh !important;
    width: min(290px, 84vw) !important; align-items: stretch !important;
    padding: calc(1rem + env(safe-area-inset-top)) 0.9rem calc(1rem + env(safe-area-inset-bottom)) !important;
    transform: translateX(-105%); transition: transform 0.25s ease !important; z-index: 1200 !important;
    background-color: #0b0e14 !important; box-shadow: 18px 0 50px rgba(0,0,0,0.55);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 1150; background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fadeIn 0.2s ease-out; }
  .sidebar .genexts-sidebar-header { margin-bottom: 1rem; }
  .sidebar-item { min-height: 44px; }
  .sidebar .profile-menu { bottom: 76px !important; }

  /* ☰ button for pages other than Chat (Chat has its own in its top bar). */
  body.has-nav:not(.in-chat) .mobile-nav-btn {
    display: grid; place-items: center; position: fixed; z-index: 1050;
    top: calc(10px + env(safe-area-inset-top)); left: 10px; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
    color: var(--text-primary); background: rgba(17,21,32,0.85); border: 1px solid rgba(255,255,255,0.09);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  body.has-nav:not(.in-chat) .genexts-main-layout > .app-container,
  body.has-nav:not(.in-chat) .genexts-main-layout > .launcher-container,
  body.has-nav:not(.in-chat) .genexts-main-layout > .genexts-centered-layout { padding: 4.25rem 1rem 1.25rem; }

  /* Chat: just the conversation, full screen. */
  .chat-nav-btn { display: grid; }
  #chat-view .chat-header .btn-back { display: none; }
  .chat-header { padding: calc(0.5rem + env(safe-area-inset-top)) 0.6rem 0.5rem; gap: 0.4rem; }
  .chat-header-actions { gap: 0.15rem; }
  .chat-title { font-size: 0.92rem; }
  #chat-agent-select { display: none; } /* assistant style stays on its default on phones; change it on a bigger screen */
  #chat-history.chat-history { padding: 1.1rem 0.85rem 0.6rem; gap: 1.2rem; }
  #chat-history .chat-message.user-message { max-width: 88%; }
  #chat-history .chat-message.ai-message { grid-template-columns: 26px minmax(0, 1fr); gap: 0.6rem; }
  .chat-empty h2 { font-size: 1.4rem; }
  .chat-composer-wrap { padding: 0.4rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom)); }
  #chat-input { font-size: 16px; } /* 16px stops iPhones zooming in when you tap the box */
  .chat-footnote { display: none; }
  .chat-more-menu { right: -0.3rem; max-width: calc(100vw - 1.5rem); }

}

/* ===== Customer branding (tenant.js sets --brand, --brand-rgb, --brand-2 from the customer's settings) ===== */
.brand-wordmark.tenant-logo { mix-blend-mode: normal; object-fit: contain; max-height: 64px; }
.sidebar-wordmark.tenant-logo { max-height: 28px; max-width: 160px; }
.powered-by { position: fixed; right: 12px; bottom: 8px; z-index: 5; font-size: 0.7rem; color: var(--text-muted); opacity: 0.8; pointer-events: none; }
body.in-chat .powered-by { display: none; }

/* ===== Spot Bots: ready-made jobs, job kinds and rules, pictures in the inbox ===== */
.bt-tpl-label { font-size: 12px; opacity: .7; margin: 10px 0 6px; }
.bt-tpls { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-tpl { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px;
  color: inherit; background: rgba(148,163,184,.08); border: 1px solid var(--border-color, rgba(148,163,184,.25)); transition: border-color .15s, background .15s; }
.bt-tpl:hover:not(:disabled) { border-color: rgba(var(--brand-rgb, 46, 230, 182), .5); background: rgba(var(--brand-rgb, 46, 230, 182), .08); }
.bt-tpl:disabled { opacity: .45; cursor: not-allowed; }
.bt-job-row + .bt-job-row { margin-top: 8px; }
.bt-job-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .95; }
.bt-job-row select:disabled { opacity: .5; }
#bt-job-cond { flex: 1; min-width: 200px; padding: 8px; border-radius: 8px; background: transparent; color: inherit; border: 1px solid var(--border-color, rgba(148,163,184,.3)); font: inherit; }
.bt-job { justify-content: flex-start; }
.bt-job > div { flex: 1; min-width: 0; }
.bt-job-ic { font-size: 18px; flex: none; }
.bt-inbox-pic { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; margin: 8px 0; background: rgba(148,163,184,.1); min-height: 80px; }
.bt-inbox-why { font-size: 12px; opacity: .7; margin: 6px 0 0; }
@media (max-width: 640px) { .bt-job-row { flex-direction: column; align-items: stretch; } .bt-job-field { justify-content: space-between; } }

/* ===== AI browser panel (browser-panel.js) ===== */
.gxb { position: fixed; top: 0; right: 0; bottom: 0; width: min(48vw, 820px); min-width: 420px; z-index: 1300; display: flex; flex-direction: column;
  background: #0d1117; border-left: 1px solid rgba(255,255,255,0.08); box-shadow: -20px 0 60px rgba(0,0,0,0.45); }
.gxb[hidden] { display: none !important; }
body.browser-open #chat-view .chat-shell { margin-right: min(48vw, 820px); }
.gxb-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0; background: #0a0d12; min-height: 40px; }
.gxb-tablist { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.gxb-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; padding: 7px 10px; border-radius: 10px 10px 0 0; border: 0; cursor: pointer;
  background: transparent; color: var(--text-secondary); font: inherit; font-size: 12.5px; }
.gxb-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gxb-tab b { opacity: .5; font-weight: 400; padding: 0 2px; }
.gxb-tab b:hover { opacity: 1; }
.gxb-tab.on { background: #161b22; color: var(--text-primary); }
.gxb-sp { flex: 1; }
.gxb-ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 15px; }
.gxb-ic:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.gxb-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #161b22; border-bottom: 1px solid rgba(255,255,255,0.06); }
.gxb-url-form { flex: 1; }
.gxb-url { width: 100%; box-sizing: border-box; padding: 7px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.1); background: #0d1117; color: var(--text-primary); font: inherit; font-size: 13px; outline: none; }
.gxb-url:focus { border-color: rgba(var(--brand-rgb, 46, 230, 182), .55); }
.gxb-view { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center; overflow: auto; background: #0d1117; }
.gxb-frame { width: 100%; height: auto; aspect-ratio: 1280 / 800; display: block; cursor: default; outline: none; user-select: none; background: #fff; }
.gxb-frame:focus { box-shadow: inset 0 0 0 2px rgba(var(--brand-rgb, 46, 230, 182), .6); }
.gxb-empty { margin: auto; max-width: 360px; text-align: center; color: var(--text-secondary); padding: 24px; }
.gxb-empty b { display: block; color: var(--text-primary); font-size: 1.05rem; margin: 6px 0; }
.gxb-empty p { font-size: 13px; line-height: 1.5; margin: 6px 0; }
.gxb-globe { font-size: 30px; opacity: .8; }
.gxb-small { font-size: 12px !important; opacity: .8; }
.gxb-banner { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: #111827; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 18px 40px rgba(0,0,0,0.5); font-size: 13px; }
.gxb-banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gxb-banner span { color: var(--text-secondary); }
.gxb-you { border-color: rgba(251,191,36,.55); background: #1c1708; }
.gxb-ask-ok { border-color: rgba(var(--brand-rgb, 46, 230, 182), .55); }
.gxb-ai { padding: 8px 12px; opacity: .95; }
.gxb-err { border-color: rgba(248,113,113,.6); color: #fca5a5; }
.gxb-btn { flex: none; padding: 7px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: var(--text-primary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gxb-btn.primary { border: 0; color: #0b0e14; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); }
.gxb-ask { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.gxb-task { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: #161b22; color: var(--text-primary); font: inherit; font-size: 14px; outline: none; }
.gxb-task:focus { border-color: rgba(var(--brand-rgb, 46, 230, 182), .55); }
.gxb-go { padding: 0 16px; border-radius: 10px; border: 0; font-weight: 700; cursor: pointer; color: #0b0e14; background: linear-gradient(135deg, var(--brand, #2ee6b6), var(--brand-2, #14b8a6)); }
.gxb-log { padding: 0 10px 8px; font-size: 12px; color: var(--text-secondary); max-height: 30vh; overflow: auto; }
.gxb-log summary { cursor: pointer; padding: 4px 0; }
.gxb-log ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.gxb-log time { opacity: .6; margin-right: 4px; }
.gxb-l-done { color: var(--text-primary); }
.gxb-l-approval, .gxb-l-user { color: #fcd34d; }
@media (max-width: 900px) {
  .gxb { width: 100vw; min-width: 0; }
  body.browser-open #chat-view .chat-shell { margin-right: 0; }
  .gxb-tabs { padding-top: calc(6px + env(safe-area-inset-top)); }
  .gxb-ask { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}
/* Spot Bots: event triggers and delivery */
.bt-dl { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.bt-dl input:disabled + * , .bt-dl:has(input:disabled) { opacity: .55; }
.bt-job-hint { font-size: 12px; opacity: .65; }
#bt-job-project { flex: 1; min-width: 200px; padding: 8px; border-radius: 8px; background: transparent; color: inherit; border: 1px solid var(--border-color, rgba(148,163,184,.3)); font: inherit; }
.bt-hook { display: flex; gap: 6px; margin-top: 6px; }
.bt-hook input { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; font: 12px/1.4 ui-monospace, Menlo, monospace; color: inherit; background: rgba(0,0,0,.2); border: 1px solid var(--border-color, rgba(148,163,184,.25)); }
.gxb-model { max-width: 150px; padding: 0 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: #161b22; color: var(--text-primary); font: inherit; font-size: 12.5px; }
@media (max-width: 520px) { .gxb-ask { flex-wrap: wrap; } .gxb-task { flex-basis: 100%; } .gxb-model { flex: 1; max-width: none; height: 38px; } }
/* Chat replies: long words and addresses wrap instead of pushing tables off the screen */
.md-table td, .md-table th { overflow-wrap: anywhere; min-width: 6rem; }
.md-table td a, .markdown-body a { overflow-wrap: anywhere; }
.markdown-body a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(var(--brand-rgb, 46, 230, 182), .45); }

/* Genexts Bot (the boss) in the main Chat: bot it made, or its offer to make one */
.gb-card { margin: 0.25rem 0; padding: 0.85rem 0.95rem; border-radius: 16px; max-width: 520px;
  background: rgba(var(--brand-rgb, 46, 230, 182), 0.06); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.25); }
.gb-from { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.55rem; flex-wrap: wrap; }
.gb-from b { color: var(--text-primary); }
.gb-boss, .gb-face { display: inline-flex; flex-shrink: 0; }
.gb-main { display: flex; gap: 0.8rem; align-items: center; }
.gb-name { font-weight: 700; font-size: 1.05rem; }
.gb-job { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.45; }
.gb-job b { color: var(--text-primary); }
.gb-reply { font-size: 0.88rem; margin-top: 0.3rem; }
.gb-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.gb-btn { border-radius: 999px; padding: 0.42rem 0.85rem; font-size: 0.84rem; cursor: pointer; font-weight: 600;
  background: transparent; color: var(--text-primary); border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.35); }
.gb-btn:hover { background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); }
.gb-btn.gb-primary { background: var(--brand, #2ee6b6); color: #05201a; border-color: transparent; }
.gb-btn.gb-primary:hover { filter: brightness(1.08); }
.gb-btn:disabled { opacity: 0.6; cursor: wait; }
.gb-working .gb-job::after { content: ''; display: inline-block; width: 0.9em; animation: gbDots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes gbDots { 0% { width: 0; } 100% { width: 1.2em; } }
@media (max-width: 600px) { .gb-card { max-width: 100%; } .gb-btn { flex: 1 1 auto; text-align: center; } }

/* Spot Bots: daily digest, 👍/👎 learning, gallery, publish */
.bt-inbox-bar { display: flex; gap: 8px; align-items: stretch; }
.bt-inbox-bar .bt-inbox-head { flex: 1; }
.bt-digest-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.bt-digest-btn small { opacity: .65; font-weight: 400; }
.bt-digest-btn.on { border-color: rgba(var(--brand-rgb, 46, 230, 182), .5); }
.bt-digest { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: rgba(148,163,184,.08); }
.bt-digest p { margin: 0 0 8px; font-size: 0.88rem; color: var(--text-secondary); }
.bt-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 0.84rem; color: var(--text-secondary); }
.bt-fb-btn { border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 1rem; }
.bt-fb-btn:hover { background: rgba(var(--brand-rgb, 46, 230, 182), .12); }
.bt-fb-done { color: var(--text-primary); }
.bt-fb-again { background: none; border: 0; color: var(--text-secondary); text-decoration: underline; cursor: pointer; font-size: 0.8rem; }
.bt-fb-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.bt-fb-chip { border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: 0.8rem; }
.bt-fb-chip.on { background: rgba(var(--brand-rgb, 46, 230, 182), .18); border-color: rgba(var(--brand-rgb, 46, 230, 182), .6); color: var(--text-primary); }
.bt-fb-row { display: flex; gap: 6px; width: 100%; }
.bt-fb-note { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; font: inherit; }
.bt-learned { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.bt-learned small { width: 100%; }
.bt-lesson { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; padding: 2px 4px 2px 9px; border-radius: 999px; background: rgba(var(--brand-rgb, 46, 230, 182), .1); }
.bt-lesson button { background: none; border: 0; color: var(--text-secondary); cursor: pointer; font-size: 0.75rem; padding: 0 4px; }
.bt-gal-label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2rem; }
.bt-gal-label small { font-weight: 400; opacity: .65; text-transform: none; letter-spacing: 0; }
.bt-gal-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; }
.bt-gal-cat { border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: var(--text-secondary); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 0.82rem; }
.bt-gal-cat.on { background: var(--brand, #2ee6b6); color: #05201a; border-color: transparent; font-weight: 600; }
.bt-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.9rem; margin-bottom: 2rem; }
.bt-gal-card { display: flex; flex-direction: column; padding: 1rem; border-radius: 18px; border: 1px solid var(--border-color, rgba(148,163,184,.22)); background: rgba(148,163,184,.05); }
.bt-gal-card.pending { border-style: dashed; border-color: rgba(250,204,21,.5); }
.bt-gal-top { display: flex; gap: 0.7rem; align-items: center; }
.bt-gal-top h3 { margin: 0; font-size: 1.05rem; }
.bt-gal-top small { color: var(--text-secondary); font-size: 0.75rem; }
.bt-gal-face { display: inline-flex; flex-shrink: 0; }
.bt-gal-desc { margin: 0.6rem 0; font-size: 0.86rem; color: var(--text-secondary); line-height: 1.45; flex: 1; }
.bt-gal-card .bt-card-tags { justify-content: flex-start; margin-bottom: 0.6rem; }
.bt-gal-card .bt-card-actions { justify-content: flex-start; }
.bt-gal-job { display: flex; gap: 6px; align-items: flex-start; font-size: 0.8rem; margin-bottom: 0.7rem; color: var(--text-secondary); cursor: pointer; }
.bt-gal-pending { font-size: 0.8rem; color: #facc15; margin-bottom: 0.6rem; }
.bt-gal-pending details { color: var(--text-secondary); margin-top: 4px; }
.bt-gal-pending p { margin: 4px 0 0; white-space: pre-wrap; }
.bt-pub-wide { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.bt-pub-wide input, .bt-publish .bt-job-field input:not([type=time]) { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; font: inherit; }
.gb-jobline { margin-top: 0.7rem; padding: 0.55rem 0.7rem; border-radius: 12px; font-size: 0.85rem; background: rgba(var(--brand-rgb, 46, 230, 182), .1); }
.gb-jobline span { color: var(--text-secondary); }
.gb-joberr { background: rgba(248,113,113,.12); }
@media (max-width: 600px) {
  .bt-inbox-bar { flex-direction: column; }
  .bt-gal { grid-template-columns: 1fr; }
  .bt-fb-row { flex-direction: column; }
}
.bt-card .bt-card-actions { flex-wrap: wrap; justify-content: center; }

/* ---------- Live voice chat (voice-live.js) ---------- */
.gx-live { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 42%, rgba(var(--brand-rgb, 46, 230, 182), .16), transparent 55%), #05070b; color: #e8edf3; }
.gx-live.open { display: flex; }
body.gx-live-open { overflow: hidden; }
.gxl-top { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gxl-brand { font-weight: 700; letter-spacing: .02em; }
.gxl-lang { background: rgba(255,255,255,.06); color: inherit; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; }
.gxl-lang option { color: #111; }
.gxl-center { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; width: 100%; max-width: 560px; }
.gxl-orb { position: relative; width: 190px; height: 190px; border: 0; background: none; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.gxl-core { position: absolute; inset: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, var(--brand, #2ee6b6) 28%, var(--brand-2, #14b8a6) 62%, #0b3b37 100%);
  box-shadow: 0 0 60px rgba(var(--brand-rgb, 46, 230, 182), .45); transition: transform .3s; }
.gxl-ring { position: absolute; inset: 20px; border-radius: 50%; border: 2px solid rgba(var(--brand-rgb, 46, 230, 182), .35); opacity: 0; }
.gx-live[data-state="listening"] .gxl-ring { animation: gxlPulse 1.8s ease-out infinite; }
.gx-live[data-state="listening"] .gxl-ring.r2 { animation-delay: .9s; }
.gx-live[data-state="listening"] .gxl-core { animation: gxlBreathe 1.8s ease-in-out infinite; }
.gx-live[data-state="thinking"] .gxl-core { animation: gxlSpin 1.4s linear infinite; background: conic-gradient(from 0deg, var(--brand, #2ee6b6), #6366f1, var(--brand-2, #14b8a6), var(--brand, #2ee6b6)); }
.gx-live[data-state="speaking"] .gxl-core { animation: gxlTalk .45s ease-in-out infinite alternate; }
.gx-live[data-state="idle"] .gxl-core { filter: grayscale(.5) brightness(.75); }
@keyframes gxlPulse { 0% { transform: scale(.85); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes gxlBreathe { 50% { transform: scale(1.06); } }
@keyframes gxlSpin { to { transform: rotate(360deg); } }
@keyframes gxlTalk { from { transform: scale(.96); } to { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .gx-live .gxl-core, .gx-live .gxl-ring { animation: none !important; } }
.gxl-state { font-size: 1.15rem; font-weight: 600; min-height: 1.5em; }
.gxl-you { font-size: 1rem; color: #fff; min-height: 1.4em; max-width: 100%; overflow-wrap: anywhere; }
.gxl-you:not(:empty)::before { content: '“'; } .gxl-you:not(:empty)::after { content: '”'; }
.gxl-ai { font-size: .92rem; color: rgba(232,237,243,.65); max-width: 100%; line-height: 1.45; overflow-wrap: anywhere; }
.gxl-bottom { display: flex; gap: 22px; }
.gxl-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; height: 72px; justify-content: center; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.09); color: #fff; font-size: 1.4rem; }
.gxl-btn span { font-size: .68rem; opacity: .8; }
.gxl-btn.on { background: #f8fafc; color: #111; }
.gxl-end { background: #ef4444; }
.gxl-note { margin: 0; font-size: .72rem; color: rgba(232,237,243,.45); text-align: center; max-width: 420px; }
@media (max-height: 620px) { .gxl-orb { width: 140px; height: 140px; } .gxl-core { inset: 24px; } .gxl-btn { width: 60px; height: 60px; } }

/* ---------- Deep Research ---------- */
.chat-toggle.active#btn-research-toggle { color: #a78bfa; background: rgba(167,139,250,.14); }
.rs-progress { padding: .2rem 0; min-width: min(460px, 100%); }
.rs-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.rs-head small { margin-left: auto; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.rs-steps { list-style: none; margin: .7rem 0 .4rem; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }
.rs-steps li { padding-left: 22px; position: relative; color: var(--text-secondary); overflow-wrap: anywhere; }
.rs-steps li::before { content: '•'; position: absolute; left: 6px; }
.rs-steps li.done { color: var(--text-primary); } .rs-steps li.done::before { content: '✓'; color: var(--brand, #2ee6b6); left: 2px; }
.rs-steps li.now::before { content: '◌'; color: #a78bfa; animation: gxlSpin 1.2s linear infinite; display: inline-block; left: 2px; }
.rs-steps small { color: var(--text-secondary); }
.rs-hosts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rs-hosts span { font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: rgba(148,163,184,.12); }
.rs-note { font-size: .76rem; color: var(--text-secondary); }
.rs-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0 .4rem; padding-top: .8rem; border-top: 1px solid var(--border-color, rgba(148,163,184,.2)); }
.markdown-body a[href]:is([href^="http"]) { overflow-wrap: anywhere; }

/* ---------- Project files ---------- */
.pf-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 1.4rem 1rem; margin: .8rem 0; border-radius: 14px; cursor: pointer;
  border: 2px dashed var(--border-color, rgba(148,163,184,.35)); transition: border-color .2s, background .2s; }
.pf-drop:hover, .pf-drop.over, .pf-drop:focus-visible { border-color: var(--brand, #2ee6b6); background: rgba(var(--brand-rgb, 46, 230, 182), .06); outline: none; }
.pf-drop-icon { font-size: 1.8rem; }
.pf-drop small { color: var(--text-secondary); font-size: .78rem; }
.pf-list { display: flex; flex-direction: column; gap: 6px; }
.pf-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(148,163,184,.08); }
.pf-item > div { flex: 1; min-width: 0; }
.pf-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.pf-item small { color: var(--text-secondary); font-size: .76rem; }
.pf-item.busy small { color: #a78bfa; } .pf-item.err small { color: #f87171; }
.pf-ic { font-size: 1.3rem; }
.pf-empty, .pf-privacy { color: var(--text-secondary); font-size: .82rem; }
.pf-privacy { margin: .9rem 0 0; }

/* ---------- Share a chat ---------- */
.sh-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sh-card { position: relative; width: min(480px, 100%); background: var(--bg-secondary, #12151c); color: var(--text-primary); border: 1px solid var(--border-color, rgba(148,163,184,.2)); border-radius: 20px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.sh-card h3 { margin: 0 0 .4rem; }
.sh-sub { color: var(--text-secondary); font-size: .9rem; margin: 0 0 .8rem; line-height: 1.5; }
.sh-warn { background: rgba(250,204,21,.12); border-radius: 12px; padding: 8px 12px; font-size: .85rem; margin: 0 0 .8rem; }
.sh-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: .9rem; cursor: pointer; }
.sh-link { display: flex; gap: 6px; margin-bottom: .8rem; }
.sh-link input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; font: inherit; font-size: .85rem; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-actions a.ws-btn { text-decoration: none; display: inline-flex; align-items: center; }
.sh-stop { color: #f87171; }
.sh-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--text-secondary); font-size: 1rem; cursor: pointer; }
.bt-gal-pick { box-shadow: 0 0 0 3px var(--brand, #2ee6b6); transition: box-shadow .3s; }

/* ---------- Spot Bots: Needs you, team jobs, team threads ---------- */
.bt-needs { margin: 14px 0; padding: 12px; border-radius: 16px; border: 1px solid rgba(250,204,21,.45); background: rgba(250,204,21,.06); }
.bt-needs-title { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.bt-need { padding: 12px; border-radius: 14px; background: var(--bg-secondary, rgba(148,163,184,.08)); margin-top: 8px; }
.bt-need-head { display: flex; gap: 10px; align-items: center; }
.bt-need-head > div { flex: 1; min-width: 0; }
.bt-need-head small { display: block; color: var(--text-secondary); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-need-x { background: none; border: 0; color: var(--text-secondary); cursor: pointer; }
.bt-need-q { margin: .6rem 0; font-weight: 600; }
.bt-need-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bt-need-input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; font: inherit; }
.bt-need-sum { margin-top: 8px; font-size: .85rem; color: var(--text-secondary); }
.bt-need-act { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-color, rgba(148,163,184,.18)); margin-top: 8px; }
.bt-need-act > div { flex: 1; min-width: 0; }
.bt-need-act details { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; }
.bt-need-act pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; font-size: .78rem; background: rgba(0,0,0,.25); padding: 8px; border-radius: 8px; }
.bt-need-act small { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.bt-need-btns { display: flex; gap: 6px; flex-shrink: 0; }
.bt-need-state { font-size: .85rem; white-space: nowrap; }
.bt-team-link { margin-top: 8px; background: none; border: 0; color: var(--brand, #2ee6b6); cursor: pointer; font: inherit; font-size: .88rem; padding: 0; }
.bt-team-steps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.bt-team-step { display: flex; gap: 6px; align-items: center; }
.bt-team-step select { max-width: 130px; }
.bt-team-step input[data-step-task] { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border-color, rgba(148,163,184,.3)); background: transparent; color: inherit; font: inherit; }
.bt-team-n { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; background: rgba(var(--brand-rgb, 46, 230, 182), .2); flex-shrink: 0; }
.bt-st-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 14px 0 6px; }
.bt-thread { display: flex; flex-direction: column; gap: 10px; }
.bt-thread-step { border-left: 3px solid var(--brand, #2ee6b6); padding-left: 10px; }
.bt-thread-step.err { border-color: #f87171; }
.bt-thread-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bt-thread-who small { color: var(--text-secondary); }
.gb-steps { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.gb-steps li { display: flex; gap: 8px; align-items: center; font-size: .88rem; }
.gb-steps li span:not(.gb-face) { display: block; color: var(--text-secondary); font-size: .82rem; }
.sidebar-item[data-target="bots-view"][data-needs]:not([data-needs=""])::after { content: attr(data-needs); margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #facc15; color: #111; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 600px) { .bt-team-step { flex-wrap: wrap; } .bt-team-step input[data-step-task] { flex-basis: 100%; order: 3; } .bt-need-act { flex-direction: column; } }

/* Spot Bots: control your computer (bots.js openComputer) */
.bt-pc-status { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; font-size: 0.85rem; padding: 0.55rem 0.8rem; margin-bottom: 0.9rem; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text-secondary); }
.bt-pc-status .ws-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.bt-pc-status.on .ws-dot { background: #2ee6b6; box-shadow: 0 0 6px #2ee6b6; }
.bt-pc-status b { color: var(--text-primary); }
.bt-pc-code ol { margin: 0.4rem 0 0.3rem 1.1rem; padding: 0; line-height: 1.6; }
.bt-pc-code code { font-size: 1.15rem; letter-spacing: 0.2em; padding: 0.1rem 0.45rem; border-radius: 6px; background: rgba(46,230,182,0.12); color: var(--text-primary); }
.bt-pc-opts { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.8rem; font-size: 0.8rem; color: var(--text-secondary); }
.bt-pc-opts label { display: flex; flex-direction: column; gap: 0.25rem; }
.bt-pc-opts select { font: inherit; font-size: 0.82rem; padding: 0.35rem 0.5rem; border-radius: 8px; color: var(--text-primary); background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.12); }
.bt-pc-approve { padding: 0.7rem 0.8rem; margin-bottom: 0.8rem; border-radius: 12px; font-size: 0.86rem; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.35); }
.bt-pc-approve div { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.bt-pc-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.bt-pc-controls .ws-btn:disabled { opacity: 0.45; cursor: default; }
.bt-pc-phase { margin-left: auto; font-size: 0.78rem; color: var(--text-secondary); }
.bt-pc-screen { min-height: 260px; display: flex; align-items: center; justify-content: center; border-radius: 12px; overflow: hidden; background: #0b0f16; border: 1px solid rgba(255,255,255,0.1); }
.bt-pc-screen p { color: #9ca3af; font-size: 0.82rem; padding: 1rem; text-align: center; }
.bt-pc-screen img { display: block; width: 100%; height: auto; }
.bt-pc.user-mode .bt-pc-screen { border-color: #2ee6b6; }
.bt-pc.user-mode .bt-pc-screen img { cursor: crosshair; }
.bt-pc-type input { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.85rem; padding: 0.55rem 0.8rem; border-radius: 10px; color: var(--text-primary); background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.12); outline: none; }

/* Chat replies: sub-bullets sit under their numbered step; --- is a thin divider */
.markdown-body ol + ul.md-sub, .markdown-body ul.md-sub { margin-top: -0.4rem; padding-left: 2.6rem !important; list-style: circle; }
.markdown-body hr.md-rule { border: none; height: 1px; background: rgba(255,255,255,0.1); margin: 1rem 0; }
html[data-theme="light"] .markdown-body hr.md-rule { background: rgba(15,23,42,0.12); }

/* Spot Bots: feed cards, watchers, memory switch, "in the app" notes */
.bt-feed-card { display: grid; gap: 4px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: rgba(148,163,184,.08); font-size: 13.5px; }
.bt-card-row { display: grid; grid-template-columns: 20px 140px 1fr; gap: 6px; align-items: baseline; }
.bt-card-row b { font-weight: 600; opacity: .8; }
.bt-card-row div { overflow-wrap: anywhere; }
@media (max-width: 640px) { .bt-card-row { grid-template-columns: 20px 1fr; } .bt-card-row div { grid-column: 2; } }
.bt-watchers { margin: 14px 0; }
.bt-watch { align-items: center; }
.bt-watch > div { flex: 1; min-width: 0; }
.bt-watch small { display: block; opacity: .7; font-size: 12px; overflow-wrap: anywhere; }
.bt-watch a { color: inherit; }
.bt-mem-switch { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 14px; cursor: pointer; }
.bt-mem-app { margin-top: 8px; }
.bt-app-note { display: flex; gap: 10px; align-items: center; margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-color, rgba(148,163,184,.35)); }
.bt-app-note > span { font-size: 20px; }
.bt-app-note small { display: block; opacity: .7; font-size: 12.5px; }

/* Spot Bot Computers ("Hunter's Computer") and "Your computer" */
.bt-pc-screen { position: relative; aspect-ratio: 1280 / 800; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; color: #cbd5e1; margin: 8px 0; }
.bt-pc-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bt-pc-tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }
.bt-pc-steps { max-height: 260px; overflow: auto; display: grid; gap: 4px; margin: 6px 0 10px; }
.bt-pc-step { font-size: 13px; padding: 5px 8px; border-radius: 8px; background: rgba(148,163,184,.08); overflow-wrap: anywhere; }
.bt-pc-step small { opacity: .6; margin-right: 4px; }
.bt-pc-step.err { color: var(--danger, #f87171); }
.bt-yp-switch { font-size: 15px; margin-top: 8px; }
.bt-yp-rules { margin: 6px 0 10px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; opacity: .9; }

/* Spot Bots tool icons (tool-icons.js): line icons in the teal accent */
.tool-ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; color: rgb(var(--brand-rgb, 46, 230, 182)); }
.bt-card-tags .tool-ic { width: 15px; height: 15px; opacity: 0.85; }

/* Pause All, Weekly report */
.bt-pause-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.bt-pause-btn.on { border-color: rgba(var(--brand-rgb, 46, 230, 182), 0.6); background: rgba(var(--brand-rgb, 46, 230, 182), 0.12); }
.bt-paused-note { display: flex; gap: 0.7rem; align-items: center; margin: 0.6rem 0; padding: 0.75rem 0.9rem; border-radius: 12px;
    border: 1px solid rgba(var(--brand-rgb, 46, 230, 182), 0.45); background: rgba(var(--brand-rgb, 46, 230, 182), 0.07); }
.bt-paused-note[hidden] { display: none; }
.bt-paused-note .tool-ic { width: 20px; height: 20px; }
.bt-paused-note small { display: block; opacity: 0.75; }
.bt-wk-preview { margin-top: 0.7rem; padding: 0.8rem; border-radius: 10px; background: rgba(127, 127, 127, 0.08); max-height: 360px; overflow: auto; font-size: 0.86rem; }
.bt-digest-btn .tool-ic { margin-right: 0.2rem; }

/* Genexts Build: screenshots for the Code Agent */
.cv-attach { flex: none; align-self: center; display: inline-flex; padding: 0.5rem; background: none; border: 0; border-radius: 8px; color: var(--text-secondary); cursor: pointer; }
.cv-attach[hidden], .cv-shots[hidden] { display: none; }
.cv-attach:hover { color: var(--text-primary); background: rgba(127,127,127,0.12); }
.cv-shots { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 0.25rem 0.5rem; }
.cv-shot { position: relative; display: inline-block; }
.cv-shot img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(127,127,127,0.35); }
.cv-shot button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: #111; color: #fff; cursor: pointer; line-height: 1; }
.cv-shot-sent { display: block; max-width: 220px; margin-top: 0.5rem; border-radius: 8px; }
