/*
  DiviMetrics — Component Library
  =====================================
  Reusable UI components built on design tokens from _variables.css
  Import AFTER _variables.css
*/

/* ──────────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  background: var(--bg-scene);
  background-attachment: fixed;
  color: var(--text);
  line-height: var(--lh-normal);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ──────────────────────────────────────────────
   LAYOUT PRIMITIVES
   ────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ──────────────────────────────────────────────
   APP SHELL — Full-width 3-column terminal grid
   ────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 1fr 280px;
  align-items: start;
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
.app-main {
  min-width: 0;
  padding: 0 var(--space-5);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - var(--header-height));
}
.app-main > * {
  width: 100%;
  max-width: 1120px;
}
.app-right-panel {
  background: var(--bg);
  border-left: 1px solid var(--border);
  align-self: start;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: var(--space-4) var(--space-4);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.app-right-panel::-webkit-scrollbar { width: 4px; }
.app-right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Sidebar navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0;
}
.sidebar-nav-section {
  font-size: 0.65rem;
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  padding: var(--space-3) var(--space-3) var(--space-1);
  text-transform: none;
  letter-spacing: 0.02em;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px var(--space-3);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  white-space: nowrap;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  text-align: left;
  width: 100%;
  font-family: var(--sans);
  letter-spacing: var(--ls-normal);
  text-transform: none;
}
.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
  color: var(--text-dim);
}
.sidebar-nav-item:hover {
  color: var(--text-bright);
  background: var(--bg-hover);
}
.sidebar-nav-item:hover svg { opacity: 1; color: var(--text-bright); }

.sidebar-nav-item.active {
  color: var(--text-bright);
  border-left-color: var(--accent);
  background: var(--bg-panel);
}
.sidebar-nav-item.active svg { opacity: 1; color: var(--accent); }
.sidebar-nav-item .tab-badge {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: var(--fw-bold);
  font-family: var(--mono);
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1.6;
}
.sidebar-footer .sf-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-footer .sf-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
}

/* Right panel sections */
.rp-section {
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) 0;
}
.rp-section:last-child { border-bottom: none; }
.rp-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: var(--ls-wide);
}
.rp-title .rp-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--green);
}

/* Mini watchlist in right panel */
.rp-wl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.rp-wl-item:hover { background: var(--bg-hover); padding-left: 4px; padding-right: 4px; margin: 0 -4px; border-radius: var(--radius-sm); }
.rp-wl-item:last-child { border-bottom: none; }
.rp-wl-ticker {
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  font-size: var(--fs-base);
}
.rp-wl-price {
  font-family: var(--mono);
  color: var(--text);
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
}
.rp-wl-change {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.rp-wl-change.pos { color: var(--green); }
.rp-wl-change.neg { color: var(--red); }
.rp-wl-empty {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-align: center;
  padding: var(--space-3) 0;
  font-family: var(--mono);
}

/* Market status */
.rp-market-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.rp-market-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rp-market-dot.open { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.rp-market-dot.closed { background: var(--red); }
.rp-market-label { color: var(--text-bright); font-weight: var(--fw-semibold); }
.rp-market-time { color: var(--text-dim); font-size: var(--fs-xs); margin-top: 4px; font-family: var(--mono); }

/* Recent tickers */
.rp-recent-item {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.rp-recent-item:hover { border-color: var(--accent); color: var(--accent); }

/* Status bar (Bloomberg-style bottom bar) */
.status-bar {
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  height: var(--footer-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-sticky);
  overflow: hidden;
  white-space: nowrap;
}
.status-bar .sb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.status-bar .sb-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}
.status-bar .sb-item strong { color: var(--text); font-weight: var(--fw-semibold); }
.status-bar .sb-spacer { flex: 1; }

/* Status bar: scrollable on mobile instead of truncating */
@media (max-width: 899px) {
  .status-bar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .status-bar::-webkit-scrollbar { display: none; }
  .status-bar .sb-spacer { display: none; }
}

/* Responsive: hide right panel below 1280px */
@media (max-width: 1279px) {
  .app-shell { grid-template-columns: var(--sidebar-width) 1fr; }
  .app-right-panel { display: none; }
}
/* Responsive: hide sidebar below 900px, show horizontal nav fallback */
@media (max-width: 899px) {
  .app-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .app-sidebar { display: none; }
  .app-main { height: auto; overflow: visible; padding: 0; }
}
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ──────────────────────────────────────────────
   TOP BAR — premium, minimal header
   ────────────────────────────────────────────── */
.top-bar {
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--header-height);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.top-bar-brand {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.top-bar-brand span { color: var(--accent-light); }
.brand-mark {
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.brand-mark--top { width: 22px; height: 22px; }
.top-bar-brand .brand-mark { width: 22px; height: 22px; }
.top-bar-brand svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

.top-bar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.top-bar-search input {
  width: 100%;
  padding: 8px 14px 8px 16px;
  background: var(--bg-input);
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.top-bar-search input:focus {
  border-left-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
}
.top-bar-search input::placeholder { color: var(--text-dim); }

.top-bar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  position: relative;
}

/* ── User menu (avatar + dropdown) ── */
.top-bar-auth-slot {
  position: relative;
}

.top-bar-pro-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.top-bar-pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: var(--accent-dim);
  border: none;
  border-radius: 6px;
  white-space: nowrap;
}

.top-bar-pro-until {
  font-size: var(--fs-xs);
  color: var(--text);
  white-space: nowrap;
}

.user-menu-head-text .top-bar-plan-expiry {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  padding: 0;
  border: none;
}

.user-menu-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.user-menu-plan .top-bar-pro-badge {
  font-size: 10px;
  padding: 3px 10px;
  letter-spacing: 0.1em;
}

.user-menu-plan-expiry,
.user-menu-plan-free {
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.3;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.user-menu-trigger:hover .user-avatar,
.user-menu.is-open .user-avatar {
  box-shadow: 0 0 0 2px var(--accent-light);
}

.user-menu-trigger .user-menu-chevron,
.user-menu-trigger .user-menu-name {
  display: none;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent-deep, #1e3a5f) 80%, var(--accent)));
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--fs-sm);
}

.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  border: 1px solid var(--border-strong);
}

.user-avatar-img.user-avatar--lg {
  width: 44px;
  height: 44px;
}

.user-menu-trigger:hover .user-avatar-img,
.user-menu.is-open .user-avatar-img {
  box-shadow: 0 0 0 2px var(--accent-light);
}

.user-avatar--guest {
  background: var(--bg-hover);
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
}

.user-menu-name {
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-bright);
  font-weight: var(--fw-medium);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 300;
}

.user-menu-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
}

.user-menu-head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-head-text strong {
  font-size: var(--fs-sm);
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-head-text span {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 10px var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
}

.user-menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.user-menu-item--danger {
  color: color-mix(in srgb, var(--red, #e57373) 85%, var(--text));
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-1) 0;
}

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

/* ──────────────────────────────────────────────
   NAV TABS — main top navigation
   ────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  gap: var(--space-1);
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: var(--space-2) 0;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.nav-tab svg { width: 16px; height: 16px; opacity: 0.5; transition: opacity var(--transition-fast); flex-shrink: 0; }
.nav-tab:hover { color: var(--text-bright); background: var(--bg-inset); }
.nav-tab:hover svg { opacity: 0.8; }
.nav-tab.active {
  color: var(--text-bright);
  background: var(--bg-elevated);
  border: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-tab.active svg { opacity: 1; color: var(--accent); }

/* Grouped nav (Pulpit / Rynek / Portfel / Narzędzia) */
.nav-tabs-grouped {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.nav-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-group-label {
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  opacity: 0.7;
  margin-right: 2px;
  white-space: nowrap;
}

.top-bar .nav-group-label { display: none; }

/* Tabular numbers */
.num-mono,
.hero-price,
.valuation-hero-value,
.val-stat-value,
.stock-rail-kv-value,
.snap-kv-value,
.snap-score,
.table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Digest chips */
.digest-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.digest-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text-dim);
  cursor: default;
}

.digest-chip.digest-signal { border-color: var(--gold); color: var(--gold); }
.digest-chip.digest-upside { border-color: var(--green-border); color: var(--green); }
.digest-chip.digest-catalyst { border-color: var(--accent); color: var(--accent-light); }
.digest-chip.digest-priced_in { border-color: var(--amber); color: var(--amber); }
.digest-chip.digest-new { border-color: var(--border-strong); color: var(--text); }

.rp-wl-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rp-wl-chips { display: flex; flex-wrap: wrap; gap: 3px; }

.rp-wl-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.nav-tab .tab-badge {
  color: var(--accent);
  font-weight: var(--fw-bold);
  font-size: 0.9em;
}

/* ──────────────────────────────────────────────
   DISCLAIMER BAR (static footer)
   ────────────────────────────────────────────── */
.disclaimer-bar {
  background: var(--bg-inset);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin-top: 0;
}
.disclaimer-bar svg { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.6; }

/* ──────────────────────────────────────────────
   SEARCH CONTAINER
   ────────────────────────────────────────────── */
.search-container {
  max-width: 100%;
  margin: var(--space-3) auto;
  padding: 0 var(--space-4);
  position: relative;
}
.search-box { display: flex; gap: var(--space-2); }
.search-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--transition-fast);
}
.search-input:focus { border-color: var(--border-focus); }
.search-input::placeholder { color: var(--text-dim); }
.search-btn {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-inverse);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.search-btn:hover { opacity: 0.85; }
.search-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.research-suggestions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-4); }
.research-suggestions.centered { justify-content: center; }
.research-suggestions-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--space-2);
  font-family: var(--mono);
}
.research-chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
}
.research-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Compact app search — full width within main */
.research-intro.compact {
  text-align: center;
  padding: var(--space-4) 0 var(--space-3);
  max-width: 640px;
  margin: 0 auto;
}
.research-intro.compact h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  margin: 0 0 var(--space-1);
  letter-spacing: -0.01em;
}
.research-intro.compact p {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin: 0;
  line-height: var(--lh-normal);
}
#searchTab .search-box,
#searchTab .suggestions,
#searchTab .research-suggestions {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ──────────────────────────────────────────────
   SUGGESTIONS DROPDOWN
   ────────────────────────────────────────────── */
.suggestions {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 2px;
  max-height: 300px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
  box-shadow: var(--shadow-lg);
}
.suggestion-item {
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}
.suggestion-item:hover { background: var(--bg-hover); }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-symbol { color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); min-width: 70px; font-family: var(--mono); }
.suggestion-name { color: var(--text-dim); font-size: var(--fs-xs); flex: 1; }
.suggestion-exch { color: var(--text-dim); font-size: var(--fs-xs); font-family: var(--mono); }
.suggestion-logo { width: 20px; height: 20px; border-radius: 2px; margin-right: 8px; flex-shrink: 0; object-fit: contain; }
.suggestion-logo-slot { width: 20px; height: 20px; margin-right: 8px; flex-shrink: 0; display: inline-block; }

/* ──────────────────────────────────────────────
   LOADING STATES (canonical — see also skeleton section below)
   ────────────────────────────────────────────── */
.loading { text-align: center; padding: var(--space-10) var(--space-4); color: var(--text-dim); }

/* Skeleton loaders — moved to dedicated section below */

/* ──────────────────────────────────────────────
   REPORT PANEL (Main result card)
   ────────────────────────────────────────────── */
.report-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: var(--space-4) var(--space-4) var(--space-6);
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  min-width: 0;
  max-width: 100%;
}
.report-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: contain; flex-shrink: 0; background: var(--bg-panel); }
.report-logo-slot { width: 40px; height: 40px; flex-shrink: 0; }
.ticker-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: contain; flex-shrink: 0; background: var(--bg-panel); }

/* Signal badge */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  border: 1px solid;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.signal-STRONG+BUY { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.signal-BUY { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.signal-WEAK+BUY { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-bg); }
.signal-HOLD { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
.signal-OVERVALUED { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.signal-NO+DATA { color: var(--text-dim); border-color: var(--border-strong); background: var(--bg-inset); }

/* Section label (sub-section within collapsible) */
.section-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: var(--space-4) 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.section-label:first-child { margin-top: 0; }

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  background: var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  cursor: help;
  flex-shrink: 0;
}
.tooltip:hover { background: var(--accent); color: var(--text-inverse); }
.tooltip .tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  color: var(--text);
  padding: var(--space-3) var(--space-4);
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  white-space: normal;
  width: 320px;
  text-align: left;
  z-index: var(--z-tooltip);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  margin-bottom: 6px;
  text-transform: none;
  letter-spacing: normal;
}
.tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }

/* ──────────────────────────────────────────────
   METRICS GRID
   ────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-2);
}
.metric {
  background: transparent;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.metric-label {
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-value {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.metric-value.green { color: var(--green); }
.metric-value.red { color: var(--red); }
.metric-value.yellow { color: var(--amber); }
.metric-value.blue { color: var(--accent); }
.metric-sub { color: var(--text-dim); font-size: var(--fs-xs); margin-top: 2px; font-family: var(--mono); }

/* ──────────────────────────────────────────────
   CONFIDENCE BADGE
   ────────────────────────────────────────────── */
.conf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.conf-badge.high { color: var(--green); background: var(--green-bg); }
.conf-badge.medium { color: var(--amber); background: var(--amber-bg); }
.conf-badge.low { color: var(--red); background: var(--red-bg); }
.conf-score-num { font-weight: var(--fw-bold); }
.conf-bar {
  width: 60px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.conf-bar-fill { height: 100%; border-radius: 2px; transition: width var(--transition-slow); }
.conf-bar-fill.high { background: var(--green); }
.conf-bar-fill.medium { background: var(--amber); }
.conf-bar-fill.low { background: var(--red); }

/* ──────────────────────────────────────────────
   SENTIMENT
   ────────────────────────────────────────────── */
.sentiment-positive { color: var(--green); font-weight: var(--fw-semibold); }
.sentiment-neutral { color: var(--amber); font-weight: var(--fw-semibold); }
.sentiment-negative { color: var(--red); font-weight: var(--fw-semibold); }

/* ──────────────────────────────────────────────
   METHOD BADGE
   ────────────────────────────────────────────── */
.method-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
}

/* ──────────────────────────────────────────────
   NEWS LIST
   ────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 1px; }
.news-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: var(--lh-normal);
}
.news-item.positive { border-left-color: var(--green); background: rgba(74, 222, 128, 0.07); }
.news-item.negative { border-left-color: var(--red); background: rgba(239, 68, 68, 0.07); }
.news-item .sentiment-dot { flex-shrink: 0; margin-top: 6px; }
.news-empty { color: var(--text-dim); font-size: var(--fs-sm); text-align: center; padding: var(--space-4); }
/* Empty state — canonical definition below */

/* ──────────────────────────────────────────────
   INVESTMENT THESIS
   ────────────────────────────────────────────── */
.thesis-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.thesis-item:last-child { border-bottom: none; }
.thesis-number {
  font-family: var(--mono);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--accent);
  min-width: 28px;
  flex-shrink: 0;
}
.thesis-body { flex: 1; }
.thesis-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.thesis-text { font-size: var(--fs-sm); color: var(--text); line-height: var(--lh-normal); }
.thesis-confidence {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.thesis-confidence.high { color: var(--green); background: var(--green-bg); }
.thesis-confidence.medium { color: var(--amber); background: var(--amber-bg); }
.thesis-confidence.low { color: var(--text-dim); background: var(--bg-inset); }

/* ──────────────────────────────────────────────
   SCORE BAR
   ────────────────────────────────────────────── */
.score-bar-container {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;
  margin-bottom: var(--space-2);
}
.score-bar-segment {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-panel);
  text-align: center;
}
.score-segment-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.score-segment-value {
  font-family: var(--mono);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}
.score-segment-bar {
  height: 3px;
  border-radius: 1px;
  margin-top: 6px;
}

/* reason-source (legacy badge) */
.reason-source {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-right: 6px;
  font-family: var(--mono);
  vertical-align: middle;
}
.reason-source.model { color: var(--accent); background: var(--accent-dim); }
.reason-source.analyst { color: var(--cyan); background: var(--cyan-bg); }
.reason-source.news { color: var(--text-dim); background: var(--bg-inset); }
.reason-source.disagreement { color: var(--amber); background: var(--amber-bg); }

/* ──────────────────────────────────────────────
   VALUATION STATUS BAR
   ────────────────────────────────────────────── */
.val-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--space-3);
}
.val-status-icon { font-size: 1.2em; font-weight: var(--fw-bold); width: 24px; text-align: center; flex-shrink: 0; }
.val-status-text { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.val-status-sub { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; font-family: var(--mono); }

/* ──────────────────────────────────────────────
   WARNING / ERROR BOXES
   ────────────────────────────────────────────── */
.warning-box {
  background: var(--amber-bg);
  border: 1px solid #3a2e10;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) var(--space-6);
  color: var(--amber);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.error-box {
  text-align: center;
  padding: var(--space-10) var(--space-5);
  color: var(--red);
  font-size: var(--fs-base);
}
.error-box .error-icon { font-size: 2em; margin-bottom: var(--space-3); }
.error-box .error-hint { font-size: var(--fs-sm); color: var(--text-dim); margin-top: var(--space-3); font-family: var(--mono); }
.error-retry {
  margin-top: var(--space-4);
  padding: 8px 24px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  color: var(--text-bright);
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}
.error-retry:hover { border-color: var(--accent); color: var(--accent); }

/* ──────────────────────────────────────────────
   CHART
   ────────────────────────────────────────────── */
.chart-container { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border); }
.chart-tabs { display: flex; gap: 2px; margin-bottom: var(--space-3); }
.chart-tab {
  padding: 3px 10px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--mono);
}
.chart-tab:hover { border-color: var(--border-strong); color: var(--text); }
.chart-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.chart-svg { width: 100%; height: 200px; display: block; }
.chart-price-up { fill: var(--green); }
.chart-price-down { fill: var(--red); }
.chart-grid line { stroke: var(--border); stroke-width: 0.5; }
.chart-label { fill: var(--text-dim); font-size: var(--fs-xs); font-family: var(--mono); }
.chart-event-marker { fill: var(--accent); }
.chart-benchmark { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3,3; opacity: 0.5; }

/* ──────────────────────────────────────────────
   ACTION BUTTONS (in report header)
   ────────────────────────────────────────────── */
.action-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.action-btn:hover { border-color: var(--accent); color: var(--text); }
.action-btn.active { border-color: var(--green); color: var(--green); background: var(--green-bg); }

/* ──────────────────────────────────────────────
   OPPORTUNITY RADAR — layout contract
   Jedna kolumna, pełna szerokość w app-main, text-align left.
   Bez margin:auto / wąskich max-width (to dawało „środek vs lewo”).
   ────────────────────────────────────────────── */
.radar-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 var(--space-4) var(--space-6);
  box-sizing: border-box;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.radar-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
}
.radar-hero-copy {
  flex: 1 1 280px;
  min-width: 0;
}
.radar-eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
}
.radar-title {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.radar-lead {
  margin: 0;
  max-width: none;
  width: 100%;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.radar-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.radar-info {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
}
.radar-disclaimer,
.radar-coverage {
  width: 100%;
  max-width: none;
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.45;
}
.radar-coverage {
  margin-bottom: var(--space-4);
  font-family: var(--mono);
  color: var(--accent-light);
  line-height: 1.4;
}
.radar-confirmed-badge {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34,197,94,0.15);
  color: var(--green);
  font-weight: var(--fw-semibold);
}
.radar-disc-badge {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  font-weight: var(--fw-semibold);
}
.radar-filters-wrap {
  width: 100%;
  margin-bottom: var(--space-5);
}
.radar-filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
  width: 100%;
  justify-content: flex-start;
}
.radar-filter-active-hint {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.45;
  max-width: none;
  width: 100%;
}
.radar-filter-legend {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.radar-filter-legend > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
  list-style: none;
  user-select: none;
}
.radar-filter-legend > summary::-webkit-details-marker { display: none; }
.radar-filter-legend > summary::before {
  content: '▸ ';
  color: var(--accent-light);
  font-family: var(--mono);
}
.radar-filter-legend[open] > summary::before { content: '▾ '; }
.radar-filter-legend > summary:hover { color: var(--text-bright); }
.radar-filter-defs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 var(--space-2);
  width: 100%;
}
.radar-filter-defs > div {
  min-width: 0;
}
.radar-filter-defs dt {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  margin: 0 0 4px;
}
.radar-filter-defs dd {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.45;
}
.radar-filter-legend-note {
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.45;
}
button.filter-chip {
  font: inherit;
}
.radar-layer {
  width: 100%;
  margin-bottom: var(--space-2);
}
.radar-layer-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.radar-section {
  width: 100%;
  margin-bottom: var(--space-5);
}
.radar-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px 16px;
  margin-bottom: var(--space-3);
  width: 100%;
}
.radar-section-head h2 {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--text-bright);
}
.radar-section-hint {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
/* auto-fit: puste tracki się zapadają — karty wypełniają rząd */
.radar-card-grid,
.radar-missed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-3);
  width: 100%;
  align-items: stretch;
}
.radar-card {
  background: var(--bg-elevated, var(--bg-inset));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.radar-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.radar-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.radar-card-ticker {
  font-family: var(--mono);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--text-bright);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.radar-card-meta {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  margin-top: 2px;
}
.radar-card-name {
  font-size: var(--fs-xs);
  color: var(--text);
  margin-top: 2px;
  line-height: 1.3;
}
.radar-story {
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-inset);
  border-left: 3px solid var(--accent);
}
.radar-story-kicker {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.radar-story-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  line-height: 1.3;
}
.radar-story-detail {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.35;
}
.radar-story-timing {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-family: var(--mono);
  color: var(--accent-light);
}
.radar-score {
  text-align: right;
  line-height: 1.1;
  flex-shrink: 0;
}
.radar-score-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
}
.radar-score-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.radar-tone-hot .radar-score-num,
.radar-tone-hot { color: var(--green); }
.radar-tone-good .radar-score-num,
.radar-tone-good { color: var(--accent-light); }
.radar-tone-watch .radar-score-num,
.radar-tone-watch { color: var(--amber); }
.radar-tone-dim .radar-score-num,
.radar-tone-dim { color: var(--text-dim); }
.radar-card-price {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.35;
}
.radar-card-price > span {
  flex: 0 1 auto;
  min-width: 0;
}
.radar-vol { color: var(--text-dim); white-space: nowrap; }
.radar-earn {
  flex: 1 1 100%;
  font-size: 0.68rem;
  color: var(--amber);
  font-family: var(--mono);
  white-space: nowrap;
}
.radar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.radar-chip {
  font-size: 0.68rem;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-inset);
}
.radar-chip.radar-tone-hot { border-color: rgba(34,197,94,0.35); color: var(--green); }
.radar-chip.radar-tone-good { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-light); }
.radar-chip.radar-tone-watch { border-color: rgba(245,158,11,0.35); color: var(--amber); }
.radar-early-badge {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-light);
  font-weight: var(--fw-semibold);
}
.radar-why {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.radar-why summary {
  cursor: pointer;
  color: var(--accent-light);
  list-style: none;
}
.radar-why summary::-webkit-details-marker { display: none; }
.radar-why ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  line-height: 1.45;
}
.radar-analyze-btn {
  margin-top: auto;
  align-self: stretch;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  cursor: pointer;
  text-align: left;
}
.radar-analyze-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}
/* Early + Why: jedna kolumna (2-col zostawiał puste półekrany) */
.radar-split {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.radar-early-list,
.radar-events-list,
.radar-catalyst-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.radar-early-row,
.radar-event-row,
.radar-catalyst-row {
  display: grid;
  grid-template-columns: 64px 72px 48px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.radar-event-row {
  grid-template-columns: 64px 1fr 48px;
}
.radar-catalyst-row {
  grid-template-columns: 64px 88px 48px 1fr;
}
.radar-early-row:hover,
.radar-event-row:hover,
.radar-catalyst-row:hover { border-color: var(--accent); }
.radar-early-ticker,
.radar-event-ticker {
  font-family: var(--mono);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
}
.radar-early-move { font-family: var(--mono); font-size: var(--fs-sm); }
.radar-early-score,
.radar-event-score {
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--accent-light);
  text-align: right;
}
.radar-early-detail,
.radar-event-sum {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  min-width: 0;
}
.radar-loading,
.radar-empty {
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-4);
  margin: 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  background: var(--bg-inset);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  line-height: 1.45;
}
.radar-empty-error { color: var(--red); }
.radar-empty-reset {
  display: inline;
  margin-left: 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-light);
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: underline;
}
.radar-empty-reset:hover { color: var(--text-bright); }
.radar-loading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
.radar-loading p { margin: 0; }

.radar-missed-section { margin-top: var(--space-2); }
.radar-missed-card {
  background: var(--bg-elevated, var(--bg-inset));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}
.radar-missed-card:hover { border-color: var(--accent); }
.radar-missed-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.radar-missed-move {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  color: var(--green);
  white-space: nowrap;
}
.radar-missed-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.radar-missed-detected {
  margin: 0;
  padding-left: 1.1rem;
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.45;
}
.radar-missed-note {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.radar-timeline {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
  width: 100%;
  box-sizing: border-box;
}
.radar-tl-item {
  display: grid;
  grid-template-columns: minmax(3.25rem, auto) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;
  padding: 3px 0;
  font-size: 0.68rem;
  font-family: var(--mono);
  line-height: 1.35;
}
.radar-tl-t {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  color: var(--accent-light);
  white-space: nowrap;
}
.radar-tl-label {
  grid-column: 2;
  grid-row: 1;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}
.radar-tl-detail {
  grid-column: 2;
  grid-row: 2;
  color: var(--text-dim);
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.62rem;
}
.radar-tl-volume .radar-tl-t { color: var(--accent-light); }
.radar-tl-catalyst .radar-tl-t { color: var(--amber); }
.radar-tl-momentum .radar-tl-t { color: var(--green); }
.radar-tl-breakout .radar-tl-t { color: var(--green); }
.radar-tl-insider .radar-tl-t { color: var(--accent-light); }
.radar-tl-valuation .radar-tl-t { color: var(--accent-light); }
.radar-event-block { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.radar-event-block .radar-timeline { margin-left: 8px; margin-bottom: 6px; }
.radar-catalyst-when {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--amber);
}

/* ──────────────────────────────────────────────
   SCANNER GRID (legacy table styles for Smart Money)
   ────────────────────────────────────────────── */
.scanner-container { max-width: 100%; margin: 0; padding: 0 var(--space-4) var(--space-4); }
.scanner-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.scanner-filters { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.filter-chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.scanner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2); }
@media (max-width: 640px) {
  .scanner-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 420px) {
  .scanner-grid { grid-template-columns: 1fr; }
}
.scanner-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.scanner-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.scanner-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-2); }
.scanner-ticker-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.scanner-ticker { font-family: var(--mono); font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-bright); }
.scanner-name { font-size: var(--fs-sm); color: var(--text-dim); display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.scanner-signal { font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--radius-sm); font-weight: var(--fw-semibold); }
.scanner-signal.buy { color: var(--green); background: rgba(34,197,94,0.1); }
.scanner-signal.strong-buy { color: var(--green); background: rgba(34,197,94,0.15); }
.scanner-signal.hold { color: var(--amber); background: rgba(245,158,11,0.1); }
.scanner-signal.overvalued { color: var(--red); background: rgba(239,68,68,0.1); }
.scanner-signal.BUY { color: var(--green); background: rgba(34,197,94,0.1); }
.scanner-signal.SELL { color: var(--red); background: rgba(239,68,68,0.1); }
.scanner-signal.purchase { color: var(--green); background: rgba(34,197,94,0.1); }
.scanner-signal.sale { color: var(--red); background: rgba(239,68,68,0.1); }
.scanner-signal.cluster-buy { color: var(--accent); background: var(--accent-dim); }
.scanner-price { font-family: var(--mono); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-bright); margin: var(--space-2) 0; }
.scanner-meta { font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); }
.scanner-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-3); }
.scanner-metric { display: flex; flex-direction: column; gap: 2px; }
.scanner-metric-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--mono); }
.scanner-metric-value { font-size: var(--fs-sm); font-family: var(--mono); font-weight: var(--fw-semibold); color: var(--text); }
.scanner-metric-value.green { color: var(--green); }
.scanner-metric-value.red { color: var(--red); }
.scanner-metric-value.high { color: var(--red); }
.scanner-metric-value.medium { color: var(--amber); }
.scanner-metric-value.low { color: var(--text-dim); }

/* ──────────────────────────────────────────────
   REPORT LAYOUT (renderResult)
   ────────────────────────────────────────────── */
.report-ticker-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.report-name { font-size: var(--fs-base); color: var(--text-dim); font-weight: var(--fw-normal); }
.report-signal {
  font-size: 1em;
  font-weight: var(--fw-bold);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}
.report-signal.signal-STRONG\+BUY, .report-signal.signal-BUY {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.25);
}
.report-signal.signal-WEAK\+BUY {
  color: var(--cyan);
  background: var(--cyan-bg);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.2);
}
.report-signal.signal-HOLD {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}
.report-signal.signal-OVERVALUED {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.25);
}
.report-signal.signal-NO\+DATA {
  color: var(--text-dim);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
}
.report-meta-item { display: flex; flex-direction: column; gap: 2px; }

/* DCF Details grid */
.dcf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; }
.dcf-card { background: transparent; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; padding: 6px 10px; }
.dcf-card-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--mono); margin-bottom: 2px; }
.dcf-card-value { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-bright); font-family: var(--mono); }
.dcf-card-desc { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; line-height: 1.3; }

/* Metric card (used in financials section) */
.metric-card { background: transparent; padding: 6px 10px; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; }
.metric-card .metric-label { color: var(--text-dim); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--ls-wide); margin-bottom: 2px; }
.metric-card .metric-value { font-family: var(--mono); font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-bright); font-variant-numeric: tabular-nums; }

/* Analyst ratings */
.analyst-ratings { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; background: transparent; border: none; border-radius: 0; }
.analyst-row { background: transparent; padding: 5px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.analyst-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--mono); }
.analyst-value { font-size: var(--fs-base); font-weight: var(--fw-semibold); font-family: var(--mono); color: var(--text-bright); }
.analyst-value.green { color: var(--green); }
.analyst-value.amber { color: var(--amber); }
.analyst-value.red { color: var(--red); }

/* Earnings info */
.earnings-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; background: transparent; border: none; border-radius: 0; }
.earnings-row { background: transparent; padding: 5px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.earnings-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--mono); }
.earnings-value { font-size: var(--fs-base); font-weight: var(--fw-semibold); font-family: var(--mono); color: var(--text-bright); }
.earnings-value.green { color: var(--green); }
.earnings-value.red { color: var(--red); }

/* Political trades list */
.political-trades-list { display: flex; flex-direction: column; gap: var(--space-2); }
.pt-politician { font-weight: var(--fw-semibold); color: var(--text-bright); font-size: var(--fs-md); }

/* Valuation methods grid */
.valuation-methods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.valuation-method-card { background: transparent; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; padding: 6px 10px; }
.valuation-method-card.unreliable { opacity: 0.5; }
.vm-name { font-size: var(--fs-xs); color: var(--text-dim); margin-bottom: 4px; }
.vm-iv { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-bright); font-family: var(--mono); margin-bottom: 2px; }
.vm-gap { font-size: var(--fs-sm); font-family: var(--mono); font-weight: var(--fw-semibold); }
.vm-gap.green { color: var(--green); }
.vm-gap.red { color: var(--red); }
.vm-gap.amber { color: var(--amber); }
.vm-verdict { font-size: var(--fs-xs); margin-top: 2px; }
.vm-verdict.green { color: var(--green); }
.vm-verdict.red { color: var(--red); }
.vm-verdict.amber { color: var(--amber); }
.vm-unreliable { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 4px; font-style: italic; }

/* Scenarios grid */
.scenarios-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; }
.scenario-card { background: transparent; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; padding: 6px 10px; }
.scenario-card.green { border-top: 2px solid var(--green); }
.scenario-card.red { border-top: 2px solid var(--red); }
.scenario-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--mono); margin-bottom: 4px; }
.scenario-value { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-bright); font-family: var(--mono); margin-bottom: 2px; }
.scenario-meta { font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); }

/* Risk factors grid */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; }
.risk-card { background: transparent; border: none; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; padding: 6px 10px; }
.risk-label { font-size: var(--fs-xs); color: var(--text-dim); margin-bottom: 2px; }
.risk-value { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-bright); font-family: var(--mono); }
.dilution-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dilution-item { font-size: var(--fs-xs); font-family: var(--mono); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-dim); }
.dilution-item.red { color: var(--red); border-color: var(--red-border); }

/* Earnings history grid — canonical definition in Earnings section below */

/* News items — canonical definition in Earnings/News section below */
.news-list { display: flex; flex-direction: column; gap: var(--space-2); }
.news-item { font-size: var(--fs-sm); color: var(--text); line-height: var(--lh-normal); padding: var(--space-2) var(--space-3); background: var(--bg-inset); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* Results container — full width within main */
.results-container { max-width: 100%; margin: 0; padding: 0 var(--space-4) var(--space-4); }

/* Research intro (used in scanner/political/insider tabs) */
.research-intro { margin-bottom: var(--space-4); }
.scanner-info { font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); }

/* ──────────────────────────────────────────────
   COMPARE VIEW
   ────────────────────────────────────────────── */
.compare-container { max-width: 100%; margin: 0; padding: 0 var(--space-4) var(--space-4); }
.compare-intro { margin-bottom: var(--space-5); }
.compare-intro h2 { font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--text-bright); margin-bottom: 4px; }
.compare-intro p { font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: var(--space-5); }
.compare-box { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--space-5); }
.compare-box > div { position: relative; flex: 1; min-width: 140px; }
.compare-label { display: block; font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; font-family: var(--mono); }
.compare-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--transition-fast);
}
.compare-input:focus { border-color: var(--border-focus); }
.compare-vs { font-size: var(--fs-xs); color: var(--text-dim); font-weight: var(--fw-semibold); font-family: var(--mono); padding: 0 var(--space-2); }
.compare-suggestions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.compare-suggestions span:first-child { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-right: var(--space-2); }
.compare-suggestion-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
}
.compare-suggestion-chip:hover { border-color: var(--accent); color: var(--accent); }
.compare-grid { display: block; }
.compare-winner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  text-align: center;
}
.compare-winner-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.compare-winner-ticker {
  font-family: var(--mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: inherit;
}
.compare-winner-name {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-winner-score {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
}
.compare-table td.compare-win { color: var(--green); background: rgba(34,197,94,0.08); }
.compare-table .compare-metric-name { color: var(--text-dim); font-family: var(--mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.compare-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); flex-wrap: wrap; }

.table-cards { display: none; }

/* ──────────────────────────────────────────────
   POLITICAL / INSIDER TRADES
   ────────────────────────────────────────────── */
.politician-trade, .insider-trade {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.politician-trade.cluster-buy, .insider-trade.cluster-buy { border-color: var(--green); background: rgba(74,222,128,0.06); }
.pt-insider, .it-insider { font-weight: var(--fw-semibold); color: var(--text-bright); font-size: var(--fs-md); }
.pt-title, .it-title { color: var(--text-dim); font-size: var(--fs-sm); }
.pt-ticker, .it-ticker { color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); cursor: pointer; font-family: var(--mono); }
.pt-ticker:hover, .it-ticker:hover { text-decoration: underline; }
.pt-type, .it-type { font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 2px 7px; border-radius: var(--radius-sm); font-family: var(--mono); }
.pt-type.buy, .it-type.BUY { color: var(--green); background: var(--green-bg); }
.pt-type.sell, .it-type.SELL { color: var(--red); background: var(--red-bg); }
.pt-type.exchange, .it-type.EXCHANGE { color: var(--cyan); background: var(--cyan-bg); }
.pt-value, .it-value { color: var(--text-bright); font-weight: var(--fw-semibold); font-size: var(--fs-sm); font-family: var(--mono); }
.pt-price, .it-price { color: var(--text-dim); font-size: var(--fs-xs); font-family: var(--mono); }
.pt-date, .it-date { color: var(--text-dim); font-size: var(--fs-xs); font-family: var(--mono); }
.pt-badge, .it-badge { font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 2px 7px; border-radius: var(--radius-sm); background: var(--green); color: var(--text-inverse); font-family: var(--mono); }
.pt-party { font-size: var(--fs-xs); padding: 2px 7px; border-radius: var(--radius-sm); font-weight: var(--fw-semibold); font-family: var(--mono); }
.pt-party.D { background: var(--party-d-bg); color: var(--party-d); }
.pt-party.R { background: var(--party-r-bg); color: var(--party-r); }
.pt-party.I { background: var(--party-i-bg); color: var(--party-i); }
.pt-amount { color: var(--text-dim); font-size: var(--fs-sm); }
.pt-conflict { font-size: var(--fs-xs); font-weight: var(--fw-semibold); padding: 2px 7px; border-radius: var(--radius-sm); font-family: var(--mono); }
.pt-conflict.high { color: var(--red); background: var(--red-bg); }
.pt-conflict.medium { color: var(--amber); background: var(--amber-bg); }
.pt-conflict.low { color: var(--text-dim); background: var(--bg-inset); }
.pt-committees { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 4px; width: 100%; }
.pt-committee-badge { display: inline-block; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--bg-inset); margin-right: 4px; margin-top: 2px; }
.pt-committee-badge.match { background: var(--amber-bg); color: var(--amber); }
.pt-match-warning { font-size: var(--fs-xs); color: var(--amber); font-weight: var(--fw-semibold); width: 100%; margin-top: 4px; }

/* ──────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--footer-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: var(--toast-min-width);
  max-width: var(--toast-max-width);
  padding: var(--toast-padding);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: toast-in 0.3s ease-out;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) translateY(20px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info { border-left: 3px solid var(--accent); }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info .toast-icon { color: var(--accent); }
.toast-content { flex: 1; }
.toast-title { font-weight: var(--fw-semibold); color: var(--text-bright); margin-bottom: 2px; }
.toast-message { color: var(--text); font-size: var(--fs-sm); }
.toast-close {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.toast-close:hover { background: var(--bg-hover); color: var(--text-bright); }

/* ──────────────────────────────────────────────
   PORTFOLIO ADD MODAL
   ────────────────────────────────────────────── */
.pf-add-modal {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.pf-add-modal.open { opacity: 1; visibility: visible; }
.pf-add-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.pf-add-modal-content {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 400px; max-width: 90vw;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}
.pf-add-modal.open .pf-add-modal-content { transform: scale(1); }
.pf-add-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}
.pf-add-modal-header h3 {
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  color: var(--text-bright); margin: 0;
}
.pf-add-modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim);
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: all var(--transition-fast);
}
.pf-add-modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.pf-add-modal-body {
  padding: var(--space-4) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
}

/* ──────────────────────────────────────────────
   MODAL / DIALOG
   ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  opacity: 0; visibility: hidden; transition: opacity var(--transition-base), visibility var(--transition-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: scale(0.95); transition: transform var(--transition-base);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-bright); }
.modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; transition: all var(--transition-fast); }
.modal-close:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.modal-body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.modal-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--space-2); }

/* ──────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0 var(--btn-padding-x-md);
  height: var(--btn-height-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--text-inverse);
  box-shadow: 0 4px 16px rgba(201, 120, 69, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  border-color: transparent;
}
.btn-secondary { background: var(--bg-inset); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: var(--text-inverse); }
.btn-sm { height: var(--btn-height-sm); padding: 0 var(--btn-padding-x-sm); font-size: var(--fs-xs); }
.btn-lg { height: var(--btn-height-lg); padding: 0 var(--btn-padding-x-lg); font-size: var(--fs-base); }

/* ──────────────────────────────────────────────
   INPUTS & FORM CONTROLS
   ────────────────────────────────────────────── */
.input {
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--input-padding-x);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--text-dim); }
.input-error { border-color: var(--red); }
.input-error:focus { box-shadow: 0 0 0 2px var(--red-bg); }

.label { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-1); font-family: var(--mono); }
.help-text { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--space-1); font-family: var(--mono); }

/* ──────────────────────────────────────────────
   TABLES
   ────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--table-header-bg); font-weight: var(--fw-semibold); color: var(--text-dim); font-size: var(--fs-xs); }
.table td { color: var(--text); }
.table tbody tr:hover td { background: var(--bg-hover); }
.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table .green { color: var(--green); }
.table .red { color: var(--red); }
.table .amber { color: var(--amber); }

/* Mobile table → cards */
@media (max-width: 768px) {
  .table-wrapper { border: none; overflow: visible; }
  .table { display: none; }
  .table-cards { display: flex; flex-direction: column; gap: var(--space-2); }
  .table-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
  .table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
  }
  .table-card-title { font-weight: var(--fw-semibold); color: var(--text-bright); font-family: var(--mono); font-size: var(--fs-sm); }
  .table-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-1) 0;
    font-size: var(--fs-sm);
  }
  .table-card-label { color: var(--text-dim); font-family: var(--mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
  .table-card-value { color: var(--text-bright); font-family: var(--mono); font-weight: var(--fw-semibold); }
  .table-card-value.green { color: var(--green); }
  .table-card-value.red { color: var(--red); }
  .table-card-value.amber { color: var(--amber); }
}

/* ──────────────────────────────────────────────
   EMPTY STATES
   ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-4);
  color: var(--text-dim);
  text-align: center;
  background: var(--bg-inset);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-3);
}
.empty-state-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: var(--space-1);
}
.empty-state-message {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  max-width: 320px;
}
.empty-state-action {
  margin-top: var(--space-4);
}

/* ──────────────────────────────────────────────
   TABS (Content tabs, not nav)
   ────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.tab { padding: var(--space-2) var(--space-4); background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; transition: all var(--transition-fast); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ──────────────────────────────────────────────
   DROPDOWN / SELECT
   ────────────────────────────────────────────── */
.select-wrapper { position: relative; }
.select {
  appearance: none;
  width: 100%;
  height: var(--input-height);
  padding: 0 var(--space-8) 0 var(--input-padding-x);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.select:focus { border-color: var(--border-focus); }
.select-wrapper::after {
  content: ''; position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--text-dim); pointer-events: none;
}

/* ──────────────────────────────────────────────
   BADGES / TAGS
   ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan); border: 1px solid var(--cyan); }
.badge-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.badge-neutral { background: var(--bg-inset); color: var(--text-dim); border: 1px solid var(--border); }

/* ──────────────────────────────────────────────
   AVATAR / LOGO
   ────────────────────────────────────────────── */
.avatar { width: 36px; height: 36px; border-radius: 3px; object-fit: contain; background: var(--bg-panel); }
.avatar-sm { width: 24px; height: 24px; }
.avatar-lg { width: 48px; height: 48px; }

/* ──────────────────────────────────────────────
   SKELETON LOADERS
   ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-highlight) 50%, var(--skeleton-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading var(--skeleton-animation);
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 1em; margin-bottom: var(--space-2); }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 1.5em; width: 40%; margin-bottom: var(--space-3); }
.skeleton-card { height: 200px; border-radius: var(--radius-md); }
.skeleton-row { height: 48px; border-radius: var(--radius-sm); margin-bottom: var(--space-2); }

/* Skeleton variants for specific components */
.skeleton-report-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.skeleton-report-panel .skeleton-report-header { height: 100px; }
.skeleton-report-panel .skeleton-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px;
}
.skeleton-report-panel .skeleton-metric-card { background: var(--bg-panel); height: 80px; }
.skeleton-report-panel .skeleton-section { height: 120px; border-radius: var(--radius-sm); }

/* ──────────────────────────────────────────────
   DIVIDER
   ────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); border: none; margin: var(--space-4) 0; }
.divider-strong { background: var(--border-strong); }

/* ──────────────────────────────────────────────
   FOCUS VISIBLE STATES
   ────────────────────────────────────────────── */

/* Source distinction — our model vs external */
.source-note {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: var(--lh-normal);
}
.source-note strong { color: var(--text-bright); }
.source-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  margin-right: 6px;
  vertical-align: middle;
  color: var(--text-dim);
  background: var(--bg-inset);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, .sidebar-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ──────────────────────────────────────────────
   SCROLLBAR STYLING
   ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ──────────────────────────────────────────────
   UTILITIES
   ────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.p-4 { padding: var(--space-4); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ──────────────────────────────────────────────
   SPINNER + LOADING STEPS
   ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  border: 3px solid var(--bg-inset);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: var(--space-6) var(--space-4);
  box-sizing: border-box;
}
/* report-open — body ma padding-top; loader tylko lekki odstęp od góry */
body.report-open .loading-screen {
  padding-top: var(--space-6);
  align-items: flex-start;
}
.loading-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 440px;
  width: 100%;
  overflow: visible;
  animation: fadeInUp 0.4s ease both;
}
.loading-ticker-badge {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  line-height: 1.35;
  color: var(--accent-light);
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  flex-shrink: 0;
  overflow: visible;
  animation: tickerPulse 2s ease-in-out infinite;
}
@keyframes tickerPulse {
  0%, 100% { border-color: var(--accent-dim); }
  50% { border-color: var(--accent); }
}
.loading-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
}
.loading-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: var(--space-4);
}
.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
}
.loading-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.35s ease;
  opacity: 0.4;
}
.loading-step.active {
  opacity: 1;
  color: var(--text-bright);
  background: rgba(200, 164, 94, 0.05);
}
.loading-step.done {
  opacity: 0.6;
  color: var(--text-dim);
}
.loading-step-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: all 0.35s ease;
  position: relative;
}
.loading-step.active .loading-step-icon {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.loading-step.done .loading-step-icon {
  border-color: var(--green);
  background: var(--green);
  animation: none;
}
.loading-step.done .loading-step-icon::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.loading-step-text {
  flex: 1;
}
.loading-step-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s;
}
.loading-step.active .loading-step-status {
  opacity: 1;
  color: var(--accent);
}
.loading-step.done .loading-step-status {
  opacity: 0.5;
  color: var(--green);
}
.loading-progress-bar {
  width: 100%;
  height: 2px;
  background: var(--bg-inset);
  border-radius: 1px;
  overflow: hidden;
  margin-top: var(--space-4);
}
.loading-progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 1px;
  transition: width 0.5s ease;
}

/* ──────────────────────────────────────────────
   SENTIMENT DOTS
   ────────────────────────────────────────────── */
.sentiment-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: middle;
}
.sentiment-dot.positive { background: var(--green); box-shadow: 0 0 4px var(--green-bg); }
.sentiment-dot.negative { background: var(--red); box-shadow: 0 0 4px rgba(239,68,68,0.2); }
.sentiment-dot.neutral { background: var(--text-dim); }

/* ──────────────────────────────────────────────
   SECTION ICONS
   ────────────────────────────────────────────── */
.section-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.95em;
  filter: grayscale(0.2);
  opacity: 0.85;
}

/* report-stats removed — verdict card replaces it */

/* ──────────────────────────────────────────────
   NEWS ITEM IMPROVEMENTS
   ────────────────────────────────────────────── */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}
.news-item .sentiment-dot {
  margin-top: 5px;
  margin-right: 10px;
}

/* report-section removed — collapsible replaces it */
.section-label .tooltip {
  margin-left: 4px;
}

/* ──────────────────────────────────────────────
   INFO ROW / INFO ITEM — canonical definition in megaplan section below
   ────────────────────────────────────────────── */

/* ──────────────────────────────────────────────
   VAL METHODS IMPROVEMENTS
   ────────────────────────────────────────────── */
.val-methods {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.val-method-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-3);
  align-items: center;
  background: var(--bg-panel);
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
}
.val-method-row.alt {
  background: var(--bg-card);
}
.val-method-name {
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.val-method-iv {
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
}
.val-method-gap {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.val-verdict {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.val-verdict.undervalued { color: var(--green); background: var(--green-bg); }
.val-verdict.overvalued { color: var(--red); background: rgba(239,68,68,0.1); }
.verdict-icon {
  font-size: 1em;
  line-height: 1;
}

/* ──────────────────────────────────────────────
   SMART MONEY VERDICT BAR
   ────────────────────────────────────────────── */
.smart-money-verdict {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.smart-verdict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.smart-verdict-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.smart-verdict-label.bullish {
  color: var(--green);
  background: var(--green-bg);
}
.smart-verdict-label.bearish {
  color: var(--red);
  background: rgba(239,68,68,0.1);
}
.smart-verdict-label.neutral {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
}
.smart-verdict-ratio {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
}
.smart-verdict-bar {
  height: 8px;
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.smart-verdict-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: var(--radius-sm);
}
.smart-verdict-fill.bullish {
  background: var(--green);
}
.smart-verdict-fill.bearish {
  background: var(--red);
}
.smart-verdict-fill.neutral {
  background: var(--amber);
}

.val-score-bar {
  display: flex;
  gap: 2px;
  margin-top: var(--space-3);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.val-score-cell {
  flex: 1;
  background: var(--bg-inset);
  border-radius: 1px;
}
.val-score-cell.undervalued { background: var(--green); }
.val-score-cell.overvalued { background: var(--red); }

/* signal-summary removed — reason-list replaces it */

/* ──────────────────────────────────────────────
   EARNINGS TABLE
   ────────────────────────────────────────────── */
.earnings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  margin-top: var(--space-2);
}
.earnings-table th,
.earnings-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-normal);
}
.earnings-table th {
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
}
.earnings-table td { color: var(--text); }
.earnings-table td.pos { color: var(--green); }
.earnings-table td.neg { color: var(--red); }
.earnings-table tr:last-child td { border-bottom: none; }
.earnings-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ──────────────────────────────────────────────
   SENTIMENT SUMMARY BAR
   ────────────────────────────────────────────── */
.sentiment-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

/* ──────────────────────────────────────────────
   TOP BAR LINKS
   ────────────────────────────────────────────── */
.top-bar-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
}
.top-bar-link:hover {
  color: var(--text-bright);
  background: var(--bg-inset);
}
.top-bar-link.login-link {
  color: var(--text-bright);
  border-color: var(--border);
  background: var(--bg-inset);
  font-weight: var(--fw-medium);
}
.top-bar-link.login-link:hover {
  color: var(--text-bright);
  border-color: var(--accent);
  background: var(--bg-panel);
}

/* ──────────────────────────────────────────────
   TOGGLE GROUP (insider tabs etc)
   ────────────────────────────────────────────── */
.toggle-group {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.toggle-btn {
  padding: 8px 16px;
  font-size: var(--fs-xs);
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn:hover { color: var(--text); background: var(--bg-hover); }
.toggle-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ──────────────────────────────────────────────
   PORTFOLIO CARDS
   ────────────────────────────────────────────── */
.pf-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.pf-summary-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}
.pf-summary-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono);
  margin-bottom: var(--space-1);
}
.pf-summary-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.pf-summary-value.gold { color: var(--accent-light); }
.pf-summary-sub {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
}

.pf-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.pf-toolbar { display: flex; gap: var(--space-2); flex-shrink: 0; }

.pf-empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  background: var(--bg-panel);
  border-radius: var(--radius-md);
}
.pf-empty-title {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
}
.pf-empty-text {
  margin: 0 auto var(--space-5);
  max-width: 28rem;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.pf-alloc {
  background: var(--bg-panel);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.pf-alloc-head {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, var(--text-dim));
  margin-bottom: var(--space-3);
}
.pf-alloc-row {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: 8px;
}
.pf-alloc-row--sector {
  grid-template-columns: minmax(72px, 130px) 1fr 48px;
}
.pf-alloc-head--sub {
  margin-top: var(--space-4);
}
.pf-alloc-fill--sector {
  background: color-mix(in srgb, var(--accent-light) 70%, var(--border));
}
.pf-summary-movers {
  margin: -4px 0 var(--space-4);
  font-size: var(--fs-xs);
  font-family: var(--mono);
  color: var(--text-dim);
}
.pf-summary-movers .green { color: var(--green); }
.pf-summary-movers .red { color: var(--red); }
.portfolio-metric-sub {
  font-size: 0.7rem;
  font-weight: var(--fw-medium);
  opacity: 0.85;
}
.pf-alloc-ticker {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.pf-alloc-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-inset);
  overflow: hidden;
}
.pf-alloc-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-grad, var(--accent));
}
.pf-alloc-fill--muted { background: var(--border-strong); opacity: 0.8; }
.pf-alloc-pct {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-align: right;
}

.portfolio-grid { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; }
.portfolio-list { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; }

.portfolio-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.portfolio-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.portfolio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.portfolio-card-title-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.portfolio-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.portfolio-ticker { font-family: var(--mono); font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--text-bright); }
.portfolio-name { font-size: var(--fs-xs); color: var(--text-dim); display: block; }
.portfolio-sector { font-size: 0.7rem; color: var(--text-muted, var(--text-dim)); display: block; margin-top: 2px; }
.portfolio-card-pnl { font-family: var(--mono); font-size: var(--fs-lg); font-weight: var(--fw-bold); text-align: right; }
.portfolio-pnl-pct { font-size: var(--fs-sm); color: var(--text-dim); }
.portfolio-card-pnl.green, .portfolio-card-pnl .green { color: var(--green); }
.portfolio-card-pnl.red, .portfolio-card-pnl .red { color: var(--red); }

.portfolio-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--space-3); margin-top: var(--space-2); }
.portfolio-metric { display: flex; flex-direction: column; gap: 2px; }
.portfolio-metric-label { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: var(--ls-wide); font-family: var(--mono); }
.portfolio-metric-value { font-size: var(--fs-sm); font-family: var(--mono); font-weight: var(--fw-semibold); color: var(--text); }
.portfolio-metric-value.green { color: var(--green); }
.portfolio-metric-value.red { color: var(--red); }
.portfolio-metric-value.gold { color: var(--accent-light); }
.pf-editable {
  cursor: text;
  border-radius: 3px;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  padding: 0 2px;
  outline: none;
}
.pf-editable:hover,
.pf-editable:focus-visible {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.pf-lot-edit {
  cursor: text;
  border-radius: 3px;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  padding: 0 2px;
  outline: none;
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.pf-lot-edit:hover,
.pf-lot-edit:focus-visible {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.pf-inline-input {
  width: 4.75rem;
  max-width: 100%;
  padding: 2px 6px !important;
  font-size: var(--fs-sm) !important;
  font-family: var(--mono) !important;
  font-weight: var(--fw-semibold);
  height: auto !important;
  min-height: 0;
  display: inline-block;
  vertical-align: baseline;
  margin: 0 2px;
}

.portfolio-lots { margin-top: var(--space-3); display: flex; flex-direction: column; gap: 4px; }
.portfolio-lot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-family: var(--mono);
  padding: 4px 8px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  gap: var(--space-2);
}
.portfolio-lot-date { color: var(--text-dim); opacity: 0.8; }
.portfolio-lot-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.portfolio-lot-edit {
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-family: var(--sans);
  padding: 2px 6px;
}
.portfolio-lot-edit:hover { text-decoration: underline; }
.portfolio-lot-info .pf-lot-edit {
  display: inline;
}
.portfolio-lot-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: var(--fs-md);
  padding: 0 4px;
  line-height: 1;
}
.portfolio-lot-remove:hover { opacity: 0.7; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

@media (max-width: 700px) {
  .portfolio-metrics { grid-template-columns: repeat(3, 1fr); }
  .pf-summary { grid-template-columns: repeat(2, 1fr); }
}

/* Portfolio inline add form */
.pf-add-form { display: none; width: 100%; margin-bottom: var(--space-4); }
.pf-add-form-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.pf-add-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}
.pf-add-form-header h3 { margin: 0; font-size: var(--fs-base); color: var(--text-bright); }
.pf-add-form-close {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); width: 28px; height: 28px;
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pf-add-form-close:hover { color: var(--text); border-color: var(--border-strong); }
.pf-add-form-body { display: flex; flex-direction: column; gap: var(--space-3); }
.pf-add-lot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: var(--space-3);
  align-items: end;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}
.pf-add-lot-field { display: flex; flex-direction: column; gap: 4px; }
.pf-add-lot-field label { font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); text-transform: uppercase; }
.pf-add-lot-field .input { width: 100%; }
.pf-add-lot-remove {
  background: none; border: none; color: var(--red); cursor: pointer;
  font-size: var(--fs-lg); padding: 0 4px; line-height: 1;
}
.pf-add-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.pf-add-form-save { display: flex; gap: var(--space-2); }

@media (max-width: 640px) {
  .portfolio-metrics { grid-template-columns: repeat(3, 1fr); }
  .pf-add-lot { grid-template-columns: 1fr 1fr; }
  .pf-add-lot-field:nth-child(3), .pf-add-lot-remove { grid-column: span 1; }
  .pf-add-form-actions { flex-direction: column; align-items: stretch; }
  .pf-add-form-save { justify-content: flex-end; }
}
@media (max-width: 420px) {
  .portfolio-metrics { grid-template-columns: repeat(2, 1fr); }
  .pf-add-lot { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────
   BACKTEST CONTAINER
   ────────────────────────────────────────────── */
.backtest-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.backtest-narrative {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--text);
}
.backtest-narrative p { margin: 0 0 var(--space-2); }
.backtest-narrative p:last-of-type { margin-bottom: 0; }
.backtest-narrative-title {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: var(--space-3);
}
.backtest-conclusion {
  padding-top: var(--space-3);
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  color: var(--text-bright);
}
.backtest-container .table-wrapper {
  border-radius: var(--radius-md);
}
.backtest-container .table th {
  white-space: nowrap;
}
.backtest-container .table td {
  white-space: nowrap;
}

/* ──────────────────────────────────────────────
   SCANNER HEADER IMPROVEMENTS
   ────────────────────────────────────────────── */
.scanner-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

/* ──────────────────────────────────────────────
   RESEARCH INTRO (tab headers)
   ────────────────────────────────────────────── */
.research-intro h2 {
  letter-spacing: -0.01em;
}
.research-intro p {
  line-height: var(--lh-relaxed);
}

/* report-sections removed — report-layout/report-main replaces it */

/* ──────────────────────────────────────────────
   TRADE BADGES (buy/sell)
   ────────────────────────────────────────────── */
.trade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 0.03em;
}
.trade-badge.buy {
  color: var(--green);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
}
.trade-badge.sell {
  color: var(--red);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
}

/* ──────────────────────────────────────────────
   CONFLICT BADGES
   ────────────────────────────────────────────── */
.conflict-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
}
.conflict-badge.high {
  color: var(--red);
  background: rgba(239,68,68,0.1);
}
.conflict-badge.medium {
  color: var(--amber);
  background: rgba(245,158,11,0.1);
}
.conflict-badge.low {
  color: var(--text-dim);
  background: var(--bg-inset);
}

/* ──────────────────────────────────────────────
   INSIDER TAB — table on PC, cards on mobile
   ────────────────────────────────────────────── */
.insider-table-desktop { display: block; }
.insider-cards-mobile { display: none; }
.insider-ticker {
  font-family: var(--mono);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.table tbody tr:hover .insider-ticker {
  color: var(--accent);
  background: var(--accent-dim);
}
.table tbody tr:hover td {
  background: var(--bg-hover);
}

/* Show nav-tabs on mobile */
@media (max-width: 899px) {
  .nav-tabs { display: flex !important; }
}

@media (max-width: 768px) {
  .insider-table-desktop { display: none; }
  .insider-cards-mobile { display: grid; }
}

/* ──────────────────────────────────────────────
   NEWS TOGGLE
   ────────────────────────────────────────────── */
.news-item-hidden { display: none; }
.news-toggle-btn {
  display: block;
  width: 100%;
  padding: 8px 16px;
  margin-top: var(--space-2);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-family: var(--mono);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.news-toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ──────────────────────────────────────────────
   REPORT LAYOUT & VERDICT CARD — canonical definitions in megaplan section below
   ────────────────────────────────────────────── */

/* ──────────────────────────────────────────────
   SCENARIO BAR (bear / base / bull)
   ────────────────────────────────────────────── */
.scenario-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.scenario-bar-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.scenario-bar-track {
  position: relative;
  height: 28px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.scenario-bar-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(248,113,113,0.12), rgba(200,164,94,0.15), rgba(74,222,128,0.12));
  border-radius: calc(var(--radius-sm) - 1px);
}
.scenario-bar-marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text-bright);
  border-radius: 1px;
}
.scenario-bar-marker.fair { background: var(--accent); width: 3px; }
.scenario-bar-values {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.scenario-bar-values .bear { color: var(--red); }
.scenario-bar-values .base { color: var(--accent); font-weight: var(--fw-semibold); }
.scenario-bar-values .bull { color: var(--green); }

/* ──────────────────────────────────────────────
   REASON LIST (key arguments)
   ────────────────────────────────────────────── */
.reason-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reason-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 7px var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  transition: background var(--transition-fast);
}
.reason-item:hover { background: var(--bg-hover); }
.reason-item .reason-mark {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-family: var(--mono);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}
.reason-item.pos .reason-mark { color: var(--green); }
.reason-item.neg .reason-mark { color: var(--red); }
.reason-item.neutral .reason-mark { color: var(--text-dim); }

/* ──────────────────────────────────────────────
   COLLAPSIBLE SECTION
   ────────────────────────────────────────────── */
/* Collapsible sections — clear visual hierarchy */
.collapsible {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: visible;
  margin-bottom: var(--space-2);
}
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 12px var(--space-3);
  cursor: pointer;
  user-select: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.2s ease;
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}
.collapsible-header:hover { color: var(--accent); background: var(--bg-hover); }
.collapsible-header:hover .collapsible-title { color: var(--accent); }
.collapsible.open .collapsible-header {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-dim) 0%, var(--bg-inset) 60%);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.collapsible-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
}
.collapsible-summary {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-family: var(--sans);
  text-transform: none;
  letter-spacing: var(--ls-normal);
  font-weight: var(--fw-normal);
}
.collapsible-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  transition: transform 0.3s ease, color 0.2s ease;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.collapsible.open .collapsible-chevron { transform: rotate(180deg); color: var(--accent); }
.collapsible-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.collapsible.open .collapsible-body { grid-template-rows: 1fr; }
.collapsible-body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s ease, padding 0.3s ease;
}
.collapsible.open .collapsible-body-inner {
  padding: var(--space-4) var(--space-3) var(--space-4);
  opacity: 1;
  transition: opacity 0.25s ease 0.05s, padding 0.3s ease;
}

/* Terminal-style report header — compact */
.report-header-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.report-header-v2 .rh-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.report-header-v2 .ticker-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.report-header-v2 .rh-ticker {
  font-family: var(--mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.report-header-v2 .rh-name {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.report-header-v2 .rh-meta {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  margin-top: 2px;
}
.report-header-v2 .rh-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.report-header-v2 .rh-price {
  text-align: right;
}
.report-header-v2 .rh-price-value {
  font-family: var(--mono);
  font-size: 2rem;
  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-family: var(--mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.report-header-v2 .rh-actions {
  display: flex;
  gap: 4px;
  margin-left: var(--space-2);
}
.report-header-v2 .rh-actions .action-btn { padding: 3px 8px; font-size: var(--fs-xs); }
@media (max-width: 640px) {
  .report-header-v2 { padding: var(--space-2) var(--space-3); }
  .report-header-v2 .rh-name { max-width: 200px; }
  .report-header-v2 .rh-right { width: 100%; justify-content: space-between; }
}

/* Smart Money sub-labels (Insiderzy / Politycy inside one section) */
.smart-sub-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: var(--space-2);
}

/* Terminal-style metrics: dense grid, flat, no cards */
.metrics-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.metric-v2 {
  background: var(--bg-card);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.metric-v2::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.metric-v2.good::before { background: var(--green); }
.metric-v2.ok::before { background: var(--amber); }
.metric-v2.bad::before { background: var(--red); }
.metric-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.metric-v2-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.metric-v2-badge {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  padding: 0 4px;
}
.metric-v2-badge.good { color: var(--green); background: transparent; }
.metric-v2-badge.ok { color: var(--amber); background: transparent; }
.metric-v2-badge.bad { color: var(--red); background: transparent; }
.metric-v2-badge.na { color: var(--text-dim); background: transparent; }
.metric-v2-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 4px 0;
}
.metric-v2-bar {
  height: 2px;
  background: var(--bg-inset);
  border-radius: 1px;
  overflow: hidden;
}
.metric-v2-bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width 0.5s ease;
}
.metric-v2-bar-fill.good { background: var(--green); }
.metric-v2-bar-fill.ok { background: var(--amber); }
.metric-v2-bar-fill.bad { background: var(--red); }
.metric-v2-desc {
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.3;
}
.metric-v2-desc .thr { color: var(--text); font-family: var(--mono); }

/* Terminal-style side panels: flat, no cards */
.side-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: var(--space-2) var(--space-3);
}
.side-panel-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
}
.side-kv:last-child { border-bottom: none; padding-bottom: 0; }
.side-kv-label { color: var(--text-dim); font-size: var(--fs-base); }
.side-kv-value {
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-md);
}
.side-kv-value.pos { color: var(--green); }
.side-kv-value.neg { color: var(--red); }

/* Earnings countdown panel */
.side-earn-days {
  font-family: var(--mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  line-height: 1;
}
.side-earn-days small {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-weight: var(--fw-normal);
}
.side-earn-meta {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Insider mini panel */
.side-ins-counts {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.side-ins-count {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.side-ins-count.buy { color: var(--green); }
.side-ins-count.sell { color: var(--red); }
.side-ins-bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg-inset);
  margin-bottom: var(--space-2);
}
.side-ins-bar .b { background: var(--green); }
.side-ins-bar .s { background: var(--red); }
.side-ins-last {
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: var(--lh-normal);
}


/* ── Report redesign ── */
.verdict-score-v2 { display:flex; flex-direction:column; align-items:center; gap:8px; }
.verdict-score-value { font-size:4em; font-weight:var(--fw-bold); line-height:1; }
.verdict-score-divider { width:40px; height:1px; background:var(--border); }
.verdict-score-label { font-family:var(--mono); font-size:var(--fs-lg); font-weight:var(--fw-bold); letter-spacing:0.04em; }

.verdict-score-bars { display:flex; flex-direction:column; gap:10px; }
.score-bar-row { display:flex; align-items:center; gap:10px; font-size:var(--fs-xs); color:var(--text-dim); font-family:var(--mono); }
.score-bar-label { width:90px; flex-shrink:0; }
.score-bar-track { flex:1; height:6px; background:var(--bg-inset); border-radius:3px; overflow:hidden; }
.score-bar-fill { height:100%; border-radius:3px; transition:width 0.5s ease; }
.score-bar-value { width:40px; text-align:right; }

.verdict-narrative { display:flex; flex-direction:column; gap:var(--space-3); border-top:1px solid var(--border); border-bottom:1px solid var(--border); padding:var(--space-3) 0; }
.verdict-narrative-title { font-size:var(--fs-base); font-weight:var(--fw-semibold); color:var(--text-bright); line-height:var(--lh-normal); }
.verdict-narrative-summary { font-size:var(--fs-sm); color:var(--text-dim); line-height:var(--lh-relaxed); }

.verdict-main-factor { display:flex; flex-wrap:wrap; align-items:center; gap:6px; background:var(--bg-inset); border-radius:var(--radius-sm); padding:var(--space-2) var(--space-3); font-size:var(--fs-sm); }
.vmf-label { color:var(--text-dim); font-family:var(--mono); text-transform:uppercase; letter-spacing:0.04em; }
.vmf-arrow { font-weight:var(--fw-bold); }
.vmf-title { font-weight:var(--fw-semibold); color:var(--text-bright); }
.vmf-value { font-family:var(--mono); font-weight:var(--fw-bold); margin-left:auto; }
.vmf-desc { width:100%; color:var(--text-dim); font-size:var(--fs-xs); }

.verdict-positives { display:flex; flex-direction:column; gap:6px; }
.vp-label { font-size:var(--fs-xs); color:var(--text-dim); font-family:var(--mono); text-transform:uppercase; letter-spacing:0.04em; }
.vp-item { display:flex; align-items:center; gap:8px; font-size:var(--fs-sm); }
.vp-check { color:var(--green); font-weight:var(--fw-bold); }
.vp-title { color:var(--text-dim); }
.vp-value { font-family:var(--mono); color:var(--green); margin-left:auto; }

.takeaway-card { background: transparent; border: none; border-left: 2px solid var(--accent); border-radius: 0; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.takeaway-label { font-size: var(--fs-xs); color: var(--text-dim); }
.takeaway-summary { font-size: var(--fs-sm); color: var(--text-bright); line-height: 1.5; font-weight: var(--fw-semibold); }
.takeaway-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.takeaway-item { display: flex; flex-direction: column; gap: 2px; }
.takeaway-item-label { font-size: var(--fs-xs); color: var(--text-dim); }
.takeaway-item-value { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.takeaway-item.pos .takeaway-item-value { color: var(--green); }
.takeaway-item.neg .takeaway-item-value { color: var(--red); }

.chart-overlay { display:flex; gap:var(--space-5); background:transparent; border:none; border-radius:0; padding:0; margin-bottom:0; }
.chart-overlay-item { display:flex; flex-direction:column; gap:2px; }
.chart-overlay-label { font-size:var(--fs-xs); color:var(--text-dim); font-family:var(--mono); text-transform:uppercase; letter-spacing:0.04em; }
.chart-overlay-value { font-size:var(--fs-base); font-weight:var(--fw-semibold); color:var(--text-bright); font-family:var(--mono); }

.reason-list-v2 { display: flex; flex-direction: column; gap: 0; background: transparent; border: none; border-radius: 0; overflow: visible; }
.reason-item-v2 { display: flex; gap: var(--space-2); padding: 6px 0; background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0; }
.reason-item-v2:last-child { border-bottom: none; }
.reason-num { display: none; } /* Hidden — replaced by icons */
.reason-icon {
  flex-shrink: 0;
  font-size: 1.2em;
  width: 24px;
  text-align: center;
  padding-top: 1px;
  font-weight: 700;
}
.reason-item-v2.pos .reason-icon { color: var(--green); }
.reason-item-v2.neg .reason-icon { color: var(--red); }
.reason-item-v2.neutral .reason-icon { color: var(--text-dim); }
.reason-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.reason-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.reason-title { font-weight: var(--fw-semibold); color: var(--text-bright); font-size: var(--fs-sm); }
.reason-value { font-family: var(--mono); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.reason-item-v2.pos .reason-value { color: var(--green); }
.reason-item-v2.neg .reason-value { color: var(--red); }
.reason-item-v2.neutral .reason-value { color: var(--text-dim); }
.reason-desc { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.4; }
.reason-arrow { font-size: var(--fs-xs); font-family: var(--mono); color: var(--text-dim); }
.reason-item-v2.pos .reason-arrow { color: var(--green); }
.reason-item-v2.neg .reason-arrow { color: var(--red); }

.conf-breakdown { display:flex; flex-direction:column; gap:10px; }
.conf-breakdown-row { display:flex; align-items:center; gap:10px; font-size:var(--fs-sm); color:var(--text); font-family:var(--mono); }
.conf-breakdown-label { width:90px; flex-shrink:0; }
.conf-breakdown-bar { flex:1; height:6px; background:var(--bg-inset); border-radius:3px; overflow:hidden; }
.conf-breakdown-fill { height:100%; border-radius:3px; transition:width 0.5s ease; }
.conf-breakdown-value { width:36px; text-align:right; }

/* report-section removed — collapsible replaces it */

@media (max-width: 900px) {
    .verdict-main-factor { flex-direction:column; align-items:flex-start; }
    .vmf-value { margin-left:0; }
    .takeaway-row { grid-template-columns:1fr; }
    .chart-overlay { grid-template-columns:1fr; }
    .score-bar-row { flex-wrap:wrap; }
    .score-bar-label { width:100%; }
}



/* Megaplan report redesign overrides */

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

.hero-body {
    display: grid;
    grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
    gap: var(--space-6);
    padding: var(--space-4) var(--space-4);
    align-items: start;
    border-top: 1px solid var(--border);
}

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

.hero-signal-badge {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  padding: 0;
  border: none;
  border-radius: 0;
  color: var(--signal-color);
  text-align: left;
  background: transparent;
  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-body { border-left: 3px solid var(--signal-color, var(--border)); padding-left: var(--space-4); }

.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 {
  flex: 1;
  height: 4px;
  background: var(--bg-inset);
  border-radius: 2px;
  overflow: hidden;
}
.hero-conf-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.hero-conf-value {
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  min-width: 54px;
  text-align: right;
  font-size: var(--fs-xs);
}
.hero-conf-value.high { color: var(--green); }
.hero-conf-value.medium { color: var(--amber); }
.hero-conf-value.low { color: var(--red); }

.hero-quality { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-1); }
.hero-bar-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-dim); font-family: var(--mono); }
.hero-bar-label { width: 50px; }
.hero-bar-track { flex: 1; height: 4px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; }
.hero-bar-fill { height: 100%; border-radius: 2px; }
.hero-bar-value { width: 32px; text-align: right; }

.hero-price { display: flex; flex-direction: column; gap: var(--space-3); }
.hero-price-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.hps-item { display: flex; flex-direction: column; gap: 2px; }
.hps-label {
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.hps-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ── Decision layer v2: compact identity type + SIGNAL card + WHY box ── */
.report-header-v2 .rh-ticker { font-size: var(--fs-2xl); letter-spacing: -0.01em; line-height: 1; }
.report-header-v2 .rh-name { font-size: var(--fs-sm); max-width: none; white-space: normal; }
.report-header-v2 .rh-price-value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.report-hero .report-header-v2 { padding: var(--space-2) var(--space-4); }

.decision-card {
    border: 1px solid var(--border);
    border-left: 2px solid var(--signal-color, var(--accent));
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    margin: 0 var(--space-4) var(--space-3);
}

.hero-body-v2 {
    display: grid;
    grid-template-columns: minmax(210px, 0.4fr) minmax(0, 0.6fr);
    gap: var(--space-5);
    padding: var(--space-4);
    align-items: start;
}

.signal-card {
    padding-right: var(--space-4);
    border-right: 1px solid var(--border);
}
.signal-card-label {
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
}
.signal-card-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
    color: var(--signal-color, var(--accent));
    margin-bottom: var(--space-2);
}
.signal-card-score {
    margin-left: auto;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text-dim);
    font-weight: var(--fw-medium);
}
.signal-card-confidence-label-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.signal-card-confidence-num { font-family: var(--mono); font-weight: var(--fw-semibold); }
.signal-card-confidence-num.high { color: var(--green); }
.signal-card-confidence-num.medium { color: var(--amber); }
.signal-card-confidence-num.low { color: var(--red); }
.signal-card-confidence-bar { height: 3px; background: var(--bg-inset); border-radius: 2px; overflow: hidden; margin-bottom: var(--space-3); }
.signal-card-confidence-fill { height: 100%; border-radius: 2px; }
.signal-card-confidence-fill.high { background: var(--green); }
.signal-card-confidence-fill.medium { background: var(--amber); }
.signal-card-confidence-fill.low { background: var(--red); }

.signal-card-divider { height: 1px; background: var(--border); margin-bottom: var(--space-3); }
.signal-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    font-size: var(--fs-sm);
}
.signal-card-row.big { padding: 7px 0; }
.signal-card-key { color: var(--text-dim); }
.signal-card-value { font-family: var(--mono); font-weight: var(--fw-semibold); color: var(--text-bright); }
.signal-card-value.gold { color: var(--accent); }
.signal-card-value.big { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.signal-card-value.high { color: var(--green); }
.signal-card-value.medium { color: var(--amber); }
.signal-card-value.low { color: var(--red); }

/* Price vs Fair Value — full-width centerpiece visualization */
.pvfv-hero {
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}
.pvfv-hero-cols { display: flex; justify-content: space-between; margin-bottom: var(--space-3); }
.pvfv-hero-col { display: flex; flex-direction: column; gap: 2px; }
.pvfv-hero-col.fv { align-items: flex-end; text-align: right; }
.pvfv-hero-tag { font-size: var(--fs-xs); letter-spacing: 0.1em; color: var(--text-dim); }
.pvfv-hero-tag.gold { color: var(--accent); }
.pvfv-hero-num { font-family: var(--mono); font-size: var(--fs-xl); font-weight: var(--fw-bold); color: var(--text-bright); line-height: 1.1; }
.pvfv-hero-num.gold { color: var(--accent); }
.pvfv-hero-track { position: relative; height: 6px; background: var(--bg-inset); border-radius: 3px; margin: var(--space-2) 4px 0; }
.pvfv-hero-fill { position: absolute; top: 0; height: 6px; border-radius: 3px; opacity: 0.55; }
.pvfv-hero-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.pvfv-hero-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--text-bright); border: 3px solid var(--bg-panel); box-shadow: 0 0 0 1px var(--border); }
.pvfv-hero-dot.gold { background: var(--accent); }
.pvfv-hero-upside { text-align: center; margin-top: var(--space-3); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }

.why-box { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-1); }
.why-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); letter-spacing: 0.08em; color: var(--text-dim); }
.why-list { display: flex; flex-direction: column; }
.why-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.why-item:last-child { border-bottom: none; }
.why-num { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-dim); }
.why-label { font-size: var(--fs-base); color: var(--text-bright); font-weight: var(--fw-medium); }
.why-value { font-family: var(--mono); font-size: var(--fs-lg); font-weight: var(--fw-bold); text-align: right; }
.why-value.positive { color: var(--green); }
.why-risk {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
}
.why-risk-label { font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--red); font-weight: var(--fw-semibold); }
.why-risk-text { font-size: var(--fs-base); color: var(--text-bright); }

@media (max-width: 1023px) {
    .hero-body-v2 { grid-template-columns: 1fr; gap: var(--space-4); }
}
@media (max-width: 640px) {
    .report-header-v2 .rh-ticker { font-size: var(--fs-xl); }
    .report-header-v2 .rh-price-value { font-size: var(--fs-xl); }
}

/* hero-thesis moved to report-thesis block below hero */

.report-thesis {
    padding: var(--space-4);
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
}
.thesis-heading {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--text-dim);
    margin-bottom: var(--space-2);
}
.thesis-paragraph {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text);
    margin: 0;
    max-width: none;
}

.decision-digest {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}
.decision-digest-column {
    background: var(--bg-panel);
    padding: var(--space-4);
}
.decision-digest-column.positive { border-top: 2px solid var(--green); }
.decision-digest-column.negative { border-top: 2px solid var(--red); }
.decision-digest-title {
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-bright);
}
.decision-digest-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: start;
    padding: var(--space-2) 0;
    border-top: 1px solid var(--border);
}
.decision-digest-item > span {
    width: 7px;
    height: 7px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--text-dim);
}
.positive .decision-digest-item > span { background: var(--green); }
.negative .decision-digest-item > span { background: var(--red); }
.decision-digest-item strong { display: block; color: var(--text-bright); font-size: var(--fs-base); }
.decision-digest-item small { display: block; margin-top: 2px; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.4; }
.decision-digest-item b { color: var(--text-bright); font: var(--fw-bold) var(--fs-sm)/1.4 var(--mono); }
.decision-digest-empty { color: var(--text-dim); font-size: var(--fs-sm); }
.thesis-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.thesis-tag {
    font-size: var(--fs-xs);
    font-family: var(--mono);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.thesis-tag.pos { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.thesis-tag.neg { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* Quick Stats Row - pod hero, 4 kolumny podstawowych metryk */
.quick-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-inset);
}
.quick-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.quick-stat-label {
    font-size: 0.7rem;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: var(--fw-medium);
}
.quick-stat-value {
    font-family: var(--mono);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
}

/* Reasons Details - collapsible dla pozostałych faktorów */
.reasons-details {
    margin-top: var(--space-3);
    border-top: 1px solid var(--border);
    padding-top: var(--space-3);
}
.reasons-summary {
    cursor: pointer;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-2);
    background: var(--bg-inset);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    user-select: none;
}
.reasons-summary:hover {
    background: var(--bg-panel);
    border-color: var(--accent);
}
.reasons-details[open] .reasons-summary {
    margin-bottom: var(--space-3);
}

.report-chart-section {
    margin-bottom: var(--space-3);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.chart-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-2);
}
.chart-section-header .chart-tabs { gap: var(--space-1); }
.chart-section-header .chart-overlay { gap: var(--space-4); }
.report-chart-section #chartArea { min-height: 580px; padding: var(--space-2) var(--space-3); }

.report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    padding: var(--space-4) var(--space-4) var(--space-3);
    gap: var(--space-4);
}

/* ── Report workspace: sticky nav + main + sticky DiviMetrics Snapshot ── */
.report-layout.report-layout-3col {
    grid-template-columns: 180px minmax(0, 1fr) 300px;
    gap: var(--space-5);
    align-items: start;
    padding-left: 0;
}
.report-layout.report-layout-3col .report-nav {
    margin-right: 0;
    padding-right: 0;
}

.report-hero,
.report-section,
.collapsible {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

.report-nav {
    position: sticky;
    top: var(--header-height);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.report-nav-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.report-nav-group-title {
    padding: 0 var(--space-3);
    font-size: 10px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.12em;
    color: var(--text-dim);
    opacity: 0.65;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}
.report-nav-item {
    display: flex;
    align-items: center;
    padding: 7px var(--space-3);
    margin-left: 0;
    font-size: var(--fs-sm);
    color: var(--text-dim);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), padding-left var(--transition-fast);
}
.report-nav-item:hover {
    color: var(--text-bright);
    padding-left: calc(var(--space-3) + 4px);
}
.report-nav-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: var(--fw-semibold);
    background: rgba(200, 164, 94, 0.08);
}
.report-nav-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0.3;
    transition: height 200ms ease-out;
    pointer-events: none;
}
.report-nav-item.flash {
    animation: navFlash 600ms ease-out;
}
@keyframes navFlash {
    0% { background: rgba(200, 164, 94, 0.35); }
    100% { background: transparent; }
}

.report-snapshot {
    position: sticky;
    top: var(--header-height);
    background: var(--bg-rail);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-family: var(--mono);
    max-height: calc(100vh - var(--header-height) - var(--space-4));
    overflow-y: auto;
}
.snap-title {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
}
.snap-score {
    font-family: var(--mono);
    font-size: var(--fs-4xl);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
    line-height: 1;
    margin-bottom: 4px;
}
.snap-score-denom { font-size: var(--fs-base); color: var(--text-dim); margin-left: 2px; }
.snap-signal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--fw-bold);
    font-size: var(--fs-lg);
    color: var(--signal-color, var(--accent));
    margin-bottom: var(--space-2);
}
.snap-signal-badge .signal-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--signal-color, var(--accent));
    flex-shrink: 0;
}
.snap-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.snap-kv:last-of-type { border-bottom: none; }
.snap-kv .snap-label { font-size: var(--fs-xs); color: var(--text-dim); }
.snap-kv .snap-value {
    font-family: var(--mono);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
}
.snap-kv .snap-value.value-gold { color: var(--accent); }
.snap-divider { height: 1px; background: var(--border); margin: var(--space-3) 0; }
.snap-metric-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: var(--fs-sm);
}
.snap-metric-row span:first-child { color: var(--text-dim); }
.snap-metric-value { color: var(--text-bright); font-weight: var(--fw-semibold); }
.snap-signals-title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
}
.snap-signals-list { display: flex; flex-direction: column; gap: 8px; }
.snap-signal-item {
    font-size: var(--fs-sm);
    color: var(--text-bright);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.snap-signal-item .sentiment-dot { margin-top: 5px; }
.snap-freshness-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: var(--space-1);
}
.snap-freshness-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-dim);
}
.snap-freshness-label { text-transform: uppercase; letter-spacing: 0.06em; }
.snap-freshness-value { color: var(--text-bright); font-weight: var(--fw-medium); }
.snap-freshness-value.live { color: var(--green); display: flex; align-items: center; gap: 6px; }
.snap-freshness-value.live::before {
    content: '';
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.15);
}

@media (max-width: 1279px) {
    .report-layout.report-layout-3col { grid-template-columns: minmax(0, 1fr) 240px; }
    .report-nav { display: none; }
}
@media (max-width: 1023px) {
    .report-layout.report-layout-3col { grid-template-columns: 1fr; }
    .report-snapshot { position: static; max-height: none; margin-bottom: var(--space-4); }
}
.report-aside {
    min-width: 0;
    align-self: start;
    position: sticky;
    top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.report-aside .earn-strip {
    margin: 0;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.report-aside > .side-panel {
    padding: var(--space-4);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.snapshot-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: var(--border);
    margin-bottom: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.snapshot-strip .side-panel { padding: var(--space-4) var(--space-4); background: var(--bg-panel); border-top: 2px solid var(--border); }
.snapshot-strip .side-panel:nth-child(1) { border-top-color: var(--accent); }
.snapshot-strip .side-panel:nth-child(2) { border-top-color: var(--accent-blue); }
.snapshot-strip .side-panel:nth-child(3) { border-top-color: var(--cyan); }
.snapshot-strip .side-panel:nth-child(4) { border-top-color: var(--amber); }
.snapshot-strip .side-panel-title { margin-bottom: var(--space-2); font-size: var(--fs-sm); }
.snapshot-strip .side-kv { padding: 5px 0; }

/* Legacy .earn-strip styles removed — replaced by .key-facts-strip */

.report-main { min-width: 0; }
.report-advanced-label {
    margin: var(--space-6) 0 var(--space-2);
    color: var(--text-dim);
    font: var(--fw-bold) var(--fs-xs)/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
}
.report-tool-description { margin: 0 0 var(--space-3); color: var(--text-dim); font-size: var(--fs-base); }
.report-tool-button {
    min-height: 40px;
    width: auto;
    padding: 8px 16px;
    color: var(--text-bright);
}
.report-main > .collapsible { margin-bottom: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: visible; }
.report-main > .collapsible .collapsible-header { background: var(--bg-inset); border-bottom: 1px solid transparent; padding: 12px var(--space-3); border-left: 3px solid var(--border); border-radius: var(--radius-md); }
.report-main > .collapsible.open .collapsible-header { border-left-color: var(--accent); border-bottom-color: var(--border); background: linear-gradient(90deg, var(--accent-dim) 0%, var(--bg-inset) 60%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.report-main > .collapsible:first-child .collapsible-header { border-left-color: var(--accent); }
.report-main > .collapsible .collapsible-title { font-size: var(--fs-base); color: var(--text-bright); font-weight: var(--fw-semibold); }
.report-main > .collapsible .collapsible-summary { font-size: var(--fs-sm); color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.report-main > .collapsible .collapsible-body-inner { padding: 0; }
.report-main > .collapsible.open .collapsible-body-inner { padding: var(--space-4) var(--space-3) var(--space-5); }

.dcf-table { display: flex; flex-direction: column; }
.dcf-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-base); }
.dcf-row:last-child { border-bottom: none; }
.dcf-label { color: var(--text-dim); font-size: var(--fs-sm); }
.dcf-value {
  font-family: var(--mono);
  color: var(--text-bright);
  font-weight: var(--fw-bold);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.dcf-desc { font-size: var(--fs-sm); color: var(--text-dim); margin-bottom: var(--space-3); line-height: 1.5; }

/* 🎯 DCF EDIT FORM */
.dcf-edit-toggle {
  margin-top: var(--space-3);
  padding: 8px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--accent-light);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dcf-edit-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text-bright);
}

.dcf-edit-form {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.dcf-edit-header {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.dcf-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dcf-input-group {
  display: flex;
  flex-direction: column;
}

.dcf-input-group label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.dcf-input-group input {
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: var(--fs-base);
  transition: border-color 0.2s;
}

.dcf-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.dcf-edit-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.dcf-btn {
  padding: 9px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}

.dcf-btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  font-weight: var(--fw-bold);
}

.dcf-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 122, 176, 0.35);
}

.dcf-btn-secondary {
  background: var(--bg-inset);
  color: var(--text-bright);
  border-color: var(--border-strong);
}

.dcf-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.dcf-btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.dcf-btn-ghost:hover {
  color: var(--text-bright);
  border-color: var(--border-strong);
  background: var(--bg-inset);
}

.dcf-recalc-result {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}
.dcf-recalc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.dcf-recalc-label {
  display: block;
  color: var(--text);
  font-size: var(--fs-xs);
  margin-bottom: 4px;
}
.dcf-recalc-value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--accent-light);
  font-family: var(--mono);
}
.dcf-recalc-params {
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.45;
}

.dcf-result-box {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-md);
}

.dcf-result-header {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.dcf-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

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

.dcf-result-label {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dcf-result-value {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-bright);
}

.dcf-error {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.dcf-loading {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.dcf-warning {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  color: var(--amber);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}


.analyst-table { display: flex; flex-direction: column; margin-top: var(--space-3); }
.analyst-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-base); }
.analyst-row:last-child { border-bottom: none; }
.analyst-label { color: var(--text-dim); font-family: var(--mono); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; }
.analyst-value {
  font-family: var(--mono);
  color: var(--text-bright);
  font-weight: var(--fw-bold);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.analyst-value.pos { color: var(--green); }
.analyst-value.neg { color: var(--red); }

.target-range { margin-bottom: var(--space-3); }
.target-range-track { position: relative; height: 8px; background: var(--bg-inset); border-radius: 4px; border: 1px solid var(--border); margin: var(--space-3) 0 var(--space-2); }
.target-range-fill { position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(90deg, rgba(248,113,113,0.25), rgba(234,180,56,0.18), rgba(74,222,128,0.25)); border-radius: 3px; }
.target-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; transform: translateX(-50%); }
.target-marker.mean { background: var(--text-bright); }
.target-marker.median { background: var(--accent); width: 4px; }
.target-marker.current { background: var(--green); width: 4px; }
.target-range-values { display: flex; justify-content: space-between; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-dim); }
.target-low { color: var(--red); }
.target-mid { color: var(--text-bright); }
.target-high { color: var(--green); }

.info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; }
.info-item { background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: var(--space-2) 0; }
.info-item:last-child { border-bottom: none; }
.info-item-label { font-size: var(--fs-sm); margin-bottom: 2px; }
.info-item-value {
  font-size: 1.125rem;
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.info-item-sub { font-size: var(--fs-sm); }

.metrics-grid-v2 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.metric-v2 { padding: var(--space-3) var(--space-4); }
.metric-v2-value { font-size: var(--fs-lg); }
.metric-v2-desc { font-size: var(--fs-sm); }

.conf-breakdown-row { gap: 8px; }
.conf-breakdown-label { width: 80px; white-space: normal; overflow-wrap: break-word; line-height: 1.25; }
.conf-breakdown-bar { height: 5px; }
.conf-breakdown-value { width: 32px; }

@media (max-width: 1023px) {
    .report-hero { margin: var(--space-4) var(--space-4) 0; }
    .hero-body { grid-template-columns: 1fr; gap: var(--space-4); }
    .report-thesis { margin: 0 var(--space-4); padding: var(--space-4); }
    .thesis-paragraph { font-size: var(--fs-base); }
    .report-layout { grid-template-columns: 1fr; padding: var(--space-4); }
    .report-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .snapshot-strip { gap: var(--space-3); }
    .metrics-grid-v2 { grid-template-columns: 1fr; }
    .report-chart-section #chartArea { min-height: 300px; }
}

@media (max-width: 768px) {
    .report-main .table-wrapper { border: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .report-main .table { display: table; width: auto; min-width: 100%; font-size: var(--fs-xs); }
    .report-main .table th, .report-main .table td { padding: 6px 8px; white-space: nowrap; }

    .quick-stats-row { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); padding: var(--space-3); }
    .hero-price-strip { grid-template-columns: repeat(3, 1fr); }
    .decision-digest { grid-template-columns: 1fr; }
    .report-aside { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .report-hero { margin: var(--space-3) var(--space-3) 0; }
    .report-hero .report-header-v2 { padding: var(--space-3) var(--space-4); flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .report-header-v2 .rh-left { width: 100%; gap: var(--space-3); }
    .report-header-v2 .rh-right { width: 100%; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; margin-left: 0; }
    .report-header-v2 .rh-ticker { font-size: var(--fs-xl); }
    .report-header-v2 .rh-name { max-width: none; white-space: normal; overflow-wrap: break-word; }
    .report-header-v2 .rh-price-value { font-size: var(--fs-base); }
    .report-header-v2 .rh-actions { margin-left: 0; flex-wrap: wrap; }
    .report-header-v2 .action-btn { min-height: 40px; padding: 7px 10px; font-size: var(--fs-xs); flex: 1 1 auto; justify-content: center; }

    .hero-body { padding: var(--space-3); gap: var(--space-3); }
    .hero-verdict { align-items: center; gap: var(--space-1); }
    .hero-score { font-size: 2.5rem; }
    .hero-signal { font-size: var(--fs-sm); }
    .hero-quality { max-width: 100%; margin-top: 0; }
    .hero-bar-row { gap: 6px; font-size: var(--fs-sm); }
    .hero-bar-label { width: auto; min-width: 50px; }
    .hero-bar-value { width: auto; text-align: right; }
    .hero-price { gap: var(--space-3); }
    .hero-price-strip { grid-template-columns: 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
    .hps-item { background: var(--bg-panel); padding: var(--space-3); flex-direction: row; justify-content: space-between; align-items: center; }
    .hps-value { font-size: var(--fs-md); }
    .hps-label { font-size: var(--fs-xs); }

    .report-thesis { margin: 0 var(--space-3); padding: var(--space-3); }
    .thesis-paragraph { font-size: var(--fs-base); }
    .chart-section-header { padding: var(--space-2) var(--space-3); }
    .report-chart-section #chartArea { min-height: 250px; padding: var(--space-2); }

    .report-layout { padding: var(--space-3); }
    .snapshot-strip { gap: var(--space-2); }
    .snapshot-strip .side-panel { padding: var(--space-2); }
    .side-earn-days { font-size: var(--fs-lg); }
    .side-panel-title { font-size: var(--fs-sm); margin-bottom: var(--space-1); }
    .side-kv { padding: 3px 0; font-size: var(--fs-sm); }
    .side-kv-value { font-size: var(--fs-sm); }

    .report-main > .collapsible .collapsible-header { padding: var(--space-3) var(--space-2); }
    .report-main > .collapsible.open .collapsible-body-inner { padding: var(--space-2) var(--space-2) var(--space-3); }
    .report-main > .collapsible .collapsible-title { flex-wrap: wrap; gap: 4px; font-size: var(--fs-sm); }
    .report-main > .collapsible .collapsible-summary { display: block; width: 100%; font-size: var(--fs-sm); }
    .report-main > .collapsible .collapsible-header { min-height: 48px; }
    .action-btn, .chart-tab, .dcf-btn, .report-tool-button { min-height: 44px; }

    .takeaway-card { padding: var(--space-3); margin-bottom: var(--space-3); gap: var(--space-2); }
    .takeaway-summary { font-size: var(--fs-sm); }
    .takeaway-row { gap: var(--space-2); }
    .takeaway-item-value { font-size: var(--fs-sm); }
    .reason-list-v2 { gap: 1px; }
    .reason-item-v2 { gap: var(--space-2); padding: var(--space-2) var(--space-3); }
    .reason-title-row { flex-wrap: wrap; gap: 2px; }
    .reason-title { font-size: var(--fs-sm); word-break: break-word; }
    .reason-value { font-size: var(--fs-sm); width: 100%; text-align: right; }
    .reason-desc { font-size: var(--fs-sm); }

    .chart-container { padding: var(--space-3) var(--space-3) !important; }
    .chart-tabs { flex-wrap: wrap; gap: var(--space-1); }
    .chart-tab { padding: 3px 8px; font-size: var(--fs-xs); }
    .chart-overlay { gap: var(--space-3); }
    .chart-overlay-value { font-size: var(--fs-sm); }

    .metrics-grid-v2 { grid-template-columns: 1fr; }
    .metric-v2 { padding: var(--space-2) var(--space-3); }
    .metric-v2-value { font-size: var(--fs-base); }
    .metric-v2-desc { font-size: var(--fs-sm); }
    .info-row { grid-template-columns: 1fr; }
    .info-item { padding: var(--space-2) 0; }
    .info-item-value {
  font-size: 1.125rem;
  font-family: var(--mono);
  font-weight: var(--fw-semibold);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
    .info-item-sub { font-size: var(--fs-sm); }

    .dcf-row, .analyst-row { font-size: var(--fs-sm); padding: 6px 0; gap: var(--space-2); }
    .dcf-value, .analyst-value { max-width: 60%; overflow-wrap: break-word; white-space: normal; }
    .dcf-label, .analyst-label { max-width: 70%; overflow-wrap: break-word; white-space: normal; }
    .dcf-desc { font-size: var(--fs-sm); }

    .scenario-bar-values { font-size: var(--fs-sm); }
    .target-range-values { flex-wrap: wrap; gap: var(--space-1); font-size: var(--fs-sm); }
    .target-range-track { margin: var(--space-2) 0; }

    .sentiment-summary-bar { padding: var(--space-2); gap: var(--space-2); flex-wrap: wrap; }
    .news-list { gap: var(--space-1); }
    .news-item { padding: var(--space-2); font-size: var(--fs-sm); }
    .news-toggle-btn { padding: 6px 10px; font-size: var(--fs-sm); }

    .conf-breakdown { gap: 6px; }
    .conf-breakdown-row { gap: 6px; font-size: var(--fs-sm); }
    .conf-breakdown-label { width: 75px; }
    .conf-breakdown-value { width: 28px; }

    /* tighter shell / report margins on small phones */
    .report-hero { margin: var(--space-2) var(--space-2) 0; }
    .report-layout { padding: var(--space-2); }
    .side-ins-counts { gap: var(--space-2); }
    .side-ins-count { font-size: var(--fs-sm); }
    .side-ins-last { font-size: var(--fs-sm); }

    .results-container { padding: 0 var(--space-2) var(--space-4); }
    .top-bar { gap: var(--space-2); padding: 0 var(--space-3); }
    .top-bar-brand span { display: none; }
    .top-bar-search { max-width: 160px; }
    .top-bar-search input { font-size: var(--fs-xs); }
    .top-bar-search input::placeholder { font-size: var(--fs-xs); }
    .top-bar-meta { gap: var(--space-1); }
    .top-bar-link { padding: 5px 10px; font-size: var(--fs-sm); }
    .nav-tabs { padding: 0 var(--space-3); }
    .nav-tab { padding: 8px 12px; font-size: var(--fs-xs); }
    .report-panel { margin-left: 0; margin-right: 0; width: 100%; }
    .decision-digest-item { grid-template-columns: 8px minmax(0, 1fr); }
    .decision-digest-item b { grid-column: 2; }
    .report-main, .report-aside, .collapsible, .collapsible-body-inner { max-width: 100%; min-width: 0; }
}

/* ──────────────────────────────────────────────
   SMALL PHONE BREAKPOINT (<480px)
   ────────────────────────────────────────────── */
@media (max-width: 479px) {
  /* Top bar: hide meta links, give search more room */
  .top-bar { padding: 0 var(--space-2); gap: var(--space-1); }
  .top-bar-brand { font-size: var(--fs-xs); }
  .top-bar-brand span { display: none; }
  .top-bar-search { max-width: none; flex: 1; }
  .top-bar-meta { display: none; }

  /* Search box: stack input and button */
  .search-box { flex-direction: column; }
  .search-btn { width: 100%; }
  #searchTab .search-box,
  #searchTab .suggestions,
  #searchTab .research-suggestions { max-width: 100%; }

  /* Containers: tighter padding */
  .search-container,
  .scanner-container,
  .compare-container,
  .results-container { padding-left: var(--space-2); padding-right: var(--space-2); }

  /* Portfolio add bar: stack vertically */
  .pf-add-bar { flex-direction: column; align-items: stretch; }
  .pf-add-bar .pf-add-search { max-width: none !important; width: 100%; }
  .pf-add-bar .search-btn { width: 100%; }

  /* Compare box: stack inputs */
  .compare-box { flex-direction: column; align-items: stretch; }
  .compare-box > div { min-width: 0; }
  .compare-vs { text-align: center; padding: var(--space-1) 0; }

  /* Scanner filters: scrollable */
  .scanner-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .scanner-filters::-webkit-scrollbar { display: none; }

  /* Disclaimer: smaller text */
  .disclaimer-bar { font-size: 0.65em; padding: var(--space-1) var(--space-2); text-align: center; }

  /* Report hero: minimal margins */
  .report-hero { margin: var(--space-1) 0 0; }
  .report-layout { padding: var(--space-1); }
  .report-thesis { margin: 0; padding: var(--space-2); }
  .report-header-v2 .rh-right { display: grid; grid-template-columns: 1fr; }
  .report-header-v2 .rh-price { align-items: flex-start; }
  .report-header-v2 .rh-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .report-header-v2 .rh-actions .action-btn:last-child { grid-column: 1 / -1; }
  .quick-stats-row { grid-template-columns: 1fr; }
  .thesis-paragraph { line-height: 1.6; }

  /* Portfolio metrics: 2 cols instead of 3 */
  .portfolio-metrics { grid-template-columns: repeat(2, 1fr); }

  /* Nav tabs: tighter */
  .nav-tab { padding: 6px 8px; font-size: 0.65em; }
  .nav-tab svg { width: 12px; height: 12px; }
}

/* ──────────────────────────────────────────────
   RESEARCH DESK — editorial application frame
   ────────────────────────────────────────────── */
@media (max-width: 0px) {
body {
  display: block;
  background: var(--bg);
  background-image: none;
  letter-spacing: 0.002em;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: 58px;
  padding: 0 clamp(14px, 2vw, 28px);
  background: rgba(11, 13, 12, 0.96);
  border-bottom: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
}
.top-bar-brand {
  min-width: 205px;
  padding-right: var(--space-5);
  border-right: 1px solid var(--border);
  gap: 10px;
}
.top-bar-brand svg { width: 15px; height: 15px; }
.top-bar-brand .brand-wordmark {
  display: inline;
  color: var(--text-bright);
  font: var(--fw-semibold) 0.78rem/1 var(--mono);
  letter-spacing: 0.11em;
}
.top-bar-brand .brand-wordmark b { color: var(--accent); font-weight: inherit; }
.top-bar-brand small {
  display: block;
  margin-left: auto;
  color: var(--text-dim);
  font: var(--fw-medium) 0.57rem/1 var(--mono);
  letter-spacing: 0.12em;
}
.top-bar-search { max-width: 430px; }
.top-bar-search input {
  height: 34px;
  padding: 0 13px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  letter-spacing: 0.06em;
}
.top-bar-search input:focus { border-color: var(--accent); }
.top-bar-link {
  padding: 6px 3px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.top-bar-link:hover { color: var(--text-bright); border-color: var(--accent); background: transparent; }
.top-bar-link.login-link,
.top-bar-link.login-link:hover {
  padding: 7px 12px;
  color: var(--accent-light);
  background: transparent;
  border: 1px solid var(--accent);
  box-shadow: none;
}

.app-shell {
  width: var(--container-max);
  min-height: calc(100vh - 58px);
  margin: 0 auto;
  padding: var(--section-pad) clamp(12px, 1.5vw, 24px) var(--space-8);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--right-panel-width);
  align-items: start;
  gap: var(--inline-gap);
  overflow: visible;
}
.app-main > * { max-width: var(--content-read-max); }
.app-main {
  height: auto;
  min-height: calc(100vh - 116px);
  overflow: visible;
  display: block;
  background: transparent;
  min-width: 0;
}
.app-sidebar,
.app-right-panel {
  position: relative;
  height: auto;
  max-height: none;
  overflow: visible;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}
.app-sidebar {
  background: var(--bg-sidebar);
  border-radius: 3px 15px 3px 3px;
}
.app-right-panel {
  background: var(--bg-rail);
  border-radius: 15px 3px 3px 3px;
}

.sidebar-nav { padding: var(--space-3) var(--space-3) var(--space-5); }
.sidebar-nav-section {
  padding: var(--space-3) 0 var(--space-4);
  opacity: 1;
  color: var(--accent);
  border-bottom: 1px solid var(--border-strong);
}
.sidebar-nav-item {
  position: relative;
  min-height: 44px;
  padding: 11px 0;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}
.sidebar-nav-item::before {
  content: attr(data-index);
  width: 21px;
  color: #666c67;
  font: var(--fw-medium) 0.62rem/1 var(--mono);
  letter-spacing: 0.04em;
}
.sidebar-nav-item svg { display: none; }
.sidebar-nav-item:hover { padding-left: 4px; color: var(--text-bright); background: transparent; }
.sidebar-nav-item.active {
  padding-left: 4px;
  color: var(--accent-light);
  border-left: 0;
  border-bottom-color: var(--accent);
  background: transparent;
}
.sidebar-nav-item.active::before { color: var(--accent); }
.sidebar-footer {
  padding: var(--space-4);
  background: #0d100e;
  border-top: 1px solid var(--border-strong);
  border-radius: 0 0 3px 3px;
}
.sidebar-footer .sf-dot { animation: none; box-shadow: none; }

.right-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 17px var(--space-4) 14px;
  color: var(--text-bright);
  border-bottom: 1px solid var(--border-strong);
  font: var(--fw-semibold) var(--fs-xs)/1 var(--mono);
  letter-spacing: 0.1em;
}
.right-panel-heading small { color: var(--text-dim); font-size: 0.58rem; letter-spacing: 0.08em; }
.rp-section { padding: var(--space-4); }
.rp-title { justify-content: flex-start; gap: var(--space-2); color: var(--text-dim); }
.rp-title::before {
  content: attr(data-index);
  color: #626762;
  font-size: 0.62rem;
}
.rp-market-status { padding: var(--space-2) 0; }
.rp-market-dot { width: 7px; height: 7px; }
.rp-market-dot.open,
.rp-market-dot.closed { box-shadow: none; }
.rp-recent-item {
  margin: 2px 5px 2px 0;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
}
.rp-recent-item:hover { color: var(--accent); border-color: var(--accent); }

.research-intro.compact {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 0 0 var(--space-6);
  text-align: center;
}
.research-kicker {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-dim);
  font: var(--fw-medium) 0.65rem/1 var(--mono);
  letter-spacing: 0.1em;
}
.research-kicker span:first-child { color: var(--accent); }
.research-intro.compact h2 {
  max-width: 700px;
  margin: 0 0 var(--space-2);
  color: var(--text-bright);
  font: 600 clamp(2.4rem, 5vw, 4.8rem)/0.95 var(--serif);
  letter-spacing: -0.045em;
}
.research-intro.compact p {
  max-width: 560px;
  font-size: var(--fs-md);
  color: var(--text-dim);
}
#searchTab .search-box,
#searchTab .suggestions,
#searchTab .research-suggestions { max-width: 820px; }
.search-container { margin: 0 auto; }
.search-box { gap: 0; border: 1px solid var(--border-strong); border-radius: 3px 12px 3px 3px; overflow: hidden; }
.search-input {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: var(--bg-input);
  font-size: var(--fs-md);
}
.search-btn {
  min-width: 160px;
  border-radius: 0;
  background: var(--accent);
  color: #11130f;
  letter-spacing: 0.06em;
}
.search-btn:hover { opacity: 1; background: var(--accent-hover); }
.research-suggestions { margin-top: var(--space-3); justify-content: flex-start !important; }
.research-suggestions-label { margin-right: var(--space-3); color: var(--text-dim); }
.research-chip {
  padding: 3px 1px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
}
.research-chip:hover { border-color: var(--accent); }
.report-active #searchTab { display: none !important; }

.report-panel {
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.report-hero {
  background: transparent;
  border: none;
  border-radius: 0;
}
.report-hero .report-header-v2 {
  padding: var(--space-2) var(--space-4);
  border-bottom-color: var(--border-strong);
}
.report-header-v2 .rh-ticker {
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
}
.report-header-v2 .rh-name { color: var(--text); }
.report-header-v2 .rh-meta { text-transform: uppercase; letter-spacing: 0.07em; }
.report-header-v2 .rh-actions .action-btn {
  padding: 5px 7px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
}
.report-header-v2 .rh-actions .action-btn:hover { border-color: var(--accent); }
.ticker-logo,
.report-logo-slot { width: 34px; height: 34px; }

.hero-body {
  grid-template-columns: minmax(165px, .48fr) minmax(0, 1.52fr);
  gap: var(--space-8);
  padding: var(--space-5);
  border-top: 0;
}
.hero-verdict { justify-content: center; }
.hero-signal-label {
  color: var(--text-dim);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.hero-signal-badge {
  align-self: flex-start;
  padding: 0;
  color: var(--signal-color);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}
.hero-confidence-row { margin-top: var(--space-2); }
.hero-conf-bar { height: 2px; border-radius: 0; }
.hero-conf-fill { border-radius: 0; }
.hero-price-strip { gap: 0; border-left: 1px solid var(--border); }
.hps-item { padding: 2px var(--space-4); border-right: 1px solid var(--border); }
.hps-value { font-size: clamp(1.25rem, 2vw, 1.8rem); }

.report-thesis {
  padding: var(--space-4);
  background: transparent;
  border-left: 2px solid var(--accent);
}
.thesis-heading { color: var(--text-dim); }
.thesis-paragraph {
  max-width: 880px;
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  margin-top: var(--space-2);
}
.thesis-oneliner {
  max-width: 880px;
  color: var(--text-bright);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  margin: 0;
}
.decision-digest { background: transparent; gap: 0; }
.decision-digest-column { padding: var(--space-5); background: transparent; }
.decision-digest-column + .decision-digest-column { border-left: 1px solid var(--border-strong); }
.decision-digest-column.positive,
.decision-digest-column.negative { border-top-width: 1px; }

.report-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: var(--space-5); padding: var(--space-4) var(--space-4); }
.report-aside { position: sticky; top: var(--header-height); gap: 0; background: var(--bg-rail); border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; }
.report-aside .earn-strip,
.report-aside .quick-stats-row,
.report-aside > .side-panel {
  margin: 0;
  padding: var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.report-aside > :last-child { border-bottom: 0; }
.quick-stats-row { gap: var(--space-4); }

.report-main { counter-reset: research-section; }
.report-main > .collapsible {
  counter-increment: research-section;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
}
.report-main > .collapsible:last-child { border-bottom: 1px solid var(--border-strong); }
.report-main > .collapsible .collapsible-header {
  min-height: 54px;
  padding: 13px 4px;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}
.report-main > .collapsible .collapsible-title::before {
  content: counter(research-section, decimal-leading-zero);
  width: 24px;
  color: #666c67;
  font-size: 0.61rem;
  letter-spacing: 0.04em;
}
.report-main > .collapsible .collapsible-title { font-size: var(--fs-base); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.report-main > .collapsible.open .collapsible-header {
  border-left: 0;
  border-bottom-color: var(--border);
  background: transparent;
}
.report-main > .collapsible.open .collapsible-title::before { color: var(--accent); }
.collapsible-chevron { background: transparent; border: 0; }
.report-main > .collapsible.open .collapsible-body-inner { padding: var(--space-4) 4px var(--space-6) 28px; }
.metric-v2,
.reason-item,
.risk-score-card,
.earnings-latest-card,
.earnings-history-card {
  border-radius: 2px;
  box-shadow: none;
}
.reason-item { background: transparent; }
.reason-item:hover { background: var(--bg-inset); }
.risk-score-card { background: transparent; }
.report-chart-section {
  margin: var(--space-5) var(--space-4);
  border: 1px solid var(--border-strong);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}
.chart-section-header { padding: var(--space-3) var(--space-4); }
.chart-section-title { margin-right: auto; }
.chart-section-title span { display: block; color: var(--text-bright); font: var(--fw-semibold) var(--fs-md)/1 var(--sans); }
.chart-section-title small { display: block; margin-top: 4px; color: var(--text-dim); font: var(--fw-medium) var(--fs-xs)/1 var(--mono); letter-spacing: .08em; }
.chart-tab { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.chart-tab.active { background: transparent; }
.report-advanced-label { padding-top: var(--space-3); border-top: 1px solid var(--accent); color: var(--accent); }

.status-bar,
.disclaimer-bar { position: relative; width: 100%; }
.status-bar { height: 30px; background: #090b0a; border-color: var(--border); }
.disclaimer-bar { background: var(--bg); }

@media (max-width: 1279px) {
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .app-right-panel { display: none; }
}
@media (max-width: 1023px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-aside { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-aside > * { border-right: 1px solid var(--border) !important; border-bottom: 0 !important; }
  .report-aside > :last-child { border-right: 0 !important; }
}
@media (max-width: 899px) {
  .app-shell { display: block; padding: 12px 10px 32px; }
  .app-sidebar { display: none; }
  .app-main { min-height: 0; }
  .top-bar-brand { min-width: auto; }
  .top-bar-brand small { display: none; }
  .top-bar-meta { display: none; }
  .report-panel,
  .report-hero,
  .report-layout,
  .report-main,
  .report-aside { width: 100%; max-width: 100%; min-width: 0; }
  .report-panel { overflow: hidden; }
  .report-hero .report-header-v2 {
    flex-direction: column;
    align-items: stretch;
  }
  .report-header-v2 .rh-left,
  .report-header-v2 .rh-right { width: 100%; min-width: 0; }
  .report-header-v2 .rh-right {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-left: 0;
  }
  .report-header-v2 .rh-actions { margin-left: 0; flex-wrap: wrap; }
  .hero-body { grid-template-columns: 1fr; gap: var(--space-4); }
  .hero-verdict { align-items: flex-start; }
  .hero-signal-label { text-align: left; }
  .hero-signal-badge { align-self: flex-start; }
  .hero-price-strip {
    grid-template-columns: 1fr;
    border: 1px solid var(--border);
    border-radius: 2px 8px 2px 2px;
    overflow: hidden;
  }
  .hps-item {
    padding: var(--space-3);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .hps-item:last-child { border-bottom: 0; }
  .hps-value { font-size: var(--fs-md); text-align: right; }
  .decision-digest { grid-template-columns: 1fr; }
  .decision-digest-column + .decision-digest-column { border-left: 0; }
  .decision-digest-item { grid-template-columns: 8px minmax(0, 1fr); }
  .decision-digest-item b { grid-column: 2; }
  .report-aside { display: block; }
  .report-aside > * {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .report-aside > :last-child { border-bottom: 0 !important; }
  .report-main > .collapsible,
  .report-main > .collapsible .collapsible-header,
  .collapsible-body,
  .collapsible-body-inner { max-width: 100%; min-width: 0; }
}
@media (max-width: 640px) {
  .top-bar { height: 52px; padding: 0 10px; }
  .top-bar-brand { min-width: auto; padding-right: 10px; }
  .top-bar-brand small { display: none; }
  .top-bar-brand .brand-wordmark b { display: none; }
  .top-bar-search { min-width: 0; }
  .research-intro.compact { margin-top: 36px; }
  .research-kicker span:last-child { display: none; }
  .research-intro.compact h2 { font-size: clamp(2.45rem, 14vw, 3.6rem); }
  .search-box { flex-direction: column; border-radius: 2px 10px 2px 2px; }
  .search-btn { width: 100%; min-height: 48px; }
  .report-panel { border-radius: 2px 10px 2px 2px; }
  .report-hero .report-header-v2 { padding: var(--space-4); }
  .hero-body { padding: var(--space-4); }
  .hero-signal-badge { align-self: center; }
  .hero-signal-label { text-align: center; }
  .hps-item { padding: var(--space-3); }
  .decision-digest-column + .decision-digest-column { border-left: 0; }
  .report-layout { padding: var(--space-4) var(--space-3); gap: var(--space-5); }
  .report-aside { display: block; }
  .report-aside > * { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
  .report-aside > :last-child { border-bottom: 0 !important; }
  .report-main > .collapsible.open .collapsible-body-inner { padding-left: var(--space-2); }
}
}

/* ──────────────────────────────────────────────
   REFACTOR COMPONENTS — Valuation Consensus, Scenario Range, Risk Score
   ────────────────────────────────────────────── */

/* Valuation Consensus Bar — wizualizacja zgody modeli wyceny */
.valuation-consensus-bar {
    margin-bottom: var(--space-4);
}
.valuation-consensus-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-2);
}
.valuation-consensus-label {
    font-size: var(--fs-sm);
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}
.valuation-consensus-count {
    font-family: var(--mono);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
}
.valuation-consensus-track {
    position: relative;
    height: 12px;
    background: var(--bg-inset);
    border-radius: 999px;
    border: 1px solid var(--border);
    overflow: hidden;
}
.valuation-consensus-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Scenario Range Bar — Bear/Base/Bull visualization */
.scenario-range-bar {
    margin: var(--space-4) 0;
}
.scenario-range-label {
    font-size: var(--fs-sm);
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: var(--space-3);
}
.scenario-range-track {
    position: relative;
    height: 10px;
    background: linear-gradient(90deg, rgba(248,113,113,0.2) 0%, rgba(234,180,56,0.2) 50%, rgba(74,222,128,0.2) 100%);
    border-radius: 999px;
    border: 1px solid var(--border);
    margin-bottom: var(--space-2);
}
.scenario-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(248,113,113,0.15), rgba(234,180,56,0.2), rgba(74,222,128,0.15));
    border-radius: 999px;
}
.scenario-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 18px;
    border-radius: 2px;
}
.scenario-marker.bear { background: var(--red); left: 0%; }
.scenario-marker.base { background: var(--amber); width: 5px; height: 20px; }
.scenario-marker.bull { background: var(--green); left: 100%; }
.scenario-marker.current {
    background: var(--text-bright);
    width: 3px;
    height: 24px;
    z-index: 2;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.scenario-marker-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    white-space: nowrap;
}
.scenario-range-values {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    margin-top: var(--space-3);
}
.scenario-value {
    text-align: center;
    line-height: 1.3;
}
.scenario-value.bear { color: var(--red); }
.scenario-value.base { color: var(--amber); }
.scenario-value.bull { color: var(--green); }
.scenario-range-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-1);
}
.scenario-range-labels .bear { color: var(--red); }
.scenario-range-labels .base { color: var(--amber); text-align: center; flex: 1; }
.scenario-range-labels .bull { color: var(--green); }
.scenario-current-label {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    text-align: center;
    margin-top: var(--space-1);
}

/* Custom Scenarios Form */
.scenario-edit-toggle {
  margin-top: var(--space-3);
  padding: 8px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--amber);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.scenario-edit-toggle:hover {
  background: var(--amber-bg);
  border-color: var(--amber);
}

.scenario-edit-form {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-md);
}

.scenario-edit-header {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.scenario-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.scenario-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-tab:hover {
  color: var(--text);
}

.scenario-tab.active {
  color: var(--text-bright);
  border-bottom-color: var(--amber);
}

.scenario-tab.bear.active { border-bottom-color: var(--red); color: var(--red); }
.scenario-tab.base.active { border-bottom-color: var(--amber); color: var(--amber); }
.scenario-tab.bull.active { border-bottom-color: var(--green); color: var(--green); }

.scenario-tab-content {
  display: none;
}

.scenario-tab-content.active {
  display: block;
}

.scenario-input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-3);
}

.scenario-input-group label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.scenario-input-group input,
.scenario-input-group select {
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: var(--fs-base);
  transition: border-color 0.2s;
}

.scenario-input-group input:focus,
.scenario-input-group select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-bg);
}

.scenario-details {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.scenario-summary {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-inset);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scenario-summary:hover {
  color: var(--text);
}

/* Peer Comparison Table */
.peer-comparison-container {
  margin-top: 0;
}

.peer-comparison-header {
  font-family: var(--mono);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.peer-comparison-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
}

.peer-comparison-table thead {
  background: var(--bg-inset);
  border-bottom: 2px solid var(--accent-dim);
}

.peer-comparison-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: default;
  transition: all 0.2s;
  user-select: none;
}

.peer-comparison-table th:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.peer-comparison-table th.sortable::after {
  content: ' ⇅';
  opacity: 0.3;
  font-size: 10px;
}

.peer-comparison-table th.sorted-asc::after {
  content: ' ▲';
  opacity: 1;
  color: var(--accent);
}

.peer-comparison-table th.sorted-desc::after {
  content: ' ▼';
  opacity: 1;
  color: var(--accent);
}

.peer-comparison-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.peer-comparison-table tbody tr:hover {
  background: var(--bg-inset);
}

.peer-comparison-table tbody tr.highlight {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
}

.peer-comparison-table td {
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.peer-comparison-table td.ticker {
  font-weight: var(--fw-bold);
  color: var(--text-bright);
  font-size: var(--fs-base);
}

.peer-comparison-table td.positive {
  color: var(--green);
}

.peer-comparison-table td.negative {
  color: var(--red);
}

.peer-comparison-table td.neutral {
  color: var(--text-dim);
}

.peer-comparison-loading {
  padding: var(--space-4);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
}

.peer-comparison-error {
  padding: var(--space-3);
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  color: var(--red);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.peer-comparison-empty {
  padding: var(--space-4);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.peer-input-group {
  margin-bottom: var(--space-3);
}

.peer-input-group label {
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.peer-input-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: var(--fs-base);
  transition: border-color 0.2s;
}

.peer-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.peer-input-hint {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-family: var(--mono);
}

@media (max-width: 768px) {
  .peer-comparison-table {
    font-size: var(--fs-xs);
  }

  .peer-comparison-table th,
  .peer-comparison-table td {
    padding: 8px 10px;
  }
}

/* Risk Score Card — agregat ryzyka 0-100 */
.risk-score-card {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}
.risk-score-card.low { border-left-color: var(--green); }
.risk-score-card.medium { border-left-color: var(--amber); }
.risk-score-card.high { border-left-color: var(--red); }
.risk-score-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-3);
}
.risk-score-label {
    font-size: var(--fs-sm);
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}
.risk-score-value {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
}
.risk-score-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.risk-factor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-sm);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.risk-factor-row:last-child { border-bottom: none; }
.risk-factor-name {
    font-family: var(--mono);
    color: var(--text-dim);
}
.risk-factor-value {
    font-family: var(--mono);
    font-weight: var(--fw-bold);
    color: var(--text-bright);
}

/* Reason Section — Top 3 positive + Top 3 negative */
.reason-section {
    margin-bottom: var(--space-4);
}
.reason-section-title {
    margin-bottom: var(--space-2);
    color: var(--text-dim);
    font: var(--fw-bold) var(--fs-xs)/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
}
.reason-section-title.positive { color: var(--green); }
.reason-section-title.negative { color: var(--red); }
.reason-item .reason-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-dim);
}
.reason-item .reason-dot.pos { background: var(--green); }
.reason-item .reason-dot.neg { background: var(--red); }
.reason-content { min-width: 0; flex: 1; }
.reason-header { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.reason-item.pos { border-left-color: var(--green); }
.reason-item.neg { border-left-color: var(--red); }
.reason-section-collapsed { display: none; }
.reason-toggle-btn {
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-inset);
    color: var(--text-dim);
    font: var(--fw-medium) var(--fs-sm)/1 var(--mono);
    cursor: pointer;
}
.reason-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
.reason-section-header {
    font-size: var(--fs-sm);
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.reason-section-header .icon {
    font-size: var(--fs-md);
}
.reason-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.reason-item {
    display: flex;
    align-items: start;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.reason-item.positive {
    border-left-color: var(--green);
    background: linear-gradient(90deg, var(--green-bg) 0%, var(--bg-inset) 30%);
}
.reason-item.negative {
    border-left-color: var(--red);
    background: linear-gradient(90deg, var(--red-bg) 0%, var(--bg-inset) 30%);
}
.reason-item .icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.reason-text {
    color: var(--text);
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quick-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
        padding: var(--space-3);
    }
    .scenario-range-labels {
        font-size: var(--fs-xs);
    }
    .risk-score-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 479px) {
    .quick-stats-row {
        grid-template-columns: 1fr;
        padding: var(--space-2);
    }
    .hero-body {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .hero-price-strip {
        grid-template-columns: 1fr;
    }
}

/* ──────────────────────────────────────────────
   UI POLISH — entrance animation + hover motion
   ────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.decision-card,
.report-thesis,
.report-summary-grid,
.report-chart-section,
.report-main > .collapsible {
    animation: fadeInUp 0.45s ease both;
}
.report-main > .collapsible:nth-of-type(1) { animation-delay: 0.03s; }
.report-main > .collapsible:nth-of-type(2) { animation-delay: 0.06s; }
.report-main > .collapsible:nth-of-type(3) { animation-delay: 0.09s; }
.report-main > .collapsible:nth-of-type(4) { animation-delay: 0.12s; }
.report-main > .collapsible:nth-of-type(n+5) { animation-delay: 0.15s; }

.metric-v2,
.why-item,
.data-row {
    transition: background var(--transition-base), transform var(--transition-base);
}
.why-item:hover { background: var(--bg-inset); transform: translateX(2px); }

.collapsible-header,
.report-main > .collapsible .collapsible-header {
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.action-btn,
.chart-tab {
    transition: color var(--transition-base), background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.action-btn:hover { transform: translateY(-1px); }

/* ──────────────────────────────────────────────
   TOP BAR INTEGRATED NAVIGATION
   ────────────────────────────────────────────── */
.top-bar .nav-tabs {
  flex: 1;
  min-width: 0;
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
  border-bottom: none;
  overflow-x: auto;
  scrollbar-width: none;
  gap: var(--space-1);
  align-items: center;
}
.top-bar .nav-tabs::-webkit-scrollbar { display: none; }
.top-bar .nav-tab {
  padding: 8px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
}
.top-bar .nav-tab svg { width: 14px; height: 14px; }
.top-bar .nav-tab:hover { color: var(--text-bright); background: var(--bg-hover); }
.top-bar .nav-tab.active {
  color: var(--text-bright);
  background: var(--bg-elevated);
  border: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}

@media (max-width: 1200px) {
  .top-bar .nav-tab { padding: 6px 8px; }
  .top-bar .nav-tab span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .decision-card,
    .report-thesis,
    .report-summary-grid,
    .report-chart-section,
    .report-main > .collapsible {
        animation: none;
    }
    .why-item:hover,
    .action-btn:hover {
        transform: none;
    }
}
