:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --surface-tint: #f1efe9;
  --ink: #17191e;
  --ink-2: #3d434d;
  --muted: #6c727e;
  --border: #e5e1d9;
  --border-strong: #d3cec3;
  --brand: #b8442a;
  --brand-soft: #fdf2ee;
  --accent: #1d5b79;
  --accent-soft: #edf5f9;
  --slate: #1c2b36;
  --up: #c4322a;
  --up-bg: #fef2f1;
  --down: #147a55;
  --down-bg: #edf8f3;
  --warn: #9a5b13;
  --warn-bg: #fef7ea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(23, 25, 30, 0.04);
  --shadow-sm: 0 2px 8px rgba(23, 25, 30, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
h1, h2, h3, p, ul, ol, dl, dt, dd, figure { margin: 0; }
section[id], div[id] { scroll-margin-top: 94px; }

/* ── Sticky Brand & Navigation ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-bar, .nav-band nav, main, .site-footer {
  width: min(calc(100% - 24px), 1080px);
  margin-inline: auto;
}
.site-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.brand-mark {
  flex: none;
  display: block;
  width: 24px;
  height: 24px;
  box-shadow: 0 1px 3px rgba(184, 68, 42, 0.25);
  border-radius: 6px;
}
.brand-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  padding-inline-start: 8px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.contact-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(184, 68, 42, 0.2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.contact-link:hover {
  background: #fbe6df;
  border-color: rgba(184, 68, 42, 0.36);
}

.nav-band {
  border-top: 1px solid #f0ede7;
}
.nav-band nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-band nav::-webkit-scrollbar { display: none; }
.nav-band nav a {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.nav-band nav a:hover { color: var(--ink); }
.nav-band nav a[aria-current="page"] {
  color: var(--slate);
  font-weight: 700;
}
.nav-band nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
}

/* ── Main Layout & Page Headings ── */
main { padding-block: 16px 32px; }
.page-heading {
  margin-bottom: 14px;
}
.heading-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}
h1 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h2 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.timing {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.timing time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink-2);
  font-weight: 500;
}
.heading-times {
  display: grid;
  justify-items: end;
  margin-inline-start: auto;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 10px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}
.meta-strip b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.live-meta-sync {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.live-status[hidden] { display: none; }
.live-status.is-stale {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid rgba(154, 91, 19, 0.24);
}
.live-status.is-error {
  background: var(--up-bg);
  color: var(--up);
  border: 1px solid rgba(196, 50, 42, 0.24);
}
.live-status-inline {
  margin: 0 14px 10px;
  padding: 7px 10px;
}
.live-status-text {
  flex: 1 1 auto;
  min-width: 0;
}
.live-retry-btn {
  flex: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 2px 9px;
  font: 600 11.5px/1.45 var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.live-retry-btn:hover { background: rgba(23, 25, 30, 0.05); }
.live-retry-btn:disabled { opacity: 0.6; cursor: default; }
.row-stale-tag {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--warn);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Semantic Numbers & Tones ── */
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-2); }
.dash { color: var(--muted); }
.code-inline, .code-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ── Homepage Tier 1: Featured Strategy Cards ── */
.headline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.strategy-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 12px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.strategy-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.strategy-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}
.strategy-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.strategy-tag {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.kpi-value {
  font-size: clamp(22px, 6.2vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.mini-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--accent);
}
.mini-trend.up { color: var(--up); }
.mini-trend.down { color: var(--down); }
.mini-trend canvas {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 24px;
}
.mini-trend small {
  flex: none;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.strategy-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding-top: 7px;
  margin-top: 2px;
  border-top: 1px solid #f0ede7;
  font-size: 11px;
  color: var(--muted);
}
.strategy-foot b {
  font-weight: 600;
  white-space: nowrap;
}

/* ── Homepage Tier 1.5: Trade Thermometer Summary ── */
.temp-panel {
  margin-bottom: 12px;
}
.temp-grid {
  list-style: none;
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.temp-card {
  min-width: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.temp-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.temp-card-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 10px 11px;
  border-radius: inherit;
}
.temp-card.is-stale {
  border-color: rgba(154, 91, 19, 0.28);
  background: #fffdf9;
}
.temp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
}
.temp-name {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
}
.temp-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.temp-badge.is-accum {
  background: var(--accent-soft);
  color: var(--accent);
}
.temp-badge.is-stale {
  background: var(--warn-bg);
  color: var(--warn);
}
.temp-badge.is-pending {
  background: var(--surface-tint);
  color: var(--muted);
}
.temp-level {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.45;
  white-space: nowrap;
}
.temp-level.level-cold { background: #e8f2f9; color: #1a547a; }
.temp-level.level-cool { background: var(--down-bg); color: var(--down); }
.temp-level.level-mild { background: var(--surface-tint); color: var(--ink-2); }
.temp-level.level-warm { background: var(--warn-bg); color: var(--warn); }
.temp-level.level-hot { background: var(--up-bg); color: var(--up); }
.temp-level.level-b0 { background: var(--surface-tint); color: var(--ink-2); }
.temp-level.level-b1 { background: var(--accent-soft); color: var(--accent); }
.temp-level.level-b2 { background: var(--warn-bg); color: var(--warn); }
.temp-level.level-b3 { background: var(--up-bg); color: var(--up); }
.temp-readout {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
  min-width: 0;
}
.temp-val {
  font-size: clamp(20px, 5.4vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.temp-val.up { color: var(--up); }
.temp-val.down { color: var(--down); }
.temp-val.flat { color: var(--ink-2); }
.temp-val.temp-placeholder {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}
.temp-unit {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.temp-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.temp-date {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Indices Subpage (/indices/) ── */
.indices-overview {
  margin-bottom: 14px;
}
.indices-overview-grid {
  padding: 0;
}
.indices-overview .temp-card {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.indices-overview .temp-card.is-stale {
  background: #fffdf9;
}
.index-sections {
  display: grid;
  gap: 12px;
}
.index-section {
  margin-bottom: 0;
}
.index-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.index-section-info {
  min-width: 0;
  flex: 1 1 160px;
}
.index-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.index-current {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.index-current-val {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.index-current-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.index-current-date {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.index-section canvas {
  height: clamp(190px, 50vw, 270px);
}
.index-chart-empty {
  margin-top: 10px;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.index-footnote {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Homepage Tier 2: Layered Dashboard Flow ── */
.dashboard-flow {
  display: grid;
  gap: 12px;
}
.flow-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.summary-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.panel-primary {
  box-shadow: inset 0 3px 0 0 var(--slate), var(--shadow-xs);
}
.panel-secondary {
  box-shadow: inset 0 2px 0 0 var(--border-strong), var(--shadow-xs);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
}
.panel-head h2 {
  font-size: 15px;
  line-height: 1.3;
}
.panel-head h2 a:hover { color: var(--accent); }
.summary-caption {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.panel-more {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.panel-more:hover { background: var(--accent-soft); }
.panel-more span { font-size: 15px; line-height: 1; }

.rank-list, .event-list, .broker-home-list {
  list-style: none;
  padding: 0;
}
.rank-list li, .event-list li, .broker-home-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #f0ede7;
}
.row-rank {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.row-rank.muted-rank {
  background: var(--surface-tint);
  color: var(--ink-2);
}
.row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.rank-list li > strong {
  flex: none;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-pill, .cat-pill, .kind-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}
.mini-pill.closed { background: var(--up-bg); color: var(--up); }
.mini-pill.open { background: var(--down-bg); color: var(--down); }
.mini-pill.limited { background: var(--warn-bg); color: var(--warn); }
.cat-pill, .kind-tag {
  background: var(--surface-tint);
  color: var(--ink-2);
}

/* Stage summary chips on home allotment card */
.stage-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 2px 14px 12px;
}
.stage-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.stage-chip.stage-0 {
  background: #fdf5f3;
  border-color: rgba(184, 68, 42, 0.22);
}
.stage-chip.stage-0 span { color: var(--brand); font-weight: 600; }
.stage-chip.stage-1 {
  background: var(--accent-soft);
  border-color: rgba(29, 91, 121, 0.2);
}
.stage-chip.stage-1 span { color: var(--accent); font-weight: 600; }
.stage-chip span { font-size: 12px; }
.stage-chip strong { font-size: 15px; font-weight: 700; color: var(--ink); }

.sub-right {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.sub-right time {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-today { background: var(--up-bg); color: var(--up); border: 1px solid rgba(196, 50, 42, 0.2); }
.status-upcoming { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(29, 91, 121, 0.18); }
.status-done { background: var(--surface-tint); color: var(--muted); }

/* Value + proportional bar (home assets & asset page) */
.val-bar-wrap {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 72px;
}
.val-bar-wrap strong {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.val-track {
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 999px;
  background: #ece9e2;
  overflow: hidden;
}
.val-track i {
  display: block;
  height: 100%;
  margin-left: auto;
  border-radius: 999px;
}
.val-track i.up { background: var(--up); }
.val-track i.down { background: var(--down); }
.val-track i.flat { background: var(--muted); }

/* Home broker rows */
.broker-chip, .broker-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--slate);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.broker-row-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
}
.broker-row-info .fee-text {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}
.broker-row-info small {
  font-size: 11px;
  color: var(--muted);
}

/* ── KPI Decks (Rotation & DCA) ── */
.stats {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 12px;
}
.stat {
  min-width: 0;
  padding: 12px 14px;
}
.stat dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.stat dd {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-primary dd {
  font-size: clamp(24px, 6.8vw, 32px);
}

/* Rotation KPI layout: primary on top row, 2 secondary split below on mobile */
.rotation-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rotation-stats .stat-primary {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.rotation-stats .stat:nth-child(3) {
  border-inline-start: 1px solid var(--border);
}

/* DCA KPI deck: paired hero + structured secondary strip with zero dangling borders */
.dca-kpi-deck {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 12px;
}
.dca-kpi-deck .stats {
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.dca-hero-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-bottom: 1px solid var(--border);
}
.dca-hero-stats .stat + .stat {
  border-inline-start: 1px solid var(--border);
}
.dca-hero-stats .stat-primary dd {
  font-size: clamp(19px, 5.4vw, 28px);
}
.dca-sub-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dca-sub-stats .stat {
  padding: 10px 14px;
}
.dca-sub-stats .stat dd {
  font-size: 16px;
}
.dca-sub-stats .stat:nth-child(even) {
  border-inline-start: 1px solid var(--border);
}
.dca-sub-stats .stat:nth-child(n+3) {
  border-top: 1px solid var(--border);
}
.dca-sub-stats.has-odd-last .stat:last-child {
  grid-column: 1 / -1;
  border-inline-start: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-soft);
}
.dca-sub-stats.has-odd-last .stat:last-child dt {
  margin-bottom: 0;
}

/* ── Charts ── */
.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px;
  margin-bottom: 12px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.chart-period {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.legend {
  display: flex;
  gap: 6px 12px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--ink-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
}
.legend b {
  font-weight: 650;
  color: var(--ink);
}
.series-0 { background: #c4322a; }
.series-1 { background: #1d5b79; }
.series-2 { background: #8a95a5; }

.chart-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-block: 10px 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid #efece6;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-readout time {
  font-weight: 600;
  color: var(--ink-2);
}
.readout-vals {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.readout-vals b {
  font-weight: 700;
  color: var(--ink);
}
.readout-vals b.up { color: var(--up); }
.readout-vals b.down { color: var(--down); }
.readout-vals i {
  font-style: normal;
  color: var(--ink-2);
}
.chart-panel canvas {
  display: block;
  width: 100%;
  height: clamp(195px, 52vw, 310px);
  touch-action: pan-y;
  cursor: crosshair;
}

/* ── DCA Latest Operation ── */
.operation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px;
  margin-bottom: 12px;
}
.operation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.period-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--slate);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.operation-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.operation-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.operation-funds {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}
.operation-funds li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-top: 1px solid #f0ede7;
  padding-block: 8px;
  font-size: 13.5px;
}
.operation-funds li:last-child { padding-bottom: 0; }
.op-fund-name {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-weight: 500;
}
.operation-funds strong { white-space: nowrap; font-weight: 650; }

/* ── Tables & Prominent Group Caps ── */
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.group-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  color: #fff;
}
.group-cap h2 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.group-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cap-reg { background: linear-gradient(90deg, #9f3326 0%, #b8442a 100%); }
.cap-pass { background: linear-gradient(90deg, #1b4f69 0%, #246586 100%); }
.cap-sub { background: linear-gradient(90deg, #1c2b36 0%, #2c4152 100%); }

.scroll-hint {
  display: none;
  padding: 5px 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}
.table-panel[data-overflow] .scroll-hint { display: block; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  text-align: left;
  vertical-align: middle;
  padding: 10px 10px;
}
thead th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody > tr > * {
  border-bottom: 1px solid #f0ede7;
}
tbody > tr:last-child > * {
  border-bottom: 0;
}
tbody tr:hover > * {
  background: #fcfbf9;
}
tbody th {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
}
td small, th small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}
td.num {
  text-align: right;
  white-space: nowrap;
}
.date-cell {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.date-cell time { white-space: nowrap; }

/* Sticky first column for horizontal scroll tables */
.sticky-first th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
}
.sticky-first thead th:first-child {
  z-index: 3;
  background: var(--surface-soft);
}
.sticky-first tbody tr:hover th:first-child {
  background: #fcfbf9;
}
.table-panel[data-overflow].sticky-first th:first-child {
  box-shadow: 1px 0 0 var(--border);
}
.table-panel[data-scrolled].sticky-first th:first-child {
  box-shadow: 4px 0 10px -4px rgba(23, 25, 30, 0.14), 1px 0 0 var(--border);
}

/* Rotation period table */
.period-table thead th:not(:first-child) { text-align: right; }
.period-table .primary-col { font-weight: 700; }
.period-table .highlight-row > * { background: var(--surface-soft); }

/* LOF table: 4 key decision cols immediately legible on 390px, date crisp & single-line */
.lof-table table { min-width: 454px; }
.lof-table th:nth-child(1) { width: 128px; min-width: 120px; }
.lof-table th:nth-child(2), .lof-table td:nth-child(2) { width: 58px; text-align: right; }
.lof-table th:nth-child(3), .lof-table td:nth-child(3) { width: 76px; text-align: right; }
.lof-table th:nth-child(4), .lof-table td:nth-child(4) { width: 102px; }
.lof-table th:nth-child(5), .lof-table td:nth-child(5) { width: 90px; text-align: right; }
.lof-table tbody th strong {
  display: block;
  line-height: 1.35;
}
.rate-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
}
.rate-pill.strong-prem.up {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--up-bg);
}
.rate-pill.strong-prem.down {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--down-bg);
}
.state-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.status {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
}
.status.primary-state {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.status.primary-state.open { background: var(--down-bg); color: var(--down); }
.status.primary-state.closed { background: var(--up-bg); color: var(--up); }
.status.primary-state.limited { background: var(--warn-bg); color: var(--warn); }
.status.secondary-state {
  color: var(--muted);
  font-size: 11px;
  padding-inline: 2px;
}
.status .limit {
  display: inline;
  margin-top: 0;
  color: inherit;
  font-size: 10.5px;
  font-weight: 500;
}

/* Asset returns table: fits cleanly with zero horizontal scroll */
.asset-table thead th:nth-child(1) { width: 42px; text-align: center; }
.asset-table thead th:nth-child(3) { width: 92px; text-align: right; }
.asset-table thead th:nth-child(4) { width: 84px; text-align: right; }
.asset-table td.rank { text-align: center; padding-inline: 6px; }
.rank-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-tint);
}
.rank-num.top-rank {
  background: var(--brand-soft);
  color: var(--brand);
}
.asset-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 3px;
}
.asset-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.ytd-cell {
  vertical-align: middle;
}
.ytd-val {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ytd-cell .val-track { margin-left: auto; }

/* Allotment & IPO tables */
.jump-links {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.jump-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.jump-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.jump-links a span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.callout-strip {
  padding: 9px 12px 9px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 3px 0 0 0 var(--accent);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.55;
}
.data-section { margin-top: 14px; }
#bond-allotment .data-section:first-of-type { margin-top: 0; }
.wide-table table { min-width: 540px; }
.wide-table th:first-child { width: 138px; min-width: 130px; }
.wide-table thead th:not(:first-child) { text-align: right; }
.bond-table tbody td.num { font-size: 13px; font-weight: 600; }
.announce-date {
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.bond-note {
  margin-top: 5px;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
}
.bond-note .source-link { color: var(--warn); }

.subscription-table thead th:nth-child(3),
.subscription-table td:nth-child(3) { text-align: right; }
.subscription-table thead th:nth-child(4),
.subscription-table td.status-col { text-align: right; white-space: nowrap; }

/* Source link styling: clean, modern, no heavy 2005 underline noise */
.target-title { line-height: 1.35; }
.source-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 91, 121, 0.28);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.source-link:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.target-title .source-link {
  color: var(--ink);
  border-bottom: 1px solid transparent;
}
.target-title .source-link::after {
  content: "\2060\00a0↗";
  font-size: 10px;
  color: var(--accent);
  vertical-align: 1px;
  white-space: nowrap;
}
.target-title .source-link:hover {
  color: var(--accent);
  border-bottom-color: rgba(29, 91, 121, 0.35);
}

/* ── Brokers: Responsive Card-Rows on Mobile, Clean Table on Desktop ── */
.broker-table .threshold-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}
.broker-table .broker-cond {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

@media (max-width: 699px) {
  .broker-table {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .broker-table .table-scroll { overflow: visible; }
  .broker-table table,
  .broker-table tbody { display: block; width: 100%; }
  .broker-table thead { display: none; }
  .broker-table tbody {
    display: grid;
    gap: 10px;
  }
  .broker-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
  }
  .broker-table tbody tr:hover > * { background: transparent; }
  .broker-table tbody th {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px 10px;
    background: var(--surface-soft);
    border-bottom: 1px solid #f0ede7;
  }
  .broker-table td.fee-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0ede7;
  }
  .broker-table td.fee-cell:nth-of-type(2) {
    border-inline-start: 1px solid #f0ede7;
  }
  .broker-table td.fee-cell::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
  }
  .broker-table td.fee-cell strong {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
  }
  .broker-table td.threshold-cell {
    grid-column: 1 / -1;
    display: block;
    padding: 10px 14px 12px;
    border-bottom: 0;
    background: #fcfbf9;
  }
  .broker-table td.threshold-cell::before {
    content: attr(data-label) " ";
    display: inline-block;
    margin-inline-end: 6px;
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
  }
}

/* ── Contact & QR Section ── */
.contact {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px;
}
.contact-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.contact-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.qr-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid #ece8e0;
}
.qr-frame {
  flex: none;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.qr-frame img {
  display: block;
  width: 86px;
  height: 86px;
  object-fit: contain;
}
.search-badge {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 98px;
  min-height: 86px;
  padding: 10px 8px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--border);
}
.search-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--down-bg);
  color: var(--down);
  font-size: 13px;
  font-weight: 700;
}
.search-word {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.qr-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.qr-kicker {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.qr-card strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.qr-card figcaption small {
  font-size: 12px;
  color: var(--ink-2);
}

/* ── Notes, Empty States & Footer ── */
.notes-block { margin-top: 10px; }
.note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  margin-top: 6px;
}
.empty-state {
  padding: 16px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 16px 26px;
  color: var(--muted);
  font-size: 12px;
}
.footer-meta {
  display: flex;
  gap: 4px 12px;
  flex-wrap: wrap;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer p { margin-top: 5px; line-height: 1.5; }

/* ── Tight Mobile Adjustments (320px - 430px) ── */
@media (max-width: 599px) {
  .brand-sub { display: none; }
  .index-section-head { flex-direction: column; }
  .index-section-info { flex: 0 0 auto; width: 100%; }
  .index-current { align-items: flex-start; }
  .index-current-meta { justify-content: flex-start; }
  th, td { padding: 9px 7px; font-size: 12.5px; }
  thead th { padding: 8px 7px; font-size: 11px; }
  .asset-table thead th:nth-child(1) { width: 36px; }
  .asset-table td.date-cell { font-size: 11px; }
  .asset-table thead th:nth-child(3) { width: 76px; }
  .asset-table thead th:nth-child(4) { width: 72px; }
  .asset-table .val-track { width: 52px; }
  .subscription-table td.date-cell { font-size: 11.5px; }
}

@media (max-width: 360px) {
  .site-bar, .nav-band nav, main, .site-footer { width: calc(100% - 16px); }
  .nav-band nav a { font-size: 12.5px; padding-inline: 7px; }
  .strategy-card { padding: 10px 9px 9px; }
  .kpi-value { font-size: 20px; }
  .strategy-foot { font-size: 10.5px; }
  .panel-head, .rank-list li, .event-list li, .broker-home-list li { padding-inline: 10px; }
  .temp-grid { padding: 0 10px 10px; gap: 6px; }
  .indices-overview-grid { padding: 0; }
  .temp-card-link { padding: 9px 9px; }
  .temp-val { font-size: 18px; }
  .temp-unit { font-size: 10.5px; }
  .stage-strip { padding-inline: 10px; }
  .row-name { font-size: 13px; }
  .dca-hero-stats .stat-primary dd { font-size: 18px; }
  .asset-table thead th:nth-child(1) { width: 32px; }
  .asset-table thead th:nth-child(3) { width: 68px; }
  .asset-table thead th:nth-child(4) { width: 68px; }
  .asset-table th, .asset-table td { padding-inline: 5px; }
  .asset-table .ytd-val { font-size: 12.5px; }
  .asset-table .val-track { width: 44px; }
  .asset-table td.date-cell { font-size: 10.5px; }
  .broker-table td.fee-cell { padding: 9px 10px; }
  .broker-table td.fee-cell strong { font-size: 12.5px; }
  .qr-card { gap: 10px; padding: 10px; }
  .qr-frame img { width: 74px; height: 74px; }
  .search-badge { width: 84px; min-height: 74px; }
}

/* ── Desktop & Tablet Expansion (>= 700px / >= 860px) ── */
@media (min-width: 700px) {
  main { padding-block: 24px 44px; }
  h1 { font-size: 26px; }
  .site-bar { min-height: 52px; }
  .nav-band nav {
    justify-content: flex-start;
    gap: 8px;
  }
  .nav-band nav a {
    min-height: 42px;
    padding: 8px 14px;
    font-size: 14px;
  }
  .headline-grid { gap: 16px; margin-bottom: 16px; }
  .temp-panel { margin-bottom: 16px; }
  .temp-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .temp-card-link { padding: 12px 14px; }
  .temp-val { font-size: 26px; }
  .indices-overview { margin-bottom: 16px; }
  .index-sections { gap: 16px; }
  .strategy-card { padding: 16px 18px 14px; }
  .kpi-value { font-size: 32px; }
  .mini-trend canvas { height: 30px; }

  .rotation-stats {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .rotation-stats .stat-primary {
    grid-column: auto;
    border-bottom: 0;
  }
  .rotation-stats .stat + .stat {
    border-inline-start: 1px solid var(--border);
  }
  .dca-kpi-deck {
    display: grid;
    grid-template-columns: 1.15fr 1.6fr;
  }
  .dca-hero-stats {
    border-bottom: 0;
    border-inline-end: 1px solid var(--border);
  }
  .dca-sub-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .dca-sub-stats .stat:nth-child(n+3) { border-top: 0; }
  .dca-sub-stats .stat + .stat { border-inline-start: 1px solid var(--border); }
  .dca-sub-stats.has-odd-last .stat:last-child {
    grid-column: auto;
    display: block;
    background: transparent;
    border-inline-start: 1px solid var(--border);
  }
  .dca-sub-stats.has-odd-last .stat:last-child dt { margin-bottom: 3px; }

  .broker-table thead th:nth-child(1) { width: 13%; }
  .broker-table thead th:nth-child(2) { width: 21%; }
  .broker-table thead th:nth-child(3) { width: 21%; }
  .broker-table thead th:nth-child(4) { width: 45%; }

  .qr-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .lof-table table, .wide-table table { min-width: 100%; }
  .wide-table th:first-child { width: 28%; }
  .lof-table th:nth-child(1) { width: 28%; }
  .lof-table th:nth-child(2), .lof-table td:nth-child(2) { width: 12%; }
  .lof-table th:nth-child(3), .lof-table td:nth-child(3) { width: 14%; }
  .lof-table th:nth-child(4), .lof-table td:nth-child(4) { width: 28%; }
  .lof-table th:nth-child(5), .lof-table td:nth-child(5) { width: 18%; }
  .status.primary-state { flex-direction: row; align-items: baseline; gap: 4px; }
  .state-pair { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
}

@media (min-width: 860px) {
  .flow-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .dashboard-flow { gap: 16px; }
}
