/*
  REDESIGN OVERRIDES
  Simpler app shell, cleaner report, less cockpit.
  Loaded last so it overrides earlier component rules.
*/

/* ──────────────────────────────────────────────
   APP SHELL — 2 columns, no left sidebar
   ────────────────────────────────────────────── */
.app-right-panel {
  padding: var(--space-5);
}

/* Noise texture — applied selectively to card-like elements for subtle contrast */

.report-aside::before,
.app-sidebar::before,
.key-facts-strip::before,
.snapshot-card::before,
.side-panel::before,
.report-section-divider::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.report-aside,
.app-sidebar,
.key-facts-strip,
.snapshot-card,
.side-panel,
.report-section-divider {
  position: relative;
}
.report-aside > *,
.app-sidebar > *,
.key-facts-strip > *,
.snapshot-card > *,
.side-panel > *,
.report-section-divider > * {
  position: relative;
  z-index: 1;
}

/* On smaller screens, hide right panel */
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0 var(--space-3);
  }
  .app-right-panel { display: none; }
  .app-main { padding: 0; }
}

/* ──────────────────────────────────────────────
   TOP NAV (nav-tabs)
   ────────────────────────────────────────────── */
.nav-tabs {
  margin-bottom: var(--space-4);
}

/* ──────────────────────────────────────────────
   REPORT — card-based, single column
   ────────────────────────────────────────────── */
.report-panel {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.report-hero {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0 0 var(--space-4) 0;
  margin-bottom: var(--space-4);
}

.report-header-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.report-header-v2 .rh-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.report-header-v2 .rh-ticker {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.report-header-v2 .rh-name {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.report-header-v2 .rh-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.report-header-v2 .rh-price {
  text-align: right;
}

.report-header-v2 .rh-price-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.report-header-v2 .rh-price-change {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.report-header-v2 .rh-actions {
  display: flex;
  gap: 6px;
}

.report-header-v2 .rh-actions .action-btn {
  padding: 6px 12px;
  font-size: var(--fs-xs);
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--text);
}

.report-header-v2 .rh-actions .action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-bright);
}

.hero-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--signal-color, var(--border));
}

.hero-verdict { display: flex; flex-direction: column; gap: var(--space-2); }

.hero-signal-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

.hero-signal-badge {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--signal-color);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.signal-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--signal-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal-color) 15%, transparent);
}

.hero-confidence-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
}

.hero-conf-label { color: var(--text-dim); font-size: var(--fs-xs); }

.hero-conf-bar {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.hero-conf-fill { height: 100%; border-radius: 3px; }

.hero-conf-value { color: var(--text-dim); font-size: var(--fs-xs); }

.hero-price {
  display: flex;
  justify-content: flex-end;
}

.hero-price-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  width: 100%;
  max-width: 420px;
  text-align: right;
}

.hps-item { display: flex; flex-direction: column; gap: 2px; }
.hps-label { font-size: var(--fs-xs); color: var(--text-dim); }
.hps-value { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-bright); }

/* ─── Key Facts strip — earnings + core metrics in one panel ─── */
.report-summary-grid {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.key-facts-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.kf-earnings {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  min-width: 240px;
  max-width: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}
.kf-earnings.upcoming { border-left: 2px solid var(--accent); }
.kf-earnings.reported { border-left: 2px solid var(--green); }
.kf-earnings.past { border-left: 2px solid var(--text-dim); opacity: 0.92; }
.kf-earnings-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.kf-earnings-badge {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.kf-earnings-q {
  font-family: var(--mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
}
.kf-earnings-date {
  font-size: var(--fs-sm);
  color: var(--text);
}
.kf-eps-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-1);
}
.kf-eps-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 90px;
}
.kf-eps-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kf-eps-value {
  font-family: var(--mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  line-height: 1.1;
}
.kf-eps-what {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.kf-eps-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-sm);
}
.kf-eps-row { color: var(--text); }
.kf-eps-row.pos { color: var(--green); }
.kf-eps-row.neg { color: var(--red); }
.kf-eps-surprise { font-weight: var(--fw-semibold); }
.kf-earnings-history {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.kf-history-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  margin-bottom: 2px;
}
.kf-earnings-prev {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-xs);
}
.kf-prev-q { color: var(--text-dim); }
.kf-prev-eps { font-family: var(--mono); color: var(--text-bright); }
.kf-prev-est { color: var(--text-dim); }

.kf-metrics {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1px;
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  border: 1px solid var(--border);
}
.kf-metrics::-webkit-scrollbar { height: 4px; }
.kf-metrics::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.kf-metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1 1 0;
  min-width: 110px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-inset);
}
.kf-metric-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.kf-metric-value {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
}
.kf-metric-value.pos { color: var(--green); }
.kf-metric-value.neg { color: var(--red); }

/* Bottom snapshot panel — single horizontal row, no wrapping */
.report-summary-grid .side-panel {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.report-summary-grid .side-panel .side-panel-title,
.report-summary-grid .side-panel .side-kv {
  flex: 1 1 0;
  min-width: 100px;
  background: var(--bg-panel);
  padding: var(--space-2) var(--space-3);
}
.report-summary-grid .side-panel .side-panel-title {
  display: none;
}
.report-summary-grid .side-kv {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.report-summary-grid .side-kv-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  white-space: nowrap;
}
.report-summary-grid .side-kv-value {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  white-space: nowrap;
}

/* ─── Report layout — single column ─── */
.report-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.report-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ─── Collapsible cards ─── */
.collapsible {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.collapsible-header {
  background: transparent;
  border: none;
  cursor: pointer;
  justify-content: flex-start !important;
}

.collapsible-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.collapsible-summary {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-weight: var(--fw-normal);
}

.collapsible-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.collapsible.open .collapsible-chevron { transform: rotate(180deg); }

.collapsible-body { display: none; }
.collapsible.open .collapsible-body { display: block; }

.collapsible-body-inner {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.55;
}

/* ─── Decision digest ─── */
.decision-digest {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.decision-digest-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.decision-digest-item b { color: var(--text-dim); font-size: var(--fs-xs); font-weight: var(--fw-medium); }

/* ─── Thesis ─── */
.report-thesis {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--stack-gap) 0 0;
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
}

/* ─── Fixed header + content offset so nothing overlaps the chart ─── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}
body {
  padding-top: var(--header-height);
}
html {
  scroll-padding-top: var(--header-height);
}

.app-shell {
  grid-template-columns: 1fr;
  max-width: 100%;
  padding: 0 var(--space-5);
}
.app-right-panel { display: none; }
.app-main { padding: 0; }

/* ─── Report density / less bold / no uppercase ─── */
.results-container { max-width: 100% !important; }
body.report-open .app-shell { height: calc(100vh - var(--header-height)) !important; min-height: auto !important; max-height: calc(100vh - var(--header-height)) !important; overflow: hidden !important; }
body.report-open .app-main { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
body.report-open .results-container { flex: 1; min-height: 0; overflow: hidden; display: flex; justify-content: center; }
.report-panel {
  padding: 0 var(--space-4) 0 var(--space-4);
  max-width: 1120px !important;
  max-height: 100%;
  height: calc(100% - 120px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: none;
  box-shadow: var(--shadow-lg);
  margin-bottom: 120px;
}
.report-end-spacer {
  height: min(45vh, 420px);
  flex-shrink: 0;
}
.report-panel::-webkit-scrollbar { width: 6px; }
.report-panel::-webkit-scrollbar-track { background: transparent; }
.report-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.report-panel::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Force single-column layout so fixed sidebars don't reduce main width */
.report-layout.report-layout-3col {
  display: block !important;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}
.report-layout.report-layout-3col .report-main {
  width: 100%;
  max-width: 100%;
}

/* Wider layout — breathing room for inner elements */
.collapsible-body-inner {
  padding: 0 var(--space-5) var(--space-4);
}
.report-section {
  padding: var(--space-5) var(--space-4);
  background: transparent;
  border: none;
  border-radius: 0;
}
.report-section-title {
  display: none;
}
.table-wrapper {
  overflow-x: auto;
}
.table-wrapper table,
.earnings-table,
.analyst-table {
  width: 100%;
}
.analyst-row,
.dcf-row {
  padding-right: var(--space-4) !important;
  gap: var(--space-4) !important;
}
.data-row {
  padding: 10px var(--space-4);
}
.hero-identity {
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.hero-decision {
  padding: var(--space-5);
}
.report-hero {
  padding: var(--space-5);
}
.collapsible-header {
  padding: 0;
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.7;
}
.collapsible.open .collapsible-header {
  opacity: 1;
}
.collapsible-summary {
  color: var(--text-dim);
  opacity: 0.7;
}
.report-chart-section .chart-section-header {
  border: none;
  padding: 0;
  margin: 0;
}
.report-advanced-label {
  display: none;
}

/* Hero v3 — flat identity + decision row */
.hero-identity {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}
.hero-identity-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.hero-identity-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-align: right;
}
.hero-price-block { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hero-actions { display: flex; gap: var(--space-2); }

.hero-decision {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: var(--space-4);
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}
.hero-decision-main { display: flex; flex-direction: column; gap: var(--space-3); }
.hero-signal-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.hero-signal-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--signal-color, var(--accent));
}
.hero-signal-badge .signal-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--signal-color, var(--accent));
}
.hero-confidence {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  display: flex; align-items: baseline; gap: 4px;
}
.hero-confidence-num { font-family: var(--mono); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.hero-confidence-num.high { color: var(--green); }
.hero-confidence-num.medium { color: var(--amber); }
.hero-confidence-num.low { color: var(--red); }
.hero-confidence-denom { font-size: var(--fs-xs); color: var(--text-dim); }

.hero-reasons { display: flex; flex-direction: column; gap: var(--space-2); }
.hero-reason {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}
.hero-reason:last-child { border-bottom: none; }
.hero-reason-num { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-dim); }
.hero-reason-title { font-size: var(--fs-base); color: var(--text-bright); }
.hero-reason-value { font-family: var(--mono); font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--green); text-align: right; }

.hero-fv-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid var(--border);
}
.hero-fv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-sm);
}
.hero-fv-row span:first-child { color: var(--text-dim); }
.hero-fv-row span:last-child { font-family: var(--mono); font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-bright); }
.hero-fv-row .value-gold { color: var(--accent); }

/* Flat report sections (P0: fewer cards) */
.report-section-body { padding: 0; }

.report-hero { margin-bottom: var(--space-3); }
.report-header-v2 { margin-bottom: var(--space-3); }
.report-header-v2 .rh-ticker { font-size: var(--fs-xl); }
.report-header-v2 .rh-price-value { font-size: var(--fs-xl); }
.hero-body { padding: var(--space-3); gap: var(--space-3); border-left-width: 2px; }
.hero-signal-badge { font-size: var(--fs-xl); }
.hero-price-strip { gap: var(--space-3); max-width: 360px; }
.hps-value { font-size: var(--fs-base); font-weight: var(--fw-medium); }

.report-summary-grid { margin-bottom: var(--space-3); }

/* Valuation primary section */
.valuation-summary {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
    color: var(--text-dim);
}
.valuation-summary strong {
    font-family: var(--mono);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
    margin-left: 4px;
}
.valuation-summary .value-gold { color: var(--accent); }
.valuation-divider { color: var(--border-strong); }

/* Advanced analysis label */
.report-advanced-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: var(--space-4) 0 var(--space-2);
    margin-top: var(--space-4);
    border-top: 1px solid var(--border-strong);
}

/* Metric group labels inside financials section */
.metric-group-label {
    font-size: 10px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0.7;
    padding: var(--space-3) var(--space-3) var(--space-1);
    margin-top: var(--space-2);
}
.metric-group-label:first-child { margin-top: 0; padding-top: 0; }

/* Taller, more readable metric rows and tables */
.metric-v2 { padding: var(--space-3) 0; }
.loading-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 40vh;
  padding: var(--space-8) var(--space-4) var(--space-4);
  box-sizing: border-box;
}
body.report-open .loading-screen {
  padding-top: calc(var(--header-height) + var(--space-6));
}
.data-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 10px var(--space-3);
    border-bottom: 1px solid var(--border);
}
.data-row:last-child { border-bottom: none; }
.table-wrapper td, .table-wrapper th { padding: 12px var(--space-3); }
.table-wrapper tbody tr { border-bottom: 1px solid var(--border); }
.table-wrapper tbody tr:last-child { border-bottom: none; }

/* Risk score larger */
.risk-inline-label { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.risk-inline-score { font-family: var(--mono); font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.risk-inline-bar { height: 8px; border-radius: 4px; margin: var(--space-2) 0 var(--space-3); }
.risk-profile-title { margin-bottom: var(--space-1); }

/* Remove uppercase / heavy labels from report tables/cards */
.analyst-label,
.earnings-label,
.metric-card .metric-label,
.dcf-card-label,
.scenario-label,
.scanner-metric-label,
.compare-label,
.compare-suggestions span:first-child,
.compare-winner-label,
.score-segment-label,
.section-label,
.risk-factor-label,
.metric-v2-label,
.rp-wl-empty {
  text-transform: none;
  letter-spacing: var(--ls-normal);
  font-family: var(--sans);
  font-weight: var(--fw-normal);
}

/* Soften values so not everything screams */
.analyst-value,
.earnings-value,
.metric-card .metric-value,
.dcf-card-value,
.scenario-value,
.scanner-metric-value,
.metric-v2-value,
.compare-vs {
  font-family: var(--sans);
  font-weight: var(--fw-medium);
}

/* Keep only truly important numbers bold */
.analyst-value.green,
.analyst-value.amber,
.analyst-value.red,
.earnings-value.green,
.earnings-value.red,
.scenario-value,
.hero-signal-badge,
.report-header-v2 .rh-ticker,
.report-header-v2 .rh-price-value {
  font-weight: var(--fw-semibold);
}

/* Simplify source note / badge */
.source-note {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.source-badge {
  text-transform: none;
  font-weight: var(--fw-normal);
  letter-spacing: var(--ls-normal);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-dim);
}

/* Soften table headers in report */
.report-main .table th,
.earnings-table th,
.analyst-table .analyst-label {
  text-transform: none;
  letter-spacing: var(--ls-normal);
  font-weight: var(--fw-normal);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.report-main .table td,
.earnings-table td,
.analyst-table .analyst-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
  white-space: normal;
}

/* Smaller target range values */
.target-range-values {
  font-size: var(--fs-sm);
  font-weight: var(--fw-normal);
}
.target-mid { color: var(--text); }

/* ─── Responsive report ─── */
@media (max-width: 768px) {
  .report-panel { padding: 0 var(--space-3); }
  .report-hero { padding: var(--space-3); }
  .report-header-v2 { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .report-header-v2 .rh-right { width: 100%; justify-content: space-between; }
  .hero-body { grid-template-columns: 1fr; }
  .hero-price { justify-content: flex-start; }
  .hero-price-strip { max-width: 100%; grid-template-columns: repeat(3, 1fr); text-align: left; }
  .key-facts-strip { flex-direction: column; }
  .kf-metrics { flex-wrap: wrap; overflow-x: visible; }
}

/* =========================================================
   POLISH PASS v2 — less radius, tighter summary, fade colors
   ========================================================= */

/* 1. Sharper, less cardy report containers */
.report-hero,
.collapsible,
.risk-score-card,
.reason-item,
.metrics-grid-v2 .metric-v2 {
  border-radius: var(--radius-sm);
}

/* 2. Summary strip — compact unified key facts panel */
.report-summary-grid {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.report-summary-grid .side-panel-title { display: none; }

/* Section divider — clear visual break between summary and detailed report */
.report-section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-6);
}
.report-section-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.report-section-divider-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

/* 3. Reason items — soft color fade, no hard left outline */
.reason-item {
  border: none;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.reason-item.positive {
  background: linear-gradient(90deg, rgba(74,222,128,0.06) 0%, transparent 35%);
}

.reason-item.negative {
  background: linear-gradient(90deg, rgba(248,113,113,0.06) 0%, transparent 35%);
}

.reason-item .reason-dot {
  width: 6px;
  height: 6px;
  margin-top: 8px;
}

.reason-section-title {
  font-family: var(--sans);
  text-transform: none;
  letter-spacing: var(--ls-normal);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
}

/* 4. Risk section — clean list, not cards, aligned */
.risk-score-card {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: var(--space-3);
}

.risk-score-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.risk-score-label {
  font-family: var(--sans);
  text-transform: none;
  letter-spacing: var(--ls-normal);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}

.risk-score-value {
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
}

.risk-factors-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.risk-factor-tag {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  background: var(--bg-inset);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Risk/Fundamentals list — flat, color-faded, one line per metric */
.risk-details .metrics-grid-v2,
.collapsible-body-inner .metrics-grid-v2,
.metrics-grid-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.risk-details .metric-v2,
.collapsible-body-inner .metrics-grid-v2 .metric-v2,
.metrics-grid-v2 .metric-v2 {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.risk-details .metric-v2::before,
.collapsible-body-inner .metrics-grid-v2 .metric-v2::before,
.metrics-grid-v2 .metric-v2::before {
  display: none;
}

.risk-details .metric-v2.good,
.collapsible-body-inner .metrics-grid-v2 .metric-v2.good,
.metrics-grid-v2 .metric-v2.good { background: linear-gradient(90deg, rgba(74,222,128,0.05) 0%, transparent 30%); }

.risk-details .metric-v2.ok,
.collapsible-body-inner .metrics-grid-v2 .metric-v2.ok,
.metrics-grid-v2 .metric-v2.ok { background: linear-gradient(90deg, rgba(251,191,36,0.05) 0%, transparent 30%); }

.risk-details .metric-v2.bad,
.collapsible-body-inner .metrics-grid-v2 .metric-v2.bad,
.metrics-grid-v2 .metric-v2.bad { background: linear-gradient(90deg, rgba(248,113,113,0.05) 0%, transparent 30%); }

/* Flatten .metric-v2-head so label/badge/value line up */
.risk-details .metric-v2-head,
.collapsible-body-inner .metric-v2-head,
.metrics-grid-v2 .metric-v2-head {
  display: contents;
}

.risk-details .metric-v2-label,
.collapsible-body-inner .metric-v2-label,
.metrics-grid-v2 .metric-v2-label {
  grid-column: 1;
  font-size: var(--fs-sm);
  color: var(--text);
  font-family: var(--sans);
}

.risk-details .metric-v2-value,
.collapsible-body-inner .metric-v2-value,
.metrics-grid-v2 .metric-v2-value {
  grid-column: 2;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-bright);
  font-family: var(--sans);
  text-align: right;
}

.risk-details .metric-v2-badge,
.collapsible-body-inner .metric-v2-badge,
.metrics-grid-v2 .metric-v2-badge {
  grid-column: 3;
  text-align: right;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.risk-details .metric-v2-bar,
.risk-details .metric-v2-desc,
.collapsible-body-inner .metric-v2-bar,
.collapsible-body-inner .metric-v2-desc,
.metrics-grid-v2 .metric-v2-bar,
.metrics-grid-v2 .metric-v2-desc {
  display: none;
}

/* 6. Smaller, calmer report hero */
.report-header-v2 .rh-ticker { font-size: var(--fs-lg); }
.report-header-v2 .rh-price-value { font-size: var(--fs-lg); }
.hero-signal-badge { font-size: var(--fs-lg); }
.hero-body { padding: var(--space-3); gap: var(--space-3); }
.hps-label { font-size: var(--fs-xs); }
.hps-value { font-size: var(--fs-sm); }

/* 7. Calmer collapsible headers — handled by divider style */

/* 8. Tables in report less heavy */
.report-main .table th,
.earnings-table th,
.analyst-table .analyst-label {
  font-weight: var(--fw-normal);
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
}

.analyst-table .analyst-value { font-weight: var(--fw-medium); }

/* ═══════════════════════════════════════════════════
   9. SECTION-BASED REPORT LAYOUT (old report architecture)
   ═══════════════════════════════════════════════════ */

/* Score bar — 5 segments under thesis */
.score-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.score-segment {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-seg-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-family: var(--mono);
}
.score-seg-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-family: var(--mono);
}
.score-seg-track {
  height: 3px;
  background: var(--bg-inset);
  border-radius: 2px;
  overflow: hidden;
}
.score-seg-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Report section — always visible, no collapse */
.report-section {
  margin-bottom: var(--space-4);
}
.report-section-body {
  padding: 0;
}

/* Data rows — inline label | desc | value | badge */
.data-rows {
  display: flex;
  flex-direction: column;
}
.data-row {
  display: grid;
  grid-template-columns: 140px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  transition: background 0.15s;
}
.data-row:last-child { border-bottom: none; }
.data-row:hover { background: var(--bg-inset); }
.data-label {
  font-weight: var(--fw-medium);
  color: var(--text-bright);
}
.data-desc {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.data-value {
  font-family: var(--mono);
  font-weight: var(--fw-medium);
  color: var(--text-bright);
  text-align: right;
  white-space: nowrap;
}
.data-badge {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.data-badge.good { color: var(--green); }
.data-badge.ok { color: var(--text-dim); }
.data-badge.bad { color: var(--red); }
.data-badge.na { color: var(--text-dim); }

/* Thesis items — numbered like old report */
.thesis-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.thesis-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.thesis-group-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  margin-bottom: 6px;
}
.thesis-group-label.positive { color: var(--green); }
.thesis-group-label.negative { color: var(--red); }
.thesis-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  align-items: start;
}
.thesis-item:last-child { border-bottom: none; }
.thesis-num {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-family: var(--mono);
  color: var(--text-dim);
  line-height: 1.4;
}
.thesis-item.positive .thesis-num { color: var(--green); }
.thesis-item.negative .thesis-num { color: var(--red); }
.thesis-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.thesis-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.thesis-item-title {
  font-weight: var(--fw-medium);
  color: var(--text-bright);
  font-size: var(--fs-sm);
}
.thesis-item-value {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  white-space: nowrap;
}
.thesis-item.positive .thesis-item-value { color: var(--green); }
.thesis-item.negative .thesis-item-value { color: var(--red); }
.thesis-item-desc {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.45;
  margin: 0;
}
.thesis-others {
  margin-top: var(--space-2);
}
.thesis-others summary {
  cursor: pointer;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  padding: 6px 0;
}
.thesis-others[open] summary { margin-bottom: var(--space-2); }

/* Risk inline header */
.risk-profile-title {
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}
.risk-inline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.risk-inline-label {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
.risk-inline-score {
  font-family: var(--mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}
.risk-inline-bar {
  width: 100%;
  height: 4px;
  margin-bottom: var(--space-4);
  background: var(--bg-inset);
  border-radius: 2px;
  overflow: hidden;
}
.risk-inline-fill {
  height: 100%;
  border-radius: 2px;
}

/* Dilution chips */
.dilution-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-3);
}
.dilution-chips-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-family: var(--mono);
  width: 100%;
  margin-bottom: 4px;
}
.dilution-chip {
  font-size: var(--fs-xs);
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border);
}

/* Earnings dot in data-badge */
.data-badge .earnings-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Legacy fixed sidebars — disabled; rail is in document flow (_report_redesign_v2) */
/*
  .report-nav {
    position: fixed;
    ...
  }
*/

/* Hide fixed sidebars on smaller screens */
@media (max-width: 1023px) {
  .report-nav,
  .report-snapshot {
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    box-shadow: none !important;
  }
}

/* ──────────────────────────────────────────────
   NIPPO / MTA THEME — final overrides
   ────────────────────────────────────────────── */
.report-thesis,
.decision-card,
.snapshot-card,
.side-panel,
.radar-card,
.settings-card,
.auth-card {
  border: none !important;
  box-shadow: var(--shadow-sm);
}

.filter-chip.active,
.radar-filter-chip.active {
  background: var(--bg-elevated) !important;
  color: var(--text-bright) !important;
  border-color: transparent !important;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.user-menu-avatar,
.top-bar-user-avatar {
  background: var(--accent-grad) !important;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.collapsible-header:hover {
  background: var(--bg-hover);
}

/* Akcent na linkach w treści raportu/appki — nie w nav marketingu */
.report-panel a:not(.btn):not(.action-btn):not(.nav-tab):not(.chart-tab),
.app-main .pulpit-empty a {
  color: var(--accent-light);
}

.report-rail .report-nav-item,
.report-rail .report-nav-item .report-nav-label {
  color: var(--text-dim);
}
.report-rail .report-nav-item:hover,
.report-rail .report-nav-item:hover .report-nav-label {
  color: var(--text-bright);
}
.report-rail .report-nav-item.active,
.report-rail .report-nav-item.active .report-nav-label {
  color: var(--text-bright);
}

.report-header-v2 .rh-ticker,
.valuation-hero .vh-price,
.gold-num,
.cel-dm-value {
  color: var(--accent-light);
}
