/* BrawlTools design system — no build step. Tokens on :root, light theme via [data-theme=light]. */
:root {
  color-scheme: dark;
  --bt-bg: #0b1016;
  --bt-bg-2: #0e151d;
  --bt-surface: #121a24;
  --bt-surface-2: #182230;
  --bt-surface-hover: #1c2836;
  --bt-border: #223040;
  --bt-border-strong: #2f4257;
  --bt-text: #e6eaf2;
  --bt-text-muted: #9aa6b8;
  --bt-text-faint: #6b7788;
  --bt-text-on-accent: #06101c;
  --bt-accent: #4ea2ff;
  --bt-accent-hover: #6fb4ff;
  --bt-accent-soft: rgba(78, 162, 255, 0.16);
  --bt-ok: #3ddc84;
  --bt-ok-soft: rgba(61, 220, 132, 0.16);
  --bt-warn: #ffb547;
  --bt-warn-soft: rgba(255, 181, 71, 0.16);
  --bt-danger: #ff6b6b;
  --bt-danger-soft: rgba(255, 107, 107, 0.16);
  --bt-info: #7cc4ff;
  --bt-info-soft: rgba(124, 196, 255, 0.14);
  --bt-chart-1: #4ea2ff;
  --bt-chart-2: #3ddc84;
  --bt-chart-3: #ffb547;
  --bt-chart-4: #ff6b6b;
  --bt-chart-5: #7cc4ff;
  --bt-chart-6: #b58cff;
  --bt-s1: 4px; --bt-s2: 8px; --bt-s3: 12px; --bt-s4: 16px; --bt-s5: 24px; --bt-s6: 32px; --bt-s7: 40px; --bt-s8: 48px;
  --bt-r-sm: 6px; --bt-r-md: 10px; --bt-r-lg: 14px; --bt-r-pill: 999px;
  --bt-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --bt-shadow-2: 0 12px 40px rgba(0, 0, 0, 0.45);
  --bt-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bt-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bt-fs-xs: 12px; --bt-fs-sm: 13px; --bt-fs-md: 14px; --bt-fs-lg: 16px; --bt-fs-xl: 20px; --bt-fs-2xl: 28px;
  --bt-lh: 1.5;
  --bt-sidebar-w: 248px; --bt-topbar-h: 56px; --bt-content-max: 1320px; --bt-public-max: 1120px;
  --bt-ease: 160ms ease;
  --bt-z-nav: 30; --bt-z-drawer: 40; --bt-z-modal: 50; --bt-z-toast: 60;
}
[data-theme="light"] {
  color-scheme: light;
  --bt-bg: #f6f8fb; --bt-bg-2: #eef2f7; --bt-surface: #ffffff; --bt-surface-2: #f3f6fa; --bt-surface-hover: #eaf0f7;
  --bt-border: #dde4ee; --bt-border-strong: #c3cedd;
  --bt-text: #1b2430; --bt-text-muted: #5b6678; --bt-text-faint: #8a94a6; --bt-text-on-accent: #ffffff;
  --bt-accent: #2b6fe0; --bt-accent-hover: #1f5fc9; --bt-accent-soft: rgba(43, 111, 224, 0.12);
  --bt-ok: #1a9f5a; --bt-ok-soft: rgba(26, 159, 90, 0.12);
  --bt-warn: #c77700; --bt-warn-soft: rgba(199, 119, 0, 0.12);
  --bt-danger: #d64545; --bt-danger-soft: rgba(214, 69, 69, 0.12);
  --bt-info: #2a7fc9; --bt-info-soft: rgba(42, 127, 201, 0.12);
  --bt-chart-1: #2b6fe0; --bt-chart-2: #1a9f5a; --bt-chart-3: #c77700; --bt-chart-4: #d64545; --bt-chart-5: #2a7fc9; --bt-chart-6: #7a4fd6;
  --bt-shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.08);
  --bt-shadow-2: 0 12px 40px rgba(16, 24, 40, 0.18);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bt-bg: #f6f8fb; --bt-bg-2: #eef2f7; --bt-surface: #ffffff; --bt-surface-2: #f3f6fa; --bt-surface-hover: #eaf0f7;
    --bt-border: #dde4ee; --bt-border-strong: #c3cedd;
    --bt-text: #1b2430; --bt-text-muted: #5b6678; --bt-text-faint: #8a94a6; --bt-text-on-accent: #ffffff;
    --bt-accent: #2b6fe0; --bt-accent-hover: #1f5fc9; --bt-accent-soft: rgba(43, 111, 224, 0.12);
    --bt-ok: #1a9f5a; --bt-ok-soft: rgba(26, 159, 90, 0.12);
    --bt-warn: #c77700; --bt-warn-soft: rgba(199, 119, 0, 0.12);
    --bt-danger: #d64545; --bt-danger-soft: rgba(214, 69, 69, 0.12);
    --bt-info: #2a7fc9; --bt-info-soft: rgba(42, 127, 201, 0.12);
    --bt-chart-1: #2b6fe0; --bt-chart-2: #1a9f5a; --bt-chart-3: #c77700; --bt-chart-4: #d64545; --bt-chart-5: #2a7fc9; --bt-chart-6: #7a4fd6;
    --bt-shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.08);
    --bt-shadow-2: 0 12px 40px rgba(16, 24, 40, 0.18);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--bt-font); font-size: var(--bt-fs-md); line-height: var(--bt-lh);
  color: var(--bt-text); background: linear-gradient(180deg, var(--bt-bg) 0%, var(--bt-bg-2) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bt-accent); text-decoration: none; }
a:hover { color: var(--bt-accent-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 var(--bt-s2); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: var(--bt-fs-2xl); } h2 { font-size: var(--bt-fs-xl); } h3 { font-size: var(--bt-fs-lg); } h4 { font-size: var(--bt-fs-md); }
p { margin: 0 0 var(--bt-s3); }
code, pre, .bt-mono { font-family: var(--bt-font-mono); font-size: 0.92em; }
pre { background: var(--bt-surface-2); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md); padding: var(--bt-s3); overflow: auto; }
code { background: var(--bt-surface-2); border-radius: var(--bt-r-sm); padding: 1px 5px; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--bt-border); margin: var(--bt-s4) 0; }
:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; border-radius: var(--bt-r-sm); }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }
.bt-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; }
.bt-skip { position: absolute; left: -999px; top: 8px; background: var(--bt-accent); color: var(--bt-text-on-accent); padding: 8px 12px; border-radius: var(--bt-r-sm); z-index: 100; }
.bt-skip:focus { left: 8px; }
.bt-muted { color: var(--bt-text-muted); } .bt-faint { color: var(--bt-text-faint); }
.bt-text-warn { color: var(--bt-warn); } .bt-text-danger { color: var(--bt-danger); }
.bt-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-num, .bt-table__num { font-variant-numeric: tabular-nums; text-align: right; }
.bt-small { font-size: var(--bt-fs-sm); } .bt-xs { font-size: var(--bt-fs-xs); }
.bt-mt-0 { margin-top: 0; } .bt-mt-2 { margin-top: var(--bt-s2); } .bt-mt-4 { margin-top: var(--bt-s4); } .bt-mb-0 { margin-bottom: 0; }
.bt-mt-3 { margin-top: var(--bt-s3); } .bt-text-right { text-align: right; } .bt-strong { font-weight: 600; color: var(--bt-text); }
.bt-avatar { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px; object-fit: cover; background: var(--bt-surface-2); }
.bt-code { font-family: var(--bt-font-mono); font-size: var(--bt-fs-xs); white-space: pre-wrap; word-break: break-word; }
.bt-chip.is-hit { background: var(--bt-accent-soft); border-color: var(--bt-accent); }
.bt-nowrap { white-space: nowrap; }
.bt-brawlers td { vertical-align: middle; } .bt-brawlers .bt-chip + .bt-chip { margin-left: 4px; }
.bt-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--bt-s4); align-items: start; }
.bt-center { text-align: center; } .bt-right { text-align: right; }
.bt-w-100 { width: 100%; }

/* ---------- app shell ---------- */
.bt-app { display: grid; grid-template-columns: var(--bt-sidebar-w) 1fr; min-height: 100vh; }
.bt-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bt-surface); border-right: 1px solid var(--bt-border);
  padding: var(--bt-s4) var(--bt-s3); display: flex; flex-direction: column; gap: var(--bt-s2); z-index: var(--bt-z-nav);
}
.bt-sidebar__brand { display: flex; align-items: center; gap: var(--bt-s2); padding: var(--bt-s2) var(--bt-s2) var(--bt-s4); font-weight: 700; font-size: var(--bt-fs-lg); color: var(--bt-text); }
.bt-sidebar__brand:hover { text-decoration: none; }
.bt-sidebar__logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--bt-accent), var(--bt-chart-6)); display: inline-grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.bt-sidebar__group { margin-top: var(--bt-s3); padding: 0 var(--bt-s2); font-size: var(--bt-fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--bt-text-faint); font-weight: 600; }
.bt-nav-item { display: flex; align-items: center; gap: var(--bt-s3); padding: 9px var(--bt-s3); border-radius: var(--bt-r-md); color: var(--bt-text-muted); font-weight: 500; transition: background var(--bt-ease), color var(--bt-ease); }
.bt-nav-item:hover { background: var(--bt-surface-hover); color: var(--bt-text); text-decoration: none; }
.bt-nav-item--active, .bt-nav-item[aria-current="page"] { background: var(--bt-accent-soft); color: var(--bt-accent); }
.bt-nav-item__icon { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.9; }
.bt-sidebar__footer { margin-top: auto; padding: var(--bt-s3) var(--bt-s2) 0; font-size: var(--bt-fs-xs); color: var(--bt-text-faint); }
.bt-main { min-width: 0; display: flex; flex-direction: column; }
.bt-topbar {
  position: sticky; top: 0; z-index: calc(var(--bt-z-nav) - 1); height: var(--bt-topbar-h); display: flex; align-items: center; gap: var(--bt-s3);
  padding: 0 var(--bt-s5); background: color-mix(in srgb, var(--bt-bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bt-border);
}
.bt-topbar__title { font-weight: 600; font-size: var(--bt-fs-lg); flex: 1; min-width: 0; }
.bt-topbar__actions { display: flex; align-items: center; gap: var(--bt-s2); }
.bt-topbar__meta { color: var(--bt-text-faint); font-size: var(--bt-fs-xs); }
.bt-hamburger { display: inline-flex; }
/* desktop: the hamburger collapses the sidebar (remembered in localStorage, applied before Alpine loads) */
@media (min-width: 901px) {
  html[data-nav="collapsed"] .bt-app { grid-template-columns: 1fr; }
  html[data-nav="collapsed"] .bt-sidebar { display: none; }
}
.bt-content { padding: var(--bt-s5); max-width: var(--bt-content-max); width: 100%; margin: 0 auto; }
.bt-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--bt-s3); flex-wrap: wrap; margin-bottom: var(--bt-s5); }
.bt-page-header h1 { margin: 0; }
.bt-page-header__sub { color: var(--bt-text-muted); margin: var(--bt-s1) 0 0; }
.bt-page-header__actions { display: flex; gap: var(--bt-s2); flex-wrap: wrap; }
.bt-role { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--bt-r-pill); background: var(--bt-surface-2); border: 1px solid var(--bt-border); font-size: var(--bt-fs-xs); color: var(--bt-text-muted); }
.bt-role b { color: var(--bt-text); font-weight: 600; }

/* public shell */
.bt-public-nav { position: sticky; top: 0; z-index: var(--bt-z-nav); display: flex; align-items: center; gap: var(--bt-s4); padding: 0 var(--bt-s5); height: var(--bt-topbar-h); background: color-mix(in srgb, var(--bt-bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bt-border); }
.bt-public-nav__brand { display: flex; align-items: center; gap: var(--bt-s2); font-weight: 700; color: var(--bt-text); }
.bt-public-nav__brand:hover { text-decoration: none; }
.bt-public-nav__links { display: flex; gap: var(--bt-s1); flex: 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.bt-public-nav__links a { padding: 6px 10px; border-radius: var(--bt-r-md); color: var(--bt-text-muted); white-space: nowrap; font-weight: 500; }
.bt-public-nav__links a:hover { background: var(--bt-surface-hover); color: var(--bt-text); text-decoration: none; }
.bt-public-nav__links a[aria-current="page"], .bt-public-nav__links a[aria-current="page"]:hover { background: var(--bt-accent-soft); color: var(--bt-accent); font-weight: 600; text-decoration: none; }
.bt-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--bt-s3); font-size: var(--bt-fs-sm); color: var(--bt-text-faint); }
.bt-crumbs a { color: var(--bt-text-muted); }
.bt-crumbs__sep { opacity: 0.6; }
.bt-crumbs__current { color: var(--bt-text); font-weight: 500; }
.bt-public-main { max-width: var(--bt-public-max); margin: 0 auto; padding: var(--bt-s6) var(--bt-s5); width: 100%; }
.bt-public-main--wide { max-width: var(--bt-content-max); }
.bt-footer { border-top: 1px solid var(--bt-border); padding: var(--bt-s5); color: var(--bt-text-faint); font-size: var(--bt-fs-xs); text-align: center; }
.bt-footer a { color: var(--bt-text-muted); }
.bt-hero { padding: var(--bt-s6) 0 var(--bt-s5); }
.bt-hero h1 { font-size: 34px; margin-bottom: var(--bt-s2); }
.bt-hero p { color: var(--bt-text-muted); font-size: var(--bt-fs-lg); max-width: 60ch; }

/* ---------- layout ---------- */
.bt-grid { display: grid; gap: var(--bt-s4); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.bt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bt-grid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bt-grid--auto-sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.bt-col-4 { grid-column: span 4; } .bt-col-6 { grid-column: span 6; } .bt-col-8 { grid-column: span 8; } .bt-col-12 { grid-column: span 12; }
.bt-stack { display: flex; flex-direction: column; gap: var(--bt-s4); }
.bt-stack--sm { gap: var(--bt-s2); }
.bt-row { display: flex; align-items: center; gap: var(--bt-s2); flex-wrap: wrap; }
.bt-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--bt-s3); flex-wrap: wrap; }
.bt-grow { flex: 1; min-width: 0; }

/* ---------- cards & stats ---------- */
.bt-card { background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-lg); box-shadow: var(--bt-shadow-1); display: flex; flex-direction: column; min-width: 0; }
.bt-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--bt-s3); padding: var(--bt-s4) var(--bt-s4) 0; flex-wrap: wrap; }
.bt-card__title { margin: 0; font-size: var(--bt-fs-md); font-weight: 600; }
.bt-card__meta { color: var(--bt-text-faint); font-size: var(--bt-fs-xs); }
.bt-card__body { padding: var(--bt-s4); }
.bt-card__footer { padding: var(--bt-s3) var(--bt-s4); border-top: 1px solid var(--bt-border); color: var(--bt-text-muted); font-size: var(--bt-fs-sm); }
.bt-card--flush .bt-card__body { padding: 0; }
.bt-card--accent { border-color: color-mix(in srgb, var(--bt-accent) 50%, var(--bt-border)); }
.bt-stat { position: relative; background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-lg); padding: var(--bt-s4); box-shadow: var(--bt-shadow-1); overflow: hidden; }
.bt-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bt-border-strong); }
.bt-stat--ok::before { background: var(--bt-ok); } .bt-stat--warn::before { background: var(--bt-warn); } .bt-stat--danger::before { background: var(--bt-danger); } .bt-stat--accent::before { background: var(--bt-accent); }
.bt-stat__label { color: var(--bt-text-muted); font-size: var(--bt-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.bt-stat__value { font-size: var(--bt-fs-2xl); font-weight: 700; line-height: 1.15; margin-top: var(--bt-s1); font-variant-numeric: tabular-nums; }
.bt-stat__sub { color: var(--bt-text-faint); font-size: var(--bt-fs-sm); margin-top: var(--bt-s1); }
.bt-kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--bt-s1) var(--bt-s4); margin: 0; }
.bt-kv__k { color: var(--bt-text-muted); font-size: var(--bt-fs-sm); }
.bt-kv__v { margin: 0; word-break: break-word; }

/* ---------- tables ---------- */
.bt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bt-table { width: 100%; border-collapse: collapse; font-size: var(--bt-fs-sm); min-width: 520px; }
.bt-table th, .bt-table td { padding: 10px var(--bt-s3); text-align: left; border-bottom: 1px solid var(--bt-border); vertical-align: middle; }
.bt-table th { color: var(--bt-text-muted); font-weight: 600; font-size: var(--bt-fs-xs); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; background: var(--bt-surface-2); position: sticky; top: 0; }
.bt-table tbody tr:hover { background: var(--bt-surface-hover); }
.bt-table tbody tr:last-child td { border-bottom: 0; }
.bt-table--compact th, .bt-table--compact td { padding: 6px var(--bt-s2); }
.bt-table__sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.bt-table__sort::after { content: "↕"; opacity: 0.35; font-size: 10px; }
th[aria-sort="ascending"] .bt-table__sort::after { content: "↑"; opacity: 1; } th[aria-sort="descending"] .bt-table__sort::after { content: "↓"; opacity: 1; }
.bt-table tr.is-clickable { cursor: pointer; }
.bt-empty { padding: var(--bt-s6) var(--bt-s4); text-align: center; color: var(--bt-text-faint); }
.bt-empty strong { display: block; color: var(--bt-text-muted); margin-bottom: var(--bt-s1); }

/* ---------- badges, pills, dots ---------- */
.bt-badge, .bt-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--bt-r-pill); font-size: var(--bt-fs-xs); font-weight: 600; line-height: 1.6; background: var(--bt-surface-2); color: var(--bt-text-muted); border: 1px solid var(--bt-border); white-space: nowrap; }
.bt-badge--ok { background: var(--bt-ok-soft); color: var(--bt-ok); border-color: transparent; }
.bt-badge--warn { background: var(--bt-warn-soft); color: var(--bt-warn); border-color: transparent; }
.bt-badge--danger { background: var(--bt-danger-soft); color: var(--bt-danger); border-color: transparent; }
.bt-badge--info { background: var(--bt-info-soft); color: var(--bt-info); border-color: transparent; }
.bt-badge--accent { background: var(--bt-accent-soft); color: var(--bt-accent); border-color: transparent; }
.bt-badge--muted { opacity: 0.8; }
.bt-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: 0 0 8px; }
.bt-dot--running { animation: bt-pulse 1.2s ease-in-out infinite; }
@keyframes bt-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.75); } }
.bt-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--bt-r-sm); background: var(--bt-surface-2); border: 1px solid var(--bt-border); font-size: var(--bt-fs-xs); color: var(--bt-text-muted); font-family: var(--bt-font-mono); }

/* ---------- buttons ---------- */
.bt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: var(--bt-r-md); border: 1px solid var(--bt-border-strong); background: var(--bt-surface-2); color: var(--bt-text); font: inherit; font-weight: 600; font-size: var(--bt-fs-sm); cursor: pointer; transition: background var(--bt-ease), border-color var(--bt-ease), transform var(--bt-ease); white-space: nowrap; text-decoration: none; }
.bt-btn:hover { background: var(--bt-surface-hover); text-decoration: none; color: var(--bt-text); }
.bt-btn:active { transform: translateY(1px); }
.bt-btn:disabled, .bt-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.bt-btn--primary { background: var(--bt-accent); border-color: var(--bt-accent); color: var(--bt-text-on-accent); }
.bt-btn--primary:hover { background: var(--bt-accent-hover); border-color: var(--bt-accent-hover); color: var(--bt-text-on-accent); }
.bt-btn--secondary { background: transparent; }
.bt-btn--ghost { background: transparent; border-color: transparent; color: var(--bt-text-muted); }
.bt-btn--ghost:hover { color: var(--bt-text); }
.bt-btn--danger { background: var(--bt-danger-soft); border-color: transparent; color: var(--bt-danger); }
.bt-btn--danger:hover { background: var(--bt-danger); color: #fff; }
.bt-btn--sm { padding: 5px 10px; font-size: var(--bt-fs-xs); border-radius: var(--bt-r-sm); }
.bt-btn--icon { padding: 7px; width: 34px; height: 34px; }
.bt-btn--sm.bt-btn--icon { width: 28px; height: 28px; padding: 4px; }
.bt-btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.bt-btn[aria-busy="true"]::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--bt-text) transparent var(--bt-text) transparent; border-radius: 50%; animation: bt-spin 0.8s linear infinite; }
.bt-btn--primary[aria-busy="true"]::after { border-color: var(--bt-text-on-accent) transparent var(--bt-text-on-accent) transparent; }
@keyframes bt-spin { to { transform: rotate(360deg); } }
.bt-btn svg { width: 16px; height: 16px; }

/* ---------- forms ---------- */
.bt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bt-label { font-size: var(--bt-fs-sm); font-weight: 600; color: var(--bt-text-muted); }
.bt-help { font-size: var(--bt-fs-xs); color: var(--bt-text-faint); }
.bt-input, .bt-select, .bt-textarea { width: 100%; padding: 8px 11px; border-radius: var(--bt-r-md); border: 1px solid var(--bt-border-strong); background: var(--bt-bg); color: var(--bt-text); font: inherit; font-size: var(--bt-fs-sm); transition: border-color var(--bt-ease), box-shadow var(--bt-ease); }
.bt-input:focus, .bt-select:focus, .bt-textarea:focus { outline: none; border-color: var(--bt-accent); box-shadow: 0 0 0 3px var(--bt-accent-soft); }
.bt-input::placeholder { color: var(--bt-text-faint); }
.bt-input--sm, .bt-select--sm { padding: 5px 9px; font-size: var(--bt-fs-xs); }
.bt-input[readonly] { color: var(--bt-text-muted); }
.bt-textarea { min-height: 96px; resize: vertical; }
.bt-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--bt-text-muted) 50%), linear-gradient(135deg, var(--bt-text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.bt-checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: var(--bt-fs-sm); cursor: pointer; }
.bt-checkbox input { width: 16px; height: 16px; accent-color: var(--bt-accent); }
.bt-switch { position: relative; width: 38px; height: 22px; border-radius: var(--bt-r-pill); background: var(--bt-border-strong); border: 0; cursor: pointer; padding: 0; transition: background var(--bt-ease); flex: 0 0 38px; }
.bt-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--bt-ease); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.bt-switch[aria-checked="true"] { background: var(--bt-ok); }
.bt-switch[aria-checked="true"]::after { transform: translateX(16px); }
.bt-switch:disabled { opacity: 0.5; cursor: not-allowed; }
.bt-form-grid { display: grid; gap: var(--bt-s3) var(--bt-s4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bt-fieldset { border: 1px solid var(--bt-border); border-radius: var(--bt-r-md); padding: var(--bt-s3) var(--bt-s4); margin: 0; }
.bt-fieldset legend { padding: 0 6px; font-size: var(--bt-fs-xs); color: var(--bt-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.bt-inline-form { display: flex; gap: var(--bt-s2); align-items: flex-end; flex-wrap: wrap; }
.bt-inline-form > .bt-input, .bt-inline-form > .bt-select, .bt-inline-form > .bt-search { width: auto; min-width: 150px; flex: 0 1 auto; }
.bt-inline-form > .bt-search .bt-input { width: 100%; }
.bt-search { position: relative; }
.bt-search .bt-input { padding-left: 32px; }
.bt-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--bt-text-faint); }

/* ---------- tabs & pagination ---------- */
.bt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bt-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.bt-tab { all: unset; cursor: pointer; padding: 8px 12px; font-size: var(--bt-fs-sm); font-weight: 600; color: var(--bt-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.bt-tab:hover { color: var(--bt-text); }
.bt-tab--active, .bt-tab[aria-selected="true"] { color: var(--bt-accent); border-bottom-color: var(--bt-accent); }
.bt-tabs--pills { border: 0; gap: 6px; }
.bt-tabs--pills .bt-tab { border: 1px solid var(--bt-border); border-radius: var(--bt-r-pill); padding: 5px 11px; margin: 0; }
.bt-tabs--pills .bt-tab--active, .bt-tabs--pills .bt-tab[aria-selected="true"] { background: var(--bt-accent-soft); border-color: transparent; }
.bt-pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bt-pagination__page { min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--bt-r-sm); border: 1px solid var(--bt-border); background: transparent; color: var(--bt-text-muted); font: inherit; font-size: var(--bt-fs-xs); cursor: pointer; display: inline-grid; place-items: center; }
.bt-pagination__page:hover { background: var(--bt-surface-hover); color: var(--bt-text); text-decoration: none; }
.bt-pagination__page[aria-current="page"] { background: var(--bt-accent-soft); color: var(--bt-accent); border-color: transparent; }
.bt-pagination__page:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- feedback ---------- */
.bt-toast-stack { position: fixed; right: var(--bt-s4); bottom: var(--bt-s4); z-index: var(--bt-z-toast); display: flex; flex-direction: column; gap: var(--bt-s2); max-width: min(420px, calc(100vw - 32px)); }
.bt-toast { display: flex; align-items: flex-start; gap: var(--bt-s2); padding: 10px 12px; border-radius: var(--bt-r-md); background: var(--bt-surface); border: 1px solid var(--bt-border-strong); box-shadow: var(--bt-shadow-2); font-size: var(--bt-fs-sm); animation: bt-in 180ms ease-out; }
.bt-toast--ok { border-color: var(--bt-ok); } .bt-toast--err { border-color: var(--bt-danger); } .bt-toast--info { border-color: var(--bt-accent); }
.bt-toast__close { all: unset; cursor: pointer; margin-left: auto; color: var(--bt-text-faint); padding: 0 4px; }
@keyframes bt-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bt-skeleton { position: relative; overflow: hidden; background: var(--bt-surface-2); border-radius: var(--bt-r-sm); min-height: 12px; }
.bt-skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bt-text) 8%, transparent), transparent); animation: bt-shimmer 1.4s infinite; }
@keyframes bt-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.bt-skeleton--line { height: 12px; margin: 6px 0; } .bt-skeleton--tile { height: 84px; border-radius: var(--bt-r-lg); } .bt-skeleton--row { height: 38px; margin: 4px 0; }
.bt-alert { display: flex; gap: var(--bt-s3); align-items: flex-start; padding: var(--bt-s3) var(--bt-s4); border-radius: var(--bt-r-md); border: 1px solid var(--bt-border); background: var(--bt-surface-2); font-size: var(--bt-fs-sm); }
.bt-alert--info { border-color: var(--bt-accent); background: var(--bt-accent-soft); }
.bt-alert--warn { border-color: var(--bt-warn); background: var(--bt-warn-soft); }
.bt-alert--danger { border-color: var(--bt-danger); background: var(--bt-danger-soft); }
.bt-alert--ok { border-color: var(--bt-ok); background: var(--bt-ok-soft); }
.bt-progress { height: 8px; border-radius: var(--bt-r-pill); background: var(--bt-surface-2); overflow: hidden; border: 1px solid var(--bt-border); }
.bt-progress__bar { height: 100%; background: var(--bt-accent); border-radius: var(--bt-r-pill); transition: width 300ms ease; }
.bt-progress__bar--warn { background: var(--bt-warn); } .bt-progress__bar--danger { background: var(--bt-danger); } .bt-progress__bar--ok { background: var(--bt-ok); }

/* drawers & modals */
/* no backdrop-filter here: blurring a full admin page blocks the main thread for hundreds of ms before a drawer can slide in */
.bt-drawer__backdrop, .bt-modal__backdrop { position: fixed; inset: 0; background: rgba(2, 6, 12, 0.62); z-index: var(--bt-z-drawer); }
.bt-modal .bt-modal__backdrop { z-index: 0; }
.bt-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bt-surface); border-left: 1px solid var(--bt-border); box-shadow: var(--bt-shadow-2); z-index: calc(var(--bt-z-drawer) + 1); display: flex; flex-direction: column; animation: bt-slide 200ms ease-out; }
.bt-drawer--left { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--bt-border); animation-name: bt-slide-left; }
@keyframes bt-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bt-slide-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.bt-drawer__header { display: flex; align-items: center; justify-content: space-between; gap: var(--bt-s3); padding: var(--bt-s4); border-bottom: 1px solid var(--bt-border); }
.bt-drawer__body { padding: var(--bt-s4); overflow-y: auto; flex: 1; }
.bt-drawer__footer { padding: var(--bt-s3) var(--bt-s4); border-top: 1px solid var(--bt-border); display: flex; gap: var(--bt-s2); justify-content: flex-end; }
.bt-modal { position: fixed; inset: 0; z-index: var(--bt-z-modal); display: grid; place-items: center; padding: var(--bt-s4); }
.bt-modal__dialog { position: relative; z-index: 1; width: min(480px, 100%); background: var(--bt-surface); border: 1px solid var(--bt-border-strong); border-radius: var(--bt-r-lg); box-shadow: var(--bt-shadow-2); padding: var(--bt-s5); animation: bt-in 160ms ease-out; }
.bt-modal__actions { display: flex; justify-content: flex-end; gap: var(--bt-s2); margin-top: var(--bt-s4); }

/* charts */
.bt-chart { position: relative; height: var(--h, 280px); width: 100%; }
.bt-chart--sm { --h: 160px; }
.bt-chart canvas { width: 100% !important; height: 100% !important; }
.bt-legend { display: flex; gap: var(--bt-s3); flex-wrap: wrap; font-size: var(--bt-fs-xs); color: var(--bt-text-muted); }
.bt-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.bt-bar-list { display: flex; flex-direction: column; gap: 8px; }
.bt-bar-list__row { display: grid; grid-template-columns: 110px 1fr 56px; gap: var(--bt-s2); align-items: center; font-size: var(--bt-fs-sm); }
.bt-bar-list__bar { height: 8px; border-radius: var(--bt-r-pill); background: var(--bt-surface-2); overflow: hidden; }
.bt-bar-list__bar i { display: block; height: 100%; background: var(--bt-accent); }

/* plan cards (public) */
.bt-plan { display: flex; flex-direction: column; gap: var(--bt-s3); }
.bt-plan__price { font-size: var(--bt-fs-2xl); font-weight: 700; }
.bt-plan__price small { font-size: var(--bt-fs-sm); color: var(--bt-text-muted); font-weight: 500; }
.bt-plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--bt-text-muted); font-size: var(--bt-fs-sm); }
.bt-plan ul li::before { content: "✓"; color: var(--bt-ok); margin-right: 8px; font-weight: 700; }
.bt-plan--featured { border-color: var(--bt-accent); box-shadow: 0 0 0 1px var(--bt-accent), var(--bt-shadow-1); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .bt-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-col-4, .bt-col-6, .bt-col-8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .bt-app { grid-template-columns: 1fr; }
  .bt-split { grid-template-columns: 1fr; }
  .bt-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform 200ms ease; will-change: transform; z-index: calc(var(--bt-z-drawer) + 1); box-shadow: var(--bt-shadow-2); }
  .bt-sidebar.is-open { transform: none; }
  .bt-topbar { padding: 0 var(--bt-s4); }
  .bt-content, .bt-public-main { padding: var(--bt-s4); }
  .bt-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-hide-sm { display: none !important; }
  .bt-hero h1 { font-size: 28px; }
}
@media (max-width: 900px) {
  .bt-public-nav { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .bt-public-nav__brand { margin-right: auto; white-space: nowrap; }
  .bt-public-nav__links { order: 10; flex: 1 0 100%; }
}
@media (max-width: 600px) {
  .bt-grid--2, .bt-grid--3, .bt-grid--4 { grid-template-columns: 1fr; }
  .bt-grid--auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-page-header { align-items: flex-start; flex-direction: column; }
  .bt-stat__value { font-size: 22px; }
  .bt-public-nav { gap: var(--bt-s2); padding-left: var(--bt-s3); padding-right: var(--bt-s3); }
  .bt-bar-list__row { grid-template-columns: 80px 1fr 48px; }
  .bt-kv { grid-template-columns: 1fr; gap: 2px; }
  .bt-kv__k { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media print { .bt-sidebar, .bt-topbar, .bt-toast-stack, .bt-public-nav { display: none !important; } .bt-app { display: block; } }

/* ---------- push events ---------- */
.pe-card { display: flex; flex-direction: column; transition: transform var(--bt-ease), box-shadow var(--bt-ease); }
.pe-card:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-2); text-decoration: none; }
.pe-card__banner { height: 110px; background-size: cover; background-position: center; }
.pe-head { padding: var(--bt-s2) 0; }
.pe-head__banner img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--bt-r-lg); margin-bottom: var(--bt-s4); }
.pe-desc { white-space: pre-wrap; color: var(--bt-text-muted); max-width: 80ch; }
.pe-refresh { width: 120px; height: 6px; border-radius: 3px; background: var(--bt-surface-2); overflow: hidden; }
.pe-refresh__bar { height: 100%; background: var(--pe-outer, var(--bt-accent)); transition: width 1s linear; }
.pe-rows { display: flex; flex-direction: column; gap: 8px; }
.pe-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; border-radius: var(--bt-r-md); overflow: hidden; background: var(--pe-inner, var(--bt-surface)); color: var(--pe-text, var(--bt-text)); min-height: 56px; }
.pe-row--sub { margin-left: 32px; min-height: 48px; }
.pe-row__rank, .pe-row__pushed { display: flex; align-items: center; justify-content: center; background: var(--pe-outer, var(--bt-accent-soft)); color: var(--pe-text, var(--bt-text)); font-weight: 800; font-size: var(--bt-fs-lg); padding: 0 var(--bt-s3); }
.pe-row__pushed { color: var(--pe-pushed, var(--bt-text)); min-width: 110px; }
.pe-row__main { display: flex; align-items: center; gap: var(--bt-s3); padding: 6px var(--bt-s3); min-width: 0; }
.pe-row__main .bt-avatar { width: 36px; height: 36px; flex-basis: 36px; }
.pe-row__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-row__sub { font-size: var(--bt-fs-xs); opacity: 0.8; }
.pe-team { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 2px; }
.pe-theme-preview { padding: var(--bt-s4); border-radius: var(--bt-r-lg); background: var(--bt-bg); border: 1px solid var(--bt-border); }
.pe-avatar-dot { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 36px; opacity: 0.9; }
.pe-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: var(--bt-r-pill); border: 1px solid var(--bt-border); background: var(--bt-surface-2); color: var(--bt-text-muted); font: inherit; font-size: var(--bt-fs-xs); font-weight: 600; cursor: pointer; }
.pe-preset:hover { border-color: var(--bt-border-strong); color: var(--bt-text); }
.pe-preset.is-active { border-color: var(--bt-accent); color: var(--bt-accent); background: var(--bt-accent-soft); }
.pe-preset.is-locked { opacity: 0.45; cursor: not-allowed; }
.pe-preset__swatches { display: inline-flex; gap: 2px; } .pe-preset__swatches i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); }
.pe-color { display: flex; align-items: center; gap: 8px; }
.pe-color input[type="color"] { width: 36px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--bt-border); background: var(--bt-surface-2); cursor: pointer; flex: 0 0 36px; }
.pe-color input[type="color"]:disabled { cursor: not-allowed; opacity: 0.6; }
.pe-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; } .pe-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.pe-section { scroll-margin-top: 72px; }
@media (max-width: 900px) { .pe-row { grid-template-columns: 44px minmax(0, 1fr) auto; } .pe-row__pushed { min-width: 80px; font-size: var(--bt-fs-md); } }
.pe-brawler { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.pe-brawler img { width: 20px; height: 20px; border-radius: 4px; }
.pe-row__btn { font: inherit; font-size: var(--bt-fs-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--bt-r-pill); border: 1px solid currentColor; background: transparent; color: inherit; opacity: 0.75; cursor: pointer; white-space: nowrap; margin-left: auto; }
.pe-row__btn:hover { opacity: 1; }
.bt-public-nav__sep { width: 1px; height: 20px; background: var(--bt-border); margin: 0 4px; flex: 0 0 1px; }

/* ---------- home & cdn ---------- */
.home-hero { padding: var(--bt-s8) 0 var(--bt-s6); max-width: 760px; }
.home-hero__title { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -0.02em; }
.home-hero__accent { background: linear-gradient(90deg, var(--bt-accent), var(--bt-chart-6)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-card { text-decoration: none; color: inherit; transition: transform var(--bt-ease), box-shadow var(--bt-ease); }
.home-card:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-2); text-decoration: none; }
.home-card__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bt-accent-soft); color: var(--bt-accent); margin-bottom: var(--bt-s3); }
.home-card__icon svg { width: 18px; height: 18px; }
.cdn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--bt-s3); }
.cdn-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--bt-s3); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md); padding: var(--bt-s3); background: var(--bt-surface-2); }
.cdn-item__preview { width: 88px; height: 88px; border-radius: var(--bt-r-sm); background: repeating-conic-gradient(var(--bt-border) 0 25%, transparent 0 50%) 0 0 / 16px 16px; overflow: hidden; padding: 6px; box-sizing: border-box; }
.cdn-item__preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cdn-item__preview img.is-missing { display: none; }
.cdn-item__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cdn-item__url { font-size: var(--bt-fs-xs); word-break: break-all; }

/* ---------- status page ---------- */
.st-fade { animation: bt-in 0.5s both; animation-delay: var(--d, 0ms); }
.st-live .bt-dot { animation: bt-pulse 2.2s ease-in-out infinite; }
.st-num { font-variant-numeric: tabular-nums; }
.st-group__head { display: flex; align-items: baseline; gap: var(--bt-s3); margin-bottom: var(--bt-s2); }
.st-group__title { font-size: var(--bt-fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bt-text-faint); }
.st-tiles { display: grid; gap: var(--bt-s2); }
.st-tiles--lg { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.st-tiles--md { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .st-tiles--md { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-tile { padding: var(--bt-s3); border-radius: var(--bt-r-md); background: var(--bt-surface-2); border: 1px solid var(--bt-border); min-width: 0; }
.st-tiles--lg .st-tile { border-left: 3px solid var(--bt-accent); }
.st-tile__value { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tiles--lg .st-tile__value { font-size: 28px; }
.st-tile__label { font-size: var(--bt-fs-sm); font-weight: 600; color: var(--bt-text-muted); margin-top: 2px; }
.st-refresh { height: 3px; border-radius: 2px; background: var(--bt-surface-2); overflow: hidden; }
.st-refresh__bar { height: 100%; background: var(--bt-accent); transition: width 1s linear; opacity: 0.7; }
@media (prefers-reduced-motion: reduce) { .st-fade, .st-live .bt-dot { animation: none; } .st-refresh__bar { transition: none; } }

/* ---------------------------------------------------------------- Live (formerly Brawlboard) pages */
.lv-logo { background: linear-gradient(135deg, #ff6060, #ffc83d); color: #1a0b00; }
.lv-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: var(--bt-s6); align-items: center; max-width: none; }
.lv-demo { border-radius: var(--bt-r-lg); overflow: hidden; border: 1px solid var(--bt-border); background: #0b0d12 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='12' height='12' fill='%23141821'/%3E%3Crect x='12' y='12' width='12' height='12' fill='%23141821'/%3E%3C/svg%3E"); box-shadow: var(--bt-shadow-1); }
.lv-demo__bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: var(--bt-fs-xs); color: var(--bt-text-muted); background: var(--bt-surface); border-bottom: 1px solid var(--bt-border); }
.lv-demo iframe { display: block; width: 100%; height: 500px; border: 0; }
.lv-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--bt-text-muted); }
.lv-steps b { color: var(--bt-text); }
.lv-account__icon { width: 36px; height: 36px; border-radius: var(--bt-r-md); background: var(--bt-surface-2); flex: 0 0 36px; }
.lv-link { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.lv-link__group { font-size: var(--bt-fs-xs); color: var(--bt-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.lv-accounts { border-top: 1px solid var(--bt-border); display: grid; gap: 8px; }
.lv-accounts__row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 0; }
.lv-accounts__row + .lv-accounts__row { border-top: 1px dashed var(--bt-border); }
.lv-link__url { font-family: var(--bt-font-mono); font-size: var(--bt-fs-xs); }
.lv-preview { border-radius: var(--bt-r-lg); overflow: hidden; border: 1px solid var(--bt-border); background: #0b0d12 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='12' height='12' fill='%23141821'/%3E%3Crect x='12' y='12' width='12' height='12' fill='%23141821'/%3E%3C/svg%3E"); }
.lv-preview__bar { padding: 6px 10px; font-size: var(--bt-fs-xs); color: var(--bt-text-muted); background: var(--bt-surface); border-bottom: 1px solid var(--bt-border); }
.lv-preview iframe { display: block; width: 100%; height: 360px; border: 0; }
.lv-preview--tall iframe { height: 480px; }
.lv-colour { display: flex; flex-direction: column; gap: 4px; font-size: var(--bt-fs-xs); color: var(--bt-text-muted); }
.lv-colour input[type="color"] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--bt-border); border-radius: var(--bt-r-md); background: var(--bt-surface-2); cursor: pointer; }
.lv-swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.lv-colour-preview { padding: 16px; border-radius: var(--bt-r-lg); background: #15171d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='12' height='12' fill='%231c1f27'/%3E%3Crect x='12' y='12' width='12' height='12' fill='%231c1f27'/%3E%3C/svg%3E"); font-family: "LilitaOne", "Trebuchet MS", sans-serif; font-size: 26px; line-height: 1.15; }
.lv-colour-preview__line { white-space: nowrap; }
.lv-colour-preview__tile + .lv-colour-preview__tile { margin-top: 8px; }
.lv-colour-preview.is-brawl { -webkit-text-stroke-width: 2px; }
.lv-colour-preview.is-tiles .lv-colour-preview__tile { width: fit-content; max-width: 100%; padding: 10px 14px; border-radius: 14px; border: 3px solid #15121c;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bb-box, rgba(28, 20, 50, 0.9)) 100%, #fff 12%), var(--bb-box, rgba(28, 20, 50, 0.9)));
  box-shadow: 0 4px 0 #15121c, 0 10px 18px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.18); }
.lv-circle-mini { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.6); display: inline-block; }
.lv-stats-image { display: block; width: 100%; max-width: 100%; border-radius: var(--bt-r-md); border: 1px solid var(--bt-border); cursor: zoom-in; }
/* the stats and match images are 1920 px wide: give the dialog the room the screen has */
.lv-image-dialog { width: min(1400px, 96vw); max-height: 94vh; overflow: auto; }
.lv-guide-img { display: block; max-width: 100%; border-radius: var(--bt-r-lg); border: 1px solid var(--bt-border); }
.lv-legal { max-width: 860px; margin: 0 auto; }
.lv-legal [data-custom-class="title"] { font-size: var(--bt-fs-2xl); margin-bottom: 4px; }
.lv-legal [data-custom-class="subtitle"] { color: var(--bt-text-muted); }
.lv-legal [data-custom-class="heading_1"] { font-size: var(--bt-fs-lg); margin-top: var(--bt-s5); }
.lv-legal [data-custom-class="heading_2"] { font-size: var(--bt-fs-md); margin-top: var(--bt-s4); }
.lv-legal [data-custom-class="body_text"] { color: var(--bt-text-muted); line-height: 1.6; }
.lv-legal a { word-break: break-word; }
@font-face { font-family: "LilitaOne"; src: url("/fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: swap; }
.lv-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--bt-s4); align-items: start; }
.lv-split { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.lv-split--wide { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 900px) {
  .lv-hero { grid-template-columns: 1fr; }
  .lv-link { grid-template-columns: 1fr auto auto; }
  .lv-link__label { grid-column: 1 / -1; }
  .lv-main, .lv-split, .lv-split--wide { grid-template-columns: 1fr; }
}

/* ---------- win rates (player page) ---------- */
.wr-hero { padding-bottom: var(--bt-s3); }
.wr-hero h1 { font-size: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-avatar { width: 56px; height: 56px; border-radius: var(--bt-r-md); flex: 0 0 56px; object-fit: cover; background: var(--bt-surface-2); }
.wr .bt-field.is-disabled { opacity: 0.55; }
.wr-rank-icon { width: 26px; height: 26px; object-fit: contain; flex: 0 0 26px; }
.wr-mode-icon { width: 14px; height: 14px; object-fit: contain; }
.wr-bar { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: var(--bt-r-pill); background: var(--bt-surface-2); overflow: hidden; }
.wr-bar > i { display: block; height: 100%; background: var(--bt-accent); transition: width var(--bt-ease); }
.wr-item .bt-card__body { padding: var(--bt-s3) var(--bt-s4); }
.wr-item__head { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: var(--bt-s2); }
.wr-item__head .bt-strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-item__img { width: 40px; height: 40px; border-radius: var(--bt-r-sm); object-fit: cover; flex: 0 0 40px; background: var(--bt-surface-2); }
.wr-item__img--map { width: 64px; flex-basis: 64px; }
.wr-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px var(--bt-s3); margin: 0; align-items: center; }
.wr-kv dt { color: var(--bt-text-muted); font-size: var(--bt-fs-xs); }
.wr-kv dd { margin: 0; font-variant-numeric: tabular-nums; font-size: var(--bt-fs-sm); }
.wr-sub { margin-top: var(--bt-s3); border-top: 1px solid var(--bt-border); padding-top: var(--bt-s2); }
.wr-sub summary { cursor: pointer; color: var(--bt-text-muted); font-size: var(--bt-fs-xs); font-weight: 600; }
.wr-subgrid { display: grid; gap: 6px; margin-top: var(--bt-s2); }
.wr-mini { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wr-mini .wr-item__img { width: 30px; height: 30px; flex-basis: 30px; }
.wr-mini .wr-item__img--map { width: 48px; flex-basis: 48px; }
.wr-lightbox { width: min(900px, 96vw); }

/* ---------- images gallery ---------- */
.im-avatar { width: 56px; height: 56px; border-radius: var(--bt-r-md); flex: 0 0 56px; object-fit: cover; background: var(--bt-surface-2); }
.im-tile .bt-card__body { padding: var(--bt-s3) var(--bt-s4); }
.im-tile__preview { border-radius: var(--bt-r-md); overflow: hidden; border: 1px solid var(--bt-border); background: var(--bt-surface-2); }
.im-tile__img { display: block; width: 100%; cursor: zoom-in; }
.im-lightbox { width: min(1400px, 96vw); max-height: 94vh; overflow: auto; }
.im-lightbox__img { display: block; width: 100%; border-radius: var(--bt-r-md); }
.wr-lightbox__img { display: block; width: 100%; border-radius: var(--bt-r-md); }

.bt-table tr.is-warn > td { background: color-mix(in srgb, var(--bt-warn) 8%, transparent); }

/* status page: incidents */
.st-incident { border-left: 4px solid var(--bt-border); }
.st-incident--warn { border-left-color: var(--bt-warn); }
.st-incident--danger { border-left-color: var(--bt-danger); }
.st-incident--info { border-left-color: var(--bt-accent); }
.st-incident--muted { border-left-color: var(--bt-border); }
.st-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--bt-border); display: grid; gap: var(--bt-s2); }
.st-timeline__item { position: relative; font-size: var(--bt-fs-sm); }
.st-timeline__item::before { content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bt-text-faint); }
.st-timeline__meta { margin-bottom: 2px; }
.st-past + .st-past { border-top: 1px solid var(--bt-border); padding-top: var(--bt-s2); }
.st-admin-incident { border-left: 3px solid var(--bt-warn); }
.bt-link { background: none; border: 0; padding: 0; color: var(--bt-accent); cursor: pointer; font: inherit; font-size: var(--bt-fs-xs); }
.bt-ml-1 { margin-left: 6px; }

.bt-drawer--wide { width: min(760px, 96vw); }
