:root {
  --assembly-bg: #1a1a2e;
  --assembly-card: #2a2a3e;
  --assembly-hover: #3a3a4e;
  --assembly-text: #e0e0e0;
  --assembly-muted: #a0a0b0;
  --assembly-purple: #c084fc;
  --assembly-purple-deep: #7c3aed;
  --assembly-pink: #f472b6;
  --assembly-success: #4ade80;
  --assembly-warning: #fbbf24;
}

.assembly-page { background: radial-gradient(circle at 10% 5%, rgba(192,132,252,.18), transparent 30%), radial-gradient(circle at 82% 8%, rgba(244,114,182,.12), transparent 34%), var(--assembly-bg); }
.assembly-shell { max-width: 1380px; }
.product-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; max-width: 100%; padding: 8px; margin-bottom: 18px; position: sticky; top: 12px; z-index: 10; }
.product-nav a { color: var(--assembly-muted); text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: .02em; padding: 10px 14px; border-radius: 999px; border: 1px solid transparent; }
.product-nav a:hover { color: var(--assembly-text); background: rgba(255,255,255,.05); }
.product-nav a.active { color: #fff; background: linear-gradient(135deg, rgba(124,58,237,.85), rgba(244,114,182,.65)); box-shadow: 0 12px 28px rgba(124,58,237,.25); }
.assembly-hero { overflow: hidden; position: relative; }
.assembly-hero::after { content: ''; position: absolute; inset: auto -12% -45% 55%; height: 280px; background: radial-gradient(circle, rgba(244,114,182,.22), transparent 64%); pointer-events: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.status-pill { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; border: 1px solid rgba(192,132,252,.28); border-radius: 999px; color: var(--assembly-text); background: rgba(124,58,237,.13); font-size: 12px; font-weight: 800; }
.muted-pill { color: var(--assembly-muted); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.assembly-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.assembly-kpis .stat-card { min-height: 126px; position: relative; overflow: hidden; }
.assembly-kpis .stat-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(192,132,252,.12), transparent 45%); opacity: .9; pointer-events: none; }
.assembly-kpis .stat-value { font-size: clamp(32px, 4vw, 52px); }
.source-card { min-height: 210px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.source-metric { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); }
.source-metric span { display: block; color: var(--assembly-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.source-metric strong { display: block; margin-top: 8px; color: var(--assembly-text); font-size: 24px; }
.assembly-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.leaderboard-stack { display: grid; gap: 18px; }
.leaderboard-card { min-height: 190px; }
.highlight-card { border-color: rgba(74,222,128,.32); box-shadow: 0 0 0 1px rgba(74,222,128,.08), 0 24px 80px rgba(74,222,128,.08); }
.leader-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.leader-row:last-child { border-bottom: 0; }
.rank-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: rgba(192,132,252,.13); color: var(--assembly-purple); font-family: 'IBM Plex Mono', monospace; font-weight: 800; font-size: 12px; }
.leader-name { flex: 1; font-weight: 800; color: var(--assembly-text); }
.leader-score { color: var(--assembly-success); font-family: 'IBM Plex Mono', monospace; font-weight: 800; }
.bar-list { display: grid; gap: 12px; margin: 6px 0 22px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 52px; gap: 12px; align-items: center; }
.bar-label { color: var(--assembly-text); font-weight: 800; font-size: 13px; }
.bar-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; border: 1px solid rgba(255,255,255,.06); }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--assembly-purple-deep), var(--assembly-pink)); box-shadow: 0 0 18px rgba(244,114,182,.28); }
.bar-value { color: var(--assembly-muted); text-align: right; font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 12px; }
.assembly-table-shell table { width: 100%; border-collapse: collapse; }
.assembly-table-shell th, .assembly-table-shell td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: right; }
.assembly-table-shell th:first-child, .assembly-table-shell td:first-child { text-align: left; }
.assembly-table-shell th { color: var(--assembly-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.assembly-table-shell td { color: var(--assembly-text); font-family: 'IBM Plex Mono', monospace; }
.assembly-table-shell td:first-child { font-family: Manrope, system-ui, sans-serif; font-weight: 800; }
.positive { color: var(--assembly-success) !important; }
.tab-agent-list { display: grid; gap: 8px; margin-top: 12px; }
.tab-agent-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.tab-agent-row span { color: var(--assembly-muted); font-family: 'IBM Plex Mono', monospace; font-weight: 800; }
.error-box { padding: 18px; border-radius: 16px; color: var(--assembly-warning); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.18); }
.source-splits.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1040px) { .assembly-kpis, .source-grid, .assembly-main-grid, .source-splits.three-col { grid-template-columns: 1fr 1fr; } .leaderboard-stack { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .product-nav { flex-wrap: nowrap; overflow-x: auto; } .assembly-kpis, .source-grid, .assembly-main-grid, .leaderboard-stack, .source-splits.three-col { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 1fr; gap: 6px; } .bar-value { text-align: left; } }


/* Assembly page feedback fixes */
.assembly-table-shell { width: 100%; overflow-x: auto; }
.assembly-table-shell table { table-layout: fixed; min-width: 620px; }
.assembly-table-shell th, .assembly-table-shell td { white-space: nowrap; vertical-align: middle; }
.assembly-table-shell th:first-child, .assembly-table-shell td:first-child { width: 38%; }
.assembly-table-shell th:not(:first-child), .assembly-table-shell td:not(:first-child) { width: 15.5%; text-align: right; }
.assembly-table-shell th { line-height: 1.1; }
.source-splits.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .source-splits.two-col { grid-template-columns: 1fr; } }


/* Grid table replacement, avoids global table styles forcing stacked headers */
.assembly-table-shell { width: 100%; overflow-x: auto; }
.agent-grid-table {
  display: grid;
  grid-template-columns: minmax(150px, 1.6fr) repeat(4, minmax(82px, .7fr));
  min-width: 620px;
  width: 100%;
}
.agent-cell {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: var(--assembly-text);
  font-family: 'IBM Plex Mono', monospace;
  text-align: right;
  white-space: nowrap;
}
.agent-head {
  color: var(--assembly-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}
.agent-head:first-child, .agent-name {
  text-align: left;
}
.agent-name {
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 800;
}
@media (max-width: 760px) {
  .agent-grid-table { grid-template-columns: minmax(140px, 1.4fr) repeat(4, minmax(74px, .65fr)); min-width: 540px; }
  .agent-cell { padding: 11px 10px; }
}


/* Full-width all-time leaderboard */
.assembly-all-time-section { display: block; }
.all-time-panel { width: 100%; }
.full-leader-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 28px; row-gap: 0; }
.full-leader-list .leader-row { min-width: 0; }
