/* ============ tokens ============ */
:root {
  color-scheme: dark;
  --bg: #04050c;
  --ink: #eaefff;
  --muted: #9aa5c9;
  --dim: #7c87ad;
  --line: rgba(146, 166, 255, 0.14);
  --line-strong: rgba(158, 180, 255, 0.3);
  --violet: #8b7bff;
  --cyan: #52d6ff;
  --pink: #ff77c8;
  --green: #59e3ad;
  --red: #ff6f86;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --glass: linear-gradient(158deg, rgba(32, 39, 75, 0.62) 0%, rgba(10, 13, 28, 0.74) 62%, rgba(8, 10, 22, 0.8) 100%);
  --shadow-panel: 0 40px 90px -50px rgba(0, 0, 0, 0.95), 0 2px 0 rgba(255, 255, 255, 0.03) inset;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 760px at 16% -12%, rgba(93, 72, 226, 0.3), transparent 62%),
    radial-gradient(900px 700px at 92% 4%, rgba(0, 138, 255, 0.16), transparent 60%),
    radial-gradient(1000px 900px at 52% 118%, rgba(178, 54, 196, 0.15), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 123, 255, 0.38); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus { outline: none; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }

/* ============ background ============ */
#neural-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  opacity: 0.9;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(115% 85% at 50% 34%, transparent 30%, rgba(2, 3, 9, 0.5) 78%, rgba(1, 2, 6, 0.78) 100%);
}

/* ============ layout ============ */
.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 22px 0 0;
  flex: none;
}

.topbar__inner {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(173, 160, 255, 0.95), rgba(94, 200, 255, 0.72));
  box-shadow:
    0 8px 24px -10px rgba(139, 123, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.brand__mark svg { width: 24px; height: 24px; }

.brand__name {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(150, 170, 255, 0.08);
}

.nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.nav__item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }

.nav__item.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(160, 180, 255, 0.16);
}

.nav__item[data-locked] { color: rgba(140, 152, 190, 0.6); cursor: default; }
.nav__item[data-locked]:hover { color: rgba(160, 176, 215, 0.75); background: transparent; }

.nav__lock {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  opacity: 0.7;
}

.nav__item:not([data-locked]) .nav__lock { display: none; }

.topbar__status {
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.topbar__epoch { color: var(--dim); font-size: 11.5px; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(89, 227, 173, 0.55);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}

.pulse-dot--sm { width: 6px; height: 6px; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(89, 227, 173, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(89, 227, 173, 0); }
  100% { box-shadow: 0 0 0 0 rgba(89, 227, 173, 0); }
}

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vh, 64px) 0 48px;
}

.stage.is-connected { align-items: flex-start; }

.stage__inner {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============ auth panel ============ */
.auth-panel {
  position: relative;
  width: min(880px, 100%);
  margin-inline: auto;
  border-radius: var(--radius-xl);
  padding: clamp(26px, 3.6vw, 46px);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(26px) saturate(135%);
  -webkit-backdrop-filter: blur(26px) saturate(135%);
  overflow: hidden;
  animation: panel-in 0.75s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}

.auth-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(142deg, rgba(180, 190, 255, 0.45), rgba(120, 90, 255, 0.04) 42%, rgba(82, 214, 255, 0.28) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.auth-panel__halo {
  position: absolute;
  width: 560px;
  height: 420px;
  top: -280px;
  left: -80px;
  background: radial-gradient(closest-side, rgba(124, 107, 255, 0.5), transparent 72%);
  filter: blur(20px);
  pointer-events: none;
}

.auth-panel__body { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a8b4dd;
}

.eyebrow__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 1px rgba(82, 214, 255, 0.8);
}

.auth-panel__title {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 620;
  color: #f4f7ff;
}

.grad {
  background: linear-gradient(96deg, #b7adff 0%, #8fd9ff 48%, #ff9fd6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-panel__lede {
  margin: 18px 0 0;
  max-width: 56ch;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--muted);
}

/* ============ form ============ */
.key-form {
  margin-top: clamp(24px, 3vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.field { min-width: 0; }

.field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field__head label {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b9c4e8;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: #8f9bc4;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.link-btn:hover { color: #c9d3ff; }
.link-btn--arrow::after { content: " →"; }

.input-wrap {
  display: flex;
  align-items: center;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(6, 9, 20, 0.72);
  border: 1px solid rgba(150, 170, 255, 0.17);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap:hover { border-color: rgba(160, 180, 255, 0.28); }

.input-wrap:focus-within {
  border-color: rgba(139, 123, 255, 0.75);
  background: rgba(7, 10, 23, 0.85);
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.14);
}

.input-wrap.is-invalid {
  border-color: rgba(255, 111, 134, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 111, 134, 0.12);
}

.input-wrap__icon {
  width: 42px;
  display: grid;
  place-items: center;
  color: #6f7ba4;
  flex: none;
}

.input-wrap__icon svg { width: 17px; height: 17px; }

#apiKey {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  outline: none;
}

#apiKey::placeholder { color: #5c678d; }

#apiKey:disabled { color: var(--dim); }

#apiKey:focus-visible { outline: none; }

.icon-btn {
  flex: none;
  width: 38px;
  height: 38px;
  margin-right: 7px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7d89b3;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.icon-btn svg { width: 17px; height: 17px; }

.field__hint {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}

.field__error {
  margin: 9px 0 0;
  display: flex;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #ff9aa9;
}

.field__error::before {
  content: "!";
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #1a0710;
  background: #ff8b9d;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 54px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.25s, background 0.25s, opacity 0.2s;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(128deg, #7a68ff 0%, #5b7dff 52%, #3fb9ff 100%);
  box-shadow:
    0 14px 34px -14px rgba(104, 106, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 18px 40px -14px rgba(104, 130, 255, 0.95), 0 1px 0 rgba(255, 255, 255, 0.4) inset; }
.btn--primary:active { transform: translateY(0); }

.btn--primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn svg { width: 16px; height: 16px; }

.btn__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.btn.is-busy .btn__spinner { display: block; }
.btn.is-busy .btn__label { opacity: 0.75; }

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

.key-form .btn--primary { margin-top: 26px; min-width: 186px; }

.btn--ghost {
  height: 40px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 550;
  color: #d5dcf7;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(150, 170, 255, 0.16);
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(158, 180, 255, 0.3); }
.btn--ghost:disabled { opacity: 0.45; cursor: default; }
.btn--quiet { color: var(--muted); background: transparent; }
.btn--quiet:hover { color: #ffb3bf; border-color: rgba(255, 111, 134, 0.35); background: rgba(255, 111, 134, 0.07); }
.btn--sm { height: 38px; padding: 0 13px; font-size: 12.5px; }

.form-status {
  margin: 12px 0 0;
  min-height: 20px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s;
}

.form-status.is-error { color: #ff9aa9; }
.form-status.is-ok { color: var(--green); }

/* ============ auth foot ============ */
.auth-panel__foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(22px, 2.6vw, 32px);
  padding-top: 18px;
  border-top: 1px solid rgba(150, 170, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  color: var(--dim);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.994); }
  to { opacity: 1; transform: none; }
}

/* ============ session ============ */
.session {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(30, 37, 72, 0.55), rgba(9, 12, 26, 0.72));
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  animation: panel-in 0.55s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}

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

.session__dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px 2px rgba(89, 227, 173, 0.55);
  flex: none;
}

.session__text { min-width: 0; }

.session__label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.session__label strong { color: #cdd7ff; font-weight: 600; }

.session__key {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #b9c6f2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.session__sync {
  margin: 0 6px 0 0;
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ============ dashboard ============ */
.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 26px 60px -42px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(170, 190, 255, 0.3), transparent);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(158, 180, 255, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 32px 70px -42px rgba(0, 0, 0, 1);
}

.reveal { animation: card-in 0.6s cubic-bezier(0.16, 0.84, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 65ms); }

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

.card__label {
  margin: 0;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #8d99c1;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #e6ecff;
}

.card__sub {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid rgba(150, 170, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b6c2e8;
}

.pill--live {
  color: #8ff0c8;
  border-color: rgba(89, 227, 173, 0.28);
  background: rgba(89, 227, 173, 0.09);
}

.pill--ghost { color: var(--dim); border-color: rgba(150, 170, 255, 0.12); background: transparent; }

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px 1px rgba(89, 227, 173, 0.7);
  animation: pulse 2s ease-out infinite;
}

/* stat */
.stat { grid-column: span 3; display: flex; flex-direction: column; min-height: 138px; }

.stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.stat__value {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #f2f6ff;
  line-height: 1.15;
}

.stat__total { font-size: 12px; font-weight: 500; color: var(--dim); letter-spacing: 0; }

.stat__foot {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--dim);
}

.delta {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: -0.01em;
}

.delta--up { color: #79ecc0; background: rgba(89, 227, 173, 0.1); }
.delta--down { color: #79ecc0; background: rgba(89, 227, 173, 0.1); }
.delta--neutral { color: var(--muted); background: rgba(255, 255, 255, 0.05); }

.meter {
  height: 5px;
  margin-top: 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c6bff, #a99cff);
  transition: width 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.meter--cyan i { background: linear-gradient(90deg, #2f8cff, #52d6ff); }
.meter--pink i { background: linear-gradient(90deg, #e557b4, #ff9f6e); }
.meter--green i { background: linear-gradient(90deg, #2fce96, #8ef0c8); }
.meter--thin { height: 3px; margin-top: 0; }

/* chart */
.card--chart { grid-column: span 8; padding-bottom: 10px; display: flex; flex-direction: column; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(150, 170, 255, 0.1);
  flex: none;
}

.seg__btn {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 5px 10px;
  font: inherit;
  font-size: 11.5px;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.seg__btn:hover { color: #cfd8f8; }
.seg__btn.is-active { color: #eef2ff; background: rgba(255, 255, 255, 0.08); }

.chart {
  position: relative;
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 180px;
  padding-bottom: 20px;
}

.chart__svg { width: 100%; height: 100%; display: block; overflow: visible; }

.spend-line {
  fill: none;
  stroke: url(#spendStroke);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.spend-area { fill: url(#spendFill); }

.grid-line { stroke: rgba(150, 170, 255, 0.08); stroke-width: 1; vector-effect: non-scaling-stroke; }

.spend-cursor {
  fill: #0a0d1c;
  stroke: #b3a6ff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 1;
  transition: opacity 0.15s;
}

.chart__x {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.chart__tip {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -112%);
  display: grid;
  gap: 1px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(9, 12, 24, 0.94);
  border: 1px solid rgba(158, 180, 255, 0.25);
  box-shadow: 0 12px 30px -16px #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 2;
}

.chart__tip.is-visible { opacity: 1; }
.chart__tip-date { font-size: 10px; color: var(--dim); }
.chart__tip-value { font-family: var(--mono); font-size: 12px; color: #f0f4ff; }

/* limits */
.limits { grid-column: span 4; }
.limits__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 13px; }

.limit__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #c3cdec;
}

.limit__val { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.limit .meter { margin-top: 7px; height: 4px; }

.limits__foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(150, 170, 255, 0.1);
  display: grid;
  gap: 6px;
}

.limits__foot p {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--dim);
}

.limits__foot .mono { color: #c2ccec; font-size: 11px; }

/* routes (модели) */
.routes { grid-column: span 5; display: flex; flex-direction: column; }

.routes__list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 7px;
  border-radius: 9px;
  transition: background 0.2s;
}

.route:hover { background: rgba(255, 255, 255, 0.035); }

.route__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b557a;
  flex: none;
}

.route__dot--ok { background: var(--green); box-shadow: 0 0 8px rgba(89, 227, 173, 0.7); }
.route__dot--slow { background: #ffc46b; box-shadow: 0 0 8px rgba(255, 196, 107, 0.55); }

.route__name {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #dbe3fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route__provider {
  font-size: 10.5px;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
}

.route__latency {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #aab6dd;
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.routes__more {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(150, 170, 255, 0.09);
  font-size: 11px;
  color: var(--dim);
}

/* activity (поток запросов) */
.activity { grid-column: span 7; display: flex; flex-direction: column; }

.activity__list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.request {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(150, 170, 255, 0.06);
}

.request.is-new { animation: req-in 0.45s cubic-bezier(0.16, 0.84, 0.3, 1) both; }

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

.request__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px rgba(82, 214, 255, 0.65);
  flex: none;
}

.request__main { min-width: 0; }

.request__model {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #e2e9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request__meta {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request__right { text-align: right; }

.request__cost {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #e8eeff;
}

.request__lat {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
/* soon */
.soon--strip { grid-column: span 12; }

.soon--strip .soon__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.soon__list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 7px; }

.soon__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.022);
  transition: background 0.2s, border-color 0.2s;
}

.soon__item:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(150, 170, 255, 0.12); }

.soon__icon {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.soon__icon::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.85;
}

.soon__icon--violet { color: #a294ff; background: rgba(139, 123, 255, 0.14); }
.soon__icon--cyan { color: #7bdcff; background: rgba(82, 214, 255, 0.12); }
.soon__icon--pink { color: #ff9ad4; background: rgba(255, 119, 200, 0.12); }
.soon__icon--green { color: #7defbf; background: rgba(89, 227, 173, 0.12); }

.soon__title { margin: 0; font-size: 12.5px; color: #dbe3fb; }
.soon__sub { margin: 1px 0 0; font-size: 11px; color: var(--dim); }

/* ============ footer ============ */
.footer {
  width: min(1180px, 100% - 40px);
  margin: 34px auto 0;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(150, 170, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--dim);
}

.footer p { margin: 0; }

.footer__right { display: inline-flex; align-items: center; gap: 8px; }

.footer__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(89, 227, 173, 0.8);
}

.footer__sep { opacity: 0.4; }

/* ============ responsive ============ */
@media (max-width: 1120px) {
  .stat { grid-column: span 6; }
  .card--chart { grid-column: span 12; }
  .limits { grid-column: span 6; }
  .routes { grid-column: span 6; }
  .activity { grid-column: span 12; }
  .soon--strip .soon__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .limits, .routes { grid-column: span 12; }
  .nav { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding-top: 16px; }
  .topbar__inner, .stage__inner, .footer { width: calc(100% - 28px); }
  .stage { padding: 20px 0 32px; }
  .auth-panel { border-radius: 20px; }
  .key-form { grid-template-columns: 1fr; }
  .key-form .btn--primary { margin-top: 2px; width: 100%; }
  .auth-panel__foot { gap: 10px; }
  .session { gap: 12px; }
  .session__actions { width: 100%; justify-content: flex-end; }
  .session__sync { width: 100%; margin: 0 0 2px; }
  .topbar__status { display: none; }
  .stat { grid-column: span 12; min-height: 0; }
  .stat__value { font-size: 23px; }
  .card { padding: 16px 15px 14px; }
  .chart { height: 176px; }
  .soon--strip .soon__list { grid-template-columns: 1fr; }
  .topbar__epoch { display: none; }
  .footer { margin-top: 24px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .pulse-dot, .live-dot { animation: none; }
  .card:hover { transform: none; }
}
