/* ============================================================
   ACCESSIBILITY / SEO 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;
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg:          #080B0F;
  --surface:     #0D1117;
  --border:      #1C2330;
  --border2:     #243040;
  --amber:       #F0A500;
  --amber-dim:   #A06800;
  --amber-glow:  #F0A50022;
  --green:       #00C896;
  --green-dim:   #00856A;
  --red:         #E05050;
  --muted:       #4A5568;
  --text:        #C8D4E0;
  --text-dim:    #6B7F96;
  --mono:        'IBM Plex Mono', monospace;
  --serif:       'DM Serif Display', serif;
  --sans:        'IBM Plex Sans', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .4;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes shimmer {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(240, 165, 0, .4); }
  50%       { opacity: .8; box-shadow: 0 0 0 4px rgba(240, 165, 0, 0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInUp .5s ease forwards;
}

/* ============================================================
   DISCLAIMER BAR
   ============================================================ */
.disclaimer-bar {
  background: #1A0A00;
  border-bottom: 1px solid #5A2800;
  padding: 8px 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: #C06020;
  letter-spacing: .04em;
}

.disclaimer-bar strong {
  color: #E07030;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
}

.header-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-tag::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--amber);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  color: #E8F0F8;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

h1 em {
  color: var(--amber);
  font-style: italic;
}

.header-version {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber-dim);
  letter-spacing: .08em;
  border: 1px solid var(--border2);
  padding: 2px 8px;
  margin-bottom: 16px;
}

.header-sub {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text-dim);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.byline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.byline a {
  color: var(--amber-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.byline a:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* ── Sample Preview ──────────────────────────────────────────── */
.sample-preview {
  padding: 28px 0 36px;
  border-bottom: 1px solid var(--border);
}

.sp-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.sp-grid {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--amber-dim);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.sp-key {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .06em;
  text-transform: uppercase;
  min-width: 100px;
  flex-shrink: 0;
}

.sp-val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sp-signal {
  color: var(--amber);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
}

.sp-ticker {
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--amber);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  letter-spacing: .06em;
}

.sp-muted {
  color: var(--text-dim);
  font-size: 11px;
}

/* ============================================================
   RECENT WINS
   ============================================================ */
/* ── Skeleton loader (shared with stats.html) ─────────────────── */
@keyframes skeleton-pulse {
  0%   { opacity: .35; }
  50%  { opacity: .65; }
  100% { opacity: .35; }
}
.skeleton {
  background: var(--border2);
  border-radius: 3px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
  display: inline-block;
}

.rw-skeleton {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  overflow: hidden;
}
.rw-skeleton-card {
  flex-shrink: 0;
  width: 160px;
  height: 80px;
  background: var(--border2);
  border-radius: 3px;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.rw-skeleton-card:nth-child(2) { animation-delay: .2s; }
.rw-skeleton-card:nth-child(3) { animation-delay: .4s; }

.recent-wins {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--border);
}

.rw-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.rw-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rw-disclaimer {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--text-dim);
  opacity: .7;
}

.rw-cards {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .rw-cards {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rw-cards::-webkit-scrollbar { display: none; }
}

.rw-track {
  display: flex;
  gap: 12px;
  width: max-content;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }

  .rw-track {
    animation: marquee var(--ticker-duration, 30s) linear infinite;
  }

  .recent-wins:hover .rw-track {
    animation-play-state: paused;
  }
}

.rw-card {
  flex: 0 0 auto;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--green-dim);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rw-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rw-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.rw-ticker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .06em;
}

.rw-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--green);
  border: 1px solid var(--green-dim);
  padding: 1px 5px;
  letter-spacing: .08em;
  border-radius: 2px;
}

.rw-sector {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.rw-roi {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  margin-top: 2px;
}

.rw-price {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.rw-arrow {
  color: var(--muted);
  margin: 0 2px;
}

/* ============================================================
   ANALYTICS BAR
   ============================================================ */
.analytics-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 6px 12px 6px 10px;
  background: rgba(240, 165, 0, .04);
  border: 1px solid var(--border2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .03em;
  transition: border-color .3s;
}

.analytics-bar.analytics-updated {
  animation: analytics-flash .6s ease forwards;
}

@keyframes analytics-flash {
  0%   { border-color: var(--amber-dim); color: var(--amber); }
  100% { border-color: var(--border2);   color: var(--text-dim); }
}

.analytics-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 4px var(--green);
}

.analytics-count {
  color: var(--amber);
  font-weight: 600;
  font-size: 13px;
}

.analytics-label {
  color: var(--text-dim);
}

.analytics-sep {
  color: var(--muted);
}

.analytics-leading {
  color: var(--text);
}

.stats-page-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  background: var(--green);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  border-radius: 2px;
  transition: opacity .15s, background .15s;
}

.stats-page-link:hover {
  opacity: .85;
}


/* ============================================================
   SECTOR SELECTOR
   ============================================================ */
.selector-section {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 32px;
}

.risk-profile-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.risk-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  padding: 12px 20px;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  max-width: 240px;
}

.risk-btn .risk-btn-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

.risk-btn .risk-btn-hint {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
}

.risk-btn:hover {
  border-color: var(--amber-dim);
  color: var(--text);
  background: #0F1520;
}

.risk-btn.selected {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-glow);
}

.risk-btn.selected .risk-btn-hint {
  color: var(--amber-dim);
}

.risk-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.sector-btn {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: .02em;
}

.sector-btn .ticker {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: .06em;
}

.sector-btn .name {
  display: block;
  font-size: 12px;
}

.sector-btn:hover {
  border-color: var(--amber-dim);
  color: var(--text);
  background: #0F1520;
}

.sector-btn.selected {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-glow);
}

.sector-btn.selected .ticker {
  color: var(--amber-dim);
}

/* ============================================================
   RUN BUTTON
   ============================================================ */
.run-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--amber);
  color: #000;
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 14px 32px;
  cursor: pointer;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: all .2s;
}

.run-btn:hover {
  background: #FFB800;
  transform: translateY(-1px);
}

.run-btn:active {
  transform: translateY(0);
}

.run-btn:disabled {
  background: var(--amber-dim);
  cursor: not-allowed;
  transform: none;
  opacity: .6;
}

/* ── Pipeline Diagram ─────────────────────────────────────────── */
.pipeline-diagram {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 24px 0 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-node {
  flex: 1 1 0;
  min-width: 108px;
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pipeline-node--critic {
  border-color: var(--amber-dim);
  background: var(--amber-glow);
}

.pipeline-node-id {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .1em;
}

.pipeline-node-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}

.pipeline-node--critic .pipeline-node-name {
  color: var(--amber);
}

.pipeline-node-badge {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber-dim);
  letter-spacing: .04em;
  border: 1px solid var(--amber-dim);
  display: inline-block;
  padding: 1px 5px;
  margin-top: 2px;
  width: fit-content;
}

.pipeline-node-role {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: .03em;
  margin-top: 2px;
}

.pipeline-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
  align-self: center;
}

/* ── Time hint ────────────────────────────────────────────────── */
.time-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .04em;
  margin: 16px 0 16px;
}

/* ============================================================
   EXECUTION PANEL
   ============================================================ */
#execution-panel {
  padding: 48px 0;
  display: none;
  border-bottom: 1px solid var(--border);
}

#execution-panel.visible {
  display: block;
}

.exec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.exec-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
}

.exec-title span {
  color: var(--amber);
}

.exec-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}

/* Progress bar */
.progress-wrap {
  margin-bottom: 36px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .06em;
}

.progress-pct {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  font-weight: 600;
}

.progress-bar-bg {
  height: 3px;
  background: var(--border2);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
  width: 0%;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 0, .6));
  animation: shimmer 1.5s infinite;
}

.status-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  margin-top: 8px;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-line::before {
  content: '>';
  font-size: 10px;
  animation: blink 1s infinite;
}

/* Agent cards */
.agents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .agents-grid {
    grid-template-columns: 1fr;
  }
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 20px;
  opacity: .4;
  transform: translateY(4px);
  transition: opacity .4s, transform .4s, border-color .3s, background .3s;
}

.agent-card.active {
  border-color: var(--amber-dim);
  background: #0D1117;
  opacity: 1;
  transform: translateY(0);
}

.agent-card.done {
  border-color: var(--green-dim);
  background: #081210;
  opacity: 1;
  transform: translateY(0);
}

.agent-card.pending {
  opacity: .3;
  transform: translateY(4px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.agent-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .1em;
}

.agent-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  transition: background .3s;
}

.agent-card.active .agent-status-dot {
  background: var(--amber);
  animation: pulse-dot 1s infinite;
}

.agent-card.done .agent-status-dot {
  background: var(--green);
}

.agent-name {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.agent-card.active .agent-name {
  color: var(--amber);
}

.agent-card.done .agent-name {
  color: var(--green);
}

.agent-model-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber-dim);
  letter-spacing: .04em;
  margin-bottom: 6px;
  min-height: 13px;
}

.agent-card.done .agent-model-tag {
  color: var(--green-dim);
}


.agent-role {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 14px;
  letter-spacing: .04em;
}

.agent-output {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  min-height: 32px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.agent-card.active .agent-output {
  color: var(--text);
}

.agent-card.done .agent-output {
  color: #7ABFA0;
}

.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--amber);
  margin-left: 2px;
  animation: blink .7s infinite;
  vertical-align: middle;
}

/* ============================================================
   REPORT SECTION
   ============================================================ */
#report-section {
  padding: 48px 0;
  display: none;
}

#report-section.visible {
  display: block;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.report-title {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--text);
  margin-bottom: 4px;
}

.report-title span {
  color: var(--amber);
}

.report-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.8;
}

.report-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 200, 150, .08);
  border: 1px solid var(--green-dim);
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ── Download PDF button ──────────────────────────────────── */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 7px 14px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .18s, border-color .18s, color .18s, transform .15s;
  white-space: nowrap;
}

.download-btn:hover:not(:disabled) {
  background: var(--amber-glow);
  border-color: var(--amber);
  transform: translateY(-1px);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: .55;
  cursor: default;
}

.btn-spinner {
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Share row ────────────────────────────────────────────────── */
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 7px 12px;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, transform .15s;
  white-space: nowrap;
}

.share-btn:hover {
  transform: translateY(-1px);
}

.share-btn--twitter:hover {
  border-color: #1D9BF0;
  color: #1D9BF0;
  background: rgba(29, 155, 240, .08);
}

.share-btn--linkedin:hover {
  border-color: #0A66C2;
  color: #0A66C2;
  background: rgba(10, 102, 194, .08);
}

.report-body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.report-body h2 {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--amber);
  margin: 32px 0 12px;
  font-weight: 400;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.report-body h3 {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 24px 0 8px;
}

.report-body p {
  margin-bottom: 16px;
}

.report-body ul {
  padding-left: 0;
  margin-bottom: 16px;
  list-style: none;
}

.report-body ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
  color: var(--text);
}

.report-body ul li::before {
  content: '--';
  position: absolute;
  left: 0;
  color: var(--amber-dim);
}

/* Metric boxes */
.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.metric-row-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 900px) {
  .metric-row-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 500px) {
  .metric-row {
    grid-template-columns: 1fr 1fr;
  }
  .metric-row-5 {
    grid-template-columns: 1fr 1fr;
  }
}

.metric-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 16px;
}

.metric-box .m-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.metric-box .m-value {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--amber);
  font-weight: 500;
  line-height: 1;
}

.metric-box .m-value.up   { color: var(--green); }
.metric-box .m-value.down { color: var(--red); }

/* Report disclaimer */
.disclaimer-box {
  margin-top: 40px;
  background: #0D0800;
  border: 1px solid #3A1800;
  padding: 20px 24px;
}

.disclaimer-box p {
  font-family: var(--mono);
  font-size: 11px;
  color: #7A4820;
  line-height: 1.7;
  margin: 0;
}

.disclaimer-box strong {
  color: #BA6830;
}

/* Stock recommendation cards (live report renderer) */
.stock-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.stock-card-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.stock-ticker {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--amber);
}

.stock-rec {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
}

.stock-score {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.subsection-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 16px 0 6px;
}

/* ============================================================
   EXECUTION METRICS TABLE (appended to report-body)
   ============================================================ */
.metrics-table-wrap {
  overflow-x: auto;
  margin: 8px 0 20px;
}

.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

.metrics-table th,
.metrics-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.metrics-table thead th {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: right;
  background: var(--surface);
  font-weight: 500;
}

.metrics-table th.mt-name,
.metrics-table td.mt-name {
  text-align: left;
}

.metrics-table td {
  color: var(--text);
}

.metrics-table td.mt-num {
  text-align: right;
  color: var(--text-dim);
}

.metrics-table td.mt-total {
  color: var(--amber);
  font-weight: 600;
}

.metrics-table tbody tr:hover {
  background: rgba(255, 255, 255, .02);
}

/* ============================================================
   PRINT / PDF EXPORT
   Activated by body.is-printing (set by report.js triggerPDF).
   ============================================================ */
@media print {
  /* ── Page setup ── */
  @page {
    size: A4 portrait;
    margin: 18mm 16mm;
  }

  /* ── Hide everything except the report ── */
  body.is-printing .disclaimer-bar,
  body.is-printing .analytics-bar,
  body.is-printing header,
  body.is-printing .sample-preview,
  body.is-printing .selector-section,
  body.is-printing #execution-panel,
  body.is-printing footer,
  body.is-printing .download-btn,
  body.is-printing .report-badge,
  body.is-printing .share-row,
  body.is-printing body::before {
    display: none !important;
  }

  /* ── Reset to print-friendly light theme ── */
  body.is-printing,
  body.is-printing #report-section {
    background: #fff !important;
    color: #111 !important;
  }

  body.is-printing #report-section {
    display: block !important;
    padding: 0 !important;
  }

  body.is-printing .report-header {
    border-bottom: 1.5px solid #bbb !important;
    padding-bottom: 12px !important;
    margin-bottom: 24px !important;
  }

  body.is-printing .report-title {
    font-size: 22px !important;
    color: #111 !important;
  }

  body.is-printing .report-title span {
    color: #8B6000 !important;
  }

  body.is-printing .report-meta {
    font-size: 9px !important;
    color: #555 !important;
  }

  /* ── Report body typography ── */
  body.is-printing .report-body {
    font-size: 11px !important;
    color: #111 !important;
    line-height: 1.65 !important;
  }

  body.is-printing .report-body h2 {
    font-size: 15px !important;
    color: #8B6000 !important;
    border-bottom: 1px solid #ddd !important;
    margin: 20px 0 8px !important;
    page-break-after: avoid;
  }

  body.is-printing .report-body p {
    margin-bottom: 8px !important;
  }

  body.is-printing .report-body ul li {
    color: #222 !important;
    margin-bottom: 3px !important;
  }

  body.is-printing .report-body ul li::before {
    color: #8B6000 !important;
  }

  /* ── Metric boxes ── */
  body.is-printing .metric-row {
    gap: 8px !important;
    margin: 12px 0 !important;
  }

  body.is-printing .metric-box {
    background: #f5f5f5 !important;
    border: 1px solid #ccc !important;
    padding: 10px !important;
  }

  body.is-printing .metric-box .m-label {
    color: #555 !important;
  }

  body.is-printing .metric-box .m-value {
    font-size: 16px !important;
    color: #8B6000 !important;
  }

  body.is-printing .metric-box .m-value.up   { color: #007A5A !important; }
  body.is-printing .metric-box .m-value.down { color: #B03030 !important; }

  /* ── Stock cards ── */
  body.is-printing .stock-card {
    background: #fafafa !important;
    border: 1px solid #ccc !important;
    padding: 14px 18px !important;
    margin-bottom: 10px !important;
    page-break-inside: avoid;
  }

  body.is-printing .stock-ticker {
    color: #8B6000 !important;
    font-size: 16px !important;
  }

  body.is-printing .stock-score {
    color: #666 !important;
  }

  body.is-printing .subsection-label {
    color: #555 !important;
  }

  /* ── Disclaimer ── */
  body.is-printing .disclaimer-box {
    background: #fff8f0 !important;
    border: 1px solid #d4a070 !important;
    padding: 12px 16px !important;
    margin-top: 24px !important;
    page-break-inside: avoid;
  }

  body.is-printing .disclaimer-box p {
    color: #7A4820 !important;
    font-size: 9px !important;
  }

  body.is-printing .disclaimer-box strong {
    color: #A04820 !important;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 16px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.footer-brand a {
  color: var(--amber-dim);
  text-decoration: none;
}

.footer-brand a:hover {
  color: var(--amber);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--amber);
}
