/* ── Variables (from design system) ────────────────────────────────────────── */
:root {
  --bg-dark:        #0f172a;
  --bg-panel:       rgba(30, 41, 59, 0.7);
  --border-color:   rgba(255, 255, 255, 0.1);
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --accent-primary: #3b82f6;
  --accent-hover:   #2563eb;
  --glow-blue:      rgba(59, 130, 246, 0.15);
  --glow-purple:    rgba(147, 51, 234, 0.15);
  --sidebar-w:      260px;
  --topbar-h:       52px;
  --font-display:   'Inter', sans-serif;
  --font-mono:      'DM Mono', monospace;
}

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

html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-display);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Background glow effects ────────────────────────────────────────────────── */
.background-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(100px);
}
.glow-blue {
  top: -100px; left: -100px;
  background: var(--glow-blue);
  animation: float 10s infinite ease-in-out alternate;
}
.glow-purple {
  bottom: -100px; right: -100px;
  background: var(--glow-purple);
  animation: float 12s infinite ease-in-out alternate-reverse;
}
@keyframes float {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  background: rgba(10, 16, 30, 0.92);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0.75rem 0.25rem;
  padding: 0.55rem 0.9rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.new-chat-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.75rem 1rem 0.4rem;
  flex-shrink: 0;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* ── Session list ────────────────────────────────────────────────────────────── */
.session-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s;
  flex-shrink: 0;
}
.session-item:hover { background: rgba(255, 255, 255, 0.06); }

.session-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--text-primary);
}
.session-link--active { color: var(--accent-primary); }
.session-item:has(.session-link--active) {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.2);
}

.session-preview {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.session-delete-btn {
  flex-shrink: 0;
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.session-item:hover .session-delete-btn { opacity: 1; }
.session-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ── Main area ───────────────────────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ── Messages ────────────────────────────────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* inner window constrains width */
.chat-window {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.message-row {
  display: flex;
  animation: fadeUp 0.2s ease both;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.message-row--user  { justify-content: flex-end; }
.message-row--agent { justify-content: flex-start; }

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

/* ── Bubbles ─────────────────────────────────────────────────────────────────── */
.bubble {
  max-width: min(92%, 100%);
  width: fit-content;
  min-width: 0;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: visible;
}

.bubble-text {
  border-radius: 20px;
  padding: 0.85rem 1.1rem;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  font-size: 0.93rem;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  display: block;
  overflow: hidden;
}

.markdown-content {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* user */
.bubble-user { align-items: flex-end; }
.bubble-user .bubble-text {
  background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(37,99,235,0.95));
  border: 1px solid rgba(59,130,246,0.35);
  color: #fff;
  border-radius: 20px 20px 5px 20px;
}

/* agent */
.bubble-agent { align-items: flex-start; }
.bubble-agent .bubble-text {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 20px 20px 20px 5px;
  backdrop-filter: blur(12px);
}

/* markdown inside bubbles */
.bubble-text br { display: block; margin: 0.3rem 0; content: ""; }
.bubble-text p  { margin: 0 0 0.5rem; }
.bubble-text p:last-child { margin-bottom: 0; }
.bubble-text ul,
.bubble-text ol  { margin: 0.5rem 0; padding-left: 1.25rem; }
.bubble-text li  { margin-bottom: 0.3rem; }
.bubble-text code {
  background: rgba(255,255,255,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: var(--font-mono);
  word-break: normal;
  overflow-wrap: anywhere;
  display: inline;
  max-width: 100%;
}

.bubble-text pre {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  background: rgba(0,0,0,0.3);
  padding: 0.75rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  max-width: 100%;
}

.bubble-text pre code {
  display: block;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
.bubble-text h1, .bubble-text h2, .bubble-text h3 {
  margin: 0.75rem 0 0.4rem;
  font-weight: 600;
}
.bubble-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.88em;
  table-layout: fixed;
  overflow: hidden;
}
.bubble-text th,
.bubble-text td {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-color);
  text-align: left;
  word-break: normal;
  overflow-wrap: anywhere;
}
.bubble-text th { background: rgba(255,255,255,0.07); font-weight: 600; }
.bubble-text blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: 0.5rem 0.85rem;
  margin: 0.5rem 0;
  background: rgba(59,130,246,0.06);
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

/* ── Agent badge ─────────────────────────────────────────────────────────────── */
.agent-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  color: #1a1a1a;
}

/* ── Thinking dots ───────────────────────────────────────────────────────────── */
.thinking-dots {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-color);
  border-radius: 20px 20px 20px 5px;
  backdrop-filter: blur(12px);
}
.dot {
  width: 7px; height: 7px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* ── Empty / welcome state ───────────────────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.75rem;
  min-height: 300px;
}
.empty-icon {
  font-size: 48px;
  color: var(--accent-primary);
  opacity: 0.5;
  margin-bottom: 0.5rem;
}
.empty-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}
.empty-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 400px;
  line-height: 1.7;
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.quick-chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  color: var(--text-primary);
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.08);
}

/* ── Input bar ───────────────────────────────────────────────────────────────── */
.input-bar {
  border-top: 1px solid var(--border-color);
  background: rgba(10, 16, 30, 0.9);
  backdrop-filter: blur(16px);
  padding: 0.85rem 1.5rem 1rem;
  flex-shrink: 0;
}

.input-bar--hidden {
  display: none;
}

.input-form { max-width: 780px; margin: 0 auto; }

.input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  min-height: 48px;
  max-height: 160px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.93rem;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.chat-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.chat-input::placeholder { color: rgba(148,163,184,0.45); }

.send-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.send-btn:hover   { background: var(--accent-hover); }
.send-btn:active  { transform: scale(0.96); }
.send-btn:disabled { background: var(--text-secondary); cursor: not-allowed; transform: none; }

/* ── File upload styles ──────────────────────────────────────────────────────── */
.hidden-file-input {
  display: none;
}

.input-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.file-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}
.file-btn:hover {
  background: rgba(59,130,246,0.1);
  border-color: var(--accent-primary);
}
.file-btn:active {
  transform: scale(0.96);
}

.file-preview-area {
  min-height: auto;
  margin-bottom: 0.6rem;
}

.file-previews {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.file-preview-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 8px;
  padding: 0.5rem;
  animation: slideUp 0.2s ease-out;
}

.image-preview {
  padding: 0.4rem;
}

.image-preview img {
  height: 60px;
  width: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview {
  padding: 0.6rem 0.8rem;
  min-width: 150px;
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.file-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.file-preview-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.file-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: #ef4444;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-weight: bold;
}
.file-remove-btn:hover {
  background: rgba(239,68,68,0.3);
  border-color: rgba(239,68,68,0.6);
}

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

/* ── YOU label on user bubble ────────────────────────────────────────────────── */
.you-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.65;
  color: rgba(255,255,255,0.9);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }

  .chat-window { padding: 0 1rem; }
  .input-bar   { padding: 0.75rem 1rem 0.9rem; }

  .input-row {
    flex-direction: column;
  }

  .send-btn {
    width: 100%;
    height: 44px;
    justify-content: center;
  }
}
/* ═══════════════════════════════════════════════════════════════════════════
   PANELS & PROSPECTS — added for slide-in panel feature
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar tabs ────────────────────────────────────────────────────────────── */
.sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.75rem 0.5rem;
  flex: 1;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.sidebar-tab:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.sidebar-tab.active {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.25);
  color: var(--accent-primary);
}
.sidebar-tab svg { flex-shrink: 0; }

/* ── Sidebar panels ──────────────────────────────────────────────────────────── */
.slide-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: rgba(10, 16, 30, 0.97);
  border-right: 1px solid var(--border-color);
  border-left: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  z-index: 120;
  backdrop-filter: blur(16px);
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}
.slide-panel.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0,0,0,0.35);
}
.panel-overlay.visible { display: block; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.panel-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.12s;
}
.panel-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
}

.panel-new-btn {
  display: block;
  margin: 0.6rem 0.75rem 0.25rem;
  padding: 0.5rem 0.85rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 7px;
  color: var(--accent-primary);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.panel-new-btn:hover { background: rgba(59,130,246,0.18); }

.panel-list {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.5rem;
}
.panel-list::-webkit-scrollbar { width: 4px; }
.panel-list::-webkit-scrollbar-track { background: transparent; }
.panel-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.panel-empty {
  display: block;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ── Prospect items in panel ─────────────────────────────────────────────────── */
.prospect-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.prospect-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  border-radius: 7px;
  transition: background 0.12s;
}
.prospect-link:hover { background: rgba(255,255,255,0.05); }

.prospect-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.prospect-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-tier {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.tier-a { background: rgba(110,231,183,0.15); color: #6ee7b7; }
.tier-b { background: rgba(253,186,116,0.15); color: #fdba74; }
.tier-c { background: rgba(148,163,184,0.15); color: #94a3b8; }

.prospect-product {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-score {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ── Prospect save prompt (inline in chat) ───────────────────────────────────── */
.prospect-prompt {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(700px, 85%);
  margin: 0 clamp(16px, 8vw, 120px) 0.5rem;
  padding: 0;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 10px;
  animation: fadeUp 0.2s ease both;
  overflow: hidden;
}

.prospect-prompt > div:first-child {
  padding: 0.75rem 1rem;
}
.prospect-prompt--success {
  background: rgba(110,231,183,0.08);
  border-color: rgba(110,231,183,0.25);
  color: #6ee7b7;
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  max-width: min(680px, 80%);
  margin: 0 clamp(16px, 8vw, 120px) 0.5rem;
  border-radius: 10px;
  animation: fadeUp 0.2s ease both;
}

.prospect-prompt-text {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}

.prospect-prompt-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  flex-shrink: 0;
  width: 100%;
}

.prospect-prompt-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.prospect-prompt-save {
  background: var(--accent-primary);
  color: #fff;
}
.prospect-prompt-save:hover { background: var(--accent-hover); }
.prospect-prompt-dismiss {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.prospect-prompt-dismiss:hover { color: var(--text-primary); }

/* ── Prospect dropdown and list ──────────────────────────────────────────────── */

.prospect-dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
  margin-left: auto;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prospect-dropdown-toggle:hover {
  color: var(--text-primary);
  transform: scale(1.15);
}

.prospect-list {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(59,130,246,0.04);
  border-top: 1px solid rgba(59,130,246,0.15);
  transition: max-height 0.2s ease, opacity 0.2s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
}
.prospect-list--hidden {
  max-height: 0;
  opacity: 0;
  padding: 0;
  overflow: hidden;
  border-top: none;
}

.prospect-item-selectable {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px;
  transition: all 0.15s;
  cursor: pointer;
}
.prospect-item-selectable:hover {
  background: rgba(59,130,246,0.1);
  border-color: rgba(59,130,246,0.35);
}

.prospect-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.prospect-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.prospect-item-summary {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding-left: 22px;
  margin-top: 0.25rem;
}

/* Add prospect profile panel */
.prospect-profile-window {
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.profile-panel {
  width: min(920px, 100%);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
  overflow: hidden;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.profile-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.35rem;
}

.profile-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.profile-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.profile-field--full {
  width: 100%;
}

.profile-field--hidden {
  display: none;
}

.profile-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-input,
.profile-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: rgba(15,23,42,0.42);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  line-height: 1.4;
  outline: none;
}

.profile-input {
  min-height: 42px;
  padding: 0.62rem 0.75rem;
}

.profile-select {
  appearance: auto;
  background-color: rgba(15,23,42,0.42);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.profile-select option {
  background: #0a101e;
  color: var(--text-primary);
}

.profile-textarea {
  resize: vertical;
  min-height: 110px;
  padding: 0.75rem;
}

.profile-input:focus,
.profile-textarea:focus {
  border-color: rgba(59,130,246,0.75);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.14);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.2rem;
}

.profile-primary-btn,
.profile-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.profile-primary-btn {
  border: none;
  background: var(--accent-primary);
  color: #fff;
}

.profile-primary-btn:hover {
  background: var(--accent-hover);
}

.profile-secondary-btn {
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

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

@media (max-width: 860px) {
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .prospect-profile-window {
    justify-content: flex-start;
    padding: 1rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    flex-direction: column-reverse;
  }

  .profile-primary-btn,
  .profile-secondary-btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROSPECT TABS & FNA DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Prospect Tabs Navigation ───────────────────────────────────────────────── */
.prospect-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  padding: 0 clamp(1rem, 3vw, 2rem);
  margin-bottom: 0;
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
  overflow: hidden;
}

.prospect-tabs-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.prospect-tab-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding-left: 1rem;
  margin-left: 1rem;
  border-left: 1px solid var(--border-color);
}

.prospect-tab-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
}

.prospect-tab-name {
  max-width: min(28vw, 320px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.prospect-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.85rem 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-tab-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.1rem;
}

.prospect-tab-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  fill: currentColor;
  stroke: none;
}

.prospect-tab-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-tab-btn:not(:first-child) {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
}

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

.prospect-tab-btn.active {
  color: var(--accent-primary);
}

.prospect-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-primary);
}

/* ── Tab Contents Container ────────────────────────────────────────────────── */
.prospect-tab-contents {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}

.tab-content {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.tab-content.active {
  display: flex;
}

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

.prospect-tabbed-window {
  flex-direction: column;
  gap: 0;
  padding: 0;
}

/* ── FNA Dashboard ──────────────────────────────────────────────────────────── */
.prospect-fna-window {
  flex-direction: column;
  padding: 0;
  align-items: stretch;
}

.fna-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 2rem);
  position: relative;
}

.fna-save-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(110, 231, 183, 0.35);
  border-radius: 6px;
  background: rgba(6, 78, 59, 0.92);
  color: #d1fae5;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  animation: fna-save-notification-autohide 5s ease forwards;
}

.fna-save-notification--error {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.92);
  color: #fee2e2;
}

.fna-save-notification--leaving {
  opacity: 0;
  transform: translateY(-4px);
}

@keyframes fna-save-notification-autohide {
  0%, 94% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
  }
}

.fna-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  width: 100%;
}

.fna-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
}

.fna-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s;
}

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

.fna-card-healthy {
  border-color: rgba(110, 231, 183, 0.25);
  background: rgba(110, 231, 183, 0.08);
}

.fna-card-warning {
  border-color: rgba(252, 211, 77, 0.25);
  background: rgba(252, 211, 77, 0.08);
}

.fna-card-critical {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
}

.fna-card-top {
  display: flex;
  flex-direction: column;
}

.fna-card-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.fna-card-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.fna-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fna-score-display {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fna-score-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.fna-score-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: var(--score);
  background: var(--color);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fna-score-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fna-score-display--empty .fna-score-text {
  color: #94a3b8;
}

.fna-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fna-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.fna-metric:first-child {
  border-top: none;
  padding-top: 0;
}

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

.fna-metric-value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* ── FNA Summary Sidebar ─────────────────────────────────────────────────── */
.fna-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fna-summary-panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: fit-content;
  position: sticky;
  top: 0;
}

.fna-summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.fna-summary-items {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.fna-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.fna-summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fna-summary-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fna-risk-medium {
  color: #fcd34d;
}

.fna-priority {
  color: #f87171;
}

.fna-summary-note-container {
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.fna-summary-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .fna-content {
    grid-template-columns: 1fr;
  }

  .fna-summary-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 768px) {
  .prospect-tabs {
    overflow: hidden;
  }

  .prospect-tab-label {
    display: none;
  }

  .prospect-tab-name {
    max-width: 34vw;
  }

  .fna-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .prospect-tab-btn:not(:first-child) {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }

  .prospect-tab-btn {
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
  }

  .fna-panel {
    padding: 1rem;
  }

  .fna-card {
    padding: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENHANCED FNA DASHBOARD — Metrics, Charts, and Editable Inputs
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Key Metrics Display ───────────────────────────────────────────────────── */
.fna-metrics-section {
  width: 100%;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.fna-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: 1rem;
  width: 100%;
}

.metric-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(110, 231, 183, 0.06));
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all 0.2s;
}

.metric-box:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(110, 231, 183, 0.1));
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

.metric-box.metric-healthy {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.08), rgba(16, 185, 129, 0.06));
  border-color: rgba(110, 231, 183, 0.25);
}

.metric-box.metric-healthy .metric-big-number {
  color: #6ee7b7;
}

.metric-box.metric-warning {
  background: linear-gradient(135deg, rgba(252, 211, 77, 0.08), rgba(251, 146, 60, 0.06));
  border-color: rgba(252, 211, 77, 0.25);
}

.metric-box.metric-warning .metric-big-number {
  color: #fcd34d;
}

.metric-box.metric-critical {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.08), rgba(239, 68, 68, 0.06));
  border-color: rgba(248, 113, 113, 0.25);
}

.metric-box.metric-critical .metric-big-number {
  color: #f87171;
}

.metric-box.metric-empty {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.04), rgba(100, 116, 139, 0.04));
  border-color: rgba(148, 163, 184, 0.1);
  opacity: 0.6;
}

.metric-box.metric-empty .metric-big-number {
  color: #94a3b8;
}

.metric-big-number {
  font-size: clamp(1.2rem, 6vw, 2rem);
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── Charts Section ────────────────────────────────────────────────────────── */
.fna-charts-section {
  width: 100%;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.fna-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.fna-chart-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fna-chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}

.fna-chart-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.fna-chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* ── Editable Input Cards ──────────────────────────────────────────────────── */
.fna-input-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  width: 100%;
  padding-top: 1rem;
}

.fna-input-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s;
}

.fna-input-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(59, 130, 246, 0.25);
}

.fna-card-header {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.fna-card-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.5rem;
  font-size: 1.45rem;
  line-height: 1;
}

.fna-card-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  fill: currentColor;
  stroke: none;
}

.fna-card-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.fna-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fna-score-display {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fna-score-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.fna-score-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: var(--score);
  background: var(--color);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fna-score-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.fna-score-display--empty .fna-score-text {
  color: #94a3b8;
}

/* ── Input Rows ────────────────────────────────────────────────────────────── */
.fna-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.fna-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.fna-input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.fna-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  transition: all 0.2s;
}

.fna-input-wrapper:focus-within {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.05);
}

.fna-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  min-width: 0;
}

.fna-input-field::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.fna-input-suffix {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── WIDE LAYOUT FOR FNA ───────────────────────────────────────────────────── */
.fna-input-cards-grid.fna-wide-layout {
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-top: 1.5rem;
}

.fna-input-card {
  padding: 1.5rem;
  gap: 1.2rem;
}

.fna-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── Checkbox Styling ──────────────────────────────────────────────────────── */
.fna-checkbox-row {
  padding: 0.6rem 0;
}

.fna-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.fna-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
  border-radius: 4px;
}

.fna-checkbox:hover {
  opacity: 0.8;
}

/* ── Radio Button Styling ──────────────────────────────────────────────────── */
.fna-radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fna-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.3rem;
}

.fna-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: all 0.2s;
}

.fna-radio-label:hover {
  color: var(--text-primary);
}

.fna-radio-label input:checked + span {
  color: var(--accent-primary);
  font-weight: 600;
}

.fna-radio {
  width: 16px;
  height: 16px;
  min-width: 16px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

/* ── Slider Styling ────────────────────────────────────────────────────────── */
.fna-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fna-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.fna-slider {
  flex: 1;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.fna-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}

.fna-slider::-webkit-slider-thumb:hover {
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.fna-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}

.fna-slider::-moz-range-thumb:hover {
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.fna-slider-value {
  min-width: 60px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* ── Responsive Wide Layout ────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .fna-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .fna-input-cards-grid.fna-wide-layout {
    grid-template-columns: 1fr;
  }

  .fna-inputs {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .fna-input-card {
    padding: 1.2rem;
  }

  .fna-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .fna-input-card {
    padding: 1rem;
    gap: 0.9rem;
  }

  .fna-inputs {
    gap: 0.6rem;
  }

  .fna-radio-group {
    flex-direction: column;
    align-items: stretch;
  }

  .fna-radio-label {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Responsive Chart Layout ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .fna-charts-grid {
    grid-template-columns: 1fr;
  }

  .fna-input-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .fna-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .metric-big-number {
    font-size: 1.1rem;
  }

  .metric-label {
    font-size: 0.7rem;
  }

  .fna-input-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .fna-metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .fna-charts-grid {
    gap: 1rem;
  }

  .fna-chart-container {
    height: 220px;
  }

  .fna-input-field {
    font-size: 0.8rem;
  }
}
