/*
 * Jarvis Control design system.
 * CSP-safe: one same-origin stylesheet, no inline styles, no external fonts or images.
 * Dark is the default; light follows the OS unless the user picks a theme (html[data-theme]).
 */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --blur: saturate(160%) blur(18px);
  --grad-brand: linear-gradient(135deg, #c084fc 0%, #8b5cf6 32%, #6366f1 64%, #22d3ee 100%);
  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #6d28d9 45%, #4f46e5 100%);
  --grad-hero:
    radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, .22), transparent 52%),
    radial-gradient(90% 120% at 78% 112%, rgba(236, 72, 153, .22), transparent 56%),
    linear-gradient(135deg, #25145e 0%, #19194b 46%, #0b2541 100%);
  --on-dark: #f5f3ff;
  --on-dark-muted: rgba(232, 229, 255, .8);

  --bg: #070a15;
  --side: rgba(11, 15, 31, .74);
  --side-solid: #0b0f1f;
  --panel: rgba(19, 25, 47, .72);
  --panel-solid: #131a31;
  --panel-2: #1a2241;
  --dialog-bg: #111733;
  --input-bg: rgba(6, 9, 21, .6);
  --btn-bg: rgba(33, 41, 73, .72);
  --btn-hover: rgba(48, 58, 99, .9);
  --hover: rgba(139, 152, 255, .075);
  --track: rgba(148, 163, 255, .13);
  --table-head: rgba(148, 163, 255, .045);
  --code-bg: #0a0e1f;
  --code-text: #dfe3f6;
  --line: rgba(148, 163, 255, .13);
  --line-strong: rgba(148, 163, 255, .24);
  --text: #eef1fb;
  --muted: #a6aecb;
  --subtle: #8089aa;
  --accent: #8b5cf6;
  --lavender: #c4b5fd;
  --focus: #c4b5fd;
  --focus-ring: rgba(139, 92, 246, .3);
  --t-violet: #a78bfa;
  --t-green: #34d399;
  --t-cyan: #22d3ee;
  --t-amber: #fbbf24;
  --t-pink: #f472b6;
  --t-blue: #60a5fa;
  --t-rose: #fb7185;
  --t-slate: #94a3b8;
  --aurora-1: rgba(124, 58, 237, .3);
  --aurora-2: rgba(14, 165, 233, .18);
  --aurora-3: rgba(236, 72, 153, .14);
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .035), 0 12px 32px -12px rgba(2, 4, 18, .55);
  --shadow-2: 0 30px 80px -20px rgba(1, 3, 14, .7);
  --scroll-thumb: rgba(148, 163, 255, .26);
  --toast-bg: #1c2346;
  --toast-text: #f1f3fb;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5fb;
  --side: rgba(255, 255, 255, .78);
  --side-solid: #ffffff;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --panel-2: #f2f3fb;
  --dialog-bg: #ffffff;
  --input-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-hover: #f0f1fa;
  --hover: rgba(99, 102, 241, .06);
  --track: rgba(30, 41, 84, .09);
  --table-head: rgba(30, 41, 84, .035);
  --code-bg: #f5f6fc;
  --code-text: #1e2440;
  --line: rgba(30, 41, 84, .1);
  --line-strong: rgba(30, 41, 84, .18);
  --text: #141933;
  --muted: #4d5575;
  --subtle: #626a88;
  --accent: #7c3aed;
  --lavender: #6d28d9;
  --focus: #7c3aed;
  --focus-ring: rgba(124, 58, 237, .18);
  --t-violet: #6d28d9;
  --t-green: #047857;
  --t-cyan: #0e7490;
  --t-amber: #b45309;
  --t-pink: #be185d;
  --t-blue: #1d4ed8;
  --t-rose: #be123c;
  --t-slate: #475569;
  --aurora-1: rgba(139, 92, 246, .18);
  --aurora-2: rgba(56, 189, 248, .16);
  --aurora-3: rgba(244, 114, 182, .12);
  --shadow-1: 0 1px 2px rgba(20, 24, 60, .05), 0 12px 32px -14px rgba(20, 24, 60, .16);
  --shadow-2: 0 30px 80px -24px rgba(20, 24, 60, .3);
  --scroll-thumb: rgba(30, 41, 84, .24);
  --toast-bg: #141933;
  --toast-text: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f5fb;
    --side: rgba(255, 255, 255, .78);
    --side-solid: #ffffff;
    --panel: rgba(255, 255, 255, .86);
    --panel-solid: #ffffff;
    --panel-2: #f2f3fb;
    --dialog-bg: #ffffff;
    --input-bg: #ffffff;
    --btn-bg: #ffffff;
    --btn-hover: #f0f1fa;
    --hover: rgba(99, 102, 241, .06);
    --track: rgba(30, 41, 84, .09);
    --table-head: rgba(30, 41, 84, .035);
    --code-bg: #f5f6fc;
    --code-text: #1e2440;
    --line: rgba(30, 41, 84, .1);
    --line-strong: rgba(30, 41, 84, .18);
    --text: #141933;
    --muted: #4d5575;
    --subtle: #626a88;
    --accent: #7c3aed;
    --lavender: #6d28d9;
    --focus: #7c3aed;
    --focus-ring: rgba(124, 58, 237, .18);
    --t-violet: #6d28d9;
    --t-green: #047857;
    --t-cyan: #0e7490;
    --t-amber: #b45309;
    --t-pink: #be185d;
    --t-blue: #1d4ed8;
    --t-rose: #be123c;
    --t-slate: #475569;
    --aurora-1: rgba(139, 92, 246, .18);
    --aurora-2: rgba(56, 189, 248, .16);
    --aurora-3: rgba(244, 114, 182, .12);
    --shadow-1: 0 1px 2px rgba(20, 24, 60, .05), 0 12px 32px -14px rgba(20, 24, 60, .16);
    --shadow-2: 0 30px 80px -24px rgba(20, 24, 60, .3);
    --scroll-thumb: rgba(30, 41, 84, .24);
    --toast-bg: #141933;
    --toast-text: #ffffff;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Aurora backdrop: a fixed, viewport-sized layer that can never cause horizontal overflow. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48vw 42vh at 6% -8%, var(--aurora-1), transparent 70%),
    radial-gradient(42vw 46vh at 102% 2%, var(--aurora-2), transparent 70%),
    radial-gradient(52vw 50vh at 74% 110%, var(--aurora-3), transparent 72%);
  animation: aurora 16s ease-in-out infinite alternate;
}
button, input, select, textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); font-family: var(--font-display); }
h1 { margin-bottom: 8px; font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: 20px; font-weight: 650; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 15px; font-weight: 650; line-height: 1.4; }
p { color: var(--muted); }
a { color: var(--lavender); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { color: var(--text); font-weight: 650; }
code, kbd, pre { font-family: var(--mono); }
kbd {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
}
::selection { background: rgba(139, 92, 246, .35); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ico {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--lavender);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow .ico { width: 15px; height: 15px; }
.gradient-text {
  background: linear-gradient(90deg, #c4b5fd, #818cf8 45%, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-2);
}
.skip:focus { top: 16px; }

/* Semantic tones shared by icons, chips, cards and avatars. */
.tone-violet { --tone: var(--t-violet); }
.tone-green { --tone: var(--t-green); }
.tone-cyan { --tone: var(--t-cyan); }
.tone-amber { --tone: var(--t-amber); }
.tone-pink { --tone: var(--t-pink); }
.tone-blue { --tone: var(--t-blue); }
.tone-rose { --tone: var(--t-rose); }
.tone-slate { --tone: var(--t-slate); }

/* ---------- Buttons ---------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, box-shadow .2s, color .18s, filter .18s;
}
button .ico { width: 17px; height: 17px; }
button:hover { border-color: var(--line-strong); background: var(--btn-hover); transform: translateY(-1px); }
button:active { transform: translateY(0) scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.primary {
  border-color: transparent;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 22px -6px rgba(124, 58, 237, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.primary:hover {
  border-color: transparent;
  background: var(--grad-primary);
  filter: brightness(1.1) saturate(1.05);
  box-shadow: 0 12px 30px -6px rgba(124, 58, 237, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ghost { border-color: transparent; background: transparent; }
.ghost:hover { border-color: var(--line); background: var(--hover); }
.danger { color: var(--t-rose); }
.danger:hover {
  border-color: color-mix(in srgb, var(--t-rose) 35%, transparent);
  background: color-mix(in srgb, var(--t-rose) 12%, transparent);
  color: var(--t-rose);
}
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.icon-btn .ico { width: 19px; height: 19px; }
.small-btn { padding: 6px 11px; border-radius: 10px; font-size: 12.5px; }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
input[readonly] { background: var(--panel-2); font-family: var(--mono); font-size: 13px; }
textarea { min-height: 110px; resize: vertical; }
select {
  padding-right: 40px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  cursor: pointer;
}
select option { background: var(--panel-solid); color: var(--text); }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 12.5px; font-weight: 650; letter-spacing: .01em; }
label > input, label > select, label > textarea, label > .copy-field, label > .password-field { margin-top: 7px; }
label input, label select, label textarea { color: var(--text); font-weight: 400; }
.form-error { margin-top: 14px; color: var(--t-rose); font-size: 13px; font-weight: 600; white-space: pre-wrap; }
.form-error:empty { margin: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.password-field, .copy-field { position: relative; display: block; }
.password-field input { padding-right: 50px; }
.copy-field input { padding-right: 52px; }
.password-field .icon-btn, .copy-field .icon-btn { position: absolute; top: 50%; right: 4px; width: 36px; height: 36px; transform: translateY(-50%); }
.password-field .icon-btn:hover, .copy-field .icon-btn:hover { transform: translateY(-50%); }
.password-field .icon-btn:active, .copy-field .icon-btn:active { transform: translateY(-50%) scale(.94); }

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: var(--text);
  font: 700 19px/1.1 var(--font-display);
  letter-spacing: -.02em;
}
.brand small { display: block; margin-top: 5px; color: var(--subtle); font: 700 10px/1 var(--font); letter-spacing: .18em; }
.brand-orb {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--grad-brand);
  color: #fff;
  font: 800 23px/1 var(--font-display);
  box-shadow: 0 10px 26px -6px rgba(124, 58, 237, .6), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-orb::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, .34), transparent 46%);
  pointer-events: none;
}

/* ---------- Shell ---------- */
.layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--side);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.nav-title { margin: 26px 12px 10px; color: var(--subtle); font-size: 10.5px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 7px 10px 7px 7px;
  border-color: transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
}
.nav button:hover { background: var(--hover); color: var(--text); transform: none; }
.nav-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--tone, var(--t-violet)) 14%, transparent);
  color: var(--tone, var(--lavender));
  transition: background .2s, color .2s, box-shadow .2s, transform .3s var(--spring);
}
.nav button:hover .nav-ico { transform: scale(1.07) rotate(-5deg); }
.nav button.selected {
  border-color: color-mix(in srgb, var(--t-violet) 26%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--t-violet) 18%, transparent), color-mix(in srgb, var(--t-violet) 4%, transparent));
  color: var(--text);
}
.nav button.selected .nav-ico { background: var(--grad-primary); color: #fff; box-shadow: 0 8px 18px -6px rgba(124, 58, 237, .7); }
.nav button.selected::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--lavender);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--t-violet) 20%, transparent);
}
.sidebar-bottom { display: grid; gap: 14px; margin-top: auto; padding-top: 18px; }
.connection-note {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 14px 14px 14px 48px;
  border: 1px solid color-mix(in srgb, var(--t-green) 28%, transparent);
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t-green) 13%, transparent), color-mix(in srgb, var(--t-cyan) 6%, transparent));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.connection-note .ico { position: absolute; top: 14px; left: 14px; width: 22px; height: 22px; color: var(--t-green); }
.connection-note b { color: var(--t-green); font-size: 12.5px; }
.profile { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.profile > div { min-width: 0; }
.profile-name { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.profile-sub { color: var(--subtle); font-size: 11.5px; }
.profile button { margin-left: auto; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--avatar, var(--grad-primary));
  color: #fff;
  font: 700 14px/1 var(--font-display);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.avatar.tone-0 { --avatar: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.avatar.tone-1 { --avatar: linear-gradient(135deg, #db2777, #ea580c); }
.avatar.tone-2 { --avatar: linear-gradient(135deg, #0891b2, #2563eb); }
.avatar.tone-3 { --avatar: linear-gradient(135deg, #059669, #0891b2); }
.avatar.tone-4 { --avatar: linear-gradient(135deg, #d97706, #dc2626); }
.avatar.tone-5 { --avatar: linear-gradient(135deg, #a855f7, #db2777); }
.scrim { display: none; }
.main-column { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 70px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.menu-toggle, .topbar-brand { display: none; }
.topbar-brand { align-items: center; gap: 10px; font: 700 16px/1 var(--font-display); }
.topbar-brand .brand-orb { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: 13px; }
.breadcrumb .ico { width: 15px; height: 15px; }
.breadcrumb strong { color: var(--text); font-weight: 650; }
.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top-right .pill { text-transform: none; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 32px 36px 26px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-title { min-width: 0; }
.page-header h1 { margin-bottom: 6px; }
.page-header p { margin-bottom: 0; font-size: 14px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wave { display: inline-block; transform-origin: 70% 75%; }
.footer-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 2px 4px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 12px;
}
.version-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--t-violet) 13%, transparent);
  color: var(--lavender);
  font: 600 11px/1.6 var(--mono);
  letter-spacing: 0;
}
.version-tag:empty { display: none; }

/* ---------- Pills and chips ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid color-mix(in srgb, var(--pill, var(--muted)) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill, var(--muted)) 12%, transparent);
  color: var(--pill, var(--muted));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  text-transform: capitalize;
}
.pill.active, .pill.online, .pill.completed, .pill.succeeded, .pill.allowed, .pill.read-only { --pill: var(--t-green); }
.pill.pending, .pill.started, .pill.created, .pill.queued, .pill.mutating { --pill: var(--t-amber); }
.pill.disabled, .pill.error, .pill.failed, .pill.denied, .pill.rejected, .pill.cancelled, .pill.revoked { --pill: var(--t-rose); }
.pill.offline { --pill: var(--t-slate); }
.pill.installed, .pill.auto { --pill: var(--t-cyan); }
.pill.admin { --pill: var(--t-violet); }
.pill.user { --pill: var(--t-blue); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online .dot, .pill.active .dot, .dot.live { animation: ping 2.4s var(--ease) infinite; }
.dot.live { width: 8px; height: 8px; background: #34d399; color: #34d399; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone, var(--t-violet)) 12%, transparent);
  color: var(--tone, var(--lavender));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}
.count-chip .ico { width: 14px; height: 14px; color: var(--t-amber); }
.chip .ico { width: 14px; height: 14px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 236px;
  margin-bottom: 24px;
  padding: 34px 38px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 26px;
  background: var(--grad-hero);
  color: var(--on-dark);
  box-shadow: 0 30px 70px -32px rgba(76, 29, 149, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.hero::before, .auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(80% 90% at 85% 45%, #000, transparent 70%);
  mask-image: radial-gradient(80% 90% at 85% 45%, #000, transparent 70%);
  opacity: .6;
}
.hero-copy { position: relative; z-index: 1; max-width: min(560px, 62%); }
.hero .eyebrow { color: #c4b5fd; }
.hero h2 { margin-bottom: 12px; color: #fff; font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; }
.hero p { max-width: 480px; color: var(--on-dark-muted); font-size: 14px; }
.hero .button-row { margin-top: 18px; }
.hero .ghost { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #ede9fe; }
.hero .ghost:hover { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #e9e5ff;
  font-size: 12px;
  font-weight: 600;
}
.hero-chip .ico { width: 14px; height: 14px; color: #6ee7b7; }
.orbit { position: absolute; top: 50%; right: 9%; display: grid; place-items: center; width: 150px; height: 150px; transform: translateY(-50%); }
.orbit-ring { position: absolute; inset: 0; border: 1px solid rgba(196, 181, 253, .26); border-radius: 50%; }
.orbit-ring.r1 { inset: -30px; border-style: dashed; animation: spin 50s linear infinite; }
.orbit-ring.r2 { inset: -62px; border-color: rgba(103, 232, 249, .16); animation: spin 80s linear infinite reverse; }
.orbit .brand-orb {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  font-size: 44px;
  box-shadow: 0 0 0 10px rgba(139, 92, 246, .12), 0 0 70px rgba(139, 92, 246, .55);
  animation: float 6s ease-in-out infinite;
}
.orbit-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(22, 18, 54, .78);
  color: #ddd6fe;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
  animation: float 7s ease-in-out infinite;
}
.orbit-node .ico { width: 18px; height: 18px; }
.orbit-node.n1 { top: -8px; right: -14px; }
.orbit-node.n2 { top: 92px; left: -42px; border-color: rgba(110, 231, 183, .3); color: #6ee7b7; animation-delay: -2.3s; }
.orbit-node.n3 { right: 6px; bottom: -42px; border-color: rgba(103, 232, 249, .3); color: #67e8f9; animation-delay: -4.6s; }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.metric::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tone) 30%, transparent), transparent 70%);
  pointer-events: none;
}
.metric:hover {
  border-color: color-mix(in srgb, var(--tone) 42%, transparent);
  box-shadow: var(--shadow-1), 0 16px 36px -14px color-mix(in srgb, var(--tone) 45%, transparent);
  transform: translateY(-3px);
}
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--tone) 15%, transparent);
  color: var(--tone);
}
.metric-value { margin-top: 12px; font: 700 38px/1.05 var(--font-display); letter-spacing: -.03em; }
.metric-caption { margin-top: 6px; color: var(--subtle); font-size: 12.5px; }
.meter, .progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--track); }
.meter { margin-top: 12px; }
.meter > span, .progress-track > span {
  display: block;
  width: calc(var(--value, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tone, var(--t-violet)), color-mix(in srgb, var(--tone, var(--t-violet)) 55%, #67e8f9));
  transition: width .9s var(--ease);
}
.progress-track > span { background: linear-gradient(90deg, #34d399, #22d3ee); }

/* ---------- Panels, tables and feeds ---------- */
.panel {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-header > button { flex-shrink: 0; }
.panel-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-header p { margin: 2px 0 0; font-size: 12.5px; }
.bubble {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
}
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; white-space: nowrap; }
th { padding: 12px 22px; background: var(--table-head); color: var(--subtle); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 14px 22px; border-top: 1px solid var(--line); }
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: var(--hover); }
.cell-title { display: flex; align-items: center; gap: 12px; }
.cell-title strong { display: block; font-weight: 650; }
.cell-title small { display: block; max-width: 280px; margin-top: 1px; overflow: hidden; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; }
.device-icon {
  --tone: var(--t-slate);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--tone) 26%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  color: var(--tone);
}
.device-icon.online { --tone: var(--t-green); box-shadow: 0 0 20px -5px color-mix(in srgb, var(--t-green) 60%, transparent); }
.device-icon.disabled { --tone: var(--t-rose); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions button { padding: 7px 11px; font-size: 12.5px; }
.feed { margin: 0; padding: 6px 0; list-style: none; }
.feed-row { display: flex; align-items: center; gap: 14px; padding: 12px 22px; transition: background-color .15s; }
.feed-row + .feed-row { border-top: 1px solid var(--line); }
.feed-row:hover { background: var(--hover); }
.feed-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
}
.feed-icon .ico { width: 17px; height: 17px; }
.feed-main { flex: 1; min-width: 0; }
.feed-main strong { display: block; overflow: hidden; font: 600 13px/1.45 var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.feed-main small { color: var(--subtle); font-size: 12px; }
.feed-row .pill { margin-left: auto; }
.steps-progress { padding: 16px 22px 2px; }
.steps { margin: 0; padding: 8px 0 12px; list-style: none; }
.step { position: relative; display: flex; gap: 14px; padding: 12px 22px; }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 50px;
  bottom: -6px;
  left: 38px;
  width: 2px;
  border-radius: 2px;
  background: var(--line-strong);
}
.step.done:not(:last-child)::before { background: linear-gradient(var(--t-green), var(--line-strong)); }
.step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--t-violet) 34%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--t-violet) 14%, var(--panel-solid));
  color: var(--lavender);
  font: 700 13px/1 var(--font-display);
}
.step.done .step-number { border-color: transparent; background: linear-gradient(135deg, #6ee7b7, #10b981); color: #052e1c; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .7); }
.step-number .ico { width: 17px; height: 17px; stroke-width: 2.6; }
.step-body { min-width: 0; padding-top: 5px; }
.step h3 { margin: 0 0 2px; font-size: 14px; }
.step.done h3 { color: var(--muted); }
.step p { margin: 0; font-size: 13px; }
.step .small-btn { margin-top: 9px; }

/* ---------- Tool catalog ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.toolbar-controls { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.search { position: relative; flex: 1; max-width: 440px; }
.search .ico { position: absolute; top: 50%; left: 14px; color: var(--subtle); transform: translateY(-50%); pointer-events: none; }
.search input { height: 46px; padding-left: 44px; border-radius: 14px; background: var(--panel); }
.policy-filter { display: flex; align-items: center; gap: 10px; margin: 0; white-space: nowrap; }
.policy-filter select { width: auto; min-width: 150px; height: 46px; margin: 0; border-radius: 14px; background-color: var(--panel); }
.result-count { color: var(--subtle); font-size: 12.5px; font-weight: 600; }
.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t-violet) 10%, var(--panel-solid)), var(--panel));
  box-shadow: var(--shadow-1);
}
.bulk-selection, .tool-card-actions { display: flex; align-items: center; gap: 12px; }
.tool-select-all { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.bulk-toolbar input[type=checkbox], .tool-checkbox { width: 18px; height: 18px; margin: 0; padding: 0; flex-shrink: 0; appearance: auto; accent-color: var(--accent); cursor: pointer; }
.selection-count { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; }
.bulk-hint { flex-basis: 100%; margin: 0; color: var(--subtle); font-size: 12.5px; line-height: 1.5; }
.bulk-preview { margin: 0 0 6px; padding-left: 22px; overflow-wrap: anywhere; color: var(--text); font-family: var(--mono); font-size: 12.5px; }
.bulk-preview li { margin: 3px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.tool-card {
  --tone: var(--t-violet);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 204px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.tool-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--tone), transparent 85%); opacity: .9; }
.tool-card:hover {
  border-color: color-mix(in srgb, var(--tone) 45%, transparent);
  box-shadow: var(--shadow-1), 0 16px 36px -16px color-mix(in srgb, var(--tone) 55%, transparent);
  transform: translateY(-3px);
}
.tool-card.is-selected {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 15%, var(--panel-solid)), var(--panel));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 14px 34px -14px rgba(124, 58, 237, .5);
}
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
}
.tool-card h3 { margin: 4px 0 0; font: 600 13.5px/1.45 var(--mono); overflow-wrap: anywhere; }
.tool-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  white-space: normal;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.tool-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.tool-card footer button { padding: 7px 10px; font-size: 12.5px; }
.cat-computer { --tone: var(--t-cyan); }
.cat-browser { --tone: var(--t-blue); }
.cat-filesystem, .cat-workspace { --tone: var(--t-amber); }
.cat-process, .cat-unified-exec { --tone: var(--t-green); }
.cat-visualize, .cat-image-gen { --tone: var(--t-pink); }
.cat-session, .cat-threads { --tone: var(--t-violet); }
.cat-audit { --tone: var(--t-rose); }
:where(.tool-detail-head) { --tone: var(--t-violet); }
.tool-detail-head { display: flex; align-items: flex-start; gap: 14px; margin-top: 14px; }
.tool-detail-head .tool-icon { flex-shrink: 0; }
.tool-detail-head p { margin: 0 0 10px; }
.tool-detail-head .button-row { gap: 6px; }

/* ---------- Empty states and notices ---------- */
.empty { display: flex; flex-direction: column; align-items: center; padding: 52px 24px; text-align: center; }
.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--t-violet) 30%, transparent);
  border-radius: 24px;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--t-violet) 30%, transparent), color-mix(in srgb, var(--t-cyan) 10%, transparent) 70%);
  color: var(--lavender);
}
.empty-art::after { content: ""; position: absolute; inset: -9px; border: 1px dashed color-mix(in srgb, var(--t-violet) 32%, transparent); border-radius: 30px; }
.empty-art .ico { width: 32px; height: 32px; stroke-width: 1.6; }
.empty h3 { margin-bottom: 6px; font-size: 17px; }
.empty p { max-width: 440px; margin: 0 auto 18px; font-size: 13.5px; }
.notice {
  --tone: var(--t-amber);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 16px 0;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--tone) 9%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.notice > .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--tone); }
.notice.info { --tone: var(--t-violet); }
.notice.warn { --tone: var(--t-amber); }
.success-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--t-green) 32%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--t-green) 12%, transparent);
  color: var(--text);
  font-size: 13.5px;
}
.success-banner .ico { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: #34d399; color: #052e1c; stroke-width: 2.8; }

/* ---------- Authentication and consent ---------- */
.auth-shell { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 36px 22px; }
.floating-theme { position: absolute; top: 20px; right: 20px; z-index: 2; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  width: 100%;
  max-width: 1100px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 660px;
  padding: 44px 46px;
  overflow: hidden;
  background: var(--grad-hero);
  color: var(--on-dark);
}
.auth-story .brand { padding: 0; color: #fff; }
.auth-story .brand small { color: rgba(226, 222, 255, .72); }
.auth-story h1 { max-width: 420px; margin: 44px 0 16px; color: #fff; font-size: 46px; line-height: 1.06; letter-spacing: -.035em; }
.auth-story h1 em {
  background: linear-gradient(90deg, #c4b5fd, #818cf8 45%, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}
.auth-story > p { max-width: 390px; color: var(--on-dark-muted); font-size: 14.5px; }
.auth-story .orbit { top: 44px; right: 58px; width: 92px; height: 92px; transform: none; }
.auth-story .orbit .brand-orb { width: 54px; height: 54px; border-radius: 17px; font-size: 30px; }
.auth-story .orbit-ring.r1 { inset: -18px; }
.auth-story .orbit-ring.r2 { inset: -38px; }
.auth-story .orbit-node { width: 30px; height: 30px; border-radius: 10px; }
.auth-story .orbit-node .ico { width: 15px; height: 15px; }
.auth-story .orbit-node.n1 { top: -14px; right: -22px; }
.auth-story .orbit-node.n2 { top: 58px; left: -34px; }
.feature-list { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 12px; color: var(--on-dark-muted); font-size: 13px; line-height: 1.45; }
.feature-list b { display: block; color: #fff; font-size: 14px; }
.feature-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #c4b5fd;
}
.feature-ico.green { color: #6ee7b7; }
.feature-ico.cyan { color: #67e8f9; }
.story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  color: rgba(226, 222, 255, .62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}
.story-footer .version-tag { background: rgba(255, 255, 255, .1); color: #ddd6fe; }
.auth-card { display: flex; flex-direction: column; justify-content: center; width: 100%; padding: 50px 46px; }
.auth-shell > .auth-card {
  max-width: 540px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.auth-card > .brand-orb { margin-bottom: 22px; }
.auth-card h1 { margin: 2px 0 8px; font-size: 30px; }
.auth-card > p { font-size: 14px; }
.auth-card form > .primary { width: 100%; height: 48px; margin-top: 24px; font-size: 14.5px; }
.auth-card .button-row { margin-top: 24px; }
.auth-switch { margin: 22px 0 0; font-size: 13.5px; text-align: center; }
.auth-switch button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--lavender);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.auth-switch button:hover { background: none; text-decoration-color: currentColor; transform: none; }
.auth-notice {
  display: flex;
  gap: 11px;
  margin-top: 22px;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--t-violet) 24%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--t-violet) 8%, transparent);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.auth-notice .ico { color: var(--lavender); }
.auth-card > .small { margin: 14px 0 0; }
.consent-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.consent-link { position: relative; width: 60px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
.consent-link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 12px #22d3ee;
  transform: translate(-50%, -50%);
  animation: travel 2.4s var(--ease) infinite;
}
.client-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--panel-2);
  color: var(--text);
  font: 700 18px/1 var(--font-display);
}
.consent-perms { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.consent-perms li {
  position: relative;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
}
.consent-perms li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16.5 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translateY(-50%);
}

/* ---------- Dialogs ---------- */
dialog {
  width: min(660px, calc(100vw - 28px));
  max-height: min(88vh, 920px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: var(--shadow-2);
}
dialog[open] { animation: dialog-in .34s var(--spring); }
dialog::backdrop { background: rgba(3, 5, 16, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--dialog-bg);
}
.modal-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-brand); }
.modal-header h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.modal-body { padding: 8px 24px 22px; }
.modal-body > p:first-child { margin-top: 12px; }
.modal-body h3 { margin: 20px 0 8px; }
.modal-body pre {
  max-height: 340px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--dialog-bg);
}
.endpoint { position: relative; margin: 14px 0 4px; }
.endpoint pre { padding-right: 58px; color: var(--lavender); font-size: 13.5px; }
.endpoint .icon-btn { position: absolute; top: 6px; right: 6px; }
.endpoint .icon-btn:hover { transform: none; }
.snippets { display: grid; gap: 10px; }
.snippet { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.snippet-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--text); font-size: 13.5px; }
.snippet-head .ico { width: 17px; height: 17px; color: var(--lavender); }
.snippet-head button { margin-left: auto; }
.snippet code {
  display: block;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.snippet p { margin: 0; font-size: 13px; }
.gate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 6px; }
.gate {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--tone) 8%, transparent);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.gate .ico { width: 22px; height: 22px; margin-bottom: 6px; color: var(--tone); }
.gate b { color: var(--text); font-size: 13.5px; }

/* ---------- Toast and loading ---------- */
.toast {
  --toast-tone: #a78bfa;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e1065' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 11v6M12 7.2v.1'/%3E%3C/svg%3E");
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 24px) scale(.96);
  transition: opacity .25s, transform .35s var(--spring);
}
.toast::before { content: ""; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--toast-icon) center / 16px no-repeat, var(--toast-tone); }
.toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.success {
  --toast-tone: #34d399;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052e1c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8.5'/%3E%3C/svg%3E");
}
.toast.error {
  --toast-tone: #fb7185;
  --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c0519' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6.5v7M12 17.3v.1'/%3E%3C/svg%3E");
}
.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100vh; color: var(--muted); font-weight: 600; }
.loader { position: relative; display: grid; place-items: center; width: 92px; height: 92px; }
.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: #8b5cf6;
  border-right-color: #22d3ee;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader .brand-orb { width: 56px; height: 56px; border-radius: 18px; font-size: 30px; animation: breathe 2s ease-in-out infinite; }

/* ---------- Motion ---------- */
.page-enter > * { animation: rise .5s var(--ease) backwards; }
.page-enter > :nth-child(2) { animation-delay: .05s; }
.page-enter > :nth-child(3) { animation-delay: .1s; }
.page-enter > :nth-child(4) { animation-delay: .15s; }
.page-enter > :nth-child(5) { animation-delay: .2s; }
.page-enter > :nth-child(n+6) { animation-delay: .25s; }
.page-enter .metric, .page-enter .tool-card { animation: rise .5s var(--ease) backwards; }
.page-enter .metric:nth-child(2), .page-enter .tool-card:nth-child(2) { animation-delay: .14s; }
.page-enter .metric:nth-child(3), .page-enter .tool-card:nth-child(3) { animation-delay: .2s; }
.page-enter .metric:nth-child(4), .page-enter .tool-card:nth-child(4) { animation-delay: .26s; }
.page-enter .tool-card:nth-child(n+5) { animation-delay: .3s; }
.page-enter .wave { animation: wave 2.4s ease-in-out .6s 1; }
.page-enter .empty-art { animation: float 5s ease-in-out infinite; }
@keyframes aurora { from { opacity: .7; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes breathe { 50% { opacity: .82; transform: scale(.94); } }
@keyframes travel { from { left: 0; } to { left: 100%; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

/* ---------- Responsive ---------- */
@media (min-width: 1500px) {
  .content { padding-top: 38px; }
  .hero { min-height: 252px; }
}
@media (max-width: 1280px) {
  .layout { grid-template-columns: 244px minmax(0, 1fr); }
  .topbar { padding: 0 28px; }
  .content { padding: 28px 28px 24px; }
}
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { max-width: 64%; }
  .orbit { right: 7%; }
}
@media (max-width: 900px) {
  .gate-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-story h1 { font-size: 38px; }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 86vw);
    height: auto;
    background: var(--side-solid);
    transform: translateX(-105%);
    transition: transform .32s var(--ease);
  }
  .sidebar.open { box-shadow: 30px 0 90px rgba(0, 0, 0, .45); transform: none; }
  .sidebar.open + .scrim {
    position: fixed;
    inset: 0;
    z-index: 9;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(3, 5, 16, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    transform: none;
  }
  .menu-toggle, .topbar-brand { display: inline-flex; }
  .topbar { gap: 12px; height: 62px; padding: 0 16px; }
  .breadcrumb, .top-right .pill { display: none; }
  .content { padding: 22px 16px 20px; }
  h1 { font-size: 28px; }
  .page-header { align-items: flex-start; }
  .hero { min-height: 0; padding: 26px 22px; }
  .hero-copy { max-width: 100%; }
  .hero h2 { font-size: 24px; }
  .hero .orbit { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-controls { flex-direction: column; align-items: stretch; width: 100%; }
  .search { max-width: none; }
  .policy-filter { flex-direction: column; align-items: flex-start; gap: 6px; }
  .policy-filter select { width: 100%; }
  td, th { padding: 12px 16px; }
  .auth-layout { display: block; max-width: 480px; }
  .auth-story { display: none; }
  .auth-card { padding: 34px 26px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .footer-note span:nth-child(2) { display: none; }
}
@media (max-width: 520px) {
  .metrics { gap: 12px; }
  .metric { padding: 16px; }
  .metric-value { font-size: 31px; }
  .page-header .button-row, .bulk-toolbar .button-row { width: 100%; }
  .page-header .button-row button, .bulk-toolbar .button-row button, .modal-actions button { flex: 1 1 auto; }
  .bulk-toolbar { padding: 14px; }
  .bulk-selection { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
