/* ── Design Tokens (matching deep-value dashboard) ── */
:root {
  --bg-primary: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2333;
  --bg-header: #010409;
  --border: #30363d;
  --border-light: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #0f3460;
  --accent-light: #1a4a7a;
  --green: #4ade80;
  --green-dim: #22543d;
  --red: #f87171;
  --red-dim: #7f1d1d;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --font-mono: 'SF Mono','Cascadia Code','Fira Code','Consolas',monospace;
  --font-sans: 'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif;
  --radius: 8px;
  --radius-sm: 4px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-sans); line-height: 1.5; min-height: 100vh; }

/* ── Top Bar ── */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  height: 56px;
}
.logo { font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.logo a { color: var(--text-primary); text-decoration: none; }
.logo a:hover { color: var(--blue); }
.top-bar .spacer { flex: 1; }
.nav-link {
  color: var(--text-secondary); text-decoration: none; font-size: 0.85rem;
  padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-primary); border-color: var(--text-muted); }
.nav-link.active { color: var(--blue); border-color: var(--blue); background: rgba(96,165,250,0.08); }
.search-bar {
  display: flex; align-items: center; gap: 0.75rem;
  max-width: 1400px; margin: 0 auto; padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.search-form { display: flex; gap: 0.4rem; flex: 1; max-width: 600px; }
.market-select {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem; font-size: 0.82rem; font-family: var(--font-mono);
  cursor: pointer;
}
.ticker-input {
  flex: 1; background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem; font-size: 0.9rem; font-family: var(--font-mono);
  font-weight: 600; letter-spacing: 0.02em;
}
.ticker-input:focus { outline: none; border-color: var(--blue); }
.analyze-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 0.4rem 1rem;
  font-weight: 600; cursor: pointer; font-size: 0.85rem;
  transition: background 0.15s;
}
.analyze-btn:hover { background: var(--accent-light); }
.lang-btn {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.8rem;
  white-space: nowrap; margin-left: auto;
}

/* ── Page Navigation (second row) ── */
.page-nav {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  max-width: 1400px; margin: 0 auto; padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.page-nav-link {
  color: var(--text-secondary); text-decoration: none; font-size: 0.8rem;
  padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  white-space: nowrap; transition: all 0.15s;
}
.page-nav-link:hover { color: var(--text-primary); border-color: var(--text-muted); }
.lang-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ── Loading / Error ── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50vh; color: var(--text-muted); gap: 1rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { text-align: center; padding: 3rem; }
.error-msg { color: var(--red); font-size: 1rem; }

/* ── Stock Header ── */
.stock-header { padding: 1rem 1.5rem 0; max-width: 1400px; margin: 0 auto; }
.stock-name { font-size: 1.3rem; font-weight: 700; }
.stock-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Tabs ── */
.tabs-bar { display: flex; gap: 2px; padding: 0.75rem 1.5rem 0; max-width: 1400px; margin: 0 auto; border-bottom: 1px solid var(--border); }
.tab-btn {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 600; padding: 0.6rem 1rem;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; padding: 1rem 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Value Tab Grid ── */
.value-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; }
.section-title { font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }

/* Qualitative Topics */
.qual-topic { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.qual-topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.qual-topic-name { font-weight: 600; font-size: 0.85rem; }
.qual-topic-score { font-family: var(--font-mono); font-weight: 700; color: var(--blue); font-size: 1rem; }
.qual-topic-score small { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }
.qual-bar { width: 100%; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 0.5rem; }
.qual-bar-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.4s; }
.qual-reason { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; }
.ai-enhanced-reason { font-size: 0.78rem; color: var(--cyan); line-height: 1.6; margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: rgba(34,211,238,0.06); border-radius: var(--radius-sm); }
.ai-badge { display: inline-block; font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; color: var(--cyan); background: rgba(34,211,238,0.1); padding: 0.1rem 0.35rem; border-radius: 3px; margin-right: 0.3rem; }

.ai-btn {
  display: block; width: 100%; padding: 0.6rem;
  background: linear-gradient(135deg, #0f3460 0%, #1a4a7a 100%);
  color: var(--cyan); border: 1px solid var(--cyan);
  border-radius: var(--radius); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: all 0.15s; text-align: center; margin-top: 0.5rem;
}
.ai-btn:hover { background: var(--accent-light); }
.ai-btn:disabled { opacity: 0.5; cursor: wait; }
.ai-loading { color: var(--cyan); font-size: 0.85rem; text-align: center; padding: 1rem; }

/* Quant Card */
.quant-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.quant-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.85rem; }
.quant-row span { color: var(--text-secondary); }
.quant-row strong { font-family: var(--font-mono); }
.quant-divider { height: 1px; background: var(--border-light); margin: 0.5rem 0; }

/* PE Range Bar */
.pe-range-bar { width: 100%; height: 6px; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); border-radius: 3px; overflow: hidden; margin: 0.5rem 0; position: relative; }
.pe-range-fill { height: 100%; background: transparent; border-right: 3px solid #fff; }
.pe-range-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }

/* Multiplier */
.mult-display { text-align: center; padding: 0.75rem; border: 2px solid; border-radius: var(--radius); margin-top: 0.75rem; }
.mult-display small { font-size: 0.7rem; }
.mult-value { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); }

/* AI Valuation Box */
.ai-val-box { margin-top: 0.75rem; padding: 0.75rem; background: rgba(34,211,238,0.05); border: 1px solid rgba(34,211,238,0.15); border-radius: var(--radius-sm); }
.ai-val-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; margin-top: 0.3rem; }

/* Score Box */
.score-box { background: var(--bg-card); border: 2px solid; border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; text-align: center; }
.score-title { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.score-calc-row { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.score-part { background: var(--bg-primary); border-radius: var(--radius-sm); padding: 0.75rem; text-align: center; min-width: 80px; }
.score-part small { font-size: 0.65rem; color: var(--text-muted); display: block; }
.score-big { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; }
.score-op { font-size: 1.2rem; color: var(--text-muted); font-weight: 700; }
.score-final { border: 2px solid; }
.score-grade { display: inline-block; padding: 0.3rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 700; color: #000; margin-top: 1rem; }

/* Multiplier Explainer */
.mult-explainer { margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-secondary); }
.mult-explainer summary { cursor: pointer; color: var(--text-muted); font-size: 0.78rem; padding: 0.3rem 0; }
.mult-explainer p { margin: 0.4rem 0; }

/* ── Tech Tab ── */
.tech-verdict { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); border: 2px solid; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.tech-verdict-label { font-weight: 600; color: var(--text-secondary); }
.tech-verdict-signal { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; }
.tech-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.metric-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; }
.metric-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.2rem; }
.metric-value { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; }

/* Chart */
.chart-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; margin-top: 0.5rem; }
.chart-container canvas { width: 100%; height: 300px; }

/* ── Financials Tab ── */
.fin-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.fin-metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; }
.fin-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.15rem; }
.fin-value { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; }
.fin-delta { font-family: var(--font-mono); font-size: 0.75rem; margin-top: 0.15rem; }
.fin-divider { height: 1px; background: var(--border-light); margin: 1rem 0; }

/* ── Enhanced Financials (Phase 1) ── */
.efin-section { margin-top: 1.25rem; }
.efin-section-title {
  font-size: 0.88rem; font-weight: 700; color: var(--text-primary);
  margin: 0 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border);
}
.efin-freshness { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* Company Profile */
.company-profile {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.profile-logo { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: contain; background: #fff; flex-shrink: 0; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 1rem; font-weight: 700; margin: 0; }
.profile-meta { font-size: 0.75rem; color: var(--text-secondary); margin: 0.1rem 0 0.3rem; }
.profile-meta a { color: var(--blue); text-decoration: none; }
.profile-meta a:hover { text-decoration: underline; }
.profile-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.profile-tag {
  font-size: 0.65rem; padding: 0.12rem 0.45rem; border-radius: 3px;
  background: var(--accent); color: var(--blue); font-weight: 600;
}
.profile-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.profile-desc.truncated { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.profile-toggle {
  background: none; border: none; color: var(--blue); font-size: 0.72rem;
  cursor: pointer; padding: 0; margin-top: 0.2rem;
}

/* 10-Year Financial Table */
.fin-table-wrapper {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.fin-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.75rem; font-family: var(--font-mono); white-space: nowrap;
}
.fin-table th {
  background: var(--bg-header); color: var(--text-muted); font-weight: 600;
  padding: 0.5rem 0.7rem; text-align: right; font-size: 0.7rem;
  border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 2;
}
.fin-table th:first-child {
  text-align: left; position: sticky; left: 0; z-index: 3;
  background: var(--bg-header); min-width: 150px;
}
.fin-table td {
  padding: 0.4rem 0.7rem; text-align: right;
  border-bottom: 1px solid var(--border-light);
}
.fin-table td:first-child {
  text-align: left; font-family: var(--font-sans); font-weight: 500;
  color: var(--text-secondary); position: sticky; left: 0; z-index: 1;
  background: var(--bg-card); min-width: 150px; font-size: 0.72rem;
}
.fin-table tr:hover td { background: rgba(96,165,250,0.04); }
.fin-table tr:hover td:first-child { background: var(--bg-card); }
.fin-table .section-hdr td {
  background: var(--accent) !important; color: var(--blue); font-weight: 700;
  font-family: var(--font-sans); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.35rem 0.7rem; border-bottom: 1px solid var(--border);
}
.fin-table .section-hdr td:first-child { background: var(--accent) !important; }
.fin-table .latest-col { background: rgba(96,165,250,0.04); }
.fin-table .ttm-col { background: rgba(251,191,36,0.06); border-left: 2px solid rgba(255,255,255,0.12); }
.fin-table th.ttm-col { background: rgba(251,191,36,0.10); border-left: 2px solid rgba(255,255,255,0.12); color: #fbbf24; }
.fin-pos { color: #4ade80; }
.fin-neg { color: #f87171; }

/* Growth Rates Table */
.growth-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.growth-table th {
  background: var(--bg-header); color: var(--text-muted); font-weight: 600;
  padding: 0.5rem 0.75rem; text-align: right; font-size: 0.7rem;
  border-bottom: 2px solid var(--border);
}
.growth-table th:first-child { text-align: left; }
.growth-table td {
  padding: 0.45rem 0.75rem; text-align: right; font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-light);
}
.growth-table td:first-child { text-align: left; font-family: var(--font-sans); font-weight: 500; color: var(--text-secondary); }
.growth-table tr:hover td { background: rgba(96,165,250,0.04); }

/* Quarterly Tables */
.quarterly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.quarterly-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.quarterly-table th {
  background: var(--bg-header); color: var(--text-muted); font-weight: 600;
  padding: 0.45rem 0.6rem; text-align: right; font-size: 0.7rem;
  border-bottom: 2px solid var(--border);
}
.quarterly-table th:first-child { text-align: left; }
.quarterly-table td {
  padding: 0.4rem 0.6rem; text-align: right; font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-light); font-size: 0.75rem;
}
.quarterly-table td:first-child { text-align: left; font-family: var(--font-sans); color: var(--text-secondary); }

/* Capital Structure */
.cap-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.cap-metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem; margin-bottom: 0.75rem;
}
.cap-metric-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.cap-metric-value { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; }
.cap-bar {
  display: flex; height: 28px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--border-light); margin-top: 0.5rem;
}
.cap-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 600; color: #fff; white-space: nowrap;
  padding: 0 0.4rem; min-width: 30px;
}
.cap-debt { background: #ef4444; }
.cap-equity { background: #3b82f6; }
.cap-cash { background: #22c55e; }

/* Loading skeleton */
.efin-loading {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; color: var(--text-muted); font-size: 0.82rem;
}
.efin-error { color: var(--text-muted); font-size: 0.78rem; text-align: center; padding: 1rem 0; }

/* ── Phase 2: Sub-tabs & Full Statements ── */
.fin-subtabs {
  display: flex; gap: 4px; margin-bottom: 1rem; flex-wrap: wrap;
}
.fin-subtab {
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans); transition: all 0.15s;
}
.fin-subtab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.fin-subtab.active { background: var(--accent); color: #fff; border-color: var(--accent-light); }
.fin-subpanel { display: none; }
.fin-subpanel.active { display: block; }

/* Statement controls bar */
.stmt-controls {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.stmt-controls .ctrl-group { display: flex; gap: 2px; }
.stmt-controls .ctrl-label { font-size: 0.75rem; color: var(--text-muted); margin-right: 0.25rem; align-self: center; }
.stmt-btn {
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border); padding: 0.3rem 0.6rem;
  font-size: 0.75rem; cursor: pointer; font-family: var(--font-mono); transition: all 0.15s;
}
.stmt-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stmt-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.stmt-btn.active { background: var(--accent); color: #fff; border-color: var(--accent-light); }
.stmt-btn:hover:not(.active) { color: var(--text-primary); border-color: var(--text-muted); }

/* Statement chart */
.stmt-chart-wrap {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; margin-bottom: 0.75rem;
}
.stmt-chart-wrap canvas { width: 100%; height: 250px; }

/* Statement table (reuses .fin-table base) */
.stmt-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 70vh; overflow-y: auto;
}
.stmt-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.75rem; font-family: var(--font-mono); white-space: nowrap;
}
.stmt-table th {
  background: var(--bg-header); color: var(--text-muted); font-weight: 600;
  padding: 0.5rem 0.7rem; text-align: right; font-size: 0.7rem;
  border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 2;
}
.stmt-table th:first-child {
  text-align: left; position: sticky; left: 0; z-index: 3;
  background: var(--bg-header); min-width: 200px;
}
.stmt-table td {
  padding: 0.4rem 0.7rem; text-align: right;
  border-bottom: 1px solid var(--border-light);
}
.stmt-table td:first-child {
  text-align: left; font-family: var(--font-sans);
  color: var(--text-secondary); position: sticky; left: 0; z-index: 1;
  background: var(--bg-card); min-width: 200px; font-size: 0.72rem;
}
.stmt-table tr:hover td { background: rgba(96,165,250,0.04); }
.stmt-table tr:hover td:first-child { background: var(--bg-card); }
.stmt-table .latest-col { background: rgba(96,165,250,0.04); }

/* Parent rows (bold, colored left border) */
.stmt-parent td:first-child {
  font-weight: 700; color: var(--text-primary); cursor: pointer;
}
.stmt-parent td:first-child::before {
  content: '\25B6'; font-size: 0.55rem; margin-right: 0.4rem; color: var(--text-muted);
  display: inline-block; transition: transform 0.15s;
}
.stmt-parent.expanded td:first-child::before { transform: rotate(90deg); }
.stmt-parent td { font-weight: 600; }
.stmt-border-purple td:first-child { border-left: 3px solid #a78bfa; }
.stmt-border-green td:first-child { border-left: 3px solid #4ade80; }
.stmt-border-blue td:first-child { border-left: 3px solid #60a5fa; }
.stmt-border-orange td:first-child { border-left: 3px solid #fb923c; }
.stmt-border-red td:first-child { border-left: 3px solid #f87171; }

/* Child rows (indented, hidden by default) */
.stmt-child { display: none; }
.stmt-child.visible { display: table-row; }
.stmt-child td:first-child { padding-left: 1.8rem; }
.stmt-child-2 td:first-child { padding-left: 2.8rem; }

/* Divider row */
.stmt-divider td { border-bottom: 2px solid var(--border); padding: 0; height: 2px; }

/* Derived metrics (bottom section) */
.stmt-derived td:first-child { color: var(--text-muted); font-style: italic; }

/* Cell-level highlight for Show in Statements */
@keyframes highlightCell {
  0% { background-color: rgba(234,179,8,0.35); box-shadow: inset 0 0 0 2px #EAB308; }
  70% { background-color: rgba(234,179,8,0.20); box-shadow: inset 0 0 0 2px #EAB308; }
  100% { background-color: rgba(234,179,8,0.10); box-shadow: inset 0 0 0 2px rgba(234,179,8,0.5); }
}
.highlight-cell { animation: highlightCell 2s ease-out forwards; position: relative; z-index: 1; }

/* Cross-statement reference note */
.cross-ref-note {
  padding: 0.5rem 0.75rem; margin: 0.5rem 0;
  background: rgba(234,179,8,0.08); border-left: 3px solid #EAB308;
  border-radius: var(--radius-sm); font-size: 0.78rem; color: var(--text-muted);
}
.cross-ref-link { color: #EAB308; text-decoration: none; margin-left: 0.5rem; font-weight: 500; }
.cross-ref-link:hover { text-decoration: underline; }

/* ── Phase 3: Valuation Charts ── */
.val-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem; margin-bottom: 1rem;
}
.val-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.65rem 0.85rem; cursor: pointer; transition: border-color 0.15s;
}
.val-card:hover { border-color: var(--text-muted); }
.val-card-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.val-card-value { font-size: 1.3rem; font-weight: 700; font-family: var(--font-mono); margin: 0.1rem 0; }
.val-card-diff { font-size: 0.72rem; font-family: var(--font-mono); }
.val-card-sub { font-size: 0.62rem; color: var(--text-muted); }
.val-selector { display: flex; gap: 2px; margin-bottom: 0.75rem; flex-wrap: wrap; }
.val-zone-legend {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 0.6rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light);
}
.val-zone-legend-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.val-zone-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: var(--text-secondary); }
.val-zone-swatch { width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0; }
.val-desc {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.85rem 1.1rem; margin-top: 0.75rem;
}
.val-desc-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.4rem; }
.val-desc p {
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6; margin: 0;
}
.val-desc p b { color: var(--text-primary); }

/* ── Phase 2C: Health Check ── */
.hc-period-btn {
  padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
}
.hc-period-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.hc-period-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.hc-scorecard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.hc-total { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.hc-total-label { font-size: 0.82rem; color: var(--text-secondary); }
.hc-total-num { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); }
.hc-total-max { font-size: 1rem; color: var(--text-muted); }
.hc-bar { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; margin-bottom: 1rem; }
.hc-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s; }
.hc-cats { display: flex; flex-direction: column; gap: 0.4rem; }
.hc-cat-row { display: flex; align-items: center; gap: 0.5rem; }
.hc-cat-label { font-size: 0.75rem; color: var(--text-secondary); min-width: 130px; }
.hc-cat-bar { flex: 1; height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.hc-cat-fill { height: 100%; border-radius: 3px; transition: width 0.6s; }
.hc-cat-score { font-size: 0.72rem; font-family: var(--font-mono); color: var(--text-muted); min-width: 40px; text-align: right; }
.hc-summary { display: flex; gap: 0.6rem; margin-top: 0.75rem; flex-wrap: wrap; }
.hc-badge {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm); font-family: var(--font-mono);
}
.hc-pass { background: rgba(74,222,128,0.12); color: #4ade80; }
.hc-warn { background: rgba(251,191,36,0.12); color: #fbbf24; }
.hc-red { background: rgba(248,113,113,0.12); color: #f87171; }

.hc-cat-title {
  font-size: 0.88rem; font-weight: 700; color: var(--text-primary);
  margin: 1.25rem 0 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border);
}

.hc-check {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-left: 3px solid var(--border);
}
.hc-check-pass { border-left-color: #4ade80; }
.hc-check-warning { border-left-color: #fbbf24; }
.hc-check-red { border-left-color: #f87171; }
.hc-check-header { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.hc-check-detail { font-size: 0.78rem; font-family: var(--font-mono); color: var(--text-secondary); margin-bottom: 0.4rem; }
.hc-check-explain { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.2rem; }
.hc-check-explain b { color: var(--text-secondary); }
.hc-show-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--blue); font-size: 0.7rem; padding: 0.2rem 0.5rem; cursor: pointer;
  margin-top: 0.3rem;
}
.hc-show-btn:hover { border-color: var(--blue); }

.hc-disclaimer {
  font-size: 0.68rem; color: var(--text-muted); text-align: center;
  padding: 1rem 0; margin-top: 1rem; border-top: 1px solid var(--border); font-style: italic;
}

@media (max-width: 768px) {
  .quarterly-grid { grid-template-columns: 1fr; }
  .company-profile { flex-direction: column; }
  .cap-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ── News ── */
.earnings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.news-list { display: flex; flex-direction: column; gap: 0.5rem; }
.news-item { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; text-decoration: none; transition: background 0.15s; }
.news-item:hover { background: var(--bg-card-hover); }
.news-publisher { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.news-title { font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }
.ai-summary-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.ai-summary-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; white-space: pre-line; margin-top: 0.3rem; }
.source-link { color: var(--blue); text-decoration: none; font-size: 0.85rem; }
.source-link:hover { text-decoration: underline; }

/* ── 13F Tab ── */
.f13-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.f13-info { margin-bottom: 0.75rem; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.2rem; }
.f13-info code { font-family: var(--font-mono); color: var(--blue); background: var(--bg-primary); padding: 0.1rem 0.3rem; border-radius: 3px; }
.f13-desc { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 1rem; }
.f13-btn { display: inline-block; background: var(--accent); color: #fff; padding: 0.5rem 1.2rem; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.f13-btn:hover { background: var(--accent-light); }

/* ── Ref Table ── */
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 0.5rem; }
.ref-table th { text-align: left; padding: 0.5rem; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-primary); border-bottom: 1px solid var(--border); }
.ref-table td { padding: 0.5rem; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }

/* ── Utilities ── */
.positive { color: var(--green); }
.negative { color: var(--red); }
.text-muted { color: var(--text-muted); }
.empty-state { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 2rem; }

/* ── Responsive ── */
@media (max-width: 1024px) { .value-grid { grid-template-columns: 1fr; } }
/* ── Phase 4: Returns vs S&P 500 ── */
.ret-cards {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem; margin-bottom: 1rem;
}
.ret-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; cursor: pointer; transition: border-color 0.15s;
  border-left: 3px solid var(--border);
}
.ret-card:hover { border-color: var(--text-muted); }
.ret-card.outperform { border-left-color: #4ade80; }
.ret-card.underperform { border-left-color: #f87171; }
.ret-card.disabled { opacity: 0.4; cursor: default; }
.ret-card.active { border-color: var(--accent); border-left-color: var(--accent); }
.ret-card-period { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.ret-card-stock { font-size: 1.1rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }
.ret-card-sp { font-size: 0.78rem; font-family: var(--font-mono); color: var(--text-muted); margin: 0.15rem 0; }
.ret-card-alpha { font-size: 0.82rem; font-weight: 600; font-family: var(--font-mono); margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--border-light); }
.ret-card-status { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; }
.ret-period-btns { display: flex; gap: 2px; margin-bottom: 0.75rem; }
.ret-chart-wrap { position: relative; height: 360px; margin-bottom: 0.5rem; }
.ret-footnote { font-size: 0.7rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem; }

/* ── Edge case warnings ── */
.hc-neg-equity-warn { background: var(--red-dim); color: var(--red); font-size: 0.8rem; padding: 0.6rem 0.8rem; border-radius: var(--radius); margin-bottom: 0.8rem; border-left: 3px solid var(--red); line-height: 1.4; }
.val-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; padding: 0.4rem 0; }

/* ── Cross-tab links ── */
.xlink-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin-top: 0.6rem; }
.xlink { font-size: 0.75rem; color: var(--accent-light); cursor: pointer; text-decoration: none; opacity: 0.8; transition: opacity 0.15s; }
.xlink:hover { opacity: 1; text-decoration: underline; }

/* ── Phase 8: Stock Screener ── */
.scr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.scr-header h2 { font-size: 1.3rem; color: var(--text-primary); margin: 0; }
.scr-count { font-size: 0.8rem; color: var(--text-muted); }
.scr-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.scr-filters { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem; margin-bottom: 0.8rem; }
.filter-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.filter-metric, .filter-op, .filter-val { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.3rem 0.5rem; font-size: 0.78rem; color: var(--text-primary); }
.filter-metric { min-width: 140px; }
.filter-op { width: 50px; text-align: center; }
.filter-val { width: 80px; font-family: var(--font-mono); }
.filter-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; padding: 0.3rem 0.5rem; }
.filter-remove:hover { color: var(--red); }
.scr-dropdowns { display: flex; gap: 1rem; margin-top: 0.6rem; }
.scr-dropdowns label { font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; }
.scr-dropdowns select { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.25rem 0.5rem; font-size: 0.78rem; color: var(--text-primary); }
.scr-results-info { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.scr-table td:first-child { font-family: var(--font-mono); }
.scr-ticker { font-weight: 700; color: var(--accent-light); cursor: pointer; }
.scr-ticker:hover { text-decoration: underline; }
.page-nav-link.active { color: var(--accent-light); border-bottom: 2px solid var(--accent-light); }

@media (max-width: 768px) {
  .filter-row { flex-wrap: wrap; }
  .filter-metric { min-width: 100%; }
  .scr-dropdowns { flex-direction: column; gap: 0.4rem; }
}

/* ── Phase 7: DCF Calculator ── */
.dcf-controls { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.dcf-base-fcf { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.8rem; }
.dcf-base-fcf strong { color: var(--text-primary); font-family: var(--font-mono); }
.dcf-slider-group { margin-bottom: 0.6rem; }
.dcf-slider-label { font-size: 0.78rem; color: var(--text-secondary); display: block; margin-bottom: 0.2rem; }
.dcf-slider-row { display: flex; align-items: center; gap: 0.6rem; }
.dcf-range { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--border); outline: none; }
.dcf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-light); cursor: pointer; border: 2px solid var(--bg-primary); }
.dcf-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent-light); cursor: pointer; border: 2px solid var(--bg-primary); }
.dcf-slider-val { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; color: var(--text-primary); min-width: 4rem; text-align: right; }
.dcf-hint { font-size: 0.7rem; color: var(--text-muted); margin: -0.3rem 0 0.4rem 0; }
.dcf-scenario-btns { display: flex; gap: 0.4rem; margin-top: 0.8rem; flex-wrap: wrap; }
.dcf-btn { padding: 0.35rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); transition: all 0.15s; }
.dcf-btn:hover { border-color: var(--accent); color: var(--accent); }
.dcf-btn-reset { color: var(--text-muted); }
.dcf-fcf-btn { border: 1px solid var(--border); background: var(--bg-primary); }
.dcf-fcf-active { border-color: var(--accent) !important; color: var(--accent) !important; background: rgba(96,165,250,0.08) !important; }
.dcf-result-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.dcf-result-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; font-size: 0.85rem; }
.dcf-result-row span { color: var(--text-secondary); }
.dcf-fair-price { font-size: 1.4rem; color: var(--text-primary); font-family: var(--font-mono); }
.dcf-verdict { text-align: center; padding: 0.5rem; margin: 0.5rem 0; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.85rem; }
.dcf-under { background: var(--green-dim); color: var(--green); }
.dcf-neutral { background: rgba(251,191,36,0.15); color: var(--yellow); }
.dcf-over { background: var(--red-dim); color: var(--red); }
.dcf-bridge { border-top: 1px solid var(--border-light); margin-top: 0.5rem; padding-top: 0.5rem; }
.dcf-bridge-row { display: flex; justify-content: space-between; font-size: 0.78rem; padding: 0.15rem 0; color: var(--text-muted); font-family: var(--font-mono); }
.dcf-bridge-total { font-weight: 700; color: var(--text-primary); border-top: 1px solid var(--border-light); padding-top: 0.3rem; margin-top: 0.2rem; }
.dcf-composition { margin-top: 0.6rem; }
.dcf-comp-bar { height: 8px; border-radius: 4px; background: var(--blue); overflow: hidden; }
.dcf-comp-fcf { height: 100%; background: var(--green); border-radius: 4px 0 0 4px; }
.dcf-comp-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.dcf-warning { background: var(--red-dim); color: var(--red); font-size: 0.78rem; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm); margin-bottom: 0.8rem; }
.dcf-sens-current { background: rgba(96,165,250,0.15); font-weight: 700; color: var(--text-primary); }
.dcf-disclaimer { font-size: 0.68rem; color: var(--text-muted); font-style: italic; margin-top: 0.8rem; padding: 0.5rem 0; border-top: 1px solid var(--border-light); }

/* ── Phase 6: Ratios Dashboard ── */
.ratios-section { margin-bottom: 0.5rem; }
.ratios-section-hdr {
  display: flex; align-items: center; cursor: pointer;
  padding: 0.6rem 0.5rem; font-weight: 600; font-size: 0.85rem;
  user-select: none; border-left: 3px solid var(--border);
  margin-top: 0.8rem; color: var(--text-primary);
}
.ratios-section-hdr::before {
  content: '\25B6'; font-size: 0.55rem; margin-right: 0.5rem;
  display: inline-block; transition: transform 0.15s; color: var(--text-muted);
}
.ratios-section-hdr.expanded::before { transform: rotate(90deg); }
.ratios-section-hdr.border-green  { border-left-color: #4ade80; }
.ratios-section-hdr.border-blue   { border-left-color: #60a5fa; }
.ratios-section-hdr.border-orange { border-left-color: #fb923c; }
.ratios-section-hdr.border-purple { border-left-color: #a78bfa; }
.ratios-section-body.collapsed { display: none; }
.dupont-section { margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.ratios-note { color: var(--text-muted); font-size: 0.75rem; font-style: italic; padding: 0.3rem 0 0.5rem; }

/* ── Phase 5: Peer Comparison ── */
.peer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.peer-comparing { font-size: 0.8rem; color: var(--text-muted); margin-right: 0.3rem; }
.peer-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; font-family: var(--font-mono); }
.peer-chip-primary { background: var(--accent); color: #fff; }
.peer-chip-removable { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); cursor: default; }
.peer-chip-x { cursor: pointer; color: var(--text-muted); font-size: 0.65rem; margin-left: 0.15rem; }
.peer-chip-x:hover { color: var(--red); }
.peer-chip-add { background: transparent; border: 1px dashed var(--border); color: var(--text-secondary); cursor: pointer; font-size: 0.72rem; }
.peer-chip-add:hover { border-color: var(--accent); color: var(--accent); }
.peer-add-input { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 0.25rem 0.6rem; font-size: 0.78rem; color: var(--text-primary); font-family: var(--font-mono); width: 7rem; outline: none; }
.peer-add-input:focus { border-color: var(--accent); }
.peer-suggested { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.peer-suggested-label { font-size: 0.72rem; color: var(--text-muted); margin-right: 0.2rem; }
.peer-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 0.5rem; }
.peer-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 480px; }
.peer-table thead { position: sticky; top: 0; z-index: 2; }
.peer-th { background: var(--bg-primary); padding: 0.6rem 0.7rem; text-align: right; border-bottom: 2px solid var(--border); vertical-align: bottom; min-width: 90px; }
.peer-th-primary { border-bottom-color: var(--accent); }
.peer-th-label { background: var(--bg-primary); text-align: left; position: sticky; left: 0; z-index: 3; min-width: 130px; }
.peer-th-ticker { font-weight: 700; font-size: 0.88rem; font-family: var(--font-mono); color: var(--text-primary); cursor: pointer; }
.peer-th-ticker:hover { color: var(--accent); }
.peer-th-name { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.peer-section-row td { padding: 0.5rem 0.7rem 0.25rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-primary); border-top: 1px solid var(--border); }
.peer-td-label { padding: 0.4rem 0.7rem; color: var(--text-secondary); font-size: 0.78rem; position: sticky; left: 0; background: var(--bg-secondary); z-index: 1; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.peer-td { padding: 0.4rem 0.7rem; text-align: right; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-primary); border-bottom: 1px solid var(--border-light); position: relative; }
.peer-best { font-weight: 700; }
.peer-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; margin-right: 0.3rem; vertical-align: middle; }
.peer-max-note { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-top: 0.3rem; }
.peer-loading { text-align: center; color: var(--text-muted); padding: 2rem; }

@media (max-width: 768px) {
  html { font-size: 13px; }
  .top-bar { flex-wrap: nowrap; height: auto; padding: 0.6rem 1rem; gap: 0.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .search-form { order: 10; max-width: 100%; min-width: 100%; }
  .tech-metrics-grid, .fin-row, .earnings-grid { grid-template-columns: repeat(2, 1fr); }
  .ret-cards { grid-template-columns: repeat(2, 1fr); }
  .tabs-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; font-size: 0.78rem; padding: 0.5rem 0.75rem; }
  .peer-table { min-width: 400px; }
  .peer-th-name { display: none; }
}
