/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --mg: #FF00FF;
  --mg-soft: oklch(0.96 0.08 328);
  --ink: #0A0A0A;
  --ink-2: #2A2A2D;
  --ink-3: #5C5C61;
  --ink-4: #8A8A90;
  --line: #E6E6E8;
  --line-2: #F0F0F2;
  --bg: #FAFAFA;
  --paper: #FFFFFF;
  --font: "Helvetica Neue", Helvetica, Arial, "Inter", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle grain on background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.025) 1px, transparent 0);
  background-size: 4px 4px;
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 40px 48px;
}

/* ---------- Header ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.page-head-left { display: flex; align-items: center; gap: 22px; }
.page-head-divider { width: 1px; height: 28px; background: var(--line); }
.page-head-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head-title p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
.page-head-right { display: flex; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.chip-mg {
  border-color: var(--mg);
  color: var(--mg);
  background: color-mix(in oklch, var(--mg) 6%, white);
}

/* ---------- KPIs ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}
.kpi {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  position: relative;
}
.kpi:last-child { border-right: none; }
.kpi-label {
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.kpi-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
}

/* ---------- Chart container ---------- */
.chart {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

/* ---------- Month header ---------- */
.month-header {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}
.month-header-spacer { width: 240px; flex: 0 0 240px; border-right: 1px solid var(--line); }
.month-header-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  position: relative;
}
.month-col {
  padding: 12px 8px 10px;
  border-right: 1px solid var(--line-2);
  position: relative;
  transition: background 120ms ease;
  cursor: default;
}
.month-col:last-child { border-right: none; }
.month-col.quarter-change { border-right-color: var(--line); }
.month-col.year-change::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--ink);
}
.month-q {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  height: 12px;
}
.month-l {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.month-y {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-4);
  margin-top: 2px;
  height: 11px;
}
.month-col.is-hover {
  background: color-mix(in oklch, var(--mg) 6%, transparent);
}
.month-col.is-hover .month-l { color: var(--mg); }

/* ---------- Rows area ---------- */
.rows {
  position: relative;
}
.rows-grid {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
  z-index: 0;
}
.rows-grid-spacer { width: 240px; flex: 0 0 240px; border-right: 1px solid var(--line); }
.rows-grid-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.grid-col {
  border-right: 1px solid var(--line-2);
  transition: background 120ms ease;
}
.grid-col:last-child { border-right: none; }
.grid-col.is-q-start { border-right-color: var(--line); }
.grid-col.is-y-start {
  box-shadow: inset 2px 0 0 0 var(--ink);
}
.grid-col.is-hover {
  background: color-mix(in oklch, var(--mg) 4%, transparent);
}

/* ---------- Row ---------- */
.row {
  display: flex;
  height: 68px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
  z-index: 1;
  transition: opacity 160ms ease;
}
.row:last-child { border-bottom-color: var(--line); }
.row.is-dimmed { opacity: 0.42; }
.row.is-focused { background: color-mix(in oklch, var(--mg) 2%, transparent); }

.row-label {
  width: 240px;
  flex: 0 0 240px;
  border-right: 1px solid var(--line);
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.5);
  overflow: hidden;
}
.row-label-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-mark {
  font-size: 11px;
  line-height: 1;
  font-family: var(--mono);
  flex: 0 0 auto;
}
.row-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  min-width: 0;
}
.row-free-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg);
  border: 1px solid var(--mg);
  background: color-mix(in oklch, var(--mg) 8%, white);
  padding: 1px 5px;
  border-radius: 3px;
  flex: 0 0 auto;
  line-height: 1.2;
}
.row-lohn-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.45 0.18 70);
  border: 1px solid oklch(0.62 0.22 70);
  background: oklch(0.96 0.07 70);
  padding: 1px 5px;
  border-radius: 3px;
  flex: 0 0 auto;
  line-height: 1.2;
}
.row-cat {
  border: 1px solid currentColor;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.row-owner::before { content: '· '; color: var(--ink-4); }
.row-total {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Track / bar ---------- */
.row-track {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.cell {
  border-right: 1px solid transparent;
  position: relative;
  z-index: 1;
}
.cell-hover { background: color-mix(in oklch, var(--mg) 5%, transparent); }

.bar {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 6px;
  background: color-mix(in oklch, var(--bar-tint) 10%, white);
  border: 1px solid color-mix(in oklch, var(--bar-tint) 45%, white);
  overflow: hidden;
  z-index: 2;
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 300ms ease,
              box-shadow 200ms ease,
              border-color 200ms ease;
  cursor: default;
}
.bar.is-in {
  transform: scaleX(1);
  opacity: 1;
}
.row.is-focused .bar.is-in {
  border-color: var(--bar-tint);
  box-shadow: 0 4px 18px -6px color-mix(in oklch, var(--bar-tint) 40%, transparent);
  transform: scaleX(1) translateY(-1px);
}
.bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--bar-tint) 18%, white) 0%,
    color-mix(in oklch, var(--bar-tint) 8%, white) 100%);
  z-index: 0;
}
.bar-segments {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--seg-count, 1), 1fr);
  z-index: 1;
}
.bar .bar-segments { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
/* override via inline via JS not used; just rely on natural seg count */
.seg {
  border-right: 1px dashed color-mix(in oklch, var(--bar-tint) 35%, transparent);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 6px 0;
  transition: background 100ms ease;
  cursor: pointer;
}
.seg:last-child { border-right: none; }
.seg:hover { background: color-mix(in oklch, var(--bar-tint) 22%, transparent); }
.seg-hover { background: color-mix(in oklch, var(--bar-tint) 18%, transparent); }
.seg-amt {
  font-family: var(--mono);
  font-size: 9.5px;
  color: color-mix(in oklch, var(--bar-tint) 75%, black);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.bar-spine {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}
.bar-name {
  font-size: 11px;
  font-weight: 600;
  color: color-mix(in oklch, var(--bar-tint) 85%, black);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-note {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ---------- Section header (group divider) ---------- */
.section-header {
  display: flex;
  min-height: 32px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.section-header.is-first { border-top: none; }
.section-header-label {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.section-header-track { flex: 1; }
.section-mark { font-weight: 700; font-size: 12px; }
.section-title { font-weight: 700; }
.section-count {
  font-size: 9.5px;
  padding: 1px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-left: auto;
}
.section-header.is-lohn .section-mark { color: oklch(0.62 0.22 70); }
.section-header.is-lohn .section-title { color: oklch(0.45 0.18 70); }
.section-header.is-lohn .section-count {
  background: oklch(0.96 0.07 70);
  border-color: oklch(0.62 0.22 70);
  color: oklch(0.45 0.18 70);
}

/* ---------- Liquidity row ---------- */
.liquidity {
  display: flex;
  min-height: 116px;
  border-top: 2px solid var(--ink);
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  position: relative;
  z-index: 3;
}
.liq-label {
  background: #fff !important;
  border-right: 1px solid var(--line);
}
.liq-label .row-name { font-size: 13px; }
.liq-cat {
  border: none !important;
  padding: 0 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--ink-3) !important;
  font-size: 10.5px !important;
}
.liq-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.liq-cell {
  position: relative;
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px 8px 8px;
  transition: background 120ms ease;
}
.liq-cell:last-child { border-right: none; }
.liq-cell.cell-hover { background: color-mix(in oklch, var(--mg) 6%, transparent); }
.liq-bar {
  width: 100%;
  background: color-mix(in oklch, var(--mg) 8%, white);
  border-top: 2px solid var(--mg);
  position: relative;
  margin-bottom: 6px;
  min-height: 2px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.liq-bar.is-in { transform: scaleY(1); }
.liq-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--mg) 14%, white) 0%,
    color-mix(in oklch, var(--mg) 4%, white) 100%);
}
.liq-cell.is-peak .liq-bar {
  background: color-mix(in oklch, var(--mg) 18%, white);
  border-top-width: 3px;
}
.liq-cell.is-peak .liq-bar-fill {
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--mg) 28%, white) 0%,
    color-mix(in oklch, var(--mg) 10%, white) 100%);
}
.liq-amt {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.liq-amt-u { font-size: 9px; color: var(--ink-4); font-weight: 500; }
.liq-cell.is-peak .liq-amt { color: var(--mg); }
.liq-opp {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--mg);
  margin-top: 1px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.peak-flag {
  position: absolute;
  top: -10px;
  right: 8px;
  background: var(--mg);
  color: white;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px -4px color-mix(in oklch, var(--mg) 50%, transparent);
}

/* ---------- Cumulative ---------- */
.cumul-section {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 18px 0 12px;
  margin-bottom: 24px;
  display: flex;
}
.cumul { display: flex; width: 100%; }

.cumul-head {
  width: 240px;
  flex: 0 0 240px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cumul-label {
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}
.cumul-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--mg);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.cumul-svg {
  position: absolute;
  left: 240px;
  right: 0;
  top: 18px;
  height: 60px;
  width: calc(100% - 240px);
}
.cumul-section {
  position: relative;
}
.cumul-axis {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  flex: 1;
  align-self: end;
  margin-top: 70px;
}
.cumul-tick {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  text-align: center;
  padding: 6px 4px 0;
  border-right: 1px solid var(--line-2);
}
.cumul-tick:last-child { border-right: none; }
.cumul-tick.is-hover {
  color: var(--mg);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.page-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.foot-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-mark { font-size: 11px; }
.foot-right { display: flex; gap: 8px; }
.foot-sep { color: var(--ink-4); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .page { padding: 24px 24px 36px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .kpi:nth-child(even) { border-right: none; }
  .kpi:last-child { border-right: none; border-bottom: none; }
}
@media (max-width: 900px) {
  .row-label, .month-header-spacer, .rows-grid-spacer, .cumul-head { width: 180px; flex-basis: 180px; }
  .cumul-svg { left: 180px; width: calc(100% - 180px); }
  .bar-note { display: none; }
  .seg-amt { font-size: 9px; }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: bdIn 180ms ease forwards;
}
@keyframes bdIn { to { opacity: 1; } }

.modal {
  background: var(--paper);
  border-radius: 10px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px -20px rgba(0,0,0,0.25),
              0 8px 24px -8px rgba(0,0,0,0.15);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: mdIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes mdIn { to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.modal-head::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--bar-tint, var(--mg));
}
.modal-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.modal-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}
.modal-close {
  border: 1px solid var(--line);
  background: var(--paper);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 14px;
  flex: 0 0 auto;
  transition: all 120ms ease;
}
.modal-close:hover {
  border-color: var(--mg);
  color: var(--mg);
}

.modal-body { padding: 18px 24px 22px; }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 18px;
}
.modal-stat {
  background: var(--paper);
  padding: 12px 14px;
}
.modal-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.modal-stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.modal-stat-value.is-accent { color: var(--mg); }
.modal-stat-value.is-opp { color: var(--mg); opacity: 0.85; }

.sub-opp { color: var(--mg); }

.modal-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 18px 0 10px;
}
.section-title-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.free-token {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--mg);
  background: color-mix(in oklch, var(--mg) 10%, white);
  border: 1px solid var(--mg);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #fafafa);
  transition: border-color 120ms ease, transform 120ms ease;
}
.team-item:hover { border-color: color-mix(in oklch, var(--bar-tint, #FF00FF) 35%, var(--line)); }

.team-item.is-free {
  border: 1px solid var(--mg);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklch, var(--mg) 6%, white) 0,
      color-mix(in oklch, var(--mg) 6%, white) 8px,
      color-mix(in oklch, var(--mg) 12%, white) 8px,
      color-mix(in oklch, var(--mg) 12%, white) 16px);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,0,255,0.05),
              0 4px 14px -8px color-mix(in oklch, var(--mg) 40%, transparent);
}
.team-item.is-free::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--mg);
  border-radius: 6px 0 0 6px;
}
.team-item.is-free .avatar {
  background: color-mix(in oklch, var(--mg) 14%, white);
  color: var(--mg);
  border-color: var(--mg);
  font-weight: 700;
}

.team-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: white;
  background: var(--mg);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  line-height: 1;
}

.team-share {
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.share-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.share-amt {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}
.free-pct { color: var(--mg); }
.free-amt {
  color: var(--mg);
  font-weight: 600;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bar-soft, var(--mg-soft));
  color: var(--bar-tint, var(--mg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
  border: 1px solid color-mix(in oklch, var(--bar-tint, #FF00FF) 35%, white);
}
.team-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.team-role {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.team-text { flex: 1; min-width: 0; }

.modal-note {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  background: var(--bg);
  border-left: 2px solid var(--bar-tint, var(--mg));
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
}

/* ---------- Empty state ---------- */
.empty-state {
  border: 1px dashed var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 28px 28px;
  text-align: center;
  margin-bottom: 24px;
}
.empty-state h2 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.empty-state p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
.empty-state a { color: var(--mg); border-bottom: 1px solid var(--mg); text-decoration: none; }

/* ---------- API key gate ---------- */
.api-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.api-gate-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  width: min(420px, 100%);
  box-shadow: 0 24px 80px -20px rgba(0,0,0,0.18),
              0 8px 24px -8px rgba(0,0,0,0.10);
}
.api-gate-brand { margin-bottom: 18px; }
.api-gate-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.api-gate-card p {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}
.api-gate-error {
  border: 1px solid var(--mg);
  background: color-mix(in oklch, var(--mg) 6%, white);
  color: var(--mg);
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.api-gate-card input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  margin-bottom: 12px;
}
.api-gate-card input:focus {
  border-color: var(--mg);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--mg) 12%, transparent);
}
.api-gate-btn {
  width: 100%;
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--mg);
  background: var(--mg);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: filter 120ms ease;
}
.api-gate-btn:hover { filter: brightness(1.05); }

.foot-link {
  color: var(--ink-3);
  border-bottom: 1px dotted var(--ink-4);
  text-decoration: none;
  cursor: pointer;
}
.foot-link:hover { color: var(--mg); border-bottom-color: var(--mg); }

/* ---------- Print ---------- */
@media print {
  body::before { display: none; }
  body { background: white; }
  .page { padding: 12mm; max-width: none; }
  .chart, .kpis, .cumul-section { box-shadow: none; }
  .bar { transform: scaleX(1) !important; opacity: 1 !important; }
  .liq-bar { transform: scaleY(1) !important; }
  .modal-backdrop { display: none; }
  .api-gate { display: none; }
}
