:root {
  --bg: #f3eee3;
  --bg-soft: #ebe4d6;
  --card: #fbf7ee;
  --card-strong: #fffaf2;
  --ink: #2d2924;
  --muted: #7a7368;
  --accent: #7b8871;
  --accent-strong: #65725e;
  --accent-soft: #e5eadf;
  --accent-wash: #eff2ea;
  --negative: #a45f52;
  --negative-soft: #f4e4df;
  --warning: #c4975c;
  --warning-soft: #f6ead8;
  --border: #d9cfbe;
  --shadow: 0 18px 40px rgba(83, 67, 45, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(123, 136, 113, 0.14) 0, transparent 30%),
    radial-gradient(circle at bottom left, rgba(196, 151, 92, 0.12) 0, transparent 26%),
    linear-gradient(180deg, #faf6ee 0%, var(--bg) 100%);
  font-family: "Pretendard", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

body.home-page {
  --home-header-offset: 72px;
  --home-bg-height: calc(100vw * 848 / 1264);
  position: relative;
  background: linear-gradient(180deg, #faf6ee 0%, var(--bg) 100%);
}

.home-background-layer {
  position: fixed;
  top: var(--home-header-offset);
  left: 0;
  width: 100%;
  height: var(--home-bg-height);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.home-background-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 246, 238, 0.18), rgba(243, 238, 227, 0.3));
}

.home-background-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.5);
}

.home-background-mobile {
  display: none;
}

@media (max-aspect-ratio: 4/5) {
  body.home-page {
    --home-header-offset: 68px;
    --home-bg-height: calc(100vw * 1376 / 768);
  }

  .home-background-desktop {
    display: none;
  }

  .home-background-mobile {
    display: block;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- header / gnb --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(45, 41, 36, 0.08);
  background: rgba(250, 246, 238, 0.85);
  backdrop-filter: blur(14px);
}

.home-page .site-header {
  border-bottom: none;
  background: rgba(250, 246, 238, 0.85);
  backdrop-filter: blur(14px);
}

.home-page .brand {
  text-shadow: none;
}

.brand-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: nowrap;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gnb {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.gnb-separator {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.gnb a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 72px;
  padding: 8px 16px;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.gnb a:hover {
  color: var(--ink);
  background: rgba(229, 234, 223, 0.4);
  transform: none;
}

.gnb-link-active,
.market-link-active {
  color: var(--ink) !important;
  font-weight: 600;
  border-bottom-color: var(--accent-strong) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.home-page .gnb a {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  border-bottom: 2px solid transparent;
}

.home-page .gnb a:hover,
.home-page .gnb-link-active,
.home-page .market-link-active {
  background: rgba(229, 234, 223, 0.4);
  border-color: transparent;
  border-bottom-color: var(--accent-strong);
  box-shadow: none;
}

.market-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(123, 136, 113, 0.14);
  background: rgba(255, 250, 242, 0.75);
}

.market-link-active .flag-badge {
  border: 1px solid rgba(101, 114, 94, 0.42);
  box-shadow: none;
  background: var(--accent-soft);
}

/* --- layout --- */

.page-shell {
  max-width: 1240px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 32px 28px 40px;
  flex: 1;
  overflow-x: hidden;
}

.site-footer,
.page-shell,
.home-background-spacer {
  position: relative;
  z-index: 1;
}

.home-page .page-shell {
  max-width: 1140px;
  padding-top: 80px;
  padding-bottom: 0;
}

/* --- hero / sections --- */

.hero,
.page-head,
.meta-grid,
.chart-grid,
.grid-2,
.overview-grid {
  margin-bottom: 24px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  padding: 34px;
  border: 1px solid rgba(45, 41, 36, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(245, 239, 227, 0.9)),
    var(--card-strong);
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow: hidden;
}

.home-page .hero {
  margin-bottom: 56px;
  padding: 36px 40px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.84), rgba(245, 239, 227, 0.74)),
    var(--card-strong);
  backdrop-filter: blur(9px);
}

.hero-actions,
.pill-row,
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero h1,
.page-head h1,
.card h2 {
  margin-top: 0;
}

.bench-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.2rem 0 0.3rem;
}

.lead {
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.6;
}

/* --- buttons --- */

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ink);
  color: var(--card);
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(45, 41, 36, 0.1);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 41, 36, 0.13);
}

.button-secondary {
  background: rgba(123, 136, 113, 0.14);
  border-color: rgba(123, 136, 113, 0.28);
  color: var(--ink);
}

/* --- cards --- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(83, 67, 45, 0.04);
}

/* --- grids --- */

.meta-grid,
.grid-2,
.overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-grid-dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-grid > *,
.home-overview-grid > * {
  min-width: 0;
}

.home-page .overview-grid {
  gap: 34px;
}

.overview-card p:last-child {
  margin-bottom: 0;
}

.champion-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.champion-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.champion-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(83, 67, 45, 0.10);
}

.home-page .champion-card {
  padding: 18px 20px;
  background: rgba(251, 247, 238, 0.8);
  backdrop-filter: blur(8px);
}

.champion-title,
.champion-capital {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.champion-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* --- page head / filters --- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.filter-row {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.74);
}

.hero .filter-row {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.filter-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  align-self: center;
}

/* --- tables --- */

.data-table,
.heatmap-table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table th,
.data-table td,
.heatmap-table th,
.heatmap-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(29, 38, 31, 0.08);
  text-align: left;
  font-size: 0.92rem;
}

.data-table thead th,
.heatmap-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover,
.heatmap-table tbody tr:hover {
  background: rgba(123, 136, 113, 0.1);
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  color: var(--ink);
}

.sort-arrow {
  font-size: 0.75em;
  opacity: 0.7;
}

.metric-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-link-active {
  color: var(--ink);
}

.sort-icon {
  font-size: 0.9em;
  color: var(--muted);
}

.metric-sub {
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.metric-help,
.metric-tip {
  cursor: help;
  outline: none;
}

.metric-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(123, 136, 113, 0.24);
  background: rgba(229, 234, 223, 0.55);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.metric-tip {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: underline dotted rgba(123, 136, 113, 0.72);
  text-underline-offset: 0.18em;
  touch-action: manipulation;
}

.metric-tooltip-layer {
  position: fixed;
  z-index: 1200;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(45, 41, 36, 0.96);
  color: var(--card);
  font-size: 0.76rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  box-shadow: 0 10px 24px rgba(45, 41, 36, 0.18);
}

.metric-tooltip-layer[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.reference-row {
  background: rgba(229, 234, 223, 0.2);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-pass {
  color: #2f6b3d;
  background: #e3f0e1;
  border-color: rgba(47, 107, 61, 0.22);
}

.status-fail {
  color: #8b3d30;
  background: #f7e3de;
  border-color: rgba(139, 61, 48, 0.22);
}

.status-pending {
  color: var(--muted);
  background: rgba(229, 234, 223, 0.45);
  border-color: rgba(123, 136, 113, 0.14);
}

.status-running {
  color: #2d5f8a;
  background: #dde8f5;
  border-color: #b5cde5;
}

/* Period bar */
.leaderboard-period-bar {
  margin: 0 0 16px;
}

/* Research tabs */
.research-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}

.research-tabs {
  display: flex;
  gap: 0;
}

.research-tab {
  padding: 7px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.research-tab:first-child {
  border-radius: 6px 0 0 6px;
}

.research-tab:last-child {
  border-radius: 0 6px 6px 0;
}

.research-tab:not(:first-child) {
  border-left: none;
}

.research-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.research-tab-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.research-tab-active:hover {
  background: var(--accent);
  color: #fff;
}

.research-status-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.research-summary {
  margin: 16px 0;
  text-align: right;
}

.compact th,
.compact td {
  padding: 8px 10px;
}

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

.negative {
  color: var(--negative);
}

.empty-cell {
  text-align: center;
}

.rank-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* --- summary badges --- */

.summary-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-wash);
  color: var(--muted);
  border: 1px solid rgba(123, 136, 113, 0.14);
  font-size: 0.88rem;
}

.summary-badge strong {
  color: var(--ink);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 12px;
}

.table-toolbar-meta,
.table-toolbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.toolbar-item strong {
  color: var(--ink);
}

.section-inline-note {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(123, 136, 113, 0.18);
  background: rgba(229, 234, 223, 0.35);
  color: var(--muted);
  font-size: 0.88rem;
}

.page-link:hover {
  color: var(--ink);
  border-color: rgba(123, 136, 113, 0.28);
}

.page-link-active {
  color: var(--ink);
  background: rgba(190, 212, 231, 0.45);
  border-color: rgba(95, 135, 170, 0.32);
}

.page-link-disabled {
  opacity: 0.45;
  cursor: default;
}

.window-toolbar-card {
  display: grid;
  gap: 8px;
}

.window-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.window-form-inline {
  width: 100%;
}

.window-form-label,
.window-range-arrow {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.window-date-input {
  width: clamp(6.8rem, 28vw, 9rem);
  min-width: 0;
}

.window-input {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* --- fold / details --- */

.fold-card {
  display: grid;
  gap: 14px;
}

.fold-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.fold-summary::-webkit-details-marker {
  display: none;
}

.fold-summary::before {
  content: "▸";
  color: var(--accent-strong);
  margin-right: 8px;
  transition: transform 120ms ease;
}

.fold-card[open] .fold-summary::before {
  transform: rotate(90deg);
}

/* --- pills --- */

.pill {
  border-radius: 10px;
  padding: 8px 12px;
  background: #eee6d9;
  border: 1px solid transparent;
  font-weight: 500;
}

.pill-active {
  background: var(--accent-soft);
  border-color: rgba(123, 136, 113, 0.24);
  color: var(--accent-strong);
}

.flag {
  font-size: 1.05em;
  line-height: 1;
}

/* --- charts --- */

.chart {
  width: 100%;
  height: auto;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart text {
  fill: var(--ink);
  stroke: rgba(251, 247, 238, 0.85);
  stroke-width: 3px;
  paint-order: stroke fill;
  font-family: "Inter", "Pretendard", sans-serif;
  font-weight: 500;
}

.negative-stroke {
  stroke: var(--accent);
}

.chart-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.chart-range {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.chart-stat-grid span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--accent-wash);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
}

.chart-stat-grid strong {
  color: var(--ink);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chart-stat-grid em {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-stat-grid small {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chart-axis-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.event-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.event-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  border: 1px solid transparent;
  color: var(--muted);
}

.event-pill strong {
  color: var(--ink);
}

.event-pill-accent {
  background: var(--accent-soft);
  border-color: rgba(123, 136, 113, 0.22);
}

.event-pill-negative {
  background: var(--negative-soft);
  border-color: rgba(164, 95, 82, 0.2);
}

.event-pill-warning {
  background: var(--warning-soft);
  border-color: rgba(196, 151, 92, 0.22);
}

.axis-line {
  stroke: rgba(45, 41, 36, 0.22);
  stroke-width: 1;
}

.axis-grid {
  stroke: rgba(45, 41, 36, 0.08);
  stroke-width: 1;
}

.y-axis-label {
  fill: var(--muted);
  stroke: rgba(251, 247, 238, 0.92);
  stroke-width: 5px;
  paint-order: stroke fill;
  font-family: "Inter", "Pretendard", sans-serif;
  font-weight: 500;
  font-size: 11px;
}

.axis-label,
.event-label {
  fill: var(--ink);
  stroke: rgba(251, 247, 238, 0.85);
  stroke-width: 3px;
  paint-order: stroke fill;
  font-family: "Inter", "Pretendard", sans-serif;
  font-weight: 500;
  font-size: 12px;
}

.event-line {
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  opacity: 0.9;
}

.event-accent {
  stroke: var(--accent-strong);
}

.event-negative {
  stroke: var(--negative);
}

.event-warning {
  stroke: var(--warning);
}

/* --- stacked area chart --- */

.stacked-chart {
  stroke: none;
}

.area-invested {
  fill: var(--accent);
  opacity: 0.55;
  stroke: var(--accent-strong);
  stroke-width: 1;
}

.area-cash {
  fill: var(--warning);
  opacity: 0.35;
  stroke: var(--warning);
  stroke-width: 1;
}

.allocation-stat-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.allocation-stat-row {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.allocation-stat-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.allocation-stat-row strong {
  color: var(--ink);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.allocation-stat-row em {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.allocation-stat-row small {
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}

.allocation-stat-label {
  background: transparent !important;
  padding: 0 4px !important;
  font-weight: 600;
  font-size: 0.72rem !important;
  color: var(--ink) !important;
  width: 56px;
  min-width: 56px;
}

.stat-row-invested .allocation-stat-label {
  border-left: 3px solid var(--accent);
  padding-left: 6px !important;
}

.stat-row-cash .allocation-stat-label {
  border-left: 3px solid var(--warning);
  padding-left: 6px !important;
}

/* --- tooltip & crosshair --- */

.chart-svg-wrap {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 100;
  display: none;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(251, 247, 238, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(83, 67, 45, 0.12);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  line-height: 1.5;
  color: var(--ink);
}

.chart-crosshair {
  stroke: rgba(45, 41, 36, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

/* --- benchmark lines --- */

.benchmark-line {
  stroke-width: 1.5;
  stroke-dasharray: 6 3;
  fill: none;
}

.benchmark-spy { stroke: #4a7fb5; }
.benchmark-qqq { stroke: #b5784a; }
.benchmark-069500 { stroke: #4a7fb5; }
.benchmark-229200 { stroke: #b5784a; }

.benchmark-pill-0 { border-color: #4a7fb5 !important; }
.benchmark-pill-1 { border-color: #b5784a !important; }

.benchmark-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 120ms;
}

.benchmark-toggle input { display: none; }
.benchmark-active { opacity: 1; }

.stacked-legend-invested {
  background: var(--accent-soft);
  border-color: rgba(123, 136, 113, 0.22);
}

.stacked-legend-cash {
  background: var(--warning-soft);
  border-color: rgba(196, 151, 92, 0.22);
}

.positive-bg {
  background: var(--accent-soft);
}

.negative-bg {
  background: var(--negative-soft);
}

/* --- forms --- */

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
}

input,
select {
  border: 1px solid var(--border);
  background: rgba(255, 250, 242, 0.96);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}

/* --- footer --- */

.site-footer {
  margin-top: 0;
  padding: 0 28px;
  border-top: 1px solid rgba(45, 41, 36, 0.08);
  background: rgba(250, 246, 238, 0.6);
}

.home-page .site-footer {
  margin-top: 0;
  padding: 0 28px;
}

.home-background-spacer {
  width: 100%;
  height: var(--home-bg-height);
}

.footer-grid {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.footer-grid a,
.footer-note {
  display: inline-flex;
  width: auto;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-grid a:hover {
  color: var(--ink);
  background: rgba(123, 136, 113, 0.08);
}

.footer-clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}

/* --- glossary --- */

.glossary-list { line-height: 1.7; }
.glossary-list dt { font-weight: 700; margin-top: 18px; }
.glossary-list dt:first-child { margin-top: 0; }
.glossary-list dd { margin: 4px 0 0; padding: 0; }

/* --- responsive --- */

@media (max-width: 860px) {
  .hero,
  .chart-grid,
  .grid-2,
  .overview-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Seeds + Capitals stay side-by-side on tablet/mobile */
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-end;
  }

  .site-header,
  .page-head,
  .chart-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header {
    padding: 9px 16px;
  }

  .gnb {
    width: 100%;
    justify-content: flex-start;
  }

  .page-shell {
    padding: 16px 14px 24px;
  }

  .home-page .page-shell {
    padding-top: 34px;
    padding-bottom: 14px;
  }

  .home-page .site-footer {
    padding: 0 16px;
  }

  .hero,
  .home-page .hero {
    padding: 18px 16px;
  }

  .hero-actions,
  .filter-row,
  .pill-row {
    width: 100%;
  }

  .hero-actions .button,
  .hero-actions .button-secondary {
    width: 100%;
  }

  .filter-row {
    align-items: stretch;
    padding: 12px;
    gap: 8px;
  }

  .hero .filter-row {
    flex-direction: column;
  }

  .filter-row label {
    width: 100%;
    min-width: 0;
  }

  .chart-stat-grid {
    width: 100%;
    min-width: 0;
  }

  .hero,
  .page-head,
  .meta-grid,
  .chart-grid,
  .grid-2,
  .overview-grid {
    margin-bottom: 12px;
  }

  .card {
    padding: 12px;
    border-radius: 10px;
  }

  .card h2 {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .page-head {
    margin-bottom: 10px;
    gap: 12px;
  }

  .page-head h1 {
    font-size: 1.2rem;
    word-break: break-all;
  }

  .eyebrow {
    font-size: 0.68rem;
    margin-bottom: 2px;
  }

  .lead {
    font-size: 0.88rem;
    margin-top: 4px;
    margin-bottom: 0;
  }

  .summary-badges {
    gap: 6px;
    margin-bottom: 8px;
  }

  .summary-badge {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .pill {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .pill-row {
    gap: 6px;
  }

  .chart-stat-grid {
    gap: 4px;
  }

  .chart-stat-grid span {
    padding: 5px 6px;
    font-size: 0.72rem;
  }

  .chart-stat-grid em {
    font-size: 0.72rem;
  }

  .chart-stat-grid small {
    font-size: 0.62rem;
  }

  .chart-stat-grid strong {
    font-size: 0.62rem;
  }

  .chart-meta {
    margin-top: 8px;
  }

  .event-pill {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .chart-card-head {
    margin-bottom: 10px;
    gap: 10px;
  }

  .chart-range {
    font-size: 0.78rem;
    margin-top: 2px;
  }

  .event-label {
    font-size: 7px;
    opacity: 0.6;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 8px 12px;
  }

  .brand-block {
    gap: 8px;
  }

  .brand {
    font-size: 1.2rem;
  }

  .gnb a {
    padding: 6px 10px;
    min-width: 56px;
    font-size: 0.85rem;
  }

  .page-shell {
    padding: 12px 10px 20px;
  }

  .home-page .page-shell {
    padding-top: 22px;
    padding-bottom: 8px;
  }

  .hero,
  .home-page .hero {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .card,
  .home-page .champion-card {
    padding: 10px;
    border-radius: 8px;
  }

  .card h2 {
    font-size: 0.88rem;
    margin-bottom: 4px;
  }

  .page-head h1 {
    font-size: 1.05rem;
  }

  h1 {
    font-size: 1.25rem;
  }

  .summary-badge {
    width: 100%;
    justify-content: space-between;
  }

  .home-page .champion-card,
  .home-page .champion-card-link,
  .home-page .summary-badges,
  .home-page .summary-badge {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .home-page .champion-card .summary-badge {
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 4px;
    column-gap: 6px;
    overflow-wrap: anywhere;
  }

  .home-page .champion-card .summary-badge strong {
    margin-right: auto;
  }

  .home-page .champion-card .status-chip {
    margin-left: auto;
  }

  .chart-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .chart-stat-grid span {
    padding: 5px 5px;
    font-size: 0.72rem;
    border-radius: 6px;
  }

  .chart-stat-grid strong {
    font-size: 0.65rem;
  }

  .axis-label {
    font-size: 8px;
  }

  .event-label {
    font-size: 6px;
    opacity: 0.5;
  }

  .site-footer {
    padding: 0 10px;
  }

  .home-page .site-footer {
    padding: 0 10px;
  }

  .hero,
  .page-head,
  .meta-grid,
  .chart-grid,
  .grid-2,
  .overview-grid {
    margin-bottom: 10px;
  }

  .meta-grid {
    gap: 6px;
  }

  .pill {
    padding: 4px 8px;
    font-size: 0.8rem;
  }

  .pill-row {
    gap: 4px;
  }
}

/* --- prediction quality --- */

.section-prediction-quality {
  margin-bottom: 18px;
}

.pq-grid.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pq-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.pq-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.metric-row dt {
  font-size: 0.85rem;
  color: var(--muted);
  cursor: help;
  margin: 0;
}

.metric-row dd {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin: 0;
}

@media (max-width: 768px) {
  .pq-grid.three-col {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .pq-card {
    padding: 12px;
  }
}

/* --- gosongpa-3x page helpers --- */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 24px;
}

.big {
  margin: 4px 0 0;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.metric {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(45, 41, 36, 0.08);
  background: rgba(229, 234, 223, 0.35);
}

.badge-pass {
  background: #e3f0e1;
  color: #245b2e;
}

.badge-warn {
  background: #f7e3de;
  color: #8e4c3f;
}

.lead-inline {
  color: var(--muted);
  margin-top: 8px;
}

.compact th,
.compact td {
  font-size: 0.86rem;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.detail-card-title {
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .big {
    font-size: 1.8rem;
  }
}
