/* Jester.Guru — dashboard shell.
   Neutral dark surfaces, one accent, hairline borders. Restraint over motif:
   the logo carries the identity so the chrome doesn't have to. */

:root {
  /* Neutral ramp — no hue tint, so the accent and status colours stay honest. */
  --bg: #0a0a0c;
  --bg-soft: #0e0e11;
  --surface: #121215;
  --surface-2: #17171b;
  --surface-3: #1e1e23;
  --border: #26262c;
  --border-soft: #1c1c21;

  /* Two accents, because one cannot do both jobs: --accent is light enough to
     read as text/icons on dark surfaces (5.4:1), --accent-solid is dark enough
     for white text on top of it (6.4:1). Using one for both is what made the
     "Redeem a key" button illegible. */
  --accent: #8f74ff;
  --accent-hover: #a892ff;
  --accent-solid: #6035f0;
  --accent-solid-hover: #6d4aff;
  --accent-dim: rgba(124, 92, 255, .14);
  --accent-line: rgba(124, 92, 255, .32);

  --text: #ededf0;
  --text-2: #b4b4bd;
  --muted: #8a8a95;
  --faint: #62626d;

  --ok: #3ecf8e;
  --warn: #f0b429;
  --danger: #f2555a;
  --info: #4aa8ff;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* One easing everywhere so motion feels like a single system. */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --fast: 130ms var(--ease);
  --med: 220ms var(--ease);

  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
  --ring: 0 0 0 3px rgba(124, 92, 255, .25);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.006em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.25;
  letter-spacing: -.021em;
  font-weight: 600;
}
h1 { font-size: 1.55rem; letter-spacing: -.028em; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 1em; }
small, .tiny { font-size: .78rem; }

code, kbd, pre { font-family: var(--mono); }
code {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: .1em .38em;
  font-size: .86em;
  color: var(--text-2);
}
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.65;
  margin: 0 0 1em;
}
pre code { background: none; border: 0; padding: 0; color: var(--text-2); }

hr, .divider { border: 0; border-top: 1px solid var(--border-soft); margin: 20px 0; height: 0; }

::selection { background: var(--accent-dim); }

/* ------------------------------------------------------------------ layout */
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.wrap-narrow { width: min(680px, 100% - 40px); margin-inline: auto; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
/* Six feature cards want 3x2, not 4+2. */
@media (min-width: 1000px) { #features .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* The old circus ribbon is gone; a hairline keeps the header seated. */
.ribbon { height: 1px; background: var(--border-soft); }

/* -------------------------------------------------------------- masthead */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 12, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.masthead-inner { display: flex; align-items: center; gap: 18px; height: 56px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px;
  display: block;
  flex: none;
  object-fit: contain;
}
.brand em { font-style: normal; color: var(--muted); font-weight: 400; }

.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav a:not(.btn) {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  transition: color .12s, background .12s;
}
.nav a:not(.btn):hover { background: var(--surface-2); color: var(--text); }
.nav a:not(.btn).active { color: var(--text); background: var(--surface-2); }

/* ---------------------------------------------------------------- sidebar */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; padding: 26px 0 72px; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; gap: 16px; } }

.side { position: sticky; top: 78px; align-self: start; }
@media (max-width: 900px) { .side { position: static; } }

.side-group + .side-group { margin-top: 18px; }
.side-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--faint);
  font-weight: 600;
  padding: 0 9px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .86rem;
  font-weight: 450;
  transition: background .12s, color .12s;
}
.side-link + .side-link { margin-top: 1px; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--surface-2); color: var(--text); font-weight: 550; }
.side-link.active .side-icon { color: var(--accent); }
.side-icon {
  width: 15px; height: 15px;
  flex: none;
  color: var(--faint);
  display: grid; place-items: center;
}
.side-icon svg { width: 15px; height: 15px; display: block; }
.side-link .count {
  margin-left: auto;
  font-size: .72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  padding: 0 6px;
}
@media (max-width: 900px) {
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-link + .side-link { margin-top: 0; }
  .side-label { display: none; }
}

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-tight { padding: 14px; }
.card-flush { padding: 0; overflow: hidden; }
.card h2, .card h3 { margin-top: 0; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 18px; }
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}

.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; max-width: 68ch; font-size: .875rem; }

/* ------------------------------------------------------------------- stats */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
}
.stat-label {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-sub { font-size: .76rem; color: var(--faint); margin-top: 3px; }
.stat.gold .stat-value { color: var(--text); }
.stat.jade .stat-value { color: var(--ok); }
.stat.crimson .stat-value { color: var(--danger); }

/* ------------------------------------------------------------------ tables */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .855rem; }
table.data th {
  text-align: left;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-soft);
}
table.data td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-mark {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--faint);
  font-size: 1rem;
}
.empty h3 { color: var(--text-2); margin-bottom: 4px; }
.empty p { font-size: .82rem; margin: 0; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: .73rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-plain::before { display: none; }

.badge-violet  { color: #a892ff; border-color: rgba(124, 92, 255, .3); background: rgba(124, 92, 255, .1); }
.badge-gold    { color: var(--warn); border-color: rgba(240, 180, 41, .28); background: rgba(240, 180, 41, .09); }
.badge-jade    { color: var(--ok); border-color: rgba(62, 207, 142, .28); background: rgba(62, 207, 142, .09); }
.badge-crimson { color: var(--danger); border-color: rgba(242, 85, 90, .28); background: rgba(242, 85, 90, .09); }
.badge-sky     { color: var(--info); border-color: rgba(74, 168, 255, .28); background: rgba(74, 168, 255, .09); }
.badge-muted   { color: var(--muted); }

/* Shop-defined status pills, tinted from a chosen hex via --pill. */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: .74rem; font-weight: 500;
  color: var(--pill, var(--accent));
  background: color-mix(in srgb, var(--pill, var(--accent)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill, var(--accent)) 30%, transparent);
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--pill, var(--accent));
  border-radius: 50%;
  flex: none;
}
.swatch {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .14);
  flex: none;
  display: inline-block;
  vertical-align: -2px;
  padding: 0;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .845rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #32323a; color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }

.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); color: #fff; }

/* "gold" is legacy naming for the secondary emphasis button. */
.btn-gold { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-gold:hover { background: #fff; border-color: #fff; color: var(--bg); }

.btn-danger { color: var(--danger); border-color: rgba(242, 85, 90, .3); background: rgba(242, 85, 90, .07); }
.btn-danger:hover { background: rgba(242, 85, 90, .14); border-color: var(--danger); color: var(--danger); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: .78rem; border-radius: 8px; }
.btn-lg { padding: 10px 20px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- forms */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label, .label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.field .hint { font-size: .76rem; color: var(--faint); margin-top: 5px; line-height: 1.5; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: .865rem;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%238a8a95' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
input[type=color] {
  width: 40px; height: 34px; padding: 3px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); cursor: pointer;
}
input[readonly] { color: var(--muted); }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input[type=checkbox] {
  width: 15px; height: 15px; margin: 2px 0 0;
  accent-color: var(--accent); cursor: pointer; flex: none;
}
.check span { font-size: .845rem; color: var(--muted); }
.check strong { display: block; color: var(--text); font-size: .845rem; font-weight: 500; }

.input-group { display: flex; gap: 7px; align-items: stretch; }
.input-group > input { flex: 1 1 auto; }
.input-group > .btn { flex: none; }

fieldset { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
legend { padding: 0 6px; font-size: .76rem; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ alerts */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .845rem;
  display: flex; gap: 9px; align-items: flex-start;
  margin-bottom: 14px;
  color: var(--text-2);
}
.alert-mark { flex: none; line-height: 1.5; }
.alert-ok   { border-color: rgba(62, 207, 142, .28); background: rgba(62, 207, 142, .07); color: #a5e8c9; }
.alert-err  { border-color: rgba(242, 85, 90, .28); background: rgba(242, 85, 90, .07); color: #f7b4b6; }
.alert-warn { border-color: rgba(240, 180, 41, .28); background: rgba(240, 180, 41, .07); color: #f2d99a; }
.alert-info { border-color: rgba(74, 168, 255, .26); background: rgba(74, 168, 255, .07); color: #b3d8ff; }
.alert ul { margin: 5px 0 0; padding-left: 17px; }

/* ------------------------------------------------------------- copy fields */
.copy-box {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: .78rem;
  overflow: hidden;
}
.copy-box .val {
  flex: 1 1 auto;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text-2);
  scrollbar-width: thin;
}
.copy-box .val::-webkit-scrollbar { height: 3px; }
.copy-box .val::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.reveal-once {
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  border-radius: var(--radius);
  padding: 16px;
}

/* ------------------------------------------------------------------- misc */
.dim, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--text); }
.jade { color: var(--ok); }
.crimson { color: var(--danger); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.hide { display: none !important; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 42px; }
.spark i {
  flex: 1 1 0;
  min-height: 2px;
  background: var(--accent);
  border-radius: 2px;
  opacity: .8;
}
.spark i.zero { background: var(--surface-3); opacity: 1; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: .855rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

.avatar-dot {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  flex: none;
}

.thumb {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--border); flex: none;
}
.thumb-fallback { display: grid; place-items: center; font-size: .8rem; color: var(--faint); }

/* ---------------------------------------------------------------- landing */
.hero { padding: 62px 0 56px; text-align: center; }
.hero-mark { width: 64px; height: 64px; margin: 0 auto 20px; display: block; }
.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.35rem);
  letter-spacing: -.04em;
  margin-bottom: 16px;
  line-height: 1.06;
  font-weight: 600;
}
.hero .lede {
  font-size: clamp(.95rem, 1.6vw, 1.075rem);
  color: var(--muted);
  max-width: 56ch;
  margin: 0 auto 30px;
  line-height: 1.65;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .76rem; color: var(--text-2); font-weight: 450;
  margin-bottom: 18px;
}

.feature { padding: 20px; }
.feature-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 12px;
}
.feature-mark svg { width: 15px; height: 15px; }
.feature h3 { margin-bottom: 4px; font-size: .9rem; }
.feature p { color: var(--muted); font-size: .82rem; margin: 0; line-height: 1.6; }

.foot {
  border-top: 1px solid var(--border-soft);
  padding: 22px 0 34px;
  color: var(--faint);
  font-size: .8rem;
}
.foot a:not(.btn) { color: var(--muted); }

/* ---------------------------------------------------------------- auth box */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(400px, 100%); }
.auth-card .card { padding: 26px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .brand { justify-content: center; font-size: 1.05rem; }
.auth-head .brand-mark { width: 30px; height: 30px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------------ motion */
/* Everything here is decoration: the whole UI works with motion disabled. */

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  0%   { transform: scale(.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes sweep {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

main, .auth-card { animation: rise 380ms var(--ease) both; }

/* Stagger the cards in a grid so a dashboard assembles rather than snaps. */
.grid > *, .stack > * { animation: rise 340ms var(--ease) both; }
.grid > *:nth-child(1), .stack > *:nth-child(1) { animation-delay: 20ms; }
.grid > *:nth-child(2), .stack > *:nth-child(2) { animation-delay: 55ms; }
.grid > *:nth-child(3), .stack > *:nth-child(3) { animation-delay: 90ms; }
.grid > *:nth-child(4), .stack > *:nth-child(4) { animation-delay: 125ms; }
.grid > *:nth-child(5), .stack > *:nth-child(5) { animation-delay: 160ms; }
.grid > *:nth-child(n+6), .stack > *:nth-child(n+6) { animation-delay: 190ms; }

.card, .stat {
  transition: border-color var(--med), background var(--med), transform var(--med);
}
.card:hover, .stat:hover { border-color: #30303a; }

.stat { position: relative; overflow: hidden; }
.stat::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--med);
}
.stat:hover::after { transform: scaleX(1); }
.stat.jade::after { background: var(--ok); }
.stat.crimson::after { background: var(--danger); }

.btn { transform: translateZ(0); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); transition-duration: 60ms; }

.side-link { position: relative; }
.side-link::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height var(--med);
}
.side-link.active::before { height: 15px; }
.side-link .side-icon { transition: transform var(--fast), color var(--fast); }
.side-link:hover .side-icon { transform: translateX(1px); }

table.data tbody tr { transition: background var(--fast); }

.alert { animation: rise 300ms var(--ease) both; }
.reveal-once { animation: pop 320ms var(--ease) both; }
.empty-mark { animation: pop 400ms var(--ease) 80ms both; }

.spark i {
  transition: opacity var(--fast), transform var(--fast);
  transform-origin: bottom;
  animation: sweep 500ms var(--ease) both;
}
.spark i:hover { opacity: 1; transform: scaleX(1.25); }

.pill, .badge { transition: transform var(--fast); }
.method:hover .method-go { transform: translateX(2px); }

/* Honour the OS setting — no exceptions, including the staggered entrances. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover { transform: none; }
}

@media print {
  .masthead, .side, .ribbon, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  main, .grid > *, .stack > * { animation: none; }
}

/* ------------------------------------------------------------------- docs */
.docs-shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 44px;
  padding: 32px 0 96px;
  align-items: start;
}
@media (max-width: 940px) { .docs-shell { grid-template-columns: 1fr; gap: 20px; } }

.toc { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc::-webkit-scrollbar { width: 3px; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
@media (max-width: 940px) {
  .toc { position: static; max-height: none; border-bottom: 1px solid var(--border-soft); padding-bottom: 14px; }
  .toc-list { display: flex; flex-wrap: wrap; gap: 4px; }
}
.toc-title {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint); font-weight: 600; padding: 0 10px 7px;
}
.toc-list + .toc-title { margin-top: 16px; }
.toc a:not(.btn) {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .83rem;
  transition: background var(--fast), color var(--fast);
}
.toc a:not(.btn):hover { background: var(--surface-2); color: var(--text); }
.toc a:not(.btn).active { background: var(--surface-2); color: var(--text); font-weight: 500; }

.docs-body { max-width: 78ch; }
.docs-body section { scroll-margin-top: 76px; margin-bottom: 46px; }
.docs-body h2 {
  font-size: 1.32rem;
  letter-spacing: -.028em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 16px;
}
.docs-body h3 { font-size: 1rem; margin-top: 26px; }
.docs-body p { color: var(--text-2); line-height: 1.7; }
.docs-body ul { color: var(--text-2); padding-left: 20px; line-height: 1.75; }
.docs-body li + li { margin-top: 4px; }

.endpoint {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--surface);
  transition: border-color var(--med);
}
.endpoint:hover { border-color: #30303a; }
.endpoint-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 15px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}
.endpoint-path { font-family: var(--mono); font-size: .84rem; color: var(--text); }
.endpoint-note { color: var(--muted); font-size: .8rem; margin-left: auto; }
.endpoint-body { padding: 15px; }
.endpoint-body p:last-child { margin-bottom: 0; }
.endpoint-body pre:last-child { margin-bottom: 0; }

.method {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid;
  flex: none;
}
.method-get    { color: var(--ok);     border-color: rgba(62, 207, 142, .3);  background: rgba(62, 207, 142, .09); }
.method-post   { color: var(--accent); border-color: var(--accent-line);      background: var(--accent-dim); }
.method-patch  { color: var(--warn);   border-color: rgba(240, 180, 41, .3);  background: rgba(240, 180, 41, .09); }
.method-delete { color: var(--danger); border-color: rgba(242, 85, 90, .3);   background: rgba(242, 85, 90, .09); }

.scope-tag {
  font-family: var(--mono); font-size: .7rem;
  color: var(--faint); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 2px 6px;
}

table.params { width: 100%; border-collapse: collapse; font-size: .82rem; margin-bottom: 14px; }
table.params th {
  text-align: left; font-size: .7rem; color: var(--muted); font-weight: 500;
  padding: 7px 10px; border-bottom: 1px solid var(--border);
}
table.params td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; color: var(--text-2); }
table.params tr:last-child td { border-bottom: 0; }
table.params td:first-child { font-family: var(--mono); color: var(--text); white-space: nowrap; }
table.params .req { color: var(--danger); font-size: .72rem; }
table.params .type { font-family: var(--mono); color: var(--faint); font-size: .76rem; }

.codeblock { position: relative; }
.codeblock .copy-btn {
  position: absolute; top: 8px; right: 8px;
  opacity: 0; transition: opacity var(--fast);
}
.codeblock:hover .copy-btn, .codeblock .copy-btn:focus-visible { opacity: 1; }

.callout {
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 15px;
  margin: 0 0 16px;
  font-size: .845rem;
  color: var(--text-2);
}
.callout strong { color: var(--text); }
.callout-warn { border-left-color: var(--warn); }
.callout-danger { border-left-color: var(--danger); }

.lifecycle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.lifecycle .arrow { color: var(--faint); }

/* ----------------------------------------------------------- image pickers */
.imagepick { display: flex; gap: 12px; align-items: flex-start; }
.imagepick-preview {
  width: 62px; height: 62px; flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
  display: grid; place-items: center;
}
.imagepick-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imagepick-placeholder { color: var(--faint); display: grid; place-items: center; }
.imagepick-placeholder svg { width: 20px; height: 20px; }

input[type=file] {
  width: 100%;
  font: inherit;
  font-size: .82rem;
  color: var(--muted);
}
input[type=file]::file-selector-button {
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}
input[type=file]::file-selector-button:hover { background: var(--surface-3); border-color: #32323a; }
