/* prediction-shell.css — Prediction chrome (shared shell) — Phase 1
 * Extracted (copied, not moved) from v1's prediction.css. v1 keeps its own
 * inline copy of every rule below — this file is v2's independent stylesheet.
 * Uses --color-* tokens from main.css. Classes prefixed .pred-*
 */

/* ── Page shell override (scoped to prediction page only) ─────────────────
   .page-content is shared across many pages (main.css); do not edit that
   rule. Here we zero out only the top padding for this page's <main>,
   identified by the extra .pred-page-content class, so content sits
   closer to the top nav. Left/right/bottom padding stay untouched. */

.page-content.pred-page-content {
  padding-top: 0;
}

/* ── Layout ─────────────────────────────────────────────────────────────
   .pred-layout is the two-column grid (main + sidebar). Same composition
   as v1: breadcrumb + ticker header live INSIDE .pred-main (left column),
   not full-width above the grid — so the sidebar's top edge aligns with
   the breadcrumb. Mirrors v1's max-width/gap/padding exactly. */

.pred-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem 2rem;
}

.pred-main { min-width: 0; }

.pred-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

@media (max-width: 768px) {
  .pred-layout { grid-template-columns: 1fr; }
  .pred-sidebar { position: static; }
}

/* ── Breadcrumb — quiet one-liner above the page header (logo/ticker row) */

.pred-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--color-muted, #888888);
  margin-bottom: 0.6rem;
}

.pred-breadcrumb a {
  color: var(--color-muted, #888888);
  text-decoration: none;
}

.pred-breadcrumb a:hover {
  color: var(--color-text, #f0f0f0);
  text-decoration: underline;
}

.pred-breadcrumb-sep {
  color: var(--color-muted, #888888);
}

.pred-breadcrumb-current {
  color: var(--color-muted, #888888);
}

/* ── Ticker header (logo / ticker label / price pill / feed-status) ────── */

.pred-page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.pred-logo,
.pred-logo-chip {
  align-self: center;
  flex-shrink: 0;
}

.pred-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-surface, #111111);
  border: 1px solid var(--color-border, #333);
}

.pred-logo-chip {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface, #111111);
  border: 1.5px solid var(--color-brand, #D5477F);
  color: var(--color-brand, #D5477F);
  font-weight: 800;
  font-size: 1rem;
}

.pred-ticker-label {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text, #f0f0f0);
}

.pred-price-label {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  color: var(--color-text, #f0f0f0);
}

/* ── Price change pill (header) ──────────────────────────────
   --up/--dn/--flat share the same green/red/grey used elsewhere
   on the page (pred-score--bull / pred-score--bear treatment). */

.pred-chg-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  line-height: 1.4;
  white-space: nowrap;
  /* Baseline-align (not center) so the pill's text sits on the same
     text baseline as .pred-price-label instead of floating above it. */
  align-self: baseline;
}

.pred-chg-pill--up {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pred-chg-pill--down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.pred-chg-pill--flat {
  color: #888;
  background: rgba(136, 136, 136, 0.12);
  border: 1px solid rgba(136, 136, 136, 0.3);
}

/* ── "as of" snapshot timestamp ──────────────────────────────
   Sits under the company metrics strip; muted, small, matches
   the hero/subtitle treatment used elsewhere on the page. */

.pred-asof-line {
  margin-top: -0.9rem;
  margin-bottom: 1.5rem;
  font-size: 0.72rem;
  color: var(--color-muted, #888888);
  letter-spacing: 0.01em;
}

/* ── Company detail: subtitle + metrics strip ───────────────── */

.pred-company-detail {
  margin-top: -0.6rem;
  margin-bottom: 1.5rem;
}

.pred-company-subtitle {
  font-size: 0.9rem;
  color: var(--color-muted, #888888);
  line-height: 1.5;
}

.pred-company-metrics {
  margin-top: 0.15rem;
  font-family: 'SF Mono', 'Roboto Mono', Consolas, monospace;
  font-size: 0.78rem;
  color: var(--color-muted, #888888);
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.pred-company-dot {
  color: var(--color-brand, #D5477F);
  margin: 0 0.15rem;
  opacity: 0.7;
}

/* ── Sidebar (sticky TOC / rail) ────────────────────────────── */

.pred-sidebar-section { margin-bottom: 1.5rem; }

.pred-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted, #888888);
  margin-bottom: 0.5rem;
}

.pred-toc-link {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--color-muted, #888888);
  text-decoration: none;
  transition: color 0.2s;
}

.pred-toc-link:hover { color: var(--color-text, #f0f0f0); }

.pred-sidebar-meta {
  font-size: 0.75rem;
  color: var(--color-muted, #888888);
  line-height: 1.6;
}

/* ── Search Ticker (right rail) ────────────────────────────── */

.pred-ts { position: relative; width: 100%; }

.pred-ts__input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  background: var(--color-bg, #0a0a0a);
  border: 1px solid var(--color-border, #2a2a2a);
  border-radius: 8px;
  transition: border-color 0.15s;
}

.pred-ts__input-wrap:focus-within {
  border-color: var(--color-brand, #D5477F);
  box-shadow: 0 0 0 2px rgba(213, 71, 127, 0.18);
}

.pred-ts__icon {
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.6;
  flex: 0 0 auto;
}

.pred-ts__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text, #f0f0f0);
  font-size: 0.8rem;
  font-family: inherit;
}

.pred-ts__input::placeholder { color: var(--color-muted, #888888); }

.pred-ts__clear {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--color-muted, #888888);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pred-ts__clear:hover { color: var(--color-text, #f0f0f0); }

.pred-ts__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--color-bg, #0a0a0a);
  border: 1px solid var(--color-border, #2a2a2a);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  max-height: 280px;
  overflow-y: auto;
  padding: 0.35rem;
}

.pred-ts__row {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.pred-ts__row + .pred-ts__row { margin-top: 2px; }

.pred-ts__row:hover,
.pred-ts__row--active {
  background: rgba(213, 71, 127, 0.12);
}

.pred-ts__row-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.pred-ts__symbol {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--color-brand, #D5477F);
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.pred-ts__name {
  font-weight: 600;
  color: var(--color-text, #f0f0f0);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.pred-ts__meta {
  font-size: 0.68rem;
  color: var(--color-muted, #888888);
  margin-top: 0.15rem;
}

.pred-ts__empty {
  padding: 0.6rem 0.5rem;
  font-size: 0.78rem;
  color: var(--color-muted, #888888);
}

/* ── Debug panel ─────────────────────────────────────────────────────────── */

.pred-debug-panel {
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border, #222);
  padding-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--color-muted, #888);
}

.pred-debug-panel__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted, #888);
  margin-bottom: 0.45rem;
  opacity: 0.6;
}

.pred-debug-rows {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin-bottom: 0.55rem;
}

.pred-debug-row {
  display: grid;
  grid-template-columns: 2rem 6rem 1fr;
  gap: 0.4rem;
  align-items: baseline;
}

.pred-debug-lid {
  font-weight: 700;
  color: var(--color-muted, #888);
  opacity: 0.7;
}

.pred-debug-src {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.67rem;
  background: var(--color-bg, #0a0a0a);
  border: 1px solid var(--color-border, #222);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--color-muted, #888);
  white-space: nowrap;
}

.pred-debug-desc {
  color: var(--color-muted, #888);
  opacity: 0.75;
}

.pred-debug-meta {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border, #222);
  opacity: 0.7;
}

.pred-debug-meta span strong {
  color: var(--color-text, #f0f0f0);
  font-weight: 600;
  opacity: 0.8;
}
