:root {
  --paper: #fafaf9;
  --paper-tint: #f5f5f4;
  --surface: #ffffff;
  --border: #e7e5e4;
  --border-soft: #f0eeec;
  --ink: #1c1917;
  --muted: #57534e;
  --subtle: #78716c;
  --navy: #1e3a5f;
  --green: #15803d;
  --green-bg: #f0fdf4;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --darkred: #7f1d1d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 6px 18px rgba(28, 25, 23, 0.03);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "JetBrains Mono", monospace; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Minimal Editorial Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
}
.brand-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav-sep { width: 1px; height: 14px; background: var(--border); }
.nav a.nav-ext { color: var(--navy); font-weight: 600; }

/* Chapters */
.chapter { padding: 36px 0; }
.chapter-tinted {
  background: var(--paper-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.hero-chapter { padding: 24px 0 32px; }

.top-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.date-kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--subtle);
}
.market-tape {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Compact Editorial Hero Card */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.stance-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.stance-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--navy);
}
.stance-green   { background: var(--green); }
.stance-bright  { background: #047857; }
.stance-blue    { background: var(--blue); }
.stance-amber   { background: var(--amber); }
.stance-red     { background: var(--red); }
.stance-darkred { background: var(--darkred); }
.stance-context { font-size: 13px; color: var(--subtle); font-weight: 600; }

.serif-headline {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}

.hero-summary {
  font-size: 15.5px;
  color: var(--muted);
  max-width: 860px;
  line-height: 1.55;
  margin-bottom: 16px;
}

.hero-strips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.trend-brief, .watch-strip {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}
.trend-brief { border-left: 3px solid var(--navy); }
.watch-strip { border-left: 3px solid var(--subtle); }
.trend-brief strong, .watch-strip strong { color: var(--navy); }

/* 4 Live Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
}
.kpi-num-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kpi-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.kpi-z {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--paper-tint);
  border: 1px solid var(--border);
  color: var(--muted);
}
.kpi-delta {
  font-size: 12px;
  font-weight: 600;
}
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--subtle); }
.kpi-sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Live Tactical Setups Strip */
.setups-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding: 0 2px;
}
.strip-kicker {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}
.strip-note { font-size: 12px; color: var(--subtle); }

.setups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.setup-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setup-box.setup-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.14);
}
.setup-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.setup-top h3 { font-size: 14px; font-weight: 700; }
.setup-box p { font-size: 13px; color: var(--muted); flex: 1; line-height: 1.45; }
.setup-edge { font-size: 11.5px; color: var(--navy); font-weight: 600; padding-top: 6px; border-top: 1px solid var(--border-soft); }

/* Chapter Headers */
.chapter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.chapter-num {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin-bottom: 4px;
}
.serif-h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.chapter-sub {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 700px;
}

/* Editorial Cards */
.editorial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

/* Segmented Buttons */
.seg-group {
  display: inline-flex;
  background: var(--surface);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active {
  background: var(--ink);
  color: #ffffff;
}

/* Quadrant + 10-Day Table Split */
.radar-split {
  display: grid;
  grid-template-columns: 1.48fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.axis-bridge {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.axis-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
}
.axis-dir {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.axis-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.axis-now { font-size: 12px; margin-left: 4px; font-weight: 600; }
.axis-desc { font-size: 11.5px; color: var(--subtle); }

.chart-quadrant { width: 100%; height: 420px; }
.chart-full-4p  { width: 100%; height: 640px; }
.chart-tactical { width: 100%; height: 540px; }

.radar-caption {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.recent-card {
  display: flex;
  flex-direction: column;
}
.recent-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.recent-card-head h3 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
}
.recent-card-sub { font-size: 12px; color: var(--subtle); }

/* Tabs */
.guide-card { padding: 20px 24px 24px; }
.guide-tabs, .full-chart-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.guide-tab {
  border: none;
  background: transparent;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.guide-tab:hover { color: var(--ink); background: var(--paper-tint); }
.guide-tab.active {
  background: var(--ink);
  color: #ffffff;
}
.guide-pane { display: none; padding-top: 16px; }
.guide-pane.active { display: block; }
.pane-intro { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

/* Tables */
.table-scroll { overflow-x: auto; }
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.clean-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
}
.clean-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.compact-table td { padding: 9.5px 6px; font-size: 12.5px; }
.compact-table th { padding: 8px 6px; font-size: 10.5px; }
.clean-table tr:last-child td { border-bottom: none; }
.clean-table tr.active-row {
  background: #f5f3ff;
  outline: 1.5px solid rgba(109, 40, 217, 0.28);
}
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }

.soft-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper-tint);
  color: var(--muted);
  white-space: nowrap;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-amber { background: var(--amber-bg); color: var(--amber); }
.tag-blue  { background: var(--blue-bg); color: var(--blue); }
.tag-red   { background: var(--red-bg); color: var(--red); }

/* Concept / What is CSI Section */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.concept-card h3 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}
.concept-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}
.concept-read {
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 10px 12px;
  line-height: 1.48;
}
.concept-read strong { color: var(--navy); }

.concept-viz {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 6px 4px 2px;
  margin: 2px 0;
}
.cycle-visual-card {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.cycle-svg-wrap {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 8px 4px;
}
.cycle-explain h3 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cycle-explain p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}
.cycle-steps {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.48;
}
.cycle-steps strong { color: var(--navy); }

.concept-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  flex: 1;
}
.flow-step strong { color: var(--ink); }
.flow-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-arrow { color: var(--subtle); font-weight: 700; font-size: 16px; }
.concept-footnote { font-size: 12.5px; color: var(--subtle); padding-left: 2px; }

/* Method Columns */
.method-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.method-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); margin-bottom: 5px; }
.method-cols h3 { font-family: "Newsreader", Georgia, serif; font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.method-cols p { font-size: 14px; color: var(--muted); }

/* Tactical Overlay Controls */
.overlay-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.overlay-label { font-size: 12px; font-weight: 600; color: var(--subtle); }
.overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.overlay-btn .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.overlay-btn.active[data-q="Q1"] { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.overlay-btn.active[data-q="Q2"] { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); }
.overlay-btn.active[data-q="Q4"] { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.overlay-btn.active[data-q="Q3"] { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* Footer */
.footer {
  padding: 26px 0;
  font-size: 12.5px;
  color: var(--subtle);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--navy); text-decoration: none; font-weight: 600; }

/* Responsive */
@media (max-width: 1020px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .radar-split, .concept-grid, .cycle-visual-card { grid-template-columns: 1fr; }
  .concept-flow { flex-direction: column; align-items: flex-start; }
  .flow-arrow { display: none; }
}
@media (max-width: 760px) {
  .hero-strips, .kpi-grid, .setups-grid, .method-cols, .axis-bridge { grid-template-columns: 1fr; }
  .nav { display: none; }
  .hero-card, .editorial-card { padding: 18px 16px; }
}
