:root {
  --bg-dark: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --header-bg: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-cyan: #38bdf8;
  --accent-green: #4ade80;
  --accent-purple: #c084fc;
  --accent-amber: #fbbf24;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

html {
  font-size: 16px;
}

@media (min-width: 1400px) {
  html {
    font-size: 17.5px;
  }
}

@media (min-width: 1920px) {
  html {
    font-size: 19px;
  }
}

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

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

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Viewport Navigation Tabs & Inline Brand */
.view-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
  height: 44px;
  flex-shrink: 0;
}

/* Brand Bar */
.brand-bar {
  display: flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  height: 38px;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: #38bdf8;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.version-tag {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Active Chat Header Bar (Title on Left, View Tabs in Middle, Metadata on Right) */
.active-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  height: 44px;
  gap: 16px;
}

.active-chat-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.active-chat-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.active-chat-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  transition: all 0.15s ease;
}

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

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.05);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.tab-btn.active .tab-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.active-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.active-chat-meta {
  font-size: 13.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  user-select: none;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.sidebar-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

/* Log Viewport */
.log-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 16.5px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: radial-gradient(
    circle at top right,
    rgba(56, 189, 248, 0.03),
    transparent 40%
  );
}

.log-entry {
  position: relative;
  padding: 8px 36px 8px 12px;
  border-radius: 6px;
  word-break: break-word;
  white-space: pre-wrap;
  animation: fadeIn 0.15s ease-out;
  font-size: 16.5px;
}

.log-entry-text {
  font-size: 16.5px;
}

.copy-msg-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  border-radius: 4px;
  padding: 3px 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.log-entry:hover .copy-msg-btn {
  opacity: 1;
}

.copy-msg-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan, #38bdf8);
  border-color: rgba(56, 189, 248, 0.4);
}

.copy-msg-btn.copied {
  opacity: 1;
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.15);
}

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

/* Message Sender Badges & Attribution */
.msg-sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  margin-bottom: 5px;
  opacity: 0.92;
  letter-spacing: 0.3px;
  user-select: none;
}

.log-entry.user-cmd .msg-sender-badge {
  color: var(--accent-cyan);
}

.log-entry.reply-msg .msg-sender-badge {
  color: var(--accent-green);
}

/* Edit / Resume Interrupted Prompt Button */
.edit-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--accent-amber);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.edit-prompt-btn:hover {
  background: rgba(251, 191, 36, 0.28);
  border-color: var(--accent-amber);
  color: #fff;
}

.log-entry.user-cmd {
  align-self: flex-start;
  margin-right: auto;
  max-width: 80%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 16px 16px 16px 3px;
  color: #e0f2fe;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 10px 38px 10px 14px;
}

.log-entry.thinking-msg {
  background: rgba(192, 132, 252, 0.08);
  border-left: 3px solid var(--accent-purple);
  color: #f3e8ff;
}

.log-entry.debug-msg {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #64748b;
  color: #94a3b8;
}

.log-entry.reply-msg {
  align-self: flex-end;
  margin-left: auto;
  max-width: 82%;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-right: 3px solid var(--accent-green);
  border-radius: 16px 16px 3px 16px;
  color: #f0fdf4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 10px 38px 10px 14px;
}

.msg-sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  user-select: none;
  vertical-align: middle;
}

.log-entry.analyzing-indicator {
  background: rgba(56, 189, 248, 0.06);
  border-left: 3px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulseCyan 1.5s infinite ease-in-out;
}

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

.log-entry.system-msg {
  color: var(--accent-amber);
  font-size: 14px;
}

/* Chat Layout Theme: User on Left, iNoU on Right */
.theme-chat-user-left .log-entry.user-cmd,
.theme-chat-user-right .log-entry.user-cmd {
  align-self: flex-start;
  margin-right: auto;
  max-width: 80%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 16px 16px 16px 3px;
  color: #e0f2fe;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 10px 38px 10px 14px;
}

.theme-chat-user-left .log-entry.reply-msg,
.theme-chat-user-right .log-entry.reply-msg,
.theme-chat-user-left .log-entry.analyzing-indicator,
.theme-chat-user-right .log-entry.analyzing-indicator {
  align-self: flex-end;
  margin-left: auto;
  max-width: 82%;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-right: 3px solid var(--accent-green);
  border-radius: 16px 16px 3px 16px;
  color: #f0fdf4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  padding: 10px 38px 10px 14px;
}

.log-entry.analyzing-indicator {
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulseCyan 1.8s infinite ease-in-out;
}

.theme-chat-user-left .log-entry.thinking-msg,
.theme-chat-user-left .log-entry.debug-msg,
.theme-chat-user-left .log-entry.system-msg,
.theme-chat-user-left .log-entry.error-msg,
.theme-chat-user-right .log-entry.thinking-msg,
.theme-chat-user-right .log-entry.debug-msg,
.theme-chat-user-right .log-entry.system-msg,
.theme-chat-user-right .log-entry.error-msg {
  max-width: 82%;
  align-self: flex-start;
}

/* Chat Layout Theme 3: Classic Monospace Terminal Log */
.theme-terminal-log .log-entry {
  width: 100%;
  max-width: 100%;
  border-radius: 6px;
}

/* Bottom Pinned Input Bar */
.bottom-input-bar {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 14px 24px;
}

.input-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  transition: border-color 0.2s ease;
}

.input-form:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.prompt-prefix {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  user-select: none;
  margin-right: 8px;
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 16.5px;
  outline: none;
}

.cmd-input::placeholder {
  color: #64748b;
  font-family: var(--font-sans);
}

.send-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    transform 0.1s ease,
    box-shadow 0.2s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.send-btn:active {
  transform: translateY(0);
}

/* Error log entries with inline retry */
.log-entry.error-msg {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--accent-amber);
  color: #fef3c7;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.error-text {
  flex: 1;
}

.retry-btn {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--accent-amber);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.retry-btn:hover {
  background: rgba(251, 191, 36, 0.3);
}

/* Mode selector — same chrome as language selector */
.mode-dropdown {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.mode-dropdown option {
  background: #1e293b;
  color: #fff;
}

/* Thinking indicator in main stream */
.log-entry.thinking-indicator {
  background: rgba(192, 132, 252, 0.06);
  border-left: 3px solid var(--accent-purple);
  color: #e9d5ff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
}

.thinking-label {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.thinking-dots {
  display: inline-flex;
  gap: 1px;
  margin-left: 1px;
}

.thinking-hint {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.thinking-hint em {
  font-style: normal;
  color: var(--accent-purple);
}

/* Sequential dot pulse animation */
.dot {
  display: inline-block;
  animation: dotPulse 1.4s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%,
  60%,
  100% {
    opacity: 1;
  }
  30% {
    opacity: 0.15;
  }
}

/* LLM provider configuration */
.llm-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--text-main);
  background: #111827;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.llm-dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.llm-config-form {
  display: flex;
  flex-direction: column;
}

.llm-dialog-header,
.llm-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
}

.llm-dialog-header {
  border-bottom: 1px solid var(--border-color);
}

.llm-dialog-header h2 {
  margin-top: 2px;
  font-size: 18px;
  letter-spacing: 0;
}

.llm-dialog-eyebrow {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
}

.llm-form-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}

.form-field {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.form-field input,
.form-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  color: var(--text-main);
  background: #1e293b;
  font: 13px var(--font-mono);
  cursor: pointer;
}

.form-field select option {
  background: #1e293b;
  color: #f8fafc;
  padding: 6px;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.capability-fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--border-color);
}

.capability-fieldset legend {
  padding-right: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  cursor: pointer;
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: #0ea5e9;
}

.credential-guidance {
  padding: 10px 12px;
  border-left: 3px solid var(--accent-amber);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.07);
  font: 12px/1.5 var(--font-mono);
}

.provider-docs-link {
  width: fit-content;
  color: var(--accent-cyan);
  font-size: 13px;
}

.form-error {
  min-height: 18px;
  color: #fca5a5;
  font-size: 12px;
}

.llm-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

.primary-btn,
.secondary-btn {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 6px;
  font: 600 13px var(--font-sans);
  cursor: pointer;
}

.primary-btn {
  border: 1px solid #0284c7;
  color: white;
  background: #0284c7;
}

.secondary-btn {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background: transparent;
}

@media (max-width: 600px) {
  .llm-dialog-header,
  .llm-dialog-actions,
  .llm-form-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .capability-fieldset {
    grid-template-columns: 1fr;
  }

  .llm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Two-Column Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100vh;
}

.chat-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

/* Sidebar Resizer Divider (Growable / Draggable) */
.sidebar-resizer {
  width: 8px;
  cursor: col-resize;
  position: relative;
  background: transparent;
  flex-shrink: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  user-select: none;
  margin-left: -4px;
  margin-right: -4px;
}

.sidebar-resizer-line {
  width: 2px;
  height: 100%;
  background: var(--border-color);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-resizer:hover .sidebar-resizer-line,
.sidebar-resizer.resizing .sidebar-resizer-line {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.sidebar-resizer.collapsed {
  width: 6px;
  cursor: pointer;
  margin: 0;
}

.sidebar-resizer.collapsed .sidebar-resizer-line {
  background: rgba(56, 189, 248, 0.35);
}

.sidebar-resizer.collapsed:hover .sidebar-resizer-line {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* Chat Sidebar (Right Column) */
.chat-sidebar {
  width: 35vw;
  min-width: 320px;
  max-width: 85vw;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}

.chat-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  pointer-events: none;
  opacity: 0;
}

/* Sidebar Top Navigation Tabs */
.sidebar-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  height: 44px;
}

/* Top-Left Collapse Button inside Right Panel */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  padding: 0 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.sidebar-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  color: var(--text-muted);
  font: 600 14.5px var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

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

.sidebar-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.06);
}

/* Sidebar Tab Panes */
.sidebar-tab-pane {
  display: none;
  display: none !important;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.sidebar-tab-pane.active {
  display: flex;
  display: flex !important;
}

/* Pane 1: Chats */
#pane-chats {
  height: 100%;
}

#pane-chats .chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: none;
}

/* Pane 2: Config Tab with Expandable Bars / Accordions */
#pane-config {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Reusable Expandable Section / Expandable Bar */
.expandable-section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.expandable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

.expandable-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.expandable-header:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -2px;
}

.expandable-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  pointer-events: none;
}

.expandable-icon {
  font-size: 16px;
  line-height: 1;
}

.expandable-text {
  letter-spacing: 0.2px;
}

.expandable-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  pointer-events: none;
  transform: rotate(0deg);
}

.expandable-header:hover .expandable-chevron {
  color: var(--accent-cyan);
}

.expandable-content {
  display: flex;
  flex-direction: column;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  max-height: 480px;
  opacity: 1;
  overflow-y: auto;
  padding: 10px 14px 14px 14px;
}

/* Collapsed State */
.expandable-section.collapsed .expandable-header {
  border-bottom: none;
}

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

.expandable-section.collapsed .expandable-content {
  max-height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

/* Single-Row iPhone Toggle Switch (CHAT UI / LOG UI) */
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 6px 8px;
  user-select: none;
}

.theme-toggle-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-label:hover {
  color: var(--text-main);
}

.theme-toggle-label.active {
  color: var(--accent-cyan);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.theme-switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.theme-switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2.5px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.theme-switch input:checked + .theme-switch-slider {
  background-color: #2563eb;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
}

.theme-switch input:checked + .theme-switch-slider::before {
  transform: translateX(22px);
  background-color: #f8fafc;
}

.theme-switch input:focus-visible + .theme-switch-slider {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.sidebar-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
  flex-shrink: 0;
}

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

.sidebar-title span {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.sidebar-action-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-action-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.sidebar-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14.5px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-cyan);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
  max-height: 300px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.chat-item.active {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.4);
}

.chat-item.active .chat-title-text {
  color: var(--accent-green);
  font-weight: 600;
}

.chat-checkbox {
  cursor: pointer;
}

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

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

.chat-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sidebar-merge-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  gap: 8px;
}

.merge-action-btn {
  flex: 1;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid var(--accent-purple);
  color: var(--accent-purple);
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.merge-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-muted);
  background: transparent;
}

.delete-bulk-action-btn {
  flex: 1;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.delete-bulk-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-muted);
  background: transparent;
}

/* Floating Chat Context Menu */
.chat-context-menu {
  position: fixed;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(56, 189, 248, 0.12);
  backdrop-filter: blur(16px);
  padding: 5px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: fadeInDown 0.12s ease-out;
}

.chat-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.chat-context-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.chat-context-item.danger {
  color: #f87171;
}

.chat-context-item.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

.chat-context-divider {
  height: 1px;
  background: var(--border-color);
  margin: 3px 0;
}

/* Engines List & Item Styling */
.engines-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.3);
}

.engine-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.engine-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.7);
}

.dot-orange {
  background-color: var(--accent-amber);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.7);
}

.dot-red {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}

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

.engine-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.engine-title-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engine-tier-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.engine-model-text {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engine-gear-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.engine-gear-btn:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Integrations List & Item Styling */
.integrations-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.3);
}

.integration-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.integration-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.integration-tier-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(192, 132, 252, 0.15);
  color: var(--accent-purple);
  font-family: var(--font-mono);
}

/* Scrapers List & Adapter Item Styling */
.scrapers-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.3);
}

.scraper-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
}

.scraper-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 189, 248, 0.25);
}

.scraper-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scraper-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.scraper-icon {
  font-size: 15px;
  line-height: 1;
}

.scraper-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.scraper-engine-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.scraper-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.scraper-targets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.scraper-target-pill {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Chat Engine Badge & Quick-Switcher */
.chat-engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.chat-engine-badge:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-engine-icon {
  font-size: 14px;
  line-height: 1;
}

.chat-engine-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input Bar Style Selector Pill */
.style-selector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 6px;
  flex-shrink: 0;
  user-select: none;
}

.style-selector-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.style-selector-pill.canonical {
  border-color: rgba(168, 85, 247, 0.45);
  color: #c084fc;
}

.style-selector-pill.canonical:hover {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.style-pill-icon {
  font-size: 14px;
}

.style-pill-label {
  font-family: var(--font-sans);
}

.style-pill-caret {
  font-size: 10px;
  color: var(--text-muted);
}

/* Floating Style Picker Dropdown */
.style-picker-dropdown {
  position: absolute;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(12px);
  min-width: 280px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.15s ease-out forwards;
}

.style-picker-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.style-picker-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.style-picker-item:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.style-picker-item.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
}

.style-picker-item-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.style-picker-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.style-picker-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.style-picker-item-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Input Bar Engine Selector Pill */
.engine-selector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 8px;
  flex-shrink: 0;
  user-select: none;
}

.engine-selector-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.engine-pill-caret {
  font-size: 12px;
  color: var(--text-muted);
}

/* Floating Engine Picker Dropdown */
.engine-picker-dropdown {
  position: absolute;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.15);
  backdrop-filter: blur(16px);
  padding: 6px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInDown 0.15s ease-out;
}

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

.engine-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.engine-picker-option:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.engine-picker-option.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  font-weight: 600;
}

.engine-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.engine-option-icon {
  font-size: 17px;
}

.engine-option-details {
  display: flex;
  flex-direction: column;
}

.engine-option-name {
  font-size: 14.5px;
  font-weight: 500;
}

.engine-option-model {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.engine-option-badge {
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Message Attribution Tag */
.msg-provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 3px;
  padding: 1px 5px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

/* Chat Item Header (Row 1) & Meta Row (Row 2) */
.chat-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.chat-meta-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.chat-item:hover .chat-delete-btn {
  opacity: 1;
}

.chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  transform: scale(1.15);
}

.chat-delete-btn svg {
  stroke: currentColor;
}


/* Reusable Confirmation & Prompt Modal */
.inou-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 15, 29, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.15s ease-out forwards;
}

.inou-modal-overlay.closing {
  animation: modalFadeOut 0.12s ease-in forwards;
}

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

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

.inou-modal-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.1);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon {
  font-size: 18px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

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

.modal-body {
  padding: 18px;
}

.modal-message {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.modal-chat-target-card {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fca5a5;
}

.modal-chat-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.modal-chat-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-word;
}

.modal-submessage {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.45;
}

.modal-chat-target-list {
  margin: 12px 0;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-chat-target-item {
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #ffffff;
}

/* Modal Inputs & Prompt Chips */
.modal-input-group {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-input-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 13px;
  border-radius: 6px;
  font-size: 14.5px;
  outline: none;
  font-family: var(--font-sans);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.modal-chips-section {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-chips-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-amber);
}

.modal-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-chip-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.modal-chip-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.btn-confirm-primary {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.btn-confirm-primary:hover {
  background: rgba(56, 189, 248, 0.3);
}

.btn-confirm-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  font-weight: 600;
}

.btn-confirm-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   Floating Translucent Toast Notifications
   ══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
  width: max-content;
}

.inou-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inou-toast.toast-hiding {
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message-body {
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 2px;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 6px;
  display: flex;
  align-items: center;
  transition: opacity 0.15s ease;
}

.toast-close-btn:hover {
  opacity: 1;
}

/* Success Toast - Translucent Emerald Green */
.toast-success {
  background: rgba(16, 68, 38, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #f0fdf4;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(74, 222, 128, 0.25);
}
.toast-success .toast-icon {
  stroke: #4ade80;
}

/* Warning Toast - Translucent Amber / Yellow */
.toast-warning {
  background: rgba(84, 51, 10, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fefce8;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(251, 191, 36, 0.25);
}
.toast-warning .toast-icon {
  stroke: #fbbf24;
}

/* Error Toast - Translucent Crimson Red */
.toast-error {
  background: rgba(92, 18, 18, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fef2f2;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(248, 113, 113, 0.25);
}
.toast-error .toast-icon {
  stroke: #f87171;
}

/* Info Toast - Translucent Cyan */
.toast-info {
  background: rgba(12, 45, 74, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #f0f9ff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.25);
}
.toast-info .toast-icon {
  stroke: #38bdf8;
}

@keyframes toastSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header Specifi-Meter Pill */
.header-specifimeter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.header-specifimeter-pill.passed {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(6, 30, 20, 0.75);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.specifi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.header-specifimeter-pill.passed .specifi-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.specifi-label {
  color: var(--text-muted);
}

.specifi-val {
  font-family: var(--font-mono);
  color: #38bdf8;
  font-weight: 700;
}

.header-specifimeter-pill.passed .specifi-val {
  color: #34d399;
}

/* Sidebar Chat Item Specifi Badge */
.chat-specifi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 4px;
}

.chat-specifi-badge.high {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.chat-specifi-badge.mid {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   Prompt Scorer & Gated Cloud Dispatch Banner
   ========================================================================== */
.prompt-scorer-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.prompt-scorer-banner.contradiction {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(30, 10, 15, 0.85);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.prompt-scorer-banner.passed {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(6, 30, 20, 0.8);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.18);
}

.scorer-meter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scorer-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.scorer-title {
  color: var(--text-muted);
}

.scorer-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38bdf8;
  transition: color 0.2s ease;
}

.scorer-score.score-low {
  color: #f87171;
}

.scorer-score.score-mid {
  color: #fbbf24;
}

.scorer-score.score-high {
  color: #34d399;
}

.scorer-threshold-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-weight: 500;
}

.scorer-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.scorer-progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #f87171, #fb923c);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.scorer-progress-bar.bar-mid {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.scorer-progress-bar.bar-high {
  background: linear-gradient(90deg, #10b981, #06b6d4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.scorer-status-feedback {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

.scorer-status-feedback.contradiction {
  color: #fca5a5;
  font-weight: 500;
}

.scorer-status-feedback.passed {
  color: #6ee7b7;
  font-weight: 500;
}

.scorer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.scorer-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.scorer-select:focus {
  border-color: var(--accent-cyan);
}

.btn-dispatch-cloud {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-dispatch-cloud:hover {
  background: linear-gradient(135deg, #0369a1, #0f766e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45);
}

.btn-dispatch-cloud:active {
  transform: translateY(0);
}

.btn-dispatch-cloud:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Config Tab Range Slider & Value Badge */
.config-form-group {
  margin-bottom: 14px;
}

.config-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.config-value-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.config-range-slider {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
  margin: 6px 0;
}

.config-help-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 4px 0 0;
}

.config-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.config-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.config-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.config-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.config-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 20px;
}

.config-switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.config-switch input:checked + .config-switch-slider {
  background-color: #10b981;
}

.config-switch input:checked + .config-switch-slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   LLM & Integration Dialog Styling (Polymorphic Zero-Key Architecture)
   ========================================================================== */

[hidden] {
  display: none !important;
}

.provider-custom-view[hidden],
.google-auth-state[hidden] {
  display: none !important;
}

dialog.llm-dialog {
  background: #111827;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0;
  width: 92%;
  max-width: 480px;
  max-height: 85vh;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

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

.llm-config-form {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.llm-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.llm-dialog-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.llm-dialog-header h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.llm-form-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

/* Polymorphic Provider Custom Views */
.provider-custom-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Google OAuth Card */
.google-auth-card {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.08) 0%, rgba(52, 168, 83, 0.04) 100%);
  border: 1px solid rgba(66, 133, 244, 0.25);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.google-auth-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.google-g-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
}

.auth-card-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.auth-card-subheading {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.google-login-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.google-email-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.google-email-input:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.25);
}

/* Google Sign-in Button */
.google-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #dadce0;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.google-signin-btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.google-signin-btn:active {
  transform: translateY(0);
}

/* Google User Pill (Authenticated State) */
.google-user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
}

.google-user-pill .user-avatar-badge {
  font-size: 18px;
  flex-shrink: 0;
}

.google-user-pill .user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.google-user-pill .user-email-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #34d399;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.google-user-pill .user-status-text {
  font-size: 11px;
  color: var(--text-muted);
}

.google-signout-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.google-signout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Ollama Info Card */
.ollama-info-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 14px;
}

.ollama-badge-row,
.copilot-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ollama-icon,
.copilot-icon {
  font-size: 22px;
}

.ollama-card-heading,
.copilot-card-heading {
  font-size: 13px;
  color: #fff;
}

.ollama-card-subheading,
.copilot-card-subheading {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Form Fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.llm-select,
.form-field input[type="text"],
.form-field input[type="url"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 7px 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.llm-select option {
  background: #1e293b;
  color: #fff;
}

.llm-select:focus,
.form-field input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.credential-guidance {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.provider-docs-link {
  font-size: 11.5px;
  color: var(--accent-cyan);
  text-decoration: none;
}

.provider-docs-link:hover {
  text-decoration: underline;
}

.form-error {
  font-size: 12px;
  color: #f87171;
  margin: 0;
  min-height: 16px;
}

/* Dialog Footer Actions */
.llm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.primary-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  color: #fff;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   Tech Spec 0025: Floating Interactive Clarification Popover (Non-Modal)
   Anchored directly above user prompt input
   ========================================================================== */
.clarification-floating-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 16px;
  right: 16px;
  max-width: 680px;
  margin: 0 auto;
  z-index: 60;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(56, 189, 248, 0.15);
  animation: popoverSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* LOG / Terminal Layout Mode Adaptation */
.clarification-floating-popover.layout-terminal-log {
  font-family: var(--font-mono), monospace;
  background: rgba(10, 15, 26, 0.98);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 10px rgba(34, 197, 94, 0.15);
}

.clarification-floating-popover.layout-terminal-log .clarification-popover-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-radius: 2px;
  font-family: var(--font-mono), monospace;
}

.clarification-floating-popover.layout-terminal-log .clarification-option-label {
  border-radius: 3px;
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  border-color: rgba(34, 197, 94, 0.2);
}

.clarification-floating-popover.layout-terminal-log .clarification-option-label:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
}

.clarification-floating-popover.layout-terminal-log .clarification-option-label.selected {
  background: rgba(34, 197, 94, 0.25);
  border-color: #4ade80;
}

.clarification-floating-popover.layout-terminal-log .clarification-apply-btn {
  background: #16a34a;
  border-radius: 3px;
  font-family: var(--font-mono), monospace;
}

.clarification-floating-popover.layout-terminal-log .clarification-dismiss-btn {
  border-radius: 3px;
  font-family: var(--font-mono), monospace;
}

.clarification-floating-popover.hidden {
  display: none !important;
}

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

.clarification-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.clarification-popover-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clarification-popover-icon {
  font-size: 16px;
}

.clarification-popover-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
}

.clarification-popover-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-weight: 500;
  white-space: nowrap;
}

.clarification-popover-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  transition: all 0.12s ease;
}

.clarification-popover-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.clarification-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.clarification-option-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.clarification-option-label:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: #fff;
}

.clarification-option-label.selected {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #fff;
}

.clarification-option-input {
  accent-color: #38bdf8;
  cursor: pointer;
}

.clarification-writein-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.clarification-writein-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.clarification-writein-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.clarification-popover-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.clarification-dismiss-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.clarification-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.clarification-apply-btn {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clarification-apply-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}




