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

:root {
  --sep-navy: #1B2D5B;
  --sep-navy-light: #243768;
  --sep-yellow: #F5C542;
  --sep-pink: #E84D8A;
  --sep-teal: #0E8C6A;
  --sep-coral: #E8734A;
  --sep-blue: #2D6EB5;
  --sep-yellow-light: #FEF7E0;
  --sep-teal-light: #E6F5EE;
  --sidebar-bg: var(--sep-navy);
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-hint: #9b9b9b;
  --bg: #ffffff;
  --bg-secondary: #f5f5f3;
  --border: #e5e5e3;
  --success: #0E8C6A;
  --error: #c53030;
  --error-bg: #fef2f2;
  --radius: 10px;
  --radius-lg: 14px;
}

/* Dark mode */
[data-theme="dark"] {
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --text-hint: #71717a;
  --bg: #18181b;
  --bg-secondary: #27272a;
  --border: #3f3f46;
  --error: #ef4444;
  --error-bg: #2a1515;
  --sep-yellow-light: #302a14;
  --sep-teal-light: #1a2e26;
}

[data-theme="dark"] .sidebar-logo {
  background: rgba(255,255,255,0.95);
}

[data-theme="dark"] .message-assistant .message-bubble code {
  background: rgba(255,255,255,0.08);
}

[data-theme="dark"] .message-user .message-bubble {
  background: #2D4A8A;
}

[data-theme="dark"] .input-wrapper {
  background: var(--bg-secondary);
}

[data-theme="dark"] #chat-input {
  color: var(--text);
}

[data-theme="dark"] .btn-send {
  background: #3b5998;
}

[data-theme="dark"] .btn-send:not(:disabled):hover {
  background: #4a6bb5;
}

[data-theme="dark"] .file-card {
  background: var(--bg-secondary);
}

[data-theme="dark"] .context-slider {
  background: var(--bg-secondary);
}

[data-theme="dark"] .slider-thumb {
  background: #27272a;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.app { display: flex; height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-logo {
  height: 48px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  align-self: flex-start;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.btn-new-chat:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}

/* Search */
.sidebar-search {
  padding: 8px 14px;
}

.sidebar-search input {
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: background 0.15s;
}

.sidebar-search input::placeholder { color: rgba(255,255,255,0.3); }
.sidebar-search input:focus { background: rgba(255,255,255,0.12); }

/* Conversation list */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.conversation-list::-webkit-scrollbar { width: 4px; }
.conversation-list::-webkit-scrollbar-track { background: transparent; }
.conversation-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.conv-empty {
  padding: 20px 10px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 12.5px;
}

.conv-group { margin-bottom: 4px; }

.conv-group-label {
  padding: 10px 8px 4px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.conv-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.conv-item:hover { background: rgba(255,255,255,0.08); }
.conv-item.active { background: rgba(255,255,255,0.12); }

.conv-title {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-item.active .conv-title { color: #fff; }

.conv-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

/* Snelkeuze (collapsible) */
.sidebar-quick {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-section-label {
  padding: 10px 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.sidebar-section-label::-webkit-details-marker { display: none; }
.sidebar-section-label::marker { display: none; content: ""; }

.sidebar-actions { padding: 0 8px 10px; }

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 1px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}

.sidebar-btn:hover { background: rgba(255,255,255,0.08); }
.sidebar-btn svg { flex-shrink: 0; }

/* Sidebar user info */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: auto;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sep-yellow);
  color: var(--sep-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

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

/* ============================================================
   CHAT AREA
   ============================================================ */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}

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

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

.header-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-hint);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.btn-icon:hover { background: var(--bg-secondary); color: var(--text-muted); }

/* Welcome screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 40px;
  color: var(--text-muted);
}

.welcome-icon { margin-bottom: 16px; opacity: 0.7; }
.welcome-screen h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.welcome-screen p { font-size: 14px; color: var(--text-hint); max-width: 340px; }

/* ============================================================
   MESSAGES
   ============================================================ */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 8px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  max-width: 100%;
}

.message-user { flex-direction: row-reverse; margin-left: auto; }

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assistant-avatar { background: #EEF0F8; }
.user-avatar { background: var(--bg-secondary); color: var(--text-muted); }

.message-content { max-width: min(60%, 820px); }
.message-user .message-content { max-width: min(60%, 820px); }

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  line-height: 1.65;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-assistant .message-bubble {
  background: var(--bg-secondary);
  border-top-left-radius: 4px;
  color: var(--text);
}

.message-assistant .message-bubble p { margin: 0 0 8px; }
.message-assistant .message-bubble p:last-child { margin-bottom: 0; }
.message-assistant .message-bubble ul { margin: 6px 0; padding-left: 20px; }
.message-assistant .message-bubble li { margin-bottom: 4px; }
.message-assistant .message-bubble strong { font-weight: 500; }
.message-assistant .message-bubble code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

/* Fenced code blocks */
.message-assistant .message-bubble pre {
  margin: 8px 0;
  border-radius: 8px;
  overflow: hidden;
}

.message-assistant .message-bubble pre code {
  display: block;
  padding: 14px 16px;
  background: #f6f8fa;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  border-radius: 8px;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
}

.message-assistant .message-bubble .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: #e8eaed;
  font-size: 11px;
  color: #656871;
  font-family: inherit;
}

.message-assistant .message-bubble .code-header .btn-copy-code {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: #656871;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.message-assistant .message-bubble .code-header .btn-copy-code:hover {
  background: rgba(0,0,0,0.06);
  color: #333;
}

[data-theme="dark"] .message-assistant .message-bubble pre code {
  background: #1e1e2e;
}

[data-theme="dark"] .message-assistant .message-bubble .code-header {
  background: #2a2a3a;
  color: #9a9ab0;
}

[data-theme="dark"] .message-assistant .message-bubble .code-header .btn-copy-code {
  color: #9a9ab0;
}

[data-theme="dark"] .message-assistant .message-bubble .code-header .btn-copy-code:hover {
  background: rgba(255,255,255,0.06);
  color: #ccc;
}

.message-assistant .message-bubble .md-heading {
  display: block; font-size: 15px; font-weight: 600; margin: 12px 0 4px;
}
.message-assistant .message-bubble .md-heading:first-child { margin-top: 0; }

.message-assistant .message-bubble .md-subheading {
  display: block; font-size: 14.5px; font-weight: 600; margin: 10px 0 4px;
}

.message-assistant .message-bubble .md-blockquote {
  border-left: 3px solid var(--sep-teal);
  padding: 6px 12px; margin: 8px 0;
  color: var(--text-muted); font-size: 13.5px;
}

.message-user .message-bubble {
  background: var(--sep-navy);
  color: #fff;
  border-top-right-radius: 4px;
}

.message-error .message-bubble {
  background: var(--error-bg);
  color: var(--error);
  border-top-left-radius: 4px;
}

/* Copy button on assistant messages */
.message-actions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.message-content:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
}

.btn-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-hint);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.btn-copy:hover {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.btn-copy.copied {
  color: var(--success);
}

/* ============================================================
   FILE CARDS
   ============================================================ */

.file-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.file-card:hover {
  border-color: var(--sep-navy);
  box-shadow: 0 1px 4px rgba(27,45,91,0.08);
}

.file-icon { font-size: 22px; flex-shrink: 0; }

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: var(--text-hint);
}

.file-download {
  flex-shrink: 0;
  color: var(--sep-navy);
  opacity: 0.5;
  transition: opacity 0.12s;
}

.file-card:hover .file-download { opacity: 1; }

/* ============================================================
   SOURCES
   ============================================================ */

.sources-block {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 3px solid var(--sep-teal);
}

.sources-label {
  font-size: 11px;
  color: var(--text-hint);
  margin-bottom: 6px;
}

.sources-chips { display: flex; flex-direction: column; gap: 4px; }

.source-chip {
  font-size: 12.5px;
  padding: 6px 10px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 6px;
}

.source-chip:hover { border-color: var(--sep-navy); }
.source-name { color: var(--text); font-weight: 500; display: block; }
.source-context { color: var(--text-hint); font-size: 11px; display: block; margin-top: 1px; }

/* ============================================================
   TRACE PANEL (Denkpad)
   ============================================================ */

.trace-panel {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 13px;
}

.trace-panel[open] {
  background: var(--bg);
}

.trace-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--text-muted);
  transition: background 0.12s;
}

.trace-header::-webkit-details-marker { display: none; }
.trace-header::marker { display: none; content: ""; }
.trace-header:hover { background: rgba(0,0,0,0.02); }

.trace-icon-main { font-size: 14px; }

.trace-summary {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trace-time {
  font-size: 11px;
  color: var(--text-hint);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.trace-content {
  padding: 0 10px 10px;
}

/* Individual trace step */
.trace-step {
  margin-bottom: 2px;
  border-radius: 6px;
}

.trace-step-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  border-radius: 6px;
  transition: background 0.1s;
  overflow: hidden;
}

.trace-step-header::-webkit-details-marker { display: none; }
.trace-step-header::marker { display: none; content: ""; }
.trace-step-header:hover { background: var(--bg-secondary); }

.trace-step-icon {
  font-size: 13px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.trace-step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}

.trace-step-detail {
  font-size: 11.5px;
  color: var(--text-hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
}

.trace-step-time {
  font-size: 10px;
  color: var(--text-hint);
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.trace-step-body {
  margin: 2px 8px 6px 32px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* Thinking steps: fully visible text */
.trace-thinking .trace-step-label { color: var(--sep-blue); }
.trace-thinking-text {
  margin: 2px 8px 6px 32px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}
.trace-thinking .trace-step-body {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  max-height: 300px;
}

/* Stats footer */
.trace-stats {
  margin-top: 6px;
  padding: 6px 8px 0;
  font-size: 11px;
  color: var(--text-hint);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   TYPING / LOADING
   ============================================================ */

.typing-sep {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}

.sep-loading-gif { width: 32px; height: 32px; object-fit: contain; }

.typing-text {
  font-size: 13px;
  color: var(--text-hint);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ============================================================
   CONTEXT SLIDER - auto-slider with neon glow
   ============================================================ */

.context-slider {
  padding: 0;
  margin-bottom: 0;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease,
    padding 0.4s ease,
    margin 0.4s ease,
    border-color 0.6s ease,
    box-shadow 0.6s ease;
}

.context-slider.visible {
  max-height: 320px;
  opacity: 1;
  padding: 8px 12px 6px;
  margin-bottom: 8px;
}

.context-slider.neon-active {
  border-color: var(--neon-color);
  box-shadow: 0 0 10px 1px var(--neon-color);
}

.slider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slider-label { font-size: 11px; color: var(--text-hint); }
.slider-value-wrap { display: flex; align-items: center; gap: 8px; }
.slider-level { font-size: 12px; font-weight: 500; color: var(--sep-blue); transition: color 0.4s; }
.slider-tokens { font-size: 10px; color: var(--text-hint); background: var(--bg-secondary); padding: 1px 6px; border-radius: 4px; }

.slider-track-wrap {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  cursor: pointer;
}

.slider-track {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  position: relative;
  background: linear-gradient(to right,
    #0E8C6A 0%, #0E8C6A 14%,
    #1a7a6a 17%, #2D6EB5 22%, #2D6EB5 34%,
    #5a9ac4 38%, #c4b044 42%, #F5C542 46%, #F5C542 58%,
    #eaa040 62%, #E8734A 68%, #E8734A 82%,
    #e06068 86%, #E84D8A 90%, #E84D8A 100%
  );
  transition: height 0.4s;
}

.slider-track.neon-glow { height: 6px; }

/* Analyzing state - pulsing border on the slider container */
.context-slider.analyzing {
  border-color: var(--sep-blue);
  animation: analyzeGlow 1.2s ease-in-out infinite alternate;
}

@keyframes analyzeGlow {
  0%   { border-color: var(--border); }
  100% { border-color: var(--sep-blue); }
}

/* Pulsing rec label while analyzing */
.slider-rec.analyzing {
  animation: recPulse 1.2s ease-in-out infinite alternate;
}

@keyframes recPulse {
  0%   { opacity: 0.4; }
  100% { opacity: 1; }
}

.slider-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sep-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  top: 50%;
  transform: translate(-50%, -50%);
  left: 25%;
  cursor: grab;
  transition: left 0.15s ease, border-color 0.4s, box-shadow 0.4s;
  z-index: 2;
}

.slider-thumb.animate {
  transition: left 1s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s, box-shadow 0.4s;
}

.slider-thumb.dragging { cursor: grabbing; transition: border-color 0.4s, box-shadow 0.4s; }

.slider-thumb.neon-active {
  box-shadow: 0 0 8px 2px var(--neon-color, transparent);
}

.slider-ticks {
  position: relative;
  height: 16px;
  margin: 2px 9px 0;
}

.slider-tick {
  position: absolute;
  font-size: 9.5px;
  color: var(--text-hint);
  cursor: pointer;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: color 0.3s;
  padding: 1px 0;
}

.slider-tick:first-child { transform: translateX(0); }
.slider-tick:last-child { transform: translateX(-100%); }
.slider-tick:hover { color: var(--text-muted); }
.slider-tick.active { font-weight: 600; }

/* Bottom row: info link left, recommendation right */
.slider-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  min-height: 16px;
}

.slider-info-link {
  font-size: 10px;
  color: var(--text-hint);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.slider-info-link:hover { color: var(--text-muted); }

.slider-rec {
  font-size: 10.5px;
  color: var(--text-hint);
  opacity: 0;
  transition: opacity 0.3s;
}

.slider-rec.visible { opacity: 1; }

/* Info panel - slides open below */
.slider-info-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), padding 0.3s;
  padding: 0;
}

.slider-info-panel.open {
  max-height: 120px;
  padding: 6px 0 2px;
}

.slider-info-explain {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 2px 0 6px;
  border-left: 2.5px solid var(--sep-blue);
  padding-left: 10px;
  margin-bottom: 6px;
  transition: border-color 0.4s;
}

.slider-info-stats {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.slider-info-stat { display: flex; flex-direction: column; }
.slider-info-stat-label { font-size: 9px; color: var(--text-hint); }
.slider-info-stat-value { font-size: 11.5px; font-weight: 500; color: var(--text); transition: color 0.4s; }
.slider-info-stat-bar { flex: 1; }

.slider-usage-bar {
  height: 3px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.slider-usage-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--sep-blue);
  width: 0.5%;
  transition: width 0.6s, background 0.4s;
}

.slider-usage-pct {
  font-size: 9px;
  color: var(--text-hint);
  transition: color 0.4s;
}

/* Neon - only the send button pulses (opacity = GPU-composited, no repaint) */
@keyframes btnPulse {
  0%   { opacity: 0.82; }
  100% { opacity: 1; }
}

/* ============================================================
   INPUT AREA
   ============================================================ */

.chat-input-area {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s;
}

.input-wrapper:focus-within { border-color: var(--sep-navy); }

#chat-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.5;
  padding: 6px 0;
  max-height: 120px;
  background: transparent;
  color: var(--text);
}

#chat-input::placeholder { color: var(--text-hint); }

.btn-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--sep-navy);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s, background 0.4s, box-shadow 0.4s;
}

.btn-send:disabled { opacity: 0.35; cursor: default; }
.btn-send:not(:disabled):hover { background: var(--sep-navy-light); }
.btn-send:not(:disabled):active { transform: scale(0.95); }

.btn-send.neon-active {
  box-shadow: 0 0 10px 2px var(--neon-color, transparent);
  animation: btnPulse 1.8s ease-in-out infinite alternate;
}

.btn-send.btn-stop {
  background: var(--error);
}
.btn-send.btn-stop:hover { background: #a52828; }

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 100;
    transition: left 0.2s ease;
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  }

  .btn-sidebar-toggle { display: flex; }
  .chat-header { padding: 10px 16px; }
  .messages { padding: 16px 16px 8px; }
  .chat-input-area { padding: 10px 16px 14px; }
}

/* ============================================================
   PRINT / EXPORT PDF
   ============================================================ */

@media print {
  .sidebar,
  .chat-input-area,
  .header-actions,
  .btn-sidebar-toggle,
  .trace-panel,
  .message-actions,
  .welcome-screen {
    display: none !important;
  }

  .app {
    display: block;
    height: auto;
  }

  .chat-area {
    display: block;
    height: auto;
  }

  .chat-header {
    border-bottom: 2px solid #1B2D5B;
    padding: 12px 0;
    min-height: auto;
  }

  .chat-title {
    font-size: 18px;
    font-weight: 700;
    color: #1B2D5B;
  }

  .messages {
    overflow: visible;
    padding: 16px 0;
  }

  .message {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .message-content {
    max-width: 90% !important;
  }

  .message-bubble {
    box-shadow: none;
    border: 1px solid #e5e5e3;
  }

  .message-user .message-bubble {
    background: #f0f0f0 !important;
    color: #1a1a1a !important;
  }

  .message-assistant .message-bubble {
    background: #fff !important;
  }

  body {
    background: #fff;
    font-size: 12px;
  }
}
