/* ====================================================
   ANTIGRAVITY 2.0 - EXACT 1:1 DESKTOP & BARD MOBILE THEME
   - Strict 100vw viewport lock (zero horizontal sliding/overflow)
   - Soft word-wrapping for code and terminal blocks
   - Gemini / Bard mobile responsive chat feed & sticky prompt
   ==================================================== */

:root {
  /* Exact Reference Matte Dark Charcoal Palette */
  --bg-app: #181818;
  --bg-sidebar: #131313;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
  --bg-sidebar-active: rgba(255, 255, 255, 0.08);
  --bg-chat: #181818;
  --bg-user-bubble: #222222;
  --bg-prompt-card: #202020;
  --bg-pill: #282828;
  --bg-pill-hover: #333333;
  --bg-terminal-box: #121212;
  --bg-modal: #1c1c1c;
  --bg-sheet: #191919;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.25);
  --border-pill: rgba(255, 255, 255, 0.1);

  --accent-purple: #c084fc;
  --accent-purple-hover: #d8b4fe;
  --accent-purple-dim: rgba(192, 132, 252, 0.15);
  --accent-purple-glow: rgba(192, 132, 252, 0.25);

  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #38bdf8;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --diff-add: #34d399;
  --diff-del: #f87171;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100dvh;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* Antigravity 2.0 Custom Dark Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(157, 114, 255, 0.4);
}

/* Strict Viewport Lock & Mobile Keyboard Docking */
html, body {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden !important;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y;
}

/* Base SVG icon enforcement */
svg {
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}

.lucide-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none !important;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.app-root {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-app);
  overflow: hidden !important;
}

/* ----------------------------------------------------
   RIGHT SLIDE-IN FILE & ARTIFACT INSPECTOR DRAWER
   ---------------------------------------------------- */
.inspector-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 450;
  transition: opacity 0.2s ease;
}

.inspector-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.file-inspector-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  height: var(--app-height, 100dvh);
  background: #141414;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  z-index: 500;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.file-inspector-drawer.open {
  transform: translateX(0);
}

.inspector-header {
  height: calc(48px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 14px;
  padding-right: 14px;
  background: #181818;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.inspector-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.inspector-file-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

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

.inspector-close-btn:hover {
  color: #ffffff;
}

.inspector-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #111111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.inspector-file-path {
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.inspector-diff-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.inspector-content-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
  background: #0f0f0f;
  white-space: pre-wrap;
  word-break: break-word;
}

.inspector-code-line {
  display: flex;
  gap: 12px;
}

.inspector-line-num {
  color: #52525b;
  user-select: none;
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.inspector-line-text {
  flex: 1;
  word-break: break-all;
}

/* Inspector Image Viewer */
.inspector-image-view-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px;
  width: 100%;
}

.inspector-image-frame {
  width: 100%;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090909;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: 8px;
}

.inspector-image-element {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.inspector-image-meta {
  width: 100%;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-row strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.inspector-btn-action {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent-purple);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.inspector-btn-action:hover {
  background: var(--accent-purple-hover);
}

.file-diff-row {
  cursor: pointer !important;
  transition: background 0.15s ease, transform 0.1s ease;
  padding: 4px 6px !important;
  border-radius: 4px;
  display: inline-flex !important;
}

.file-diff-row:hover, .file-diff-row:active {
  background: rgba(255, 255, 255, 0.08);
}

/* ----------------------------------------------------
   SIDEBAR & NAVIGATION
   ---------------------------------------------------- */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.app-sidebar {
  width: 260px;
  max-width: 80vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 300;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.75);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-header {
  padding: calc(14px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo-brand {
  display: flex;
  align-items: center;
  color: var(--text-primary);
}

.brand-asterisk-icon {
  color: var(--text-primary);
}

.sidebar-panel-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-panel-toggle-btn:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: none;
  padding: 4px;
}

@media (max-width: 768px) {
  .sidebar-close-btn {
    display: block;
  }
}

.sidebar-top-actions {
  padding: calc(12px + var(--safe-top)) 12px 8px;
}

.new-convo-btn-primary {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.new-convo-btn-primary:hover, .new-convo-btn-primary:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  gap: 1px;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item-btn:hover, .nav-item-btn:active {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.sidebar-scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 12px;
}

.sidebar-section {
  padding: 6px 8px 0;
  display: flex;
  flex-direction: column;
}

.section-title-plain {
  padding: 6px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease;
}

.section-title-plain:hover {
  color: var(--text-primary);
}

.section-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .conversations-tree {
  display: none;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.section-action-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.section-action-icon-btn:hover {
  color: var(--text-primary);
}

.conversations-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.convo-pinned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.convo-pinned-item:hover, .convo-pinned-item:active {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.convo-pinned-item.active {
  background: #23232c;
  color: #ffffff;
  font-weight: 500;
}

.convo-pinned-title-box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 1px;
}

.convo-pinned-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}

.convo-pinned-workspace {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.projects-nested-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-folder-group {
  display: flex;
  flex-direction: column;
}

.project-folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.project-folder-header:hover {
  color: var(--text-primary);
  background: var(--bg-sidebar-hover);
}

.folder-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}

.project-folder-group.collapsed .folder-chevron {
  transform: rotate(-90deg);
}

.project-folder-group.collapsed .project-nested-items,
.project-folder-group.collapsed .project-folder-empty-note {
  display: none;
}

.folder-count-pill {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.project-folder-empty-note {
  padding: 4px 8px 4px 28px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.project-nested-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 12px;
  margin-top: 1px;
}

.project-nested-convo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.project-nested-convo-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.project-nested-convo-item.active {
  background: #23232c;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
}

.project-nested-convo-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Sidebar Live Running Badges */
.sidebar-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-live-badge.running {
  color: #d8b4fe;
  background: rgba(192, 132, 252, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.25);
}

.sidebar-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 6px #c084fc;
  animation: sidebar-live-pulse 1.3s infinite ease-in-out;
}

@keyframes sidebar-live-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #c084fc;
  }
  50% {
    opacity: 0.35;
    transform: scale(0.75);
    box-shadow: 0 0 2px #c084fc;
  }
}

.sidebar-live-badge.active {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-active-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
}

/* Project Folder Live Indicator */
.folder-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1.5px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
  margin-right: 4px;
}

.folder-live-pill.running {
  color: #d8b4fe;
  background: rgba(192, 132, 252, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.2);
}

/* Active running item row glow */
.convo-pinned-item.is-working,
.project-nested-convo-item.is-working {
  border-left: 2px solid #c084fc;
  background: rgba(192, 132, 252, 0.08);
}

.more-dots-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0 4px;
}

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

.convo-age {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.status-dot-purple {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-purple);
  box-shadow: 0 0 6px var(--accent-purple-glow);
  flex-shrink: 0;
}

.status-spinner-svg {
  width: 12px;
  height: 12px;
  color: var(--accent-purple);
  animation: spin 1.2s linear infinite;
  flex-shrink: 0;
}

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

.sidebar-footer {
  padding: 8px 8px calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

/* ----------------------------------------------------
   MAIN CHAT & TOP HEADER
   ---------------------------------------------------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  overflow-x: hidden !important;
  overflow-y: hidden;
  background: var(--bg-chat);
  position: relative;
}

.app-header {
  height: calc(48px + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 14px;
  padding-right: 14px;
  background: var(--bg-chat);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
  max-width: 100vw;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.bc-workspace {
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

.bc-sep {
  color: var(--text-muted);
  flex-shrink: 0;
}

.bc-title {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-emerald);
  transition: all 0.2s ease;
}

.live-badge.running {
  background: rgba(192, 132, 252, 0.15);
  border-color: rgba(192, 132, 252, 0.4);
  color: var(--accent-purple);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.live-badge.running .live-dot {
  background: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple);
  animation: live-pulse-dot 1.2s infinite ease-in-out;
}

@keyframes live-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

.user-cmd-header {
  margin-bottom: 4px;
}

.slash-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slash-badge.goal {
  background: rgba(192, 132, 252, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #d8b4fe;
}

.slash-badge.schedule {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.slash-badge.browser {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.slash-badge.generic {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.open-ide-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.open-ide-btn:hover, .open-ide-btn:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-purple);
}

/* ----------------------------------------------------
   CHAT CANVAS & BARD MOBILE RESPONSIVE MESSAGES
   Strictly zero horizontal overflow sliding
   ---------------------------------------------------- */
.chat-canvas {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden !important;
  overflow-anchor: auto !important;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(105px + var(--keyboard-safe-bottom, var(--safe-bottom))) 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  touch-action: pan-y;
}

.messages-container {
  display: flex;
  flex-direction: column;
  min-height: min-content;
  gap: 14px;
  max-width: 820px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  overflow-x: hidden !important;
}

/* Bard / Gemini Style User Prompt Bubble (Right-aligned, soft pill, word-wrapped) */
.user-msg-box {
  background: var(--bg-user-bubble);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  font-size: 14px;
  color: #f1f5f9;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  align-self: flex-end;
  max-width: 88%;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: cardFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

@media (min-width: 769px) {
  .user-msg-box {
    max-width: 75%;
    align-self: flex-end;
  }
}

.user-text {
  color: #f1f5f9;
  font-size: 14px;
  line-height: 1.5;
}

.delivery-tag {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
  margin-top: 2px;
}

/* Antigravity Assistant Response Card */
.agent-response-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  align-self: flex-start;
  animation: cardFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.assistant-header-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: 2px;
}

.active-working-card {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #222222 !important;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.3) !important;
  animation: pulseCard 1.8s infinite ease-in-out;
}

@keyframes pulseCard {
  0%, 100% { border-color: rgba(157, 114, 255, 0.3); }
  50% { border-color: rgba(157, 114, 255, 0.8); }
}

.live-pulse-pill {
  color: #c084fc;
}

.pulse-spin {
  animation: spinSlow 1s linear infinite;
  color: #c084fc;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.action-text {
  font-weight: 400;
  color: #e2e8f0;
}

.turn-tools-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
  width: 100%;
}

.file-diff-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12.5px;
}

/* Activity Stream Box (Full Width, Contained) */
.activity-stream-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  align-self: flex-start;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  width: 100%;
  max-width: 100%;
  padding: 2px 0;
  flex-wrap: wrap;
  word-break: break-word;
}

.activity-row > span:first-child {
  flex-shrink: 0;
}

.activity-row.thought {
  color: var(--text-muted);
}

.activity-row .chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 2px;
}

.activity-row.expanded .chevron {
  transform: rotate(90deg);
}

/* File edit badges */
.badge-ext {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-ext.js { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-ext.html { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-ext.css { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-ext.json { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-ext.generic { background: rgba(255, 255, 255, 0.1); color: #cbd5e1; }

.file-name-bold {
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-all;
  max-width: 100%;
}

.diff-add-tag {
  color: var(--diff-add);
  font-size: 12px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.diff-del-tag {
  color: var(--diff-del);
  font-size: 12px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* Terminal execution box (Soft Word-Wrap, No Screen Sliding) */
.terminal-execution-box {
  background: var(--bg-terminal-box);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 4px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  overflow-x: hidden !important;
}

.formatted-reasoning-box {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  background: #141414 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #d4d4d8 !important;
}

.reasoning-step-heading {
  color: #c084fc;
  font-weight: 600;
  font-size: 12.5px;
  margin-top: 8px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reasoning-step-heading:first-child {
  margin-top: 0;
}

.reasoning-gap {
  height: 6px;
}

.terminal-prompt-line {
  color: #94a3b8;
  margin-bottom: 4px;
  word-break: break-all;
}

.terminal-prompt-line .dollar {
  color: var(--accent-purple);
}

/* Final Assistant Markdown (Fluid, Word-Wrapped) */
.agent-final-response {
  color: var(--text-primary);
  width: 100%;
}

/* ----------------------------------------------------
   NATIVE ANTIGRAVITY MARKDOWN & CODE HIGHLIGHTER
   Exact match to native Antigravity IDE UI
   ---------------------------------------------------- */
.md-body {
  font-size: 14px;
  line-height: 1.65;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
  color: #ffffff;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
  line-height: 1.35;
}

.md-body h1 { font-size: 18px; }
.md-body h2 { font-size: 16px; }
.md-body h3 { font-size: 14.5px; }
.md-body h4 { font-size: 13.5px; color: #cbd5e1; }

.md-body p {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.md-body ul, .md-body ol {
  margin-left: 20px;
  margin-bottom: 12px;
  padding-left: 0;
}

.md-list-item-numbered,
.md-list-item-bullet {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0;
  line-height: 1.6;
  color: var(--text-primary);
}

.md-list-item-numbered.indent-1,
.md-list-item-bullet.indent-1 {
  margin-left: 22px;
}

.md-list-item-numbered.indent-2,
.md-list-item-bullet.indent-2 {
  margin-left: 44px;
}

.list-num-badge {
  font-weight: 600;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  min-width: 18px;
  flex-shrink: 0;
}

.list-bullet-dot {
  color: #64748b;
  font-size: 14px;
  min-width: 12px;
  flex-shrink: 0;
  line-height: 1;
}

.list-num-content,
.list-bullet-content {
  flex: 1;
  word-break: break-word;
}

.md-para {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text-primary);
}

.md-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  margin: 18px 0;
  width: 100%;
}

/* Markdown Tables */
.md-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 16px 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 26, 0.7);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: left;
}

.md-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: #f8fafc;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.md-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.md-table tr:last-child td {
  border-bottom: none;
}

/* Markdown Inline Code (Boxless, Natural Monospace) */
.md-inline-code,
.md-body code,
code {
  font-family: 'JetBrains Mono', monospace;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  font-size: 13px;
  font-weight: 500;
  color: #f59e0b !important;
  display: inline !important;
  word-break: break-word;
}

/* Native Antigravity Code Block Card */
.code-block-card {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #14141e;
  overflow: hidden;
  margin: 12px 0 16px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

.code-lang-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 8px;
  border-radius: 4px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

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

.code-action-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.code-action-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.code-block-content {
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Syntax Highlighting Colors */
.syn-comment { color: #64748b; font-style: italic; }
.syn-keyword { color: #f59e0b; font-weight: 600; }
.syn-flag { color: #38bdf8; }
.syn-string { color: #34d399; }
.syn-number { color: #c084fc; }

/* Turn Review Bar & Metadata Footer (Screenshot 2 Match) */
.turn-review-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 14px;
  font-size: 12.5px;
}

.turn-review-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.turn-review-left:hover {
  color: var(--text-primary);
}

.turn-review-left .diff-add { color: var(--diff-add); font-weight: 600; font-family: var(--font-mono); }
.turn-review-left .diff-del { color: var(--diff-del); font-weight: 600; font-family: var(--font-mono); }

.turn-review-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.turn-review-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.turn-metadata-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

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

.turn-action-icon {
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.turn-action-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.agent-final-response th {
  background: rgba(255, 255, 255, 0.04);
}

/* ----------------------------------------------------
   GEMINI / BARD STICKY FLOATING PROMPT BAR
   ---------------------------------------------------- */
.prompt-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 14px calc(6px + var(--keyboard-safe-bottom, var(--safe-bottom))) 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to top, var(--bg-chat) 75%, transparent 100%);
  flex-shrink: 0;
  z-index: 150;
  width: 100%;
  max-width: 100vw;
  pointer-events: auto;
}

/* Slash Commands Autocomplete Popup */
.slash-commands-popup {
  width: 100%;
  max-width: 820px;
  margin-bottom: 8px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.6);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.slash-commands-popup.hidden {
  display: none !important;
}

.slash-popup-header {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.slash-command-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

.slash-command-item:hover, .slash-command-item.selected, .slash-command-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.slash-cmd-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
}

.slash-cmd-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.desktop-prompt-card {
  pointer-events: auto;
  background: var(--bg-prompt-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  max-width: 820px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.desktop-prompt-card:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.attached-images-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.attached-img-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.attached-img-chip img {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  object-fit: cover;
}

.attached-img-chip .remove-img-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  display: flex;
  align-items: center;
}

.attached-img-chip .remove-img-btn:hover {
  color: #ff5555;
}

.chat-embedded-image-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-embedded-image {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
}

.chat-image-caption {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  font-style: italic;
}

#main-prompt-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
}

#main-prompt-input::placeholder {
  color: var(--text-muted);
}

.prompt-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background 0.15s ease, color 0.15s ease;
}

.ctrl-icon-btn:hover, .ctrl-icon-btn:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.header-icon-square-btn {
  width: 30px;
  height: 30px;
  background: var(--bg-prompt-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-icon-square-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-welcome-search {
  max-width: 680px;
  width: 100%;
  margin: 32px auto 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-sublabel {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 26px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.search-suggestions-shelf {
  max-width: 680px;
  width: 100%;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.suggestion-row svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.suggestion-row:hover, .suggestion-row:active {
  background: var(--bg-prompt-card);
  color: var(--text-primary);
}

.suggestion-row:hover svg {
  color: var(--text-primary);
}

.floating-customize-pill {
  position: fixed;
  bottom: calc(14px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-prompt-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 160;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.floating-customize-pill:hover {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.25);
}

.prompt-mode-pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prompt-mode-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.model-picker-trigger-exact {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: background 0.15s ease;
}

.model-picker-trigger-exact:hover {
  background: rgba(255, 255, 255, 0.05);
}

.soundwave-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-purple, #c084fc);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #121212;
  box-shadow: 0 2px 8px rgba(192, 132, 252, 0.4);
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.soundwave-circle-btn:hover {
  background: #d8b4fe;
  box-shadow: 0 4px 14px rgba(192, 132, 252, 0.6);
  transform: scale(1.05);
}

.soundwave-circle-btn:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .prompt-footer {
    padding: 4px 8px calc(4px + var(--keyboard-safe-bottom, var(--safe-bottom))) 8px;
  }
  .desktop-prompt-card {
    padding: 8px 10px;
    border-radius: 14px;
    gap: 6px;
  }
  #main-prompt-input {
    font-size: 16px;
    max-height: 80px;
    line-height: 1.35;
  }
  .prompt-controls-row {
    gap: 4px;
  }
  .model-picker-trigger-exact {
    max-width: 140px;
    font-size: 11px;
    padding: 2px 4px;
  }
  .soundwave-circle-btn {
    width: 28px;
    height: 28px;
  }
  .soundwave-circle-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* ----------------------------------------------------
   BOTTOM ACTION SHEET & MODALS
   ---------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.bottom-action-sheet {
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 550px;
  padding: 10px 14px calc(14px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideUpSheet 0.25s ease-out;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  align-self: center;
}

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

.sheet-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

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

.model-option-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s ease;
}

.model-option-card:hover, .model-option-card:active {
  background: var(--bg-sidebar-hover);
}

.model-option-card.selected {
  background: rgba(157, 114, 255, 0.15);
}

.option-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-title-row strong {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.badge-effort {
  font-size: 11px;
  color: var(--text-muted);
}

.badge-fast {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  color: #cbd5e1;
}

.option-check {
  font-size: 14px;
  color: var(--accent-purple);
}

/* Modals */
.antigravity-modal {
  border: none;
  background: transparent;
  margin: auto;
  max-width: 90vw;
  width: 550px;
}

.antigravity-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
}

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

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

.modal-term-presets {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.term-chip {
  background: var(--bg-sidebar-hover);
  border: 1px solid var(--border-subtle);
  color: #93c5fd;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.modal-term-screen {
  background: #090a12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px;
  height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a7f3d0;
  white-space: pre-wrap;
}

.modal-term-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-term-input-row input {
  flex: 1;
  background: #090a12;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  outline: none;
}

.modal-term-run-btn {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  cursor: pointer;
}

/* Toast Shelf */
.toast-shelf {
  position: fixed;
  top: calc(52px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: rgba(30, 32, 50, 0.95);
  border: 1px solid var(--border-active);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  animation: toastFade 0.2s ease-out;
}

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

/* ====================================================
   HARDENED PIN SECURITY LOCK OVERLAY
   ==================================================== */
.pin-lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(8, 9, 14, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lockFadeIn 0.25s ease-out;
}

.pin-lock-overlay.hidden {
  display: none !important;
}

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

.pin-lock-card {
  background: #121420;
  border: 1px solid rgba(167, 139, 250, 0.25);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 32px rgba(124, 58, 237, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 340px;
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.pin-lock-card.shake {
  animation: lockShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes lockShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.pin-lock-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #a78bfa;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.pin-lock-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}

.pin-lock-subtitle {
  color: #94a3b8;
  font-size: 13px;
  margin: 0 0 24px;
  line-height: 1.4;
}

.pin-dots-container {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background: #a78bfa;
  border-color: #c4b5fd;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.6);
  transform: scale(1.15);
}

.pin-error-banner {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
  width: 100%;
  line-height: 1.35;
}

.pin-error-banner.hidden {
  display: none !important;
}

.pin-attempts-badge {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 20px;
  letter-spacing: 0.2px;
}

.pin-attempts-badge.warning {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
}

.pin-attempts-badge.danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

#pin-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.pin-key {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  font-family: inherit;
  height: 54px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:active {
  background: rgba(167, 139, 250, 0.25);
  border-color: #a78bfa;
  transform: scale(0.94);
}

.pin-key-action {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.pin-key-action:active {
  color: #ffffff;
}
