/* ============================================================
   Investor Debate — NotebookLM-inspired clean design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  /* Core palette */
  --bg:           #FFFFFF;
  --bg-panel:     #F8F9FA;
  --bg-card:      #FFFFFF;
  --bg-input:     #FFFFFF;
  --border:       #DADCE0;
  --border-light: #E8EAED;
  --text:         #202124;
  --text-muted:   #5F6368;
  --text-dim:     #80868B;
  --accent:       #1A73E8;
  --accent-hover: #1557B0;
  --green:        #188038;
  --red:          #C5221F;
  --yellow:       #B06200;
  --purple:       #8430CE;

  /* Sizing */
  --navbar-h:    64px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-pill: 100px;

  /* Agent chip colors */
  --agent-buffett:     #1565c0;
  --agent-munger:      #6a1b9a;
  --agent-lynch:       #2e7d32;
  --agent-greenblatt:  #e65100;
  --agent-marks:       #b71c1c;
  --agent-fisher:      #00695c;
  --agent-ackman:      #546e7a;
  --agent-mauboussin:  #4e342e;
  --agent-terry_smith: #006064;
  --agent-brad_jacobs: #1a237e;
  --agent-schmehl:     #880e4f;
  --agent-baron:       #f57f17;
  --agent-bares:       #558b2f;
  --agent-danoff:      #0277bd;
  --agent-neuberger:   #827717;
  --agent-leonard:     #1b5e20;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: none; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  height: var(--navbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-brand:hover { color: var(--text); }

.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  transition: background 0.12s, color 0.12s;
}
.nav-links a:hover { background: var(--bg-panel); color: var(--text); }
.nav-links a.active {
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent);
}

/* Nav dropdowns */
.nav-dropdown {
  position: relative;
}
.nav-drop-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.nav-drop-btn:hover { background: var(--bg-panel); color: var(--text); }
.nav-drop-btn.active {
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent);
}
.nav-caret {
  font-size: 9px;
  opacity: 0.6;
  margin-top: 1px;
}
.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  flex-direction: column;
}
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
  display: flex;
}
.nav-drop-menu a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.nav-drop-menu a:hover {
  background: var(--bg);
  color: var(--text);
}
.nav-drop-menu a.active {
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent);
}

/* Pending debates badge */
.nav-pending {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #B06200 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: rgba(176, 98, 0, 0.1);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}
.nav-pending:hover { background: rgba(176, 98, 0, 0.15); color: #B06200 !important; }
.nav-pending-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #B06200;
  animation: pulse-dot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: var(--bg-panel); text-decoration: none; color: var(--text); }

.btn-primary {
  background: #202124;
  border-color: #202124;
  color: #ffffff;
}
.btn-primary:hover { background: #3C4043; border-color: #3C4043; color: #ffffff; }

.btn-sm  { padding: 5px 14px; font-size: 13px; }
.btn-lg  { padding: 10px 26px; font-size: 15px; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg-panel); color: var(--text); border-color: transparent; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { background: var(--bg-panel); color: var(--text); border-color: var(--text-dim); }

.btn-send { border-radius: var(--radius-sm); min-width: 60px; }

/* ── Page containers ─────────────────────────────────────────── */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}
.page-narrow { max-width: 720px; }
.page-chat   {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - var(--navbar-h) - 24px);
  padding-top: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-subtitle { color: var(--text-muted); font-size: 14px; }

/* ── Filter toolbar (NotebookLM style) ──────────────────────── */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  white-space: nowrap;
}
.filter-pill:hover { background: var(--bg-panel); color: var(--text); }
.filter-pill.active {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.filter-pill-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}
.filter-pill.active .filter-pill-count { color: var(--text-muted); }

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

/* ── History table — NotebookLM style ──────────────────────── */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.history-table tbody tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; transition: background 0.1s; }
.clickable-row:hover { background: var(--bg-panel); }

/* Row icon (verdict-colored circle, like NotebookLM) */
.row-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
}

.row-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-title-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row-title-ticker {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
.row-title-company {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-col       { color: var(--text-muted); white-space: nowrap; font-size: 13px; }
.conviction-col { color: var(--text-muted); font-size: 13px; }
.analysts-col   { color: var(--text-muted); font-size: 13px; }

/* ── Verdict badges ─────────────────────────────────────────── */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.verdict-buy   { background: rgba(24,128,56,.12);  color: var(--green); }
.verdict-avoid { background: rgba(197,34,31,.12);  color: var(--red);   }
.verdict-hold  { background: rgba(176,98,0,.12);   color: var(--yellow);}
.verdict-none  { color: var(--text-dim); }

/* Status badges */
.status-queued {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(176,98,0,.1); color: #B06200;
}
.status-processing {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(26,115,232,.1); color: var(--accent);
}
.status-failed {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(197,34,31,.1); color: var(--red);
}

tr.row-pending       { opacity: 0.72; cursor: default; }
tr.row-pending:hover { background: inherit; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.35; }
.empty-state p { margin-bottom: 20px; font-size: 16px; }

/* ── Viewer split-screen ────────────────────────────────────── */
.viewer-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

.memo-panel,
.chat-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.memo-panel { border-right: 1px solid var(--border); }

.panel-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg);
  min-height: 52px;
}
.panel-title {
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.panel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.panel-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.ticker-badge {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
}
.run-date { font-size: 12px; color: var(--text-dim); }
.conviction-badge {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

/* Memo content */
.memo-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 28px 32px;
  font-size: 14px;
  line-height: 1.7;
}
.memo-content h1 { font-size: 1.5em; font-weight: 500; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 18px; margin-top: 8px; }
.memo-content h2 { font-size: 1.2em; font-weight: 500; border-bottom: 1px solid var(--border-light); padding-bottom: 4px; margin-top: 28px; margin-bottom: 12px; }
.memo-content h3 { font-size: 1.05em; font-weight: 500; margin-top: 20px; margin-bottom: 8px; }
.memo-content p  { margin-bottom: 10px; }
.memo-content ul, .memo-content ol { padding-left: 22px; margin-bottom: 10px; }
.memo-content li { margin-bottom: 4px; }
.memo-content table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.memo-content th, .memo-content td { border: 1px solid var(--border); padding: 8px 12px; }
.memo-content th { background: var(--bg-panel); font-weight: 500; }
.memo-content code { background: var(--bg-panel); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: 'Roboto Mono', monospace; }
.memo-content pre  { background: var(--bg-panel); padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; margin: 14px 0; }
.memo-content blockquote { border-left: 3px solid var(--border); padding-left: 14px; color: var(--text-muted); margin: 12px 0; }
.memo-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Agent chips ─────────────────────────────────────────────── */
.agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-family: inherit;
}
.chip:hover { border-color: var(--text-dim); color: var(--text); background: var(--bg-panel); }
.chip.active {
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 14%, transparent);
  border-color: var(--chip-color, var(--accent));
  color: var(--text);
}
.chip-all.active { background: var(--bg-panel); border-color: var(--border); color: var(--text); }

/* ── Chat messages ──────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-messages.standalone {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.chat-welcome { color: var(--text-muted); padding: 20px 0; font-size: 14px; line-height: 1.7; }
.chat-hint    { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* User bubble */
.msg-user {
  align-self: flex-end;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 10px 14px;
  max-width: 80%;
  font-size: 14px;
}

/* Agent bubble */
.msg-agent { align-self: flex-start; max-width: 95%; }
.msg-agent-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.msg-agent-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.msg-agent-name { font-size: 12px; font-weight: 500; color: var(--text-muted); }

.msg-agent-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--agent-color, var(--border-light));
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.65;
}
.msg-agent-body.streaming::after {
  content: "▌";
  animation: blink 0.7s step-start infinite;
  color: var(--text-muted);
}
@keyframes blink { 50% { opacity: 0; } }

/* Markdown inside chat bubbles */
.msg-agent-body p  { margin-bottom: 8px; }
.msg-agent-body p:last-child { margin-bottom: 0; }
.msg-agent-body ul, .msg-agent-body ol { padding-left: 20px; margin-bottom: 8px; }
.msg-agent-body li { margin-bottom: 2px; }
.msg-agent-body strong { font-weight: 600; }
.msg-agent-body em     { font-style: italic; }
.msg-agent-body code   { background: var(--bg-panel); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: 'Roboto Mono', monospace; }
.msg-agent-body pre    { background: var(--bg-panel); padding: 10px; border-radius: var(--radius-sm); overflow-x: auto; margin: 8px 0; }
.msg-agent-body table  { border-collapse: collapse; font-size: 13px; margin: 8px 0; width: 100%; }
.msg-agent-body th, .msg-agent-body td { border: 1px solid var(--border); padding: 5px 10px; }
.msg-agent-body th     { background: var(--bg-panel); font-weight: 500; }
.msg-agent-body h1, .msg-agent-body h2, .msg-agent-body h3 { margin-top: 14px; margin-bottom: 6px; font-weight: 500; }
.msg-agent-body blockquote { border-left: 2px solid var(--border); padding-left: 12px; color: var(--text-muted); margin: 8px 0; }

/* ── Chat input ──────────────────────────────────────────────── */
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.chat-textarea {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}
.chat-textarea:focus { border-color: var(--accent); background: var(--bg); }
.chat-textarea::placeholder { color: var(--text-dim); }

/* ── Forms (new run, philosophy, etc.) ──────────────────────── */
.form-row { display: flex; gap: 20px; margin-bottom: 24px; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
  flex: 1;
}
.form-group label  { font-size: 14px; font-weight: 500; color: var(--text); }
.form-hint         { font-size: 13px; color: var(--text-muted); margin-top: -2px; }
.form-hint-inline  { font-size: 13px; color: var(--text-dim); font-weight: 400; }

.form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--accent); }

.radio-group { display: flex; gap: 20px; }
.radio-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio-label input { cursor: pointer; accent-color: var(--accent); }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.12s;
}
.checkbox-label:hover { background: var(--bg-panel); }
.checkbox-label input { cursor: pointer; accent-color: var(--accent); }

.round-list { display: flex; flex-direction: column; gap: 4px; }
.round-row  { padding: 9px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.checkbox-label.round-row { background: var(--bg); border: 1px solid var(--border); }
.round-divider { color: var(--text-dim); font-size: 12px; padding: 8px 4px 4px; }
.round-fixed {
  color: var(--text-muted);
  font-size: 13px;
  padding: 9px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  opacity: 0.8;
}

/* ── Length / Run Mode selector cards ───────────────────────── */
.length-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.length-card { cursor: pointer; display: block; }
.length-card input[type="radio"] { display: none; }
.length-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.length-card:hover .length-card-body { border-color: var(--text-dim); }
.length-card input:checked ~ .length-card-body {
  border-color: var(--accent);
  background: rgba(26, 115, 232, 0.06);
  box-shadow: 0 0 0 1px var(--accent);
}
.length-name  { font-size: 14px; font-weight: 500; color: var(--text); }
.length-words { font-size: 13px; font-weight: 500; color: var(--accent); }
.length-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.form-actions { margin-top: 32px; }

/* ── Progress overlay ────────────────────────────────────────── */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.9);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.progress-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 520px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.progress-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-message { font-size: 16px; font-weight: 500; color: var(--text); text-align: center; }
.progress-log {
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  font-family: 'Roboto Mono', monospace;
  color: var(--text-muted);
}
.log-line { padding: 1px 0; line-height: 1.4; }

/* ── Chat config (standalone chat page) ─────────────────────── */
.chat-config {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chat-config label { font-size: 14px; font-weight: 500; white-space: nowrap; }

/* ── Financial tables (shared — used by viewer, chat, valuation panels) ── */
.financials-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.financials-wrap table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: max-content;
  width: 100%;
}
.financials-wrap th, .financials-wrap td {
  padding: 5px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-family: 'Roboto Mono', monospace;
}
.financials-wrap th:first-child, .financials-wrap td:first-child {
  text-align: left;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--bg-panel);
  z-index: 1;
  min-width: 220px;
  max-width: 280px;
}
.financials-wrap th {
  background: var(--bg-panel);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 2;
}
.financials-wrap th:first-child {
  z-index: 3;
}
.financials-wrap tr:hover td { background: var(--bg-hover, var(--bg-input)); }
.financials-wrap tr:hover td:first-child { background: var(--bg-hover, var(--bg-input)); }
.financials-wrap h2, .financials-wrap h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 12px 6px;
  margin: 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 0;
  white-space: nowrap;
}
.financials-wrap td.avg-col {
  color: var(--accent);
  font-weight: 600;
}
.financials-wrap p {
  font-size: 12px;
  padding: 4px 12px;
  margin: 0;
  color: var(--text-muted);
}
.financials-wrap ul {
  font-size: 12px;
  padding: 4px 12px 4px 28px;
  margin: 0;
  color: var(--text-muted);
}
.financials-wrap ul li {
  margin-bottom: 2px;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
