:root {
  --bg: #09090b;
  --bg-elev: #0c0c0f;
  --surface: #121215;
  --surface-2: #18181c;
  --surface-3: #1f1f24;
  --line: #2a2a31;
  --line-2: #3f3f48;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #d4ff4a;
  --accent-text: #0a0a0c;
  --accent-soft: rgba(212, 255, 74, 0.14);
  --accent-2: #f472b6;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #fb7185;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(212, 255, 74, 0.03) 0%, transparent 32%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 3px
    ),
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(212, 255, 74, 0.09), transparent 55%),
    linear-gradient(180deg, #0b0b0e 0%, var(--bg) 42%);
}

a {
  color: #f9a8d4;
  text-underline-offset: 3px;
}

a:hover {
  color: #fbcfe8;
}

.hidden {
  display: none !important;
}

.err {
  color: var(--err);
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.45;
}

.ok {
  color: var(--ok);
  font-size: 13px;
}

.help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px 22px;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(212, 255, 74, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: var(--radius-sm);
}

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

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-label {
  margin: 10px 4px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #71717a;
}

.sidebar-spacer {
  flex: 1;
  min-height: 12px;
}

.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 12px;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.15s var(--ease);
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--line-2);
  background: var(--surface-2);
}

.nav-btn.active {
  color: var(--accent-text);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.nav-btn--logout {
  margin-top: 4px;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 600;
}

.nav-btn--logout:hover {
  color: var(--err);
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.08);
}

.mobnav {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mobnav .nav-btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 120px;
  text-align: center;
}

.main {
  padding: 26px 32px 48px;
  overflow-x: hidden;
}

.layout > .main {
  max-width: 1720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.topbar,
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-head-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-head-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717a;
}

.page-head-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.pill-user {
  color: var(--text);
  border-color: var(--accent-soft);
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  box-shadow: 0 0 0 1px rgba(212, 255, 74, 0.12);
}

.card {
  position: relative;
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: card-in 0.32s var(--ease) both;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  opacity: 0.85;
  pointer-events: none;
}

.card--toolbar::before {
  opacity: 1;
}

.admin-toolbar {
  margin-bottom: 0;
}

.admin-toolbar .card.card--toolbar {
  background: linear-gradient(
    105deg,
    rgba(212, 255, 74, 0.07) 0%,
    rgba(212, 255, 74, 0.02) 56px,
    var(--surface) 140px
  );
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm), inset 1px 0 0 rgba(212, 255, 74, 0.08);
}

.admin-work {
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.admin-work #admin-body > .card:first-child {
  margin-top: 0;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.row > div {
  flex: 1;
  min-width: 180px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input:not([type='checkbox']):not([type='radio']),
textarea,
select {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 11px 14px;
  font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input:not([type='checkbox']):not([type='radio']):hover,
textarea:hover,
select:hover {
  border-color: var(--line-2);
}

input:not([type='checkbox']):not([type='radio']):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  max-width: 100%;
  min-height: 126px;
  font-family: var(--mono);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), filter 0.15s var(--ease), opacity 0.15s;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-2);
}

.btn.secondary:hover {
  border-color: var(--muted);
  background: var(--surface-2);
  filter: none;
}

.btn.danger {
  background: #9f1239;
  border-color: #e11d48;
  color: #fff7ed;
}

.btn.danger:hover {
  filter: brightness(1.08);
}

.btn.sm {
  font-size: 13px;
  border-radius: 7px;
  padding: 7px 12px;
}

.link-btn {
  background: transparent;
  border: none;
  color: #f9a8d4;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.link-btn:hover {
  color: #fbcfe8;
  text-decoration: underline;
}

.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #71717a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

tbody tr:hover td {
  background: rgba(212, 255, 74, 0.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge.ok {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.1);
}

.badge.bad {
  color: var(--err);
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.08);
}

.badge.warn {
  color: #e8d38a;
  border-color: rgba(234, 211, 138, 0.45);
  background: rgba(234, 211, 138, 0.08);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 38vw) 1fr;
  background: var(--bg);
}

.login-page--boot .login-aside {
  animation: none;
}

.login-aside {
  position: relative;
  display: flex;
  align-items: stretch;
  padding: clamp(28px, 5vw, 56px);
  background: linear-gradient(165deg, #111 0%, var(--bg-elev) 48%, #0a0a0c 100%);
  border-right: 1px solid var(--line);
}

.login-aside::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  opacity: 0.5;
  border-radius: 3px;
}

.login-aside-inner {
  max-width: 320px;
  margin: auto 0;
}

.login-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent);
  border-radius: 14px;
  letter-spacing: -0.04em;
}

.login-aside-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #71717a;
}

.login-aside-title {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.login-aside-lead {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 28ch;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px);
  background: radial-gradient(ellipse 80% 50% at 70% 20%, rgba(212, 255, 74, 0.06), transparent 50%), var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0;
  padding: 0;
}

.login-card {
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.login-card::before,
.boot-card::before {
  opacity: 0.65;
}

.login-card-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #71717a;
}

.login-card-title {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.boot-card .boot-status {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.boot-err {
  margin: 0 0 16px !important;
}

.boot-spinner {
  width: 40px;
  height: 40px;
  margin: 0 0 18px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: boot-spin 0.75s linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

.mono {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 14px;
}

.client-main {
  max-width: 1080px;
  margin: 0 auto;
  padding-bottom: 56px;
}

.client-dashboard {
  padding-top: 4px;
}

.client-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-sm);
}

.client-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.client-h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.client-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 560px;
  line-height: 1.55;
}

.client-hero-aside {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.client-empty-card {
  text-align: center;
  padding: 36px 28px;
}

.client-empty-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.toast-host {
  position: fixed;
  z-index: 10050;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  right: max(18px, env(safe-area-inset-right, 0px));
  left: auto;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-pop {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px 14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface-3) 100%);
  box-shadow: var(--shadow-sm), 0 20px 50px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.985);
  visibility: hidden;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0.22s;
}

.toast-pop.toast-pop--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  visibility: visible;
  transition:
    opacity 0.26s var(--ease),
    transform 0.26s var(--ease),
    visibility 0s;
}

.toast-pop__accent {
  width: 4px;
  align-self: stretch;
  flex-shrink: 0;
  margin: 2px 0;
  border-radius: 3px;
  background: var(--line-2);
}

.toast-pop--ok .toast-pop__accent {
  background: linear-gradient(180deg, #86efac 0%, var(--ok) 55%, #15803d 100%);
}

.toast-pop--err .toast-pop__accent {
  background: linear-gradient(180deg, #fda4af 0%, var(--err) 50%, #be123c 100%);
}

.toast-pop__glyph {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
}

.toast-pop--ok .toast-pop__glyph {
  color: var(--ok);
  background: rgba(74, 222, 128, 0.1);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.32);
}

.toast-pop--ok .toast-pop__glyph::before {
  content: "✓";
}

.toast-pop--err .toast-pop__glyph {
  color: var(--err);
  background: rgba(251, 113, 133, 0.12);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.38);
}

.toast-pop--err .toast-pop__glyph::before {
  content: "!";
}

.toast-pop__msg {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 5px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.toast-pop__close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin: -2px -2px 0 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.toast-pop__close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--muted);
}

.toast-pop__close:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.client-mirror-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.client-mirror-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.client-mirror-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.client-mirror-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.client-mirror-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--muted);
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.client-mirror-h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.client-limit-pill {
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--warn);
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.client-status-slot {
  margin-left: auto;
}

.client-mirror-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-stat-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.client-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 10px 12px;
  min-width: 0;
}

.client-stat--compact {
  flex: 0 0 auto;
  width: 108px;
}

.client-stat--grow {
  flex: 1 1 0;
  min-width: 140px;
}

.client-stat-label {
  display: block;
  margin-bottom: 5px;
  color: #71717a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.client-stat-value {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.client-stat-line {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-mirror-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.client-meta-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 148px;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
}

.client-meta-k {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #71717a;
}

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

.client-settings {
  margin: 0;
  border: 0;
}

.client-settings-summary {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--surface-2);
  transition: background 0.18s var(--ease);
}

.client-settings-summary::-webkit-details-marker {
  display: none;
}

.client-settings-summary::marker {
  content: "";
}

.client-settings-summary:hover {
  background: var(--surface-3);
}

.client-settings[open] > .client-settings-summary {
  border-bottom: 1px solid var(--line);
}

.client-settings-label {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.client-settings-hint {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}

.client-settings-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.22s var(--ease), border-color 0.15s, color 0.15s;
}

.client-settings[open] .client-settings-chevron {
  transform: rotate(-180deg);
  border-color: rgba(212, 255, 74, 0.35);
  color: var(--accent);
}

.client-settings-body {
  padding: 0 18px 18px;
  background: var(--surface);
}

.client-settings-body .client-fields {
  padding: 16px 0 0;
  margin-bottom: 0;
}

.client-fields {
  padding: 18px;
}

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

.client-tight input {
  max-width: none;
}

.client-ta {
  min-height: 96px;
}

.client-save-row {
  margin-top: 16px;
}

.client-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 36px 16px;
}

.client-modal.hidden {
  display: none !important;
}

.client-modal-card {
  width: 100%;
  max-width: 920px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.client-modal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.client-modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  min-width: 180px;
}

.client-log-pre {
  max-height: min(60vh, 520px);
  margin: 0;
  min-height: 220px;
}

.client-policy-card {
  max-width: 980px;
  padding: 24px 24px 20px;
}

.client-policy-lead {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.55;
}

.client-policy-list {
  margin: 0;
  padding-left: 22px;
  max-height: min(58vh, 560px);
  overflow: auto;
  display: grid;
  gap: 10px;
  color: var(--text);
  line-height: 1.5;
}

.client-policy-list li {
  padding-right: 4px;
}

.client-policy-foot {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.client-policy-check {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.client-policy-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.sb-panel {
  overflow: hidden;
  background: var(--surface-2);
}

.sb-panel-h {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.sb-panel-h h2 {
  margin: 0;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sb-mirrors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sb-mirrors-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sb-panel-b {
  padding: 16px 18px 18px;
}

.sb-navtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.sb-navtab {
  border: 1px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 10px 16px;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sb-navtab:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.sb-navtab.active {
  color: var(--text);
  border-color: var(--line);
  border-bottom-color: var(--surface);
  background: var(--surface);
}

.sb-tab-panel {
  display: none;
  padding: 0 0 16px;
}

.sb-tab-panel.show {
  display: block;
}

.sb-mirrors-card .sb-tab-panel.show {
  padding: 0 16px 16px;
}

.sb-mirrors-hint {
  margin: 12px 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.sb-table {
  margin: 0;
}

.sb-table thead th {
  white-space: nowrap;
  background: var(--surface-2);
}

.sb-table tbody tr:hover {
  background: rgba(212, 255, 74, 0.04);
}

.sb-console-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sb-console-label {
  color: #71717a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.sb-select {
  min-width: 200px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.sb-select--grow {
  flex: 1;
  min-width: 220px;
}

.sb-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.sb-inline-check input {
  width: auto;
  accent-color: var(--accent);
}

.sb-log {
  height: min(60vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.sb-log--page {
  margin-top: 6px;
}

.sb-log-line {
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

.sb-log-line:last-child {
  border-bottom: 0;
}

.sb-log-line--err {
  color: var(--err);
  font-weight: 600;
}

.sb-log-line--muted {
  color: var(--muted);
  font-style: italic;
}

.sb-add-card textarea.sb-textarea-json {
  min-height: 160px;
  max-width: 100%;
  font-family: var(--mono);
}

.sb-dep-stats-bundle {
  margin-bottom: 22px;
}

.sb-dep-stats-bundle:last-of-type {
  margin-bottom: 0;
}

.sb-dep-stats-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 1024px) {
  .sb-dep-stats-split {
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
    align-items: stretch;
  }
}

.sb-panel--stats-meta .sb-stat-meta-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.sb-panel--stats-mir .sb-stat-mirrors-wrap {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.sb-stat-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.sb-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sb-stat-card--meta {
  min-height: 78px;
}

.sb-stat-k {
  color: #71717a;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sb-stat-v {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.sb-stat-v--sm {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.sb-stat-mirrors-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.sb-stat-card--mirror {
  grid-column: span 1;
}

.sb-stat-mirror-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sb-stat-mirror-title {
  font-size: 15px;
  font-weight: 700;
}

.sb-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sb-stat-mirror-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sb-stat-span2 {
  grid-column: 1 / -1;
}

.sb-raw-details {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 14px 16px;
}

.sb-raw-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sb-raw-pre {
  margin: 14px 0 0;
  max-height: 52vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.sb-stats-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sb-stats-legend {
  font-size: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.sb-lg-steam {
  color: #6eb5ff;
}

.sb-lg-fp {
  color: #7dcea0;
}

.sb-lg-cp {
  color: #f5b041;
}

.sb-lg-rd {
  color: #f87171;
}

.sb-stats-chart-label {
  margin: 0 0 6px;
  font-size: 12px;
}

.sb-stats-charts-mirror-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.sb-stats-chart-compare-wrap {
  margin-top: 16px;
}

.sb-stats-chart-compare-wrap .sb-stats-compare-title {
  margin: 0 0 6px;
}

.sb-stats-chart-tip {
  display: none;
  position: absolute;
  z-index: 5;
  min-width: 120px;
  max-width: 200px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  line-height: 1.45;
  color: var(--fg);
  pointer-events: none;
}

.sb-stats-chart-tip-inner {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--muted);
}

.sb-dep-stats-cap {
  margin-bottom: 10px;
}

.sb-dep-stats-h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sb-mirrors-subcard {
  margin-bottom: 18px;
}

.sb-mirrors-subcard:last-of-type {
  margin-bottom: 0;
}

.toolbar-main-label {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
}

.toolbar-deps-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 720px;
}

.toolbar-dep-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.toolbar-dep-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.toolbar-dep-lab {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.toolbar-dep-sel {
  max-width: 100%;
}

.toolbar-dep-sel--full {
  width: 100%;
  min-width: 0;
}

.toolbar-dep-block--multi {
  max-width: 720px;
}

.toolbar-dep-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 320px);
  overflow-y: auto;
  padding: 4px 0;
}

.toolbar-dep-check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.toolbar-dep-check-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.toolbar-dep-check-txt {
  flex: 1;
  min-width: 0;
}

.toolbar-dep-check-url {
  word-break: break-all;
  color: var(--muted);
  font-size: 12px;
}

.sb-select-multi {
  width: 100%;
  max-width: 100%;
  min-height: 120px;
}

.client-tg-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  max-width: none;
}

.client-tg-row > .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.client-wipe-btn--cd {
  opacity: 0.78;
  border-color: rgba(251, 191, 36, 0.35);
  color: #d4d4d8;
}

.client-wipe-btn--cd:hover {
  opacity: 0.92;
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--text);
}

input.client-tg-input.f-tg {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.client-dep-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: middle;
}

.client-subh2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.client-stats-charts {
  margin-top: 18px;
}

.cl-inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cl-dot-spin {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  display: inline-block;
  animation: cl-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes cl-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.sb-stats-chart-wrap {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
}

.sb-stats-chart {
  display: block;
  width: 100%;
  height: 220px;
  vertical-align: top;
}

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

  .sidebar {
    display: none;
  }

  .mobnav {
    display: flex;
  }

  .main {
    padding: 18px 16px 28px;
  }

  .page-head-title {
    font-size: 24px;
  }
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 20px;
  }

  .login-aside::after {
    display: none;
  }

  .login-aside-inner {
    max-width: none;
  }

  .login-aside-lead {
    max-width: none;
  }

  .login-main {
    align-items: flex-start;
    padding-top: 28px;
  }
}

@media (max-width: 720px) {
  .card {
    padding: 16px;
  }

  .row {
    gap: 10px;
  }

  .row > div {
    min-width: 100%;
  }

  input,
  textarea,
  select {
    max-width: 100%;
  }

  .client-field-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .client-h1 {
    font-size: 24px;
  }

  .client-mirror-actions {
    width: 100%;
  }

  .client-mirror-actions .btn {
    flex: 1;
    min-width: 110px;
  }

  .sb-stat-mirror-grid {
    grid-template-columns: 1fr;
  }
}

.ds-title-lab {
  display: block;
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ds-title-inp {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}

.ds-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.ds-mount {
  margin-top: 4px;
}

.ds-scroll {
  overflow: auto;
  max-height: min(72vh, 920px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ds-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

.ds-th,
.ds-td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  vertical-align: middle;
}

.ds-th--corner,
.ds-td--num {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ds-th {
  background: var(--surface-2);
  position: relative;
  user-select: none;
}

.ds-th-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 8px 10px 8px 8px;
  padding-right: 36px;
}

.ds-col-name {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
}

.ds-col-del {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s var(--ease);
}

.ds-th:hover .ds-col-del,
.ds-th:focus-within .ds-col-del {
  opacity: 1;
  pointer-events: auto;
}

.ds-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.ds-resize:hover {
  background: var(--accent-soft);
}

.ds-td {
  background: var(--surface);
}

.ds-cell {
  min-height: 38px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
}

.ds-cell:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ds-td--rowact {
  width: 48px;
  min-width: 48px;
  text-align: center;
  background: var(--surface-2);
  vertical-align: middle;
}

.ds-tr:hover .ds-cell {
  background: var(--surface-3);
}

.ds-tr:hover .ds-td--num,
.ds-tr:hover .ds-td--rowact {
  background: var(--surface-3);
}

.doc-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}

.doc-guide-card {
  border-left: 3px solid var(--accent);
}

.doc-guide-h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc-guide-h3 {
  margin: 18px 0 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.doc-guide-h3:first-of-type {
  margin-top: 4px;
}

.doc-ol {
  margin: 0 0 12px;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.doc-ol li {
  margin-bottom: 8px;
}

.doc-ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

.doc-pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  color: #e4e4e7;
  max-height: 420px;
  overflow-y: auto;
}

.doc-code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: #fde68a;
}

.doc-pkg-status {
  margin: 0 0 14px !important;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text) !important;
  font-size: 13px !important;
}

.doc-pkg-inp {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
