/* ============================================================================
   Royalses — Liquid Glass design system
   Dark, translucent, iOS-native feel. Mobile-first.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  /* base */
  --abyss:        #04050a;
  --abyss-2:      #070912;

  /* ambient aurora (lives behind the glass, exists to be refracted) */
  --aurora-indigo: #5b6cff;
  --aurora-teal:   #00c7b7;
  --aurora-violet: #8e5bff;

  /* system accents */
  --blue:   #0a84ff;
  --green:  #30d158;
  --amber:  #ffd60a;
  --red:    #ff453a;
  --pink:   #ff375f;

  /* ink */
  --ink:        #f4f7ff;
  --ink-2:      rgba(233, 239, 255, 0.64);
  --ink-3:      rgba(233, 239, 255, 0.40);
  --ink-4:      rgba(233, 239, 255, 0.24);

  /* glass material */
  --glass-tint:      rgba(255, 255, 255, 0.055);
  --glass-tint-2:    rgba(255, 255, 255, 0.085);
  --glass-rim:       rgba(255, 255, 255, 0.14);
  --glass-rim-soft:  rgba(255, 255, 255, 0.07);
  --glass-specular:  rgba(255, 255, 255, 0.42);
  --glass-blur:      blur(32px) saturate(180%);
  --glass-blur-lite: blur(18px) saturate(160%);

  /* elevation */
  --shadow-1: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 24px 56px -18px rgba(0, 0, 0, 0.78);
  --shadow-3: 0 40px 90px -24px rgba(0, 0, 0, 0.85);

  /* geometry — continuous, iOS-ish */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* type */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
             "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
               "Cascadia Code", Menlo, Consolas, monospace;

  /* layout */
  --dock-h: 68px;
  --rail-w: 232px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ease-glass: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); font-variant-ligatures: none; }
::selection { background: rgba(10, 132, 255, 0.38); }

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

.hidden { display: none !important; }

/* thin scrollbars that match the material */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); background-clip: content-box; }

/* ============================================================================
   AMBIENT — the light source the glass refracts
   ========================================================================== */
.ambient {
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(46vmax 40vmax at 12% 8%,  rgba(91, 108, 255, 0.30), transparent 62%),
    radial-gradient(40vmax 38vmax at 88% 18%, rgba(0, 199, 183, 0.22),  transparent 60%),
    radial-gradient(52vmax 46vmax at 72% 92%, rgba(142, 91, 255, 0.26), transparent 64%),
    radial-gradient(36vmax 34vmax at 20% 88%, rgba(10, 132, 255, 0.18), transparent 60%);
  filter: blur(20px);
  animation: drift 48s var(--ease-glass) infinite alternate;
}
.ambient::after {
  /* film grain so the gradients never band */
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -3%, 0) scale(1.02); }
}

/* vignette keeps text legible over the brightest blobs */
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 30%, rgba(4, 5, 10, 0.72) 100%);
}

/* ============================================================================
   GLASS PRIMITIVE
   ========================================================================== */
.glass {
  position: relative;
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 1px 0 0 var(--glass-specular),          /* specular top edge */
    inset 0 0 0 0.5px var(--glass-rim),             /* hairline rim */
    inset 0 -20px 40px -30px rgba(255,255,255,.16), /* bottom bounce light */
    var(--shadow-2);
  isolation: isolate;
}

/* the signature: a specular lens that tracks pointer / touch across the panel */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms var(--ease-glass);
  background: radial-gradient(
    16rem 16rem at var(--lx, 50%) var(--ly, 0%),
    rgba(255, 255, 255, 0.13),
    rgba(255, 255, 255, 0.04) 42%,
    transparent 68%
  );
  z-index: 0;
}
.glass.is-lit::before { opacity: 1; }
.glass > * { position: relative; z-index: 1; }

.glass-lite {
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur-lite);
  backdrop-filter: var(--glass-blur-lite);
  box-shadow:
    inset 0 1px 0 0 rgba(255,255,255,.22),
    inset 0 0 0 0.5px var(--glass-rim-soft),
    var(--shadow-1);
  border-radius: var(--r-md);
}

/* ============================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.022em; }
h1 { font-size: 27px; line-height: 1.2; }
h2 { font-size: 21px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
p  { margin: 0 0 12px; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 590;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted   { color: var(--ink-2); }
.muted-2 { color: var(--ink-3); }
.tnum    { font-variant-numeric: tabular-nums; }

/* ============================================================================
   LOGIN
   ========================================================================== */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-b));
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 34px 30px 30px;
  border-radius: var(--r-xl);
  animation: rise 700ms var(--ease-glass) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.login-mark {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(150deg, rgba(91,108,255,.9), rgba(0,199,183,.75));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 10px 24px -8px rgba(91,108,255,.7);
}
.login-mark svg { width: 24px; height: 24px; }

/* ============================================================================
   SHELL — rail (desktop) + dock (mobile)
   ========================================================================== */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* плотнее обычного стекла: под панелью проезжает контент, и он не должен спорить с подписями */
  background: linear-gradient(to bottom, rgba(4,5,10,.94), rgba(4,5,10,.66) 72%, rgba(4,5,10,0));
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 640; font-size: 17px; letter-spacing: -0.02em;
}
.brand-dot {
  width: 26px; height: 26px; border-radius: 9px;
  background: linear-gradient(150deg, rgba(91,108,255,.95), rgba(0,199,183,.8));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 16px -6px rgba(91,108,255,.8);
  display: grid; place-items: center; flex: none;
}
.brand-dot svg { width: 15px; height: 15px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 13px; color: var(--ink-2);
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur-lite);
  backdrop-filter: var(--glass-blur-lite);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 .5px var(--glass-rim-soft);
  transition: background 200ms var(--ease-glass), transform 200ms var(--ease-glass);
  max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { background: var(--glass-tint-2); }
.chip:active { transform: scale(.96); }
.chip svg { width: 15px; height: 15px; flex: none; }

/* --- desktop rail --- */
.rail { display: none; }

/* --- mobile dock --- */
.dock {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + var(--safe-b));
  z-index: 50;
  height: var(--dock-h);
  display: flex;
  align-items: stretch;
  padding: 6px;
  border-radius: var(--r-xl);
  transition: transform 380ms var(--ease-glass), opacity 240ms var(--ease-glass);
  /* Док стоит поверх прокручиваемого контента. На чистом стекле сквозь него
     читался текст страницы и сталкивался с подписями вкладок — поэтому здесь
     материал плотнее: сильнее блюр и собственная тёмная подложка. */
  background: rgba(9, 11, 19, 0.66);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  backdrop-filter: blur(40px) saturate(200%);
}
.dock.is-tucked { transform: translateY(calc(100% + 20px)); opacity: 0; }

.dock-btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 530;
  letter-spacing: -0.005em;
  position: relative;
  transition: color 240ms var(--ease-glass), transform 240ms var(--ease-glass);
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
}
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dock-btn:active { transform: scale(.92); }
.dock-btn.active { color: var(--ink); }

/* the sliding glass pill behind the active tab */
.dock-pill {
  position: absolute;
  top: 6px; bottom: 6px; left: 0;
  opacity: 0;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), inset 0 0 0 .5px rgba(255,255,255,.1);
  transition: transform 460ms var(--ease-glass), width 460ms var(--ease-glass);
  pointer-events: none;
  z-index: 0;
}
.dock-btn { z-index: 1; }

/* ============================================================================
   CONTENT
   ========================================================================== */
.content {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px calc(var(--dock-h) + 34px + var(--safe-b));
}

.view { animation: viewIn 480ms var(--ease-glass) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 2px 16px;
}
.view-head h1 { flex: 1 1 auto; min-width: 0; }
.view-head .sub { width: 100%; margin-top: 2px; color: var(--ink-3); font-size: 13.5px; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 2px 12px;
}
.section-title h2 { font-size: 18px; }

/* ============================================================================
   STATS
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  padding: 15px 16px 16px;
  border-radius: var(--r-md);
  min-width: 0;
}
.stat-label {
  font-size: 11px; font-weight: 560; letter-spacing: 0.075em;
  text-transform: uppercase; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  margin-top: 7px;
  font-size: 30px; font-weight: 620; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.stat-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.stat-dot.blue  { background: var(--blue);  box-shadow: 0 0 10px var(--blue); }
.stat-dot.green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.stat-dot.amber { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.stat-dot.violet{ background: var(--aurora-violet); box-shadow: 0 0 10px var(--aurora-violet); }
.stat-dot.teal  { background: var(--aurora-teal); box-shadow: 0 0 10px var(--aurora-teal); }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 560;
  letter-spacing: -0.012em;
  white-space: nowrap;
  transition: transform 180ms var(--ease-glass), background 200ms var(--ease-glass),
              box-shadow 200ms var(--ease-glass), opacity 200ms var(--ease-glass);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: scale(.955); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
  background: linear-gradient(180deg, rgba(10,132,255,1), rgba(6,102,214,1));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 0 0 .5px rgba(255,255,255,.16),
    0 10px 26px -10px rgba(10,132,255,.9);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-glass {
  background: var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur-lite);
  backdrop-filter: var(--glass-blur-lite);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), inset 0 0 0 .5px var(--glass-rim);
}
.btn-glass:hover { background: var(--glass-tint-2); }

.btn-ghost { color: var(--ink-2); height: 34px; padding: 0 11px; font-size: 13px; }
.btn-ghost:hover { color: var(--ink); background: rgba(255,255,255,.08); }

.btn-danger { color: #ffb4ae; height: 34px; padding: 0 11px; font-size: 13px; }
.btn-danger:hover { color: #fff; background: rgba(255,69,58,.22); }

.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background 200ms var(--ease-glass), color 200ms var(--ease-glass), transform 180ms var(--ease-glass);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255,255,255,.09); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }

/* ============================================================================
   FORM CONTROLS
   ========================================================================== */
.field { margin-bottom: 14px; min-width: 0; }
.field > label,
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-3);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 0;
  background: rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.13), inset 0 1px 0 rgba(255,255,255,.08);
  color: var(--ink);
  font-size: 15px; /* 16px-ish keeps iOS from zooming on focus */
  transition: box-shadow 200ms var(--ease-glass), background 200ms var(--ease-glass);
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
}
.field textarea { height: auto; padding: 10px 13px; min-height: 90px; resize: vertical; }

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(10,132,255,.85), 0 0 0 4px rgba(10,132,255,.16);
}
.input::placeholder, .field input::placeholder { color: var(--ink-4); }
.field input[readonly] { color: var(--ink-2); }

select.input, .field select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a8b0c8' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
}
option { background: #10131f; color: var(--ink); }

/* iOS-style switch */
/* .field > label задаёт display:block и мелкий кегль — перебиваем его тем же весом,
   иначе дорожка переключателя становится строчной и теряет размеры */
.switch,
.field > label.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 0;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  display: inline-block;
  width: 50px; height: 30px; border-radius: 999px; flex: none;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.14);
  transition: background 260ms var(--ease-glass);
  position: relative;
}
.switch-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
  transition: transform 300ms var(--ease-glass);
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* segmented control (iOS) */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
  position: relative;
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-3);
  transition: color 220ms var(--ease-glass);
}
.segmented button.active { color: var(--ink); }
.segmented .seg-pill {
  position: absolute;
  top: 3px; bottom: 3px; left: 0;
  opacity: 0;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 10px -4px rgba(0,0,0,.6);
  transition: transform 420ms var(--ease-glass), width 420ms var(--ease-glass);
  z-index: 0;
}

/* ============================================================================
   BADGES
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 570;
  letter-spacing: 0.005em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
}
.badge-green  { background: rgba(48,209,88,.17);  color: #7ff0a0; }
.badge-red    { background: rgba(255,69,58,.17);  color: #ff9d95; }
.badge-amber  { background: rgba(255,214,10,.15); color: #ffe066; }
.badge-blue   { background: rgba(10,132,255,.18); color: #8ec5ff; }
.badge-slate  { background: rgba(255,255,255,.08);color: var(--ink-2); }

.badge-method { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 4px 9px; }

/* ============================================================================
   TABLES → cards on mobile
   ========================================================================== */
.table-wrap { border-radius: var(--r-lg); overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 570;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 -0.5px 0 rgba(255,255,255,.1);
}
tbody td {
  padding: 12px 14px;
  box-shadow: inset 0 -0.5px 0 rgba(255,255,255,.06);
  vertical-align: middle;
}
tbody tr:last-child td { box-shadow: none; }
tbody tr { transition: background 200ms var(--ease-glass); }
tbody tr:hover { background: rgba(255,255,255,.045); }
td.num, th.num { font-variant-numeric: tabular-nums; }
/* строка лида кликабельна — показываем это явно */
tbody tr[data-lead] { cursor: pointer; }
tbody tr[data-lead]:hover { background: rgba(10,132,255,.09); }

td.go { width: 1%; white-space: nowrap; color: var(--ink-4); transition: color 200ms var(--ease-glass); }
td.go svg { width: 18px; height: 18px; display: block; margin-left: auto; }
td.go .go-label { display: none; }
tbody tr[data-lead]:hover td.go { color: var(--blue); }
td.actions { text-align: right; white-space: nowrap; }
td.dim { color: var(--ink-3); }
td .cell-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
td .cell-stack { min-width: 0; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}
.empty-mark {
  width: 46px; height: 46px; margin: 0 auto 12px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 .5px rgba(255,255,255,.08);
  color: var(--ink-3);
}
.empty-mark svg { width: 22px; height: 22px; }
.empty strong { display: block; color: var(--ink); font-weight: 560; margin-bottom: 4px; font-size: 15px; }

/* mobile: every row becomes its own glass card.
   Правила намеренно привязаны к .table-wrap — это таблицы-данные. Справочные
   таблицы (.doc-table в настройках и в инструкции) должны остаться таблицами
   и скроллиться горизонтально, иначе у них пропадают заголовки колонок. */
@media (max-width: 860px) {
  .table-wrap { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .table-wrap::before { display: none; }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    margin-bottom: 10px;
    padding: 6px 4px;
    border-radius: var(--r-md);
    background: var(--glass-tint);
    -webkit-backdrop-filter: var(--glass-blur-lite);
    backdrop-filter: var(--glass-blur-lite);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 .5px var(--glass-rim-soft), var(--shadow-1);
  }
  .table-wrap tbody tr:hover { background: var(--glass-tint); }
  .table-wrap tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 13px;
    box-shadow: none;
    text-align: right;
    min-height: 38px;
  }
  .table-wrap tbody td::before {
    content: attr(data-label);
    flex: none;
    font-size: 11px;
    font-weight: 560;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: left;
  }
  .table-wrap tbody td:empty { display: none; }
  .table-wrap td.actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 6px;
    padding-bottom: 10px;
    box-shadow: inset 0 .5px 0 rgba(255,255,255,.07);
    margin-top: 4px;
  }
  /* на мобиле карточка лида получает явную кнопку внизу вместо еле заметной стрелки */
  .table-wrap td.go {
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    padding: 11px 13px;
    color: #8ec5ff;
    font-size: 13.5px;
    font-weight: 550;
    box-shadow: inset 0 .5px 0 rgba(255,255,255,.07);
  }
  .table-wrap td.go::before { display: none; }
  .table-wrap td.go .go-label { display: inline; }
  .table-wrap td.go svg { width: 16px; height: 16px; margin-left: 0; }

  .table-wrap td.actions::before { margin-right: auto; }
  .table-wrap td .cell-sub { text-align: right; }
  .table-wrap td .cell-stack { text-align: right; }
}

/* ============================================================================
   FILTER BAR
   ========================================================================== */
.filters {
  padding: 14px;
  border-radius: var(--r-lg);
  margin-bottom: 14px;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.filters-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.filters-actions .btn { flex: 1 1 auto; }
.filters .field { margin-bottom: 0; }

.collapse-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 0 0 12px;
  font-size: 14px; font-weight: 560;
}
.collapse-head .chev { margin-left: auto; transition: transform 320ms var(--ease-glass); color: var(--ink-3); }
.collapse-head .chev svg { width: 18px; height: 18px; display: block; }
.collapse-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.collapse-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 380ms var(--ease-glass); }
.collapse-body[hidden] { display: grid; grid-template-rows: 0fr; }
.collapse-body > div { overflow: hidden; min-height: 0; }

/* ============================================================================
   MODAL / SHEET
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(2, 3, 8, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade 260ms var(--ease-glass);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px calc(22px + var(--safe-b));
  animation: sheetUp 460ms var(--ease-glass);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

.sheet-grabber {
  width: 38px; height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
  margin: 6px auto 12px;
  flex: none;
}
.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  flex: none;
}
.sheet-head h3 { flex: 1; min-width: 0; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
/* Кнопки живут внутри прокручиваемого тела листа, поэтому липнут к его низу —
   иначе на длинной форме «Сохранить» уезжает за край экрана. */
.sheet-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  position: sticky;
  bottom: -1px;
  z-index: 2;
  margin-top: 4px;
  padding: 14px 0 6px;
  background: linear-gradient(to top, rgba(9, 11, 19, 0.96) 55%, rgba(9, 11, 19, 0));
}
.sheet-actions .btn { flex: 1 1 auto; }

/* ============================================================================
   TOAST
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 26px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 100;
  display: flex; align-items: center; gap: 9px;
  max-width: min(92vw, 440px);
  padding: 11px 17px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 420ms var(--ease-glass);
}
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok    { color: var(--ink); }
.toast.ok svg { color: var(--green); }
.toast.error { color: #ffc4bf; }
.toast.error svg { color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px) scale(.94); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ============================================================================
   KEY PILL (copyable secrets)
   ========================================================================== */
.key-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 200ms var(--ease-glass), color 200ms var(--ease-glass), transform 160ms var(--ease-glass);
  max-width: 100%;
}
.key-pill:hover { background: rgba(10,132,255,.18); color: #a9d1ff; }
.key-pill:active { transform: scale(.96); }
.key-pill svg { width: 13px; height: 13px; flex: none; opacity: .7; }
.key-pill .k { overflow: hidden; text-overflow: ellipsis; }

/* ============================================================================
   DOCS
   ========================================================================== */
.docs-layout { display: block; }

.docs-toolbar {
  position: sticky;
  top: calc(52px + var(--safe-t));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: var(--r-lg);
  margin-bottom: 14px;
}
.docs-toolbar .spacer { flex: 1 1 auto; }

/* table of contents */
.toc { display: none; }
.toc-mobile {
  margin-bottom: 14px;
  padding: 4px;
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.toc-mobile::-webkit-scrollbar { display: none; }
.toc-mobile-inner { display: flex; gap: 4px; }
.toc-link {
  display: block;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 520;
  color: var(--ink-3);
  white-space: nowrap;
  transition: background 200ms var(--ease-glass), color 200ms var(--ease-glass);
}
.toc-link:hover { color: var(--ink); background: rgba(255,255,255,.07); text-decoration: none; }
.toc-link.active { color: var(--ink); background: rgba(255,255,255,.11); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); }

.doc-section {
  padding: 20px 18px;
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  scroll-margin-top: 120px;
}
.doc-section > h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px;
  margin-bottom: 4px;
}
.doc-section > .lede { color: var(--ink-3); font-size: 13.5px; margin-bottom: 16px; }
.doc-section h3 { margin: 22px 0 8px; font-size: 15.5px; }
.doc-section h3:first-of-type { margin-top: 16px; }
.doc-section p { font-size: 14.5px; }
.doc-section ul, .doc-section ol { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.doc-section li { margin-bottom: 5px; }
.doc-section code { font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.09); color: #d8e2ff; }

.sec-num {
  display: grid; place-items: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 9px;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 .5px rgba(255,255,255,.1);
}

/* endpoint header */
.endpoint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
  margin-bottom: 14px;
}
.endpoint .path { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); word-break: break-all; }

/* code blocks */
.code {
  position: relative;
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.42);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
  margin-bottom: 12px;
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 13px;
  box-shadow: inset 0 -0.5px 0 rgba(255,255,255,.08);
}
.code-lang {
  font-size: 10.5px; font-weight: 570; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.code-copy {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 540;
  color: var(--ink-3);
  transition: background 200ms var(--ease-glass), color 200ms var(--ease-glass);
}
.code-copy svg { width: 13px; height: 13px; }
.code-copy:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.code pre {
  margin: 0;
  padding: 13px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 12.5px;
  line-height: 1.62;
  color: #cfe0ff;
  tab-size: 2;
}
.code pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

/* param tables inside docs */
.doc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1); }
.doc-table { font-size: 13px; min-width: 460px; }
.doc-table th { background: rgba(255,255,255,.05); padding: 9px 12px; }
.doc-table td { padding: 9px 12px; vertical-align: top; box-shadow: inset 0 -0.5px 0 rgba(255,255,255,.06); }
.doc-table td:first-child { white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: #d8e2ff; }
.doc-table .req { color: #ff9d95; font-size: 11px; font-weight: 570; }
.doc-table .opt { color: var(--ink-3); font-size: 11px; font-weight: 570; }

/* callouts */
.note {
  display: flex; gap: 11px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 13px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
}
.note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.note.info  { background: rgba(10,132,255,.11); color: #c3ddff; }
.note.info svg { color: var(--blue); }
.note.warn  { background: rgba(255,214,10,.10); color: #f5e5a8; }
.note.warn svg { color: var(--amber); }
.note.danger{ background: rgba(255,69,58,.11); color: #ffc9c4; }
.note.danger svg { color: var(--red); }
.note code { background: rgba(0,0,0,.3); }

/* numbered steps — used only where order genuinely matters */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 8px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12.5px; font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, rgba(10,132,255,1), rgba(6,102,214,1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px -6px rgba(10,132,255,.8);
}
.steps li strong { color: var(--ink); font-weight: 570; display: block; margin-bottom: 3px; }
.steps li:last-child { margin-bottom: 4px; }

/* the flow diagram — how a lead actually travels */
.flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.flow-node {
  flex: 1 1 0;
  min-width: 108px;
  padding: 11px 12px;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 .5px rgba(255,255,255,.09);
  text-align: center;
}
.flow-node .t { font-size: 12.5px; font-weight: 570; color: var(--ink); }
.flow-node .s { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }
.flow-node.self { background: rgba(10,132,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 .5px rgba(10,132,255,.4); }
.flow-arrow {
  flex: none;
  display: grid; place-items: center;
  color: var(--ink-4);
  width: 18px;
}
.flow-arrow svg { width: 16px; height: 16px; }

/* строка маршрута в настройках: на узком экране всё в столбик, на широком — в одну линию */
/* .legend-row объявлен ниже и тоже задаёт display — берём специфичность двумя классами */
.legend-row.route-row {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.route-row .rname { min-width: 0; font-weight: 560; }
.route-row .rcodes {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  word-break: break-all;
}
.route-row .racts { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; }
@media (min-width: 900px) {
  .legend-row.route-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .route-row .rcodes { grid-column: 1; grid-row: 2; }
  .route-row .rbadge { grid-column: 2; grid-row: 1 / span 2; }
  .route-row .racts { grid-column: 3; grid-row: 1 / span 2; flex-wrap: nowrap; }
}

/* status legend */
.legend { display: grid; gap: 8px; margin-bottom: 6px; }
.legend-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-xs);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.08);
}
.legend-row .badge { flex: none; margin-top: 1px; }
.legend-row .txt { font-size: 13.5px; color: var(--ink-2); }

/* download cards */
.dl-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
.dl-card {
  display: flex; align-items: center; gap: 13px;
  padding: 14px;
  border-radius: var(--r-md);
  text-align: left;
  width: 100%;
  transition: background 220ms var(--ease-glass), transform 200ms var(--ease-glass);
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 .5px rgba(255,255,255,.1);
}
.dl-card:hover { background: rgba(255,255,255,.09); }
.dl-card:active { transform: scale(.985); }
.dl-icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(91,108,255,.85), rgba(0,199,183,.7));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
  color: #fff;
}
.dl-icon svg { width: 19px; height: 19px; }
.dl-card .t { font-size: 14.5px; font-weight: 560; }
.dl-card .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dl-card .go { margin-left: auto; color: var(--ink-4); flex: none; }
.dl-card .go svg { width: 18px; height: 18px; display: block; }

/* ============================================================================
   RESPONSIVE — tablet
   ========================================================================== */
@media (min-width: 600px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-actions .btn { flex: 0 0 auto; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet {
    border-radius: var(--r-xl);
    margin-bottom: 0;
    animation: sheetPop 420ms var(--ease-glass);
  }
  .modal { align-items: center; padding: 24px; }
  .sheet-grabber { display: none; }
  .sheet { padding: 22px 24px 24px; }
  .sheet-actions .btn { flex: 0 0 auto; }
  @keyframes sheetPop {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
  }
}

/* ============================================================================
   RESPONSIVE — desktop: dock becomes a floating rail
   ========================================================================== */
@media (min-width: 1024px) {
  .shell { padding-left: var(--rail-w); }

  .dock { display: none; }

  .rail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: 16px; bottom: 16px; left: 16px;
    width: calc(var(--rail-w) - 32px);
    z-index: 50;
    padding: 14px 10px;
    border-radius: var(--r-xl);
  }
  .rail-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 16px;
    font-weight: 640; font-size: 16.5px; letter-spacing: -0.02em;
  }
  .rail-btn {
    display: flex; align-items: center; gap: 11px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--ink-3);
    font-size: 14px;
    font-weight: 530;
    text-align: left;
    transition: color 220ms var(--ease-glass), background 220ms var(--ease-glass);
    position: relative;
    z-index: 1;
  }
  .rail-btn svg { width: 19px; height: 19px; flex: none; }
  .rail-btn:hover { color: var(--ink); background: rgba(255,255,255,.055); }
  .rail-btn.active { color: var(--ink); }
  .rail-pill {
    position: absolute;
    left: 10px; right: 10px; top: 0;
    opacity: 0;
    height: 42px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,.11);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.32), inset 0 0 0 .5px rgba(255,255,255,.1);
    transition: transform 460ms var(--ease-glass);
    z-index: 0;
    pointer-events: none;
  }
  .rail-foot { margin-top: auto; padding: 8px 4px 0; }
  .rail-foot .who { font-size: 12px; color: var(--ink-3); padding: 0 8px 8px; overflow: hidden; text-overflow: ellipsis; }

  .topbar { display: none; }
  .content { padding: 22px 26px 40px; max-width: 1240px; }
  .toast { bottom: 28px; left: auto; right: 28px; transform: none; animation: toastInDesk 420ms var(--ease-glass); }
  @keyframes toastInDesk {
    from { opacity: 0; transform: translateY(14px) scale(.95); }
    to   { opacity: 1; transform: none; }
  }

  .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .view-head { margin-top: 4px; }

  /* docs get a sticky sidebar TOC */
  .docs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
  .toc {
    display: block;
    position: sticky;
    top: 22px;
    padding: 12px 8px;
    border-radius: var(--r-lg);
  }
  .toc-mobile { display: none; }
  .toc-title { padding: 4px 10px 8px; }
  .docs-toolbar { top: 22px; }
  .doc-section { padding: 24px 24px; scroll-margin-top: 90px; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .dl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================================
   MOTION / ACCESSIBILITY
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .ambient { animation: none; }
  .glass::before { display: none; }
}

/* if the browser can't blur, fall back to solid panels so nothing turns to mush */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-lite, .chip, .btn-glass, .input { background: rgba(18, 21, 34, 0.92); }
  .ambient { opacity: .5; }
}

/* print — the docs should survive Cmd+P */
@media print {
  .ambient, .vignette, .dock, .rail, .topbar, .docs-toolbar, .toc, .toc-mobile, .code-copy { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .doc-section { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .code { background: #f4f4f6; }
  .code pre { color: #111; }
  .doc-section { break-inside: avoid; }
}
