/* ═══════════════════════════════════════════════════════
   Report Panel — Sidebar (rpt-)
   ═══════════════════════════════════════════════════════ */

.rpt-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 10px 0;
  font-family: var(--font-ui);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ── AI Header ── */
.rpt-ai-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid rgba(167,139,250,.22);
  flex-shrink: 0;
  background:
    linear-gradient(135deg, rgba(88,28,135,.45) 0%, rgba(109,40,217,.28) 45%, rgba(30,64,175,.18) 100%),
    radial-gradient(120% 140% at 0% 0%, rgba(196,181,253,.15), transparent 60%);
  position: relative;
}
.rpt-ai-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.6), transparent);
}
.rpt-ai-stars { width: 28px; height: 28px; flex-shrink: 0; }
.rpt-ai-stars .rpt-star-big {
  fill: #f3e8ff; transform-origin: center; transform-box: fill-box;
  animation: rptSparkleDance 5s ease-in-out infinite;
}
.rpt-ai-stars .rpt-star-small {
  fill: #f3e8ff; transform-origin: center; transform-box: fill-box;
  animation: rptSparkleDance 5s ease-in-out infinite .5s;
}
@keyframes rptSparkleDance {
  0%,100% { transform: rotate(-18deg) scale(1); filter: drop-shadow(0 0 4px rgba(216,180,254,.8)); }
  50%     { transform: rotate(18deg) scale(1.35); filter: drop-shadow(0 0 10px rgba(216,180,254,1)); }
}
.rpt-ai-title {
  font-family: var(--font-ui); font-size: 1.04rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(135deg, #d8b4fe, #a78bfa 40%, #7dd3fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; white-space: nowrap;
  line-height: 1.15;
}
.rpt-ai-sub {
  font-family: var(--font-ui); font-size: .94rem;
  color: rgba(216,180,254,.75); white-space: nowrap;
  margin-top: 2px; letter-spacing: .02em;
}

/* Main title — visible heading inside the report card */
.rpt-main-title {
  font-family: var(--font-ui);
  font-size: 1.37rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  letter-spacing: -.01em;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--border);
}
.rpt-main-title-sym {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: rgba(167,139,250,.16);
  color: #c4b5fd;
  font-size: 1.12rem;
  font-weight: 700;
  vertical-align: 2px;
  letter-spacing: .03em;
}

/* ── Header ── */
.rpt-header {
  padding: 14px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rpt-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.rpt-price {
  font-size: 1.47rem;
  font-weight: 700;
  color: var(--text-bright);
}
.rpt-change {
  font-size: 1.07rem;
  font-weight: 600;
}
.rpt-change.pos { color: var(--green); }
.rpt-change.neg { color: var(--red); }

/* ── Sections (aligned with stm-ins gold standard) ── */
.rpt-section {
  padding: 16px 18px 20px;
  border-bottom: 1px solid var(--border);
}
.rpt-section:last-child { border-bottom: none; }

.rpt-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-ui);
  font-size: 1.395rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: -.01em;
  text-transform: none;
}
.rpt-section-num {
  font-family: var(--font-ui);
  font-size: 1.395rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: -.01em;
  min-width: auto;
  opacity: .55;
}

.rpt-text {
  font-family: var(--font-ui);
  font-size: .94rem;
  line-height: 1.65;
  color: var(--text);
}
.rpt-text strong {
  color: var(--text-bright);
  font-weight: 700;
}
.rpt-text + .rpt-text { margin-top: 10px; }

/* Yearly narrative inlined into the Panoramica section — same typography
   and rhythm as the surrounding paragraphs, no border/background box. */
.rpt-yearly-narr { display: contents; }
.rpt-yearly-narr p { margin: 10px 0 0; }
.rpt-yearly-narr .yr-up { color: var(--green, #26d97f); font-weight: 700; }
.rpt-yearly-narr .yr-dn { color: var(--red, #f0506e); font-weight: 700; }

/* Yearly Predictors flowing narrative — continues the AI report discourse
   (no title/subtitle, no separator). Paragraphs flow naturally with the
   surrounding Panoramica text. */
.rpt-yearly-flowing { display: contents; }
.rpt-yearly-flowing p { margin: 10px 0 0; }
.rpt-yearly-flowing b { font-weight: 700; }
.rpt-yearly-flowing .yr-up { color: var(--green, #26d97f); font-weight: 700; }
.rpt-yearly-flowing .yr-dn { color: var(--red, #f0506e); font-weight: 700; }

/* Inline waiting spinner inside section 1 while the yearly fetch is still
   in flight (sec 1 prose typed, yearly html not yet here). Keeps the user
   aware that something is loading instead of staring at a frozen panel. */
.rpt-yearly-waiting { margin: 12px 0 4px; }
.rpt-yearly-waiting .aiTt-wrap { min-height: 120px; padding: 16px 12px; }

/* Generic between-sections waiting spinner — shown at the end of .rpt-wrap
   when the cascade is blocked waiting for the next section's data. */
.rpt-cascade-waiting { padding: 16px 18px 20px; border-bottom: 1px solid var(--border); }
.rpt-cascade-waiting .aiTt-wrap { min-height: 120px; padding: 16px 12px; }

/* Sub-header inside section text — separates thematic blocks */
.rpt-subhead {
  display: block;
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.rpt-text > .rpt-subhead:first-child { margin-top: 4px; }

/* ── Verdict badge ── */
.rpt-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1;
}
.rpt-verdict.bullish {
  background: var(--green-subtle);
  color: var(--green);
  border: 1px solid rgba(38,217,127,.15);
}
.rpt-verdict.neutral {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid rgba(255,184,51,.15);
}
.rpt-verdict.bearish {
  background: var(--red-subtle);
  color: var(--red);
  border: 1px solid rgba(240,80,110,.15);
}

/* ── Final verdict ── */
.rpt-final {
  padding: 16px 18px 18px;
  background: var(--surface-veil);
  border-top: 1px solid var(--border);
}
.rpt-final-title {
  font-family: var(--font-ui);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.rpt-final-text {
  font-family: var(--font-ui);
  font-size: .94rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
}
.rpt-score-grid {
  display: grid;
  /* Each row is exactly 2 children (label + val with emoji+text combined).
     Keep this in sync with rptBuildVerdict() in report.js. */
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: .96rem;
  align-items: center;
}
.rpt-score-label {
  color: var(--text-dim);
}
.rpt-score-dot {
  text-align: center;
  font-size: .9rem;
  line-height: 1;
}
.rpt-score-text {
  font-weight: 600;
  text-align: left;
}
.rpt-score-text.pos { color: var(--green); }
.rpt-score-text.neu { color: var(--amber); }
.rpt-score-text.neg { color: var(--red); }
/* Legacy single-cell variant (still used by .rpt-score-overall). */
.rpt-score-val {
  font-weight: 600;
  text-align: right;
}
.rpt-score-val.pos { color: var(--green); }
.rpt-score-val.neu { color: var(--amber); }
.rpt-score-val.neg { color: var(--red); }
.rpt-score-val.rpt-score-pending,
.rpt-score-text.rpt-score-pending,
.rpt-score-dot.rpt-score-pending,
.rpt-score-pending {
  color: var(--text-muted);
  font-weight: 500;
  opacity: .75;
}
.rpt-final.rpt-verdict-pending .rpt-score-overall .rpt-score-val {
  color: var(--text-muted);
  font-weight: 600;
}
.rpt-score-overall {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 1.04rem;
  font-weight: 700;
}

/* ── Loading state ── orbiting-stars spinner (compact variant of aiTt-wrap) */
.rpt-loading-section { padding: 8px 0 4px; }
.rpt-loading-section .aiTt-wrap {
  min-height: 120px;
  padding: 14px 0;
  gap: 10px;
}
.rpt-loading-section .aiTt-stage {
  width: 80px;
  height: 80px;
}
.rpt-loading-section .aiTt-big {
  width: 34px;
  height: 34px;
}
.rpt-loading-section .aiTt-orbit-a svg { width: 14px; height: 14px; margin-left: -7px; }
.rpt-loading-section .aiTt-orbit-b svg { width: 12px; height: 12px; margin-left: -6px; bottom: 3px; }
.rpt-loading-section .aiTt-orbit-c svg { width: 10px; height: 10px; margin-top: -5px; }
.rpt-loading-section .aiTt-label { font-size: .85rem; }

/* ═══════════════════════════════════════════════════════
   Visual primitives (rpt-viz-*)
   Inline mini-charts/widgets that accompany section text.
   ═══════════════════════════════════════════════════════ */
.rpt-viz {
  margin: 4px 0 14px;
  padding: 10px 12px;
  background: var(--surface-veil);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
}
.rpt-viz svg { display: block; width: 100%; height: auto; }

/* ── 52-week range scale ── */
.rpt-viz-52w svg { height: 46px; }
.rpt-viz-52w-labels {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .85rem; color: var(--text-muted);
  margin-top: 2px;
}
.rpt-viz-52w-low, .rpt-viz-52w-high { color: var(--text); font-weight: 600; }
.rpt-viz-52w-mid {
  color: var(--text-bright); font-weight: 600;
  font-size: .82rem; opacity: .85;
}

/* ── Horizon performance grid (slider with arrows) ── */
.rpt-viz-horizons { padding: 12px 12px 10px; }
.rpt-viz-hz-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.rpt-viz-hz-wrap {
  position: relative;
  padding: 0 4px;
}
.rpt-viz-hz-grid {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rpt-viz-hz-grid::-webkit-scrollbar { display: none; }
.rpt-viz-hz-cell {
  flex: 1 0 110px;
  scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 6px; text-align: center;
}
.rpt-viz-hz-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-bright);
  font-size: 1.1rem; font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: background var(--ease, .15s ease);
  padding: 0;
}
.rpt-viz-hz-arrow:hover { background: var(--surface-raised, rgba(255,255,255,.08)); }
.rpt-viz-hz-arrow.prev { left: -8px; }
.rpt-viz-hz-arrow.next { right: -8px; }
/* Hide arrows when ≤4 horizons (everything fits without scroll) */
.rpt-viz-horizons[data-cols="1"] .rpt-viz-hz-arrow,
.rpt-viz-horizons[data-cols="2"] .rpt-viz-hz-arrow,
.rpt-viz-horizons[data-cols="3"] .rpt-viz-hz-arrow,
.rpt-viz-horizons[data-cols="4"] .rpt-viz-hz-arrow { display: none; }
.rpt-viz-hz-lbl {
  font-size: .82rem; color: var(--text-muted); font-weight: 600;
  margin-bottom: 4px;
}
.rpt-viz-hz-val {
  font-size: 1.05rem; font-weight: 700; color: var(--text-bright);
  line-height: 1.2;
}
.rpt-viz-hz-pct {
  font-size: .9rem; font-weight: 700; margin-top: 2px;
}
.rpt-viz-hz-pct.pos { color: var(--green); }
.rpt-viz-hz-pct.neg { color: var(--red); }

/* ── MA ladder ── */
.rpt-viz-ma-title,
.rpt-viz-fwd-title,
.rpt-viz-regime-title,
.rpt-viz-dd-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.rpt-viz-ma-row {
  display: grid; grid-template-columns: 1fr 80px 70px;
  align-items: center; gap: 10px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: .94rem;
  margin-bottom: 2px;
}
.rpt-viz-ma-row.is-price {
  background: rgba(167,139,250,.14);
  border: 1px solid rgba(167,139,250,.28);
}
.rpt-viz-ma-row.is-price .rpt-viz-ma-label,
.rpt-viz-ma-row.is-price .rpt-viz-ma-side {
  color: var(--text-bright); font-weight: 700;
}
.rpt-viz-ma-label { color: var(--text); font-weight: 600; }
.rpt-viz-ma-side {
  text-align: center; font-weight: 700; font-size: .82rem;
  letter-spacing: .06em;
  padding: 3px 6px; border-radius: 4px;
}
.rpt-viz-ma-side.pos { color: var(--green); background: rgba(38,217,127,.12); }
.rpt-viz-ma-side.neg { color: var(--red);   background: rgba(240,80,110,.12); }
.rpt-viz-ma-dist { text-align: right; font-weight: 700; font-size: .9rem; }
.rpt-viz-ma-dist.pos { color: var(--green); }
.rpt-viz-ma-dist.neg { color: var(--red); }

/* ── Forward returns table (divergent mean bar) ── */
.rpt-viz-fwd-meta {
  font-size: .82rem; font-weight: 500; color: var(--text-dim);
  text-transform: none; letter-spacing: 0; margin-left: 6px;
}
.rpt-viz-fwd-head,
.rpt-viz-fwd-row {
  display: grid;
  grid-template-columns: 38px 1fr 60px 42px;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  font-size: .92rem;
}
.rpt-viz-fwd-head {
  font-size: .82rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.rpt-viz-fwd-h { color: var(--text); font-weight: 700; }
.rpt-viz-fwd-bar-lbl { color: var(--text-muted); font-weight: 600; }
.rpt-viz-fwd-mean { font-weight: 700; text-align: right; }
.rpt-viz-fwd-mean.pos { color: var(--green); }
.rpt-viz-fwd-mean.neg { color: var(--red); }
.rpt-viz-fwd-wr {
  text-align: right; font-weight: 700; color: var(--text-bright);
  font-size: .88rem;
}
/* Divergent bar centered on 0 */
.rpt-viz-fwd-bar {
  position: relative; height: 14px;
  background: rgba(255,255,255,.04);
  border-radius: 3px; overflow: hidden;
  display: block;
}
.rpt-viz-fwd-bar-axis {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1px;
  background: rgba(255,255,255,.25);
  z-index: 2;
}
.rpt-viz-fwd-bar-fill {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 2px;
  transition: width .4s ease;
}
.rpt-viz-fwd-bar-fill.pos { background: var(--green); }
.rpt-viz-fwd-bar-fill.neg { background: var(--red); }

/* ── Seasonality histogram (flat, adjacent bars, responsive via cqi) ── */
.rpt-viz-sn-title,
.rpt-viz-cyc-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.rpt-viz-seasonal { container-type: inline-size; }
.rpt-viz-sn {
  position: relative;
}
.rpt-viz-sn-chart {
  position: relative;
  height: 180px;
  margin-top: 18px;
}
.rpt-viz-sn-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.rpt-viz-sn-grid .gl {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,.05);
}
.rpt-viz-sn-grid .gl.zero { background: rgba(255,255,255,.22); }
.rpt-viz-sn-cols {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 0;
}
.rpt-viz-sn-col {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}
.rpt-viz-sn-bar {
  position: absolute;
  left: 0; right: 0;
  border: 0;
  border-radius: 0;
  box-shadow: inset -1px 0 0 rgba(0,0,0,.35);
  transition: height .4s ease;
}
.rpt-viz-sn-bar.pos { background: var(--green); bottom: 50%; }
.rpt-viz-sn-bar.neg { background: var(--red);   top: 50%; }
.rpt-viz-sn-col:last-child .rpt-viz-sn-bar { box-shadow: none; }
.rpt-viz-sn-col.is-current .rpt-viz-sn-bar.pos,
.rpt-viz-sn-col.is-current .rpt-viz-sn-bar.neg {
  background: var(--accent, #a78bfa);
}
.rpt-viz-sn-val {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: clamp(.62rem, .95cqi, .82rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.rpt-viz-sn-val.pos { color: var(--green); }
.rpt-viz-sn-val.neg { color: var(--red); }
.rpt-viz-sn-col.is-current .rpt-viz-sn-val { color: var(--accent, #a78bfa); }
.rpt-viz-sn-col.is-current::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  background: var(--accent, #a78bfa);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--card), 0 0 10px var(--accent, #a78bfa);
  z-index: 2;
}
.rpt-viz-sn-xlabels {
  display: flex;
  gap: 0;
  margin-top: 8px;
}
.rpt-viz-sn-xlabels span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: clamp(.62rem, 1cqi, .88rem);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rpt-viz-sn-xlabels span.cur {
  color: var(--accent, #a78bfa);
  font-weight: 800;
}

/* ── Presidential cycle: average YTD pattern chart ── */
.rpt-viz-cyc { container-type: inline-size; }
.rpt-viz-cy-pattern {
  margin-top: 6px;
}
.rpt-viz-cy-pat-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 10px;
}
.rpt-viz-cy-pat-title {
  font-size: clamp(.74rem, 1cqi, .86rem);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rpt-viz-cy-pat-sub {
  font-size: clamp(.74rem, 1cqi, .86rem);
  font-weight: 600;
  color: var(--text-dim, var(--text-muted));
}
.rpt-viz-cy-pat-sub b { font-weight: 800; color: var(--text-bright); }
.rpt-viz-cy-pat-sub b.pos { color: var(--green); }
.rpt-viz-cy-pat-sub b.neg { color: var(--red); }
.rpt-viz-cy-pat-sub b.accent { color: var(--accent, #a78bfa); }
.rpt-viz-cy-pat-wrap {
  position: relative;
  width: 100%;
  height: 160px;
}
.rpt-viz-cy-pat-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.rpt-viz-cy-pat-xlabels {
  display: flex;
  gap: 0;
  margin-top: 6px;
}
.rpt-viz-cy-pat-xlabels span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: clamp(.62rem, .95cqi, .82rem);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Narrative paragraphs */
.rpt-cyc-p {
  margin: 0 0 10px 0;
  line-height: 1.55;
}
.rpt-cyc-p:last-child { margin-bottom: 0; }
.rpt-cyc-p strong.pos { color: var(--green); }
.rpt-cyc-p strong.neg { color: var(--red); }


/* ── Volatility regime bar ── */
.rpt-viz-regime-title strong { color: var(--text-bright); }
.rpt-viz-regime-bar {
  position: relative; height: 24px; border-radius: 4px;
  overflow: hidden; margin: 8px 0;
}
.rpt-viz-regime-zone { position: absolute; top: 0; height: 100%; }
.rpt-viz-regime-needle {
  position: absolute; top: -4px; width: 4px; height: 32px;
  background: #7c3aed;
  border-radius: 2px; z-index: 5;
  transition: left .5s ease;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,.85),
    0 0 0 2.5px rgba(0,0,0,.45),
    0 0 8px rgba(124,58,237,.7);
}
.rpt-viz-regime-labels {
  display: flex; justify-content: space-between;
  font-size: .82rem; color: var(--text-muted); font-weight: 600;
}

/* ── Volatility percentiles multi-TF ── */
/* Style mirrored from .stm-pct-gauge-* in statistics.css for consistency */
.rpt-viz-pct-multi { padding: 12px; }
.rpt-viz-pct-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.rpt-viz-pct-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
}
.rpt-viz-pct-row + .rpt-viz-pct-row { border-top: 1px solid var(--divider-soft); }
.rpt-viz-pct-lbl {
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600;
  color: var(--text-dim); width: 86px; flex-shrink: 0;
}
.rpt-viz-pct-track {
  flex: 1; height: 7px; border-radius: 4px; position: relative;
  background: linear-gradient(90deg,
    #3b82f6 0%, #60a5fa 15%, #a3a3a3 40%, #a3a3a3 60%, #f59e0b 85%, #ef4444 100%);
  overflow: visible;
}
/* Hide the per-zone overlays — gradient handles the background */
.rpt-viz-pct-zone { display: none; }
.rpt-viz-pct-marker {
  position: absolute; top: -4px; width: 3px; height: 15px;
  border-radius: 1px; transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 0 6px rgba(255,255,255,.5);
  transition: left .5s ease;
}
.rpt-viz-pct-val {
  font-family: var(--font-ui); font-size: .82rem; font-weight: 700;
  width: 32px; text-align: right; flex-shrink: 0;
}
.rpt-viz-pct-zone-lbl {
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600;
  width: 110px; text-align: right; flex-shrink: 0; text-transform: uppercase;
  letter-spacing: .03em;
}
.rpt-viz-pct-val.blue,  .rpt-viz-pct-zone-lbl.blue  { color: var(--blue); }
.rpt-viz-pct-val.green, .rpt-viz-pct-zone-lbl.green { color: var(--green); }
.rpt-viz-pct-val.amber, .rpt-viz-pct-zone-lbl.amber { color: var(--amber); }
.rpt-viz-pct-val.red,   .rpt-viz-pct-zone-lbl.red   { color: var(--red); }

/* ── Expected price corridor — corridor bars ── */
.rpt-viz-rng { padding: 12px; }
.rpt-viz-rng-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 4px;
}
.rpt-viz-rng-title strong { color: var(--text-bright); }
.rpt-viz-rng-legend {
  display: flex; gap: 14px; align-items: center;
  font-size: .72rem; color: var(--text-muted);
  margin-bottom: 6px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rpt-viz-rng-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rpt-viz-rng-legend-sw {
  width: 14px; height: 10px; border-radius: 2px; display: inline-block;
}
.rpt-viz-rng-legend-sw.typ { background: rgba(38,217,127,.2); border: 1px solid rgba(38,217,127,.5); }
.rpt-viz-rng-legend-sw.ext { background: rgba(240,80,110,.1); border: 1px dashed rgba(240,80,110,.4); }
.rpt-viz-rng-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 16px;
  padding: 36px 4px 42px;
}
.rpt-viz-rng-row + .rpt-viz-rng-row { border-top: 1px solid var(--border); }
.rpt-viz-rng-tf {
  font-size: 1rem; font-weight: 600; color: var(--text-bright);
}
.rpt-viz-rng-bar-wrap { position: relative; }
.rpt-viz-rng-bar {
  position: relative;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02);
  overflow: visible;
}
.rpt-viz-rng-ext {
  position: absolute; top: 0; bottom: 0;
  background: rgba(240,80,110,.07);
  border-left: 1px dashed rgba(240,80,110,.35);
  border-right: 1px dashed rgba(240,80,110,.35);
}
.rpt-viz-rng-typ {
  position: absolute; top: 0; bottom: 0;
  background: rgba(38,217,127,.14);
  border-left: 2px solid rgba(38,217,127,.5);
  border-right: 2px solid rgba(38,217,127,.5);
}
.rpt-viz-rng-needle {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px; background: var(--text-bright);
  box-shadow: 0 0 8px rgba(255,255,255,.5);
}
.rpt-viz-rng-needle::before {
  content: ''; position: absolute;
  top: -5px; left: -4px;
  width: 10px; height: 10px;
  background: var(--text-bright); border-radius: 50%;
  box-shadow: 0 0 8px rgba(255,255,255,.6);
}
.rpt-viz-rng-tick,
.rpt-viz-rng-tick-top {
  position: absolute;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
}
.rpt-viz-rng-tick { top: 100%; margin-top: 8px; }
.rpt-viz-rng-tick-top { bottom: 100%; margin-bottom: 8px; }
.rpt-viz-rng-tick .price,
.rpt-viz-rng-tick-top .price { font-size: .845rem; font-weight: 500; }
.rpt-viz-rng-tick .pct,
.rpt-viz-rng-tick-top .pct { font-size: .745rem; font-weight: 500; opacity: .75; }
.rpt-viz-rng-tick.typ .price,
.rpt-viz-rng-tick.typ .pct { color: var(--green); }
.rpt-viz-rng-tick-top .price,
.rpt-viz-rng-tick-top .pct { color: var(--red); }

/* Responsive: shrink fonts + narrow the TF column when the report is embedded
   in tight containers (Wix embed, narrow sidebars, mobile). */
@media (max-width: 520px) {
  .rpt-viz-rng-row {
    grid-template-columns: 62px 1fr;
    gap: 10px;
    padding: 28px 2px 32px;
  }
  .rpt-viz-rng-tf { font-size: .84rem; }
  .rpt-viz-rng-tick .price,
  .rpt-viz-rng-tick-top .price { font-size: .785rem; }
  .rpt-viz-rng-tick .pct,
  .rpt-viz-rng-tick-top .pct { font-size: .685rem; }
}
@media (max-width: 380px) {
  .rpt-viz-rng-tick .price,
  .rpt-viz-rng-tick-top .price { font-size: .725rem; }
  .rpt-viz-rng-tick .pct,
  .rpt-viz-rng-tick-top .pct { font-size: .645rem; }
}

/* ── Drawdown gauge ── */
.rpt-viz-dd svg { height: 50px; }
.rpt-viz-dd-labels {
  display: flex; justify-content: space-between;
  font-size: .88rem; color: var(--text-muted);
  margin-top: 2px;
}
.rpt-viz-dd-labels strong { color: var(--text-bright); font-weight: 700; }

/* ── Yearly Max DD histogram (inverted bars) ── */
.rpt-viz-yrdd { padding: 12px 12px 6px; }
.rpt-viz-yrdd-title {
  font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px;
}
.rpt-viz-yrdd-chart {
  position: relative;
  height: 200px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rpt-viz-yr-cols {
  position: absolute;
  inset: 0 0 18px 0;
  display: flex;
  gap: 1px;
  align-items: flex-start;
}
.rpt-viz-yr-col {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  height: 100%;
}
.rpt-viz-yr-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  border-radius: 0 0 2px 2px;
  transition: height .35s ease;
}
.rpt-viz-yr-bar-low      { background: rgba(38,217,127,.55); }
.rpt-viz-yr-bar-mod      { background: rgba(255,184,51,.65); }
.rpt-viz-yr-bar-high     { background: rgba(234,61,61,.75); }
.rpt-viz-yr-bar-extreme  { background: rgba(234,61,61,.95); }
.rpt-viz-yr-lbl {
  position: absolute;
  bottom: -16px; left: 0; right: 0;
  text-align: center;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpt-viz-yr-avgline {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(255,184,51,.55);
  border-top: 1px dashed rgba(255,184,51,.55);
  z-index: 2;
  pointer-events: none;
}
.rpt-viz-yr-avglbl {
  position: absolute;
  right: 4px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--amber, #ffb833);
  background: rgba(16,18,25,.85);
  padding: 0 4px;
  border-radius: 3px;
  z-index: 3;
  pointer-events: none;
}

@keyframes rptFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.rpt-section { animation: rptFadeIn .3s ease both; }
.rpt-section:nth-child(2) { animation-delay: .05s; }
.rpt-section:nth-child(3) { animation-delay: .1s; }
.rpt-section:nth-child(4) { animation-delay: .15s; }
.rpt-section:nth-child(5) { animation-delay: .2s; }
.rpt-section:nth-child(6) { animation-delay: .25s; }
.rpt-section:nth-child(7) { animation-delay: .3s; }

/* ── Scoped overrides: shared insight titles (ddm-ins-*) inside the report
   stay slightly smaller than in the drawdown panel to match the section-title
   treatment; prose aligns with .rpt-text so paragraphs are all one size. ── */
.rpt-wrap .ddm-ins-num,
.rpt-wrap .ddm-ins-title { font-size: 1.275rem; }
.rpt-wrap .ddm-ins-prose { font-size: .94rem; }
