/* ==========================================================================
   Iris Application Stylesheet — Exact Reference Design
   Pixel-accurate recreation matching modern high-end AI workstations.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-canvas: #161618;
  --bg-sidebar: #121214;
  --bg-input: #212124;
  --bg-input-hover: #26262a;
  --bg-card: #1c1c1f;
  --bg-card-hover: #232327;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-input: #2e2e33;
  --border-focus: #44444c;
  --text-main: #f0f0f2;
  --text-muted: #8e8e93;
  --text-dim: #5c5c62;
  --accent-coral: #e07a5f;
  --accent-green: #34d399;
  --accent-iris: #6366f1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --font-serif: 'Newsreader', 'Georgia', 'Playfair Display', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
}

#app-root {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  user-select: none;
  z-index: 30;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  padding: 12px 14px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.window-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 4px 2px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-new-chat {
  background-color: #26262a;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  height: 38px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.btn-new-chat:hover {
  background-color: #2e2e33;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Navigation Menu Items */
.sidebar-nav-menu {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 400;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s ease;
}

.nav-link-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-link-btn.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 500;
}

.nav-link-btn svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

.nav-link-btn:hover svg, .nav-link-btn.active svg {
  color: var(--text-main);
}

/* Sidebar Scrollable Section (Pinned & Recents) */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 4px 10px;
  cursor: pointer;
  text-transform: capitalize;
}

.section-label-row:hover {
  color: var(--text-muted);
}

.chat-thread-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
}

.thread-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.thread-nav-item.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 500;
}

.thread-nav-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar Footer Profile */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sidebar-footer:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2e2e33;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.user-tag {
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   Main Content Canvas
   ========================================================================== */
.main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: var(--bg-canvas);
  overflow: hidden;
}

/* Top Right Navigation Header */
.canvas-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  z-index: 20;
}

.brand-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.brand-badge-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.brand-badge-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Center View / Chat Launcher (Exact Reference Layout)
   ========================================================================== */
.center-content-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px 20px;
}

.hero-greeting-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  margin-top: 10px;
}

.coral-spark-icon {
  color: var(--accent-coral);
  font-size: 26px;
  display: inline-block;
  line-height: 1;
}

.hero-greeting-text {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* Dedicated Chat Box (Center) */
.central-chat-box {
  width: 100%;
  max-width: 680px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-lg);
  padding: 14px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.central-chat-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.central-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 48px;
  max-height: 180px;
}

.central-textarea::placeholder {
  color: var(--text-dim);
}

.chat-box-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-attach-plus {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 400;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-attach-plus:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.right-input-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-input-tool {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-input-tool:hover {
  color: var(--text-main);
}

/* Model Selector Row Immediately Below Chat Box */
.sub-chat-bar {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0 2px;
}

.project-folder-dropdown {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
  user-select: none;
}

.project-folder-dropdown:hover {
  color: var(--text-main);
}

.sub-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.model-presence-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.model-presence-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.green-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.mode-badge {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   Recent Artifacts Cards (Exact Reference Grid)
   ========================================================================== */
.artifacts-section {
  width: 100%;
  max-width: 680px;
  margin-top: 50px;
}

.artifacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.artifacts-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.artifacts-view-all {
  font-size: 12.5px;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
}

.artifacts-view-all:hover {
  color: var(--text-main);
}

.artifacts-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.artifact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.artifact-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.artifact-thumbnail {
  height: 90px;
  background: #252528;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.thumb-doc {
  background: #ffffff;
  color: #111;
  width: 85%;
  height: 90%;
  border-radius: 3px;
  padding: 6px;
  font-size: 8px;
  line-height: 1.3;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.thumb-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}

.thumb-folder {
  width: 85%;
  height: 85%;
  background: #1b2028;
  border: 1px solid #2d3748;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
}

.artifact-details {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.artifact-card-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-card-time {
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   Active Conversation Stream View
   ========================================================================== */
.conversation-view {
  width: 100%;
  max-width: 720px;
  display: none;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}

.message-card {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: 14.5px;
}

.message-card.user {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  align-self: flex-end;
  max-width: 85%;
}

.message-card.assistant {
  background-color: transparent;
  align-self: flex-start;
  width: 100%;
  padding-left: 0;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.message-author {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-metrics {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.message-body pre {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 12px 0;
  overflow: hidden;
}

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

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
}

.copy-btn:hover {
  color: var(--text-main);
}

.code-content {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #e2e8f0;
  overflow-x: auto;
}

/* ==========================================================================
   Modals & Drawers (Search, Projects, Scheduled, Settings)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.search-input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14.5px;
  outline: none;
}

.search-results-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* System Settings Slide-Over Drawer */
.settings-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  height: 100%;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 90;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 18px;
  overflow-y: auto;
}

.settings-drawer.open {
  right: 0;
}

/* Model Dropdown Popover */
.model-dropdown-menu {
  position: absolute;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 280px;
  padding: 6px;
  z-index: 50;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.model-dropdown-menu.open {
  display: flex;
}

.model-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-main);
}

.model-option-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.model-option-item.active {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--accent-iris);
  font-weight: 500;
}

/* ==========================================================================
   Floating Dock & Attachment Chips
   ========================================================================== */
.floating-dock-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px 24px 20px;
  background: linear-gradient(180deg, rgba(22, 22, 24, 0) 0%, rgba(22, 22, 24, 0.95) 40%, rgba(22, 22, 24, 1) 100%);
  pointer-events: none;
  z-index: 25;
}

.floating-dock-container > * {
  pointer-events: auto;
}

.chat-attachment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11.5px;
  color: var(--text-main);
  animation: fadeIn 0.15s ease;
}

.attachment-chip .chip-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
}

.attachment-chip .chip-remove-btn:hover {
  color: #ff6b6b;
}

.send-btn {
  background-color: var(--text-main);
  color: var(--bg-canvas);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

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

.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-green {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-yellow {
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (Phone Support)
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
}

/* ==========================================================================
   Responsive (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    left: -260px;
    top: 0;
    bottom: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.6);
  }
  .sidebar.open {
    left: 0;
  }
  .artifacts-cards-grid {
    grid-template-columns: 1fr;
  }
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
    z-index: 40;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    cursor: pointer;
    padding: 6px;
  }
  .mobile-nav-item.active {
    color: var(--accent-iris);
  }
  .floating-dock-container {
    bottom: 58px;
  }
}

/* ==========================================================================
   Live Voice Orb, Wave Bars & Thinking Box
   ========================================================================== */
.voice-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, #6366f1 0%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.6);
  animation: pulseOrb 2.5s infinite ease-in-out;
}

@keyframes pulseOrb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(99, 102, 241, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 45px rgba(99, 102, 241, 0.85); }
}

.voice-wave-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  margin-top: 6px;
}

.voice-wave-bars span {
  width: 4px;
  height: 8px;
  background: var(--accent-iris);
  border-radius: 2px;
  animation: waveBar 1.2s infinite ease-in-out;
}

.voice-wave-bars span:nth-child(2) { animation-delay: 0.15s; }
.voice-wave-bars span:nth-child(3) { animation-delay: 0.3s; }
.voice-wave-bars span:nth-child(4) { animation-delay: 0.45s; }
.voice-wave-bars span:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

/* Mic Active Pulse */
.btn-input-tool.recording-active {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15);
  animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Thinking Box Collapsible */
.thinking-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.thinking-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-iris);
  font-size: 12px;
  letter-spacing: 0.02em;
  user-select: none;
  outline: none;
  margin-bottom: 8px;
}

/* Remove any legacy coral spark references */
.coral-spark-icon {
  display: none !important;
}

/* ========================================================================= */
/* FUTURISTIC NEURAL MOTION GRAPHICS CANVAS                                  */
/* ========================================================================= */
.neural-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  transition: opacity 0.5s ease;
}

#app-root {
  position: relative;
  z-index: 1;
}

/* ========================================================================= */
/* HEADER ACTION BUTTONS (VISION, BYOK, AUTH)                                */
/* ========================================================================= */
.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

.btn-vision {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.btn-vision:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.vision-spark {
  color: #818cf8;
  font-size: 13px;
  animation: sparkGlow 2.5s infinite ease-in-out;
}

@keyframes sparkGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px #818cf8); }
}

.btn-byok {
  position: relative;
}

.byok-badge {
  font-size: 9.5px;
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 2px;
}

.btn-auth {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-auth:hover {
  border-color: var(--accent-iris);
  color: var(--text-main);
}

/* ========================================================================= */
/* UPGRADED ARTIFACT VIEWER                                                  */
/* ========================================================================= */
.artifact-tab-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.artifact-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.artifact-tab-btn.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.artifact-rendered-view {
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
}

.artifact-rendered-view h1,
.artifact-rendered-view h2,
.artifact-rendered-view h3 {
  color: #ffffff;
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 700;
}

.artifact-rendered-view h1 { font-size: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
.artifact-rendered-view h2 { font-size: 16px; color: #a5b4fc; }
.artifact-rendered-view h3 { font-size: 14px; }

.artifact-rendered-view p {
  margin-bottom: 12px;
}

.artifact-rendered-view table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 12.5px;
}

.artifact-rendered-view th,
.artifact-rendered-view td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  text-align: left;
}

.artifact-rendered-view th {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  font-weight: 600;
}

.artifact-rendered-view code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #38bdf8;
}

.artifact-rendered-view pre {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 14px 0;
}

.artifact-rendered-view pre code {
  background: transparent;
  padding: 0;
  color: #f8fafc;
}

.artifact-rendered-view ul,
.artifact-rendered-view ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.artifact-rendered-view li {
  margin-bottom: 4px;
}

/* ========================================================================= */
/* FOUNDER'S VISION MODAL                                                    */
/* ========================================================================= */
.vision-icon-glow {
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  display: flex;
}

.vision-quote-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(168,85,247,0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-left: 4px solid var(--accent-iris);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 20px;
}

.vision-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

@media (max-width: 680px) {
  .vision-pillars-grid {
    grid-template-columns: 1fr;
  }
}

.vision-pillar-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.pillar-number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-iris);
  margin-bottom: 6px;
}

.pillar-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.pillar-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ========================================================================= */
/* BYOK KEYS MODAL                                                           */
/* ========================================================================= */
.byok-keys-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .byok-keys-grid {
    grid-template-columns: 1fr;
  }
}

.byok-key-card {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.byok-provider-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.byok-models-tag {
  font-size: 10.5px;
  color: var(--text-dim);
}

.byok-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.byok-key-input {
  width: 100%;
  padding-right: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.byok-toggle-vis {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  border-radius: 4px;
}

.byok-toggle-vis:hover {
  color: var(--text-main);
}

/* ========================================================================= */
/* AUTH MODAL TABS                                                           */
/* ========================================================================= */
.auth-tabs-row {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ========================================================================= */
/* ASSISTANT CARD AUDIO / TTS BUTTON                                         */
/* ========================================================================= */
.btn-speak-msg {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.btn-speak-msg:hover {
  color: var(--accent-iris);
  background: rgba(99, 102, 241, 0.1);
}

/* ========================================================================= */
/* CUSTOM APIS SECTION STYLING                                               */
/* ========================================================================= */
.btn-custom-apis {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}

.btn-custom-apis:hover {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.5);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25);
}

.custom-api-pill-badge {
  font-size: 10px;
  background: rgba(14, 165, 233, 0.25);
  color: #bae6fd;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.api-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.api-preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.api-preset-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.custom-api-form-card {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 16px;
}

.custom-apis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 680px) {
  .custom-apis-grid {
    grid-template-columns: 1fr;
  }
}

.custom-api-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.custom-api-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.custom-api-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.custom-api-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.custom-api-url-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.custom-api-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  margin-top: 4px;
}

