/* ═══════════════════════════════════════════════════════════════════════════
   NPTS ORBIT — Bloomberg-Style Financial Terminal
   styles.css — Bloomberg Visual Overhaul
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --bg-primary:      #000000;
  --bg-panel:        #050505;
  --bg-panel-alt:    #0a0a0a;
  --bg-hover:        #111111;
  --bg-active:       #0d1a00;
  --bg-section-hdr:  #001a33;
  --border:          #1a1a1a;
  --border-bright:   #2a2a2a;
  --border-focus:    #FF8C00;
  --text-primary:    #d0d0d0;
  --text-secondary:  #c0c0c0;
  --text-dim:        #909090;
  --text-muted:      #404040;
  --accent-amber:    #FF8C00;
  --accent-cyan:     #00AACC;
  --accent-green:    #00CC66;
  --accent-red:      #CC3333;
  --accent-orange:   #FF6600;
  --accent-purple:   #8866CC;
  --up:              #00CC66;
  --down:            #CC3333;
  --unchanged:       #888888;
  --header-height:   36px;
  --sidebar-width:   52px;
  --ticker-tape-h:   22px;
  --font-mono:       'Roboto Mono', 'Courier New', monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ─── Header Bar — Bloomberg style ──────────────────────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: #0a0a0a;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 10px;
  z-index: 100;
}

#app-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-transform: uppercase;
  padding-right: 10px;
  border-right: 1px solid #2a2a2a;
  line-height: 1;
}

#app-logo span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.04em;
}

#clock {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 130px;
}

#clock .clock-date { color: var(--text-muted); font-size: 9px; }
#clock .clock-time { color: var(--text-secondary); font-size: 11px; font-weight: 600; }

#command-bar-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
}

#command-bar {
  width: 100%;
  background: #000;
  border: 1px solid #2a2a2a;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px 3px 26px;
  outline: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.1s;
}

#command-bar:focus {
  border-color: var(--accent-amber);
}

#command-bar-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-amber);
  font-size: 9px;
  pointer-events: none;
  opacity: 0.6;
}

#command-bar::placeholder {
  color: #333;
  letter-spacing: 0.04em;
}

#command-hint {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.header-spacer { flex: 1; }

/* Header center — module title */
#header-center-title {
  flex: 2;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header right — platform label + live badge */
#header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid #1e1e1e;
  padding-left: 10px;
  white-space: nowrap;
}

#header-platform-label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#header-live-badge,
.header-session-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  letter-spacing: 0.12em;
  transition: all 0.3s;
}

.session-live {
  background: #002200;
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.session-pre {
  background: #1a1a00;
  border: 1px solid #ccaa00;
  color: #ccaa00;
}

.session-after {
  background: #1a0a00;
  border: 1px solid #ff8800;
  color: #ff8800;
}

.session-closed {
  background: #1a0000;
  border: 1px solid #666;
  color: #666;
}

#market-status {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid #1a1a1a;
  padding-left: 10px;
}

.market-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text-dim);
}

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

.status-dot.orange { background: var(--accent-orange); animation: none; }
.status-dot.red    { background: var(--accent-red); animation: none; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: var(--ticker-tape-h);
  width: var(--sidebar-width);
  background: #050505;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  z-index: 90;
  gap: 1px;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #444;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  gap: 2px;
  transition: background 0.1s, color 0.1s;
  border-left: 2px solid transparent;
  width: 100%;
  text-align: center;
}

.nav-btn:hover {
  background: #0d0d0d;
  color: #888;
}

.nav-btn.active {
  background: #030d00;
  color: var(--accent-amber);
  border-left-color: var(--accent-amber);
}

.nav-btn .nav-key {
  font-size: 7px;
  color: #333;
  font-weight: 400;
  margin-top: 1px;
}

.nav-btn.active .nav-key { color: var(--accent-amber); opacity: 0.5; }

.nav-divider {
  height: 1px;
  background: #111;
  margin: 2px 6px;
}

/* ─── Main Content ──────────────────────────────────────────────────────── */
#main-content {
  position: fixed;
  top: var(--header-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: var(--ticker-tape-h);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
}

/* ─── Module Header — Bloomberg style ────────────────────────────────────── */
.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 22px;
}

.module-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.module-go {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
}

.module-go span { color: var(--text-muted); font-weight: 400; }

/* ─── Bloomberg Section Headers — numbered, dark-blue bg ─────────────────── */
.bb-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px;
  background: var(--bg-section-hdr);
  border-top: 1px solid #003366;
  border-bottom: 1px solid #003366;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.bb-section-hdr .bb-sec-num {
  color: var(--accent-amber);
  margin-right: 4px;
}

.bb-section-hdr .bb-sec-link {
  color: #5599cc;
  font-size: 9px;
  font-weight: 400;
  cursor: pointer;
}

.bb-section-hdr .bb-sec-link:hover { color: #88ccff; text-decoration: underline; }

/* ─── Panel / Card — Bloomberg flat style ────────────────────────────────── */
.panel {
  background: var(--bg-primary);
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: #080808;
  border-bottom: 1px solid #1a1a1a;
}

.panel-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-subtitle {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.panel-body { padding: 6px 8px; }

/* ─── Loading / Error States ─────────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  color: var(--accent-amber);
  font-size: 10px;
  letter-spacing: 0.15em;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  color: var(--accent-red);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* ─── Colors ─────────────────────────────────────────────────────────────── */
.up        { color: var(--up); }
.down      { color: var(--down); }
.unchanged { color: var(--unchanged); }
.amber     { color: var(--accent-amber); }
.cyan      { color: var(--accent-cyan); }
.dim       { color: var(--text-dim); }
.muted     { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.purple    { color: var(--accent-purple); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.data-table th {
  text-align: left;
  color: var(--accent-amber);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}

.data-table th.right { text-align: right; }

.data-table td {
  padding: 3px 6px;
  border-bottom: 1px solid #111;
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table td.right { text-align: right; }
.data-table td.center { text-align: center; }

.data-table tr:hover td { background: #0a0a0a; }
.data-table tr:last-child td { border-bottom: none; }

/* ─── Buttons & Toggles ─────────────────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 1px;
}

.tf-btn {
  background: transparent;
  border: 1px solid #222;
  color: #555;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.1s;
}

.tf-btn:hover { background: #0d0d0d; color: #888; border-color: #333; }
.tf-btn.active { background: #001a33; color: #fff; border-color: #003366; }
.tf-btn.eq-iv-btn.active { background: rgba(0,204,255,0.08); color: #00ccff; border-color: #00667f; }

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.1s;
  white-space: nowrap;
}

.tab-btn:hover { color: #888; }
.tab-btn.active { color: var(--accent-amber); border-bottom-color: var(--accent-amber); }

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1a1a1a;
  padding: 0 8px;
  background: #050505;
}

/* Bloomberg-style number-bracket nav tabs */
.bb-nav-tabs {
  display: flex;
  gap: 0;
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.bb-nav-tabs::-webkit-scrollbar { display: none; }

.bb-tab {
  background: transparent;
  border: none;
  border-right: 1px solid #1a1a1a;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: all 0.1s;
}

.bb-tab .bb-tab-num {
  color: #444;
  font-size: 9px;
  margin-right: 1px;
}

.bb-tab:hover {
  background: #0a0a0a;
  color: #999;
}

.bb-tab:hover .bb-tab-num { color: #777; }

.bb-tab.active {
  background: #001a33;
  color: #fff;
  border-bottom: 1px solid var(--accent-amber);
}

.bb-tab.active .bb-tab-num { color: var(--accent-amber); }

/* Checkboxes styled */
.curve-toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.curve-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  user-select: none;
}

.curve-toggle input[type="checkbox"] { display: none; }

.curve-check {
  width: 10px; height: 10px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  transition: all 0.1s;
}

.curve-toggle input:checked + .curve-check {
  background: currentColor;
  border-color: currentColor;
  color: #000;
}

.curve-toggle input:checked ~ .curve-label { opacity: 1; }
.curve-toggle .curve-label { opacity: 0.5; transition: opacity 0.1s; }

/* ─── EQ MODULE ──────────────────────────────────────────────────────────── */
#eq-module { padding: 0; }

/* Bloomberg EQ Module Header Strip */
#eq-bb-header {
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  padding: 0;
}

#eq-bb-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  border-bottom: 1px solid #111;
}

#eq-bb-ticker-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.06em;
}

#eq-bb-page-title {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

#eq-bb-right-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--text-dim);
}

/* Dense quote strip — single row Bloomberg style */
#eq-quote-strip {
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 24px;
  font-size: 11px;
  line-height: 1.3;
}

#eq-quote-strip .qs-ticker {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.06em;
  margin-right: 8px;
  white-space: nowrap;
}

#eq-quote-strip .qs-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 6px;
  white-space: nowrap;
}

#eq-quote-strip .qs-change {
  font-size: 11px;
  font-weight: 600;
  margin-right: 10px;
  white-space: nowrap;
}

#eq-quote-strip .qs-divider {
  color: #333;
  margin: 0 6px;
  font-size: 11px;
}

#eq-quote-strip .qs-stat {
  white-space: nowrap;
  margin-right: 8px;
  font-size: 10px;
}

#eq-quote-strip .qs-stat-label {
  color: var(--text-dim);
  margin-right: 2px;
}

#eq-quote-strip .qs-stat-val {
  color: var(--text-primary);
}

#eq-quote-strip .qs-status {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  letter-spacing: 0.1em;
  border: 1px solid;
}

#eq-quote-strip .qs-status.open  { color: var(--accent-green); border-color: var(--accent-green); background: rgba(0,204,102,0.08); }
#eq-quote-strip .qs-status.closed { color: var(--accent-orange); border-color: var(--accent-orange); background: rgba(255,102,0,0.08); }

/* Second quote row: volume + OHLC */
#eq-quote-row2 {
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  padding: 2px 10px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 18px;
  font-size: 10px;
  line-height: 1.3;
}

#eq-quote-row2 .qs-stat {
  white-space: nowrap;
  margin-right: 10px;
  font-size: 10px;
}

#eq-quote-row2 .qs-stat-label {
  color: var(--text-dim);
  margin-right: 2px;
}

#eq-quote-row2 .qs-stat-val {
  color: var(--text-secondary);
}

#eq-quote-row2 .qs-stat-val.up { color: var(--up); }
#eq-quote-row2 .qs-stat-val.down { color: var(--down); }

/* Ticker input bar */
#eq-ticker-bar {
  background: #050505;
  border-bottom: 1px solid #111;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#eq-ticker-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

#eq-ticker-input-label { font-size: 9px; color: var(--text-dim); letter-spacing: 0.08em; }

#eq-ticker-input {
  background: #000;
  border: 1px solid #2a2a2a;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  width: 90px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.1s;
}

#eq-ticker-input:focus { border-color: var(--accent-amber); }

#eq-ticker-go-btn {
  background: #001a33;
  border: 1px solid #003366;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.1s;
}

#eq-ticker-go-btn:hover { background: #002244; }

.suggested-tickers {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.sug-ticker {
  font-size: 8px;
  color: #444;
  cursor: pointer;
  padding: 1px 4px;
  border: 1px solid #1a1a1a;
  letter-spacing: 0.06em;
  transition: all 0.1s;
}

.sug-ticker:hover { color: var(--accent-amber); border-color: #333; }

/* EQ main grid */
#eq-main-grid {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 0;
  border-top: none;
}

/* Left column */
#eq-left-col {
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
}

#eq-chart-panel { flex: none; }

.chart-container {
  padding: 6px 8px 3px;
  position: relative;
}

#eq-price-chart-wrap { height: 200px; }
#eq-volume-chart-wrap { height: 50px; }

.tf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-top: 1px solid #111;
  background: #050505;
}

/* Right column panels */
#eq-right-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  border-bottom: 1px solid #0d0d0d;
  position: relative;
}

.metric-row:nth-child(odd) { background: rgba(255,255,255,0.005); }

.metric-key {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  cursor: help;
}

.metric-val {
  font-size: 10px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* Tooltip */
.metric-key[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0; top: 100%;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: var(--text-secondary);
  font-size: 9px;
  padding: 4px 7px;
  z-index: 200;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  min-width: 180px;
  letter-spacing: 0;
}

.metric-key[data-tooltip]:hover::after { opacity: 1; }

/* Company profile — Bloomberg dense 3-col layout */
.profile-grid {
  padding: 0 2px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  font-size: 9px;
}

.profile-key { color: var(--text-dim); white-space: nowrap; }
.profile-val { color: var(--text-secondary); }
.profile-val a { color: var(--accent-cyan); text-decoration: none; }
.profile-val a:hover { text-decoration: underline; }

/* Bloomberg 3-column company overview grid */
.bb-company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid #1a1a1a;
}

.bb-company-col {
  border-right: 1px solid #1a1a1a;
  padding: 6px 8px;
}

.bb-company-col:last-child { border-right: none; }

.bb-company-col .bb-col-title {
  font-size: 9px;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 2px;
}

.bb-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 1px 0;
  font-size: 9px;
}

.bb-kv-row .bb-k { color: var(--text-dim); white-space: nowrap; }
.bb-kv-row .bb-v { color: var(--text-primary); text-align: right; font-weight: 500; }
.bb-kv-row .bb-v a { color: var(--accent-cyan); text-decoration: none; }
.bb-kv-row .bb-v a:hover { text-decoration: underline; }

.company-desc {
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  padding: 5px 8px;
  border-bottom: 1px solid #111;
  max-height: 120px;
  overflow-y: auto;
}

.next-earnings {
  font-size: 9px;
  margin-bottom: 4px;
}

/* Earnings beat/miss */
.beat  { color: var(--up); }
.miss  { color: var(--down); }
.inline{ color: var(--unchanged); }

/* ─── ECON MODULE ────────────────────────────────────────────────────────── */
#econ-module { padding: 0; }
.econ-body { padding: 0; }

/* ECON Sub-tab bar (mirrors FI tab bar) */
.econ-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1a1a1a;
  padding: 0 8px;
  background: #050505;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.econ-tab-bar::-webkit-scrollbar { display: none; }

.econ-sub-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  white-space: nowrap;
}
.econ-sub-tab:hover { color: #888; }
.econ-sub-tab.active { color: var(--accent-amber); border-bottom-color: var(--accent-amber); }

/* Fed Policy banner */
.econ-fed-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #080808;
  border-bottom: 1px solid #1a1a1a;
}
.econ-fed-label {
  font-size: 9px;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
  font-weight: 700;
}
.econ-fed-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Dynamic indicator grids */
.econ-ind-grid {
  display: grid;
  gap: 1px;
  background: #111;
  margin: 0;
}
.econ-ind-cols-1 { grid-template-columns: 1fr; }
.econ-ind-cols-2 { grid-template-columns: repeat(2, 1fr); }
.econ-ind-cols-3 { grid-template-columns: repeat(3, 1fr); }
.econ-ind-cols-4 { grid-template-columns: repeat(4, 1fr); }

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #111;
  margin: 0;
}

.indicator-tile {
  background: #050505;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ind-name {
  font-size: 9px;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.ind-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.01em;
}

.ind-value .ind-unit { font-size: 11px; font-weight: 500; color: var(--text-dim); }

.ind-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
}

.ind-arrow { font-size: 10px; font-weight: 700; }
.ind-prev { color: var(--text-muted); }
.ind-date { color: var(--text-muted); font-size: 8px; margin-top: 1px; }

.econ-charts-row {
  display: grid;
  gap: 1px;
  background: #111;
}
.econ-charts-cols-1 { grid-template-columns: 1fr; }
.econ-charts-cols-2 { grid-template-columns: repeat(2, 1fr); }
.econ-charts-cols-3 { grid-template-columns: repeat(3, 1fr); }

.econ-chart-panel { background: #050505; }
.econ-chart-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 8px 0 8px;
}
.econ-chart-wrap  { height: 170px; padding: 4px 8px 6px; }

.upcoming-releases { }
.release-header {
  font-size: 9px;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 8px;
  border-bottom: 1px solid #2a2a2a;
  background: #050505;
}

/* ─── FI MODULE ──────────────────────────────────────────────────────────── */
#fi-module { padding: 0; }

#fi-controls {
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.fi-control-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 4px;
}

#fi-main-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1px;
  background: #111;
}

#fi-left { background: #000; display: flex; flex-direction: column; }
#fi-right { background: #000; display: flex; flex-direction: column; }

#fi-curve-chart-wrap { height: 280px; padding: 8px 10px 5px; }

#fi-table-wrap { overflow-x: auto; }

.fi-right-panel { border-bottom: 1px solid #1a1a1a; }

/* Benchmarks */
.benchmark-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  border-bottom: 1px solid #0d0d0d;
  font-size: 10px;
}

.benchmark-row:last-child { border-bottom: none; }
.benchmark-label { color: var(--text-secondary); }
.benchmark-yield { color: var(--text-primary); font-weight: 600; }
.benchmark-chg   { font-size: 9px; }

/* Spread rows */
.spread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  border-bottom: 1px solid #0d0d0d;
  gap: 3px;
}

.spread-row:last-child { border-bottom: none; }
.spread-label { color: var(--text-secondary); font-size: 9px; flex: 1; }
.spread-val   { font-size: 10px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.spread-chg   { font-size: 9px; white-space: nowrap; }

/* Sparklines */
.sparkline-wrap { width: 50px; height: 18px; }

/* ─── FI SUB-TABS ──────────────────────────────────────────────────────── */
.fi-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1a1a1a;
  padding: 0 8px;
  background: #050505;
}

.fi-sub-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.15s;
  white-space: nowrap;
}

.fi-sub-tab:hover { color: #888; }
.fi-sub-tab.active { color: var(--accent-amber); border-bottom-color: var(--accent-amber); }

/* ─── FI SPREADS TAB ───────────────────────────────────────────────────── */

#fi-spread-controls {
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fi-spread-tf-group { display: flex; gap: 3px; }

/* Summary cards row */
#fi-spread-summary {
  display: flex;
  gap: 1px;
  background: #111;
  padding: 0;
  overflow-x: auto;
}

.spd-card {
  flex: 1;
  min-width: 120px;
  background: #0a0a0a;
  padding: 6px 8px;
  border-bottom: 1px solid #1a1a1a;
}

.spd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.spd-card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.05em;
}

.spd-card-cat {
  font-size: 8px;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spd-card-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 2px;
}

.spd-card-unit {
  font-size: 9px;
  color: #555;
  margin-left: 2px;
  font-weight: 400;
}

.spd-card-changes {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}

.spd-card-chg {
  font-size: 9px;
  color: #555;
}

.spd-card-chg.up   { color: #00CC66; }
.spd-card-chg.down  { color: #CC3333; }

.spd-card-range {
  font-size: 8px;
  color: #444;
}

.spd-card-lo { color: #CC3333; }
.spd-card-hi { color: #00CC66; }

/* Chart grid */
.fi-spread-chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: #111;
}

.fi-spread-chart-panel {
  background: #0a0a0a;
  padding: 6px 8px 4px;
}

.fi-spread-chart-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1px;
}

.fi-spread-chart-name {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.fi-spread-chart-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.fi-spread-chart-val.up   { color: #00CC66; }
.fi-spread-chart-val.down  { color: #CC3333; }

.fi-spread-chart-desc {
  font-size: 8px;
  margin-bottom: 3px;
  line-height: 1.3;
}

.fi-spread-chart-wrap {
  height: 180px;
  position: relative;
}

.fi-spd-section-hdr {
  margin-top: 1px;
}

/* Overlay chart */
.fi-spread-overlay-wrap {
  height: 300px;
  padding: 8px 10px 5px;
  background: #0a0a0a;
}

/* Detail table */
.fi-spread-detail-wrap {
  overflow-x: auto;
  background: #0a0a0a;
}

@media (max-width: 768px) {
  .fi-spread-chart-row { grid-template-columns: 1fr; }
  #fi-spread-summary { flex-wrap: wrap; }
  .spd-card { min-width: 100px; }
  .fi-spread-overlay-wrap { height: 220px; }
}

/* ─── Ticker Tape (bottom scrolling bar) ─────────────────────────────────── */
#ticker-tape {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--ticker-tape-h);
  background: #050505;
  border-top: 1px solid #1a1a1a;
  overflow: hidden;
  z-index: 200;
  display: flex;
  align-items: center;
}

#ticker-tape-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}

#ticker-tape-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.tt-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 14px 0 0;
  font-size: 10px;
  white-space: nowrap;
}

.tt-item .tt-sym {
  color: var(--accent-amber);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tt-item .tt-price {
  color: var(--text-secondary);
}

.tt-item .tt-chg {
  font-size: 9px;
}

.tt-item .tt-chg.up   { color: var(--up); }
.tt-item .tt-chg.down { color: var(--down); }

.tt-divider {
  color: #222;
  padding: 0 4px;
  font-size: 11px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  #eq-main-grid { grid-template-columns: 1fr; }
  #eq-left-col  { border-right: none; }
  .econ-charts-row { grid-template-columns: 1fr; }
  .indicator-grid  { grid-template-columns: repeat(2, 1fr); }
  #fi-main-layout  { grid-template-columns: 1fr; }
  .bb-company-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  #sidebar {
    top: auto;
    bottom: var(--ticker-tape-h);
    left: 0;
    right: 0;
    width: 100%;
    height: 40px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid #1a1a1a;
    padding: 0;
  }
  .nav-btn {
    flex: 1;
    flex-direction: row;
    border-left: none;
    border-top: 2px solid transparent;
    padding: 0 8px;
    height: 100%;
  }
  .nav-btn.active { border-left-color: transparent; border-top-color: var(--accent-amber); }
  #main-content { bottom: calc(var(--ticker-tape-h) + 40px); left: 0; }
  .nav-divider { display: none; }
  .bb-company-grid { grid-template-columns: 1fr; }
}

/* ─── Metric row border adjustments ────────────────────────────────────── */
.metrics-grid .metric-row:nth-child(2n+1) {
  border-right: 1px solid #111;
}

/* Ensure earnings beats/misses clearly visible */
.data-table .beat { color: var(--up); font-weight: 600; }
.data-table .miss { color: var(--down); font-weight: 600; }
.data-table .inline { color: var(--unchanged); }

/* FI table: left align maturity */
#fi-table-wrap .data-table td:first-child { font-weight: 700; }

/* EQ chart panel needs a fixed height to avoid squishing */
#eq-main-grid {
  min-height: 420px;
}

/* ─── Misc utilities ─────────────────────────────────────────────────────── */
.num-right { text-align: right; }
.mono { font-family: var(--font-mono); }
.text-sm { font-size: 9px; }
.text-xs { font-size: 8px; }
.bold { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.p-8  { padding: 8px; }
.p-10 { padding: 10px; }
.mb-4 { margin-bottom: 4px; }
.mt-4 { margin-top: 4px; }

/* ─── Search Autocomplete Dropdown ──────────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  min-width: 320px;
  max-width: 460px;
  background: #080808;
  border: 1px solid #2a2a2a;
  border-top: 1px solid var(--accent-amber);
  z-index: 500;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8);
  font-family: var(--font-mono);
}

.search-result {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  border-bottom: 1px solid #0d0d0d;
  transition: background 0.06s;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.search-result:last-child { border-bottom: none; }

.search-result:hover,
.search-result.selected {
  background: #0d1a00;
}

.search-result.selected { border-left: 2px solid var(--accent-amber); }

.sr-symbol {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-name {
  font-size: 9px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-exchange {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Position context for input wraps that host a dropdown */
#eq-ticker-input-wrap { position: relative; }
#command-bar-wrap     { position: relative; }

/* Command bar dropdown */
#cmd-search-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  min-width: 320px;
  background: #080808;
  border: 1px solid #2a2a2a;
  border-top: 1px solid var(--accent-amber);
  z-index: 600;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8);
  font-family: var(--font-mono);
}

#cmd-search-dropdown .search-result { font-size: 10px; }

/* ─── Ticker Presets ─────────────────────────────────────────────────────── */
.ticker-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.ticker-presets a {
  color: #558;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.1s;
  font-weight: 600;
}

.ticker-presets a:hover {
  color: var(--accent-amber);
  text-decoration: underline;
}

/* ─── Currency Label Badge ───────────────────────────────────────────────── */
.currency-label {
  display: inline-block;
  font-size: 8px;
  font-weight: 600;
  color: var(--text-muted);
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  padding: 1px 4px;
  letter-spacing: 0.08em;
  vertical-align: middle;
  margin-left: 3px;
  text-transform: uppercase;
}

/* ─── Extended hours display ─────────────────────────────────────────────── */
#eq-extended-hours {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: 8px;
}

/* Align EQ quote fields hidden (we use the new qs-* classes now) */
#eq-ticker-info { display: none; }
#eq-price-center { display: none; }
#eq-key-stats { display: none; }

/* ─── EQ Tab Content Panels ───────────────────────────────────────────────────────────── */
#eq-tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ─── News Feed ───────────────────────────────────────────────────────────────────── */
.news-feed {
  padding: 0;
}

.news-feed-item {
  display: grid;
  grid-template-columns: 52px 80px 1fr;
  align-items: start;
  gap: 0 8px;
  padding: 5px 10px;
  border-bottom: 1px solid #0d0d0d;
  cursor: pointer;
  transition: background 0.08s;
  text-decoration: none;
}

.news-feed-item:hover {
  background: #070707;
}

.news-feed-item:last-child { border-bottom: none; }

.news-time {
  font-size: 9px;
  color: var(--accent-amber);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 1px;
  font-weight: 600;
}

.news-publisher {
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
  text-transform: uppercase;
}

.news-headline {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.news-headline:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.news-feed-empty {
  padding: 16px 10px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ─── Ownership Tables ────────────────────────────────────────────────────────────── */
.ownership-summary-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 5px 10px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  flex-wrap: wrap;
  font-size: 10px;
}

.osb-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 0;
  white-space: nowrap;
}

.osb-item + .osb-item {
  padding-left: 12px;
  border-left: 1px solid #1e1e1e;
}

.osb-label {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.osb-value {
  color: var(--accent-amber);
  font-weight: 700;
  font-size: 11px;
}

.ownership-section {
  padding: 0;
}

.ownership-section + .ownership-section {
  border-top: 2px solid #111;
}

.ownership-scroll {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ─── News Top-3 Highlights ──────────────────────────────────────────────────────── */
.news-top3 {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-top3-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #111;
  cursor: pointer;
  transition: background 0.08s;
  text-decoration: none;
  background: #030303;
}

.news-top3-item:hover {
  background: #0a0a0a;
}

.news-top3-item:last-child {
  border-bottom: 2px solid #1a1a1a;
}

.news-top3-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-amber);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  border-radius: 2px;
  letter-spacing: 0;
}

.news-top3-body {
  flex: 1;
  min-width: 0;
}

.news-top3-headline {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin-bottom: 3px;
}

.news-top3-item:hover .news-top3-headline {
  color: var(--accent-amber);
}

.news-top3-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.news-top3-publisher {
  font-size: 9px;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.news-top3-time {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.news-feed-scroll {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

/* ─── ECON Bloomberg Overhaul ─────────────────────────────────────────────────────── */
/* Bloomberg-style ECON/FI header matching EQ module */
.bb-module-header {
  background: #050505;
  border-bottom: 1px solid #1a1a1a;
  padding: 0;
}

.bb-module-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  border-bottom: 1px solid #111;
}

.bb-module-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.06em;
}

.bb-module-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.bb-module-go {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* Macro summary strip */
.macro-strip {
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 22px;
  font-size: 10px;
}

.macro-strip .ms-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 0;
  white-space: nowrap;
  font-size: 10px;
}

.macro-strip .ms-item + .ms-item {
  padding-left: 10px;
  border-left: 1px solid #1e1e1e;
}

.macro-strip .ms-label {
  color: var(--text-dim);
  font-size: 9px;
}

.macro-strip .ms-val {
  color: var(--text-primary);
  font-weight: 600;
}

.macro-strip .ms-chg {
  font-size: 9px;
}

/* Compact indicator tiles for ECON Bloomberg style */
.indicator-tile-compact {
  background: #050505;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-value-compact {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.01em;
}

.ind-value-compact .ind-unit { font-size: 10px; font-weight: 500; color: var(--text-dim); }

/* FI Bloomberg rate strip */
.fi-rate-strip {
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 22px;
  font-size: 10px;
}

.fi-rate-strip .rs-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 0;
  white-space: nowrap;
}

.fi-rate-strip .rs-item + .rs-item {
  padding-left: 10px;
  border-left: 1px solid #1e1e1e;
}

.fi-rate-strip .rs-label { color: var(--text-dim); font-size: 9px; }
.fi-rate-strip .rs-val   { color: var(--text-primary); font-weight: 700; }
.fi-rate-strip .rs-chg   { font-size: 9px; }

/* ═══════ Bond Search Tab ═══════ */
.fi-bond-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #1a1a1a;
  background: #050505;
}
.fi-bond-search-label {
  font-size: 9px;
  color: #666;
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.fi-bond-input {
  background: #111;
  border: 1px solid #222;
  color: #eee;
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  padding: 5px 10px;
  flex: 0 1 340px;
  outline: none;
  transition: border-color 0.15s;
}
.fi-bond-input:focus {
  border-color: #ff9800;
}
.fi-bond-input::placeholder {
  color: #444;
  font-size: 10px;
}
.fi-bond-go-btn {
  background: #ff9800;
  color: #000;
  border: none;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
}
.fi-bond-go-btn:hover {
  background: #ffa726;
}

/* Bond search wrapper for dropdown positioning */
.fi-bond-search-wrap {
  position: relative;
  flex: 0 1 400px;
}
.fi-bond-search-wrap .fi-bond-input {
  flex: unset;
  width: 100%;
}

/* Bond name search dropdown */
.fi-bond-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: #111;
  border: 1px solid #333;
  border-top: none;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.fi-bond-dropdown:not(:empty) {
  display: block;
}
.fi-bond-dd-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #1a1a1a;
  transition: background 80ms ease;
}
.fi-bond-dd-item:hover {
  background: rgba(255, 140, 0, 0.08);
}
.fi-bond-dd-item:last-child { border-bottom: none; }
.fi-bond-dd-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fi-bond-dd-ticker {
  color: #FF8C00;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.fi-bond-dd-name {
  color: #888;
  font-family: var(--font-mono);
  font-size: 9px;
  margin-top: 1px;
}
.fi-bond-dd-trace {
  background: rgba(0,170,204,0.15);
  color: #00AACC;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.fi-bond-dd-exch {
  color: #666;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.fi-bond-dd-loading, .fi-bond-dd-empty {
  padding: 10px;
  text-align: center;
  color: #666;
  font-family: var(--font-mono);
  font-size: 9px;
}
.fi-bond-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
}
.fi-bond-result {
  background: #000;
}
.fi-bond-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #1a1a1a;
}
.fi-bond-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #ff9800;
  letter-spacing: 0.5px;
}
.fi-bond-subtitle {
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
  color: #666;
  margin-top: 2px;
}
.fi-bond-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0;
  min-height: 400px;
}
.fi-bond-profile-col {
  border-right: 1px solid #1a1a1a;
  overflow-y: auto;
  max-height: 600px;
}
.fi-bond-chart-col {
  display: flex;
  flex-direction: column;
}
.fi-bond-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.fi-bond-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 10px;
  border-bottom: 1px solid #0d0d0d;
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
}
.fi-bond-kv:nth-child(odd) {
  border-right: 1px solid #0d0d0d;
}
.fi-bond-k {
  color: #666;
  white-space: nowrap;
  margin-right: 8px;
}
.fi-bond-v {
  color: #ccc;
  font-weight: 600;
  text-align: right;
}
.fi-bond-chart-area {
  flex: 1;
  min-height: 280px;
  padding: 8px 12px;
  position: relative;
}
.fi-bond-chart-area canvas {
  width: 100% !important;
  height: 100% !important;
}
.fi-bond-price-stats {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1a1a1a;
  background: #050505;
}
.fi-bond-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 8px;
  border-right: 1px solid #0d0d0d;
}
.fi-bond-stat:last-child {
  border-right: none;
}
.fi-bond-stat-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 8px;
  color: #555;
  letter-spacing: 0.5px;
}
.fi-bond-stat-val {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: #eee;
  font-weight: 700;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .fi-bond-layout {
    grid-template-columns: 1fr;
  }
  .fi-bond-profile-col {
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
    max-height: none;
  }
}

/* Overview tab: full-width company layout */
.eq-overview-panel {
  padding: 0;
}

.eq-overview-desc {
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 8px 10px;
  border-bottom: 1px solid #111;
  max-height: 200px;
  overflow-y: auto;
}

/* Analysis tab: full-width earnings + valuation */
.eq-analysis-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: none;
}

.eq-analysis-col {
  border-right: 1px solid #1a1a1a;
}

.eq-analysis-col:last-child { border-right: none; }

/* Analysis tab chart containers */
.analysis-chart-wrap {
  position: relative;
  padding: 8px;
  height: 240px;
}
.analysis-chart-wrap canvas {
  width: 100% !important;
}
.analysis-note {
  color: #666;
  font-size: 10px;
  padding: 2px 8px;
  font-style: italic;
}

/* Analyst Price Target Gauge */
.target-gauge {
  padding: 16px 12px;
}
.target-info-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.target-info-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.target-info-item .dim {
  font-size: 9px;
  letter-spacing: 0.06em;
}
.target-bar-wrap {
  position: relative;
  height: 40px;
  margin: 12px 0;
}
.target-range-bg {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 12px;
  background: #1a1a1a;
  border-radius: 6px;
}
.target-range-fill {
  position: absolute;
  top: 14px;
  height: 12px;
  background: linear-gradient(90deg, rgba(136,136,136,0.25), rgba(38,166,154,0.25));
  border-radius: 6px;
}
.target-marker {
  position: absolute;
  top: 8px;
  width: 3px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 2px;
}
.target-marker-price {
  background: #f0b90b;
  width: 3px;
  height: 28px;
  top: 6px;
  z-index: 3;
}
.target-price-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: #f0b90b;
  white-space: nowrap;
  font-weight: 700;
}
.target-marker-mean {
  background: #26a69a;
  z-index: 2;
}
.target-marker-median {
  background: #888;
  z-index: 1;
  width: 2px;
}
.target-legend {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #888;
}
.target-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.target-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

@media (max-width: 1000px) {
  .eq-analysis-panel { grid-template-columns: 1fr; }
  .eq-analysis-col { border-right: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   WATCHLIST MODULE
   ═══════════════════════════════════════════════════════════════════════════ */

#wl-module {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wl-tab-body {
  flex: 1;
  overflow: hidden;
}

/* ─── Layout: sidebar + main ─────────────────────────────────────────────── */

#wl-eq-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  height: calc(100vh - var(--header-height) - var(--ticker-tape-h) - 58px);
  overflow: hidden;
}

/* ─── Watchlist Sidebar ──────────────────────────────────────────────────── */

#wl-sidebar {
  background: #030303;
  border-right: 1px solid #1a1a1a;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

.wl-sidebar-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--bg-section-hdr);
  border-bottom: 1px solid #111;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
}

.wl-icon-btn {
  background: none;
  border: 1px solid #333;
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  line-height: 1;
  padding: 0;
  border-radius: 1px;
  transition: background 0.1s;
}

.wl-icon-btn:hover {
  background: #1a1a1a;
}

/* List items */
#wl-list-items {
  padding: 0;
}

.wl-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid #0a0a0a;
  transition: background 0.08s;
}

.wl-list-item:hover {
  background: #0a0a0a;
}

.wl-list-item.active {
  background: #0d1a00;
  color: var(--accent-amber);
  border-left: 2px solid var(--accent-amber);
}

.wl-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.wl-list-del {
  background: none;
  border: none;
  color: #444;
  cursor: pointer;
  font-size: 13px;
  padding: 0 0 0 6px;
  line-height: 1;
  font-family: var(--font-mono);
}

.wl-list-del:hover {
  color: var(--accent-red);
}

/* Add ticker input */
#wl-add-ticker-wrap {
  position: relative;
  padding: 4px 8px;
}

#wl-add-ticker-input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #222;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
  outline: none;
  letter-spacing: 0.04em;
}

#wl-add-ticker-input:focus {
  border-color: var(--accent-amber);
}

#wl-add-ticker-dropdown {
  left: 8px;
  right: 8px;
  width: auto;
}

/* Column tags */
#wl-col-tags {
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.wl-col-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  background: #111;
  border: 1px solid #222;
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 1px;
}

.wl-col-tag-x {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  line-height: 1;
  font-family: var(--font-mono);
}

.wl-col-tag-x:hover {
  color: var(--accent-red);
}

/* ─── Main: Table + Mini Chart ───────────────────────────────────────────── */

#wl-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wl-table-wrap {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.wl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.wl-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.wl-table th {
  background: #050505;
  border-bottom: 2px solid #1a1a1a;
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  text-align: left;
  white-space: nowrap;
}

.wl-table th.right {
  text-align: right;
}

.wl-th-ticker {
  min-width: 70px;
}

.wl-th-action {
  width: 28px;
}

.wl-row {
  cursor: pointer;
  transition: background 0.06s;
  border-bottom: 1px solid #0a0a0a;
}

.wl-row:hover {
  background: #070707;
}

.wl-row.selected {
  background: #0d1a00;
}

.wl-row td {
  padding: 4px 8px;
  white-space: nowrap;
  font-size: 10px;
  color: var(--text-primary);
}

.wl-row td.right {
  text-align: right;
}

.wl-td-ticker {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.wl-td-action {
  text-align: center;
}

.wl-row-del {
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-mono);
  line-height: 1;
  padding: 0;
}

.wl-row-del:hover {
  color: var(--accent-red);
}

/* ─── Mini Chart Panel (enhanced) ────────────────────────────────────────── */

#wl-mini-chart-panel {
  height: 320px;
  min-height: 280px;
  border-top: 2px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

/* Quote strip – ticker name, price, change, vol, mcap */
.wl-chart-quote-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 8px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
}
.wl-cq-name {
  color: #ff8800;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-cq-price {
  font-weight: 600;
  color: #e0e0e0;
}
.wl-cq-price.pos { color: #33cc66; }
.wl-cq-price.neg { color: #ff4444; }
.wl-cq-chg {
  color: #aaa;
}
.wl-cq-chg.pos { color: #33cc66; }
.wl-cq-chg.neg { color: #ff4444; }
.wl-cq-stat {
  color: #aaa;
}
.wl-cq-stat .dim {
  color: #555;
  margin-right: 3px;
}

/* Chart area – stacked price + volume */
#wl-mini-chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 2px 4px;
}
#wl-mini-price-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}
#wl-mini-price-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
#wl-mini-vol-wrap {
  height: 42px;
  min-height: 42px;
  position: relative;
  border-top: 1px solid #1a1a1a;
}
#wl-mini-vol-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Timeframe bar */
.wl-chart-tf-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-top: 1px solid #1a1a1a;
  background: #050505;
}
.wl-chart-tf-bar .tf-btn {
  background: none;
  border: 1px solid transparent;
  color: #888;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.wl-chart-tf-bar .tf-btn:hover {
  color: #ccc;
  background: #1a1a1a;
}
.wl-chart-tf-bar .tf-btn.active {
  color: #ff8800;
  border-color: #ff8800;
  background: rgba(255,136,0,0.08);
}
.wl-chart-tf-bar .wl-range-label {
  margin-left: auto;
  color: #555;
  font-size: 10px;
  font-family: var(--font-mono);
}

/* ─── Column Picker Modal ────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   FI WATCHLIST LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

#wl-fi-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  height: calc(100vh - var(--header-height) - var(--ticker-tape-h) - 58px);
  overflow: hidden;
}

#wl-fi-sidebar {
  background: #030303;
  border-right: 1px solid #1a1a1a;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

#wl-fi-add-wrap {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
}

#wl-fi-add-input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #222;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 6px;
  outline: none;
  letter-spacing: 0.04em;
}

#wl-fi-add-input:focus {
  border-color: var(--accent-amber);
}

.wl-fi-add-go {
  background: #111;
  border: 1px solid #333;
  color: var(--accent-amber);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  line-height: 1;
  padding: 0;
  border-radius: 1px;
  transition: background 0.1s;
}

.wl-fi-add-go:hover {
  background: #1a1a1a;
}

#wl-fi-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wl-fi-table-wrap {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

#wl-fi-mini-chart-panel {
  height: 300px;
  min-height: 260px;
  border-top: 2px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
}

#wl-fi-mini-chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 2px 4px;
}

#wl-fi-mini-price-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

#wl-fi-mini-price-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Column Picker Modal ────────────────────────────────────────────────── */

.wl-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-modal {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.wl-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-section-hdr);
  border-bottom: 1px solid #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wl-modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  padding: 0;
}

.wl-modal-close:hover {
  color: var(--accent-red);
}

.wl-modal-body {
  padding: 8px 12px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
}

.wl-col-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 9px;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.04em;
}

.wl-col-option input[type="checkbox"] {
  accent-color: var(--accent-amber);
  width: 12px;
  height: 12px;
  cursor: pointer;
}

.wl-modal-footer {
  padding: 8px 12px;
  border-top: 1px solid #1a1a1a;
  display: flex;
  justify-content: flex-end;
}

.wl-modal-btn {
  background: #1a2a00;
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 16px;
  cursor: pointer;
  transition: background 0.1s;
}

.wl-modal-btn:hover {
  background: #2a3a00;
}

/* ═════════════════════════════════════════════════════════════════════════════
   GRAPHS MODULE
═════════════════════════════════════════════════════════════════════════════ */

#gr-module {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#gr-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: #111;
  min-height: 0;
}

/* ─── Panel ───────────────────────────────────────────────────────────────── */

.gr-panel {
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

/* ─── Toolbar ─────────────────────────────────────────────────────────────── */

.gr-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-bottom: 1px solid #1a1a1a;
  background: #080808;
  flex-shrink: 0;
  min-height: 28px;
}

.gr-toolbar-left {
  display: flex;
  align-items: center;
  gap: 3px;
  position: relative;
}

.gr-ticker-input {
  background: #111;
  border: 1px solid #2a2a2a;
  color: #ff8800;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  width: 70px;
  text-transform: uppercase;
  outline: none;
  letter-spacing: 0.5px;
}

.gr-ticker-input:focus {
  border-color: #ff8800;
  background: #1a1200;
}

.gr-go-btn {
  background: #1a2800;
  border: 1px solid #2a3a00;
  color: #88cc00;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.gr-go-btn:hover {
  background: #2a3800;
}

/* Search dropdown */
.gr-search-dd {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  max-height: 200px;
  overflow-y: auto;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  z-index: 100;
  display: none;
}

.gr-search-dd:not(:empty) {
  display: block;
}

.gr-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
}

.gr-dd-item:hover {
  background: #1a1a1a;
}

.gr-dd-sym {
  color: #ff8800;
  font-weight: 600;
  min-width: 60px;
}

.gr-dd-name {
  color: #888;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gr-dd-exch {
  color: #444;
  font-size: 8px;
}

/* Timeframe buttons */
.gr-toolbar-center {
  display: flex;
  gap: 1px;
  margin-left: auto;
}

.gr-tf-btn {
  background: none;
  border: 1px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.gr-tf-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}

.gr-tf-btn.active {
  color: #ff8800;
  border-color: #ff8800;
  background: rgba(255,136,0,0.08);
}

/* Interval (candle size) buttons */
.gr-iv-btn {
  background: none;
  border: 1px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 4px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.gr-iv-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}

.gr-iv-btn.active {
  color: #00ccff;
  border-color: #00ccff;
  background: rgba(0,204,255,0.08);
}

/* Chart type + tools */
.gr-toolbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.gr-sep {
  color: #2a2a2a;
  font-size: 10px;
  margin: 0 2px;
}

.gr-type-btn,
.gr-draw-btn,
.gr-clear-btn {
  background: none;
  border: 1px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.gr-type-btn:hover,
.gr-draw-btn:hover,
.gr-clear-btn:hover {
  color: #aaa;
  background: #1a1a1a;
}

.gr-type-btn.active {
  color: #3388FF;
  border-color: #3388FF;
  background: rgba(51,136,255,0.08);
}

.gr-draw-btn.active {
  color: #FF8C00;
  border-color: #FF8C00;
  background: rgba(255,140,0,0.1);
}

.gr-clear-btn:hover {
  color: #ff4444;
}

.gr-export-btn {
  background: none;
  border: 1px solid transparent;
  color: #555;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 1px 5px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  line-height: 1;
}

.gr-export-btn:hover {
  color: #3388FF;
  background: rgba(51,136,255,0.08);
  border-color: rgba(51,136,255,0.3);
}

/* ─── Overlay Bar ─────────────────────────────────────────────────────────── */

.gr-overlay-bar {
  display: flex;
  gap: 2px;
  padding: 2px 6px;
  border-bottom: 1px solid #111;
  background: #060606;
  flex-shrink: 0;
}

.gr-ov-btn {
  background: none;
  border: 1px solid transparent;
  color: #444;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 600;
  padding: 1px 5px;
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.3px;
  transition: all 0.15s;
}

.gr-ov-btn:hover {
  color: #888;
  background: #1a1a1a;
}

.gr-ov-btn.active {
  border-color: currentColor;
}

.gr-ov-btn[data-ov="sma20"].active  { color: #FFAA00; background: rgba(255,170,0,0.08); }
.gr-ov-btn[data-ov="sma50"].active  { color: #00CCFF; background: rgba(0,204,255,0.08); }
.gr-ov-btn[data-ov="sma200"].active { color: #FF5588; background: rgba(255,85,136,0.08); }
.gr-ov-btn[data-ov="ema12"].active  { color: #88FF44; background: rgba(136,255,68,0.08); }
.gr-ov-btn[data-ov="ema26"].active  { color: #FF66FF; background: rgba(255,102,255,0.08); }
.gr-ov-btn[data-ov="bb"].active     { color: #999; background: rgba(136,136,136,0.08); }

/* ─── Quote Strip ─────────────────────────────────────────────────────────── */

.gr-quote-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 8px;
  border-bottom: 1px solid #111;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 16px;
}

.gr-q-name {
  color: #e0e0e0;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gr-q-ticker {
  color: #ff8800;
  font-weight: 600;
}

.gr-q-price {
  font-weight: 600;
  color: #e0e0e0;
}
.gr-q-price.pos { color: #33cc66; }
.gr-q-price.neg { color: #ff4444; }

.gr-q-chg { color: #888; }
.gr-q-chg.pos { color: #33cc66; }
.gr-q-chg.neg { color: #ff4444; }

.gr-q-stat { color: #888; }
.gr-q-stat .dim { color: #444; margin-right: 2px; }

/* ─── Chart Area ──────────────────────────────────────────────────────────── */

.gr-chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.gr-price-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}

.gr-price-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.gr-vol-wrap {
  height: 36px;
  min-height: 36px;
  position: relative;
  border-top: 1px solid #111;
}

.gr-vol-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.gr-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #333;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
}

/* ─── Drawing Canvas Overlay ──────────────────────────────────────────────── */

.gr-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

.gr-panel .gr-draw-canvas {
  /* Positioned relative to gr-chart-area */
}

/* ─── Range Bar ───────────────────────────────────────────────────────────── */

.gr-range-bar {
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: #444;
  border-top: 1px solid #111;
  background: #050505;
  flex-shrink: 0;
  text-align: right;
  min-height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* EQ HOME CHART TOOLBAR & DRAWING CANVAS                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.eq-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  background: #080808;
  border: 1px solid #151515;
  border-bottom: none;
  flex-wrap: wrap;
}

.eq-chart-toolbar-left {
  display: flex;
  align-items: center;
  gap: 3px;
}

.eq-chart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.eq-type-btn,
.eq-draw-btn,
.eq-clear-btn {
  background: transparent;
  border: 1px solid #222;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.2;
}

.eq-type-btn:hover,
.eq-draw-btn:hover,
.eq-clear-btn:hover {
  color: #aaa;
  border-color: #333;
}

.eq-type-btn.active {
  color: #3388FF;
  border-color: #3388FF;
  background: rgba(51,136,255,0.08);
}

.eq-draw-btn.active {
  color: #FF8C00;
  border-color: #FF8C00;
  background: rgba(255,140,0,0.08);
}

.eq-clear-btn:hover {
  color: #ff4444;
  border-color: #ff4444;
}

.eq-ov-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #444;
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 5px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}

.eq-ov-btn:hover {
  color: #888;
  border-color: #333;
}

.eq-ov-btn.active {
  border-color: currentColor;
}
.eq-ov-btn[data-ov="sma20"].active  { color: #FFAA00; background: rgba(255,170,0,0.08); }
.eq-ov-btn[data-ov="sma50"].active  { color: #00CCFF; background: rgba(0,204,255,0.08); }
.eq-ov-btn[data-ov="sma200"].active { color: #FF5588; background: rgba(255,85,136,0.08); }
.eq-ov-btn[data-ov="ema12"].active  { color: #88FF44; background: rgba(136,255,68,0.08); }
.eq-ov-btn[data-ov="ema26"].active  { color: #FF66FF; background: rgba(255,102,255,0.08); }
.eq-ov-btn[data-ov="bb"].active     { color: #999; background: rgba(136,136,136,0.08); }

.eq-chart-area {
  position: relative;
}

.eq-draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;
}

/* ─── FINANCIALS TAB ────────────────────────────────────────────────────── */

.fin-tab-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: #050505;
  border-bottom: 1px solid #111;
}

.fin-freq-toggle,
.fin-stmt-toggle {
  display: flex;
  gap: 2px;
}

.fin-freq-btn,
.fin-stmt-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fin-freq-btn:hover,
.fin-stmt-btn:hover {
  color: #888;
  border-color: #333;
}

.fin-freq-btn.active {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background: rgba(255, 170, 0, 0.06);
}

.fin-stmt-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 204, 255, 0.06);
}

.financials-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  overscroll-behavior: contain;
}

.financials-table {
  min-width: 600px;
}

.financials-table th {
  position: sticky;
  top: 0;
  background: #080808;
  z-index: 2;
}

.fin-row-label {
  position: sticky;
  left: 0;
  background: #060606;
  z-index: 1;
  font-size: 9px;
  color: #aaa;
  font-weight: 600;
  text-transform: capitalize;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}

.financials-table td.right {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.fin-highlight-row {
  background: rgba(240, 185, 11, 0.06);
}
.fin-highlight-row td.fin-row-label {
  color: #f0b90b;
  background: rgba(240, 185, 11, 0.06);
}
.fin-highlight-row td {
  font-weight: 600;
}

/* ─── SEC FILINGS TAB ───────────────────────────────────────────────────── */

.filings-filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #050505;
  border-bottom: 1px solid #111;
}

.filings-filter-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.03em;
}

.filings-filter-btn:hover {
  color: #888;
  border-color: #333;
}

.filings-filter-btn.active {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background: rgba(255, 170, 0, 0.06);
}

.filings-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  overscroll-behavior: contain;
}

.filings-table td {
  font-size: 10px;
}

.filing-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filing-10k  { background: rgba(255,170,0,0.12);  color: #FFAA00; }
.filing-10q  { background: rgba(0,204,255,0.12);   color: #00CCFF; }
.filing-8k   { background: rgba(136,255,68,0.12);  color: #88FF44; }
.filing-insider { background: rgba(255,102,255,0.12); color: #FF66FF; }
.filing-sc13 { background: rgba(255,85,136,0.12);  color: #FF5588; }
.filing-proxy { background: rgba(136,136,255,0.12); color: #8888FF; }
.filing-other { background: rgba(128,128,128,0.12); color: #888; }

.filing-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.12s;
  margin-left: 6px;
}

.filing-link:hover {
  color: #fff;
}

/* ─── NEWS TAB — Images & Summaries (Finnhub) ──────────────────────────── */

.news-top3-img {
  flex-shrink: 0;
  width: 72px;
  height: 48px;
  border-radius: 2px;
  overflow: hidden;
  background: #111;
}

.news-top3-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-top3-summary {
  font-size: 9px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

/* ─── FX MODULE ────────────────────────────────────────────────────────────── */

#fx-module {
  height: 100%;
  overflow: hidden;
}

.fx-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
  gap: 0;
}

/* Left panel: rates + converter */
.fx-rates-panel {
  border-right: 2px solid #111;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fx-rates-board {
  display: flex;
  flex-direction: column;
}

.fx-rate-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #0a0a0a;
  cursor: pointer;
  transition: background 0.1s;
}

.fx-rate-card:hover {
  background: #0a0a0a;
}

.fx-rate-selected {
  background: #0c0c0c;
  border-left: 2px solid var(--accent-amber);
}

.fx-rate-left {
  min-width: 0;
}

.fx-pair-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.fx-pair-full {
  font-size: 8px;
  letter-spacing: 0.03em;
  margin-top: 1px;
}

.fx-rate-mid {
  flex-shrink: 0;
}

.fx-rate-right {
  text-align: right;
}

.fx-rate-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fx-rate-change {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.fx-rate-change.up   { color: var(--up); }
.fx-rate-change.down { color: var(--down); }
.fx-rate-change.unch { color: var(--unchanged); }

.fx-rate-error {
  opacity: 0.5;
}

/* Converter */
.fx-converter {
  padding: 10px;
}

.fx-conv-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fx-conv-input {
  flex: 1;
  background: #080808;
  border: 1px solid #1a1a1a;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  min-width: 0;
}

.fx-conv-input:focus {
  border-color: var(--accent-amber);
}

.fx-conv-select {
  background: #080808;
  border: 1px solid #1a1a1a;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 4px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  width: 56px;
  text-align: center;
}

.fx-conv-select:focus {
  border-color: var(--accent-amber);
}

.fx-conv-arrow {
  color: #555;
  font-size: 14px;
  flex-shrink: 0;
}

.fx-conv-result {
  margin-top: 8px;
  padding: 8px;
  background: #050505;
  border: 1px solid #111;
}

.fx-conv-output {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fx-conv-rate {
  display: block;
  font-size: 9px;
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* Right panel: chart */
.fx-chart-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fx-chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  background: #050505;
  border-bottom: 1px solid #111;
}

.fx-tf-bar,
.fx-type-bar {
  display: flex;
  gap: 2px;
}

.fx-tf-btn,
.fx-type-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #555;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.03em;
}

.fx-tf-btn:hover,
.fx-type-btn:hover {
  color: #888;
  border-color: #333;
}

.fx-tf-btn.active {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background: rgba(255, 170, 0, 0.06);
}

.fx-type-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 204, 255, 0.06);
}

.fx-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 300px;
  padding: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HOME PAGE — Market Overview
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─ Edit Toolbar ─────────────────────────────────────────────────────────── */

.home-edit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
  min-height: 26px;
}

.home-edit-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-edit-bar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}

.home-edit-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-edit-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.12s;
  text-transform: uppercase;
}

.home-edit-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.home-edit-btn.active {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(255,140,0,0.07);
}

.home-edit-btn-cancel {
  color: #555;
  border-color: #222;
}

.home-edit-btn-cancel:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.home-edit-btn-reset {
  color: #444;
}

.home-edit-btn-reset:hover {
  color: #aaa;
  border-color: #444;
}

/* ─ Layout grid ──────────────────────────────────────────────────────────── */

.home-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.home-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.9fr 0.85fr;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  gap: 0;
  background: #000;
}

.home-layout-editing {
  /* Slightly loosen to accommodate edit chrome */
  overflow-y: auto;
}

.home-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border-right: 1px solid #111;
}

.home-col:last-child {
  border-right: none;
}

.home-col-left  { border-right: 1px solid #0f0f0f; }
.home-col-center { border-right: 1px solid #0f0f0f; }
.home-col-right  { border-right: none; }

/* ─ Sections ─────────────────────────────────────────────────────────────── */

.home-section {
  border-bottom: 1px solid #0d0d0d;
  flex-shrink: 0;
}

.home-col-left .home-section:last-child,
.home-col-right .home-section:last-child {
  flex: 1;
}

/* home-section-hdr: legacy fallback (fixed layout uses bb-section-hdr) */
.home-section-hdr {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-section-hdr);
  padding: 2px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid #003366;
  border-bottom: 1px solid #003366;
}

.home-subsection-hdr {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-dim);
  background: #040404;
  padding: 2px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #0d0d0d;
}

/* ─ Widget Edit Chrome ────────────────────────────────────────────────────── */

.home-widget-chrome {
  border: 1px dashed #1f1f1f;
  margin: 2px;
  position: relative;
}

.home-widget-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  background: #080808;
  border-bottom: 1px solid #1a1a1a;
  cursor: grab;
  user-select: none;
}

.home-widget-handle-label {
  font-size: 8px;
  font-family: var(--font-mono);
  color: #444;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-widget-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.home-widget-act-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: #444;
  font-size: 9px;
  padding: 1px 5px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.1s;
  line-height: 1.2;
}

.home-widget-act-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.home-widget-act-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.home-widget-act-remove:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ─ Add Widget Button & Panel ─────────────────────────────────────────────── */

.home-add-widget-row {
  padding: 6px;
  background: #000;
  border-top: 1px solid #0f0f0f;
}

.home-add-widget-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px dashed #1f1f1f;
  color: #333;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 5px 8px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-align: center;
  transition: all 0.12s;
}

.home-add-widget-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(255,140,0,0.04);
}

.home-add-panel {
  background: #050505;
  border: 1px solid #222;
  margin: 0 6px 6px;
  overflow: hidden;
}

.home-add-panel-item {
  padding: 5px 10px;
  cursor: pointer;
  border-bottom: 1px solid #111;
  transition: background 0.1s;
}

.home-add-panel-item:last-child {
  border-bottom: none;
}

.home-add-panel-item:hover {
  background: #0a0a0a;
}

.home-add-panel-item:hover .home-add-panel-label {
  color: var(--accent-amber);
}

.home-add-panel-label {
  display: block;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.home-add-panel-desc {
  display: block;
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 1px;
}

.home-add-panel-cancel {
  background: #030303;
}

.home-add-panel-cancel .home-add-panel-label,
.home-add-panel-cancel:hover .home-add-panel-label {
  color: #555;
}

.home-add-panel-cancel:hover .home-add-panel-label {
  color: var(--accent-red);
}

/* ─ Config Panel ──────────────────────────────────────────────────────────── */

.home-config-panel {
  background: #050505;
  border: 1px solid #222;
  margin: 0 6px 6px;
  padding: 8px 10px;
}

.home-config-panel-title {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 4px;
}

.home-cfg-label {
  display: block;
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.home-cfg-input,
.home-cfg-select {
  display: block;
  width: 100%;
  margin-top: 2px;
  background: #000;
  border: 1px solid #222;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 6px;
  outline: none;
  transition: border-color 0.12s;
  box-sizing: border-box;
}

.home-cfg-input:focus,
.home-cfg-select:focus {
  border-color: var(--accent-amber);
}

.home-config-panel-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #111;
}

/* ─ Tables ────────────────────────────────────────────────────────────────── */

.home-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.home-table thead tr {
  background: #030303;
  border-bottom: 1px solid #0d0d0d;
}

.home-table th {
  padding: 2px 6px;
  color: #2a2a2a;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  font-size: 8px;
}

.home-th-price,
.home-th-chg,
.home-th-pct {
  text-align: right;
}

/* Alternating row striping */
.home-table tbody tr:nth-child(even) {
  background: #020202;
}

.home-table tbody tr + tr {
  border-top: 1px solid #080808;
}

.home-row {
  transition: background 0.1s;
}

.home-row:hover {
  background: #0d0d0d;
}

.home-td-name {
  padding: 2px 6px;
  color: var(--text-secondary);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.home-td-ticker {
  padding: 2px 6px;
  color: #b06000;
  font-size: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.home-td-price {
  padding: 2px 6px;
  text-align: right;
  color: var(--text-primary);
  font-size: 9px;
  white-space: nowrap;
}

.home-td-chg,
.home-td-pct {
  padding: 2px 6px;
  text-align: right;
  font-size: 9px;
  white-space: nowrap;
}

.home-td-chg.up,
.home-td-pct.up { color: var(--up); }
.home-td-chg.down,
.home-td-pct.down { color: var(--down); }
.home-td-chg.unchanged,
.home-td-pct.unchanged { color: var(--unchanged); }

.home-loading {
  padding: 8px;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.home-error {
  padding: 6px 8px;
  color: var(--accent-red);
  font-size: 9px;
}

.home-placeholder {
  padding: 16px 10px;
  color: var(--text-muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ─ Market News ───────────────────────────────────────────────────────────── */

.home-news-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.home-news-list {
  background: #000;
  flex: 1;
  overflow-y: auto;
}

.home-news-item {
  padding: 4px 10px 4px 14px;
  border-bottom: 1px solid #090909;
  border-left: 2px solid transparent;
  transition: border-left-color 0.12s, background 0.1s;
  position: relative;
}

.home-news-item:last-child {
  border-bottom: none;
}

.home-news-item:hover {
  background: #070707;
  border-left-color: var(--accent-amber);
}

.home-news-headline {
  font-size: 9px;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-news-headline a {
  color: var(--text-primary);
  text-decoration: none;
}

.home-news-headline a:hover {
  color: var(--accent-amber);
  text-decoration: underline;
}

.home-news-meta {
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 1px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.home-news-dot {
  color: #1e1e1e;
}

.home-news-source {
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.home-news-date {
  color: var(--text-muted);
}

/* ─ Normalized Performance Chart section ─────────────────────────────────── */

.home-chart-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #010106;
  border-left: 1px solid #0a0a18;
  border-right: 1px solid #0a0a18;
}

.home-tf-bar {
  display: flex;
  gap: 2px;
  padding: 3px 8px;
  background: #030303;
  border-bottom: 1px solid #111;
  flex-shrink: 0;
}

.home-tf-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.04em;
}

.home-tf-btn:hover {
  color: #888;
  border-color: #333;
}

.home-tf-btn.active {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
  background: rgba(255, 140, 0, 0.06);
}

/* ─ Terminal Ticker Bar ───────────────────────────────────────────────────── */

.home-ticker-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 3px 4px;
  background: #020202;
  border-bottom: 1px solid #111;
  flex-shrink: 0;
}

.home-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px 2px 4px;
  white-space: nowrap;
  border-right: 1px solid #1a1a1a;
  position: relative;
}

.home-ticker-dot {
  font-size: 7px;
  line-height: 1;
  flex-shrink: 0;
}

.home-ticker-remove {
  background: none;
  border: none;
  color: #2a2a2a;
  cursor: pointer;
  font-size: 11px;
  padding: 0 0 0 2px;
  margin: 0;
  line-height: 1;
  transition: color 0.1s;
  opacity: 0;
}

.home-ticker-item:hover .home-ticker-remove {
  opacity: 1;
  color: #555;
}

.home-ticker-item:hover .home-ticker-remove:hover {
  color: var(--accent-red);
}

.home-add-wrap {
  display: flex;
  align-items: center;
  padding-left: 6px;
}

.home-add-input {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  width: 52px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.12s;
}

.home-add-input:focus {
  border-color: var(--accent-amber);
  color: var(--text-primary);
}

.home-add-input::placeholder {
  color: #333;
  letter-spacing: 0.08em;
}

.home-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 200px;
  padding: 6px;
  background: #010106;
}

.home-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ─ Fixed Income + Global Yields row ─────────────────────────────────────── */

.home-fi-row {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex-shrink: 0;
}

.home-fi-panel {
  flex: 1;
  border-right: 1px solid #111;
  min-width: 0;
}

.home-yields-panel {
  flex: 1;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR MODULE (CL) — Monthly Grid
   ═══════════════════════════════════════════════════════════════════════════ */

.cl-module {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cl-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Month header with nav */
.cl-month-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  flex-shrink: 0;
}

.cl-month-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: #eee;
  letter-spacing: 0.02em;
  min-width: 160px;
}

.cl-month-btn {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  font-size: 10px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 120ms ease, border-color 120ms ease;
}

.cl-month-btn:hover {
  color: #FF8C00;
  border-color: #FF8C00;
}

.cl-today-btn {
  background: #1a1a1a;
  border: 1px solid #444;
  color: #ccc;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 4px 12px;
  cursor: pointer;
  border-radius: 2px;
  margin-left: auto;
  transition: color 120ms ease, border-color 120ms ease;
}

.cl-today-btn:hover {
  color: #FF8C00;
  border-color: #FF8C00;
}

/* 7-column calendar grid */
.cl-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid #1a1a1a;
}

.cl-cal-dow {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #666;
  text-align: center;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
  letter-spacing: 0.06em;
  font-weight: 600;
  background: var(--bg-section-hdr);
}

.cl-cal-cell {
  min-height: 80px;
  border-bottom: 1px solid #111;
  border-right: 1px solid #111;
  padding: 4px 6px;
  cursor: pointer;
  transition: background 100ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cl-cal-cell:nth-child(7n+8) {
  /* first column (Sun) */
}

.cl-cal-cell:hover:not(.cl-cal-weekend) {
  background: #111;
}

.cl-cal-outside {
  opacity: 0.25;
}

.cl-cal-weekend {
  background: #080808;
  cursor: default;
}

.cl-cal-today {
  background: rgba(255, 140, 0, 0.04);
}

.cl-cal-expanded {
  background: rgba(255, 140, 0, 0.08);
  border-color: #FF8C00;
}

.cl-cal-day-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin-bottom: 3px;
}

.cl-cal-today-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e04040;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
}

.cl-cal-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.cl-cal-ev {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #aaa;
  background: rgba(255, 140, 0, 0.08);
  border-left: 2px solid #FF8C00;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 1px;
}

.cl-cal-more {
  font-family: var(--font-mono);
  font-size: 7px;
  color: #666;
  padding: 1px 4px;
}

.cl-cal-loading {
  font-family: var(--font-mono);
  font-size: 7px;
  color: #444;
  padding: 2px 0;
}

/* Detail panel below calendar */
.cl-detail-panel {
  display: none;
  flex-direction: column;
  max-height: 40vh;
  border-top: 2px solid #FF8C00;
  flex-shrink: 0;
  overflow: hidden;
}

.cl-detail-hdr {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #ccc;
  padding: 8px 14px;
  background: var(--bg-section-hdr);
  border-bottom: 1px solid #1a1a1a;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cl-detail-hdr .dim {
  color: #666;
  font-weight: 400;
}

.cl-detail-close {
  background: none;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  margin-left: auto;
  padding: 0 4px;
  line-height: 1;
  font-family: var(--font-mono);
}

.cl-detail-close:hover {
  color: #ff4444;
}

.cl-table-wrap {
  flex: 1;
  overflow: auto;
}

.cl-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 9px;
}

.cl-table thead th {
  background: var(--bg-section-hdr);
  color: #888;
  font-weight: 600;
  font-size: 8px;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid #1a1a1a;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.cl-th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease;
}

.cl-th-sortable:hover { color: #FF8C00; }

.cl-table tbody td {
  padding: 5px 10px;
  border-bottom: 1px solid #111;
  color: #aaa;
  white-space: nowrap;
}

.cl-row {
  cursor: pointer;
  transition: background 80ms ease;
}

.cl-row:hover { background: rgba(255, 140, 0, 0.04); }

.cl-symbol { color: #FF8C00; font-weight: 600; }
.cl-company { color: #999; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cl-timing { color: #888; }
.cl-num { text-align: right; }
.cl-table .green { color: var(--accent-green); }
.cl-table .red   { color: var(--accent-red); }

.cl-empty {
  text-align: center;
  padding: 30px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #666;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WATCHLIST COLUMN DRAG & LIST RENAME
   ═══════════════════════════════════════════════════════════════════════════ */

/* Column picker modal — wide layout */
.wl-modal-wide {
  width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.wl-col-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
}

.wl-col-section {
  border: 1px solid #222;
  border-radius: 2px;
  background: #0a0a0a;
}

.wl-col-section-hdr {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #FF8C00;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-bottom: 1px solid #222;
  background: #111;
}

.wl-col-section-hdr .dim {
  color: #555;
  font-size: 8px;
}

/* Active columns list — scrollable, sortable */
.wl-col-active-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.wl-col-active-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #ccc;
  user-select: none;
  transition: background 100ms ease;
}

.wl-col-active-item:hover {
  background: rgba(255, 140, 0, 0.06);
}

/* Arrow buttons for reorder */
.wl-col-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
  margin-right: 4px;
}

.wl-col-arrow-btn {
  background: none;
  border: 1px solid #333;
  color: #888;
  font-size: 7px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 1px;
  transition: color 100ms ease, border-color 100ms ease, background 100ms ease;
}

.wl-col-arrow-btn:hover:not(.wl-col-arrow-disabled) {
  color: #FF8C00;
  border-color: #FF8C00;
  background: rgba(255, 140, 0, 0.1);
}

.wl-col-arrow-disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.wl-col-active-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-col-active-remove {
  background: none;
  border: none;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 100ms ease;
}

.wl-col-active-remove:hover {
  color: #ff4444;
}

/* Available columns list */
.wl-col-avail-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}

.wl-col-avail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #777;
  cursor: pointer;
  transition: background 100ms ease;
}

.wl-col-avail-item:hover {
  background: rgba(255, 140, 0, 0.06);
  color: #ccc;
}

.wl-col-avail-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-col-avail-add {
  background: none;
  border: 1px solid #333;
  color: #FF8C00;
  font-size: 11px;
  cursor: pointer;
  padding: 0 5px;
  line-height: 16px;
  border-radius: 1px;
  flex-shrink: 0;
  transition: border-color 100ms ease, background 100ms ease;
}

.wl-col-avail-add:hover {
  border-color: #FF8C00;
  background: rgba(255, 140, 0, 0.1);
}

/* List rename inline input */
.wl-rename-input {
  background: #111;
  border: 1px solid #FF8C00;
  color: #FF8C00;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  width: calc(100% - 8px);
  outline: none;
  border-radius: 1px;
}

.wl-list-name {
  cursor: default;
}

/* ── Add to Watchlist button ── */
.wl-add-btn {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  font-size: 9px;
  font-family: 'Roboto Mono', monospace;
  padding: 3px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}
.wl-add-btn:hover {
  border-color: #ff9800;
  color: #ff9800;
}
.wl-add-btn.added {
  border-color: #00c853;
  color: #00c853;
  pointer-events: none;
}

/* ── Watchlist Picker Modal ── */
.wl-picker-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wlFadeIn 0.15s ease;
}
@keyframes wlFadeIn { from { opacity: 0; } to { opacity: 1; } }
.wl-picker-modal {
  background: #1a1a1a;
  border: 1px solid #333;
  min-width: 280px;
  max-width: 360px;
  font-family: 'Roboto Mono', monospace;
}
.wl-picker-header {
  padding: 10px 14px;
  font-size: 10px;
  color: #ff9800;
  border-bottom: 1px solid #333;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wl-picker-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}
.wl-picker-close:hover { color: #ff4444; }
.wl-picker-body {
  padding: 8px 0;
  max-height: 300px;
  overflow-y: auto;
}
.wl-picker-item {
  padding: 8px 14px;
  font-size: 10px;
  color: #ccc;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s ease;
}
.wl-picker-item:hover {
  background: #252525;
}
.wl-picker-item-name {
  color: #ddd;
}
.wl-picker-item-count {
  color: #555;
  font-size: 9px;
}
.wl-picker-item.has-item {
  color: #555;
}
.wl-picker-item.has-item .wl-picker-item-name::after {
  content: ' ✓';
  color: #00c853;
  font-size: 8px;
}
.wl-picker-footer {
  padding: 8px 14px;
  border-top: 1px solid #333;
  font-size: 9px;
  color: #555;
}

/* ══════════════════════════════════════════════════════════════════════════════
   AUTH — Login Overlay
   ══════════════════════════════════════════════════════════════════════════════ */

.login-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-container {
  width: 320px;
  padding: 40px 36px 36px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.15em;
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  margin-bottom: 36px;
  text-align: center;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-field label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.login-field input {
  background: #111;
  border: 1px solid #333;
  color: #ddd;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
  letter-spacing: 0.05em;
}

.login-field input:focus {
  border-color: var(--accent-amber);
}

.login-error {
  font-size: 10px;
  color: var(--accent-red);
  min-height: 14px;
  text-align: center;
  letter-spacing: 0.04em;
}

.login-btn {
  background: var(--accent-amber);
  color: #000;
  border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #ffaa33;
}

/* ══════════════════════════════════════════════════════════════════════════════
   USER MENU — bottom of sidebar
   ══════════════════════════════════════════════════════════════════════════════ */

.user-menu {
  left: 0;
  width: var(--sidebar-width);
  background: #050505;
  border-top: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 4px;
  overflow: hidden;
}

.user-menu-name {
  font-size: 8px;
  color: var(--accent-amber);
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 0;
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.user-menu-btn {
  background: transparent;
  border: 1px solid #1a1a1a;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  padding: 3px 2px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: color 0.1s, border-color 0.1s;
}

.user-menu-btn:hover {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODAL OVERLAYS — Change Password, Admin Create/Reset
   ══════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.modal-box {
  width: 380px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-field label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.modal-field-label {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.modal-field input,
.modal-select {
  background: #111;
  border: 1px solid #333;
  color: #ddd;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 9px;
  outline: none;
}

.modal-field input:focus,
.modal-select:focus {
  border-color: var(--accent-amber);
}

.modal-select option {
  background: #111;
  color: #ddd;
}

.modal-error {
  font-size: 10px;
  color: var(--accent-red);
  min-height: 14px;
  letter-spacing: 0.04em;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-btn-primary {
  background: var(--accent-amber);
  color: #000;
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  cursor: pointer;
  flex: 1;
}

.modal-btn-primary:hover { background: #ffaa33; }

.modal-btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid #333;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  cursor: pointer;
  flex: 1;
}

.modal-btn-secondary:hover {
  border-color: #555;
  color: #aaa;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════════════════════════ */

.admin-panel {
  padding: 20px 24px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 12px;
}

.admin-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
}

.admin-btn-create {
  background: var(--accent-amber);
  color: #000;
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  cursor: pointer;
}

.admin-btn-create:hover { background: #ffaa33; }

.admin-status {
  font-size: 10px;
  min-height: 14px;
  letter-spacing: 0.04em;
}

.admin-status-ok { color: var(--accent-green); }
.admin-status-err { color: var(--accent-red); }

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.admin-table th {
  text-align: left;
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  border-bottom: 1px solid #1a1a1a;
  padding: 6px 10px 6px 0;
  white-space: nowrap;
}

.admin-table td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid #111;
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #0d0d0d;
}

.role-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border: 1px solid;
}

.role-admin {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.role-user {
  color: var(--text-secondary);
  border-color: #333;
}

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-action-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  cursor: pointer;
}

.admin-action-btn:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.admin-action-delete:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Ensure sidebar nav buttons don't overlap user menu */
#sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar .user-menu {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PORTFOLIO & BACKTEST MODULE (PT)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.pt-container {
  display: flex;
  gap: 0;
  height: 100%;
  overflow: hidden;
}

.pt-sidebar {
  width: 240px;
  min-width: 200px;
  border-right: 1px solid #1a1a1a;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: #050505;
  flex-shrink: 0;
}

.pt-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 24px 20px;
  background: var(--bg-panel-alt);
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.pt-sidebar-header {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 10px 12px 6px 12px;
  border-bottom: 1px solid #111;
  text-transform: uppercase;
}

#pt-portfolio-list {
  flex: 1;
}

.pt-portfolio-item {
  padding: 9px 12px;
  border-bottom: 1px solid #0e0e0e;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-left-color 0.1s;
  outline: none;
}

.pt-portfolio-item:hover {
  background: #111;
}

.pt-portfolio-item.active {
  border-left: 3px solid var(--accent-cyan);
  background: rgba(0, 170, 204, 0.05);
}

.pt-portfolio-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-portfolio-meta {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.pt-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid #111;
  flex-shrink: 0;
}

.pt-btn-new {
  width: 100%;
  text-align: center;
  padding: 6px 8px;
}

.pt-empty-msg {
  padding: 16px 12px;
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.06em;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.pt-btn {
  background: transparent;
  border: 1px solid #2a2a2a;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.pt-btn:hover {
  border-color: var(--text-dim);
  color: var(--text-primary);
}

.pt-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pt-btn-primary {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.pt-btn-primary:hover {
  background: rgba(0, 170, 204, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.pt-btn-danger {
  border-color: #2a2a2a;
  color: var(--accent-red);
}

.pt-btn-danger:hover {
  border-color: var(--accent-red);
  background: rgba(204, 51, 51, 0.08);
  color: var(--accent-red);
}

.pt-btn-add {
  border-color: #1e1e1e;
  color: var(--text-dim);
  font-size: 9px;
}

.pt-btn-add:hover {
  border-color: #333;
  color: var(--text-secondary);
}

/* ─── Builder ────────────────────────────────────────────────────────────── */
.pt-builder {
  max-width: 760px;
}

.pt-builder-section {
  margin-bottom: 18px;
}

.pt-section-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 1px solid #111;
  padding-bottom: 4px;
}

.pt-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pt-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  min-width: 70px;
  flex-shrink: 0;
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.pt-input {
  background: #0a0a0a;
  border: 1px solid #1e1e1e;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

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

.pt-input::placeholder {
  color: var(--text-muted);
}

.pt-name-input {
  width: 260px;
  flex: none;
}

.pt-benchmark-input {
  width: 120px;
  flex: none;
}

.pt-date-input {
  background: #0a0a0a;
  border: 1px solid #1e1e1e;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
  width: 140px;
  color-scheme: dark;
}

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

/* ─── Holdings Table ─────────────────────────────────────────────────────── */
.pt-holdings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.pt-th-row {
  border-bottom: 1px solid #1a1a1a;
}

.pt-th {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: left;
  padding: 4px 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.pt-holding-row {
  border-bottom: 1px solid #0d0d0d;
}

.pt-holding-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.pt-td-ticker {
  padding: 4px 4px 4px 0;
  width: 160px;
}

.pt-td-weight {
  padding: 4px 4px;
  width: 100px;
}

.pt-holding-weight {
  width: 90px;
}

.pt-td-remove {
  padding: 4px 0;
  width: 30px;
  text-align: center;
}

.pt-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-family: var(--font-mono);
  transition: color 0.15s;
}

.pt-remove-btn:hover {
  color: var(--accent-red);
}

.pt-ticker-wrap {
  position: relative;
}

.pt-holdings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 0 0;
  gap: 12px;
}

.pt-weight-total {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.pt-weight-total.valid { color: var(--accent-green); }
.pt-weight-total.invalid { color: var(--accent-red); }

/* ─── Backtest row ───────────────────────────────────────────────────────── */
.pt-backtest-row {
  flex-wrap: wrap;
  gap: 10px;
}

.pt-action-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* ─── Builder messages ───────────────────────────────────────────────────── */
.pt-builder-msg {
  margin-top: 8px;
  font-size: 10px;
  padding: 6px 10px;
  letter-spacing: 0.06em;
}

.pt-msg-ok {
  color: var(--accent-green);
  border-left: 2px solid var(--accent-green);
  background: rgba(0, 204, 102, 0.05);
}

.pt-msg-error {
  color: var(--accent-red);
  border-left: 2px solid var(--accent-red);
  background: rgba(204, 51, 51, 0.05);
}

/* ─── Confirm Modal ──────────────────────────────────────────────────────── */

.pt-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-confirm-modal {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 24px 28px;
  min-width: 320px;
  max-width: 420px;
}

.pt-confirm-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.pt-confirm-msg {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #999;
  line-height: 1.6;
  margin-bottom: 20px;
}

.pt-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pt-btn-cancel {
  background: #1a1a1a;
  color: #888;
  border: 1px solid #333;
}

.pt-btn-cancel:hover {
  background: #222;
  color: #bbb;
}

/* ─── Results ────────────────────────────────────────────────────────────── */
.pt-results {
  margin-top: 24px;
}

.pt-results-divider {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.pt-chart-wrap {
  height: 320px;
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-radius: 1px;
  margin-bottom: 16px;
  display: flex;
  align-items: stretch;
  position: relative;
}

.pt-chart-wrap canvas {
  display: block;
}

/* ─── Metrics Table ──────────────────────────────────────────────────────── */
.pt-metrics-wrap {
  margin-bottom: 16px;
}

.pt-metrics-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 560px;
}

.pt-metrics-head-label,
.pt-metrics-head {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-align: left;
  padding: 5px 12px 5px 0;
  border-bottom: 1px solid #1a1a1a;
  font-weight: 600;
  text-transform: uppercase;
}

.pt-metrics-head {
  text-align: right;
  min-width: 100px;
}

.pt-metrics-label {
  font-size: 10px;
  color: var(--text-secondary);
  padding: 5px 12px 5px 0;
  border-bottom: 1px solid #0d0d0d;
}

.pt-metrics-cell {
  font-size: 10px;
  font-weight: 500;
  padding: 5px 0 5px 0;
  border-bottom: 1px solid #0d0d0d;
  text-align: right;
  min-width: 100px;
  padding-right: 8px;
}

.pt-metrics-cell.positive { color: var(--accent-green); }
.pt-metrics-cell.negative { color: var(--accent-red); }

/* ─── Holdings Breakdown ─────────────────────────────────────────────────── */
.pt-breakdown-title {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 1px solid #111;
  padding-bottom: 4px;
}

.pt-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 440px;
}

.pt-bd-ticker {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 4px 12px 4px 0;
  border-bottom: 1px solid #0d0d0d;
  width: 100px;
}

.pt-bd-weight {
  font-size: 10px;
  color: var(--text-dim);
  padding: 4px 12px 4px 0;
  border-bottom: 1px solid #0d0d0d;
  width: 60px;
}

.pt-bd-arrow {
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 12px 4px 0;
  border-bottom: 1px solid #0d0d0d;
  width: 20px;
}

.pt-bd-return {
  font-size: 10px;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid #0d0d0d;
}

.pt-bd-return.positive { color: var(--accent-green); }
.pt-bd-return.negative { color: var(--accent-red); }

/* ─── Autocomplete Dropdown ──────────────────────────────────────────────── */
.pt-autocomplete-dropdown {
  position: absolute;
  background: #1a1a1a;
  border: 1px solid #333;
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.pt-autocomplete-item {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pt-autocomplete-item:hover,
.pt-autocomplete-item.pt-ac-active {
  background: #252525;
  color: var(--text-primary);
}

.pt-ac-sym {
  color: var(--accent-cyan);
  font-weight: 600;
  min-width: 48px;
  font-size: 10px;
}

.pt-ac-name {
  color: var(--text-dim);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.pt-ac-exch {
  color: var(--text-muted);
  font-size: 8px;
  margin-left: auto;
}

/* ─── Utility / State Messages ───────────────────────────────────────────── */
.pt-loading-msg {
  padding: 20px 16px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-align: center;
}

.pt-error-msg {
  padding: 16px;
  font-size: 10px;
  color: var(--accent-red);
  letter-spacing: 0.06em;
  border-left: 2px solid var(--accent-red);
  background: rgba(204, 51, 51, 0.04);
  margin: 8px 0;
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.pt-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.pt-empty-state-icon {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pt-empty-state-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pt-empty-state-sub {
  font-size: 10px;
  color: var(--text-dim);
  max-width: 320px;
  line-height: 1.5;
}

/* ─── Holdings breakdown loading row ────────────────────────────────────── */
.pt-holdings-breakdown {
  margin-top: 16px;
}
