:root {
  --bg: #070809;
  --bg-soft: #0a0c0f;
  --surface: #101215;
  --surface-2: #15181d;
  --surface-3: #1b1f25;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(225, 185, 73, 0.22);
  --gold: #e1b949;
  --gold-bright: #f1cf67;
  --gold-soft: rgba(225, 185, 73, 0.12);
  --blue: #74b9ff;
  --blue-soft: rgba(116, 185, 255, 0.12);
  --green: #31d67b;
  --green-soft: rgba(49, 214, 123, 0.12);
  --red: #ff5d66;
  --red-soft: rgba(255, 93, 102, 0.12);
  --amber: #f4bb4a;
  --text: #f6f7f9;
  --text-soft: #c9cdd4;
  --muted: #8a909b;
  --subtle: #5f6671;
  --radius: 16px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --shadow-hover: 0 24px 72px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(225, 185, 73, 0.09), transparent 30rem),
    radial-gradient(circle at 92% 3%, rgba(116, 185, 255, 0.055), transparent 28rem),
    linear-gradient(180deg, #070809 0%, #090b0e 46%, #070809 100%);
}
button, select { font: inherit; }
::selection { background: rgba(225, 185, 73, 0.22); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 999px; }

.app-shell { min-height: 100vh; }
.layout {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 9, 0.84);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}
.topbar-inner {
  width: min(1480px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand, .topbar-status, .live-chip, .topbar-nav { display: flex; align-items: center; }
.brand { gap: 11px; min-width: 0; }
.brand { color: inherit; text-decoration: none; }
.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(49, 214, 123, 0.14), inset 0 1px 0 rgba(255,255,255,.20);
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-bright), #9d7419);
  color: #151006;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(225, 185, 73, 0.18), inset 0 1px 0 rgba(255,255,255,.34);
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0; }
.brand-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.topbar-nav {
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7,8,9,.34);
}
.topbar-nav a {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.topbar-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.045);
}
.topbar-status { gap: 14px; min-width: 0; }
.refresh-copy { color: var(--subtle); font-size: 11px; font-weight: 600; white-space: nowrap; }
.live-chip {
  gap: 8px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 18, 21, 0.78);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}
.live-chip > span:not(.dot) { font-size: 12px; font-weight: 700; }
.live-chip small { color: var(--muted); font-size: 11px; }
.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(244, 187, 74, 0.35);
}
.dot.live { background: var(--green); animation: pulse 2s infinite; }
.dot.dead { background: var(--red); box-shadow: 0 0 12px rgba(255, 93, 102, 0.5); }
.dot.closed { background: var(--amber); box-shadow: 0 0 12px rgba(244, 187, 74, 0.45); }
.refresh-track { height: 2px; overflow: hidden; background: rgba(255,255,255,.025); }
.refresh-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  box-shadow: 0 0 16px rgba(225, 185, 73, 0.4);
  transition: width 0.1s linear;
}

.overview-strip {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 14px 4px 16px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 3vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: 0; }
h2 { font-size: clamp(17px, 1.8vw, 22px); line-height: 1.2; font-weight: 750; letter-spacing: 0; }
.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(19, 22, 26, 0.96), rgba(14, 16, 19, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.card:hover { border-color: rgba(225, 185, 73, 0.13); }
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.025), transparent 35%);
}

.hero-section {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.58fr);
  align-items: center;
  gap: 34px;
  padding: clamp(28px, 5vw, 76px) 0 22px;
}
.hero-copy { min-width: 0; }
.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}
.hero-lede {
  max-width: 600px;
  margin-top: 18px;
  color: var(--text-soft);
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.62;
}
.hero-actions,
.guide-actions,
.social-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-actions { margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .01em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible,
.topbar-nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid rgba(116,185,255,.85);
  outline-offset: 3px;
}
.btn-primary {
  color: #121008;
  border-color: rgba(241, 207, 103, .70);
  background: var(--gold-bright);
  box-shadow: 0 14px 36px rgba(225, 185, 73, .16);
}
.btn-primary:hover {
  border-color: rgba(255, 224, 132, .88);
  background: #ffe084;
  box-shadow: 0 18px 42px rgba(225, 185, 73, .22);
}
.btn-secondary {
  background: rgba(16, 18, 21, .84);
  border-color: rgba(225,185,73,.18);
}
.btn-secondary:hover { border-color: rgba(225,185,73,.34); background: rgba(22, 24, 27, .96); }
.btn-tertiary {
  min-height: 42px;
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
}
.btn-tertiary:hover {
  color: var(--text);
  border-color: rgba(116,185,255,.26);
  background: rgba(116,185,255,.06);
}
.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.hero-notes span {
  padding: 9px 11px;
  border-right: 1px solid rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.hero-notes span:last-child { border-right: 0; }
.hero-notes strong { color: var(--text-soft); }
.hero-visual {
  position: relative;
  min-width: 0;
  width: min(100%, 460px);
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(116,185,255,.045), transparent 42%),
    rgba(11, 13, 16, .88);
  box-shadow: var(--shadow);
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.05), transparent 36%);
}
.hero-visual-head,
.hero-visual-stats,
.hero-proof { position: relative; z-index: 1; }
.hero-visual-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.hero-visual-head img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
}
.hero-visual-head span,
.hero-visual-stats span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.hero-visual-head strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: 0;
}
.hero-visual-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.hero-visual-stats div {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.hero-visual-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.3;
}
.hero-proof {
  margin-top: 10px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(7, 8, 9, .46);
}
.hero-proof span {
  display: block;
  color: var(--gold);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero-proof strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
.risk-panel,
.social-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 16, 19, .72);
}
.risk-panel p,
.social-panel p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.guide-section {
  margin-top: 18px;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 34%),
    rgba(10, 12, 15, .46);
}
.section-intro {
  display: grid;
  grid-template-columns: minmax(0, .58fr) minmax(0, .42fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}
.section-intro p:last-child {
  max-width: 540px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.section-intro h2 {
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0;
}
.guide-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(15, 17, 20, .94), rgba(10, 12, 14, .96));
}
.guide-transfer-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(116,185,255,.12);
  border-radius: 10px;
  background: rgba(116,185,255,.032);
}
.guide-transfer-note span {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.guide-transfer-note strong {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 650;
  text-align: right;
}
.step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}
.step-list li {
  position: relative;
  min-width: 0;
  min-height: 190px;
  padding: 52px 14px 16px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 12px;
  background: rgba(7,9,11,.44);
  counter-increment: steps;
}
.step-list li:hover {
  border-color: rgba(225,185,73,.16);
  background: rgba(10,12,14,.72);
}
.step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(225, 185, 73, .14);
  border: 1px solid rgba(225, 185, 73, .22);
  color: #07110b;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 900;
}
.step-list strong,
.step-list span {
  display: block;
}
.step-list strong {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}
.step-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.step-list b { color: var(--gold-bright); font-weight: 850; }
.guide-actions {
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.055);
}
.social-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 18px;
  padding: 18px 20px;
  border-color: rgba(116, 185, 255, .14);
  background:
    linear-gradient(90deg, rgba(116, 185, 255, .075), transparent 46%),
    rgba(12, 14, 17, .82);
}
.social-panel > div:first-child { max-width: 820px; }
.social-panel h2 { font-size: clamp(18px, 1.55vw, 24px); }
.social-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.social-points span {
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 9px;
  background: rgba(255,255,255,.026);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
}
.risk-panel {
  margin-top: 12px;
  padding: 16px 18px;
  border-color: rgba(255, 93, 102, .18);
  background: rgba(255, 93, 102, .045);
}
.risk-panel strong {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.kpi-card { min-height: 168px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.kpi-accent { width: 22px; height: 3px; border-radius: 999px; background: var(--gold); opacity: .8; }
.kpi-realized .kpi-accent { background: var(--green); }
.kpi-drawdown .kpi-accent { background: var(--blue); }
.kpi-floating .kpi-accent { background: var(--green); }
.kpi-value {
  display: block;
  margin: 18px 0 12px;
  color: var(--text);
  font-size: clamp(27px, 3vw, 44px);
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-note { color: var(--subtle); font-size: 11px; line-height: 1.4; }
.kpi-stack { margin-top: 15px; }
.metric-percent, .metric-money { display: block; }
.metric-percent {
  font-size: clamp(29px, 3.2vw, 46px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}
.metric-percent.realized { color: var(--green); text-shadow: 0 0 24px rgba(49, 214, 123, 0.15); }
.metric-percent.realized.neg { color: var(--red); text-shadow: 0 0 24px rgba(255, 93, 102, 0.14); }
.metric-percent.realized.neutral { color: var(--text-soft); text-shadow: none; }
.metric-percent.risk { color: var(--blue); text-shadow: 0 0 24px rgba(116, 185, 255, 0.16); }
.metric-money {
  width: fit-content;
  max-width: 100%;
  margin-top: 9px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}
.metric-money.pos { border-color: rgba(49, 214, 123, .16); background: var(--green-soft); }
.metric-money.neg { border-color: rgba(255, 93, 102, .16); background: var(--red-soft); }
.metric-money.risk-money { border-color: rgba(116, 185, 255, .18); background: rgba(116, 185, 255, .08); color: var(--blue); }

.period-panel { margin-top: 12px; padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; position: relative; z-index: 2; }
.panel-head.compact { align-items: center; margin-bottom: 18px; }
.period-head { align-items: center; margin-bottom: 18px; }
.tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7,8,9,.48);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  color: #171205;
  background: linear-gradient(135deg, var(--gold-bright), #c99524);
  box-shadow: 0 7px 18px rgba(225,185,73,.15);
}
.tabs button:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.period-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; transition: opacity .15s ease, transform .15s ease; }
.period-stats.switching { opacity: .18; transform: translateY(3px); }
.stat-tile {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 10, 12, 0.46);
}
.stat-tile span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.stat-tile strong { display: block; color: var(--text-soft); font-size: clamp(15px, 1.6vw, 20px); font-weight: 800; letter-spacing: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-subvalue {
  display: block;
  min-height: 16px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-subvalue.pos { color: var(--green) !important; }
.stat-subvalue.neg { color: var(--red) !important; }
.stat-net { border-top-color: rgba(225,185,73,.46); }
.stat-win { border-top-color: rgba(49,214,123,.46); }
.stat-factor { border-top-color: rgba(116,185,255,.46); }
.stat-range { border-top-color: rgba(255,93,102,.42); }

.charts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.chart-wide { grid-column: 1 / -1; }
.chart-card { min-width: 0; padding: 20px; }
.chart-wrap { position: relative; width: 100%; height: 310px; min-width: 0; }
.chart-large { height: 390px; }
.chart-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 -2px;
  padding-inline: 2px;
}
.chart-context span {
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 9px;
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(225,185,73,.22);
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tables-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 12px; margin-top: 12px; }
.table-card { min-width: 0; min-height: 468px; padding: 20px; display: flex; flex-direction: column; }
.table-card > .panel-head { flex: 0 0 auto; min-height: 58px; }
.table-card .table-wrap { flex: 1 1 auto; height: 360px; max-height: 360px; }
.table-card:first-child table { min-width: 600px; }
.table-card:last-child table { min-width: 680px; }

/* Position tables on the same grid lines as the two chart cards above. */
.tables-grid .panel-head > div:first-child { min-width: 0; }
.tables-grid .panel-head h2 { white-space: nowrap; }
.table-history { scrollbar-gutter: stable; }
@media (min-width: 1081px) {
  .tables-grid > .table-card { width: 100%; height: 468px; }
}

.history-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.select-field { position: relative; display: block; }
.select-field::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  min-height: 32px;
  padding: 6px 29px 6px 10px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0b0d10;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
select:hover { border-color: var(--border-strong); }
select option { background: #0b0d10; color: var(--text); }
.table-wrap {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 10, 12, 0.48);
}
table { width: 100%; min-width: 650px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.045); text-align: right; white-space: nowrap; font-size: 11px; }
th:first-child, td:first-child { text-align: left; }
th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--gold);
  background: rgba(10, 12, 15, 0.95);
  backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
td { color: var(--text-soft); font-weight: 550; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,.012); }
tbody tr:hover td { background: rgba(225,185,73,.035); }
tbody tr:last-child td { border-bottom: 0; }
.empty-row td { padding: 32px 14px; text-align: center !important; color: var(--muted); }
.table-wrap.is-empty table { height: 100%; }
.table-wrap.is-empty tbody, .table-wrap.is-empty .empty-row { height: 100%; }
.empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; }
.empty-state-icon { position: relative; width: 38px; height: 38px; margin-bottom: 4px; border: 1px solid rgba(225,185,73,.20); border-radius: 50%; background: rgba(225,185,73,.055); box-shadow: inset 0 0 0 7px rgba(225,185,73,.025); }
.empty-state-icon::before { content: ""; position: absolute; left: 10px; right: 10px; top: 18px; height: 2px; border-radius: 999px; background: rgba(225,185,73,.72); }
.empty-state strong { color: var(--text-soft); font-size: 12px; font-weight: 750; }
.empty-state small { max-width: 280px; color: var(--subtle); font-size: 10px; line-height: 1.5; }

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
.neutral { color: var(--muted) !important; }
td.pos, td.neg { font-weight: 800; }
td.pos { box-shadow: inset 3px 0 0 rgba(49,214,123,.52); }
td.neg { box-shadow: inset 3px 0 0 rgba(255,93,102,.52); }

.pnl-cell { min-width: 122px; }
.pnl-cell strong,
.pnl-cell small { display: block; font-variant-numeric: tabular-nums; }
.pnl-cell strong { font-size: 11px; font-weight: 850; }
.pnl-cell small {
  margin-top: 4px;
  color: currentColor;
  opacity: .76;
  font-size: 9px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: .01em;
}

.footer-note { padding: 22px 4px 0; color: var(--subtle); text-align: center; font-size: 10px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.reveal { animation: fadeInUp .48s both; }
.kpi-grid .reveal:nth-child(1) { animation-delay: .04s; }
.kpi-grid .reveal:nth-child(2) { animation-delay: .08s; }
.kpi-grid .reveal:nth-child(3) { animation-delay: .12s; }
.kpi-grid .reveal:nth-child(4) { animation-delay: .16s; }
.charts-grid .reveal:nth-child(1) { animation-delay: .18s; }
.charts-grid .reveal:nth-child(2) { animation-delay: .22s; }
.charts-grid .reveal:nth-child(3) { animation-delay: .26s; }
.tables-grid .reveal:nth-child(1) { animation-delay: .28s; }
.tables-grid .reveal:nth-child(2) { animation-delay: .32s; }
.value-updated { animation: valueFlash .42s ease; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(49,214,123,.40); } 70% { box-shadow: 0 0 0 8px rgba(49,214,123,0); } 100% { box-shadow: 0 0 0 0 rgba(49,214,123,0); } }
@keyframes valueFlash { 0% { opacity: .45; transform: translateY(2px); } 100% { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
  .hero-section { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { max-width: 520px; justify-self: start; }
  .section-intro { grid-template-columns: 1fr; align-items: start; gap: 10px; }
  .step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-list li { min-height: 184px; }
  .tables-grid { grid-template-columns: 1fr; }
  .table-card { min-height: 0; }
  .table-card > .panel-head { min-height: auto; }
  .table-card .table-wrap { height: auto; max-height: 420px; }
}

@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .layout, .topbar-inner { width: min(100% - 22px, 1480px); }
  .topbar-nav { display: none; }
  .refresh-copy { display: none; }
  .hero-section { padding-top: 24px; gap: 18px; }
  .hero-copy h1 { font-size: clamp(34px, 10.5vw, 56px); }
  .hero-lede { margin-top: 16px; }
  .guide-section { padding: 22px; }
  .step-list { grid-template-columns: 1fr; }
  .step-list li { min-height: 0; }
  .social-panel { align-items: flex-start; flex-direction: column; }
  .overview-strip { min-height: 90px; padding-top: 20px; }
  .period-head { align-items: flex-start; flex-direction: column; }
  .tabs { width: 100%; }
  .charts-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .chart-wrap, .chart-large { height: 300px; }
}

@media (max-width: 620px) {
  .layout, .topbar-inner { width: min(100% - 16px, 1480px); }
  .topbar-inner { min-height: 62px; }
  .brand-copy span, .live-chip small { display: none; }
  .brand-logo { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .live-chip { padding: 8px 10px; }
  .hero-section { padding-top: 18px; }
  .hero-copy h1 { letter-spacing: 0; }
  .hero-actions,
  .guide-actions,
  .social-actions { align-items: stretch; flex-direction: column; }
  .btn { width: 100%; }
  .hero-notes { width: 100%; }
  .hero-notes span { flex: 1 1 100%; width: 100%; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .hero-notes span:last-child { border-bottom: 0; }
  .hero-visual { border-radius: 14px; }
  .hero-visual-stats { grid-template-columns: 1fr; }
  .guide-section { padding: 16px; border-radius: 14px; }
  .guide-card,
  .social-panel { padding: 16px; }
  .guide-transfer-note { align-items: flex-start; flex-direction: column; gap: 6px; }
  .guide-transfer-note strong { text-align: left; }
  .step-list li { padding: 13px 12px 13px 46px; }
  .step-list li::before { width: 24px; height: 24px; border-radius: 8px; }
  .overview-strip { align-items: flex-end; gap: 14px; }
  h1 { font-size: 25px; }
  .kpi-grid { gap: 8px; }
  .kpi-card { min-height: 148px; padding: 16px; }
  .kpi-value { font-size: clamp(23px, 7.3vw, 34px); }
  .metric-percent { font-size: clamp(26px, 8vw, 38px); }
  .kpi-note { font-size: 10px; }
  .period-panel, .chart-card, .table-card { padding: 16px; }
  .period-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .stat-tile { padding: 12px; }
  .chart-wrap, .chart-large { height: 270px; }
  .panel-head.compact { align-items: flex-start; gap: 12px; }
  .tables-grid .panel-head h2 { white-space: normal; }
  .history-head { flex-direction: column; }
  .history-controls { width: 100%; justify-content: space-between; }

  .table-card .table-wrap, .table-wrap { height: auto; max-height: none; overflow: visible; border: 0; background: transparent; }
  table, tbody, tr, td { display: block; width: 100%; min-width: 0; }
  .table-card:first-child table,
  .table-card:last-child table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 8px; }
  tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(8, 10, 12, .52);
  }
  tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 0.82fr) minmax(0, 1.18fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.045);
    text-align: right !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .cell-value {
    min-width: 0;
    color: var(--text-soft);
    text-align: right;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .cell-value strong { color: var(--text); }
  tbody tr td:last-child { border-bottom: 0; }
  tbody tr:hover td, tbody tr:nth-child(even) td { background: transparent; }
  tbody td.pos {
    background: rgba(49, 214, 123, .055);
    box-shadow: inset 3px 0 0 rgba(49,214,123,.58);
  }
  tbody td.neg {
    background: rgba(255, 93, 102, .055);
    box-shadow: inset 3px 0 0 rgba(255,93,102,.58);
  }
  tbody td.pos .cell-value,
  tbody td.pos .cell-value strong,
  tbody td.pos .cell-value small { color: var(--green); }
  tbody td.neg .cell-value,
  tbody td.neg .cell-value strong,
  tbody td.neg .cell-value small { color: var(--red); }
  tbody td.neutral .cell-value,
  tbody td.neutral .cell-value strong,
  tbody td.neutral .cell-value small { color: var(--muted); }
  tbody td.pnl-cell strong,
  tbody td.pnl-cell small { text-align: right; }
  tbody td.pnl-cell .cell-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
  }
  .empty-row td { display: block; padding: 28px 14px; text-align: center !important; }
  .empty-state { min-height: 160px; }
  .empty-row td::before { display: none; }
}

@media (max-width: 460px) {
  .layout, .topbar-inner { width: min(100% - 14px, 1480px); }
  .topbar-inner { gap: 10px; }
  .brand { gap: 9px; }
  .topbar-status { flex: 0 0 auto; }
  .live-chip { max-width: 152px; }
  .live-chip > span:not(.dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .period-panel, .chart-card, .table-card { padding: 14px; }
  tbody td {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }
}

@media (max-width: 390px) {
  .brand-copy strong { font-size: 13px; }
  .live-chip > span:not(.dot) { font-size: 10px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 138px; }
  .period-stats { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.chart-wrap { position: relative; }
.chart-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(180deg, rgba(16, 18, 21, 0.28), rgba(16, 18, 21, 0.72));
  border-radius: 12px;
}
