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

:root {
  --bg:         #0a0b0d;
  --bg2:        #0d0f12;
  --bg3:        #10131a;
  --bg4:        #141720;
  --bg5:        #1a1e28;
  --border:     #181c24;
  --border2:    #1e2230;
  --border3:    #252a38;
  --text:       #e4e6ea;
  --text-sub:   #9aa0ad;
  --text-dim:   #6b7280;
  --text-dimmer:#4a5060;
  --gold:       #d4af6a;
  --gold-dim:   #9a7a3d;
  --gold-bg:    rgba(212,175,106,0.08);
  --green:      #46c98b;
  --red:        #e3604f;
  --blue:       #6ea8d8;
  --purple:     #b58bd8;
  --font-sans:  'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Fira Code', monospace;
  --font-serif: 'Newsreader', Georgia, serif;
}

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

.hidden { display: none !important; }

/* ── ANIMATIONS ─────────────────────────────────────────────────────── */
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes thinkDot {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gateGlow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1;   }
}
@keyframes spinnerRot {
  to { transform: rotate(360deg); }
}

/* ── GATE SCREEN ────────────────────────────────────────────────────── */
.gate-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.gate-topline {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold) 70%, transparent 100%);
  animation: gateGlow 3s ease-in-out infinite;
}

.gate-container {
  width: 380px;
  text-align: center;
}

.gate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.gate-eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.gate-logo {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 6px;
}

.gate-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-dimmer);
  text-transform: uppercase;
  margin-bottom: 44px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.gate-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: left;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  outline: none;
  transition: border-color 0.2s;
}

.gate-input:focus {
  border-color: var(--gold);
}

.gate-input::placeholder {
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
}

.gate-btn {
  width: 100%;
  padding: 12px;
  background: var(--gold);
  border: none;
  border-radius: 4px;
  color: #0a0b0d;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.gate-btn:hover { background: #e3c074; }
.gate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gate-error {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--red);
  text-align: center;
}

.gate-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dimmer);
}

.gate-footer-dot { color: var(--border3); }

/* ── APP LAYOUT ─────────────────────────────────────────────────────── */
.app-screen {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 2px;
}

.sidebar-tagline {
  font-size: 10px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 10px;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-sub);
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--border);
  color: var(--text);
}

.nav-item.active {
  background: var(--gold-bg);
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: 6px;
}

.nav-item.active .nav-icon { color: var(--gold) !important; }

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.15s;
}

.nav-item:hover .nav-icon { color: var(--text); }

.nav-label { flex: 1; }

.nav-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--border2);
  color: var(--text-dim);
  flex-shrink: 0;
}

.nav-badge.live-badge {
  background: rgba(70,201,139,0.12);
  color: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.nav-badge.gold-badge {
  background: var(--gold-bg);
  color: var(--gold);
}

.sidebar-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 4px 2px;
}

.user-monogram {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-bg);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
  margin-top: 1px;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-dimmer);
  cursor: pointer;
  padding: 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.logout-btn:hover { color: var(--text-sub); }

/* ── MAIN AREA ──────────────────────────────────────────────────────── */
.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: baseline; gap: 10px; }

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

.topbar-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.mkt-status { display: flex; align-items: center; gap: 6px; }

.mkt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 3s ease-in-out infinite;
}

.mkt-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.06em;
}

.topbar-sep {
  width: 1px;
  height: 16px;
  background: var(--border2);
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── SCREEN HOST ────────────────────────────────────────────────────── */
.screen-host {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Make screens flex columns so children can use flex: 1 reliably.
     height: 100% on children of position:absolute fails when the parent's
     height is derived from inset:0 rather than an explicit height property. */
  display: flex;
  flex-direction: column;
}

.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

/* ── DASHBOARD ──────────────────────────────────────────────────────── */
.dash-hero {
  margin-bottom: 28px;
}

.dash-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-dimmer);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dash-greeting {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 400;
}

.dash-brief {
  font-size: 13px;
  color: var(--text-sub);
  max-width: 600px;
  line-height: 1.6;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
  margin-bottom: 32px;
  overflow: hidden;
}

.strip-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}

.strip-cell.no-border { border-right: none; }

.strip-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.strip-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.strip-chg {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.strip-chg.up   { color: var(--green); }
.strip-chg.down { color: var(--red); }

.dash-section-hdr {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 12px;
}

.agent-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}

.agent-card:hover {
  border-color: var(--border3);
  background: var(--bg3);
}

.agent-card-mono {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.agent-card-body { flex: 1; min-width: 0; }

.agent-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.agent-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-card-arrow {
  font-size: 16px;
  color: var(--text-dimmer);
  transition: color 0.15s;
}

.agent-card:hover .agent-card-arrow { color: var(--text-sub); }

.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.dash-col-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dash-col-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.dash-col-link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0;
}

.dash-col-link:hover { opacity: 0.7; }

.briefing-list { padding: 0 0; }

.briefing-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.briefing-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
  min-width: 52px;
}

.briefing-headline {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 4px;
}

.briefing-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
}

.recent-dl-list { padding: 4px 0; }

.recent-dl-empty {
  padding: 20px 16px;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.recent-dl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.recent-dl-item:last-child { border-bottom: none; }
.recent-dl-item:hover { background: rgba(255,255,255,0.03); }

.recent-dl-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border: 1px solid;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.recent-dl-name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.recent-dl-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
  letter-spacing: 0.03em;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-dl-dl-icon {
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.recent-dl-item:hover .recent-dl-dl-icon { opacity: 1; }

/* ── CHAT ───────────────────────────────────────────────────────────── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}

.chat-agent-mono {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.chat-agent-meta { flex: 1; }

.chat-agent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.chat-agent-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.chat-online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.06em;
}

.online-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.chat-clear-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text-dimmer);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.chat-clear-btn:hover {
  border-color: var(--border3);
  color: var(--text-sub);
}

.chat-messages {
  flex: 1;
  min-height: 0;       /* required: lets flex child shrink below content size so overflow-y works */
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

.chat-date-sep {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  padding: 4px 0 8px;
}

/* user messages */
.chat-msg { display: flex; }

.chat-msg.user-msg {
  justify-content: flex-end;
  animation: fadeUp 0.2s ease-out;
}

.chat-msg.user-msg.no-anim { animation: none; }

.user-bubble {
  max-width: 65%;
  padding: 10px 14px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 8px 8px 2px 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* agent messages */
.chat-msg.agent-msg {
  justify-content: flex-start;
  gap: 10px;
  animation: fadeUp 0.2s ease-out;
}

.chat-msg.agent-msg.no-anim { animation: none; }

.agent-bubble-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.agent-bubble {
  max-width: 72%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: 2px 8px 8px 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
}

.agent-bubble.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  border-left-color: var(--border3);
}

.think-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: thinkDot 1.4s ease-in-out infinite;
}
.think-dot:nth-child(2) { animation-delay: 0.2s; }
.think-dot:nth-child(3) { animation-delay: 0.4s; }

/* markdown inside agent bubble */
.agent-bubble h1, .agent-bubble h2, .agent-bubble h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  margin: 10px 0 4px;
}
.agent-bubble h1 { font-size: 15px; }
.agent-bubble h2 { font-size: 14px; }
.agent-bubble h3 { font-size: 13px; color: var(--gold); }
.agent-bubble p  { margin-bottom: 6px; }
.agent-bubble p:last-child { margin-bottom: 0; }
.agent-bubble ul, .agent-bubble ol { padding-left: 18px; margin: 4px 0; }
.agent-bubble li { margin-bottom: 3px; }
.agent-bubble code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg4);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--gold);
}
.agent-bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}
.agent-bubble th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 5px 8px;
  border-bottom: 1px solid var(--border2);
  text-align: left;
}
.agent-bubble td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.agent-bubble blockquote {
  border-left: 2px solid var(--border3);
  padding-left: 12px;
  color: var(--text-sub);
  font-style: italic;
  margin: 4px 0;
}
.agent-bubble hr {
  border: none;
  border-top: 1px solid var(--border2);
  margin: 10px 0;
}
.agent-bubble strong { font-weight: 600; color: var(--text); }
.agent-bubble em     { font-style: italic; color: var(--text-sub); }
.agent-bubble a      { color: var(--gold); text-decoration: none; }
.agent-bubble a:hover { text-decoration: underline; }

/* CSV card in chat */
.csv-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.csv-card:hover { border-color: var(--gold); }
.csv-card-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--green);
  border-radius: 3px;
  color: var(--green);
}
.csv-card-info { flex: 1; }
.csv-card-name { font-size: 12px; color: var(--text); font-weight: 500; }
.csv-card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.csv-card-arrow { color: var(--text-dimmer); font-size: 14px; }

/* chat bottom */
.chat-bottom {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
  padding: 12px 20px 14px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.suggestion-chip {
  padding: 5px 11px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 20px;
  color: var(--text-sub);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.suggestion-chip:hover { border-color: var(--gold-dim); color: var(--text); }

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.2s;
}

.chat-textarea:focus { border-color: var(--gold); }
.chat-textarea::placeholder { color: var(--text-dimmer); }
.chat-textarea:disabled { opacity: 0.5; }

.chat-send-btn {
  width: 38px;
  height: 38px;
  background: var(--gold);
  border: none;
  border-radius: 6px;
  color: #0a0b0d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.chat-send-btn:hover   { background: #e3c074; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-disclaimer {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
  margin-top: 8px;
  text-align: center;
}

/* ── NEWS TERMINAL ──────────────────────────────────────────────────── */
/* ── Market News mode bar ───────────────────────────────────────────────────── */
.news-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 38px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.news-mode-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.news-chat-btn {
  font-size: 11px;
  font-weight: 600;
  color: #6ea8d8;
  background: #6ea8d822;
  border: 1px solid #6ea8d855;
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}
.news-chat-btn:hover {
  background: #6ea8d833;
  color: #8fc2ea;
}
/* ── Chat header terminal breadcrumb ────────────────────────────────────────── */
.chat-terminal-link {
  font-size: 11px;
  font-weight: 600;
  color: #6ea8d8;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #6ea8d855;
  border-radius: 5px;
  background: #6ea8d815;
  margin-right: auto;
  transition: background 0.15s;
  white-space: nowrap;
}
.chat-terminal-link:hover { background: #6ea8d825; }
.chat-terminal-link.hidden { display: none; }

.ticker-bar {
  display: flex;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
  flex-shrink: 0;
}

.ticker-live-tag {
  flex-shrink: 0;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 80s linear infinite;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-sub);
  letter-spacing: 0.04em;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 28px;
}

.ticker-item::before {
  content: '·';
  color: var(--border3);
  margin-right: 4px;
}

.ticker-src {
  color: var(--gold);
  margin-right: 5px;
}

/* 3-column news layout */
#screen-news {
  display: flex;
  flex-direction: column;
}

.news-body {
  display: grid;
  grid-template-columns: 272px 1fr 264px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.news-left {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

.news-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-right {
  border-left: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

/* data panels (left) */
.data-panel {
  border-bottom: 1px solid var(--border);
  padding: 0 0 4px;
}

.data-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
}

.data-panel-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

.data-unit {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
}

.data-row {
  display: flex;
  align-items: center;
  padding: 5px 14px;
  gap: 6px;
}

.data-row:hover { background: var(--border); }

.data-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-sub);
  flex: 1;
}

.data-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.data-chg {
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.data-chg.up      { color: var(--green); }
.data-chg.down    { color: var(--red); }
.data-chg.neutral { color: var(--text-dimmer); }

/* news center */
.news-center-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.news-center-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.news-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-filter {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.news-filter:hover { color: var(--text-sub); }
.news-filter.active { background: var(--gold-bg); color: var(--gold); }

.news-refresh-btn {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 12px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.news-refresh-btn:hover { border-color: var(--border3); color: var(--text-sub); }

.headlines-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

.news-loading-msg {
  padding: 24px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.06em;
}

.headline-item {
  display: block;
  text-decoration: none;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.headline-item:hover { background: var(--bg3); }

.headline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.headline-src {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.headline-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
}

.headline-cat {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--border);
  color: var(--text-dim);
  padding: 1px 5px;
  border-radius: 3px;
}

.headline-title {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 3px;
}

.headline-summary {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* right panel */
.live-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-sub);
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.5s ease-in-out infinite;
}

.channels-list { padding: 4px 0 8px; }

.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.channel-item:hover { background: var(--bg3); }

.channel-abbr {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  width: 30px;
  flex-shrink: 0;
}

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

.channel-name {
  font-size: 11.5px;
  color: var(--text);
  font-weight: 500;
}

.channel-now {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-live-pill {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  background: rgba(227,96,79,0.15);
  color: var(--red);
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.feedstock-hdr {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 10px 14px 6px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feedstock-list { padding: 2px 0; }

.feedstock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
}

.feedstock-row:hover { background: var(--border); }

.f-name {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-sub);
  flex: 1;
}

.f-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.f-chg {
  font-family: var(--font-mono);
  font-size: 10px;
  min-width: 40px;
  text-align: right;
}

.f-chg.up   { color: var(--green); }
.f-chg.down { color: var(--red); }

/* ── DELIVERABLES ───────────────────────────────────────────────────── */
.dl-page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dl-filters {
  display: flex;
  gap: 8px;
}

.dl-filter {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
}

.dl-filter:hover { color: var(--text-sub); border-color: var(--border3); }
.dl-filter.active { border-color: var(--gold-dim); color: var(--gold); }

.dl-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dl-empty {
  padding: 32px 0;
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
}

.dl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.dl-card:hover { border-color: var(--border3); }

.dl-card-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border: 1px solid var(--green);
  border-radius: 3px;
  color: var(--green);
  flex-shrink: 0;
}

.dl-card-info { flex: 1; }
.dl-card-name { font-size: 13px; color: var(--text); font-weight: 500; margin-bottom: 3px; }
.dl-card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dimmer); }

.dl-card-btn {
  width: 32px;
  height: 32px;
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.dl-card-btn:hover { background: var(--border2); border-color: var(--border3); }

/* ── EXCEL CARD ─────────────────────────────────────────────────────── */
.excel-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.excel-card:hover { border-color: var(--green); }
.excel-card-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--green);
  border-radius: 3px;
  color: var(--green);
  flex-shrink: 0;
}
.excel-card-info { flex: 1; }
.excel-card-name { font-size: 12px; color: var(--text); font-weight: 500; }
.excel-card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.excel-card-arrow { color: var(--text-dimmer); font-size: 14px; }

/* ── DECK CARD ──────────────────────────────────────────────────────── */
.deck-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.deck-card:hover { border-color: var(--gold); }
.deck-card-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  flex-shrink: 0;
}
.deck-card-info { flex: 1; }
.deck-card-name { font-size: 12px; color: var(--text); font-weight: 500; }
.deck-card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.deck-card-arrow { color: var(--text-dimmer); font-size: 14px; }

/* ── BRAIN ──────────────────────────────────────────────────────────── */
.brain-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 100%;
  overflow: hidden;
}

.brain-graph-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.brain-graph-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brain-graph-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.brain-graph-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
}

.brain-canvas {
  flex: 1;
  width: 100%;
  display: block;
  cursor: default;
}

.brain-graph-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* right panel */
.brain-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brain-list-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brain-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.brain-search-icon {
  position: absolute;
  left: 9px;
  color: var(--text-dimmer);
  pointer-events: none;
}

.brain-search-input {
  width: 100%;
  padding: 7px 10px 7px 26px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  transition: border-color 0.2s;
}

.brain-search-input:focus { border-color: var(--blue); }
.brain-search-input::placeholder { color: var(--text-dimmer); }

.brain-save-btn {
  padding: 6px 11px;
  background: rgba(110,168,216,0.1);
  border: 1px solid rgba(110,168,216,0.3);
  border-radius: 5px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  flex-shrink: 0;
}

.brain-save-btn:hover { background: rgba(110,168,216,0.18); }

.brain-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

.brain-empty {
  padding: 28px 16px;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  line-height: 1.6;
}

.brain-date-group {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 10px 14px 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.brain-entry {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
  overflow: hidden;
}

.brain-entry:hover { background: var(--bg3); }
.brain-entry.active { background: var(--bg4); border-left: 2px solid var(--blue); padding-left: 12px; }

.brain-entry-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
  min-width: 0;
}

.brain-entry-type {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
}

.brain-entry-type.conv { background: rgba(212,175,106,0.1); color: var(--gold); }
.brain-entry-type.fact { background: rgba(110,168,216,0.1); color: var(--blue); }

.brain-entry-title {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.brain-entry-summary {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brain-entry-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dimmer);
  margin-top: 3px;
}

.brain-entry-snippet {
  font-size: 10px;
  color: var(--text-dimmer);
  margin-top: 4px;
  font-style: italic;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brain-continue-btn {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gold);
  border: 1px solid rgba(212,175,106,0.35);
  border-radius: 4px;
  background: rgba(212,175,106,0.07);
  cursor: pointer;
  transition: background 0.15s;
}
.brain-continue-btn:hover { background: rgba(212,175,106,0.14); }

/* detail panel */
.brain-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brain-back-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.brain-back-btn:hover { color: var(--text-sub); }

.brain-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border3) transparent;
}

.brain-detail-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.brain-detail-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
  margin-bottom: 14px;
}

.brain-detail-conv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brain-detail-msg {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 5px;
}

.brain-detail-msg.user {
  background: var(--bg4);
  color: var(--text);
  margin-left: 12px;
}

.brain-detail-msg.assistant {
  background: var(--bg3);
  border-left: 2px solid var(--gold);
  color: var(--text-sub);
  margin-right: 12px;
}

.brain-detail-msg .role-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--text-dimmer);
}

.brain-detail-fact {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding: 12px;
  background: rgba(110,168,216,0.06);
  border: 1px solid rgba(110,168,216,0.15);
  border-radius: 6px;
  margin-bottom: 12px;
}

.brain-delete-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: none;
  border: 1px solid rgba(227,96,79,0.3);
  border-radius: 5px;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 12px;
}

.brain-delete-btn:hover { background: rgba(227,96,79,0.08); }

/* modal */
.brain-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brain-modal {
  width: 460px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.brain-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.brain-modal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.brain-modal-close {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-size: 14px;
  cursor: pointer;
}

.brain-modal-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.brain-note-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 8px;
}

.brain-note-textarea:focus { border-color: var(--blue); }
.brain-note-textarea::placeholder { color: var(--text-dimmer); }

.brain-tags-field {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.brain-tags-field:focus { border-color: var(--blue); }
.brain-tags-field::placeholder { color: var(--text-dimmer); }

.brain-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.brain-modal-cancel {
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.brain-modal-cancel:hover { border-color: var(--border3); color: var(--text-sub); }

.brain-modal-save {
  padding: 8px 16px;
  background: rgba(110,168,216,0.1);
  border: 1px solid rgba(110,168,216,0.4);
  border-radius: 5px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
}

.brain-modal-save:hover { background: rgba(110,168,216,0.2); }

/* ── BRAIN CHAT ─────────────────────────────────────────────────────── */

/* Tab strip */
.brain-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
}
.brain-tab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dimmer);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 10px 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.brain-tab:hover { color: var(--text-sub); }
.brain-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Chat panel container */
.brain-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Messages scroll area */
.brain-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Welcome state */
.brain-chat-welcome {
  margin: auto;
  text-align: center;
  padding: 24px 12px;
  opacity: 0.7;
}
.brain-chat-welcome-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 10px;
}
.brain-chat-welcome-hint {
  font-size: 11px;
  color: var(--text-dimmer);
  line-height: 2;
}
.brain-chat-example {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-sub);
  opacity: 0.85;
}

/* Message bubbles */
.brain-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.brain-chat-msg-user {
  align-self: flex-end;
  background: rgba(184,137,58,0.12);
  border: 1px solid rgba(184,137,58,0.25);
  border-radius: 10px 10px 2px 10px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.5;
}
.brain-chat-msg-brain {
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
}

/* Brain reply text */
.brain-chat-reply-text {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 6px;
}
.brain-chat-error { color: #e57373; }

/* Conversation result cards */
.brain-chat-results {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
}
.brain-chat-result {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-left: 2px solid rgba(184,137,58,0.5);
  border-radius: 5px;
  padding: 9px 11px 8px;
}
.brain-chat-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.brain-chat-result-agent {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  color: var(--gold);
  text-transform: uppercase;
}
.brain-chat-result-date {
  font-size: 10px;
  color: var(--text-dimmer);
}
.brain-chat-result-title {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
}
.brain-chat-result-snippet {
  font-size: 10px;
  color: var(--text-dimmer);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 7px;
  white-space: pre-wrap;
}
.brain-chat-open-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(184,137,58,0.3);
  background: rgba(184,137,58,0.06);
  border-radius: 4px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.15s;
}
.brain-chat-open-btn:hover { background: rgba(184,137,58,0.14); }

/* Typing indicator */
.brain-chat-typing {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
}
.brain-chat-typing span {
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.4;
  animation: brainTypingPulse 1.2s infinite;
}
.brain-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.brain-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes brainTypingPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.9); }
  40%           { opacity: 1;    transform: scale(1.1); }
}

/* Chat input row */
.brain-chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border2);
  flex-shrink: 0;
  background: var(--bg2);
}
.brain-chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.brain-chat-input:focus { border-color: rgba(184,137,58,0.5); }
.brain-chat-input::placeholder { color: var(--text-dimmer); }
.brain-chat-input:disabled { opacity: 0.5; }
.brain-chat-send {
  background: rgba(184,137,58,0.12);
  border: 1px solid rgba(184,137,58,0.3);
  color: var(--gold);
  border-radius: 5px;
  font-size: 14px;
  width: 32px; height: 32px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brain-chat-send:hover    { background: rgba(184,137,58,0.22); }
.brain-chat-send:disabled { opacity: 0.4; cursor: default; }

/* ── USAGE TRACKER ──────────────────────────────────────────────────── */
.usage-tracker {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
}
.usage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.usage-label-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.usage-amount {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  transition: color 0.3s;
}
.usage-bar-bg {
  height: 4px;
  background: var(--border3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}
.usage-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.5s ease, background 0.3s;
}
.usage-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
}
.usage-today-ticker {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--blue);
  letter-spacing: 0.05em;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── DELIVERABLES FILING SYSTEM ─────────────────────────────────────── */
.dl-section { margin-bottom: 24px; }

.dl-section-date {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  padding: 0 0 10px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.dl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.dl-card:hover { border-color: var(--border3); }

.dl-card-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 2px 5px;
  flex-shrink: 0;
  min-width: 34px;
  text-align: center;
}

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

.dl-card-name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.dl-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
}

.dl-agent-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid;
  border-radius: 3px;
  padding: 1px 4px;
}

.dl-saved-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green);
  letter-spacing: 0.06em;
}

.dl-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dl-card-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.dl-download-btn:hover { border-color: var(--blue); color: var(--blue); }
.dl-delete-btn:hover   { border-color: var(--danger, #e05c5c); color: var(--danger, #e05c5c); }

.dl-empty {
  font-size: 12px;
  color: var(--text-dimmer);
  text-align: center;
  padding: 32px 0;
  font-family: var(--font-mono);
}

.dl-filter.active {
  background: rgba(110,168,216,0.12);
  border-color: rgba(110,168,216,0.5);
  color: var(--blue);
}


/* ── DECK BUILDING INDICATOR ────────────────────────────────────────── */
.deck-building-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 13px;
  background: rgba(212,175,106,0.05);
  border: 1px solid rgba(212,175,106,0.22);
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-sub);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.deck-building-spinner {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(212,175,106,0.25);
  border-top-color: #d4af6a;
  border-radius: 50%;
  animation: deckSpin 0.75s linear infinite;
}

@keyframes deckSpin { to { transform: rotate(360deg); } }

/* Progress label inside thinking bubble */
.think-progress-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  display: inline-block;
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 2px; }

/* ── BILLING SCREEN ─────────────────────────────────────────────────── */
.billing-page { padding: 24px; max-width: 680px; }
.billing-section { margin-bottom: 28px; }
.billing-section-title { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }

/* Balance card */
.billing-balance-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.billing-balance-card.billing-balance-low    { border-color: #f59e0b44; }
.billing-balance-card.billing-balance-critical { border-color: #e3604f55; }
.billing-balance-label { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.billing-balance-amount { font-size: 36px; font-weight: 700; font-family: var(--font-mono); color: #46c98b; line-height: 1.1; }
.billing-balance-sub { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* Sub card (monthly base) */
.billing-sub-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.billing-sub-card-link { cursor: pointer; text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.billing-sub-card-link:hover { border-color: #25d36655; background: #25d3660a; }
.billing-sub-wa-hint { font-size: 10px; color: #25d366; margin-top: 4px; font-weight: 500; }
.billing-sub-row { display: flex; justify-content: space-between; align-items: center; }
.billing-sub-label { font-size: 12px; color: var(--text-sub); }
.billing-sub-val { font-size: 12px; font-weight: 600; color: var(--text); font-family: var(--font-mono); }

/* Per-agent table */
.billing-agent-table { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.billing-agent-row { display: grid; grid-template-columns: 1fr 72px 72px 72px; padding: 8px 14px; font-size: 11px; gap: 8px; }
.billing-agent-hdr { background: var(--bg3); color: var(--muted); font-weight: 700; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.billing-agent-row:not(.billing-agent-hdr):not(.billing-agent-empty) { border-top: 1px solid var(--border); color: var(--text); font-family: var(--font-mono); }
.billing-agent-row:not(.billing-agent-hdr) span:first-child { font-family: var(--font-sans, inherit); color: var(--text-sub); }
.billing-agent-empty { color: var(--text-dim); font-style: italic; font-size: 11px; border-top: 1px solid var(--border); }

/* Top-up */
.billing-topup-row { display: flex; gap: 12px; margin-bottom: 10px; }
.billing-topup-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 16px 28px; cursor: pointer; text-decoration: none; transition: border-color 0.15s, background 0.15s; min-width: 120px; }
.billing-topup-btn:hover { border-color: #46c98b55; background: #46c98b0a; }
.billing-topup-amount { font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: #46c98b; }
.billing-topup-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.billing-topup-note { font-size: 10px; color: var(--text-dim); line-height: 1.5; }

/* History bars */
.billing-history { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.billing-history-loading { font-size: 11px; color: var(--text-dim); }
.billing-hist-row { display: grid; grid-template-columns: 60px 1fr 64px 48px; align-items: center; gap: 10px; }
.billing-hist-label { font-size: 11px; font-family: var(--font-mono); color: var(--text-sub); }
.billing-hist-bar-wrap { background: var(--bg3); border-radius: 2px; height: 6px; overflow: hidden; }
.billing-hist-bar { background: #46c98b66; height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.billing-hist-cost { font-size: 11px; font-family: var(--font-mono); color: var(--text); text-align: right; }
.billing-hist-req { font-size: 10px; color: var(--muted); text-align: right; }

/* ══════════════════════════════════ MEETINGS SCREEN ══════════════════════════════════ */
.meetings-page { display: flex; flex-direction: column; gap: 16px; padding: 20px; max-width: 780px; }

/* Consent modal */
.consent-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 200; }
.consent-modal.hidden { display: none !important; }
.consent-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 28px; max-width: 420px; width: 90%; box-shadow: 0 24px 48px rgba(0,0,0,.4); }
.consent-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.consent-body { font-size: 12px; color: var(--text-sub); line-height: 1.6; margin-bottom: 20px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent-btn-cancel  { font-size: 12px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-sub); cursor: pointer; }
.consent-btn-confirm { font-size: 12px; padding: 8px 16px; border-radius: 6px; border: none; background: var(--blue); color: #fff; cursor: pointer; font-weight: 600; }

/* Capture card */
.meetings-capture-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 28px 24px; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.meet-state { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.meet-state.hidden { display: none !important; }
.meet-state-title { font-size: 15px; font-weight: 600; color: var(--text); }
.meet-state-sub   { font-size: 11px; color: var(--text-dim); text-align: center; }

/* Action buttons */
.meet-action-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.meet-btn-primary   { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 10px 20px; border-radius: 8px; border: none; background: #e3604f; color: #fff; cursor: pointer; transition: opacity .15s; }
.meet-btn-primary:hover { opacity: .85; }
.meet-btn-secondary { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 10px 20px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); cursor: pointer; transition: opacity .15s; }
.meet-btn-secondary:hover { opacity: .8; }
.meet-btn-stop { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 10px 20px; border-radius: 8px; border: none; background: #e3604f; color: #fff; cursor: pointer; }
.meet-btn-ghost { font-size: 12px; color: var(--text-dim); background: none; border: none; cursor: pointer; padding: 6px 10px; }

/* Recording state */
.meet-record-indicator { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #e3604f; }
.meet-record-dot { width: 10px; height: 10px; border-radius: 50%; background: #e3604f; animation: meet-blink 1.2s ease-in-out infinite; }
@keyframes meet-blink { 0%,100%{opacity:1} 50%{opacity:.2} }
.meet-record-label { font-size: 12px; color: #e3604f; }
.meet-record-timer { font-family: var(--font-mono); font-size: 13px; color: var(--text-sub); margin-left: 6px; }

/* Processing state */
.meet-spinner { width: 32px; height: 32px; border: 2.5px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.meet-processing-label { font-size: 12px; color: var(--text-sub); }
.meet-progress-bar-wrap { width: 260px; max-width: 100%; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.meet-progress-bar { height: 100%; background: var(--blue); border-radius: 2px; width: 0; transition: width .4s ease; }

/* Done state */
.meet-done-check { margin-bottom: 4px; }
.meet-done-title { font-size: 15px; font-weight: 600; color: #46c98b; }
.meet-done-sub   { font-size: 11px; color: var(--text-dim); }
.meet-done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* Error state */
.meet-error-icon { margin-bottom: 4px; }
.meet-error-msg  { font-size: 12px; color: #e3604f; text-align: center; max-width: 320px; }

/* Insights panel */
.meet-insights-panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; }
.meet-insights-panel.hidden { display: none !important; }
.meet-insights-header { margin-bottom: 14px; }
.meet-insights-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.meet-insights-meta  { font-size: 11px; color: var(--text-dim); }
.meet-insights-section { margin-bottom: 14px; }
.meet-insights-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 6px; }
.meet-insights-text { font-size: 12px; color: var(--text); line-height: 1.6; }
.meet-insights-list { margin: 0; padding-left: 1.2rem; }
.meet-insights-list li { font-size: 12px; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.mi-deadline { color: var(--text-dim); }
.meet-insights-figures { display: flex; flex-wrap: wrap; gap: 10px; }
.mi-figure-chip { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; }
.mi-figure-val   { display: block; font-size: 13px; font-weight: 700; color: var(--gold, #B8893A); font-family: var(--font-mono); }
.mi-figure-label { display: block; font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* Past meetings */
.meetings-past-section { }
.meetings-past-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 10px; }
.meetings-past-list  { display: flex; flex-direction: column; gap: 8px; }
.meetings-past-empty { font-size: 12px; color: var(--text-dim); padding: 12px 0; }
.meet-past-item { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.meet-past-item:hover { border-color: var(--blue); }
.meet-past-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.meet-past-title  { font-size: 12px; font-weight: 600; color: var(--text); }
.meet-past-date   { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.meet-past-summary { font-size: 11px; color: var(--text-sub); line-height: 1.5; margin-bottom: 6px; }
.meet-past-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.meet-past-tag { font-size: 9px; padding: 2px 7px; border-radius: 3px; background: rgba(110,168,216,.1); color: var(--blue); font-family: var(--font-mono); }

/* Brain list MEET tag */
.brain-entry-type.meeting { background: rgba(184,137,58,.12); color: #B8893A; border-color: rgba(184,137,58,.25); }

/* ══════════════════════════════════════════════════════════════════════════════
   WEEKLY MARKET REPORT
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Report layout ── */
.report-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 0;
  height: 100%;
  overflow: hidden;
}
.report-main {
  overflow-y: auto;
  padding: 28px 32px;
  border-right: 1px solid var(--border);
}
.report-sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  background: var(--bg2);
  min-height: 0;
}
/* ── Sidebar header + archive ── */
.report-sidebar-hdr {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
.report-archive-list  { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; min-height: 0; }
.report-archive-empty { font-size: 11px; color: var(--text-dim); padding: 6px 0; }
.report-archive-item  {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.report-archive-item:hover  { border-color: var(--gold-dim); background: var(--gold-bg); }
.report-archive-item.active { border-color: var(--gold); background: var(--gold-bg); }
.report-archive-date {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  display: block;
}
.report-archive-item.active .report-archive-date { color: var(--gold); }

/* ── Sidebar actions ── */
.report-sidebar-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.report-generate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.report-generate-btn:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--gold); }
.report-generate-btn:disabled             { opacity: .5; cursor: not-allowed; }
.report-dl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  margin-top: 8px;
}
.report-dl-btn:hover:not(:disabled) { border-color: #6B8CBF88; color: #6B8CBF; }
.report-dl-btn:disabled             { opacity: .4; cursor: not-allowed; }
.report-generate-note { font-size: 10px; color: var(--text-dim); margin-top: 6px; line-height: 1.4; text-align: center; }

/* ── Loading / empty / error states ── */
.report-loading-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 40px 0;
}
.report-spinner {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rpt-error { color: var(--red); font-size: 12px; font-family: var(--font-mono); padding: 20px 0; }
.rpt-gen-error { background: rgba(227,96,79,0.08); border: 1px solid rgba(227,96,79,0.3); border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--red); line-height: 1.5; }
.rpt-gen-error-msg { word-break: break-word; }
.rpt-empty { padding: 40px 0; }
.rpt-empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.rpt-empty-sub   { font-size: 12px; color: var(--text-dim); line-height: 1.6; max-width: 340px; }

/* ── Report document ── */
.rpt-doc { max-width: 820px; }

.rpt-doc-header {
  border-bottom: 1px solid var(--border2);
  padding-bottom: 20px;
  margin-bottom: 24px;
}
.rpt-doc-eyebrow {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.rpt-doc-re {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  font-family: var(--font-sans);
}
.rpt-doc-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.rpt-meta-sep { margin: 0 8px; color: var(--border3); }

/* ── Sections ── */
.rpt-section { margin-bottom: 28px; }
.rpt-section-hdr {
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--border2);
  padding-bottom: 6px;
  margin-bottom: 14px;
}

/* ── Macro data table ── */
.rpt-table-wrap { overflow-x: auto; }
.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.rpt-table thead tr { background: #131620; }
.rpt-table thead th {
  text-align: left;
  padding: 8px 10px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.rpt-table thead th:nth-child(n+3) { text-align: right; }
.rpt-table tbody tr { border-bottom: 1px solid var(--border); }
.rpt-table tbody tr:hover { background: var(--bg3); }

/* Region band row */
.rpt-region-row td {
  padding: 7px 10px 5px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-sub);
  font-weight: 600;
  background: var(--bg3);
  border-bottom: 1px solid var(--border2);
  border-top: 1px solid var(--border2);
}

/* Data cells */
.rpt-td-date  { padding: 7px 10px; color: var(--text-dim); white-space: nowrap; }
.rpt-td-event { padding: 7px 10px; color: var(--text); }
.rpt-td-num   { padding: 7px 10px; text-align: right; color: var(--text-sub); }
.rpt-beat     { color: var(--green) !important; font-weight: 600; }
.rpt-miss     { color: var(--red)   !important; font-weight: 600; }

/* Beat/miss legend */
.rpt-beat-legend { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.rpt-beat-sample { color: var(--green); font-weight: 600; }
.rpt-miss-sample { color: var(--red);   font-weight: 600; }
.rpt-legend-note { color: var(--text-dimmer); }

/* ── Commentary subsections ── */
.rpt-subsection { margin-bottom: 14px; }
.rpt-subsection-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rpt-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rpt-bullets li {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.65;
  padding-left: 14px;
  position: relative;
}
.rpt-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dimmer);
}
.rpt-bullets li p { margin: 0; }
.rpt-bullets li a { color: var(--blue); text-decoration: none; }
.rpt-bullets li a:hover { text-decoration: underline; }
.rpt-bullet-label {
  font-weight: 600;
  color: var(--text);
  font-style: italic;
}

/* ── Sources footer ── */
.rpt-sources { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.rpt-sources-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 8px; font-family: var(--font-mono); }
.rpt-sources-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.rpt-sources-list li { font-size: 10px; font-family: var(--font-mono); }
.rpt-sources-list a { color: var(--blue); text-decoration: none; word-break: break-all; }
.rpt-sources-list a:hover { text-decoration: underline; }

.rpt-footer { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 10px; font-family: var(--font-mono); color: var(--text-dimmer); }

/* ── Dashboard widget ── */
.report-dash-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  min-height: 80px;
}
.rdw-empty  { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.rdw-meta   { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 5px; }
.rdw-title  { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.rdw-bullet { font-size: 11.5px; color: var(--text-sub); line-height: 1.55; padding-left: 12px; position: relative; margin-bottom: 4px; }
.rdw-bullet::before { content: '—'; position: absolute; left: 0; color: var(--text-dimmer); }
.rdw-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gold);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: .04em;
}
.rdw-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first, ≤768px
   Desktop layout (≥1024px) is visually unchanged.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile-only elements: hidden on desktop ────────────────────────────── */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 4px;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 5px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.mobile-menu-btn:active { background: var(--border); color: var(--text); }

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 390;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-overlay.visible { display: block; }

.bottom-tabs { display: none; }

.brain-graph-close-mobile { display: none; }
.brain-graph-tab-btn      { display: none !important; }

/* ─────────────────────────────────────────────────────────────────────────
   @media (max-width: 768px) — MOBILE
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Mobile-only elements: visible ─── */
  .mobile-menu-btn          { display: flex; }
  .brain-graph-tab-btn      { display: flex !important; }

  /* ── App shell: single column ─── */
  .app-screen {
    grid-template-columns: 1fr;
    height: 100vh;
    height: 100dvh;
  }

  /* ── Sidebar → slide-out drawer ─── */
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 85vw);
    height: 100%;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    padding-top: env(safe-area-inset-top);
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar-nav { padding-top: 8px; }

  /* Larger touch targets in drawer */
  .nav-item { min-height: 44px; padding: 9px 10px; }

  /* ── Topbar with safe-area notch clearance ─── */
  .topbar {
    padding: 0 14px;
    padding-top: env(safe-area-inset-top);
    height: calc(50px + env(safe-area-inset-top));
    min-height: calc(50px + env(safe-area-inset-top));
  }

  .topbar-left {
    align-items: center;
    gap: 0;
    min-width: 0;
    flex: 1;
  }

  .topbar-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .topbar-sub  { display: none; }
  .mkt-label   { display: none; }
  .topbar-sep  { display: none; }

  .topbar-right { flex-shrink: 0; gap: 8px; }

  .topbar-clock { font-size: 10px; letter-spacing: 0.04em; white-space: nowrap; }

  /* ── Main area: make room for bottom tabs + notch ─── */
  .main-area {
    height: 100vh;
    height: 100dvh;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  /* ── Scroll areas: compact padding ─── */
  .scroll-area { padding: 20px 16px 28px; }

  /* ── Bottom tab bar ─── */
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg2);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  }

  .btab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px 4px;
    min-height: 56px;
    min-width: 0;
    transition: color 0.15s;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .btab:active { color: var(--text-sub); }

  .btab.active { color: var(--gold); }

  .btab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--gold);
    border-radius: 0 0 2px 2px;
  }

  /* ── Dashboard ─── */
  .dash-hero    { margin-bottom: 20px; }
  .dash-greeting { font-size: 20px; }

  .market-strip {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
  }
  .strip-cell { padding: 10px 8px; min-width: 0; }
  .strip-val  { font-size: 13px; }
  .strip-lbl  { font-size: 8px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .agent-cards   { gap: 6px; margin-bottom: 22px; }
  .agent-card    { padding: 12px 14px; min-height: 60px; }
  .agent-card-desc {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .dash-cols { grid-template-columns: 1fr; gap: 12px; }

  /* Always show download icon (no hover on touch) */
  .recent-dl-dl-icon { opacity: 1 !important; }

  /* Minimum 44px tap targets */
  .agent-card,
  .brain-entry,
  .headline-item,
  .meet-past-item,
  .recent-dl-item,
  .dl-card,
  .report-archive-item,
  .channel-item { min-height: 44px; }

  /* ── Chat ─── */
  .chat-hdr       { padding: 10px 14px; gap: 8px; }
  .chat-agent-tag { display: none; }
  .chat-online    { display: none; }
  .chat-clear-btn { min-height: 36px; padding: 6px 10px; }

  .chat-messages { padding: 12px 14px; gap: 10px; }

  .user-bubble  { max-width: 85%; font-size: 13px; }
  .agent-bubble { max-width: 94%; }

  /* ≥16px on all inputs prevents iOS auto-zoom on focus */
  .chat-textarea { font-size: 16px; }

  .chat-bottom      { padding: 10px 14px 12px; }
  .chat-suggestions { margin-bottom: 8px; }
  .suggestion-chip  { font-size: 11px; padding: 6px 10px; min-height: 36px; }
  .chat-send-btn    { width: 44px; height: 44px; }
  .chat-disclaimer  { display: none; }

  /* Agent bubble tables: horizontal scroll */
  .agent-bubble table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
  }

  /* ── News terminal: stack 3 columns vertically ─── */
  #screen-news .news-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .news-center {
    order: -1;         /* headlines first */
    overflow: visible;
    display: block;
    min-height: 240px;
  }

  .headlines-list {
    overflow: visible;
    max-height: none;
  }

  .news-left, .news-right {
    overflow: visible;
    border-right: none;
    border-left:  none;
    border-top: 1px solid var(--border);
  }

  .news-mode-bar   { padding: 0 12px; }
  .news-mode-label { font-size: 9px; letter-spacing: 0.08em; }

  /* Remove hover states on touch (would flicker on tap) */
  .data-row:hover,
  .feedstock-row:hover { background: none; }

  .channel-item { min-height: 44px; }

  /* ── Brain: list is primary; graph is a fullscreen overlay ─── */
  .brain-layout { grid-template-columns: 1fr; }

  .brain-graph-panel {
    display: none;
    border-right: none;
  }

  .brain-graph-panel.mobile-graph-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 450;
    background: var(--bg);
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
  }

  .brain-graph-close-mobile {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border2);
    border-radius: 5px;
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    cursor: pointer;
    min-height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brain-list-panel { width: 100%; }

  /* ≥16px prevents iOS zoom */
  .brain-search-input,
  .brain-note-textarea,
  .brain-tags-field,
  .brain-chat-input { font-size: 16px; }

  .brain-modal {
    width: calc(100vw - 32px);
    max-width: 420px;
  }

  .brain-entry    { min-height: 48px; }
  .brain-back-btn { min-height: 44px; }
  .brain-save-btn { min-height: 36px; padding: 6px 14px; }
  .brain-chat-send { width: 40px; height: 40px; }

  /* ── Weekly Report: collapse sidebar below main content ─── */
  .report-layout {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    grid-template-columns: unset;
  }

  .report-main {
    border-right: none;
    padding: 20px 16px;
    overflow: visible;
  }

  .report-sidebar {
    border-top: 1px solid var(--border);
    padding: 16px;
    overflow: visible;
  }

  .report-archive-item { min-height: 44px; }
  .report-generate-btn { min-height: 44px; }

  /* ── Billing ─── */
  .billing-page { padding: 16px; }

  .billing-agent-row {
    grid-template-columns: 1fr 52px 52px 58px;
    font-size: 10px;
    padding: 8px 10px;
  }

  .billing-topup-row { gap: 10px; }

  .billing-topup-btn {
    flex: 1;
    padding: 12px 10px;
    min-width: 0;
    min-height: 70px;
  }

  /* ── Meetings ─── */
  .meetings-page        { padding: 16px; gap: 12px; }
  .meetings-capture-card { padding: 24px 16px; }

  .meet-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .meet-btn-primary,
  .meet-btn-secondary,
  .meet-btn-stop { justify-content: center; min-height: 46px; }

  .meet-done-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* ── Gate screen ─── */
  .gate-container { width: calc(100vw - 48px); }
  .gate-logo      { font-size: 40px; }
  .gate-input     { font-size: 16px; }
  .gate-btn       { min-height: 48px; }

  /* ── Overflow guardrails ─── */
  .screen-host { overflow-x: hidden; }

  .topbar-left,
  .topbar-right,
  .agent-card-body,
  .channel-info,
  .recent-dl-info,
  .dl-card-info,
  .user-info,
  .brain-entry-row,
  .briefing-body,
  .nav-label { min-width: 0; }
}

/* ── Very small phones (≤479px) ─────────────────────────────────────────── */
@media (max-width: 479px) {
  .market-strip { grid-template-columns: repeat(2, 1fr); }

  .strip-cell { border-bottom: 1px solid var(--border); }
  .strip-cell.no-border,
  .strip-cell:nth-last-child(-n+2) { border-bottom: none; }

  .dash-greeting { font-size: 18px; }
  .topbar-title  { font-size: 12px; }
  .topbar-clock  { font-size: 9px; }

  .user-bubble  { max-width: 91%; }
  .agent-bubble { max-width: 98%; }
  .chat-agent-name { font-size: 12px; }
}
