/* ==========================================================================
   GHOST-RELAY WORKBENCH
   High-craft, authentic developer console.
   ========================================================================== */

:root {
  --bg-root: #08090c;
  --bg-panel: #0d0f14;
  --bg-surface: #12151c;
  --bg-surface-elevated: #161a24;
  --bg-surface-active: #1e2330;
  --bg-thinking: #0c0d14;

  --border: #1e222e;
  --border-subtle: #161922;
  --border-focus: #384257;

  --text-primary: #e6edf3;
  --text-secondary: #949fad;
  --text-muted: #737c89;
  --text-dim: #49505c;

  --accent-cyan: #38bdf8;
  --accent-green: #34d399;
  --accent-purple: #c084fc;
  --accent-blue: #60a5fa;

  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-roboto: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html,
body {
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-root);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.workbench {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  min-height: 100dvh;
}

/* ---------------- NAVBAR ---------------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 16px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 2px 8px 2px 4px;
  border-radius: 6px;
}

.brand-logo-img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.prompt-sign {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 13px;
}

.nav-title {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav-divider {
  color: var(--text-dim);
}

.nav-sub {
  color: var(--text-muted);
  font-size: 11.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-settings-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-settings-btn:active {
  transform: translateY(0) scale(0.97);
}

.nav-divider-vertical {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.relay-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

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

/* ---------------- BODY SPLIT ---------------- */
.stage-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 44px);
}

.config-panel {
  width: var(--sidebar-width, 260px);
  min-width: 180px;
  max-width: 600px;
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Sidebar Resizer Splitter */
.sidebar-resizer {
  width: 6px;
  margin-left: -3px;
  margin-right: -3px;
  cursor: col-resize;
  position: relative;
  z-index: 25;
  background: transparent;
  transition: background 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2.5px;
  width: 1px;
  background: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-resizer:hover,
.sidebar-resizer.is-resizing {
  background: rgba(56, 189, 248, 0.08);
}

.sidebar-resizer:hover::after,
.sidebar-resizer.is-resizing::after {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

body.resizing-sidebar {
  cursor: col-resize !important;
  user-select: none !important;
}

body.resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* New Session Button */
.new-chat-wrapper {
  width: 100%;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.new-chat-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.12);
}

.new-chat-btn:active {
  transform: translateY(0) scale(0.97);
}

.shortcut-key {
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 1px 4px;
  border-radius: 3px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.new-chat-btn:hover .shortcut-key {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

/* History list */
.history-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
  gap: 6px;
}

.history-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to bottom, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.75) 50%, var(--bg-panel) 100%);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.history-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 2px 6px;
  user-select: none;
}

.history-label-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}

.history-label-left svg {
  color: var(--text-dim);
}

.history-count-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 500;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 2px 2px 12px 2px;
  scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
  display: none;
}

.history-item {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.038);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(1.5px);
}

.history-item.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0%, rgba(56, 189, 248, 0.02) 100%);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 2.5px 0 0 var(--accent-cyan), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.history-item.active:hover {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, rgba(56, 189, 248, 0.03) 100%);
  border-color: rgba(56, 189, 248, 0.38);
}

.history-icon-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  color: var(--text-dim);
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.history-item:hover .history-icon-col {
  color: var(--text-secondary);
}

.history-item.active .history-icon-col {
  color: var(--accent-cyan);
}

.history-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.history-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: #d1d5db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.history-item.active .history-title {
  color: #ffffff;
  font-weight: 600;
}

.history-actions-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 3px;
  min-width: 48px;
}

.history-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: opacity 0.14s ease;
}

.history-action-btn-group {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.history-rename-btn,
.history-delete-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-item:hover .history-time {
  opacity: 0;
}

.history-item:hover .history-action-btn-group {
  opacity: 1;
  pointer-events: auto;
}

.history-rename-btn:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
}

.history-delete-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.25);
}

.history-rename-input {
  flex: 1;
  background: rgba(11, 14, 20, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: 4px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 2px 6px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  min-width: 0;
  line-height: 1.35;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  line-height: 1.2;
}

.history-meta-model {
  color: #94a3b8;
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.history-item.active .history-meta-model {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

.history-meta-dot {
  color: rgba(255, 255, 255, 0.12);
  font-size: 9px;
}

.history-meta-turns {
  color: #64748b;
  white-space: nowrap;
  font-size: 9.5px;
}

/* Bottom Left Account Card */
.panel-foot {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.account-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.account-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.online-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 1.5px solid var(--bg-surface);
}

.account-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-grow: 1;
}

.account-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-plan {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.account-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}

.account-card:hover .account-menu-btn {
  color: var(--text-secondary);
}

/* ---------------- EXECUTION STAGE ---------------- */
.execution-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-root);
  padding: 16px;
  gap: 10px;
  min-width: 0;
}

.transcript-viewport {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

/* Universally hide default browser scrollbars while preserving full scrollability */
* {
  scrollbar-width: none !important;
  /* Firefox */
  -ms-overflow-style: none !important;
  /* IE/Edge */
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* Minimalist empty state */
.terminal-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-muted);
  gap: 8px;
  text-align: center;
}

.empty-lead {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.text-hl {
  color: var(--accent-cyan);
  font-weight: 600;
}

.empty-hint {
  font-size: 11.5px;
  color: var(--text-dim);
}

kbd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-primary);
}

/* ---------------- THOUGHTS & RESPONSE STREAM ---------------- */
.turn-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-prompt-turn {
  align-self: flex-end;
  max-width: 80%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  animation: userBubblePop 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-prompt-turn:hover {
  border-color: var(--border-focus);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.prompt-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 22px;
  width: 22px;
  max-width: 22px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.22s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    gap 0.22s ease, padding 0.22s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  z-index: 2;
}

.user-prompt-turn:hover .prompt-copy-btn {
  opacity: 0.85;
  transform: translateY(0);
}

.user-prompt-turn .prompt-copy-btn:hover,
.prompt-copy-btn:hover {
  opacity: 1;
  width: auto;
  max-width: 90px;
  gap: 4px;
  padding: 0 7px;
  background: rgba(30, 41, 59, 0.96);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.prompt-copy-btn .copy-btn-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.prompt-copy-btn .copy-icon-copied {
  display: none;
}

.prompt-copy-btn .copy-btn-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  white-space: nowrap;
}

.prompt-copy-btn:hover .copy-btn-label {
  max-width: 60px;
  opacity: 1;
}

.prompt-copy-btn.copied {
  opacity: 1 !important;
  width: auto !important;
  max-width: 90px !important;
  gap: 4px !important;
  padding: 0 7px !important;
  color: var(--accent-cyan) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  background: rgba(14, 165, 233, 0.18) !important;
}

.prompt-copy-btn.copied .copy-icon-default {
  display: none;
}

.prompt-copy-btn.copied .copy-icon-copied {
  display: block;
}

.prompt-copy-btn.copied .copy-btn-label {
  max-width: 60px;
  opacity: 1;
}

@keyframes userBubblePop {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------------- ULTRA-MINIMALIST THINKING DISPLAY ---------------- */
.backend-thinking-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  margin: 4px 0 8px 0;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: #cbd5e1;
  letter-spacing: -0.01em;
  line-height: 1.5;
  box-shadow: none;
  animation: hintFadeIn 0.3s ease both;
  transition: opacity 0.25s ease;
  user-select: none;
}

.backend-thinking-hint.fade-out {
  opacity: 0;
  pointer-events: none;
}

.hint-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  opacity: 0.9;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
  animation: hintDotPulse 1.8s ease-in-out infinite;
}

@keyframes hintDotPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes hintFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.85;
  }
}

.thinking-minimal-wrapper {
  margin: 2px 0 2px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  user-select: text;
  animation: thinkingFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes thinkingFadeUp {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.thinking-minimal-header {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: transparent;
  border: none;
  padding: 1px 0;
  color: #94a3b8;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  user-select: none;
}

/* Rolling / Sliding Ticker for "thinking" -> "no thinking" */
.thinking-ticker-slot {
  display: inline-block;
  position: relative;
  height: 16px;
  line-height: 16px;
  overflow: hidden;
  vertical-align: middle;
}

.thinking-ticker-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.thinking-ticker-slot.is-no-thinking .thinking-ticker-inner {
  transform: translateY(-16px);
}

.thinking-line {
  display: inline-block;
  height: 16px;
  line-height: 16px;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  transition: opacity 0.35s ease, color 0.35s ease;
}

.thinking-line.state-thinking {
  color: #94a3b8;
  opacity: 1;
}

.thinking-ticker-slot.is-no-thinking .thinking-line.state-thinking {
  opacity: 0;
}

.thinking-line.state-no-thinking {
  color: #64748b;
  opacity: 0.5;
}

.thinking-ticker-slot.is-no-thinking .thinking-line.state-no-thinking {
  opacity: 0.9;
  color: #94a3b8;
}

.thinking-minimal-label {
  color: #94a3b8;
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
}

/* Bouncing Ellipsis Animation */
.thinking-bouncing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  padding-top: 1px;
  margin-left: -8px;
  overflow: hidden;
  max-width: 36px;
  opacity: 1;
  transform: scale(1);
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.thinking-bouncing-dots.hiding,
.thinking-bouncing-dots.hidden {
  max-width: 0 !important;
  opacity: 0 !important;
  transform: scale(0.6) translateX(-4px) !important;
  margin: 0 !important;
  pointer-events: none;
}

.thinking-bouncing-dots .b-dot {
  display: inline-block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-cyan);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.thinking-minimal-wrapper.active-thinking .thinking-bouncing-dots .b-dot {
  animation: dotBounce 1.25s infinite ease-in-out both;
}

.thinking-minimal-wrapper.active-thinking .thinking-bouncing-dots .b-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.thinking-minimal-wrapper.active-thinking .thinking-bouncing-dots .b-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.thinking-minimal-wrapper.active-thinking .thinking-bouncing-dots .b-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
    color: #64748b;
  }

  40% {
    transform: translateY(-3.5px);
    opacity: 1;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  }
}

.thinking-minimal-wrapper:not(.active-thinking) .thinking-bouncing-dots .b-dot {
  animation: none;
  color: #64748b;
  opacity: 0.7;
  transform: none;
}

.thinking-roboto-body {
  font-family: var(--font-roboto);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 6px 0 8px 0;
  margin: 0;
  border: none;
  background: transparent;
  animation: thinkingBodySlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes thinkingBodySlide {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.thinking-roboto-body.collapsed {
  display: none;
}

/* ---------------- RICH MARKDOWN FORMATTING ---------------- */
.response-content {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.68;
  word-break: break-word;
  position: relative;
  letter-spacing: -0.005em;
  margin-top: -2px;
  animation: responseFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes responseFadeUp {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.response-content p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.response-content p:last-child {
  margin-bottom: 0;
}

.response-content h1,
.response-content h2,
.response-content h3,
.response-content h4 {
  color: #f8fafc;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 18px;
  margin-bottom: 8px;
}

.response-content h1 {
  font-size: 18px;
}

.response-content h2 {
  font-size: 16px;
}

.response-content h3 {
  font-size: 14.5px;
}

.response-content strong {
  color: #ffffff;
  font-weight: 600;
}

.response-content em {
  font-style: italic;
  color: #cbd5e1;
}

.response-content ul,
.response-content ol {
  margin: 8px 0 12px 22px;
  color: var(--text-primary);
}

.response-content li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.response-content li>p {
  margin-bottom: 4px;
}

.response-content blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding-left: 12px;
  margin: 12px 0;
  color: #94a3b8;
  font-style: italic;
}

.response-content a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.response-content a:hover {
  text-decoration: underline;
}

.response-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 12.5px;
}

.response-content th,
.response-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.response-content th {
  background: var(--bg-surface);
  color: #f1f5f9;
  font-weight: 600;
}

.response-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Inline Code */
.response-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(110, 118, 129, 0.2);
  padding: 2px 5px;
  border-radius: 4px;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Code Blocks (pre) */
.response-content pre {
  background: #090a0f;
  border: 1px solid #1e222e;
  border-radius: 6px;
  margin: 12px 0;
  padding: 12px 14px;
  overflow-x: auto;
  position: relative;
}

.response-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  display: block;
}

/* Code block copy button */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0;
  user-select: none;
}

.response-content pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Smooth streaming live cursor */
.stream-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.15em;
  background: var(--accent-cyan);
  margin-left: 2px;
  vertical-align: -2px;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
  animation: streamBlink 0.65s ease-in-out infinite alternate;
}

@keyframes streamBlink {

  0%,
  25% {
    opacity: 0.2;
    transform: scaleY(0.9);
  }

  75%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes badgePop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }

  70% {
    transform: translateY(-1px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Minimalist Turn Telemetry */
.turn-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
  margin-bottom: 6px;
  padding: 0;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  width: fit-content;
  opacity: 0.8;
  line-height: 1.3;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.turn-telemetry-badge:hover {
  opacity: 1;
}

.turn-telemetry-metrics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.turn-telemetry-badge .tele-lbl {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.01em;
}

.turn-telemetry-badge .tele-val {
  color: var(--accent-cyan);
  font-weight: 500;
  font-size: 11px;
}

.turn-telemetry-badge .tele-sep,
.turn-telemetry-badge .tele-dot {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  margin: 0 1px;
}

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

.response-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 20px;
  width: 20px;
  max-width: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    gap 0.22s ease, padding 0.22s ease, background 0.15s ease,
    border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.response-copy-btn:hover {
  width: auto;
  max-width: 120px;
  gap: 5px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-focus);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.response-copy-btn .copy-btn-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.response-copy-btn .copy-icon-copied {
  display: none;
}

.response-copy-btn .copy-btn-label {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 10.5px;
  letter-spacing: -0.01em;
  transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  white-space: nowrap;
}

.response-copy-btn:hover .copy-btn-label {
  max-width: 90px;
  opacity: 1;
}

.response-copy-btn.copied {
  width: auto !important;
  max-width: 120px !important;
  gap: 5px !important;
  padding: 0 8px !important;
  color: var(--accent-cyan) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  background: rgba(14, 165, 233, 0.16) !important;
}

.response-copy-btn.copied .copy-icon-default {
  display: none;
}

.response-copy-btn.copied .copy-icon-copied {
  display: block;
}

.response-copy-btn.copied .copy-btn-label {
  max-width: 90px;
  opacity: 1;
}

.composer-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-container:focus-within {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.12), 0 8px 30px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

textarea#prompt-textarea {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  resize: none;
  outline: none;
  width: 100%;
  height: 56px;
  min-height: 56px;
  max-height: 280px;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 2px 0;
  transition: height 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: none;
}

textarea#prompt-textarea::placeholder {
  color: var(--text-dim);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  gap: 12px;
}

.composer-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------------- SLEEK MODEL DROPDOWN ---------------- */
.model-dropdown-container {
  position: relative;
  user-select: none;
}

.model-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-root);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.model-dropdown-trigger:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.status-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.trigger-manuf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.trigger-manuf-icon svg,
.trigger-manuf-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.trigger-label {
  color: var(--text-primary);
}

.dropdown-chevron {
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.model-dropdown-container.open .dropdown-chevron {
  transform: rotate(180deg);
}

@keyframes dropdownSpring {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  65% {
    transform: translateY(-2px) scale(1.006);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.model-dropdown-menu {
  position: absolute !important;
  bottom: calc(100% + 10px) !important;
  top: auto !important;
  left: 0 !important;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100vh - 160px));
  overflow: hidden;
  background: rgba(11, 14, 20, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 24px 60px -8px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: none;
  flex-direction: column;
  z-index: 1000;
  transform-origin: bottom left;
}

.model-dropdown-container.open .model-dropdown-menu {
  display: flex;
  animation: dropdownSpring 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Model Picker Header (Sticky Search & Service Switcher) */
.model-picker-header {
  background: rgba(11, 14, 20, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 15;
  padding: 12px 12px 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.model-search-row {
  width: 100%;
}

.model-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 7px 10px;
  outline: none;
  transition: all 0.15s ease;
}

.model-search-input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.model-search-input::placeholder {
  color: var(--text-dim);
}

/* Service 1 / Service 2 Segmented Tab Bar with Sliding Pill Indicator */
.service-filter-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  padding: 3px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.service-tab-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  text-align: center;
}

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

.service-tab-btn.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Service Info Question Mark Tooltip */
.service-info-tooltip-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 4px;
  margin-right: 2px;
  z-index: 5;
}

.service-info-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  padding: 0;
  line-height: 1;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.service-info-btn:hover,
.service-info-btn:focus {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  outline: none;
}

.service-info-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
  width: 250px;
  background: rgba(12, 16, 25, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 12px rgba(56, 189, 248, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  cursor: default;
}

.service-info-btn:hover .service-info-popup,
.service-info-btn:focus .service-info-popup {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.service-info-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.service-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.service-info-row span:last-child {
  color: var(--text-primary);
}

.service-info-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-info-pill.svc1 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.service-info-pill.svc2 {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

/* Smooth gliding pill highlight */
.service-tab-glider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 5px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3), 0 0 8px rgba(56, 189, 248, 0.15);
  z-index: 1;
  pointer-events: none;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), width 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scrollable Viewport with Nice Glide Animation */
.model-list-viewport {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 28px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(0);
}

.model-list-viewport.service-switching {
  opacity: 0.25;
  transform: translateY(6px);
}

/* Fade at the bottom of the model picker */
.model-picker-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(to bottom, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 0.7) 45%, rgba(11, 14, 20, 0.98) 100%);
  pointer-events: none;
  z-index: 10;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.menu-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dropdown-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  padding: 6px 4px 4px 4px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 2px;
  position: relative;
  background: transparent;
}

/* Clean featured group (blue gradient removed as requested) */
.dropdown-group-label.featured-group {
  color: var(--accent-cyan);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  border-radius: 0;
  padding: 6px 4px 4px 4px;
}

.dropdown-group-label.pinned-group {
  color: #fbbf24;
  border-bottom-color: rgba(245, 158, 11, 0.25);
  background: transparent;
  border-radius: 0;
  padding: 6px 4px 4px 4px;
}

.dropdown-group-label.pinned-group .group-count-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.group-count-tag {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: normal;
}

.dropdown-group-label.featured-group .group-count-tag {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.manuf-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  max-width: 14px;
  max-height: 14px;
  flex-shrink: 0;
  opacity: 0.95;
}

.manuf-header-icon svg,
.manuf-header-icon img {
  display: block;
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.manuf-multi-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.95;
}

.manuf-multi-icons img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  display: block;
}

.option-manuf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.option-manuf-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.option-manuf-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

/* Specific brand icon backgrounds */
.option-manuf-icon.brand-chatgpt {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}
.option-manuf-icon.brand-claude {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}
.option-manuf-icon.brand-deepseek {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.2);
}
.option-manuf-icon.brand-google {
  background: rgba(66, 133, 244, 0.08);
  border-color: rgba(66, 133, 244, 0.2);
}
.option-manuf-icon.brand-xai {
  background: rgba(241, 245, 249, 0.08);
  border-color: rgba(241, 245, 249, 0.2);
}
.option-manuf-icon.brand-qwen {
  background: rgba(129, 140, 248, 0.08);
  border-color: rgba(129, 140, 248, 0.2);
}
.option-manuf-icon.brand-nvidia {
  background: rgba(118, 185, 0, 0.08);
  border-color: rgba(118, 185, 0, 0.2);
}

.model-option:hover .option-manuf-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.model-option.active .option-manuf-icon {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
}

.manuf-header-icon svg,
.option-manuf-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  padding: 8px 10px;
  min-height: 48px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  position: relative;
}

.model-option:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.model-option:active {
  transform: translateY(0);
}

.model-option.active {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.38);
  color: var(--accent-cyan);
}

.option-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  gap: 3px;
}

.option-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.option-name {
  font-size: 11.5px;
  font-weight: 500;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-option.active .option-name {
  color: var(--accent-cyan);
  font-weight: 600;
}

.model-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.model-tag {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.1;
}

.model-tag.paid-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.model-tag.live-tag {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
}

.model-tag.tools-tag {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.option-desc {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.option-by {
  font-size: 9px;
  opacity: 0.75;
}

.model-pin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--text-dim);
  opacity: 0.35;
  transition: all 0.15s ease;
  margin-left: 2px;
  flex-shrink: 0;
}

.model-option:hover .model-pin-btn {
  opacity: 0.7;
}

.model-pin-btn:hover {
  opacity: 1 !important;
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.15);
  transform: scale(1.15);
}

.model-pin-btn.active {
  opacity: 1 !important;
  color: #fbbf24 !important;
}

.model-pin-btn.active .pin-svg {
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
}

.option-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.model-option.active .option-pip {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* ---------------- PINNED MODELS INLINE CHIPS STRIP ---------------- */
.pinned-models-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 1;
  min-width: 0;
}

.pinned-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  max-width: 145px;
}

.pinned-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.pinned-chip:active {
  transform: translateY(0);
}

.pinned-chip.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.pinned-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.pinned-chip-icon svg {
  display: block;
  width: 13px;
  height: 13px;
}

.pinned-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty-notice {
  font-size: 11px;
  color: var(--text-dim);
  padding: 12px 8px;
  font-style: italic;
}

.control-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---------------- SLEEK TOGGLE SWITCH ("display thinking") ---------------- */
.thinking-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.thinking-switch-wrapper:hover {
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.thinking-switch-wrapper:active {
  transform: translateY(0) scale(0.96);
}

.switch-track {
  width: 28px;
  height: 15px;
  border-radius: 999px;
  background-color: #1a202c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  padding: 1.5px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.switch-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-dim);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, box-shadow 0.25s ease;
}

.thinking-switch-wrapper.active .switch-track {
  background-color: rgba(37, 99, 235, 0.35);
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.thinking-switch-wrapper.active .switch-thumb {
  transform: translateX(13px);
  background-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9), 0 0 16px rgba(59, 130, 246, 0.6);
}

.switch-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* Switch Rolling Ticker ("thinking" -> "no thinking") */
.switch-ticker-slot {
  display: inline-block;
  position: relative;
  height: 15px;
  line-height: 15px;
  overflow: hidden;
  vertical-align: middle;
}

.switch-ticker-inner {
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.thinking-switch-wrapper:not(.active) .switch-ticker-inner {
  transform: translateY(-15px);
}

.switch-line {
  display: inline-block;
  height: 15px;
  line-height: 15px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.switch-line.state-thinking {
  color: #93c5fd;
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
  opacity: 1;
}

.thinking-switch-wrapper:not(.active) .switch-line.state-thinking {
  opacity: 0;
}

.switch-line.state-no-thinking {
  color: var(--text-dim);
  opacity: 0.4;
}

.thinking-switch-wrapper:not(.active) .switch-line.state-no-thinking {
  opacity: 1;
  color: var(--text-muted);
}

.thinking-switch-wrapper.active .switch-label {
  color: #93c5fd;
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.thinking-switch-wrapper.in-right-controls {
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
}

.thinking-switch-wrapper.in-right-controls:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.composer-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.stop-btn {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 6px 15px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.stop-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.stop-btn:active {
  transform: translateY(0) scale(0.96);
}

.stop-icon {
  font-size: 9px;
  color: #ffffff;
  line-height: 1;
  transition: color 0.18s ease;
}

.stop-btn:hover .stop-icon {
  color: #000000;
}

.submit-btn {
  background: var(--text-primary);
  color: #000;
  border: none;
  padding: 6px 16px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.submit-btn:hover {
  background: #ffffff;
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
}

.submit-btn:active {
  transform: translateY(0) scale(0.96);
}

.submit-btn:hover .key-arrow {
  transform: translateX(2px);
}

.key-arrow {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

/* ==========================================================================
   SETTINGS & PREFERENCES MODAL
   ========================================================================== */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out both;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSpringIn {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  70% {
    transform: translateY(-2px) scale(1.006);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-modal {
  width: 100%;
  max-width: 680px;
  background: rgba(11, 14, 20, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSpringIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.012);
}

.settings-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.settings-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.settings-subtitle {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-dim);
}

.settings-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.settings-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Tabs bar */
.settings-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 15, 0.95);
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.035);
}

.settings-tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.28);
}

/* Content Area */
.settings-content-area {
  padding: 20px 24px;
  height: 380px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.settings-content-area::-webkit-scrollbar {
  width: 5px;
}

.settings-content-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.settings-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeInPane 0.2s ease;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-section-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sub-field-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.group-desc {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin: 0;
}

.settings-reset-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.settings-reset-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.settings-textarea {
  width: 100%;
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.15);
}

/* Presets Chips */
.presets-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
}

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

.presets-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}

.presets-hint {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-dim);
}

.presets-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  padding: 4px 9px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-chip:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* Active Theme Name Tag */
.active-theme-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Swatches Grid */
.swatches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 2px;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 40px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-swatch:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.theme-swatch.active {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.12);
}

.swatch-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.swatch-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-swatch-box {
  grid-column: span 1;
}

.custom-color-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 10px;
  min-height: 40px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.custom-color-trigger:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.custom-color-trigger input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  padding: 0;
}

.custom-color-trigger input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.custom-color-trigger input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.custom-swatch-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* Theme Live Preview Row */
.preview-status-glow-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.theme-live-preview-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  margin-top: 2px;
}

.preview-badge-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
}

.preview-mock-btn {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  cursor: default;
}

.preview-mock-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-mock-track {
  width: 28px;
  height: 16px;
  background: var(--accent-cyan);
  border-radius: 9999px;
  position: relative;
  display: block;
}

.preview-mock-thumb {
  width: 12px;
  height: 12px;
  background: #08090c;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
  display: block;
}

.preview-mock-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* Relay Ping */
.relay-live-ping {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-green);
}

.settings-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.settings-input {
  width: 100%;
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.param-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 3px;
  padding: 1px 6px;
}

.settings-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.slider-boundary-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.settings-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Storage Stats Grid */
.storage-status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.storage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 2px;
}

.storage-stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-dim);
}

/* Action row for data */
.settings-action-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-action-neutral {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-neutral:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-action-danger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-danger:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: #f43f5e;
  transform: translateY(-1px);
}

/* Footer */
.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 15, 0.95);
}

.footer-saved-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.settings-done-action {
  background: var(--text-primary);
  color: #000;
  border: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-done-action:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.settings-done-action:active {
  transform: translateY(0);
}

/* ---------------- MODEL WARNING / BUG NOTICE MODAL ---------------- */
.model-warning-modal {
  max-width: 480px;
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.08);
}

.warning-modal-header {
  border-bottom-color: rgba(245, 158, 11, 0.15);
}

.warning-title-badge {
  color: #f59e0b;
}

.warning-modal-body {
  padding: 22px 24px;
}

.warning-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 16px;
}

.warning-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-alert-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warning-alert-heading {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
}

.warning-alert-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: #d1d5db;
  margin: 0;
}

.warning-modal-footer {
  border-top-color: rgba(245, 158, 11, 0.15);
  justify-content: flex-end;
  gap: 10px;
}

.warning-proceed-btn {
  background: #f59e0b;
  color: #0b0e14;
}

.warning-proceed-btn:hover {
  background: #fbbf24;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* ==========================================================================
   RESPONSIVE MOBILE & TABLET OPTIMIZATIONS
   ========================================================================== */

.nav-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.nav-mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
}

.sidebar-mobile-backdrop {
  display: none;
}

.sidebar-mobile-header {
  display: none;
}

@media (max-width: 768px) {
  /* Navbar adjustments */
  .navbar {
    padding: 0 12px;
    height: 48px;
  }

  .nav-mobile-menu-btn {
    display: inline-flex;
  }

  .nav-sub,
  .nav-divider {
    display: none;
  }

  .nav-title {
    font-size: 13px;
  }

  .brand-badge {
    padding: 3px 6px;
  }

  .brand-logo-img {
    width: 16px;
    height: 16px;
  }

  .relay-indicator {
    font-size: 10px;
  }

  .nav-settings-btn span {
    display: none;
  }

  .nav-settings-btn {
    padding: 6px 8px;
  }

  /* Body split & drawer sidebar */
  .stage-body {
    height: calc(100dvh - 48px);
    max-height: calc(100dvh - 48px);
    flex: 1;
    position: relative;
    overflow: hidden;
  }

  .sidebar-resizer {
    display: none !important;
  }

  .sidebar-mobile-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 6, 9, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar-mobile-backdrop.mobile-active {
    opacity: 1;
    pointer-events: auto;
  }

  .config-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82vw !important;
    max-width: 320px !important;
    z-index: 101;
    background: #0d0f14;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.65);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 16px;
    gap: 14px;
  }

  .config-panel.mobile-open {
    transform: translateX(0);
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-mobile-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .sidebar-mobile-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
  }

  .sidebar-mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
  }

  /* Chat stage viewport */
  .execution-stage {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px;
    gap: 8px;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .transcript-viewport {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 10px;
    border-radius: 8px;
    overflow-y: auto;
  }

  .user-prompt-turn {
    max-width: 92%;
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .response-content {
    font-size: 13px;
    line-height: 1.6;
  }

  /* Responsive bottom composer dock */
  .composer-container {
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: 8px;
    gap: 6px;
    margin-bottom: env(safe-area-inset-bottom, 4px);
  }

  textarea#prompt-textarea {
    font-size: 14px; /* Prevents auto-zoom on iOS Safari */
    min-height: 40px;
    height: 40px;
    padding: 2px 0;
  }

  .composer-actions {
    padding-top: 6px;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  .composer-controls-left {
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    display: flex;
    align-items: center;
  }

  .model-dropdown-trigger {
    padding: 4px 8px;
    font-size: 11px;
    max-width: 140px;
    flex-shrink: 0;
  }

  .trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .model-dropdown-menu {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(env(safe-area-inset-bottom, 8px) + 72px) !important;
    top: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(480px, 68vh) !important;
    z-index: 9999 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  }

  .display-thinking-toggle {
    padding: 3px 6px;
    gap: 5px;
    flex-shrink: 0;
  }

  .display-thinking-toggle span:last-child {
    font-size: 10px;
  }

  .pinned-models-strip,
  .control-divider,
  .composer-shortcut {
    display: none !important;
  }

  .composer-controls-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .submit-btn {
    padding: 6px 14px;
    font-size: 12px;
    height: 32px;
    white-space: nowrap;
  }

  .submit-btn .key-arrow {
    display: none;
  }

  /* Settings Modal on mobile */
  .settings-modal {
    width: 95vw !important;
    max-height: 90vh !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }

  .settings-tabs-bar {
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .settings-tab-btn {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .settings-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .settings-footer button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}