/* Staff Dashboard: futuristic theme built on the logo's blues. */
:root {
  --bg: #040914;
  --bg-2: #07122a;
  --panel: rgba(12, 26, 54, 0.62);
  --panel-solid: #0b1a36;
  --panel-2: rgba(30, 64, 120, 0.22);
  --border: rgba(84, 164, 255, 0.16);
  --border-strong: rgba(84, 164, 255, 0.38);
  --text: #e8f1ff;
  --muted: #8fa6c9;
  --accent: #2b8cff;
  --accent-2: #0d47a1;
  --cyan: #4fd1ff;
  --accent-soft: rgba(43, 140, 255, 0.14);
  --accent-text: #ffffff;
  --grad: linear-gradient(135deg, #1565c0 0%, #2b8cff 55%, #4fd1ff 100%);
  /* Behind white text: dark enough for at least 4.5:1 contrast everywhere. */
  --grad-solid: linear-gradient(135deg, #0d47a1 0%, #1565c0 55%, #1976d2 100%);
  --focus: #9fd4ff;
  --grad-text: linear-gradient(90deg, #ffffff 0%, #9fd4ff 45%, #4fd1ff 100%);
  --good: #33e0a1;
  --good-soft: rgba(51, 224, 161, 0.12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.12);
  --bad: #ff5c7a;
  --bad-soft: rgba(255, 92, 122, 0.12);
  --glow: 0 0 0 1px rgba(84, 164, 255, 0.12), 0 8px 32px rgba(3, 10, 30, 0.55), 0 0 40px rgba(43, 140, 255, 0.06);
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: dark;
}

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/fonts/space-grotesk.woff2") format("woff2"); }

* { box-sizing: border-box; }

/* Keyboard users always see where they are. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: 10px; background: var(--panel-solid); color: var(--text); border: 1px solid var(--border-strong); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(43, 140, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(13, 71, 161, 0.35), transparent 60%),
    radial-gradient(600px 500px at 60% 110%, rgba(79, 209, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* Faint grid that fades out toward the bottom. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(84, 164, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 164, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}

::selection { background: rgba(43, 140, 255, 0.4); }

a { color: var(--cyan); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gradient-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: rgba(4, 9, 20, 0.7);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 209, 255, 0.6), transparent);
}
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; letter-spacing: 0.01em; }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px var(--border-strong), 0 0 18px rgba(43, 140, 255, 0.45); }
.brand .tag { font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 8px; }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--border); }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 1px var(--border-strong), 0 0 24px rgba(43, 140, 255, 0.25); }
.avatar.fallback { display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #cfe6ff; background: linear-gradient(135deg, rgba(21, 101, 192, 0.6), rgba(79, 209, 255, 0.35)); }
@media (max-width: 520px) {
  .user span:last-child, .brand .tag { display: none; }
}

/* ---------- layout ---------- */
.page { max-width: 1140px; margin: 0 auto; padding: 28px 16px 72px; }
.page-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div { flex: 1 1 260px; }
.page-head p { margin: 0; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.layout > * { min-width: 0; }
html, body { overflow-x: clip; }
.sidenav {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px;
  padding: 8px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.sidenav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.sidenav a svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.sidenav a:hover { background: var(--panel-2); color: var(--text); }
.sidenav a.active { background: linear-gradient(90deg, rgba(43, 140, 255, 0.22), rgba(43, 140, 255, 0.04)); color: #fff; }
.sidenav a.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--grad); box-shadow: 0 0 12px rgba(79, 209, 255, 0.8);
}
.sidenav a.active svg { color: var(--cyan); opacity: 1; }
.sidenav .dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.guild-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.guild-head h1 { margin: 0; }
.guild-head .sub { font-size: 13px; color: var(--muted); }
.back { font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); letter-spacing: 0.02em; }
.back:hover { color: var(--cyan); }

@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .sidenav::-webkit-scrollbar { display: none; }
  .sidenav a { white-space: nowrap; }
  .sidenav a.active::before { left: 10px; right: 10px; top: auto; bottom: -1px; width: auto; height: 2px; }
  .sidenav .dot { display: none; }
}

/* ---------- cards & forms ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--glow);
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  margin-bottom: 16px;
  animation: rise 0.35s ease both;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%);
}
.card.narrow { max-width: 480px; text-align: center; }
.card > h2 + p { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid-cards > .card { margin-bottom: 0; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
select, input[type="text"], input[type="number"], input[type="date"], textarea {
  font: inherit; color: var(--text);
  background: rgba(4, 12, 28, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; min-width: 0; max-width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:hover, input:hover { border-color: var(--border-strong); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 140, 255, 0.25), 0 0 18px rgba(43, 140, 255, 0.25); }
select option, select optgroup { background: var(--panel-solid); color: var(--text); }
input[type="number"] { width: 80px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
input:disabled { opacity: 0.35; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: rgba(43, 140, 255, 0.08); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(43, 140, 255, 0.16); border-color: var(--accent); box-shadow: 0 0 18px rgba(43, 140, 255, 0.25); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-solid); border-color: transparent; color: #fff; box-shadow: 0 4px 18px rgba(43, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn.primary:hover { box-shadow: 0 6px 26px rgba(43, 140, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.btn.danger { color: var(--bad); border-color: rgba(255, 92, 122, 0.35); background: var(--bad-soft); }
.btn.danger:hover { border-color: var(--bad); box-shadow: 0 0 18px rgba(255, 92, 122, 0.25); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.btn.discord { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; }

/* ---------- sub sections, permissions, logging ---------- */
.sub-head { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.role-chip { padding-right: 10px; }
.role-chip .via { font-size: 11px; color: var(--cyan); border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 6px; }
.perm-table th.center, .perm-table td.center { text-align: center; }
.perm-table th { white-space: normal; min-width: 74px; }
.perm-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; margin: 0 0 16px; }
.perm-legend div { display: flex; flex-direction: column; }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid rgba(84, 164, 255, 0.08); vertical-align: middle; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(43, 140, 255, 0.05); }
tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--muted); vertical-align: middle; box-shadow: 0 0 8px currentColor; }
.person { display: flex; align-items: center; gap: 10px; }

/* ---------- status bits ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: rgba(51, 224, 161, 0.3); }
.badge.good::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(255, 181, 71, 0.3); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 92, 122, 0.3); }
.check { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(84, 164, 255, 0.08); align-items: flex-start; }
.check:last-child { border-bottom: 0; }
.check .icon { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.icon.good { background: var(--good-soft); color: var(--good); box-shadow: 0 0 12px rgba(51, 224, 161, 0.25); }
.icon.bad { background: var(--bad-soft); color: var(--bad); box-shadow: 0 0 12px rgba(255, 92, 122, 0.3); }
.icon.info { background: var(--panel-2); color: var(--muted); }
.notice { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 14px; border: 1px solid; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(255, 181, 71, 0.3); }
.notice.info { background: var(--accent-soft); color: var(--text); border-color: var(--border-strong); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--glow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rise 0.35s ease both;
}
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(43, 140, 255, 0.28), transparent 70%); }
.stat .value { font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.choice { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; background: rgba(4, 12, 28, 0.45); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.choice:hover { border-color: var(--border-strong); }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(43, 140, 255, 0.2); }
.choice input { margin-top: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--border-strong); font-size: 13px; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 7px; border-radius: 50%; }
.chip button:hover { color: var(--bad); background: var(--bad-soft); }

.server-card { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; color: var(--text); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.server-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--glow), 0 0 32px rgba(43, 140, 255, 0.28); }
.server-card h3 { margin-bottom: 6px; }
.server-card .arrow { margin-left: auto; color: var(--muted); font-size: 20px; transition: transform 0.2s, color 0.2s; }
.server-card:hover .arrow { color: var(--cyan); transform: translateX(3px); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: rgba(8, 18, 40, 0.92); border: 1px solid; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  max-width: calc(100% - 32px); animation: toast-in 0.25s ease both;
}
.toast.good { color: var(--good); border-color: rgba(51, 224, 161, 0.45); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(51, 224, 161, 0.2); }
.toast.bad { color: var(--bad); border-color: rgba(255, 92, 122, 0.45); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(255, 92, 122, 0.2); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.loading { padding: 64px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.loading::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--cyan); animation: spin 0.8s linear infinite; }

/* ---------- landing & error pages ---------- */
.centered { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.error-logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 14px; box-shadow: 0 0 30px rgba(43, 140, 255, 0.45); }

.hero { position: relative; max-width: 820px; margin: 0 auto; padding: 72px 16px 56px; text-align: center; }
.hero-logo { position: relative; width: 168px; height: 168px; margin: 0 auto 30px; animation: float 6s ease-in-out infinite; }
.hero-logo img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 36px; object-fit: cover; box-shadow: 0 0 0 1px rgba(79, 209, 255, 0.35), 0 20px 60px rgba(4, 30, 80, 0.7), 0 0 70px rgba(43, 140, 255, 0.45); }
.hero-logo::before {
  content: ""; position: absolute; inset: -14px; border-radius: 46px; z-index: 0;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(79, 209, 255, 0.9) 60deg, transparent 140deg, rgba(43, 140, 255, 0.7) 240deg, transparent 320deg);
  filter: blur(10px); opacity: 0.8; animation: spin 7s linear infinite;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--border-strong); background: rgba(43, 140, 255, 0.08); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 2s ease-in-out infinite; }
.hero h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.05; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 600px; margin: 0 auto 32px; }
.hero p.note { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.features { max-width: 1040px; margin: 0 auto; padding: 0 16px 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.features .card { margin: 0; text-align: left; transition: transform 0.2s, border-color 0.2s; }
.features .card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.features .card:nth-child(2) { animation-delay: 0.06s; }
.features .card:nth-child(3) { animation-delay: 0.12s; }
.features .card:nth-child(4) { animation-delay: 0.18s; }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: var(--grad-solid); box-shadow: 0 0 22px rgba(43, 140, 255, 0.45); }
.feature-icon svg { width: 22px; height: 22px; }
.features .card h3 { margin-bottom: 6px; }
.features .card p { color: var(--muted); font-size: 14px; margin: 0; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 40px; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- landing page sections ---------- */
.top-links { display: flex; gap: 4px; margin-left: 12px; }
.top-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.top-links a:hover { color: var(--text); background: var(--panel-2); }
@media (max-width: 760px) { .top-links { display: none; } }

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.ghost { background: rgba(43, 140, 255, 0.06); }
.hero .note a { color: var(--cyan); }
.highlights { list-style: none; padding: 0; margin: 44px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 760px; }
.highlights li { display: flex; flex-direction: column; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.highlights strong { font-family: var(--display); font-size: 18px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.highlights span { font-size: 13px; color: var(--muted); }
@media (max-width: 620px) { .highlights { grid-template-columns: repeat(2, 1fr); } }

.section-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.1; margin-bottom: 12px; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 32px; }
.section-head p { font-size: 16px; }
main > section { scroll-margin-top: 80px; }

.showcase { max-width: 1080px; margin: 40px auto 96px; padding: 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.showcase-copy p { font-size: 16px; }
.checks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--good); background: var(--good-soft); box-shadow: 0 0 12px rgba(51, 224, 161, 0.25); }
@media (max-width: 860px) { .showcase { grid-template-columns: 1fr; gap: 28px; } }

.mock-stack { position: relative; display: grid; gap: 16px; }
.mock-embed { position: relative; background: #2b2d31; border-radius: 8px; padding: 14px 16px 14px 20px; color: #dbdee1; font-size: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05); }
.mock-embed::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 8px 0 0 8px; background: #57f287; }
.mock-embed.loa { margin-left: 32px; }
.mock-embed.loa::before { background: #5865f2; }
.mock-author { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; color: #fff; }
.mock-avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: linear-gradient(135deg, #1565c0, #4fd1ff); color: #fff; }
.mock-title { font-weight: 700; color: #fff; margin-bottom: 10px; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.mock-grid div { display: flex; flex-direction: column; }
.mock-grid .wide { grid-column: 1 / -1; }
.mock-grid span { font-size: 12px; font-weight: 700; color: #fff; }
.mock-buttons { display: flex; gap: 8px; margin-top: 12px; }
.mock-buttons span { font-size: 13px; font-weight: 600; color: #fff; padding: 6px 14px; border-radius: 4px; }
.mock-buttons .ok { background: #248046; }
.mock-buttons .no { background: #da373c; }
.mock-caption { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }

.features-section, .how, .commands-section, .faq { max-width: 1100px; margin: 0 auto 96px; padding: 0 16px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.feature { margin: 0; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--glow), 0 0 32px rgba(43, 140, 255, 0.18); }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: rgba(43, 140, 255, 0.12); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: #cfe6ff; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: none; }
.steps .card { margin: 0; padding-top: 28px; }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-family: var(--display); font-weight: 700; font-size: 18px; color: #fff; background: var(--grad-solid); box-shadow: 0 0 22px rgba(43, 140, 255, 0.45); margin-bottom: 14px; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.command-cloud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 820px; margin: 0 auto; }
.command-cloud code { font-size: 14px; padding: 8px 14px; border-radius: 10px; box-shadow: 0 0 18px rgba(43, 140, 255, 0.1); }

.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq-list .card { margin: 0; padding: 0; }
.faq-list summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--cyan); font-size: 20px; line-height: 1; transition: transform 0.2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 22px 18px; margin: 0; color: var(--muted); }

.final-cta { max-width: 860px; margin: 0 auto 72px; text-align: center; padding: 48px 24px; overflow: hidden; }
.final-cta::after { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%; background: radial-gradient(ellipse at 50% 100%, rgba(43, 140, 255, 0.3), transparent 60%); pointer-events: none; }
.final-cta img { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 16px; box-shadow: 0 0 36px rgba(43, 140, 255, 0.5); }
.final-cta .cta-row { position: relative; z-index: 1; margin-top: 20px; }
@media (max-width: 880px) { .final-cta { margin-left: 16px; margin-right: 16px; } }

.site-footer { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding: 28px 16px 44px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }

/* ---------- bot owner page ---------- */
.owner-link { border-color: rgba(255, 181, 71, 0.45); color: var(--warn); background: var(--warn-soft); }
.owner-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.owner-grid > .card { margin-bottom: 16px; }
@media (max-width: 860px) { .owner-grid { grid-template-columns: minmax(0, 1fr); } }
textarea { font: inherit; color: var(--text); background: rgba(4, 12, 28, 0.7); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; resize: vertical; width: 100%; min-height: 140px; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 140, 255, 0.25); }
label.field input[type="text"] { width: 100%; }
.mock-embed.announce::before { background: #2b8cff; }
.mock-embed .mock-avatar { object-fit: cover; }
.pv-body { white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }
.pv-foot { font-size: 12px; color: #b5bac1; }
.job { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(4, 12, 28, 0.5); display: grid; gap: 10px; }
.progress { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad); box-shadow: 0 0 12px rgba(79, 209, 255, 0.6); transition: width 0.4s ease; }
.recipients summary { cursor: pointer; font-weight: 600; }
.recipients .table-wrap { margin-top: 12px; }

/* ---------- department leadership ---------- */
.positions { display: grid; gap: 8px; }
.position-row { display: grid; grid-template-columns: 26px minmax(110px, 1fr) minmax(130px, 1.2fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.position-row input[type="text"], .position-row select { width: 100%; }
.pos-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--cyan); }
.holders { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-chip { padding: 4px 12px 4px 4px; margin-bottom: 8px; }
.leader-chip .via { font-size: 11px; font-weight: 700; color: #fff; background: var(--grad-solid); border-radius: 999px; padding: 1px 8px; margin-right: 2px; }
@media (max-width: 640px) {
  .position-row { grid-template-columns: 26px 1fr auto auto; }
  .position-row select { grid-column: 2 / -1; }
  .position-row .holders { grid-column: 2 / -1; }
}

.dept-channel { margin-bottom: 14px; }

/* ---------- charts ---------- */
.viz-root { --series-1: #3987e5; --series-2: #d95926; --grid: rgba(143, 166, 201, 0.14); }
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid { stroke: var(--grid); stroke-width: 1; }
.viz .axis { stroke: rgba(143, 166, 201, 0.35); stroke-width: 1; }
.viz .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz .label { fill: var(--text); font-size: 12px; font-family: var(--font); }
.viz .value { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.viz .bar.s1 { fill: var(--series-1); }
.viz .bar.s2 { fill: var(--series-2); }
.viz .bar.past { opacity: 0.6; }
.viz .quota-mark { stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.viz .hit { fill: transparent; cursor: default; }
.viz .hit:hover { fill: rgba(143, 166, 201, 0.06); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.swatch.quota { width: 2px; height: 14px; border-radius: 1px; background: var(--text); }
.viz-tip { position: fixed; z-index: 40; pointer-events: none; background: rgba(8, 18, 40, 0.96); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.viz-tip .tip-title { font-weight: 700; margin-bottom: 2px; }
.viz-tip .tip-line { color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-toolbar { margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.seg-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--accent-soft); color: #fff; }
.table-card summary { cursor: pointer; font-weight: 600; }
.table-card .table-wrap { margin-top: 12px; }
.stat .value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- quotas & task settings ---------- */
.quota-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.quota-form select, .quota-form input { width: 100%; }
td.actions { gap: 6px; flex-wrap: nowrap; }
.progress-list { display: grid; gap: 12px; }
.progress-row { display: grid; gap: 6px; }
.progress-fill.done { background: linear-gradient(90deg, #1f9d6e, var(--good)); }
.question-row { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 8px; align-items: center; }
.question-row input[type="text"] { width: 100%; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- feedback dialog & owner extras ---------- */
.feedback-btn { white-space: nowrap; }
@media (max-width: 720px) { .feedback-btn { display: none; } }
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 16, 0.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.modal { width: min(520px, 100%); margin: 0; }
.modal textarea, .modal select { width: 100%; }
.mock-embed.update::before { background: #33e0a1; }
.mock-buttons .neutral { background: #4e5058; }
.hook { padding: 12px 0; border-top: 1px solid var(--border); }
.hook input { flex: 1 1 260px; }
.feedback-list { display: grid; gap: 10px; margin-top: 12px; }
.feedback-item { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(4, 12, 28, 0.45); }
.feedback-item .pv-body { margin: 8px 0 0; }

/* ---------- active tasks ---------- */
.task-filters { margin: 4px 0 14px; }
.task-list { display: grid; gap: 8px; }
.task-item { border: 1px solid var(--border); border-radius: 12px; background: rgba(4, 12, 28, 0.45); }
.task-item[open] { border-color: var(--border-strong); }
.task-item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; }
.task-item summary::-webkit-details-marker { display: none; }
.task-id { font-family: var(--display); font-weight: 700; color: var(--cyan); }
.task-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-due { grid-column: 3; text-align: right; white-space: nowrap; }
.bad-text { color: var(--bad); }
.task-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.task-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.task-facts dt { color: var(--muted); }
.task-facts dd { margin: 0; }
.answers { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--warn-soft); }
.task-body .btn { justify-self: start; }

/* ---------- forms in pop-ups, timeline, notes ---------- */
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { width: min(720px, 100%); }
.modal input[type="text"], .modal input[type="datetime-local"] { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-grid select, .form-grid input { width: 100%; }
.stack.tight { gap: 8px; margin-bottom: 0; }
.stack .row input[type="text"] { flex: 1; }
.field > select, .field > .chips { margin-top: 2px; }
.timeline { display: grid; gap: 10px; margin-bottom: 18px; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--border-strong); font-size: 14px; }
.note-count { margin-left: 6px; font-size: 12px; }
.note-warning { border-color: rgba(255, 181, 71, 0.4); }
.note-praise { border-color: rgba(51, 224, 161, 0.35); }

/* ---------- documentation page ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.docs-page { padding-top: 32px; }
.docs-side { position: sticky; top: 84px; display: grid; gap: 10px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.docs-side .sidenav { position: static; }
.docs-nav a { padding: 7px 12px; font-size: 13.5px; }
.docs-search input {
  width: 100%; font: inherit; font-size: 14px; color: var(--text); background: rgba(4, 12, 28, 0.7);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
.docs-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 140, 255, 0.25); }
.docs-hero { margin-bottom: 20px; }
.docs-hero .eyebrow { margin-bottom: 14px; }
.docs-hero h1 { font-size: clamp(28px, 4.5vw, 42px); margin-bottom: 10px; }
.docs-hero .lead { font-size: 16px; color: var(--muted); max-width: 640px; }
.docs-empty { color: var(--warn); }
.doc { scroll-margin-top: 84px; padding: 26px 28px; }
.doc h2 { font-size: 22px; margin-bottom: 12px; }
.doc h3 { margin: 22px 0 8px; color: #cfe6ff; }
.doc p, .doc li { color: #c9d8f0; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.doc a { text-decoration: none; }
.doc a:hover { text-decoration: underline; }
.doc-steps { counter-reset: step; list-style: none; padding-left: 0 !important; gap: 10px !important; }
.doc-steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.doc-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--grad-solid); box-shadow: 0 0 14px rgba(43, 140, 255, 0.4);
}
.callout { margin: 14px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--accent-soft); color: #d6e8ff; font-size: 14px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.doc-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.doc-table tbody th { white-space: nowrap; font-weight: 500; width: 1%; }
.doc-table td { color: #c9d8f0; }
.doc-table.cmds td:first-child { width: 46%; }
.doc-table code { white-space: normal; overflow-wrap: anywhere; }
.docs-faq { max-width: none; margin-top: 4px; }
.docs-faq .card { box-shadow: none; animation: none; }
.docs-help { margin: 16px 0 0; color: var(--muted); }
@media (max-width: 800px) {
  .docs-side { position: sticky; top: 59px; z-index: 5; max-height: none; overflow: visible; background: rgba(4, 9, 20, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); margin: 0 -16px; padding: 10px 16px; }
  .docs-search input { padding: 8px 12px; }
  .doc { padding: 20px 18px; scroll-margin-top: 200px; }
  .doc-table th, .doc-table td { padding: 8px 6px; }
  .doc-table.cmds td:first-child { width: 50%; }
  .doc-table tbody th { white-space: normal; }
}
.doc-table tbody th code { white-space: nowrap; overflow-wrap: normal; }
.doc-table tbody th { text-transform: none; letter-spacing: normal; font-size: 14px; color: inherit; }

/* ---------- activity tracking settings ---------- */
div.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.picker { display: grid; gap: 8px; font-weight: 400; }
.picker select { width: 100%; }
.picker .chips { min-height: 28px; align-items: center; }
.dimmed { opacity: 0.45; }

/* ---------- grouped side menu ---------- */
.nav-group {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan);
  opacity: 0.75; padding: 12px 12px 4px; display: flex; align-items: center; gap: 8px;
}
.nav-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.sidenav.grouped .nav-group:first-child { padding-top: 6px; }
@media (max-width: 800px) {
  .nav-group { padding: 0 4px 0 12px; align-self: center; white-space: nowrap; border-left: 1px solid var(--border); }
  .nav-group::after { display: none; }
  .sidenav.grouped .nav-group:first-child { border-left: 0; padding-left: 4px; }
}

/* ---------- server list: linked networks & servers to add ---------- */
.list-head { margin: 28px 0 12px; font-size: 17px; align-items: center; }
.list-head h2 { margin: 0; font-size: 17px; }
.network { padding: 18px 20px 20px; margin-bottom: 18px; border-color: rgba(51, 224, 161, 0.28); box-shadow: var(--glow), 0 0 40px rgba(51, 224, 161, 0.08); }
.network-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.network-head strong { color: var(--text); }
.network-body { position: relative; display: grid; gap: 12px; padding-left: 34px; }
/* The connection: a green line from each server's node to the next, with light flowing down it. */
.net-row:not(:last-child)::before {
  content: ""; position: absolute; left: -25px; top: 50%; width: 3px; height: calc(100% + 12px); border-radius: 3px;
  background: linear-gradient(180deg, rgba(51, 224, 161, 0.9) 0%, rgba(51, 224, 161, 0.35) 30%, rgba(184, 255, 230, 0.95) 50%, rgba(51, 224, 161, 0.35) 70%, rgba(51, 224, 161, 0.9) 100%);
  background-size: 100% 200%; animation: flow-down 1.8s linear infinite;
  box-shadow: 0 0 12px rgba(51, 224, 161, 0.55);
}
.net-row { position: relative; display: flex; align-items: center; min-width: 0; }
.net-row > .server-card { flex: 1; min-width: 0; margin: 0; }
.net-row .node {
  position: absolute; left: -31px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; border-radius: 50%;
  background: var(--good); box-shadow: 0 0 0 4px rgba(51, 224, 161, 0.18), 0 0 14px var(--good);
  animation: node-pulse 2.4s ease-in-out infinite;
}
.net-row .wire {
  position: absolute; left: -16px; top: 50%; width: 16px; height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(90deg, var(--good) 0 4px, transparent 4px 7px);
  background-size: 14px 2px; animation: wire-flow 0.8s linear infinite; box-shadow: 0 0 8px rgba(51, 224, 161, 0.6);
}
.net-row:nth-child(3) .node { animation-delay: 0.4s; }
.net-row:nth-child(4) .node { animation-delay: 0.8s; }
.net-row:nth-child(5) .node { animation-delay: 1.2s; }
.net-row:nth-child(6) .node { animation-delay: 1.6s; }
.network .server-card:hover { border-color: var(--good); box-shadow: var(--glow), 0 0 32px rgba(51, 224, 161, 0.25); }
@keyframes flow-down { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
@keyframes node-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(51, 224, 161, 0.18), 0 0 14px var(--good); } 50% { box-shadow: 0 0 0 8px rgba(51, 224, 161, 0.06), 0 0 22px var(--good); } }
@keyframes wire-flow { to { background-position: 14px 0; } }
.server-card.addable { cursor: default; }
.server-card.addable:hover { transform: none; border-color: var(--border-strong); }
.server-card.addable > div { flex: 1; min-width: 0; }
.server-card.addable h3, .server-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card > div { min-width: 0; }
.badge { white-space: nowrap; }
.server-card.addable h3 { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.server-card.addable .btn { flex: none; }
.check > .btn { align-self: center; flex: none; }

/* Overview: quick-start templates */
.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.template { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); }
.template .btn { align-self: flex-start; margin-top: auto; }
.template-head { display: flex; align-items: center; gap: 10px; }
.template-emoji { font-size: 22px; }
.template-list { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }

/* Audit log */
.audit-item { padding: 12px 0; border-bottom: 1px solid rgba(84, 164, 255, 0.08); display: grid; gap: 4px; }
.audit-item:last-child { border-bottom: 0; }

/* Member page (staff record window) */
.member-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.member-head h3 { margin: 0 0 2px; }
.modal .stats { margin: 12px 0; }

/* Cookie notice: essential cookies only, so it informs and doesn't ask. */
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; max-width: 560px; margin: 0 auto; display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--border-strong); box-shadow: var(--glow); color: var(--text); font-size: 14px; line-height: 1.5; }
.cookie-notice p { margin: 0; flex: 1; }
.cookie-notice a { color: var(--cyan); }
@media (max-width: 520px) { .cookie-notice { flex-direction: column; align-items: stretch; } }

/* Legal pages */
.legal { max-width: 820px; margin: 0 auto; padding: 32px 16px 64px; }
.legal h1 { font-family: var(--display); margin: 0 0 6px; }
.legal h2 { font-family: var(--display); font-size: 20px; margin: 32px 0 8px; color: #cfe6ff; }
.legal p, .legal li, .legal td { color: #c9d8f0; line-height: 1.65; }
.legal a { color: var(--cyan); }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { color: var(--text); }
.legal .updated { color: var(--muted); margin: 0 0 24px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.consent-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.consent-note a { color: var(--cyan); }
.danger-zone { border-color: rgba(255, 92, 122, 0.4); }
.narrow-page { max-width: 760px; margin: 0 auto; }
.bulk-perms { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--panel-2); }
.bulk-perms h3 { margin: 0 0 4px; }
.bulk-perm-list { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.bulk-perm-list legend { font-weight: 600; margin-bottom: 6px; padding: 0; }

/* Updates */
.dot.good { background: var(--good); }
.feedback-btn .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.updates-list { display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.update-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.update-card ul { margin: 8px 0 0; padding-left: 20px; }
.update-card li { margin: 4px 0; color: #c9d8f0; line-height: 1.5; }
.update-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.update-head .muted { margin-left: auto; }
.update-old summary { cursor: pointer; padding: 8px 2px; color: var(--muted); }
.whats-new { display: grid; gap: 14px; }
.update-toast { position: fixed; right: 16px; bottom: 16px; z-index: 950; display: flex; gap: 10px; align-items: center; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: var(--panel-solid); border: 1px solid rgba(51, 224, 161, 0.45); box-shadow: var(--glow); animation: slide-up 0.35s ease-out; }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pop-up animations */
.modal.pop { animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes pop-in { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.shake { animation: pop-in 0.25s ease-out, shake 0.45s ease-in-out 0.25s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.btn.attention { animation: pulse-ring 1s ease-out 2; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(79, 209, 255, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(79, 209, 255, 0); } }

/* ---------- premium motion (landing, docs and legal pages) ----------
   Only active when site.js adds .motion to <html>, which it skips for people who ask for
   reduced motion. Without it everything is simply visible. */
html.motion { scroll-behavior: smooth; }
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* Hero: content rises in, one line after another. */
.motion .hero > * { animation: hero-in 1.2s var(--ease-out) both; }
.motion .hero > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero > :nth-child(4) { animation-delay: 0.26s; }
.motion .hero > :nth-child(5) { animation-delay: 0.36s; }
.motion .hero > :nth-child(6) { animation-delay: 0.44s; }
.motion .hero > :nth-child(7) { animation-delay: 0.52s; }
@keyframes hero-in { from { opacity: 0; transform: translateY(26px) scale(0.985); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.motion .hero { will-change: transform, opacity; }
/* The logo keeps floating once it has risen in. */
.motion .hero > .hero-logo { animation: hero-in 1.2s var(--ease-out) both, float 6s ease-in-out 1.2s infinite; }

/* Headline: a slow sheen across the gradient text. */
.motion .hero h1.gradient-text { background-size: 200% auto; animation: hero-in 1.2s var(--ease-out) both, sheen 9s ease-in-out 1.4s infinite; }
@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Sections fade up as they scroll into view. */
.motion .reveal { opacity: 0; transform: translateY(40px); filter: blur(8px); animation: none;
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s var(--ease-out); transition-delay: var(--d, 0ms); }
.motion .reveal.in { opacity: 1; transform: none; filter: none; }
.motion .feature.reveal.in:hover { transform: translateY(-6px); transition-delay: 0ms; }

/* Top bar firms up once you scroll. */
.topbar { transition: background 0.5s var(--ease-out), padding 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out); }
.topbar.scrolled { background: rgba(4, 9, 20, 0.82); padding-top: 9px; padding-bottom: 9px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

/* Feature cards: a soft light follows the pointer. */
.feature { overflow: hidden; }
.feature::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(79, 209, 255, 0.12), transparent 45%);
  transition: opacity 0.4s var(--ease-out); }
.feature:hover::before { opacity: 1; }
.feature > * { position: relative; }
.feature { transition: transform 0.6s var(--ease-out), border-color 0.4s, box-shadow 0.6s var(--ease-out); }

/* Example cards tilt gently towards the pointer. */
.mock-stack { perspective: 1200px; }
.mock-stack .mock-embed { transition: transform 0.8s var(--ease-out); transform-style: preserve-3d; }
.motion .mock-stack.tilting .mock-embed { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.motion .mock-stack.tilting .mock-embed.loa { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(30px); }

/* Buttons: a smoother press. */
.btn { transition: transform 0.35s var(--ease-out), background 0.3s, border-color 0.3s, box-shadow 0.4s var(--ease-out); }
.btn:active { transform: scale(0.97); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(21, 101, 192, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }

/* Spaces */
.space-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); padding: 3px 10px 3px 8px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel-2); font-size: 13px; }
.space-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: none; }
.network[style*="--space"] { border-color: color-mix(in srgb, var(--space) 45%, transparent); box-shadow: var(--glow), 0 0 40px color-mix(in srgb, var(--space) 12%, transparent); }
.network[style*="--space"] .net-row .node { background: var(--space); box-shadow: 0 0 0 4px color-mix(in srgb, var(--space) 20%, transparent), 0 0 14px var(--space); animation: none; }
.network[style*="--space"] .net-row .wire { background: repeating-linear-gradient(90deg, var(--space) 0 4px, transparent 4px 7px); background-size: 14px 2px; box-shadow: 0 0 8px var(--space); }
.network[style*="--space"] .net-row:not(:last-child)::before { background: linear-gradient(180deg, var(--space), color-mix(in srgb, var(--space) 35%, transparent) 30%, color-mix(in srgb, var(--space) 40%, white) 50%, color-mix(in srgb, var(--space) 35%, transparent) 70%, var(--space)); background-size: 100% 200%; box-shadow: 0 0 12px color-mix(in srgb, var(--space) 55%, transparent); }
.network[style*="--space"] .server-card:hover { border-color: var(--space); box-shadow: var(--glow), 0 0 32px color-mix(in srgb, var(--space) 25%, transparent); }
.spaces-cta { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.spaces-cta p { margin: 4px 0 0; }
.space-card { border-left: 4px solid var(--space, var(--accent)); }
.space-card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.space-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 8px 0; }
.space-server { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.space-server .avatar { width: 24px; height: 24px; font-size: 11px; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--border-strong); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.color-input { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; cursor: pointer; }
.space-delete { margin-top: 14px; }
.space-delete summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.field .color-row input.color-input, .color-row input.color-input { width: 40px; min-width: 40px; height: 32px; padding: 2px; flex: none; }
