/* Code & Vision Research — sell-side-style research layer on top of the core site system */

.research-hero {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  background: linear-gradient(160deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
  border-bottom: 1px solid var(--color-border);
}

.research-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 1rem;
}

/* Ticker / cover bar */
.ticker-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  align-items: center;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.5rem;
  margin: 1.5rem 0 2rem;
  font-family: var(--font-body);
}

.ticker-bar .ticker-symbol {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-text-primary);
}

.ticker-bar .ticker-item {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.ticker-bar .ticker-item strong {
  color: var(--color-text-primary);
}

.view-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
}
.view-badge.buy { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.view-badge.hold { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.view-badge.sell { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.view-badge.watchlist { background: rgba(11, 111, 242, 0.12); color: var(--color-accent-dark); }

/* Decision grid */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
}
.decision-grid > div {
  background: var(--color-bg-primary);
  padding: 1.25rem 1.4rem;
}
.decision-grid h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.decision-grid p { font-size: 0.92rem; line-height: 1.6; }

/* Scenario cards: bull / base / bear */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.scenario-card {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-border);
}
.scenario-card.bull { border-top-color: #16a34a; }
.scenario-card.base { border-top-color: var(--color-accent); }
.scenario-card.bear { border-top-color: #dc2626; }
.scenario-card h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.scenario-card.bull h4 { color: #16a34a; }
.scenario-card.base h4 { color: var(--color-accent); }
.scenario-card.bear h4 { color: #dc2626; }
.scenario-card p { font-size: 0.9rem; line-height: 1.65; }

/* Financial tables */
.fin-table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table.fin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 640px; }
table.fin-table th, table.fin-table td { padding: 0.6rem 0.9rem; text-align: right; white-space: nowrap; }
table.fin-table th:first-child, table.fin-table td:first-child { text-align: left; white-space: normal; }
table.fin-table thead th { background: var(--color-bg-tertiary); color: var(--color-text-primary); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; }
table.fin-table tbody tr:nth-child(even) { background: var(--color-bg-secondary); }
table.fin-table tbody tr.total-row td { font-weight: 700; border-top: 1.5px solid var(--color-border); color: var(--color-text-primary); }
table.fin-table td { color: var(--color-text-secondary); }

/* Valuation summary strip */
.valuation-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
}
.valuation-strip > div { background: var(--color-bg-primary); padding: 1.2rem; text-align: center; }
.valuation-strip .v-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-tertiary); margin-bottom: 0.4rem; }
.valuation-strip .v-value { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-text-primary); }
.valuation-strip .v-value.accent { color: var(--color-accent); }
.valuation-strip .v-value.positive { color: #16a34a; }

/* Risk / question lists */
.research-list { display: flex; flex-direction: column; gap: 0.65rem; margin: 1rem 0; }
.research-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; line-height: 1.6; }
.research-list li::before { content: "—"; color: var(--color-accent); flex-shrink: 0; font-weight: 700; }

/* Disclaimer banner */
.disclaimer-banner {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 1.5rem 0;
}
.disclaimer-banner strong { color: var(--color-text-primary); }

.disclaimer-footer-strip {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #b91c1c;
  padding: 0.9rem;
  border-top: 1px solid var(--color-border);
}

/* Coverage / report cards on the hub */
.coverage-card {
  display: block;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: border-color var(--transition-fast, 0.2s ease), transform var(--transition-fast, 0.2s ease);
}
.coverage-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.coverage-card .cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.coverage-card .cc-ticker { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.coverage-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.coverage-card p { font-size: 0.88rem; line-height: 1.6; }
.coverage-card .cc-meta { margin-top: 1rem; font-size: 0.72rem; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }

/* Dark mode overrides */
html.dark .decision-grid,
html.dark .valuation-strip { background: var(--color-border); }
html.dark .decision-grid > div,
html.dark .valuation-strip > div,
html.dark .ticker-bar,
html.dark .coverage-card { background: var(--color-bg-secondary); }
html.dark table.fin-table thead th { background: var(--color-bg-tertiary); }
html.dark table.fin-table tbody tr:nth-child(even) { background: var(--color-bg-secondary); }
html.dark .disclaimer-banner { background: var(--color-bg-secondary); }
html.dark .view-badge.buy { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
html.dark .view-badge.hold { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
html.dark .view-badge.sell { background: rgba(248, 113, 113, 0.18); color: #f87171; }
html.dark .view-badge.watchlist { background: rgba(11, 111, 242, 0.2); color: var(--color-accent-light); }

/* Gated PDF download component */
.gated-download {
  background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-tertiary) 100%);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 2.5rem 0;
}
.gd-form { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1.25rem; max-width: 420px; }
.gd-form input[type="email"] {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.gd-error { font-size: 0.8rem; color: #b91c1c; }
.gd-success p { font-size: 0.95rem; }
.gd-success a { color: var(--color-accent); font-weight: 700; }

/* Live price badge */
.live-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
}
.live-price-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22,163,74,0.5);
  animation: live-pulse 1.8s infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.live-price-badge .lp-price { font-weight: 700; color: var(--color-text-primary); }
.live-price-badge .lp-change.up { color: #16a34a; }
.live-price-badge .lp-change.down { color: #dc2626; }

/* Interactive DCF calculator */
.calc-panel {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 760px) { .calc-panel { grid-template-columns: 1fr; } }
.calc-control { margin-bottom: 1.4rem; }
.calc-control label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; color: var(--color-text-primary); margin-bottom: 0.4rem; }
.calc-control label .calc-val { color: var(--color-accent); font-family: var(--font-heading); }
.calc-control input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.calc-result {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.calc-result .cr-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-tertiary); }
.calc-result .cr-value { font-family: var(--font-heading); font-size: 2.6rem; color: var(--color-accent); line-height: 1.1; margin: 0.3rem 0; }
.calc-result .cr-sub { font-size: 0.85rem; color: var(--color-text-secondary); }
.calc-reset { font-size: 0.78rem; color: var(--color-accent); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0; }

html.dark .gated-download { background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%); }
html.dark .gd-form input[type="email"] { background: var(--color-bg-secondary); }
html.dark .live-price-badge,
html.dark .calc-result { background: var(--color-bg-secondary); }

/* Appendix reference links need visible affordance (base <a> has color:inherit, no underline) */
.research-list a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.research-list a:hover { color: var(--color-accent-dark); }
