:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: #15171b;
  --panel-border: #24262b;
  --panel-border-hover: #34373e;
  --text: #f2f3f5;
  --text-dim: #8b8f98;
  --text-faint: #54585f;
  --green: #3ed598;
  --red: #ff5470;
  --accent: #e0505a;
  --accent-dim: #311113;
  --display: "Anton", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
  --radius: 3px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  padding-bottom: 60px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at top, rgba(224,80,90,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

::selection {
  background: var(--accent);
  color: #000;
}

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 11, 13, 0.92);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.launcher-mark {
  display: block;
  width: auto;
  height: 22px;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--panel-border-hover);
}

.brand-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand img.lol-mark {
  display: block;
  width: auto;
  height: 13px;
  align-self: flex-start;
  flex-shrink: 0;
  opacity: 0.55;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.league-tabs {
  display: flex;
  gap: 2px;
  max-width: min(620px, 52vw);
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.league-tab {
  min-height: 29px;
  padding: 7px 12px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: all 0.15s;
}

.league-tab.active {
  background: var(--accent);
  color: #000;
}

.league-tab.custom {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.league-tab.custom.active {
  box-shadow: none;
}

.league-tab:not(.active):not(:disabled):hover {
  color: var(--text);
}

.league-tab:disabled {
  color: rgba(147, 151, 157, 0.35);
  cursor: not-allowed;
  opacity: 0.55;
}

/* Category the viewing-as channel belongs to — always in scope, can't be toggled off. */
.league-tab.locked.active {
  cursor: default;
}

.league-tab.locked.active::after {
  content: "\1F512";
  margin-left: 5px;
  font-size: 9px;
  opacity: 0.7;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--panel-border);
  padding-left: 14px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
}

.auth-btn,
.export-btn,
.channel-selector-btn,
.filters-btn {
  min-height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 8px 12px;
}

.auth-btn:not(:disabled):hover,
.export-btn:not(:disabled):hover,
.channel-selector-btn:not(:disabled):hover,
.filters-btn:hover {
  border-color: var(--accent);
}

.filters-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 9.5px;
  padding: 0 4px;
}

.channel-selector-btn {
  border-color: var(--panel-border-hover);
  color: var(--text-dim);
}

.channel-selector-btn strong {
  color: var(--text);
}

.muted-btn {
  color: var(--text-dim);
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(380px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 32px 28px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.auth-brand .launcher-mark {
  height: 36px;
  width: auto;
}

.auth-card h1 {
  margin: 0 0 20px;
  color: var(--text);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
}

.auth-error,
.auth-status {
  margin-bottom: 16px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 10px 12px;
}

.auth-error {
  border: 1px solid rgba(255, 84, 112, 0.35);
  background: rgba(255, 84, 112, 0.1);
  color: var(--red);
}

.auth-status {
  border: 1px solid rgba(62, 213, 152, 0.35);
  background: rgba(62, 213, 152, 0.1);
  color: var(--green);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  margin-top: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-form .filter-input {
  width: 100%;
}

.auth-submit {
  margin-top: 20px;
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #000;
  text-align: center;
}

.auth-submit:hover {
  border-color: var(--accent);
  opacity: 0.9;
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

#authForgotButton {
  display: block;
  margin: 14px auto 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

.auth-google {
  width: 100%;
  text-align: center;
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--panel-border);
  padding-left: 14px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
}

.live-dot {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--green);
  border-radius: 50%;
  animation: pulse-ring 1.8s ease-out infinite;
}

@keyframes pulse-ring {
  0% { opacity: 1; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.8); }
}

.page-tabs {
  position: sticky;
  top: 69px;
  z-index: 40;
  display: flex;
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
  border-bottom: 1px solid var(--panel-border);
  background: #0d0e10;
  padding: 0 28px;
}

.page-tab {
  min-height: 41px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.page-tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 28px;
  border-bottom: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.custom-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.custom-range-controls[hidden] {
  display: none;
}

.custom-range-controls .filter-input {
  width: auto;
}

.compare-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 0;
  user-select: none;
}

.mini-switch {
  position: relative;
  width: 30px;
  height: 17px;
  border: 1px solid var(--panel-border-hover);
  border-radius: 9px;
  background: var(--panel-border);
  transition: background 0.2s;
}

.mini-switch.on {
  background: var(--accent);
}

.mini-knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #0a0b0d;
  transition: left 0.2s;
}

.mini-switch.on .mini-knob {
  left: 14px;
  background: #000;
}

.control-note {
  margin-left: auto;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.spacer {
  flex: 1 1 auto;
}

.filter-select,
.filter-input,
.catalog-search {
  min-height: 36px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 9px 10px;
}

.filter-input {
  width: min(360px, 100%);
}

.mini-strip {
  overflow-x: auto;
  border-bottom: 1px solid var(--panel-border);
  background: #0d0e10;
  padding: 0 28px;
}

.mini-strip-inner {
  display: flex;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.mini-stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 18px;
  border-right: 1px solid var(--panel-border);
  white-space: nowrap;
}

.mini-stat:first-child {
  padding-left: 0;
}

.mini-stat .v {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.mini-stat .l {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--panel-border);
  background: #0d0e10;
  padding: 9px 0;
}

.ticker {
  display: inline-block;
  padding-left: 100%;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  animation: ticker-slide 68s linear infinite;
}

.ticker:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 36px;
}

.ticker .label {
  color: var(--text-dim);
  font-weight: 700;
}

.tick-up {
  color: var(--green);
}

.tick-down {
  color: var(--red);
}

.tick-neutral,
.ticker-value {
  color: var(--text-faint);
}

@keyframes ticker-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 0;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

.client-banner,
.owned-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.03);
}

.ctitle {
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0;
}

.csub {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
}

.badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.metric-block {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card {
  min-height: 116px;
  padding: 18px;
  text-align: center;
}

.stat-card .big {
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: var(--display);
  font-size: 38px;
  line-height: 1;
}

.stat-card .lbl,
.metric-block .l {
  margin-top: 8px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stat-card .sub {
  margin-top: 3px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
}

.delta {
  margin-left: 6px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.delta.up {
  color: var(--green);
}

.delta.down {
  color: var(--red);
}

.stat-card .delta {
  display: block;
  margin-top: 4px;
  margin-left: 0;
  font-size: 11px;
}

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

.grid.full,
.grid .full {
  grid-template-columns: 1fr;
}

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

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-eyebrow {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
}

.panel-head h3 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meta {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.col-head,
.rank-row {
  display: grid;
  grid-template-columns: 24px minmax(150px, 1fr) 100px 82px;
  gap: 10px;
  align-items: center;
}

/* Subs mode adds a second data column (subs gained + lifetime subs) alongside velocity. */
.col-head.mode-subs,
.rank-row.mode-subs {
  grid-template-columns: 24px minmax(150px, 1fr) 90px 90px 82px;
}

/* Same clickable-header language as the table sort headers (Leaderboard, Catalog,
   Players): pointer cursor, accent color on hover or while active. */
.col-head span.sortable {
  cursor: pointer;
}

.col-head span.sortable:hover,
.col-head span.sortable.sorted {
  color: var(--accent);
}

.col-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border-hover);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.rank-row {
  min-height: 42px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rk {
  color: var(--text-faint);
}

.nm,
.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.swatch {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.team-link {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-link:hover {
  color: var(--accent);
}

.num {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.vel {
  overflow: hidden;
  color: var(--green);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vel.down {
  color: var(--red);
}


.video-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
}

.video-card:last-child {
  border-bottom: 0;
}

.thumb {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 40px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), #000);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb a {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.thumb a:hover {
  opacity: 0.8;
}

.thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent rgba(255,255,255,0.85);
  transform: translate(-50%, -50%);
}

.vc-body {
  flex: 1 1 auto;
  min-width: 0;
}

.vc-title {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.vc-meta .chip {
  padding: 2px 7px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}

.vc-views {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  text-align: right;
}

.vc-views .lbl {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.anomaly,
.metric-block {
  padding: 14px;
}

.anomaly-title {
  margin-bottom: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.anomaly-desc {
  min-height: 34px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

.anomaly-tag {
  display: inline-block;
  margin-top: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.benchmark-row {
  margin-bottom: 16px;
}

.benchmark-row:last-child {
  margin-bottom: 0;
}

.benchmark-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.benchmark-label .you {
  color: var(--accent);
  font-weight: 700;
}

.benchmark-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel-border);
}

.benchmark-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

.benchmark-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--text-dim);
}

.benchmark-nums {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.metric-blocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-blocks.compact {
  margin-bottom: 14px;
}

.metric-block .v {
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.05;
}

.selected-channel {
  min-height: 280px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel-border);
}

.detail-list > div,
.coverage-body > div {
  min-width: 0;
  padding: 12px;
  background: #101114;
}

.detail-list span,
.coverage-body span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.detail-list strong,
.coverage-body strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
}

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

.coverage-card {
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: #101114;
}

.coverage-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
}

.coverage-heading span {
  color: var(--accent);
}

.coverage-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--panel-border);
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap.embedded {
  margin-bottom: 14px;
}

.catalog-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: 12px;
}

.catalog-table th {
  padding: 10px;
  border-bottom: 1px solid var(--panel-border-hover);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.catalog-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-dim);
  vertical-align: top;
}

.catalog-table tbody tr:hover td {
  background: rgba(255,255,255,0.018);
}

/* Numeric columns render right-aligned in the body (.num-cell); align their
   headers to match so headers sit over their columns. */
.catalog-table th.num {
  text-align: right;
}

.catalog-table th[data-sort],
.catalog-table th[data-plsort],
.catalog-table th[data-lbsort] {
  cursor: pointer;
}

.catalog-table th[data-sort]:hover,
.catalog-table th[data-plsort]:hover,
.catalog-table th[data-lbsort]:hover,
.catalog-table th.sorted {
  color: var(--accent);
}

.catalog-title-cell {
  max-width: 420px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.type-chip.SHORT,
.type-chip.V-SHORT-FORM {
  background: rgba(0,128,198,0.16);
  color: #4fb8ee;
}

.type-chip.V-LONG-FORM {
  background: rgba(160,120,255,0.16);
  color: #b199ff;
}

.type-chip.STREAMED {
  background: rgba(62,213,152,0.16);
  color: var(--green);
}

.type-chip.UPCOMING {
  background: rgba(255,199,44,0.16);
  color: #ffc72c;
}

.source-badge {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-badge.Title {
  background: rgba(62,213,152,0.16);
  color: var(--green);
}

.source-badge.Tags {
  background: rgba(255,199,44,0.16);
  color: #ffc72c;
}

.source-badge.Description {
  background: rgba(160,120,255,0.16);
  color: #b199ff;
}

.num-cell {
  color: var(--text);
  font-family: var(--mono);
  text-align: right;
  white-space: nowrap;
}

.empty-state,
.empty-table,
.dna-chart {
  border: 1px dashed var(--panel-border-hover);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  padding: 16px;
}

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

.error {
  color: var(--red);
}

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

.dna-chart {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--accent);
  font-family: var(--display);
  font-size: 44px;
}

.heatmap-shell {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.hm-day-col {
  display: grid;
  gap: 4px;
}

.heatmap-cell {
  display: grid;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(224,80,90,0.22);
  border-radius: 2px;
  background: rgba(224,80,90,0.08);
  color: rgba(242,243,245,0.32);
  font-family: var(--mono);
  font-size: 7px;
}

.heatmap-cell.hm-empty {
  border-color: var(--panel-border);
  background: rgba(255,255,255,0.02);
}

.hm-day-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
}

.hm-day-labels span {
  text-align: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  text-transform: uppercase;
}

.hm-legend {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

.cadence-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

.chart-note {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  color: var(--text-dim);
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 14px;
  min-height: 60px;
}

.keyword-chip {
  color: var(--accent);
  font-weight: 600;
  line-height: 1.2;
  cursor: default;
  transition: opacity 0.15s ease;
}

.keyword-chip:hover {
  opacity: 1 !important;
}

.owned-banner {
  justify-content: flex-start;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.owned-banner .dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.requirements-list {
  display: grid;
  gap: 10px;
}

.requirement {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(180px, 1fr) minmax(280px, 2fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}

.requirement-view {
  color: var(--accent);
  font-family: var(--display);
  font-size: 14px;
}

.requirement-table {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.requirement p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  max-width: 1400px;
  margin: 30px auto 0;
  padding: 0 28px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  flex-wrap: wrap;
}

.channel-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.channel-modal-overlay[hidden] {
  display: none;
}

.channel-modal {
  width: min(720px, 100%);
  max-height: min(760px, 88vh);
  overflow: hidden;
  border: 1px solid var(--panel-border-hover);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0,0,0,0.58);
}

.channel-modal.filter-panel {
  display: flex;
  flex-direction: column;
}

.channel-modal.filter-panel .channel-modal-head {
  flex: 0 0 auto;
}

.channel-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--panel-border);
}

.channel-modal-head h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
}

.channel-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: #0f1013;
  color: var(--text-dim);
  font-family: var(--mono);
  font-weight: 700;
}

.channel-modal-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.channel-modal-search {
  width: calc(100% - 36px);
  min-height: 38px;
  margin: 18px 18px 10px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: #0f1013;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 9px 10px;
}

.channel-modal-meta {
  padding: 0 18px 12px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.channel-modal-list {
  display: grid;
  max-height: 520px;
  overflow-y: auto;
  border-top: 1px solid var(--panel-border);
}

.channel-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-bottom: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.channel-option:hover,
.channel-option.active {
  background: rgba(224,80,90,0.09);
}

.channel-option.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.channel-option-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 700;
}

.channel-option-main span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-option-meta {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.modal-retry {
  display: block;
  width: max-content;
  min-height: 30px;
  margin-top: 12px;
  border: 1px solid var(--panel-border-hover);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 7px 10px;
}

.filter-panel-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-y: auto;
  min-height: 0;
}

.filter-section-title {
  margin-bottom: 8px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip-row:empty::after {
  content: "None yet.";
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10.5px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--panel-border-hover);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 6px 10px;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.filter-chip .remove {
  color: var(--text-faint);
  font-weight: 700;
}

.filter-chip .remove:hover {
  color: var(--red);
}

.filter-conditions-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-condition-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(140px, 1fr) minmax(120px, 1fr) 28px;
  gap: 8px;
  align-items: center;
}

.filter-remove-btn {
  min-height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text-faint);
  font-weight: 700;
}

.filter-remove-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-remove-btn.add:hover {
  border-color: var(--green);
  color: var(--green);
}

.admin-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.admin-subnav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 16px;
}

.admin-subnav-btn {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.admin-subnav-btn:hover {
  color: var(--text);
  border-color: var(--panel-border);
}

.admin-subnav-btn.active {
  background: var(--panel);
  border-color: var(--panel-border-hover);
  color: var(--accent);
}

.admin-subpage {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.admin-subpage.active {
  display: flex;
}

.admin-sync-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-sync-row:last-child {
  margin-bottom: 0;
}

.admin-override-add {
  margin-bottom: 14px;
}

.player-override-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(90px, 0.6fr) minmax(90px, 0.6fr) 28px;
  gap: 8px;
  align-items: center;
}

.custom-category-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 28px 28px;
  gap: 8px;
  align-items: center;
}

#customCategoryChannelList {
  max-height: 280px;
}

.filter-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
}

.filter-panel-actions .channel-modal-search {
  flex: 1 1 220px;
  width: auto;
  margin: 0;
}

.team-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.team-modal-overlay[hidden] {
  display: none;
}

.team-modal {
  width: min(880px, 100%);
  max-height: min(820px, 90vh);
  overflow-y: auto;
  border: 1px solid var(--panel-border-hover);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0,0,0,0.58);
}

.team-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
}

.team-modal-head .ti {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-modal-head .sw {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.team-modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.team-modal-head h2 span {
  margin-left: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.team-modal-head .rk {
  margin-top: 4px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10.5px;
}

.team-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: #0f1013;
  color: var(--text-dim);
  font-family: var(--mono);
  font-weight: 700;
}

.team-modal-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.team-modal-body {
  display: grid;
  gap: 20px;
  padding: 18px;
}

.tm-section-title {
  margin-bottom: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tm-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tm-stat {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  padding: 12px;
  text-align: center;
}

.tm-stat .v {
  color: var(--accent);
  font-family: var(--display);
  font-size: 22px;
}

.tm-stat .l {
  margin-top: 6px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tm-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tm-empty {
  border: 1px dashed var(--panel-border-hover);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 14px;
}

#growthChart {
  max-width: 100%;
}

.video-modal-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 54px;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.06);
}

.video-modal-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-modal-thumb a {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.video-modal-thumb a:hover {
  opacity: 0.8;
}

.catalog-row {
  cursor: pointer;
}

#videoHistoryChart {
  max-width: 100%;
}

@media (max-width: 1100px) {
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid,
  .grid.thirds,
  .metric-blocks {
    grid-template-columns: 1fr;
  }

  .league-tabs {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .top,
  .client-banner,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-tabs {
    top: 118px;
  }

  .launcher-mark {
    width: auto;
    max-width: min(240px, 70vw);
  }

  .auth-actions,
  .live-indicator {
    border-left: 0;
    padding-left: 0;
  }

  .control-bar,
  .mini-strip,
  .ticker,
  main,
  footer,
  .top,
  .page-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filter-input,
  .filter-select,
  .export-btn,
  .compare-toggle,
  .control-note {
    width: 100%;
  }

  .stat-cards,
  .catalog-controls,
  .detail-list,
  .placeholder-grid,
  .coverage-grid,
  .requirement,
  .heatmap-shell,
  .tm-stat-row,
  .tm-two-col,
  .filter-condition-row {
    grid-template-columns: 1fr;
  }

  .col-head,
  .rank-row {
    grid-template-columns: 24px minmax(140px, 1fr) 70px;
  }

  .col-head span:nth-child(4),
  .col-head span:nth-child(5),
  .rank-row span:nth-child(4),
  .rank-row span:nth-child(5) {
    display: none;
  }
}
