/* ──────────────────────────────────────────────────────────────────
 * Nexus webapp · Outrun synthwave design system
 *
 *   Single stylesheet shared by every Jinja template under
 *   nexus-backend/app/webapp/templates/. Tailwind CDN is loaded
 *   ahead of this file so utility classes still apply for layout;
 *   this stylesheet supplies the visual identity (palette, type,
 *   atmospherics, components) and overrides Tailwind defaults
 *   wherever they fight the synthwave look.
 *
 *   Hard contracts honoured here:
 *     • --st-* tokens are read by nexus.js (STATUS_COLORS getComputedStyle)
 *     • class hooks .is-open / .is-visible / .is-active / .is-copied
 *       / .is-bad / .is-owner / .is-member / .is-warn drive runtime state
 *     • data-* selectors (data-modal, data-user-menu, data-action-bar,
 *       data-hero, data-row-chevron etc.) keep their JS semantics
 * ────────────────────────────────────────────────────────────────── */

/* ──────────────────────── 1 · Tokens ──────────────────────── */
:root {
  /* Background ladder — deep purple-black to slightly lifted surfaces */
  --bg:        #0A0418;
  --bg-2:      #0F0626;
  --bg-3:      #160A35;
  --bg-card:   rgba(15, 6, 38, 0.55);
  --bg-glass:  rgba(255, 255, 255, 0.03);

  /* Ink ladder */
  --ink:       #FFE8FF;
  --ink-2:     rgba(255, 232, 255, 0.74);
  --ink-3:     rgba(255, 232, 255, 0.46);
  --ink-4:     rgba(255, 232, 255, 0.24);

  /* Aliases consumed by inline color overrides in nexus.js + templates */
  --text-primary:   var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary:  var(--ink-3);

  /* Outrun primary palette */
  --pink:      #FF2EA8;
  --pink-2:    #FF6BC9;
  --cyan:      #00F5FF;
  --cyan-2:    #5BE9FF;
  --violet:    #8B5FFF;
  --yellow:    #FFE94A;
  --good:      #7FE0A5;
  --bad:       #FF5F7E;
  --warn:      #F4B860;

  /* Aliases */
  --accent:        var(--pink);
  --accent-cool:   var(--cyan);

  /* Border / line ladder */
  --line:      rgba(159, 124, 255, 0.20);
  --line-c:    rgba(0, 245, 255, 0.22);
  --line-p:    rgba(255, 46, 168, 0.28);
  --border:    var(--line);

  /* Status tokens — single source of truth (nexus.js reads these via
     getComputedStyle on :root, so badges + dots stay in lockstep). */
  --st-pending:      var(--yellow);
  --st-approved:     var(--cyan);
  --st-provisioning: var(--violet);
  --st-active:       var(--good);
  --st-failed:       var(--bad);
  --st-rejected:     var(--bad);
  --st-closed:       #5D6575;
  --st-paused:       var(--warn);

  /* Radii */
  --r-sm:  6px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  14px;
  --r-2xl: 18px;

  /* Glow recipes (reused on hover, focus, active) */
  --glow-pink:  0 0 22px rgba(255, 46, 168, 0.35);
  --glow-cyan:  0 0 22px rgba(0, 245, 255, 0.35);

  /* z-index ladder */
  --z-deco:    0;
  --z-ground:  1;
  --z-header: 20;
  --z-modal:  40;
  --z-toast:  50;
  --z-scan:   60;
}

/* ──────────────────────── 2 · Base body atmosphere ─────── */
html { background: var(--bg); color-scheme: dark; }

body {
  background:
    radial-gradient(72% 55% at 50%   0%, rgba(255,  46, 168, 0.16), transparent 60%),
    radial-gradient(55% 45% at 100% 35%, rgba(139,  95, 255, 0.14), transparent 60%),
    radial-gradient(60% 50% at   0% 100%, rgba(  0, 245, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: 'Chakra Petch', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Scanline overlay sits above content but below modals/toasts. Very
   faint — present, not distracting. Skipped under prefers-reduced-motion
   anyway because it's static, but let's keep it for the synthwave seal. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-scan);
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.018) 0 1px,
    transparent 1px 3px
  );
}

::selection { background: var(--pink); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* ──────────────────────── 3 · Header chrome ─────────────── */
body > header {
  background: rgba(10, 4, 24, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

/* Brand wordmark — first-letter "N" gets the Major Mono Display
   ASCII glyph + pink glow (reads as a logomark), the rest of the word
   stays in body Chakra Petch. Single class shared by header + footer
   so the brand looks the same everywhere. */
.brand-mark {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: none;
}
.brand-mark::first-letter {
  font-family: 'Major Mono Display', monospace;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 10px rgba(255, 46, 168, 0.55);
  margin-right: 1px;
}

body > header a[aria-label$="home"] > span:last-child {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.45);
  font-family: 'JetBrains Mono', monospace;
}

/* clerk-fail / misconfigured banners */
#nexus-clerk-fail-banner,
body > div.relative.z-30 {
  background: linear-gradient(90deg, rgba(255,46,168,0.14), rgba(139,95,255,0.10));
  color: var(--ink);
  border-bottom: 1px solid var(--line-p);
  font-family: 'JetBrains Mono', monospace;
}
#nexus-clerk-fail-banner code { color: var(--cyan); }
#nexus-clerk-fail-banner button {
  color: var(--cyan); font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
}

/* ──────────────────────── 4 · Typography ─────────────────── */
.font-mono { font-family: 'JetBrains Mono', monospace !important; }

h1, h2, h3, h4 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
}

main h1 { letter-spacing: -0.025em; line-height: 0.96; }
main h1 em, main h2 em {
  font-style: italic;
  color: var(--pink);
  font-weight: 500;
  text-shadow: 0 0 14px rgba(255, 46, 168, 0.45);
}

/* Eyebrow label — small mono uppercase + accent dot.
   Bare divs that contain just a tagline ("Dashboard / your workspaces",
   "Persona catalog", etc.) already exist in templates; we promote them. */
.eyebrow,
main header > div:first-child:not([class*="flex"]):not([class*="grid"]),
main section > div > div:first-child:not([class*="flex"]):not([class*="grid"]) {
  /* Keep this scoped — only direct children of section/header that are
     bare divs with a single tagline get the eyebrow treatment. */
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.35);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  height: 6px; width: 6px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

/* "Pre" line — VT323 retro-terminal flag used above big section heads */
.pre {
  font-family: 'VT323', monospace;
  font-size: 18px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* ──────────────────────── 5 · Buttons ────────────────────── */
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

/* Default button look — applied to every <button> + every <a> styled
   as a button (templates reach for class="rounded-md ..." on those).
   We only style buttons inside main+header forms to avoid colliding
   with Tailwind's built-in resets on totally generic buttons. */
main button:not([data-menu-trigger]):not([data-modal-cancel]):not([data-modal-backdrop]):not([data-tab]):not([data-pair-copy]):not([data-pair-regenerate]):not([data-act]):not([data-action]):not([data-refresh]):not([data-create-submit]):not([data-purge-confirm]):not([data-close-confirm]):not([data-pause-confirm]):not([data-reject-confirm]):not(.btn) {
  /* leave to Tailwind */
}

/* Primary CTA — the pink/violet neon button used on home + dashboard
   submit. Targets a generic `.btn` class plus the dashboard create
   submit and admin_detail primary action. */
.btn,
[data-create-submit],
[data-pair-regenerate] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--pink);
  background: var(--pink);
  color: var(--bg);
  border-radius: var(--r-md);
  box-shadow: 0 0 24px rgba(255, 46, 168, 0.45);
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover,
[data-create-submit]:hover:not(:disabled),
[data-pair-regenerate]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(255, 46, 168, 0.75);
}
.btn:disabled,
[data-create-submit]:disabled,
[data-pair-regenerate]:disabled {
  opacity: 0.4;
  transform: none;
  box-shadow: none;
}

/* Cyan ghost variant */
.btn-c, .btn-glass, .btn-ghost,
[data-pair-copy] {
  background: transparent;
  border: 1px solid var(--line-c);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.18);
}
.btn-c:hover,
.btn-glass:hover,
.btn-ghost:hover,
[data-pair-copy]:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
  box-shadow: 0 0 32px rgba(0, 245, 255, 0.65);
}

/* Modal cancel/keep-running button — quiet ghost */
[data-modal-cancel] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: var(--r-md);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color .15s, border-color .15s, background .15s;
}
[data-modal-cancel]:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  background: rgba(255, 255, 255, 0.04);
}

/* Action bar buttons (admin_detail) — neon outlined chips, brand
   palette only (cyan / violet / red), white text everywhere so the row
   reads as one device with three coloured states. Solid fills felt
   like industrial road-signs against the rest of the synthwave UI;
   the dark base + glowing outline keeps the buttons "on the rail". */
[data-action-bar] button[data-act] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: rgba(15, 6, 38, 0.55);
  color: #FFFFFF;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
[data-action-bar] button[data-act]:hover { transform: translateY(-1px); }

/* approve / resume → cyan */
[data-action-bar] button[data-act="approve"],
[data-action-bar] button[data-act="resume"] {
  border-color: var(--cyan);
  color: var(--cyan-2);
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.35), inset 0 0 18px rgba(0, 245, 255, 0.10);
}
[data-action-bar] button[data-act="approve"]:hover,
[data-action-bar] button[data-act="resume"]:hover {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 28px rgba(0, 245, 255, 0.7);
}

/* retry → cooler cyan, signals "try again" instead of "first run" */
[data-action-bar] button[data-act="retry"] {
  border-color: var(--cyan-2);
  color: var(--cyan-2);
  box-shadow: 0 0 12px rgba(91, 233, 255, 0.30), inset 0 0 16px rgba(91, 233, 255, 0.08);
}
[data-action-bar] button[data-act="retry"]:hover {
  background: var(--cyan-2);
  color: var(--bg);
  box-shadow: 0 0 24px rgba(91, 233, 255, 0.6);
}

/* pause → violet — same color the system uses for transitional states
   (pausing/resuming/provisioning), so the button colour matches the
   state it produces */
[data-action-bar] button[data-act="pause"] {
  border-color: var(--violet);
  color: #C4B0FF;
  box-shadow: 0 0 14px rgba(139, 95, 255, 0.40), inset 0 0 18px rgba(139, 95, 255, 0.10);
}
[data-action-bar] button[data-act="pause"]:hover {
  background: var(--violet);
  color: #FFFFFF;
  box-shadow: 0 0 28px rgba(139, 95, 255, 0.75);
}

/* reject / close / purge → danger red */
[data-action-bar] button[data-act="reject"],
[data-action-bar] button[data-act="close"],
[data-action-bar] button[data-act="purge"] {
  border-color: var(--bad);
  color: var(--bad);
  box-shadow: 0 0 14px rgba(255, 95, 126, 0.40), inset 0 0 18px rgba(255, 95, 126, 0.10);
}
[data-action-bar] button[data-act="reject"]:hover,
[data-action-bar] button[data-act="close"]:hover,
[data-action-bar] button[data-act="purge"]:hover {
  background: var(--bad);
  color: #FFFFFF;
  box-shadow: 0 0 28px rgba(255, 95, 126, 0.75);
}

/* Inline approve / reject in admin row — same neon outline treatment as
   the action bar (default outlined + glow, hover solid + bigger glow),
   just smaller padding so the row stays scannable. */
[data-action="approve"], [data-action="reject"] {
  background: rgba(15, 6, 38, 0.55);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s, color .15s, box-shadow .15s;
}
[data-action="approve"] {
  border: 1px solid var(--cyan);
  color: var(--cyan-2);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.30);
}
[data-action="approve"]:hover {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.65);
}
[data-action="reject"] {
  border: 1px solid var(--bad);
  color: var(--bad);
  box-shadow: 0 0 10px rgba(255, 95, 126, 0.30);
}
[data-action="reject"]:hover {
  background: var(--bad);
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(255, 95, 126, 0.65);
}

/* Refresh button (admin) */
[data-refresh] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
  transition: color .15s, border-color .15s, background .15s;
}
[data-refresh]:hover { color: var(--cyan); border-color: var(--cyan); }

/* Modal confirm buttons (per-flavor: reject/close/purge danger; pause warn) */
[data-reject-confirm], [data-close-confirm], [data-purge-confirm] {
  background: var(--bad);
  border: 1px solid var(--bad);
  color: var(--bg);
  font-weight: 600;
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
  box-shadow: 0 0 22px rgba(255, 95, 126, 0.45);
  transition: box-shadow .15s, background .15s, opacity .15s;
}
[data-reject-confirm]:hover:not(:disabled),
[data-close-confirm]:hover:not(:disabled),
[data-purge-confirm]:hover:not(:disabled) {
  box-shadow: 0 0 32px rgba(255, 95, 126, 0.7);
}
[data-reject-confirm]:disabled,
[data-close-confirm]:disabled,
[data-purge-confirm]:disabled { opacity: 0.4; box-shadow: none; }

[data-pause-confirm] {
  background: var(--violet);
  border: 1px solid var(--violet);
  color: #FFFFFF;
  font-weight: 600;
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
  box-shadow: 0 0 22px rgba(139, 95, 255, 0.50);
}
[data-pause-confirm]:hover:not(:disabled) {
  box-shadow: 0 0 32px rgba(139, 95, 255, 0.75);
}

/* ──────────────────────── 6 · Form controls ──────────────── */
input[type="text"],
input[type="email"],
input[type="search"],
input:not([type]),
textarea {
  background: var(--bg-glass);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.18);
  background: rgba(0, 245, 255, 0.04);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(255, 95, 126, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }

/* Slug input — bigger, mono, amplified focus */
#slug, [data-close-input], [data-purge-input] {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  letter-spacing: 0.02em;
}
#slug-hint { color: var(--ink-3); }
#slug-hint[aria-invalid="true"] { color: var(--bad); }

/* Inline create-form error/success ribbons */
[data-create-error] {
  background: rgba(255, 95, 126, 0.08);
  border: 1px solid rgba(255, 95, 126, 0.35);
  color: var(--bad);
}
[data-create-success] {
  background: rgba(127, 224, 165, 0.08);
  border: 1px solid rgba(127, 224, 165, 0.35);
  color: var(--good);
}
[data-pair-error] {
  background: rgba(255, 95, 126, 0.08);
  border: 1px solid rgba(255, 95, 126, 0.35);
  color: var(--bad);
}

/* ──────────────────────── 7 · Status badge ───────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.status-dot-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 6px; width: 6px;
}
.status-dot {
  position: relative;
  z-index: 1;
  height: 6px; width: 6px;
  border-radius: 999px;
  background: var(--st-closed);
  box-shadow: 0 0 8px var(--st-closed);
}
.status-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--st-provisioning);
  opacity: 0.6;
}
.status-label { color: var(--ink); }

/* Per-state colour ladder driven by data-status */
.status-badge[data-status="pending"]      .status-dot { background: var(--st-pending);      box-shadow: 0 0 10px var(--st-pending); }
.status-badge[data-status="approved"]     .status-dot { background: var(--st-approved);     box-shadow: 0 0 10px var(--st-approved); }
.status-badge[data-status="provisioning"] .status-dot,
.status-badge[data-status="pausing"]      .status-dot,
.status-badge[data-status="resuming"]     .status-dot { background: var(--st-provisioning); box-shadow: 0 0 12px var(--st-provisioning); }
.status-badge[data-status="active"]       .status-dot { background: var(--st-active);       box-shadow: 0 0 10px var(--st-active); }
.status-badge[data-status="failed"]       .status-dot,
.status-badge[data-status="rejected"]     .status-dot { background: var(--st-failed);       box-shadow: 0 0 10px var(--st-failed); }
.status-badge[data-status="closed"]       .status-dot,
.status-badge[data-status="not_provisioned"] .status-dot { background: var(--st-closed); box-shadow: 0 0 8px rgba(93,101,117,0.45); }
.status-badge[data-status="paused"]       .status-dot { background: var(--st-paused);       box-shadow: 0 0 10px var(--st-paused); }

/* Tint the whole pill for active/failed states (the headline ones) */
.status-badge[data-status="active"]   { background: rgba(127, 224, 165, 0.06); border-color: rgba(127, 224, 165, 0.25); color: var(--good); }
.status-badge[data-status="failed"],
.status-badge[data-status="rejected"] { background: rgba(255,  95, 126, 0.06); border-color: rgba(255,  95, 126, 0.30); color: var(--bad);  }
.status-badge[data-status="provisioning"],
.status-badge[data-status="pausing"],
.status-badge[data-status="resuming"] { background: rgba(139,  95, 255, 0.06); border-color: rgba(139,  95, 255, 0.30); color: var(--violet); }
.status-badge[data-status="pending"]  { background: rgba(255, 233,  74, 0.06); border-color: rgba(255, 233,  74, 0.30); color: var(--yellow); }
.status-badge[data-status="paused"]   { background: rgba(244, 184,  96, 0.06); border-color: rgba(244, 184,  96, 0.30); color: var(--warn); }
.status-badge[data-status="approved"] { background: rgba(  0, 245, 255, 0.06); border-color: rgba(  0, 245, 255, 0.30); color: var(--cyan); }

.status-badge[data-size="md"] { padding: 5px 12px; font-size: 11.5px; }
.status-badge:not([data-size="md"]) { padding: 3px 10px; }

/* ──────────────────────── 8 · Pills ──────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 6, 38, 0.55);
  backdrop-filter: blur(10px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.pill .dot {
  height: 6px; width: 6px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px currentColor; }
  50%      { box-shadow: 0 0 14px currentColor; }
}

/* Generic role pill (dashboard ledger row) */
[data-role-slot] {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
[data-role-slot].is-owner {
  color: var(--pink);
  border-color: var(--line-p);
  background: rgba(255, 46, 168, 0.08);
  text-shadow: 0 0 8px rgba(255, 46, 168, 0.4);
}

/* ──────────────────────── 9 · Surface frames ─────────────── */
.surface-frame,
.prompt-shell,
[data-list-container],
[data-meta-container] > div {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
}
[data-list-container] { border-radius: var(--r-xl); }

/* Glowing prompt-shell (dashboard create form) — animated outline */
.prompt-shell, .surface-frame.glow,
section[data-prompt-shell] {
  background:
    linear-gradient(180deg, rgba(255, 46, 168, 0.05), transparent 30%),
    var(--bg-card);
  border: 1px solid var(--line-p);
  box-shadow: 0 0 36px rgba(255, 46, 168, 0.10);
}
.prompt-shell::before,
section[data-prompt-shell]::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--pink) 70%, transparent);
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.55);
  pointer-events: none;
}

/* Metadata cards (admin_detail) — 2-col grid with stretch (default), so
   the two cards in each row align top AND bottom. The JS renders cards
   in a height-balanced order (tall+tall, mid+mid, short orphan) so the
   stretch-induced empty space stays small. No top accent line — kept
   the cards visually independent of each other. */
[data-meta-container] {
  align-items: stretch;
}

/* Hero spotlight — fed by base.html JS via --mx/--my */
[data-hero] {
  position: relative;
}
[data-hero]::before {
  content: "";
  position: absolute;
  inset: -50px;
  pointer-events: none;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 30%),
    rgba(255, 46, 168, 0.10),
    transparent 70%
  );
  z-index: 0;
  transition: opacity .3s;
}
[data-hero] > * { position: relative; z-index: 1; }

/* ──────────────────────── 10 · Data row (ledger) ─────────── */
.data-row,
[data-ws-list] > div,
[data-req-list] > div,
[data-rows] > div {
  position: relative;
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .15s, border-color .15s;
}
.data-row:hover,
[data-rows] > div:hover {
  background: rgba(0, 245, 255, 0.025);
  border-bottom-color: var(--line-c);
}
.data-row:last-child,
[data-ws-list] > div:last-child,
[data-req-list] > div:last-child,
[data-rows] > div:last-child { border-bottom: 0; }

/* Left accent strip — driven by .is-owner / .is-member / .is-warn / .is-bad */
.data-row::before,
[data-ws-list] > div.is-owner::before,
[data-ws-list] > div.is-member::before,
[data-req-list] > div .data-row::before,
[data-req-list] > div.is-warn::before,
[data-req-list] > div.is-bad::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--ink-4);
  opacity: 0.8;
}
.data-row.is-owner::before,
[data-ws-list] > div.is-owner::before { background: linear-gradient(180deg, var(--pink), var(--violet)); box-shadow: 0 0 8px rgba(255, 46, 168, 0.4); }
.data-row.is-member::before,
[data-ws-list] > div.is-member::before { background: var(--cyan); box-shadow: 0 0 6px rgba(0, 245, 255, 0.3); opacity: 0.5; }
.data-row.is-warn::before,
[data-req-list] > div.is-warn::before { background: var(--warn); box-shadow: 0 0 8px rgba(244, 184, 96, 0.4); }
.data-row.is-bad::before,
[data-req-list] > div.is-bad::before { background: var(--bad); box-shadow: 0 0 8px rgba(255, 95, 126, 0.4); }

[data-row-chevron] { color: var(--ink-3); transition: transform .15s, color .15s; }
[data-rows] > div:hover [data-row-chevron] { color: var(--cyan); transform: translateX(2px); }

/* ──────────────────────── 11 · Tabs (admin) ──────────────── */
[role="tablist"] {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.02);
  width: fit-content;
  max-width: 100%;
}
[data-tab] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: color .15s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
[data-tab]:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
[data-tab][aria-selected="true"] {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 0 22px rgba(255, 46, 168, 0.45);
  border-color: var(--pink);
}
[data-tab-count] {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  min-width: 20px;
  text-align: center;
}
[data-tab][aria-selected="true"] [data-tab-count] {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

/* ──────────────────────── 12 · Modals ────────────────────── */
[data-modal] {
  align-items: center;
  justify-content: center;
}
[data-modal]:not(.hidden) { display: flex; }
[data-modal-backdrop] {
  background: rgba(10, 4, 24, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-modal] > div:not([data-modal-backdrop]) {
  background: var(--bg-2);
  border: 1px solid var(--line-c);
  border-radius: var(--r-xl);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(0, 245, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: modalIn 0.18s ease-out both;
}
[data-modal][data-modal="purge"] > div:not([data-modal-backdrop]),
[data-modal][data-modal="close"] > div:not([data-modal-backdrop]),
[data-modal][data-modal="reject"] > div:not([data-modal-backdrop]) {
  border-color: rgba(255, 95, 126, 0.35);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 95, 126, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Modal eyebrow ("Action · purge") */
[data-modal] > div > div:first-child:not([data-modal-backdrop]) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}
[data-modal] h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
}
[data-modal] [data-close-slug-display],
[data-modal] [data-purge-slug-display] {
  background: rgba(255, 95, 126, 0.10);
  color: var(--bad);
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(255, 95, 126, 0.30);
}

/* Reason counter */
[data-reject-counter], [data-pause-counter] {
  color: var(--ink-3);
}

/* ──────────────────────── 13 · User menu ─────────────────── */
[data-menu-trigger] {
  background: transparent;
  color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
/* Avatar tile — rounded square with pink→violet gradient + 1px line so
   it speaks the same border-and-glow language as buttons and cards. */
[data-menu-trigger] > span:first-child {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #FFFFFF;
  border: 1px solid var(--line-p);
  box-shadow: 0 0 14px rgba(255, 46, 168, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.01em;
}
[data-menu-trigger]:hover { color: var(--ink); }
[data-menu-trigger]:hover > span:first-child {
  box-shadow: 0 0 22px rgba(255, 46, 168, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

[data-menu] {
  width: 280px;
  padding: 0;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line-c);
  border-radius: var(--r-lg);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(0, 245, 255, 0.10);
}
[data-menu]::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--pink) 70%, transparent);
  pointer-events: none;
}

/* Header card — avatar + identity + presence */
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(255, 46, 168, 0.08), transparent 80%);
  border-bottom: 1px solid var(--line);
}
.user-menu-avatar {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border: 1px solid var(--line-p);
  box-shadow: 0 0 14px rgba(255, 46, 168, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.user-menu-id { min-width: 0; flex: 1; }
.user-menu-email {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-status {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.user-menu-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

/* Menu items */
[data-menu] .h-px { display: none; }
.user-menu-section { padding: 6px 0; }
.user-menu-section + .user-menu-section { border-top: 1px solid var(--line); }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.user-menu-item:hover { color: var(--ink); background: rgba(0, 245, 255, 0.06) !important; }
.user-menu-item svg { flex-shrink: 0; color: var(--ink-3); transition: color .15s; }
.user-menu-item:hover svg { color: var(--cyan); }
.user-menu-item .user-menu-tag {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
  border: 1px solid var(--line-p);
  background: rgba(255, 46, 168, 0.10);
  padding: 1px 7px;
  border-radius: 4px;
}
.user-menu-item.is-signout { color: var(--ink-3); }
.user-menu-item.is-signout:hover {
  color: var(--bad) !important;
  background: rgba(255, 95, 126, 0.08) !important;
}
.user-menu-item.is-signout:hover svg { color: var(--bad); }

/* ──────────────────────── 13b · Workspace ledger row ─────── */
.ws-avatar {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  /* member default — cool cyan */
  background: linear-gradient(135deg, var(--cyan-2), var(--violet));
  border: 1px solid var(--line-c);
  box-shadow: 0 0 12px rgba(91, 233, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.is-owner .ws-avatar {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  border-color: var(--line-p);
  box-shadow: 0 0 14px rgba(255, 46, 168, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.is-warn .ws-avatar {
  background: linear-gradient(135deg, var(--warn), var(--pink-2));
  border-color: rgba(244, 184, 96, 0.35);
  box-shadow: 0 0 14px rgba(244, 184, 96, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.is-bad .ws-avatar {
  background: linear-gradient(135deg, var(--bad), var(--pink));
  border-color: rgba(255, 95, 126, 0.35);
  box-shadow: 0 0 14px rgba(255, 95, 126, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
/* Right-side arrow that fades in on row hover — read affordance even
   though the dashboard ledger isn't a navigator (admin rows ARE, and
   share these styles harmlessly). */
.ws-row-arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s, color .15s;
  color: var(--ink-3);
}
.ws-row:hover .ws-row-arrow,
[data-rows] > div:hover .ws-row-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--cyan);
}

/* ──────────────────────── 14 · Empty / skeleton / error ──── */
[data-ws-list] > div:has(.h-4),
[data-req-list] > div:has(.h-4),
[data-rows] > div:has(.h-3) {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.018);
  animation: skel 1.4s ease-in-out infinite alternate;
}
[data-ws-list] .h-3, [data-ws-list] .h-4,
[data-req-list] .h-3, [data-req-list] .h-4,
[data-rows] .h-3 {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}
@keyframes skel { from { opacity: 0.5; } to { opacity: 0.85; } }

/* ──────────────────────── 15 · Copy button ───────────────── */
button[data-copy] {
  background: transparent;
  color: var(--ink-3);
  transition: color .15s, background .15s;
  border-radius: var(--r-sm);
  padding: 4px;
}
button[data-copy]:hover { color: var(--cyan); background: rgba(0, 245, 255, 0.06); }
button[data-copy].is-copied { color: var(--good) !important; }

/* ──────────────────────── 16 · Pair code page ────────────── */
[data-pair-code] {
  font-family: 'Major Mono Display', monospace;
  font-size: clamp(56px, 10vw, 120px);
  text-align: center;
  letter-spacing: 0.1em;
  line-height: 1;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--pink) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 46, 168, 0.4));
  user-select: all;
  margin: 12px 0;
}
[data-pair-bar] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
[data-pair-bar-fill] {
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 14px rgba(255, 46, 168, 0.5);
}

/* ──────────────────────── 17 · Timeline rail (admin_detail) ─────
   One continuous rail line lives on [data-events]; each `details` is
   transparent at the borders so events feel like beats on a stream
   instead of stacked cards. Dot punches through the rail. */
[data-events] {
  position: relative;
}
[data-events]::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0,
    var(--line-c) 12px,
    var(--line-c) calc(100% - 12px),
    transparent 100%);
  pointer-events: none;
}
[data-events] details {
  position: relative;
  padding: 12px 0 12px 28px;
}
[data-events] details + details { margin-top: 4px; }
/* Dot — sits on the rail, has a solid bg disc so the rail line doesn't
   show through the centre. */
[data-events] details > summary > span:first-child {
  position: absolute;
  left: 0; top: 16px;
  height: 11px; width: 11px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  border: 2px solid var(--bg);
  z-index: 1;
}
[data-events] details > summary > span:first-child.is-bad {
  background: var(--bad);
  box-shadow: 0 0 12px var(--bad);
}
/* Per-kind dot via data-kind (admin_detail will set this) */
[data-events] details[data-kind="ok"]      > summary > span:first-child { background: var(--good); box-shadow: 0 0 10px var(--good); }
[data-events] details[data-kind="bad"]     > summary > span:first-child { background: var(--bad);  box-shadow: 0 0 12px var(--bad); }
[data-events] details[data-kind="warn"]    > summary > span:first-child { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
[data-events] details[data-kind="info"]    > summary > span:first-child { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
[data-events] details[data-kind="neutral"] > summary > span:first-child { background: var(--ink-3); box-shadow: none; }
[data-events] details > summary { list-style: none; cursor: pointer; }
[data-events] details > summary::-webkit-details-marker { display: none; }
[data-events] details pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ──────────────────────── 18 · Diagnostic list (clerk_redirect) */
#diagnostic li[data-step] {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-3);
}

[data-redirect-card] {
  background: var(--bg-card);
  border: 1px solid var(--line-c);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 245, 255, 0.08);
  position: relative;
  overflow: hidden;
}
[data-redirect-card]::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.5);
}
[data-redirect-card] > div:first-child > span:first-child {
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ──────────────────────── 19 · Hero horizon (home only) ──── */
.horizon {
  position: relative;
  overflow: hidden;
}
.horizon .stars {
  position: absolute; inset: 0;
  pointer-events: none;
  will-change: background-position;
}
.horizon .stars-far {
  background-image:
    radial-gradient(1px 1px at 4% 18%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 17% 8%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 28% 32%, rgba(255,232,255,0.7), transparent),
    radial-gradient(1px 1px at 41% 14%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 56% 26%, rgba(255,232,255,0.6), transparent),
    radial-gradient(1px 1px at 67% 11%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 79% 22%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 91% 36%, rgba(255,232,255,0.7), transparent),
    radial-gradient(1px 1px at 11% 46%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 33% 52%, rgba(255,232,255,0.6), transparent),
    radial-gradient(1px 1px at 64% 48%, #FFE8FF, transparent),
    radial-gradient(1px 1px at 85% 58%, rgba(255,232,255,0.7), transparent);
  background-size: 1200px 600px;
  background-repeat: repeat;
  opacity: 0.45;
  animation: starDriftFar 240s linear infinite;
}
.horizon .stars-mid {
  background-image:
    radial-gradient(1.2px 1.2px at 8% 24%, #FFE8FF, transparent),
    radial-gradient(1.4px 1.4px at 24% 12%, #5BE9FF, transparent),
    radial-gradient(1.2px 1.2px at 39% 38%, #FFE8FF, transparent),
    radial-gradient(1.4px 1.4px at 53% 8%, #FFE8FF, transparent),
    radial-gradient(1.2px 1.2px at 71% 30%, #FF6BC9, transparent),
    radial-gradient(1.4px 1.4px at 88% 16%, #FFE8FF, transparent),
    radial-gradient(1.2px 1.2px at 14% 60%, #FFE8FF, transparent),
    radial-gradient(1.4px 1.4px at 47% 70%, #5BE9FF, transparent),
    radial-gradient(1.2px 1.2px at 78% 64%, #FFE8FF, transparent);
  background-size: 1400px 700px;
  background-repeat: repeat;
  opacity: 0.6;
  animation: starDriftMid 150s linear infinite;
}
.horizon .stars-near {
  background-image:
    radial-gradient(1.8px 1.8px at 12% 14%, #FFE8FF, transparent),
    radial-gradient(2px 2px at 36% 28%, #FFE94A, transparent),
    radial-gradient(1.8px 1.8px at 60% 9%, #FFE8FF, transparent),
    radial-gradient(2px 2px at 82% 22%, #5BE9FF, transparent),
    radial-gradient(1.8px 1.8px at 22% 56%, #FF6BC9, transparent),
    radial-gradient(2px 2px at 70% 64%, #FFE8FF, transparent);
  background-size: 1600px 800px;
  background-repeat: repeat;
  opacity: 0.85;
  animation: starDriftNear 90s linear infinite, twinkle 5s ease-in-out infinite alternate;
}
@keyframes starDriftFar  { from { background-position: 0 0; } to { background-position: -1200px 0; } }
@keyframes starDriftMid  { from { background-position: 0 0; } to { background-position: -1400px 0; } }
@keyframes starDriftNear { from { background-position: 0 0; } to { background-position: -1600px 0; } }
@keyframes twinkle {
  0%   { filter: brightness(0.85); }
  50%  { filter: brightness(1.15); }
  100% { filter: brightness(0.95); }
}

.horizon .sun {
  position: absolute;
  left: 50%; top: 30%;
  transform: translate(-50%, -10%);
  width: 340px; height: 340px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--yellow) 0%, var(--pink) 55%, var(--bg) 100%);
  box-shadow: 0 0 140px rgba(255, 46, 168, 0.55), inset 0 -40px 80px rgba(255, 46, 168, 0.4);
  z-index: 1;
}
.horizon .sun::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 54%; height: 50%;
  background: repeating-linear-gradient(180deg, transparent 0 9px, var(--bg) 9px 16px);
}
.horizon .grid-bg {
  position: absolute;
  bottom: -30px; left: -50%; right: -50%;
  height: 62%;
  background-image:
    linear-gradient(0deg,  rgba(255, 46, 168, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 46, 168, 0.35) 1px, transparent 1px);
  background-size: 80px 30px;
  transform: perspective(360px) rotateX(60deg);
  transform-origin: center top;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 100%);
  z-index: 1;
  animation: gridDrift 12s linear infinite;
}
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 0 30px; } }

.horizon-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.horizon h1 {
  font-family: 'Major Mono Display', monospace;
  font-size: clamp(64px, 12vw, 176px);
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow:
    0 0 4px  rgba(255, 255, 255, 0.85),
    0 0 18px rgba(255,  46, 168, 0.85),
    5px 0 0  rgba(  0, 245, 255, 0.55),
    -5px 0 0 rgba(255,  46, 168, 0.55);
}
.horizon h1 .v {
  color: var(--cyan);
  text-shadow: 0 0 4px #fff, 0 0 18px var(--cyan);
}
.horizon .pre { margin-bottom: 14px; }
.horizon .tag {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 6, 38, 0.5);
  backdrop-filter: blur(10px);
}
.horizon .tag .dot {
  height: 8px; width: 8px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ──────────────────────── 20 · Persona arcade (home) ─────── */
.arcade {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.persona-card {
  border: 1px solid var(--line-c);
  padding: 18px;
  background: rgba(15, 6, 38, 0.55);
  border-radius: var(--r-lg);
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.persona-card:hover {
  transform: translate(-3px, -3px);
  border-color: var(--pink);
  box-shadow: 6px 6px 0 var(--pink), 0 0 24px rgba(255, 46, 168, 0.3);
}
.persona-card .h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.4);
}
.persona-card h4 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.persona-card p {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.55;
}
.persona-card .meter {
  margin-top: 14px;
  height: 5px;
  background: rgba(255, 46, 168, 0.15);
  position: relative;
  overflow: hidden;
  border-radius: 3px;
}
.persona-card .meter::after {
  content: "";
  position: absolute;
  inset: 0 35% 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

@media (max-width: 980px) { .arcade { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .arcade { grid-template-columns: 1fr; } }

/* ──────────────────────── 21 · Product mock (home) ───────── */
.desktop {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--cyan);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.18),
    0 60px 120px rgba(0, 0, 0, 0.6),
    inset 0 0 80px rgba(0, 245, 255, 0.04);
}
.desktop::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border: 1px solid var(--pink);
  transform: translate(8px, 8px);
  z-index: -1;
  border-radius: var(--r-xl);
  opacity: 0.85;
}
.desktop::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.85);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-c);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}
.titlebar .dots { display: flex; gap: 7px; }
.titlebar .dots span { height: 11px; width: 11px; border-radius: 999px; background: rgba(255, 232, 255, 0.18); }
.titlebar .dots span:nth-child(1) { background: #FF5F57; box-shadow: 0 0 10px rgba(255, 95, 87, 0.45); }
.titlebar .dots span:nth-child(2) { background: #FEBC2E; box-shadow: 0 0 10px rgba(254, 188, 46, 0.45); }
.titlebar .dots span:nth-child(3) { background: #28C840; box-shadow: 0 0 10px rgba(40, 200, 64, 0.45); }
.titlebar .nav-arrows { display: flex; gap: 6px; color: var(--ink-3); }
.titlebar .nav-arrows .b { height: 24px; width: 24px; border: 1px solid var(--line-c); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.titlebar .center { flex: 1; text-align: center; font-family: 'VT323', monospace; font-size: 14px; color: var(--ink-3); letter-spacing: 0.16em; }
.titlebar .center .pink { color: var(--pink); }
.titlebar .right { font-family: 'VT323', monospace; font-size: 14px; color: var(--cyan); letter-spacing: 0.12em; }

.desktop-body { display: grid; grid-template-columns: 280px 1fr; min-height: 620px; }
@media (max-width: 980px) {
  .desktop-body { grid-template-columns: 1fr; }
}

.mock-sidebar {
  border-right: 1px solid var(--line-c);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255, 46, 168, 0.04), transparent 30%);
}
.mock-sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: default;
  transition: background .15s, color .15s;
}
.mock-sidebar .nav-item:hover { background: rgba(0, 245, 255, 0.05); color: var(--ink); }
.mock-sidebar .nav-item .ico { height: 16px; width: 16px; flex-shrink: 0; }
.mock-sidebar .nav-item .count { margin-left: auto; font-family: 'VT323', monospace; font-size: 13px; color: var(--ink-3); padding: 0 6px; background: rgba(255, 232, 255, 0.06); border-radius: 4px; }
.mock-sidebar .nav-item.active {
  background: linear-gradient(135deg, rgba(255, 46, 168, 0.22), rgba(139, 95, 255, 0.16));
  color: var(--ink);
  border: 1px solid var(--pink);
  box-shadow: 0 0 22px rgba(255, 46, 168, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.mock-sidebar .nav-item.active .ico { color: var(--pink); }
.mock-sidebar .group-h {
  display: flex; justify-content: space-between;
  padding: 0 8px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: var(--ink-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mock-sidebar .ch-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.mock-sidebar .ch-item:hover { background: rgba(0, 245, 255, 0.05); color: var(--ink); }
.mock-sidebar .ch-item .h { font-family: 'JetBrains Mono', monospace; color: var(--ink-3); }
.mock-sidebar .ch-item .unread { margin-left: auto; height: 6px; width: 6px; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.mock-sidebar .dm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.mock-sidebar .dm-item .av {
  height: 22px; width: 22px;
  border-radius: 6px;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}
.mock-sidebar .dm-item .av .pres {
  position: absolute; bottom: -2px; right: -2px;
  height: 8px; width: 8px;
  border-radius: 999px;
  background: var(--cyan);
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 6px var(--cyan);
}
.mock-sidebar .me {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 6px 4px;
  border-top: 1px solid var(--line-c);
}
.mock-sidebar .me .av {
  height: 32px; width: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: var(--bg);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  position: relative;
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.45);
}

.mock-main { padding: 24px 32px; overflow: hidden; }
.mock-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line-c); margin-top: 18px; }
.mock-tab {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--ink-2);
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: 0.04em;
}
.mock-tab.active {
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: var(--ink);
  box-shadow: 0 0 22px rgba(255, 46, 168, 0.45);
  font-weight: 600;
}

.mock-feed-section .sec-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.mock-feed-section .sec-head .ico { height: 14px; width: 14px; color: var(--cyan); }
.mock-feed-section .sec-head h3 {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.mock-feed-section .sec-head .count {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
}
.mock-feed-section .sec-head .count.warn {
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 46, 168, 0.55);
}

.mock-empty {
  border: 1px dashed var(--line-c);
  border-radius: 10px;
  padding: 38px 24px;
  text-align: center;
  background: rgba(0, 245, 255, 0.02);
}
.mock-empty .et { font-family: 'Chakra Petch', sans-serif; font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.mock-empty .es { font-size: 12.5px; color: var(--ink-3); max-width: 42ch; margin: 0 auto; }

.mock-act {
  border: 1px solid var(--line-c);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 245, 255, 0.04), transparent);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.mock-act + .mock-act { margin-top: 10px; }
.mock-act::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--pink));
}
.mock-act.agent::before { background: linear-gradient(180deg, var(--pink), var(--violet)); }
.mock-act .lbl { color: var(--pink); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; }
.mock-act.agent .lbl { color: var(--cyan); }
.mock-act .hash { font-family: 'JetBrains Mono', monospace; color: var(--ink-3); font-size: 12px; }
.mock-act .ch { font-family: 'JetBrains Mono', monospace; color: var(--cyan); font-size: 12px; background: rgba(0, 245, 255, 0.08); padding: 1px 8px; border-radius: 4px; }
.mock-act .mention {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0, 245, 255, 0.10);
  color: var(--cyan);
  padding: 1px 8px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line-c);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.15);
}
.mock-act .ago { font-family: 'VT323', monospace; font-size: 14px; color: var(--ink-3); letter-spacing: 0.1em; flex-shrink: 0; align-self: flex-start; }
.agent-prog { margin-top: 10px; height: 6px; background: rgba(255, 46, 168, 0.12); position: relative; overflow: hidden; border-radius: 3px; }
.agent-prog::after { content: ""; position: absolute; inset: 0 32% 0 0; background: linear-gradient(90deg, var(--pink), var(--cyan)); box-shadow: 0 0 12px rgba(0, 245, 255, 0.45); }
.agent-meta { margin-top: 8px; font-family: 'VT323', monospace; font-size: 14px; color: var(--ink-3); letter-spacing: 0.1em; display: flex; gap: 14px; flex-wrap: wrap; }
.agent-meta .pink { color: var(--pink); }
.agent-meta .good { color: var(--good); }

.mock-search {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-c);
  border-radius: 8px;
  background: rgba(0, 245, 255, 0.03);
  color: var(--ink-3);
  font-size: 13px;
}
.mock-search .ico { color: var(--cyan); }
.mock-search .kbd { margin-left: auto; font-family: 'VT323', monospace; font-size: 13px; color: var(--ink-3); padding: 1px 6px; border: 1px solid var(--line-c); border-radius: 4px; }

/* ──────────────────────── 22 · Footer ────────────────────── */
body > footer {
  background: rgba(10, 4, 24, 0.5);
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ──────────────────────── 23 · Scroll reveal ─────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ──────────────────────── 24 · Misc utilities ────────────── */
.text-pink { color: var(--pink); }
.text-cyan { color: var(--cyan); }
.text-violet { color: var(--violet); }
.text-good { color: var(--good); }
.text-warn { color: var(--warn); }
.text-bad { color: var(--bad); }

.mono-glow { font-family: 'JetBrains Mono', monospace; color: var(--cyan); text-shadow: 0 0 8px rgba(0, 245, 255, 0.4); }

/* hr — neon-tinted divider */
hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-p), transparent); margin: 32px 0; }

/* ping animation reused by status badge provisioning pulse */
@keyframes ping {
  75%, 100% { transform: scale(2.4); opacity: 0; }
}
.animate-ping { animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* ──────────────────────── 25 · Reduced motion ────────────── */
@media (prefers-reduced-motion: reduce) {
  .horizon .stars-far,
  .horizon .stars-mid,
  .horizon .stars-near,
  .horizon .grid-bg,
  .horizon .tag .dot,
  .pill .dot,
  [data-redirect-card] > div:first-child > span:first-child,
  .animate-ping {
    animation: none;
  }
  .scroll-reveal { opacity: 1; transform: none; transition: none; }
}
