/* ---- Qualtrim-style price hero ---- */
.ticker-hero {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-bottom: 0.5rem;
}

.ticker-hero-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ticker-hero-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.ticker-hero-change {
  font-size: 0.8rem;
  font-weight: 600;
  align-self: center;
}

.ticker-hero-exchange {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  align-self: center;
}

/* ---- Ticker price chart (over time) ---- */
.ticker-pricechart {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ticker-pricechart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ticker-pricechart-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.ticker-pricechart-change {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-transform: none;
}

.ticker-pricechart-periods {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 2px;
}

.ticker-period-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 6px;
}

.ticker-period-btn:hover { color: var(--text); }

.ticker-period-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ticker-pricechart-canvas {
  position: relative;
  height: 180px;
  width: 100%;
}

.ticker-keyfacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  column-gap: 3rem;
  row-gap: 0.7rem;
  justify-content: start;
}

.keyfact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.keyfact-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.keyfact-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.keyfact-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.keyfact-pill-pos { background: var(--green-soft); color: var(--green); }
.keyfact-pill-neutral { background: var(--surface2); color: var(--muted); }
.keyfact-pill-neg { background: var(--red-soft); color: var(--red); }

.ticker-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.ticker-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 280px));
  column-gap: 3rem;
  row-gap: 0.6rem;
  justify-content: start;
}

/* ---- Collapsible Details block ---- */
.ticker-details-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.ticker-details-toggle:hover { color: var(--text); }

.ticker-details-caret {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.7rem;
}

.ticker-details.is-open .ticker-details-caret {
  transform: rotate(90deg);
}

.ticker-details-body {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.ticker-details.is-open .ticker-details-body {
  display: flex;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.metric-tip {
  font-size: 0.55rem;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  cursor: help;
  flex-shrink: 0;
}

.metric-tip::after,
.metric-tip::before {
  display: none;
}

.float-tooltip {
  position: fixed;
  display: none;
  background: #1a1a2e;
  color: #f0f0f0;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  max-width: 280px;
  white-space: pre-line;
  text-align: left;
  pointer-events: auto;
  user-select: text;
  cursor: text;
  z-index: 999999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.metric-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* ---- 5-Year Valuation (Qualtrim-style track + dot + verdict pill) ---- */
.ticker-valuation-section {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.valuation-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.valuation-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.valuation-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.valuation-verdict {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 8px;
}

.valuation-verdict-pos { background: var(--green-soft); color: var(--green); }
.valuation-verdict-neutral { background: var(--surface2); color: var(--muted); }
.valuation-verdict-neg { background: var(--red-soft); color: var(--red); }

.valuation-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
}

.valuation-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: help;
}

.valuation-dot-pos { background: var(--green); }
.valuation-dot-neutral { background: var(--muted); }
.valuation-dot-neg { background: var(--red); }

.valuation-range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.95rem;
  color: var(--muted);
}

.valuation-current {
  font-weight: 700;
  color: var(--text);
}

/* Loading placeholder while the valuation fetch is in flight */
.valuation-loader {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  color: var(--muted);
}

.valuation-loader .chart-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.valuation-loader-label {
  font-size: 0.85rem;
}

/* --- Earnings section (annual EPS bars + GAAP vs normalized income) --- */
.eps-caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.15rem 0 0.35rem;
}

.eps-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 100px;
  padding: 0.3rem 0 0;
}

.eps-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.eps-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.eps-bar {
  width: 60%;
  max-width: 26px;
  border-radius: 3px 3px 0 0;
  cursor: help;
  transition: opacity 0.15s;
}
.eps-bar:hover { opacity: 0.8; }
.eps-bar-pos { background: var(--green); }
.eps-bar-neg { background: var(--red); border-radius: 0 0 3px 3px; }

.eps-bar-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 3px;
  white-space: nowrap;
}

.eps-bar-yoy {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  min-height: 0.75rem;
}

.eps-bar-year {
  font-size: 0.7rem;
  color: var(--muted);
}

.income-compare {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.income-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.income-compare-label {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.income-compare-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.income-compare-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.3;
}

/* ⚠ flag beside a metric value that carries a caveat */
.metric-warn {
  color: var(--amber, #d9822b);
  cursor: help;
  font-size: 0.85em;
}

.ticker-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 3px;
}

.ticker-logo-modal {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 4px;
}

.ticker-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.3px;
  vertical-align: middle;
}
.ticker-logo-fallback.ticker-logo {
  width: 24px;
  height: 24px;
  margin-right: 6px;
}
.ticker-logo-fallback.ticker-logo-modal {
  width: 28px;
  height: 28px;
  margin-right: 10px;
  font-size: 0.65rem;
}
.ticker-logo-fallback.wl-item-logo {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}
.ticker-logo-fallback.wl-detail-logo {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

