/* ==========================================================================
   Scoraline Design System v2 — Client Cabinet (/account, /dashboard, /sandbox, /explorer)
   Borderless fintech hierarchy, zero box-in-box, strict >= 15px, 400 body.
   Bold solid flat crimson (#C01E1E) icons, recessed inputs, tactile buttons.
   ========================================================================== */

:root {
  --cab-sidebar-w: 268px;
  --cab-topbar-h: 68px;
  --cab-max-w: 1240px;
  --cab-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Seamless aliases for legacy inline JS tokens across dashboard / sandbox / explorer */
  --red: var(--sw-brand);
  --red-hover: var(--sw-brand-hover);
  --red-tint: var(--sw-brand-tint);
  --green: var(--sw-ok);
  --blue: var(--sw-info);
  --amber: var(--sw-warn);
  --bg: var(--sw-surface);
  --bg-soft: var(--sw-surface-2);
  --bg-2: var(--sw-surface-2);
  --bg-tint: var(--sw-surface-hover);
  --ink: var(--sw-ink);
  --ink-2: #18202B;
  --txt: var(--sw-ink);
  --fg: var(--sw-ink);
  --fg-2: var(--sw-ink-2);
  --fg-3: var(--sw-ink-3);
  --fg-4: var(--sw-ink-3);
  --mut: var(--sw-ink-3);
  --border: var(--sw-divider);
  --border-2: var(--sw-divider);
  --border-strong: var(--sw-divider-strong);
  --font: var(--sw-font);
  --display: var(--sw-font);
  --mono: var(--sw-mono);
  --sidebar: var(--cab-sidebar-w);
  --ease: var(--cab-ease);
}

body {
  margin: 0;
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--sw-ink);
  background: var(--sw-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

b, strong { font-weight: 600; }
a { color: var(--sw-brand); text-decoration: none; }
a:not([class]):hover { text-decoration: underline; }
.mut, .muted { color: var(--sw-ink-3); }
.sm { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* Code / keys strictly in actual code blocks, never in prose labels */
.mono, pre, pre code {
  font-family: var(--sw-mono);
  font-variant-numeric: tabular-nums;
}

/* Bold flat crimson icon sizing + TT Commons optical baseline alignment */
.sw-cab-ic {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.sw-cab-ic--hd { width: 26px; height: 26px; top: -1px; }
.sw-cab-ic--kpi { width: 28px; height: 28px; top: 0; }
.sw-cab-ic--onb { width: 32px; height: 32px; top: 0; margin-bottom: 14px; }
.sw-cab-ic--sm { width: 18px; height: 18px; top: -1px; }

/* ── Unified Form Inputs & Single-Chevron Selects ────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea,
.pm-inp,
input.in,
select.in,
select.sport,
input.search {
  width: 100%;
  min-height: 46px;
  padding: 11px 15px;
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.4;
  color: var(--sw-ink);
  background-color: var(--sw-surface-2);
  border: 0;
  border-radius: var(--r-sm);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(17, 22, 29, 0.04);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
input[type="url"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover,
.pm-inp:hover,
input.in:hover,
select.in:hover,
select.sport:hover,
input.search:hover {
  background-color: var(--sw-surface-3);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus,
.pm-inp:focus,
input.in:focus,
select.in:focus,
select.sport:focus,
input.search:focus {
  background-color: var(--sw-surface);
  box-shadow: var(--focus-ring);
}

::placeholder {
  color: #6B7787;
  opacity: 1;
}

select,
select.in,
select.sport,
select.pm-inp {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 44px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23556070' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

select::-ms-expand { display: none; }
select::picker-icon { display: none !important; }

/* White surface inputs when directly sitting on canvas (#F3F5F8) */
.gsearch-row input.search,
.controls select.sport,
.controls input.search {
  background-color: var(--sw-surface);
  box-shadow: var(--shadow-xs);
}
.gsearch-row input.search:hover,
.controls select.sport:hover,
.controls input.search:hover {
  background-color: var(--sw-surface);
  box-shadow: var(--shadow-sm);
}
.gsearch-row input.search:focus,
.controls select.sport:focus,
.controls input.search:focus {
  background-color: var(--sw-surface);
  box-shadow: var(--focus-ring);
}

/* ── Unified Tactile Buttons (Zero harsh borders) ────────────────────────── */
.kbtn,
.ghostbtn,
.ghost,
.cab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  color: var(--sw-ink);
  background: var(--sw-surface-2);
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(17, 22, 29, 0.05);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.14s var(--cab-ease), box-shadow 0.15s ease;
}

.kbtn:hover:not(:disabled),
.ghostbtn:hover:not(:disabled),
.ghost:hover:not(:disabled),
.cab-btn:hover:not(:disabled) {
  background: var(--sw-surface-3);
  color: var(--sw-ink);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 22, 29, 0.08);
}

.kbtn:active:not(:disabled),
.ghostbtn:active:not(:disabled),
.ghost:active:not(:disabled) {
  transform: translateY(0);
}

.kbtn:disabled,
.ghostbtn:disabled,
.ghost:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.kbtn.sm {
  min-height: 40px;
  padding: 0 15px;
  font-size: var(--fs-sm);
  border-radius: 10px;
}

.kbtn.pri,
.cab-btn.pri {
  background: var(--sw-brand);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(192, 30, 30, 0.22);
}

.kbtn.pri:hover:not(:disabled),
.cab-btn.pri:hover:not(:disabled) {
  background: var(--sw-brand-hover);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(192, 30, 30, 0.28);
}

.kbtn.dark {
  background: var(--sw-ink);
  color: #FFFFFF;
}
.kbtn.dark:hover:not(:disabled) {
  background: #232B36;
  color: #FFFFFF;
}

.kbtn.danger {
  background: var(--sw-err-bg);
  color: var(--sw-brand);
  box-shadow: none;
}
.kbtn.danger:hover:not(:disabled) {
  background: #FADCDC;
  color: var(--sw-brand-hover);
}

.kbtn:focus-visible,
.ghostbtn:focus-visible,
.wh-more > summary:focus-visible,
.wh-menu button:focus-visible,
.dv-howto > summary:focus-visible,
.dv-pick input:focus-visible + span {
  outline: 2px solid var(--sw-brand);
  outline-offset: 2px;
}

/* ── Login Screen (/account) ─────────────────────────────────────────────── */
body.cab-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141922;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.cab-auth-body .hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(860px 540px at 88% 108%, rgba(192, 30, 30, 0.72), #141922 60%);
}
.cab-auth-body .hero-mesh-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(125% 108% at 50% 20%, #000 34%, transparent 80%);
  mask-image: radial-gradient(125% 108% at 50% 20%, #000 34%, transparent 80%);
}
.cab-auth-body .hero-mesh-flow { position: absolute; inset: 0; width: 100%; height: 100%; }
.cab-auth-body .hero-mesh-flow .hm-p circle { fill: rgba(255, 255, 255, 0.92); filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.55)); }
.cab-auth-body .hero-mesh-flow .hm-p.red circle { fill: #E40211; filter: drop-shadow(0 0 7px rgba(228, 2, 17, 0.85)); }
.cab-auth-body .hero-mesh-glow { position: absolute; inset: 0; background: radial-gradient(90% 72% at 50% 6%, rgba(32, 39, 52, 0.42), transparent 58%); }
@media (prefers-reduced-motion: reduce) { .cab-auth-body .hero-mesh-flow { display: none; } }

.authcard {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--sw-surface);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.46);
  padding: 38px 34px;
}

.authcard .logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.authcard .logo img { height: 26px; display: block; }
.authcard h1 {
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 400;
  text-align: center;
  color: var(--sw-ink-3);
  margin: 0 0 22px;
  letter-spacing: 0;
}

.authcard label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-2);
  margin: 14px 0 6px;
}
.authcard label:first-of-type { margin-top: 0; }
.authcard input {
  min-height: 48px;
  padding: 13px 16px;
}
.authcard .cap-wrap { margin-top: 18px; display: block; }

.authcard .btn {
  width: 100%;
  height: 52px;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 10px 0 24px;
  border-radius: var(--r-pill);
  border: 0;
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  background: var(--sw-ink);
  color: #FFFFFF;
  transition: transform 0.18s var(--cab-ease), background-color 0.18s ease;
}
.authcard .btn::after {
  content: "\2197";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sw-brand);
  color: #FFFFFF;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
  transition: transform 0.2s var(--cab-ease);
}
.authcard .btn:hover:not(:disabled) { transform: translateY(-2px); background: #222B36; }
.authcard .btn:hover:not(:disabled)::after { transform: rotate(45deg); }
.authcard .btn:disabled { opacity: 0.58; cursor: not-allowed; }

.authcard .msg {
  margin-top: 14px;
  font-size: var(--fs-sm);
  text-align: center;
  min-height: 22px;
  font-weight: 500;
  line-height: 1.45;
}
.authcard .msg.err { color: var(--sw-err); }
.authcard .msg.ok { color: var(--sw-ok); }

.authcard .terms {
  margin-top: 16px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  text-align: center;
  line-height: 1.5;
}
.authcard .terms a { color: var(--sw-ink-2); text-decoration: underline; text-underline-offset: 2px; }
.authcard .terms a:hover { color: var(--sw-brand); }

.authcard .foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--sw-divider);
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
}
.authcard .foot a { color: var(--sw-ink-2); font-weight: 500; }
.authcard .foot a:hover { color: var(--sw-brand); text-decoration: none; }

/* ── Main App Shell (/dashboard) ─────────────────────────────────────────── */
html:not(.auth-ok) body.cab-app-body { background: var(--sw-canvas); }
html:not(.auth-ok) .app { display: none !important; }

.app {
  display: flex;
  min-height: 100vh;
  background: var(--sw-canvas);
}

/* Backdrop for mobile drawer */
.cab-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 29, 0.42);
  z-index: 38;
}
.cab-backdrop.open { display: block; }

/* Borderless elevated sidebar (1-to-1 match with /admin) */
.app-sb {
  width: var(--cab-sidebar-w);
  flex: 0 0 var(--cab-sidebar-w);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  background: var(--sw-surface);
  border: 0;
  box-shadow: 4px 0 24px rgba(17, 22, 29, 0.04);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sb-logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--cab-topbar-h);
  padding: 0 22px;
  background: var(--sw-surface);
  border: 0;
  flex: none;
  transition: box-shadow 0.2s ease;
}
.sb-logo.scrolled { box-shadow: 0 8px 20px rgba(17, 22, 29, 0.075); }
.sb-logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sb-logo img { height: 22px; display: block; }

/* Clean borderless tariff block inside sidebar (zero dot, zero border) */
.sb-acct {
  margin: 6px 16px 8px;
  padding: 12px 15px;
  border: 0;
  border-radius: 14px;
  background: var(--sw-surface-2);
}
.sb-acct .lbl {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--sw-ink-3);
  line-height: 1.25;
  margin-bottom: 3px;
}
.sb-acct .val {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--sw-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 16px;
}

.sb-sec {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-3);
  padding: 18px 12px 6px;
  letter-spacing: 0.01em;
}
.sb-sec:first-child { padding-top: 6px; }

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--sw-ink-2);
  font-size: var(--fs-base);
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.sb-item:hover {
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  text-decoration: none;
}
.sb-item.on {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  font-weight: 600;
}
.sb-item .ext {
  margin-left: auto;
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  line-height: 1;
}

/* Borderless sidebar footer with scroll shadow */
.sb-foot {
  position: relative;
  z-index: 2;
  padding: 12px 14px 14px;
  background: var(--sw-surface);
  border: 0;
  flex: none;
  transition: box-shadow 0.2s ease;
}
.sb-foot.scrolled { box-shadow: 0 -10px 24px rgba(17, 22, 29, 0.08); }

.sb-help {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 0;
  border-radius: 13px;
  background: var(--sw-surface-2);
  margin-bottom: 10px;
  text-decoration: none;
  transition: background-color 0.14s ease;
}
.sb-help:hover {
  background: var(--sw-surface-3);
  text-decoration: none;
}
.sb-help .t { font-size: var(--fs-sm); color: var(--sw-ink-3); line-height: 1.25; }
.sb-help .l { font-size: var(--fs-sm); font-weight: 600; color: var(--sw-ink); line-height: 1.25; }

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 2px;
  border: 0;
  background: transparent;
}
.sb-user-av {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--sw-ink);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  letter-spacing: 0.02em;
}
.sb-user .em {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink);
}
.sb-user .out {
  height: 36px;
  padding: 0 12px;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.sb-user .out:hover {
  background: var(--sw-err-bg);
  color: var(--sw-brand);
}
.sb-user .out svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Main column & sticky glass topbar */
.app-main {
  margin-left: var(--cab-sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-top {
  height: var(--cab-topbar-h);
  flex: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sw-canvas);
  border: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
  transition: background-color 0.22s var(--cab-ease), box-shadow 0.22s var(--cab-ease);
}

.app-top.scrolled {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 8px 24px -10px rgba(17, 22, 29, 0.14), 0 1px 0 rgba(17, 22, 29, 0.04);
}

.cab-top-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cab-top-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cab-top-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sw-ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cab-top-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.1;
  background: var(--sw-warn-bg);
  color: var(--sw-warn);
  flex: none;
}
.cab-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.cab-top-info-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--sw-surface);
  color: var(--sw-ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.14s var(--cab-ease);
}
.cab-top-info-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cab-top-info-btn:hover,
.cab-info-wrap.open .cab-top-info-btn {
  color: var(--sw-brand);
  background: var(--sw-brand-bg);
  box-shadow: none;
}
.app-top.scrolled .cab-top-info-btn {
  background: var(--sw-surface-2);
  box-shadow: none;
}
.app-top.scrolled .cab-top-info-btn:hover,
.app-top.scrolled .cab-info-wrap.open .cab-top-info-btn {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
}
.cab-top-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  width: min(400px, calc(100vw - 48px));
  background: var(--sw-surface);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.5;
  padding: 15px 18px;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(17, 22, 29, 0.16), 0 4px 12px rgba(17, 22, 29, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s var(--cab-ease), transform 0.18s var(--cab-ease), visibility 0s linear 0.18s;
  z-index: 80;
  pointer-events: none;
}
.cab-top-tip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}
.cab-info-wrap:hover .cab-top-tip,
.cab-info-wrap:focus-within .cab-top-tip,
.cab-info-wrap.open .cab-top-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.18s var(--cab-ease), transform 0.18s var(--cab-ease), visibility 0s;
  pointer-events: auto;
}
.cab-top-tip a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--sw-brand);
  font-weight: 600;
}

.app-top .sp { flex: 1; }

/* Upgrade i18n.js .top-site & .sw-lang-trigger to borderless DS v2 pills
   (white on gray canvas -> soft gray #EDF1F6 on white scrolled topbar, matching /admin) */
.app-top .sw-lang-trigger {
  height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--sw-surface) !important;
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.2s ease, color 0.16s ease, box-shadow 0.2s ease;
}
.app-top .sw-lang-trigger:hover,
.app-top .sw-lang.open .sw-lang-trigger {
  background: var(--sw-surface) !important;
  color: var(--sw-ink);
  box-shadow: var(--shadow-sm);
}
.app-top.scrolled .sw-lang-trigger {
  background: var(--sw-surface-2) !important;
  color: var(--sw-ink);
  box-shadow: none;
}
.app-top.scrolled .sw-lang-trigger:hover,
.app-top.scrolled .sw-lang.open .sw-lang-trigger {
  background: var(--sw-surface-3) !important;
  box-shadow: none;
}

.app-top .top-site {
  height: 40px;
  padding: 0 15px 0 13px;
  border: 0;
  border-radius: 12px;
  background: var(--sw-surface) !important;
  color: var(--sw-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.2s ease, color 0.16s ease, box-shadow 0.2s ease;
}
.app-top .top-site:hover {
  border: 0;
  background: var(--sw-surface) !important;
  color: var(--sw-brand);
  box-shadow: var(--shadow-sm);
}
.app-top.scrolled .top-site {
  background: var(--sw-surface-2) !important;
  color: var(--sw-ink);
  box-shadow: none;
}
.app-top.scrolled .top-site:hover {
  background: var(--sw-surface-3) !important;
  color: var(--sw-brand);
  box-shadow: none;
}

/* Plan tier icons (bold solid flat crimson, zero background boxes, optical TT Commons alignment) */
.sw-plan-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  transform: translateY(-1.5px);
}
.sw-plan-ic svg { width: 100%; height: 100%; display: block; }
.sw-plan-ic--sm { width: 20px; height: 20px; transform: translateY(-1.5px); }
.sw-plan-ic--hero { width: 34px; height: 34px; transform: translateY(-2px); }
.sw-plan-ic--card { width: 28px; height: 28px; transform: translateY(-2px); }
.sw-plan-ic--opt { width: 19px; height: 19px; transform: translateY(-1px); }
.sb-acct .val { display: flex; align-items: center; gap: 9px; line-height: 1.1; }
.sb-item .sw-cab-ic { transform: translateY(-1.5px); }
.cab-top-ic .sw-cab-ic { transform: translateY(-2px); }
.cab-top-title { line-height: 1.1; }
.bl-plan-inline { line-height: 1.15; }
.planc-title-wrap { align-items: center; }
.planc-title-wrap h4 { line-height: 1.1; }

/* Code block wrapper with embedded copy button (API key, Beta, Sandbox) */
.sw-codewrap {
  position: relative;
  background: #0F141C;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sw-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sw-code-lang {
  font-family: var(--sw-mono);
  font-size: 15px;
  font-weight: 500;
  color: #8B97A8;
  letter-spacing: 0.01em;
}
.sw-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.10);
  color: #E8EDF4;
  font-family: var(--sw-font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.sw-code-copy:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}
.sw-code-copy:active { transform: scale(0.98); }
.sw-code-copy.copied {
  background: rgba(34, 197, 94, 0.22);
  color: #86EFAC;
}
.sw-code-copy svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sw-codewrap pre {
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 16px 18px;
}

/* View fade-in & Global animated spoilers (chevron arrow, ZERO browser triangles!) */
@keyframes cab-view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
body.cab-app-body .app-body {
  animation: cab-view-in 0.22s var(--cab-ease);
}

details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker,
details > summary::marker {
  display: none;
  content: "";
}

/* Custom animated chevron spoiler across cabinet (aligned flush at x=0, zero left-bleed or hover flicker!) */
details:not(.wh-more) > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  margin-left: 0;
  border-radius: 10px;
  background: var(--sw-surface-2);
  cursor: pointer;
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  user-select: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}
details:not(.wh-more) > summary:hover {
  background: var(--sw-surface-3);
  color: var(--sw-ink);
}
details:not(.wh-more) > summary::after {
  content: "";
  width: 12px;
  height: 8px;
  flex: none;
  transform: translateY(-0.5px);
  background-color: currentColor;
  opacity: 0.72;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5L6 6l4.5-4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5L6 6l4.5-4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.24s var(--cab-ease), opacity 0.16s ease;
}
details:not(.wh-more) > summary:hover::after {
  opacity: 1;
}
details:not(.wh-more)[open] > summary::after {
  transform: translateY(-0.5px) rotate(180deg);
}
.dv-howto > summary {
  background: transparent;
  padding: 4px 0;
}
.dv-howto > summary:hover {
  background: transparent;
  color: var(--sw-brand);
}
/* Webhook diagnostic spoiler (compact semantic pill — hides verbose prose until expanded) */
.wh-diag {
  margin-top: 12px;
}
.wh-diag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wh-diag > summary {
  padding: 6px 13px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.wh-diag.ok > summary { background: var(--sw-ok-bg); color: var(--sw-ok); }
.wh-diag.ok > summary:hover { background: rgba(21, 128, 61, 0.16); color: var(--sw-ok); }
.wh-diag.warn > summary { background: var(--sw-warn-bg); color: var(--sw-warn); }
.wh-diag.warn > summary:hover { background: rgba(180, 83, 9, 0.18); color: var(--sw-warn); }
.wh-diag.broken > summary { background: var(--sw-err-bg); color: var(--sw-err); }
.wh-diag.broken > summary:hover { background: rgba(192, 30, 30, 0.16); color: var(--sw-err); }
.wh-diag.paused > summary { background: var(--sw-surface-2); color: var(--sw-ink-2); }
.wh-diag-body {
  margin-top: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--sw-canvas);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  max-width: 780px;
}
.wh-diag-err-inline {
  margin-top: 8px;
}
.wh-more > summary svg {
  transform: translateY(-0.5px);
  transition: transform 0.24s var(--cab-ease);
}
.wh-more[open] > summary svg {
  transform: translateY(-0.5px) rotate(180deg);
}
.wh-more[open] > .wh-menu {
  animation: cab-pop-in 0.18s var(--cab-ease);
}
@keyframes cab-pop-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.wh-panel {
  animation: cab-view-in 0.2s var(--cab-ease);
}

/* Unified Current Plan visual card (100% consistent across /plans & /billing) */
.plan-hero-card {
  position: relative;
}
.plan-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.plan-hero-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.plan-hero-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.plan-hero-eyebrow {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-weight: 500;
  line-height: 1.2;
}
.plan-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.plan-hero-name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sw-ink);
  line-height: 1.15;
}
.plan-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.15;
}
.plan-status-pill.ok { background: var(--sw-ok-bg); color: var(--sw-ok); }
.plan-status-pill.warn { background: var(--sw-warn-bg); color: var(--sw-warn); }
.plan-status-pill.bad { background: var(--sw-err-bg); color: var(--sw-err); }
.plan-status-pill.info { background: var(--sw-info-bg); color: var(--sw-info); }
.plan-status-pill.mut { background: var(--sw-surface-2); color: var(--sw-ink-3); }

.plan-hero-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
}
.plan-hero-price-box {
  text-align: right;
}
.plan-hero-price {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sw-ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.plan-hero-period {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  margin-top: 2px;
}

/* Visual subscription term progress bar */
.plan-term-bar {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--sw-canvas);
}
.plan-term-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
  margin-bottom: 9px;
}
.plan-term-meta strong {
  color: var(--sw-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.plan-term-track {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--sw-surface-3);
  overflow: hidden;
}
.plan-term-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--sw-ok);
  transition: width 0.55s var(--cab-ease);
}
.plan-term-fill.warn { background: var(--sw-warn); }
.plan-term-fill.bad { background: var(--sw-brand); }

/* Visual capability chips (RPS + sport pills + tariff options unified) */
.plan-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.plan-chips-row:empty { display: none; }
.plan-chips-row .access {
  margin: 0;
  padding: 6px 12px;
  border-radius: 10px;
  line-height: 1.2;
}
.plan-hero-card .bl-tariff { margin-top: 0; }
.plan-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
}
.plan-metric-chip svg {
  width: 16px;
  height: 16px;
  fill: var(--sw-brand);
  flex: none;
  transform: translateY(-1px);
}
.plan-sport-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--sw-canvas);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
}
.plan-sport-chip svg {
  width: 16px;
  height: 16px;
  fill: var(--sw-ink-3);
  flex: none;
  transform: translateY(-1px);
}

/* ── Usage Analytics Section (/dashboard/usage — visual, showing telemetry) ─ */
.us-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.us-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.us-seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: var(--sw-surface);
  box-shadow: var(--shadow-xs);
}
.us-seg button {
  border: 0;
  background: transparent;
  color: var(--sw-ink-2);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.us-seg button:hover {
  background: var(--sw-surface-2);
  color: var(--sw-ink);
}
.us-seg button.on {
  background: var(--sw-ink);
  color: #FFFFFF;
}
.us-ip-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--sw-info-bg);
  color: var(--sw-info);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.us-ip-filter-pill button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.us-svc-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--sw-surface);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
}
.us-svc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
}
.us-svc-badge.bad {
  background: var(--sw-err-bg);
  color: var(--sw-err);
}

.us-quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.us-qcard {
  background: var(--sw-surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.us-qhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.us-qhead .lbl {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-3);
}
.us-qhead .val {
  font-size: 20px;
  font-weight: 600;
  color: var(--sw-ink);
  font-variant-numeric: tabular-nums;
}
.us-qhead .val small {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--sw-ink-3);
}
.us-qtrack {
  margin-top: 12px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--sw-surface-2);
  overflow: hidden;
}
.us-qfill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--sw-ok);
  transition: width 0.55s var(--cab-ease);
}
.us-qfill.warn { background: var(--sw-warn); }
.us-qfill.bad { background: var(--sw-brand); }
.us-qmeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
}

.us-chart-card {
  position: relative;
}
.us-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.us-chart-head h3 { margin: 0; }
.us-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
}
.us-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.us-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}
.us-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
}
.us-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.us-bar-col {
  cursor: pointer;
}
.us-bar-col rect.us-bar-hit {
  fill: transparent;
}
.us-bar-col:hover rect.us-bar-hit {
  fill: rgba(17, 22, 29, 0.035);
}
.us-bar-col rect.us-bar-ok {
  fill: var(--sw-info);
  opacity: 0.85;
  transition: opacity 0.14s ease;
}
.us-bar-col:hover rect.us-bar-ok {
  opacity: 1;
}
.us-bar-col rect.us-bar-err {
  fill: var(--sw-brand);
}
.us-chart-tip {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--sw-ink);
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  box-shadow: var(--shadow-md);
  font-variant-numeric: tabular-nums;
  z-index: 5;
}
.us-chart-tip.show {
  opacity: 1;
  transform: translateY(0);
}

.us-ip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.us-ip-head h3 { margin: 0; }
.us-ip-search {
  max-width: 260px;
  min-height: 40px !important;
  margin: 0 !important;
}
.us-ip-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.us-ip-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--sw-info);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.us-ip-link:hover { color: var(--sw-brand); }
.us-share-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 118px;
  max-width: 156px;
}
.us-share-track {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--sw-surface-2);
  overflow: hidden;
}
.us-share-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--sw-info);
}
.us-share-num {
  min-width: 44px;
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-variant-numeric: tabular-nums;
}

/* Explorer minimalist (i) info tooltip on importance bands */
.ex-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ex-info-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--sw-surface-2);
  color: var(--sw-ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.ex-info-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ex-info-btn:hover,
.ex-info-wrap.open .ex-info-btn {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
}
.ex-info-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 48px));
  background: var(--sw-surface);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.5;
  padding: 13px 16px;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(17, 22, 29, 0.16), 0 4px 10px rgba(17, 22, 29, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.16s var(--cab-ease), transform 0.16s var(--cab-ease), visibility 0s linear 0.16s;
  z-index: 40;
  pointer-events: none;
}
.ex-info-tip b { color: var(--sw-ink); font-weight: 600; }
.ex-info-wrap:hover .ex-info-tip,
.ex-info-wrap:focus-within .ex-info-tip,
.ex-info-wrap.open .ex-info-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.16s var(--cab-ease), transform 0.16s var(--cab-ease), visibility 0s;
  pointer-events: auto;
}

/* Visual Payment Card preview in Billing */
.bl-card-visual {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--sw-canvas);
  margin-top: 8px;
}
.bl-card-visual .sw-cab-ic { width: 22px; height: 22px; }
.bl-card-visual p { margin: 0 !important; font-weight: 500; color: var(--sw-ink); }
.bl-plan-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--sw-ink);
}
.bl-pending-wrap {
  border-left: 4px solid var(--sw-warn);
}
.planc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.planc-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.planc-title-wrap h4 { margin: 0; }
.planc .curtag { margin-bottom: 0; }

.sb-burger {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 0;
  background: var(--sw-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  color: var(--sw-ink);
  flex: none;
}
.sb-burger .ic {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-body {
  flex: 1;
  padding: 20px 32px 64px;
  max-width: var(--cab-max-w);
  width: 100%;
}
.app-body h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.025em;
  color: var(--sw-ink);
  line-height: 1.2;
}

.frame-view { height: calc(100vh - var(--cab-topbar-h)); }
.frame-view iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--sw-canvas);
}
#sec-key, #sec-usage, #builderSec, #plansSec, #invoiceNote { scroll-margin-top: 86px; }

/* ── Borderless Cards, KPI Grid, Onboarding & Pills ──────────────────────── */
section { margin: 24px 0; }
section:first-child { margin-top: 0; }
.sec-h {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--sw-ink);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}

.card {
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--sw-ink);
}

body.cab-app-body .grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 8px;
}

body.cab-app-body .st {
  display: flex;
  flex-direction: column;
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.18s var(--cab-ease), transform 0.18s var(--cab-ease);
}
body.cab-app-body a.st:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

body.cab-app-body .st-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
body.cab-app-body .st h3 {
  margin: 0 0 10px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-weight: 600;
  line-height: 1.3;
}
body.cab-app-body .st .big {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--sw-ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
body.cab-app-body .st-foot {
  margin-top: auto;
  padding-top: 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--sw-ink-3);
  transition: color 0.14s ease;
}
body.cab-app-body a.st:hover .st-foot { color: var(--sw-brand); }

body.cab-app-body .bar {
  height: 8px;
  background: var(--sw-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 16px;
}
body.cab-app-body .bar > i {
  display: block;
  height: 100%;
  background: var(--sw-brand);
  border-radius: var(--r-pill);
  transition: width 0.7s var(--cab-ease);
}

body.cab-app-body .pill {
  display: inline-flex;
  align-items: center;
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  font-size: var(--fs-md);
  padding: 5px 14px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.access {
  display: inline-flex;
  align-items: center;
  background: var(--sw-info-bg);
  color: var(--sw-info);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9px;
  margin: 5px 6px 0 0;
  line-height: 1.2;
}

/* Onboarding cards — ZERO icon background box, direct bold flat crimson icon */
.onb {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.onbcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 24px 24px 22px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--cab-ease), box-shadow 0.18s var(--cab-ease);
}
.onbcard:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.onbcard .oi {
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 14px;
}
.onbcard .ot {
  font-size: 19px;
  font-weight: 600;
  color: var(--sw-ink);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.onbcard .od {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  line-height: 1.5;
  font-weight: 400;
}
.onbcard .oa {
  position: absolute;
  top: 22px;
  right: 22px;
  color: var(--sw-ink-3);
  font-size: 20px;
  transition: transform 0.18s var(--cab-ease), color 0.18s ease;
}
.onbcard:hover .oa { color: var(--sw-brand); transform: translateX(3px); }

/* ── API Key & Code Blocks ───────────────────────────────────────────────── */
.keybox {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
code {
  font-family: var(--sw-font);
  font-weight: 600;
  background: var(--sw-surface-2);
  border: 0;
  border-radius: 7px;
  padding: 2px 8px;
  font-size: var(--fs-sm);
  color: var(--sw-ink);
}
pre code, .sw-codewrap code {
  font-family: var(--sw-mono);
  font-weight: 400;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
.key {
  font-family: var(--sw-mono);
  background: var(--sw-surface-2);
  border: 0;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  min-height: 46px;
  display: flex;
  align-items: center;
  font-size: var(--fs-base);
  flex: 1 1 200px;
  min-width: 180px;
  overflow: auto;
  white-space: nowrap;
  color: var(--sw-ink);
}
pre {
  background: #0F141C;
  border: 0;
  border-radius: var(--r-md);
  padding: 18px 20px;
  overflow: auto;
  font-size: 15px;
  color: #D2DAE4;
  font-family: var(--sw-mono);
  line-height: 1.65;
  margin: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sw-ink);
  color: #FFFFFF;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  font-size: var(--fs-base);
}
.toast.show { opacity: 1; }
.testbanner {
  background: var(--sw-warn-bg);
  border: 0;
  color: var(--sw-warn);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: var(--fs-base);
  margin: 0 0 16px;
}

/* ── Plans & Configurator (Borderless cards + tactile soft chips) ────────── */
.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.planc {
  background: var(--sw-surface);
  border: 0;
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s var(--cab-ease), transform 0.18s var(--cab-ease);
}
.planc:hover { box-shadow: var(--shadow-md); }
.planc.cur {
  box-shadow: inset 0 0 0 2px var(--sw-brand), var(--shadow-md);
}
.planc h4 { margin: 0 0 4px; font-size: 20px; font-weight: 600; color: var(--sw-ink); }
.planc .pr { font-size: 26px; font-weight: 600; margin: 6px 0 4px; color: var(--sw-ink); font-variant-numeric: tabular-nums; }
.planc .pr small { font-size: var(--fs-base); color: var(--sw-ink-3); font-weight: 400; }
.planc .rps { font-size: var(--fs-sm); color: var(--sw-ink-2); font-weight: 600; margin-bottom: 12px; }
.planc .lim { color: var(--sw-ink-3); font-size: var(--fs-sm); margin-bottom: 16px; }
.planc .feats { list-style: none; margin: 0 0 18px; padding: 0; font-size: var(--fs-sm); color: var(--sw-ink-2); }
.planc .feats li { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; line-height: 1.42; }
.planc .feats li::before { content: "✓"; color: var(--sw-ok); font-weight: 600; flex: none; }
.planc .curtag {
  align-self: flex-start;
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 9px;
  margin-bottom: 8px;
}
.planc button:not(.inv) {
  margin-top: auto;
  min-height: 46px;
  background: var(--sw-brand);
  color: #FFFFFF;
  font-family: var(--sw-font);
  font-weight: 600;
  border: 0;
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-size: var(--fs-base);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(192, 30, 30, 0.20);
  transition: background-color 0.15s ease, transform 0.14s ease;
}
.planc button:not(.inv):hover:not(:disabled) { background: var(--sw-brand-hover); transform: translateY(-1px); }
.planc button:not(.inv):disabled { background: var(--sw-surface-2); color: var(--sw-ink-3); box-shadow: none; cursor: default; transform: none; }
.planc .inv {
  margin-top: 8px;
  background: none;
  border: 0;
  color: var(--sw-ink-3);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px;
}
.planc .inv:hover { color: var(--sw-ink); }

/* Builder interactive chips & modules (borderless tactile fills) */
.bld-h { font-size: var(--fs-base); color: var(--sw-ink); font-weight: 600; margin: 22px 0 10px; }
.bld-row { display: flex; gap: 10px; flex-wrap: wrap; }
.opt {
  border: 0;
  border-radius: var(--r-sm);
  padding: 11px 16px;
  min-height: 44px;
  cursor: pointer;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-family: var(--sw-font);
  font-size: var(--fs-base);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.opt:hover { background: var(--sw-surface-3); }
.opt.on {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px rgba(192, 30, 30, 0.32);
}
.opt small { color: var(--sw-ink-3); font-size: var(--fs-sm); font-weight: 400; }
.opt.on small { color: var(--sw-brand); }

.sp-cnt { font-size: var(--fs-sm); color: var(--sw-ink-3); margin: 8px 0 0; }
.sp-grp { font-size: var(--fs-sm); color: var(--sw-ink-3); font-weight: 600; margin: 14px 0 8px; }
.sp-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  cursor: pointer;
  font-size: var(--fs-base);
  user-select: none;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.sp-tile svg { width: 18px; height: 18px; fill: var(--sw-ink-3); flex: none; }
.sp-tile:hover { background: var(--sw-surface-3); }
.sp-tile.on {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px rgba(192, 30, 30, 0.32);
}
.sp-tile.on svg { fill: var(--sw-brand); }
.sp-tile.dis { opacity: 0.42; cursor: not-allowed; }

.mod {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--sw-surface-2);
  margin-bottom: 10px;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}
.mod:hover { background: var(--sw-surface-3); }
.mod.on {
  background: var(--sw-brand-bg);
  box-shadow: inset 0 0 0 1.5px rgba(192, 30, 30, 0.28);
}
.mod.lock { opacity: 0.85; cursor: default; }
.mod .bx { font-size: 18px; line-height: 1.25; color: var(--sw-brand); font-weight: 600; }

.bld-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  border-top: 1px solid var(--sw-divider);
  padding-top: 20px;
  flex-wrap: wrap;
}
.bld-summary .big { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--sw-ink); font-variant-numeric: tabular-nums; }

/* ── Billing Section (Strict >= 15px, Borderless, Clean Tables) ──────────── */
.bl-hero { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.bl-hero .col { flex: 1; min-width: 170px; }
.bl-kv { font-size: var(--fs-sm); color: var(--sw-ink-3); margin-bottom: 4px; }
.bl-vv { font-size: 20px; font-weight: 600; color: var(--sw-ink); font-variant-numeric: tabular-nums; }
.bl-tariff { margin-top: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.bl-tariff .access { font-size: var(--fs-sm); }

.bl-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.bl-order-head h3 { margin: 0 0 8px; font-size: 20px; }
.bl-order-total { font-size: 20px; font-weight: 600; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bl-order-total small { display: block; margin-top: 4px; font-size: var(--fs-sm); font-weight: 400; color: var(--sw-ink-3); }
.bl-order-plan { margin-top: 14px; font-size: var(--fs-base); font-weight: 600; color: var(--sw-ink); }
.bl-order-body { margin: 7px 0 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--sw-ink-3); max-width: 70ch; }
.bl-order-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.bl-order-actions .kbtn { font-size: var(--fs-sm); min-height: 44px; padding: 0 16px; }
.bl-order-actions .bl-refresh { background: transparent; box-shadow: none; color: var(--sw-ink-3); }
.bl-order-actions .bl-refresh:hover { background: var(--sw-surface-2); color: var(--sw-ink); }

.bl-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.bl-section-head h3 { margin: 0; }
.bl-section-head .kbtn { font-size: var(--fs-sm); min-height: 40px; padding: 0 15px; }
.bl-current-state { margin: 16px 0 0; font-size: var(--fs-sm); color: var(--sw-ink-3); max-width: 70ch; }
.bl-plan-options { margin-top: 12px; }
.bl-plan-options summary,
.bl-history-detail summary,
.bl-history-older summary,
.bl-more summary { width: fit-content; }
.bl-plan-options .access,
.bl-history-detail .access { font-size: var(--fs-sm); }
.bl-pending + .bl-pending { border-top: 1px solid var(--sw-divider); padding-top: 22px; margin-top: 22px; }
.bl-more { align-self: center; }
.bl-more[open] { flex: 1 1 100%; }
.bl-more > div { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }

.bl-history-scroll { overflow: auto; }
.bl-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.bl-table th {
  text-align: left;
  color: var(--sw-ink-3);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 10px 12px;
  border-bottom: 1px solid var(--sw-divider);
  white-space: nowrap;
}
.bl-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--sw-divider);
  color: var(--sw-ink-2);
  white-space: nowrap;
  vertical-align: top;
}
.bl-table tr:last-child td { border-bottom: 0; }
td .bl-tariff { max-width: 420px; margin-top: 6px; white-space: normal; }

/* ── Modern Compact Expandable Order History Table (DS v2.6) ────────────── */
.bl-history-table {
  display: block;
  width: 100%;
  border-collapse: separate;
}
.bl-history-table thead,
.bl-history-table tbody {
  display: block;
}
.bl-history-table thead tr {
  display: grid;
  grid-template-columns: 72px minmax(220px, 1.8fr) 128px 136px 150px 36px;
  gap: 0 12px;
  align-items: center;
  padding: 10px 16px;
  background: var(--sw-canvas);
  border-radius: 12px;
  margin-bottom: 4px;
}
.bl-history-table thead th {
  padding: 0;
  border: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-3);
  text-align: left;
}
.bl-history-table thead th.bl-th-r {
  text-align: right;
}
.bl-history-table tbody tr {
  display: grid;
  grid-template-columns: 72px minmax(220px, 1.8fr) 128px 136px 150px 36px;
  gap: 0 12px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--sw-divider);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.14s ease;
}
.bl-history-table tbody tr:last-child { border-bottom: 0; }
.bl-history-table tbody tr:hover { background: #F8FAFC; }
.bl-history-table tbody tr.open { background: var(--sw-surface); }
.bl-history-table tbody td {
  padding: 0;
  border: 0;
  vertical-align: middle;
  white-space: nowrap;
}
.bl-history-table tbody td:first-child {
  font-weight: 600;
  color: var(--sw-ink-3);
  font-variant-numeric: tabular-nums;
}
.bl-ord-plan {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: normal !important;
  flex-wrap: wrap;
}
.bl-ord-title {
  color: var(--sw-ink);
  font-weight: 600;
}
.bl-ord-term {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--sw-canvas);
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.25;
}
.bl-ord-date {
  color: var(--sw-ink-3);
  font-variant-numeric: tabular-nums;
}
.bl-ord-sum {
  text-align: right;
  font-weight: 600;
  color: var(--sw-ink);
  font-variant-numeric: tabular-nums;
}
.bl-ord-st {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.bl-ord-chev {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.bl-ord-toggle {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sw-ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.bl-history-table tbody tr:hover .bl-ord-toggle,
.bl-history-table tbody tr.open .bl-ord-toggle {
  background: var(--sw-surface-2);
  color: var(--sw-ink);
}
.bl-ord-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.22s var(--cab-ease);
}
.bl-history-table tbody tr.open .bl-ord-toggle svg {
  transform: rotate(180deg);
}
.bl-ord-drawer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.24s var(--cab-ease), opacity 0.18s ease, margin-top 0.24s var(--cab-ease);
  white-space: normal !important;
  cursor: default;
}
.bl-ord-drawer > .bl-ord-drawer-inner {
  overflow: hidden;
}
.bl-history-table tbody tr.open .bl-ord-drawer {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
}
.bl-ord-drawer-card {
  background: var(--sw-canvas);
  border-radius: 14px;
  padding: 16px 18px;
}
.bl-ord-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  align-items: baseline;
}
.bl-ord-kv {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-sm);
}
.bl-ord-kv span { color: var(--sw-ink-3); }
.bl-ord-kv b { color: var(--sw-ink); font-weight: 600; }
.bl-ord-test-note {
  margin: 10px 0 0;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
}
.bl-ord-drawer-card .plan-chips-row {
  margin-top: 12px;
}
.bl-ord-drawer-card .plan-metric-chip,
.bl-ord-drawer-card .plan-sport-chip {
  background: var(--sw-surface);
  box-shadow: 0 1px 2px rgba(17, 22, 29, 0.05);
}
.bl-history-older {
  border-top: 1px solid var(--sw-divider);
  margin-top: 16px;
  padding-top: 16px;
}
.bl-history-older .bl-history-scroll {
  margin-top: 12px;
}
@media (max-width: 780px) {
  .bl-history-table thead { display: none; }
  .bl-history-table tbody tr {
    grid-template-columns: auto 1fr auto;
    gap: 8px 12px;
    padding: 14px 12px;
  }
  .bl-ord-plan { grid-column: 1 / -1; order: 2; }
  .bl-ord-date { order: 1; }
  .bl-ord-sum { grid-column: 1 / 2; order: 3; text-align: left; }
  .bl-ord-st { grid-column: 2 / 3; order: 3; justify-content: flex-start; }
  .bl-ord-chev { grid-column: 3 / 4; order: 3; }
  .bl-ord-drawer { order: 4; }
}

.bl-st {
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 10px;
  display: inline-block;
  line-height: 1.25;
}
.bl-st::first-letter { text-transform: uppercase; }
.bl-st.ok { background: var(--sw-ok-bg); color: var(--sw-ok); }
.bl-st.wait { background: var(--sw-warn-bg); color: var(--sw-warn); }
.bl-st.bad { background: var(--sw-err-bg); color: var(--sw-err); }
.bl-st.mut { background: var(--sw-surface-2); color: var(--sw-ink-3); }

.bl-payment-method { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; }
.bl-payment-method .kbtn { font-size: var(--fs-sm); min-height: 40px; padding: 0 15px; }
.bl-payment-method p { margin: 5px 0 0; }

.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #CFD8E3; border-radius: var(--r-pill); transition: background-color 0.18s ease; }
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 4px rgba(17, 22, 29, 0.22);
}
.switch input:checked + i { background: var(--sw-ok-vivid); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--sw-brand); outline-offset: 3px; }
.switch input:disabled + i { opacity: 0.45; }

.bl-set { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--sw-divider); }
.bl-set:first-of-type { border-top: 0; }
.bl-set .tt { font-weight: 600; color: var(--sw-ink); font-size: var(--fs-base); }
.bl-set .dd { font-size: var(--fs-sm); color: var(--sw-ink-3); margin-top: 2px; line-height: 1.45; }
#view-billing .kbtn:disabled { opacity: 0.48; cursor: wait; }

/* ── Payment & Webhook Modals (Borderless Elevated Surface) ──────────────── */
.paybg {
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 29, 0.52);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.paybg.open { display: flex; }
.paymodal {
  background: var(--sw-surface);
  border: 0;
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  padding: 28px 30px;
  box-shadow: var(--shadow-lg);
  max-height: 92svh;
  overflow: auto;
  position: relative;
}
.paymodal h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--sw-ink); padding-right: 36px; }
.paymodal .x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 0;
  background: var(--sw-surface-2);
  color: var(--sw-ink-3);
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, color 0.14s ease;
}
.paymodal .x:hover { background: var(--sw-surface-3); color: var(--sw-ink); }

.pm-sum { font-size: var(--fs-base); color: var(--sw-ink-3); margin-bottom: 16px; }
.pm-sum b { color: var(--sw-ink); }
.pm-quote-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin: 18px 0 12px; }
.pm-quote-head strong { font-size: 20px; color: var(--sw-ink); display: block; line-height: 1.3; }
.pm-quote-head .pm-total { text-align: right; white-space: nowrap; }
.pm-quote-head small { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--sw-ink-3); }
.pm-quote-options { margin: 12px 0; font-size: var(--fs-sm); line-height: 1.5; }
.pm-quote-options summary { cursor: pointer; color: var(--sw-ink-2); font-weight: 500; }
.pm-quote-options .access { font-size: var(--fs-sm); margin: 5px 5px 0 0; background: var(--sw-surface-2); color: var(--sw-ink-2); }

.pm-opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 0;
  border-radius: 14px;
  padding: 15px 16px;
  cursor: pointer;
  margin-bottom: 10px;
  background: var(--sw-surface-2);
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}
.pm-opt:hover { background: var(--sw-surface-3); }
.pm-opt.on {
  background: var(--sw-brand-bg);
  box-shadow: inset 0 0 0 1.5px rgba(192, 30, 30, 0.34);
}
.pm-opt .r {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #AEB9C7;
  flex: none;
  margin-top: 3px;
  background: #FFFFFF;
}
.pm-opt.on .r { border-color: var(--sw-brand); box-shadow: inset 0 0 0 3.5px #FFFFFF; background: var(--sw-brand); }
.pm-opt .t { font-weight: 600; color: var(--sw-ink); font-size: var(--fs-base); }
.pm-opt .d { font-size: var(--fs-sm); color: var(--sw-ink-3); margin-top: 3px; line-height: 1.45; }

.pm-chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
  margin: 14px 2px 4px;
  cursor: pointer;
  user-select: none;
  line-height: 1.45;
}
.pm-chk input { width: 18px; height: 18px; accent-color: var(--sw-brand); margin-top: 2px; flex: none; }
.pm-inp { margin-top: 10px; }

.pm-wait { text-align: center; padding: 24px 6px 10px; }
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--sw-surface-3);
  border-top-color: var(--sw-brand);
  margin: 0 auto 14px;
  animation: cab-spin 0.85s linear infinite;
}
@keyframes cab-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.pm-okic {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 26px;
  font-weight: 600;
}

.paymodal.stripe-open, .paymodal.usdt-open { max-width: 560px; }
.pm-stripe-sum {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  margin: 12px 0 16px;
  border-radius: 14px;
  background: var(--sw-surface-2);
  border: 0;
}
.pm-stripe-sum strong { display: block; font-size: 17px; color: var(--sw-ink); line-height: 1.3; }
.pm-stripe-sum small { display: block; font-size: var(--fs-sm); color: var(--sw-ink-3); margin-top: 3px; }
.pm-stripe-total { text-align: right; white-space: nowrap; }
.pm-stripe-load { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--sw-ink-3); font-size: var(--fs-sm); }
.pm-stripe-load .spinner { margin: 0; width: 22px; height: 22px; border-width: 2.5px; }

.pm-usdt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; padding-right: 38px; }
.pm-usdt-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-usdt-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
}
.pm-usdt-timer {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  border: 0;
}
.pm-usdt-grid { display: grid; grid-template-columns: 164px 1fr; gap: 16px; align-items: center; margin: 14px 0; }
.pm-usdt-qr {
  width: 164px;
  height: 164px;
  border-radius: 16px;
  border: 0;
  background: var(--sw-surface-2);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pm-usdt-qr img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; }
.pm-usdt-field { background: var(--sw-surface-2); border: 0; border-radius: 14px; padding: 11px 13px; margin-bottom: 10px; }
.pm-usdt-field:last-child { margin-bottom: 0; }
.pm-usdt-lbl { font-size: var(--fs-sm); color: var(--sw-ink-3); margin-bottom: 4px; display: block; }
.pm-usdt-val { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-usdt-val code { font-family: var(--sw-mono); font-size: 15px; font-weight: 600; color: var(--sw-ink); background: transparent; padding: 0; word-break: break-all; line-height: 1.35; }
.pm-usdt-val code.big { font-size: 18px; color: var(--sw-brand); }
.pm-usdt-val .kbtn { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); background: var(--sw-surface); flex: none; }
.pm-usdt-warn { background: var(--sw-warn-bg); border: 0; border-radius: 14px; padding: 12px 14px; font-size: var(--fs-sm); line-height: 1.48; color: var(--sw-warn); margin: 12px 0; }
.pm-usdt-status { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: var(--fs-sm); color: var(--sw-ink-2); }
.pm-usdt-status .spinner { margin: 0; width: 18px; height: 18px; border-width: 2px; flex: none; }
.pm-usdt-tx { margin-top: 10px; border-top: 1px solid var(--sw-divider); padding-top: 10px; font-size: var(--fs-sm); }
.pm-usdt-tx summary { cursor: pointer; color: var(--sw-ink-2); font-weight: 500; }
.pm-usdt-tx-row { display: flex; gap: 8px; margin-top: 10px; }
.pm-usdt-tx-row .pm-inp { margin-top: 0; font-family: var(--sw-mono); font-size: 15px; padding: 10px 12px; }

/* ── Sandbox (/sandbox, borderless 3-pane workspace, strict >= 15px) ─────── */
.sbx { max-width: none; margin: 0; padding: 24px 28px 48px; }
.sbx h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--sw-ink); }
.sbx .lead { color: var(--sw-ink-3); font-size: var(--fs-base); line-height: 1.55; margin: 0 0 22px; max-width: 72ch; }
.sbx .work { display: grid; grid-template-columns: 310px minmax(0, 1fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.sbx .panel { background: var(--sw-surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.sbx .panel-h {
  padding: 15px 18px;
  border-bottom: 1px solid var(--sw-divider);
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sbx .cat { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.sbx .grp { font-size: var(--fs-sm); color: var(--sw-ink-3); font-weight: 600; padding: 14px 18px 6px; }
.sbx .ep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 0;
  transition: background-color 0.13s ease, color 0.13s ease;
}
.sbx .ep:hover { background: var(--sw-surface-2); }
.sbx .ep.on { background: var(--sw-brand-bg); }
.sbx .ep .m {
  font-family: var(--sw-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--sw-ok);
  background: var(--sw-ok-bg);
  border-radius: 7px;
  padding: 3px 8px;
  flex: 0 0 auto;
  line-height: 1.15;
}
.sbx .ep .p {
  font-family: var(--sw-mono);
  font-size: 15px;
  color: var(--sw-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbx .ep.on .p { color: var(--sw-brand); font-weight: 600; }

.sbx .req { padding: 22px; }
.sbx .path { font-family: var(--sw-mono); font-size: var(--fs-base); color: var(--sw-ink); word-break: break-all; line-height: 1.5; margin-bottom: 6px; }
.sbx .path .mtag { font-weight: 600; color: var(--sw-ok); margin-right: 8px; }
.sbx .desc { color: var(--sw-ink-3); font-size: var(--fs-base); line-height: 1.5; margin-bottom: 18px; }
.sbx .flabel { font-size: var(--fs-sm); color: var(--sw-ink); font-weight: 600; margin: 18px 0 8px; }
.sbx .field { margin-bottom: 14px; }
.sbx .field label { display: block; font-size: var(--fs-sm); color: var(--sw-ink-2); font-weight: 600; margin-bottom: 6px; }
.sbx .field label .req-star { color: var(--sw-brand); }
.sbx .field .hint { color: var(--sw-ink-3); font-weight: 400; font-size: var(--fs-sm); margin-left: 6px; }
.sbx input.in, .sbx select.in { font-family: var(--sw-mono); font-size: 15px; }
.sbx .keyrow { display: flex; gap: 8px; align-items: center; }
.sbx .keyrow input { flex: 1; min-width: 0; }
.sbx .runbar { display: flex; align-items: center; gap: 12px; margin-top: 22px; border-top: 1px solid var(--sw-divider); padding-top: 18px; flex-wrap: wrap; }
.sbx .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sw-brand);
  color: #FFFFFF;
  font-family: var(--sw-font);
  font-weight: 600;
  border: 0;
  border-radius: var(--r-sm);
  padding: 0 22px;
  height: 46px;
  font-size: var(--fs-base);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(192, 30, 30, 0.22);
  transition: background-color 0.16s ease, transform 0.14s var(--cab-ease);
}
.sbx .btn:hover:not(:disabled) { background: var(--sw-brand-hover); transform: translateY(-1px); }
.sbx .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.sbx .ghostbtn { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 10px; }
.sbx .curlwrap { margin: 18px 0 0; }
.sbx pre.code { background: #0F141C; border: 0; border-radius: 14px; padding: 15px 16px; overflow-x: auto; font-size: 15px; line-height: 1.6; color: #D2DAE4; font-family: var(--sw-mono); margin: 0; }
.sbx .resp { padding: 0; }
.sbx .resp-meta { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--sw-divider); min-height: 52px; flex-wrap: wrap; }
.sbx .status { font-family: var(--sw-mono); font-size: 15px; font-weight: 600; padding: 4px 11px; border-radius: 8px; }
.sbx .status.ok { background: var(--sw-ok-bg); color: var(--sw-ok); }
.sbx .status.err { background: var(--sw-err-bg); color: var(--sw-err); }
.sbx .lat { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--sw-ink-3); }
.sbx .resp-body { max-height: min(660px, calc(100vh - 200px)); overflow: auto; }
.sbx pre.json { background: #0F141C; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 16px 18px; margin: 0; overflow-x: auto; font-size: 15px; line-height: 1.6; font-family: var(--sw-mono); color: #D2DAE4; tab-size: 2; }
.sbx .jk { color: #7EE787; }
.sbx .js { color: #A5D6FF; }
.sbx .jn { color: #F0A04B; }
.sbx .jb { color: #D2A8FF; }
.sbx .jnull { color: #8B949E; }
.sbx .empty { padding: 52px 22px; text-align: center; color: var(--sw-ink-3); font-size: var(--fs-base); }
.sbx .spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--sw-surface-3); border-top-color: var(--sw-brand); border-radius: 50%; animation: cab-spin 0.7s linear infinite; vertical-align: -3px; margin-right: 7px; }

/* ── Embedded iframe mode (no duplicate H1 / lead inside dashboard shell) ── */
html.in-frame .sbx { padding-top: 14px; }
html.in-frame .sbx > h1,
html.in-frame .sbx > .lead { display: none !important; }
html.in-frame body.cab-explorer .page { padding-top: 14px; }
html.in-frame body.cab-explorer #app > h1,
html.in-frame body.cab-explorer #app > .lead,
html.in-frame body.cab-explorer .ex-top { display: none !important; }

/* Sandbox dark code block with embedded Copy button */
.sbx .resp-code {
  position: relative;
  background: #0F141C;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}
.sbx .resp-code .sw-code-bar {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sbx .resp-code pre.json {
  border-radius: 0;
  background: transparent;
}

/* ── Explorer Light Chrome Overrides (preserves dark .mw Match Widget!) ─── */
body.cab-explorer .page { padding: 24px 28px 56px; }
body.cab-explorer .box,
body.cab-explorer .lg,
body.cab-explorer .an {
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
body.cab-explorer .sfield input,
body.cab-explorer .sfield input[type="search"],
body.cab-explorer .sfield input[type="text"] {
  padding-top: 12px;
  padding-bottom: 12px;
  padding-right: 16px;
  padding-left: 44px !important;
  line-height: 1.25;
}
body.cab-explorer .sfield svg {
  left: 15px;
  top: 50%;
  transform: translateY(calc(-50% - 1.5px));
  z-index: 2;
  color: var(--sw-ink-3);
}
/* Surface-aware inputs: white elevated on gray canvas (.gsearch), soft gray inside white cards (.box) */
body.cab-explorer .gsearch .sfield input,
body.cab-explorer .gsearch input.search,
body.cab-explorer .gsearch input[type="search"] {
  background-color: var(--sw-surface) !important;
  box-shadow: var(--shadow-xs);
  min-height: 48px;
  border-radius: 14px;
}
body.cab-explorer .gsearch .sfield input:hover,
body.cab-explorer .gsearch input.search:hover {
  box-shadow: var(--shadow-sm);
}
body.cab-explorer .gsearch .sfield input:focus,
body.cab-explorer .gsearch input.search:focus {
  background-color: var(--sw-surface) !important;
  box-shadow: 0 0 0 2px rgba(192, 30, 30, 0.24), var(--shadow-sm);
}
body.cab-explorer .box select.sport,
body.cab-explorer .box input.search,
body.cab-explorer .box input[type="search"],
body.cab-explorer .box input[type="text"] {
  border: 0;
  background-color: var(--sw-surface-2);
  border-radius: var(--r-sm);
  min-height: 44px;
  font-size: var(--fs-base);
  color: var(--sw-ink);
  box-shadow: none;
}
body.cab-explorer .box select.sport:focus,
body.cab-explorer .box input.search:focus,
body.cab-explorer .box input[type="search"]:focus,
body.cab-explorer .box input[type="text"]:focus {
  background-color: var(--sw-surface);
  box-shadow: 0 0 0 2px rgba(192, 30, 30, 0.24), var(--shadow-xs);
}
body.cab-explorer select.sport {
  padding-right: 40px;
  background-position: right 14px center;
}
body.cab-explorer select.sport::picker-icon { display: none !important; }
body.cab-explorer .grid {
  gap: 14px;
}
body.cab-explorer .lg {
  border: 0;
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: var(--sw-surface);
  box-shadow: 0 4px 20px rgba(17, 22, 29, 0.075), 0 1px 4px rgba(17, 22, 29, 0.03);
  transition: box-shadow 0.18s var(--cab-ease), transform 0.18s var(--cab-ease);
}
body.cab-explorer .lg:hover {
  box-shadow: 0 12px 30px rgba(17, 22, 29, 0.11), 0 3px 8px rgba(17, 22, 29, 0.04);
  transform: translateY(-2px);
}
body.cab-explorer .seg {
  border: 0;
  border-radius: 14px;
  background: var(--sw-surface);
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}
body.cab-explorer .seg button {
  border: 0;
  border-radius: 10px;
  padding: 8px 15px;
  font-size: var(--fs-base);
  color: var(--sw-ink-2);
}
body.cab-explorer .seg button + button { border-left: 0; }
body.cab-explorer .seg button:hover { background: var(--sw-surface-2); color: var(--sw-ink); }
body.cab-explorer .seg button.on { background: var(--sw-ink); color: #FFFFFF; font-weight: 600; }
body.cab-explorer .gs-dd { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }
body.cab-explorer .lgfb { border: 0; background: var(--sw-surface-2); color: var(--sw-ink-3); }
body.cab-explorer .statper { border: 0; background: var(--sw-surface-2); border-radius: 10px; padding: 7px 14px; font-size: var(--fs-sm); }
body.cab-explorer .statper.on { background: var(--sw-brand-bg); color: var(--sw-brand); border: 0; }
body.cab-explorer .ps-tabs button { border: 0; background: var(--sw-surface-2); font-size: var(--fs-sm); padding: 6px 13px; border-radius: 9px; }
body.cab-explorer .ps-tabs button.on { background: var(--sw-brand-bg); color: var(--sw-brand); font-weight: 600; }
body.cab-explorer .rawb { border: 0; background: var(--sw-surface-2); color: var(--sw-ink-3); font-family: var(--sw-font); font-size: var(--fs-sm); font-weight: 600; height: 30px; padding: 0 11px; border-radius: 8px; }
body.cab-explorer .rawb:hover { background: var(--sw-brand-bg); color: var(--sw-brand); }
body.cab-explorer .rawpre { font-size: 15px; border-radius: 12px; }
body.cab-explorer .gate-box { border: 0; background: var(--sw-surface-2); border-radius: 14px; padding: 15px 18px; }
body.cab-explorer .form i { width: 26px; height: 26px; font-size: 15px; border-radius: 7px; }
body.cab-explorer table:not(.mw table) {
  border: 0;
  border-radius: 14px;
  background: var(--sw-surface);
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}
body.cab-explorer table:not(.mw table) th {
  background: var(--sw-canvas);
  color: var(--sw-ink-3);
  border-bottom: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 11px 12px;
  vertical-align: middle;
}
body.cab-explorer .tabs {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  border: 0;
  border-radius: 14px;
  background: var(--sw-surface-2);
  margin: 14px 0 12px;
}
body.cab-explorer .tab {
  border: 0;
  margin: 0;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-2);
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
body.cab-explorer .tab:hover { color: var(--sw-ink); background: rgba(255, 255, 255, 0.55); }
body.cab-explorer .tab.on { background: var(--sw-surface); color: var(--sw-ink); box-shadow: var(--shadow-xs); }

/* Modern Match Schedule Rows (clean borderless flat list matching Standings & Order History) */
body.cab-explorer #tabBody {
  padding: 0;
  margin: 0;
}
body.cab-explorer .ex-ev-row {
  display: grid;
  grid-template-columns: 88px minmax(170px, 1fr) 78px minmax(170px, 1fr) 124px;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--sw-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.14s ease, border-radius 0.14s ease;
}
body.cab-explorer .ex-ev-row:last-child { border-bottom: 0; }
body.cab-explorer .ex-ev-row:hover {
  background: var(--sw-canvas);
  border-radius: 12px;
  border-bottom-color: transparent;
}
body.cab-explorer .ex-ev-dt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
body.cab-explorer .ex-ev-dt b {
  color: var(--sw-ink-2);
  font-weight: 600;
}
body.cab-explorer .ex-ev-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: var(--fs-base);
  color: var(--sw-ink-2);
  font-weight: 500;
}
body.cab-explorer .ex-ev-side.home { justify-content: flex-start; text-align: left; }
body.cab-explorer .ex-ev-side.away { justify-content: flex-start; text-align: left; }
body.cab-explorer .ex-ev-side.win { color: var(--sw-ink); font-weight: 600; }
body.cab-explorer .ex-ev-side .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cab-explorer .ex-ev-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  justify-self: center;
}
body.cab-explorer .ex-ev-score.live {
  background: var(--sw-brand-bg);
  color: var(--sw-brand);
}
body.cab-explorer .ex-ev-score.sched {
  background: transparent;
  color: var(--sw-ink-3);
  font-weight: 500;
}
body.cab-explorer .ex-ev-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
body.cab-explorer .ex-ev-stg {
  font-size: 15px;
  color: var(--sw-ink-3);
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modern Match Hub Card Components (inside openEvent modal, preserving dark .mw!) */
body.cab-explorer .ex-cap-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 16px;
}
body.cab-explorer .ex-cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 9px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}
body.cab-explorer .ex-cap-pill.has {
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
  font-weight: 600;
}
body.cab-explorer .ex-cap-pill.gated { opacity: 0.72; cursor: help; }

/* Visual 3-column Match Timeline (Home | Minute | Away) */
body.cab-explorer .ex-tl { display: flex; flex-direction: column; gap: 6px; }
body.cab-explorer .ex-tl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--sw-surface);
}
body.cab-explorer .ex-tl-side {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
}
body.cab-explorer .ex-tl-side.home { justify-content: flex-end; text-align: right; }
body.cab-explorer .ex-tl-side.away { justify-content: flex-start; text-align: left; }
body.cab-explorer .ex-tl-side b { color: var(--sw-ink); font-weight: 600; }
body.cab-explorer .ex-tl-min {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  justify-self: center;
}
body.cab-explorer .ex-tl-div {
  text-align: center;
  padding: 5px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-3);
  background: var(--sw-surface-2);
  border-radius: 999px;
  align-self: center;
  margin: 4px 0;
}

/* Modern Dual-Bar Comparison Match Statistics */
body.cab-explorer .ex-stat-list { display: flex; flex-direction: column; gap: 13px; }
body.cab-explorer .ex-stat-item {
  background: var(--sw-surface);
  border-radius: 12px;
  padding: 12px 14px;
}
body.cab-explorer .ex-stat-head {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
body.cab-explorer .ex-stat-val {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sw-ink-2);
}
body.cab-explorer .ex-stat-val.home { text-align: left; }
body.cab-explorer .ex-stat-val.away { text-align: right; }
body.cab-explorer .ex-stat-val.lead { color: var(--sw-ink); }
body.cab-explorer .ex-stat-name {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-weight: 500;
}
body.cab-explorer .ex-stat-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
body.cab-explorer .ex-stat-track {
  height: 7px;
  border-radius: 999px;
  background: var(--sw-surface-2);
  overflow: hidden;
  display: flex;
}
body.cab-explorer .ex-stat-track.home { justify-content: flex-end; }
body.cab-explorer .ex-stat-track.away { justify-content: flex-start; }
body.cab-explorer .ex-stat-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s var(--cab-ease);
}
body.cab-explorer .ex-stat-fill.home { background: #16A34A; }
body.cab-explorer .ex-stat-fill.away { background: #2563EB; }
body.cab-explorer .ex-stat-fill.dim { opacity: 0.42; }

/* Modern Attack Momentum Card */
body.cab-explorer .ex-mom-box {
  position: relative;
  height: 112px;
  background: var(--sw-surface);
  border-radius: 14px;
  overflow: hidden;
  padding: 6px 0;
}
body.cab-explorer .ex-mom-mid {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--sw-divider);
}
body.cab-explorer .ex-mom-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
}

/* Modern Symmetric Lineup Cards */
body.cab-explorer .ex-lu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
body.cab-explorer .ex-lu-card {
  background: var(--sw-canvas);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body.cab-explorer .ex-lu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--sw-divider);
}
body.cab-explorer .ex-lu-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--sw-ink);
}
body.cab-explorer .ex-lu-subh {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink-3);
  margin: 10px 0 6px;
}
body.cab-explorer .ex-lu-subh:first-of-type { margin-top: 0; }
body.cab-explorer .ex-lu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--sw-surface);
  margin-bottom: 6px;
  transition: background-color 0.14s ease, transform 0.12s ease;
}
body.cab-explorer .ex-lu-row.clk { cursor: pointer; }
body.cab-explorer .ex-lu-row.clk:hover { background: var(--sw-surface-2); transform: translateY(-1px); }
body.cab-explorer .ex-lu-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
body.cab-explorer .ex-lu-row .logo.rd,
body.cab-explorer .ex-best-card .logo.rd,
body.cab-explorer .ex-squad-card .logo.rd {
  object-fit: cover;
  object-position: top center;
  background: var(--sw-surface-2);
}
body.cab-explorer .ex-lu-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 5px;
  border-radius: 7px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}
body.cab-explorer .ex-lu-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--sw-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.cab-explorer .ex-lu-subtag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
body.cab-explorer .ex-lu-subtag.in { background: var(--sw-ok-bg); color: var(--sw-ok); }
body.cab-explorer .ex-lu-subtag.out { background: var(--sw-err-bg); color: var(--sw-err); }
body.cab-explorer .ex-lu-coach {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sw-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
}
body.cab-explorer .ex-lu-coach b { color: var(--sw-ink); font-weight: 600; }

/* Match Card Section Header, Side Bars, Best Players & Analytics DS v2 Polish */
body.cab-explorer .ex-ev-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
body.cab-explorer .ex-ev-h-l {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
body.cab-explorer .ex-ev-h h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--sw-ink);
}
body.cab-explorer .ex-ev-h .rawb { margin-left: 0; }
body.cab-explorer .ex-ev-h .rawpre { flex-basis: 100%; margin-top: 8px; }
body.cab-explorer .ex-stat-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}
body.cab-explorer .ex-mom-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sw-ink);
  min-width: 0;
}
body.cab-explorer .ex-mom-bar {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 999px;
  flex: none;
}
body.cab-explorer .ex-tl-sub {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  margin-left: 4px;
}
body.cab-explorer .ex-tl-sc {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-best-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
body.cab-explorer .ex-best-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sw-surface);
  transition: background-color 0.14s ease, transform 0.12s ease;
}
body.cab-explorer .ex-best-card.clk { cursor: pointer; }
body.cab-explorer .ex-best-card.clk:hover { background: var(--sw-surface-2); transform: translateY(-1px); }
body.cab-explorer .an {
  border: 0;
  border-radius: 16px;
  background: var(--sw-canvas);
  padding: 18px 20px;
  margin: 0 0 16px;
}
body.cab-explorer .an > h3:first-child { margin-top: 0; }
body.cab-explorer .an .metric,
body.cab-explorer .ex-panel .metric {
  background: var(--sw-surface);
  border-radius: 12px;
  padding: 12px 14px;
}
body.cab-explorer .an .tag,
body.cab-explorer .tag.ghost {
  border: 0;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
body.cab-explorer .an .tag { background: var(--sw-surface); }
body.cab-explorer .ex-panel .xtz {
  background: var(--sw-surface);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
}
body.cab-explorer .ex-panel .xtz .t {
  background: var(--sw-surface-2);
  border-radius: 999px;
}
body.cab-explorer .ex-info-tip { z-index: 60; }

/* Match Card Odds & Footer */
body.cab-explorer .ex-odd-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-odd-pill.best {
  background: var(--sw-ok-bg);
  color: var(--sw-ok);
}
body.cab-explorer .ex-ev-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--sw-divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.cab-explorer .ex-ev-foot .rawpre { flex-basis: 100%; margin-top: 8px; }
@media (max-width: 820px) {
  body.cab-explorer .ex-ev-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  body.cab-explorer .ex-lu-grid { grid-template-columns: 1fr; }
  body.cab-explorer .ex-tl-row { grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); }
}
body.cab-explorer table:not(.mw table) th:first-child { border-radius: 10px 0 0 10px; }
body.cab-explorer table:not(.mw table) th:last-child { border-radius: 0 10px 10px 0; }
body.cab-explorer table:not(.mw table) td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--sw-divider);
  color: var(--sw-ink-2);
  vertical-align: middle;
  font-size: var(--fs-base);
}
body.cab-explorer table:not(.mw table) tbody tr:last-child td { border-bottom: 0; }
body.cab-explorer table:not(.mw table) tbody tr:hover td { background: var(--sw-canvas); }

/* Crisp Data Explorer Tables (.ex-tbl) — zero right-shifted rank columns & zero clipping */
body.cab-explorer table.ex-tbl th.col-rank,
body.cab-explorer table.ex-tbl td.col-rank {
  width: 46px;
  min-width: 46px;
  max-width: 52px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
body.cab-explorer table.ex-tbl th.col-entity,
body.cab-explorer table.ex-tbl td.col-entity {
  width: auto;
  min-width: 148px;
  text-align: left;
  padding-left: 8px;
}
body.cab-explorer table.ex-tbl th.col-sub,
body.cab-explorer table.ex-tbl td.col-sub {
  width: 1%;
  text-align: left;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}
body.cab-explorer table.ex-tbl th.col-num,
body.cab-explorer table.ex-tbl td.col-num {
  width: 1%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
}
body.cab-explorer table.ex-tbl td.col-pts {
  width: 1%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  color: var(--sw-ink);
  padding-left: 10px;
  padding-right: 12px;
}
body.cab-explorer .ex-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sw-ink-2);
  background: transparent;
}
body.cab-explorer .ex-rank-badge.z-top { background: var(--sw-ok-bg); color: var(--sw-ok); }
body.cab-explorer .ex-rank-badge.z-playoff { background: var(--sw-info-bg); color: var(--sw-info); }
body.cab-explorer .ex-rank-badge.z-gold { background: rgba(234, 179, 8, 0.16); color: #A16207; }
body.cab-explorer .ex-rank-badge.z-silver { background: var(--sw-surface-2); color: var(--sw-ink-2); }
body.cab-explorer .ex-rank-badge.z-bronze { background: rgba(217, 119, 6, 0.14); color: #B45309; }
body.cab-explorer .ex-rank-badge.z-rel { background: var(--sw-err-bg); color: var(--sw-err); }
body.cab-explorer .ex-entity-link {
  color: var(--sw-ink) !important;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: color 0.14s ease;
}
body.cab-explorer .ex-entity-link:hover { color: var(--sw-brand) !important; }
body.cab-explorer .ex-diff-pos { color: var(--sw-ok); font-weight: 600; }
body.cab-explorer .ex-diff-neg { color: var(--sw-err); font-weight: 600; }
body.cab-explorer .ex-pts-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-val-bar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 112px;
}
body.cab-explorer .ex-val-track {
  width: 68px;
  height: 6px;
  border-radius: 999px;
  background: var(--sw-surface-2);
  overflow: hidden;
  flex: none;
}
body.cab-explorer .ex-val-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sw-brand);
}
body.cab-explorer .ex-group-card {
  margin-top: 18px;
}
body.cab-explorer .ex-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--sw-ink);
  margin: 0 0 10px;
}

/* Explorer Sports Hub Layout (League Profile, Team Hub, Player Hub — AiSports-grade) */
body.cab-explorer .ex-lhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
body.cab-explorer .ex-lhead-id {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
body.cab-explorer .ex-lhead h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--sw-ink);
}
body.cab-explorer .ex-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
body.cab-explorer .ex-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 9px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.25;
}
body.cab-explorer .ex-chip b { color: var(--sw-ink); font-weight: 600; }
body.cab-explorer .ex-chip.ok { background: var(--sw-ok-bg); color: var(--sw-ok); font-weight: 600; }
body.cab-explorer .ex-chip.bad { background: var(--sw-err-bg); color: var(--sw-err); font-weight: 600; }
body.cab-explorer .ex-chip.info { background: var(--sw-info-bg); color: var(--sw-info); font-weight: 600; }
body.cab-explorer .ex-chip.brand { background: var(--sw-brand-bg); color: var(--sw-brand); font-weight: 600; }
body.cab-explorer .ex-chip.link { cursor: pointer; transition: background-color 0.14s ease, color 0.14s ease; }
body.cab-explorer .ex-chip.link:hover { background: var(--sw-surface-3); color: var(--sw-brand); }

body.cab-explorer .ex-hub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
body.cab-explorer .ex-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--sw-surface-2);
  color: var(--sw-ink-2);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}
body.cab-explorer .ex-back-btn:hover { background: var(--sw-surface-3); color: var(--sw-ink); }

body.cab-explorer .ex-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--sw-canvas);
  margin-bottom: 18px;
}
body.cab-explorer .ex-hero-id {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  flex: 1 1 320px;
}
body.cab-explorer .ex-hero-avatar {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--sw-surface);
  box-shadow: var(--shadow-sm);
  flex: none;
}
body.cab-explorer .ex-hero-avatar.sq {
  border-radius: 16px;
  object-fit: contain;
  padding: 8px;
}
body.cab-explorer .ex-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.cab-explorer .ex-hero-title h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--sw-ink);
}
body.cab-explorer .ex-jersey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 9px;
  background: var(--sw-ink);
  color: #FFFFFF;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: none;
}
body.cab-explorer .ex-vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
body.cab-explorer .ex-vital {
  background: var(--sw-canvas);
  border-radius: 12px;
  padding: 11px 14px;
  min-width: 0;
}
body.cab-explorer .ex-vital .k {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  line-height: 1.25;
}
body.cab-explorer .ex-vital .v {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--sw-ink);
  margin-top: 3px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.cab-explorer .ex-hub-tabs {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 14px;
  background: var(--sw-surface-2);
  margin: 0 0 18px;
}
body.cab-explorer .ex-hub-tab {
  border: 0;
  background: transparent;
  color: var(--sw-ink-2);
  font-family: var(--sw-font);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
body.cab-explorer .ex-hub-tab:hover { color: var(--sw-ink); background: rgba(255, 255, 255, 0.55); }
body.cab-explorer .ex-hub-tab.on { background: var(--sw-surface); color: var(--sw-ink); box-shadow: var(--shadow-xs); }
body.cab-explorer .ex-hub-pane { display: none; }
body.cab-explorer .ex-hub-pane.on { display: block; animation: cab-view-in 0.18s var(--cab-ease); }

body.cab-explorer .ex-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
body.cab-explorer .ex-kpi {
  background: var(--sw-canvas);
  border-radius: 14px;
  padding: 15px 16px;
  min-width: 0;
}
body.cab-explorer .ex-kpi .k {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  font-weight: 500;
  line-height: 1.25;
}
body.cab-explorer .ex-kpi .v {
  font-size: 26px;
  font-weight: 600;
  color: var(--sw-ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-kpi .v.ok { color: var(--sw-ok); }
body.cab-explorer .ex-kpi .v.bad { color: var(--sw-err); }
body.cab-explorer .ex-kpi .s {
  font-size: var(--fs-sm);
  color: var(--sw-ink-3);
  margin-top: 5px;
  line-height: 1.3;
}
body.cab-explorer .ex-kpi .bar-mini {
  height: 5px;
  border-radius: 999px;
  background: var(--sw-surface-3);
  overflow: hidden;
  margin-top: 10px;
}
body.cab-explorer .ex-kpi .bar-mini i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sw-info);
}
body.cab-explorer .ex-kpi .bar-mini i.ok { background: var(--sw-ok); }
body.cab-explorer .ex-kpi .bar-mini i.brand { background: var(--sw-brand); }

body.cab-explorer .ex-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
body.cab-explorer .ex-panel {
  background: var(--sw-canvas);
  border-radius: 16px;
  padding: 18px 20px;
  min-width: 0;
}
body.cab-explorer .ex-panel h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--sw-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body.cab-explorer .ex-panel table {
  background: var(--sw-surface);
  margin: 0;
}

/* Home vs Away scoring split bar & market bars */
body.cab-explorer .ex-split-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--sw-ink-2);
  margin-bottom: 7px;
}
body.cab-explorer .ex-split-head b {
  font-size: 18px;
  color: var(--sw-ink);
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-split-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  gap: 3px;
  background: var(--sw-surface-3);
}
body.cab-explorer .ex-split-track i { display: block; height: 100%; border-radius: 999px; }
body.cab-explorer .ex-mkt-list { display: flex; flex-direction: column; gap: 11px; }
body.cab-explorer .ex-mkt-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: var(--fs-sm);
  margin-bottom: 5px;
}
body.cab-explorer .ex-mkt-row-head span { color: var(--sw-ink-2); }
body.cab-explorer .ex-mkt-row-head b { color: var(--sw-ink); font-variant-numeric: tabular-nums; }
body.cab-explorer .ex-mkt-track {
  height: 7px;
  border-radius: 999px;
  background: var(--sw-surface-3);
  overflow: hidden;
}
body.cab-explorer .ex-mkt-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--sw-info);
}
body.cab-explorer .ex-mkt-fill.ok { background: var(--sw-ok); }
body.cab-explorer .ex-mkt-fill.brand { background: var(--sw-brand); }

/* Color-coded ratings & W/D/L result pills */
body.cab-explorer .ex-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.cab-explorer .ex-rating.r-elite { background: var(--sw-info-bg); color: var(--sw-info); }
body.cab-explorer .ex-rating.r-good { background: var(--sw-ok-bg); color: var(--sw-ok); }
body.cab-explorer .ex-rating.r-avg { background: var(--sw-warn-bg); color: var(--sw-warn); }
body.cab-explorer .ex-rating.r-low { background: var(--sw-err-bg); color: var(--sw-err); }

body.cab-explorer .ex-res-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  flex: none;
}
body.cab-explorer .ex-res-pill.w { background: var(--sw-ok-bg); color: var(--sw-ok); }
body.cab-explorer .ex-res-pill.d { background: var(--sw-surface-2); color: var(--sw-ink-2); }
body.cab-explorer .ex-res-pill.l { background: var(--sw-err-bg); color: var(--sw-err); }

/* Match rows in Team/Player hubs */
body.cab-explorer .ex-match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.14s ease;
  border-bottom: 1px solid var(--sw-divider);
}
body.cab-explorer .ex-match-row:last-child { border-bottom: 0; }
body.cab-explorer .ex-match-row:hover { background: var(--sw-canvas); }
body.cab-explorer .ex-match-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--sw-surface-2);
  color: var(--sw-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Squad, Participants & Trophies grids */
body.cab-explorer .ex-squad-grid,
body.cab-explorer .ex-trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
body.cab-explorer .ex-squad-card,
body.cab-explorer .ex-trophy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sw-canvas);
  min-width: 0;
  transition: background-color 0.14s ease, transform 0.14s ease;
}
body.cab-explorer .ex-squad-card { cursor: pointer; }
body.cab-explorer .ex-squad-card:hover { background: var(--sw-surface-2); transform: translateY(-1px); }
body.cab-explorer .ex-panel .ex-squad-card {
  background: var(--sw-surface);
  box-shadow: 0 4px 16px rgba(17, 22, 29, 0.06), 0 1px 3px rgba(17, 22, 29, 0.025);
}
body.cab-explorer .ex-panel .ex-squad-card:hover {
  background: var(--sw-surface);
  box-shadow: 0 10px 24px rgba(17, 22, 29, 0.095), 0 2px 6px rgba(17, 22, 29, 0.035);
}
body.cab-explorer .ex-squad-info { min-width: 0; flex: 1; }
body.cab-explorer .ex-squad-name { font-weight: 600; color: var(--sw-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cab-explorer .ex-squad-sub { font-size: var(--fs-sm); color: var(--sw-ink-3); margin-top: 2px; }
body.cab-explorer .ex-trophy-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 11px;
  background: rgba(234, 179, 8, 0.16);
  color: #A16207;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* Explorer uses .modal-bg as the backdrop and .modal as the full hub sheet —
   explicitly reset sw-components.css .modal backdrop rules here! */
body.cab-explorer .modal-bg {
  background: rgba(17, 22, 29, 0.48);
  backdrop-filter: blur(5px);
  padding: 24px 18px;
}
body.cab-explorer .modal {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  overflow: auto;
  background: var(--sw-surface);
  color: var(--sw-ink);
  padding: 28px 30px;
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: none;
  z-index: auto;
}
body.cab-explorer .modal .x {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--sw-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 0;
  cursor: pointer;
}
body.cab-explorer .modal .x:hover { background: var(--sw-err-bg); color: var(--sw-brand); }
@media (max-width: 820px) {
  body.cab-explorer .ex-two-col { grid-template-columns: 1fr; }
  body.cab-explorer .ex-hero-side { align-items: flex-start; }
  body.cab-explorer .modal { padding: 20px 18px; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1120px) {
  body.cab-app-body .grid, .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .sbx .work { grid-template-columns: 1fr; }
  .sbx .cat { position: static; max-height: none; }
  .sbx .cat .catlist { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .sbx .cat .grp { width: 100%; padding: 8px 6px 2px; }
  .sbx .ep { margin: 0; background: var(--sw-surface-2); }
}

@media (max-width: 920px) {
  .app-sb { transform: translateX(-100%); transition: transform 0.24s var(--cab-ease); box-shadow: var(--shadow-lg); }
  .app-sb.open { transform: none; }
  .app-main { margin-left: 0; }
  .sb-burger { display: inline-flex; }
  .app-body { padding: 20px 20px 52px; }
  .app-top { padding: 0 20px; }
}

@media (max-width: 760px) {
  body.cab-app-body .grid, .plans, .onb, .dv-row2 { grid-template-columns: 1fr; }
  .sbx { padding: 16px; }
}

@media (max-width: 600px) {
  .bl-hero .col { flex: 1 1 calc(50% - 20px); min-width: 130px; }
  .bl-section-head { align-items: flex-start; }
  .bl-section-head .kbtn { width: 100%; }
  .bl-order-head { gap: 14px; }
  .bl-order-actions .pri { flex: 1 1 100%; }
  .bl-history-table, .bl-history-table tbody { display: block; width: 100%; }
  .bl-history-table thead { display: none; }
  .bl-history-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "order created" "plan plan" "amount status";
    gap: 8px 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--sw-divider);
  }
  #view-billing .bl-history-table td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .bl-history-table td:nth-child(1) { grid-area: order; }
  .bl-history-table td:nth-child(1)::before { content: "Заказ "; color: var(--sw-ink-3); }
  html[lang="en"] .bl-history-table td:nth-child(1)::before { content: "Order "; }
  html[lang="zh-CN"] .bl-history-table td:nth-child(1)::before { content: "订单 "; }
  .bl-history-table td:nth-child(2) { grid-area: created; text-align: right; color: var(--sw-ink-3); }
  .bl-history-table td:nth-child(3) { grid-area: plan; min-width: 0; max-width: none; }
  .bl-history-table td:nth-child(4) { grid-area: amount; }
  .bl-history-table td:nth-child(5) { grid-area: status; text-align: right; }
  .pm-usdt-grid { grid-template-columns: 1fr; }
  .pm-usdt-qr { margin: 0 auto; }
}
