/* ============================================================
 *  LavaBot — Stylesheet (corporate ember palette)
 *  Mobile-first. Fluid typography & spacing via clamp().
 *  Breakpoints: 480 / 640 / 768 / 1024 / 1440 / 1920 px.
 *  Targets phones, tablets, laptops, desktops, and 4K monitors.
 * ============================================================ */

/* ──────────────────────────────────────────────────────────
 *  Tokens
 * ────────────────────────────────────────────────────────── */
:root {
  /* Corporate ember palette — deep neutrals, muted red, restrained amber.
     Names kept identical to the old palette so component styles don't
     need rewiring; only the values changed. */
  --bg-0: #0a0a0d;
  --bg-1: #101015;
  --bg-2: #17171d;
  --surface: rgba(26, 24, 30, 0.86);
  --surface-strong: rgba(18, 17, 22, 0.94);
  --line: rgba(184, 178, 196, 0.13);
  --line-strong: rgba(217, 79, 61, 0.36);
  --text: #ecebef;
  --text-muted: #9b96a3;
  --c-primary: #d94f3d;          /* ember red — main brand accent */
  --c-primary-strong: #c23c2b;
  --c-secondary: #e0863f;        /* muted amber — gradient pair */
  --c-warm: #d99a4e;             /* amber — warnings */
  --danger: #e0556a;             /* desaturated red — errors */
  --ok: #5fb98a;                 /* muted green — semantic OK */
  --on-primary: #160a06;         /* text color sitting on ember/amber gradients */

  /* Elevation */
  --shadow-soft: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-heavy: 0 26px 70px rgba(0, 0, 0, 0.62);

  /* Radii */
  --radius-xs: 8px;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 34px;

  /* Container — fluid from 320px up to 4K, clamped */
  --shell-max: clamp(320px, 92vw, 1320px);
  --shell-pad-x: clamp(12px, 2.5vw, 28px);
  --shell-pad-y: clamp(14px, 2.4vw, 32px);

  /* Spacing scale (fluid) */
  --space-1: clamp(4px, 0.4vw, 6px);
  --space-2: clamp(8px, 0.8vw, 12px);
  --space-3: clamp(12px, 1.2vw, 18px);
  --space-4: clamp(16px, 1.6vw, 24px);
  --space-5: clamp(20px, 2vw, 32px);
  --space-6: clamp(28px, 3vw, 48px);

  /* Fluid typography */
  --fs-xs: clamp(0.72rem, 0.69rem + 0.15vw, 0.82rem);
  --fs-sm: clamp(0.82rem, 0.78rem + 0.2vw, 0.94rem);
  --fs-base: clamp(0.92rem, 0.88rem + 0.25vw, 1.06rem);
  --fs-lg: clamp(1.05rem, 0.98rem + 0.4vw, 1.25rem);
  --fs-xl: clamp(1.2rem, 1.08rem + 0.6vw, 1.5rem);
  --fs-h3: clamp(1rem, 0.92rem + 0.45vw, 1.25rem);
  --fs-h2: clamp(1.25rem, 1.05rem + 1vw, 1.85rem);
  --fs-h1: clamp(1.7rem, 1.2rem + 2.5vw, 3.2rem);
}

/* On ultra-wide displays we let the shell breathe a bit more */
@media (min-width: 1920px) {
  :root {
    --shell-max: clamp(1320px, 78vw, 1600px);
  }
}

/* ──────────────────────────────────────────────────────────
 *  Reset / base
 * ────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.55;
  /*
    Layered background (top → bottom):
      1) Soft warm radial glows for color life
      2) Dark vignette overlay so cards & text stay readable on top of the photo
      3) Lava volcano background image, cover-sized and parallax-fixed
      4) Solid token fallback if the image fails to load
    Drop the image at: web/static/lava-bg.jpg
    Suggested size: 1920×1080+, dark composition. A watermarked stock
    image will look unprofessional — get a clean version.
  */
  background:
    radial-gradient(85vw 50vw at 4% 0%, rgba(217, 79, 61, 0.16), transparent 60%),
    radial-gradient(75vw 45vw at 104% 8%, rgba(224, 134, 63, 0.16), transparent 58%),
    radial-gradient(70vw 40vw at 50% 112%, rgba(217, 154, 78, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(7, 5, 10, 0.72) 0%, rgba(7, 5, 10, 0.86) 100%),
    url("lava-bg.jpg") center center / cover no-repeat fixed,
    var(--bg-0);
  background-attachment: fixed, fixed, fixed, fixed, fixed, scroll;
  padding: var(--shell-pad-y) var(--shell-pad-x) var(--space-6);
  overflow-x: hidden;
}

/* On phones, `background-attachment: fixed` is buggy on iOS Safari and
   wastes battery on Android — switch the image layer to scroll there. */
@media (max-width: 768px) {
  body { background-attachment: scroll, scroll, scroll, scroll, scroll, scroll; }
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ──────────────────────────────────────────────────────────
 *  Background decorations
 * ────────────────────────────────────────────────────────── */
.backdrop-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(217, 79, 61, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 79, 61, 0.06) 1px, transparent 1px);
  background-size: clamp(28px, 4vw, 56px) clamp(28px, 4vw, 56px);
  mask-image: radial-gradient(circle at 50% 26%, rgba(0, 0, 0, 0.9), transparent 78%);
}

.backdrop-glow {
  position: fixed;
  width: clamp(260px, 40vw, 520px);
  height: clamp(260px, 40vw, 520px);
  top: -8vw;
  right: -6vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(224, 134, 63, 0.32), transparent 70%);
  pointer-events: none;
  filter: blur(4px);
}

/* ──────────────────────────────────────────────────────────
 *  Layout shells
 * ────────────────────────────────────────────────────────── */
.topbar {
  max-width: var(--shell-max);
  margin: 0 auto var(--space-4);
  padding: clamp(10px, 1.2vw, 16px) clamp(14px, 1.6vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(140deg, rgba(30, 28, 34, 0.92), rgba(20, 19, 24, 0.94));
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  position: relative;
  /* Keep the header (and its dropdowns) above page content, whose scroll-reveal
     transforms create stacking contexts that would otherwise cover the menus. */
  z-index: 1000;
}

.main-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  display: grid;
  gap: var(--space-4);
}

.site-footer {
  max-width: var(--shell-max);
  margin: var(--space-5) auto 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.footer-links {
  margin-top: 8px !important;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────
 *  Brand block
 * ────────────────────────────────────────────────────────── */
.brand-block {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  min-width: 0;
}

.brand-mark {
  width: clamp(40px, 4vw, 50px);
  height: clamp(40px, 4vw, 50px);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(0.75rem, 0.9vw, 0.9rem);
  letter-spacing: 0.4px;
  color: var(--on-primary);
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  box-shadow: 0 10px 22px rgba(224, 134, 63, 0.32);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: clamp(0.85rem, 0.95vw, 1rem);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text em {
  margin-top: 2px;
  font-size: clamp(0.65rem, 0.7vw, 0.76rem);
  color: var(--text-muted);
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On very small screens hide the brand subline */
@media (max-width: 480px) {
  .brand-text em { display: none; }
}

/* ──────────────────────────────────────────────────────────
 *  Navigation
 * ────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: clamp(0.82rem, 0.85vw, 0.92rem);
  transition: 140ms ease;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(217, 79, 61, 0.06);
}

.nav-note {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: clamp(140px, 18vw, 220px);
}

.nav-cta {
  color: var(--on-primary) !important;
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary)) !important;
}

.nav-cta-ghost {
  color: var(--text) !important;
  background: transparent !important;
  border-color: var(--line) !important;
}

/* Hamburger button — hidden by default, shown below 860px */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: 140ms ease;
  min-height: 42px;
  min-width: 42px;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(217, 79, 61, 0.08);
  border-color: var(--line-strong);
}

/* ── Nav dropdowns (More / account menu) ─────────────────── */
.site-nav .nav-dd { position: relative; }

.site-nav .nav-dd-summary {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: clamp(0.82rem, 0.85vw, 0.92rem);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 140ms ease;
}
.site-nav .nav-dd-summary::-webkit-details-marker { display: none; }
.site-nav .nav-dd-summary::after {
  content: "▾";
  font-size: 0.7em;
  opacity: 0.65;
  transition: transform 140ms ease;
}
.site-nav .nav-dd[open] > .nav-dd-summary::after { transform: rotate(180deg); }
.site-nav .nav-dd-summary:hover,
.site-nav .nav-dd-summary:focus-visible,
.site-nav .nav-dd[open] > .nav-dd-summary {
  border-color: var(--line-strong);
  background: rgba(217, 79, 61, 0.06);
}

.site-nav .nav-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 60;
}
.site-nav .nav-dd-menu.nav-dd-right { left: auto; right: 0; }
.site-nav .nav-dd-menu a {
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--fs-xs);
}

/* ── Owner "Edit content" floating button ────────────────── */
.site-edit-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--fs-xs);
  color: var(--on-primary);
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  box-shadow: 0 10px 28px rgba(224, 134, 63, 0.4);
  text-decoration: none;
  transition: 140ms ease;
}
.site-edit-fab:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ── Site editor: CTA pairs + island rows ────────────────── */
.cta-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) { .cta-pair { grid-template-columns: 1fr; } }

.island-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  margin-bottom: 12px;
}
.island-row .island-row-title { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.island-row .island-remove { padding: 5px 10px; font-size: var(--fs-xs); min-height: 0; }

/* ──────────────────────────────────────────────────────────
 *  Typography
 * ────────────────────────────────────────────────────────── */
h1, h2, h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  line-height: 1.15;
  color: var(--text);
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p, li, label { color: var(--text-muted); }

a { color: #e08a5a; }
a:hover, a:focus-visible { color: #eba784; }

code {
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-size: 0.85em;
  background: rgba(14, 13, 17, 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: #f0cdb0;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(217, 79, 61, 0.12);
  color: #f3d8c0;
  font-size: var(--fs-xs);
  font-weight: 700;
  width: fit-content;
}

/* ──────────────────────────────────────────────────────────
 *  Cards
 * ────────────────────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow-soft);
  padding: clamp(16px, 2vw, 28px);
}

.card::before {
  content: "";
  position: absolute;
  width: clamp(120px, 14vw, 200px);
  height: clamp(120px, 14vw, 200px);
  top: -90px;
  right: -80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 79, 61, 0.2), transparent 72%);
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────
 *  Hero
 * ────────────────────────────────────────────────────────── */
.hero-section {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(50vw 30vw at 0% 0%, rgba(217, 79, 61, 0.18), transparent 70%),
    radial-gradient(45vw 25vw at 100% 0%, rgba(224, 134, 63, 0.18), transparent 72%),
    linear-gradient(160deg, rgba(30, 28, 34, 0.95), rgba(20, 19, 24, 0.96));
  padding: clamp(20px, 4vw, 56px);
  box-shadow: var(--shadow-heavy);
}

.hero-sub {
  max-width: 70ch;
  font-size: var(--fs-lg);
  margin-bottom: var(--space-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}

/* ──────────────────────────────────────────────────────────
 *  Buttons
 * ────────────────────────────────────────────────────────── */
.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px clamp(14px, 1.8vw, 22px);
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  transition: 140ms ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary,
.btn:not(.btn-ghost):not(.btn-danger):not(.btn-discord),
button:not(.btn-ghost):not(.nav-toggle):not(.btn-danger):not(.btn-discord),
input[type="submit"] {
  color: var(--on-primary);
  background: linear-gradient(128deg, var(--c-secondary), var(--c-primary));
  box-shadow: 0 8px 20px rgba(224, 134, 63, 0.3);
}

.btn-discord {
  color: #fff;
  background: #5865f2;
  border: none;
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.3);
  text-align: center;
}

.btn-discord:hover {
  background: #4752c4;
}

.form-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.form-or::before,
.form-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.btn-ghost,
button.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  box-shadow: none;
}

.btn-danger {
  color: var(--danger);
  background: rgba(224, 85, 106, 0.12);
  border-color: rgba(224, 85, 106, 0.32);
  box-shadow: none;
}

/* Wrap CTA buttons to fill the row on very small phones */
@media (max-width: 420px) {
  .hero-actions .btn,
  .row .btn { flex: 1 1 100%; }
}

/* ──────────────────────────────────────────────────────────
 *  Stats ribbon & dashboard top stats
 * ────────────────────────────────────────────────────────── */
.stats-ribbon,
.dash-top-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.stats-ribbon.compact { margin-top: 4px; }
.dash-top-stats { margin-bottom: var(--space-3); }

.stat-card {
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.78);
  padding: 14px 14px;
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--fs-lg);
  color: var(--text);
  word-break: break-word;
}

.stat-card .stat-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Compact ranked list used by the home "Biggest communities" card */
.mini-leaderboard {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
  counter-reset: lb;
}
.mini-leaderboard li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-sm);
}
.mini-leaderboard li:not(.lb-empty)::before {
  counter-increment: lb;
  content: counter(lb) ".";
  margin-right: 6px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mini-leaderboard .lb-name {
  flex: 1 1 auto;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-leaderboard .lb-count {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Logs table — avatar + user cell */
.log-user { display: flex; align-items: center; gap: 8px; }
.log-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
}
.log-user code { font-size: var(--fs-xs); color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────
 *  Dashboard grid
 * ────────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--space-3);
}

.dash-grid .full { grid-column: 1 / -1; }

@media (min-width: 1600px) {
  .dash-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  }
}

/* ──────────────────────────────────────────────────────────
 *  Section shells
 * ────────────────────────────────────────────────────────── */
.section-shell {
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(26, 24, 30, 0.88), rgba(18, 17, 22, 0.92));
  padding: clamp(18px, 2.5vw, 32px);
}

.section-shell.section-accent {
  background:
    radial-gradient(360px 170px at 100% 0%, rgba(224, 134, 63, 0.18), transparent 70%),
    linear-gradient(155deg, rgba(26, 24, 30, 0.92), rgba(18, 17, 22, 0.94));
}

.section-head h2 { margin-bottom: 6px; }
.section-head p { margin-top: 0; }

/* ──────────────────────────────────────────────────────────
 *  Feature grid
 * ────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  margin-top: var(--space-3);
}

.feature-card {
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.74);
  padding: clamp(14px, 1.6vw, 22px);
  transition: 160ms ease;
}

.feature-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.feature-card h3 { margin-bottom: 6px; }

/* ──────────────────────────────────────────────────────────
 *  Personality list
 * ────────────────────────────────────────────────────────── */
.personality-list {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
}

/* ──────────────────────────────────────────────────────────
 *  Auth pages (login / register / admin_login)
 * ────────────────────────────────────────────────────────── */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-3);
}

@media (max-width: 860px) {
  .auth-layout { grid-template-columns: 1fr; }
}

.auth-panel {
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(30, 28, 34, 0.9), rgba(20, 19, 24, 0.92));
  padding: clamp(20px, 2.5vw, 36px);
}

.auth-panel h2 { margin-top: 8px; }

.auth-panel-feature {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.auth-feature-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  background: rgba(26, 24, 30, 0.48);
  border: 1px solid var(--line);
}

.auth-feature-bullet {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  color: var(--on-primary);
  font-weight: 800;
  font-size: var(--fs-sm);
}

.auth-feature-body strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}

.auth-feature-body span {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.auth-card {
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 22, 28, 0.94), rgba(10, 6, 3, 0.95));
  padding: clamp(20px, 2.5vw, 36px);
  box-shadow: var(--shadow-soft);
}

.auth-card .form-help {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.auth-card .form-divider,
.form-divider {
  margin: var(--space-3) 0 var(--space-2);
  height: 1px;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.form-error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(224, 85, 106, 0.14);
  border: 1px solid rgba(224, 85, 106, 0.34);
  color: var(--danger);
  font-weight: 700;
  font-size: var(--fs-sm);
}

/* ──────────────────────────────────────────────────────────
 *  Forms (general)
 * ────────────────────────────────────────────────────────── */
.stacked-form {
  display: grid;
  gap: 8px;
}

label {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: 4px;
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(26, 24, 30, 0.86);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: 120ms ease;
  min-height: 42px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(217, 79, 61, 0.22);
}

textarea { min-height: 90px; resize: vertical; }

.kv-list p {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.kv-list p:last-child { margin-bottom: 0; }

.kv-list p strong {
  color: #efd9c4;
  flex-shrink: 0;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 6px;
}

.checkbox-line input { width: auto; min-height: 0; }

/* ──────────────────────────────────────────────────────────
 *  Utility layout
 * ────────────────────────────────────────────────────────── */
.center-card {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.small { font-size: var(--fs-sm); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.hidden { display: none; }

.center {
  display: grid;
  place-items: center;
}

/* ──────────────────────────────────────────────────────────
 *  Tables
 * ────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  margin-top: var(--space-2);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.table th {
  color: #efd9c4;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(26, 24, 30, 0.7);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table td { color: var(--text); }

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td { background: rgba(217, 79, 61, 0.05); }

/* ──────────────────────────────────────────────────────────
 *  Role badges
 * ────────────────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.role-badge.role-admin {
  background: rgba(224, 134, 63, 0.18);
  color: #ff6b5a;
  border: 1px solid rgba(224, 134, 63, 0.36);
}

.role-badge.role-member {
  background: rgba(217, 79, 61, 0.14);
  color: var(--c-primary);
  border: 1px solid var(--line);
}

/* ──────────────────────────────────────────────────────────
 *  Status dot (pulsing online indicator)
 * ────────────────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ──────────────────────────────────────────────────────────
 *  Traffic badges (admin page)
 * ────────────────────────────────────────────────────────── */
.traffic-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}

.traffic-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-muted);
}

.traffic-badge.ok    { color: var(--ok);     border-color: rgba(95, 185, 138, 0.36);  background: rgba(95, 185, 138, 0.1); }
.traffic-badge.warn  { color: var(--c-warm); border-color: rgba(217, 154, 78, 0.34);  background: rgba(217, 154, 78, 0.1); }
.traffic-badge.danger{ color: var(--danger); border-color: rgba(224, 85, 106, 0.34);   background: rgba(224, 85, 106, 0.1); }

.traffic-row {
  font-size: var(--fs-sm);
  margin-bottom: 4px;
}

.traffic-row strong { color: var(--text); }

/* ──────────────────────────────────────────────────────────
 *  Command accordion
 * ────────────────────────────────────────────────────────── */
.cmd-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  margin-bottom: 8px;
}

.cmd-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(26, 24, 30, 0.66);
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  user-select: none;
  transition: 120ms ease;
  min-height: 44px;
}

.cmd-group-header:hover,
.cmd-group-header:focus-visible {
  background: rgba(217, 79, 61, 0.08);
  outline: none;
}

.cmd-group-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 200ms ease;
}

.cmd-group.open .cmd-group-arrow { transform: rotate(180deg); }

.cmd-group-body {
  padding: 6px 14px 10px;
  display: none;
  border-top: 1px solid var(--line);
}

.cmd-group.open .cmd-group-body { display: block; }

.cmd-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}

.cmd-row:last-child { border-bottom: none; }

.cmd-name {
  color: var(--c-primary);
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-weight: 700;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.cmd-help {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  flex: 1 1 240px;
  min-width: 0;
}

/* ──────────────────────────────────────────────────────────
 *  Toast notifications
 * ────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: clamp(12px, 2vw, 24px);
  right: clamp(12px, 2vw, 24px);
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-s);
  background: rgba(24, 22, 28, 0.97);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  animation: reveal-up 220ms ease both;
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.toast.toast-ok   { border-color: rgba(95, 185, 138, 0.45); color: var(--ok); }
.toast.toast-err  { border-color: rgba(224, 85, 106, 0.45);  color: var(--danger); }

@media (max-width: 480px) {
  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

/* ──────────────────────────────────────────────────────────
 *  Invite page stat
 * ────────────────────────────────────────────────────────── */
.invite-stat {
  margin-top: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.78);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────
 *  Page head (used on /donate, etc.)
 * ────────────────────────────────────────────────────────── */
.page-head {
  text-align: center;
  padding: clamp(20px, 4vw, 36px) 12px clamp(12px, 2vw, 20px);
  max-width: 760px;
  margin: 0 auto;
}

.page-head .pill { margin: 0 auto 14px; }

.page-head h1 { margin-bottom: 12px; }

.page-head p {
  font-size: var(--fs-lg);
  margin: 0 auto;
  max-width: 60ch;
}

/* ──────────────────────────────────────────────────────────
 *  Donation cards
 *  PayPal / Ko-Fi / Patreon keep their brand colors — those
 *  are brand identities, not theme accents.
 * ────────────────────────────────────────────────────────── */
.donation-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.donation-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(26, 24, 30, 0.94), rgba(18, 17, 22, 0.95));
  padding: clamp(18px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  transition: 180ms ease;
  text-decoration: none;
  color: inherit;
  min-height: 240px;
}

.donation-card:hover,
.donation-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.donation-card::before {
  content: "";
  position: absolute;
  width: clamp(120px, 14vw, 200px);
  height: clamp(120px, 14vw, 200px);
  top: -70px;
  right: -60px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 79, 61, 0.2), transparent 70%);
  pointer-events: none;
  transition: transform 220ms ease;
}

.donation-card:hover::before { transform: scale(1.25); }

.donation-card.paypal::before  { background: radial-gradient(circle, rgba(0, 156, 222, 0.28), transparent 70%); }
.donation-card.kofi::before    { background: radial-gradient(circle, rgba(255, 91, 91, 0.26), transparent 70%); }
.donation-card.patreon::before { background: radial-gradient(circle, rgba(255, 66, 77, 0.24), transparent 70%); }

.donation-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: rgba(217, 79, 61, 0.14);
  border: 1px solid var(--line-strong);
  color: var(--c-primary);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.donation-card.paypal  .donation-icon { color: #4dbeff; background: rgba(0, 156, 222, 0.14);  border-color: rgba(0, 156, 222, 0.4); }
.donation-card.kofi    .donation-icon { color: #ff7b7b; background: rgba(255, 91, 91, 0.14);  border-color: rgba(255, 91, 91, 0.4); }
.donation-card.patreon .donation-icon { color: #ff6670; background: rgba(255, 66, 77, 0.14);  border-color: rgba(255, 66, 77, 0.4); }

.donation-card h3 {
  margin: 6px 0 2px;
  color: var(--text);
  font-size: var(--fs-lg);
}

.donation-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  flex-grow: 1;
}

.donation-card .donation-cta {
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(128deg, var(--c-secondary), var(--c-primary));
  color: var(--on-primary);
  font-weight: 800;
  font-size: var(--fs-sm);
  border: none;
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────
 *  Support list (donate page)
 * ────────────────────────────────────────────────────────── */
.support-list {
  display: grid;
  gap: 8px;
  margin: var(--space-3) 0 0;
  padding-left: 0;
  list-style: none;
}

.support-list li {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.65);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-list li::before {
  content: "✦";
  color: var(--c-primary);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
 *  Selection highlight (text-select color)
 * ────────────────────────────────────────────────────────── */
::selection {
  background: rgba(217, 79, 61, 0.35);
  color: var(--text);
}

/* ──────────────────────────────────────────────────────────
 *  Scrollbar polish (WebKit only — Firefox uses defaults)
 * ────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(18, 17, 22, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(217, 79, 61, 0.25);
  border-radius: 999px;
  border: 2px solid rgba(18, 17, 22, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 79, 61, 0.4);
}

/* ──────────────────────────────────────────────────────────
 *  Nav extras (active state, separator)
 * ────────────────────────────────────────────────────────── */
.site-nav .nav-active {
  background: rgba(217, 79, 61, 0.12);
  border-color: var(--line-strong);
  color: var(--c-primary);
}

.nav-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 6px;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .nav-sep {
    display: block;
    width: 100%;
    height: 1px;
    margin: 6px 0;
  }
}

/* ──────────────────────────────────────────────────────────
 *  Dashboard sub-nav (Overview / Servers / Commands)
 * ────────────────────────────────────────────────────────── */
.dash-subnav {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.dash-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: 140ms ease;
}

.dash-subnav-link:hover {
  color: var(--text);
  background: rgba(217, 79, 61, 0.06);
}

.dash-subnav-link.dash-subnav-active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

/* ──────────────────────────────────────────────────────────
 *  Dashboard quick-link cards
 * ────────────────────────────────────────────────────────── */
.dash-quick-links {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  margin-top: var(--space-3);
}

.dash-quick-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.6);
  text-decoration: none;
  color: var(--text);
  transition: 160ms ease;
}

.dash-quick-link:hover,
.dash-quick-link:focus-visible {
  border-color: var(--line-strong);
  background: rgba(217, 79, 61, 0.08);
  transform: translateY(-2px);
  outline: none;
}

.dash-quick-link strong {
  color: var(--c-primary);
  font-size: var(--fs-sm);
}

/* ──────────────────────────────────────────────────────────
 *  About page: tech stack grid
 * ────────────────────────────────────────────────────────── */
.tech-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  margin-top: var(--space-3);
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.55);
}

.tech-item strong {
  color: var(--c-primary);
  font-size: var(--fs-sm);
}

.tech-item span {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ──────────────────────────────────────────────────────────
 *  Changelog — teaser (home page) + full timeline + roadmap
 * ────────────────────────────────────────────────────────── */
.changelog-teaser {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.changelog-teaser li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.55);
  color: var(--text);
  font-size: var(--fs-sm);
  flex-wrap: wrap;
}

.changelog-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.changelog-tag-new      { background: rgba(217, 79, 61, 0.16);  color: var(--c-primary); border: 1px solid rgba(217, 79, 61, 0.35); }
.changelog-tag-improved { background: rgba(217, 154, 78, 0.16);  color: var(--c-warm);    border: 1px solid rgba(217, 154, 78, 0.35); }
.changelog-tag-fixed    { background: rgba(95, 185, 138, 0.14);  color: var(--ok);        border: 1px solid rgba(95, 185, 138, 0.35); }
.changelog-tag-removed  { background: rgba(224, 85, 106, 0.14);   color: var(--danger);    border: 1px solid rgba(224, 85, 106, 0.34); }

/* Full changelog timeline */
.changelog-timeline {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding-left: 0;
  display: grid;
  gap: var(--space-3);
}

.changelog-entry {
  position: relative;
  padding: 16px 18px 16px 22px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.62);
}

.changelog-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c-secondary), var(--c-primary));
}

.changelog-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.changelog-meta strong {
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--fs-base);
}

.changelog-version {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.changelog-entry ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.changelog-entry ul li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text);
  font-size: var(--fs-sm);
}

/* Roadmap (numbered list with bigger styling) */
.roadmap-list {
  list-style: none;
  counter-reset: roadmap;
  padding-left: 0;
  margin: var(--space-3) 0 0;
  display: grid;
  gap: var(--space-2);
}

.roadmap-list li {
  counter-increment: roadmap;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(26, 24, 30, 0.6);
  align-items: start;
}

.roadmap-list li::before {
  content: counter(roadmap, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  color: var(--on-primary);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: var(--fs-sm);
}

.roadmap-list li strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-base);
  margin-bottom: 2px;
}

.roadmap-list li span {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ──────────────────────────────────────────────────────────
 *  Empty state (blog "coming soon", etc.)
 * ────────────────────────────────────────────────────────── */
.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(28px, 5vw, 56px) 16px;
}

.empty-state-icon {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-3);
  opacity: 0.85;
  filter: drop-shadow(0 4px 16px rgba(217, 79, 61, 0.25));
}

.empty-state h2 {
  margin-bottom: 6px;
}

.empty-state p {
  max-width: 50ch;
}

/* ──────────────────────────────────────────────────────────
 *  Premium tier UI (dashboard "My Premium" + admin grant)
 * ────────────────────────────────────────────────────────── */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.premium-badge-active {
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  color: var(--on-primary);
  box-shadow: 0 4px 14px rgba(217, 79, 61, 0.32);
}

.premium-badge-inactive {
  background: rgba(140, 140, 140, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--line);
}

.kv-line {
  margin: 0 0 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.kv-line strong {
  color: var(--text);
  font-size: var(--fs-sm);
}

.premium-grant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  background: rgba(26, 24, 30, 0.5);
  border: 1px solid var(--line);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.premium-grant-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  flex-shrink: 0;
}

.premium-grant-add {
  background: rgba(217, 79, 61, 0.16);
  color: var(--c-primary);
  border: 1px solid rgba(217, 79, 61, 0.35);
}

.premium-grant-revoked {
  background: rgba(224, 85, 106, 0.14);
  color: var(--danger);
  border: 1px solid rgba(224, 85, 106, 0.34);
}

/* Compact audit log state diffs — soft monospace, wraps on small screens */
.audit-states {
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  word-break: break-all;
  white-space: normal;
  display: inline-block;
  max-width: 380px;
}

/* ──────────────────────────────────────────────────────────
 *  Scroll-reveal islands
 * ──────────────────────────────────────────────────────────
 *  `.reveal` elements start hidden and slid down a touch. An
 *  IntersectionObserver (index.js) toggles `.in-view` as each
 *  element enters / leaves the viewport, so islands fade in on
 *  the way down and fade back out on the way up — giving the
 *  page a calm, breathing rhythm rather than a static wall.
 *
 *  Stagger: wrap a row of cards in `.stagger` and its direct
 *  `.reveal` children pick up incremental delays via nth-child.
 *  Direction variants: `.reveal-left` / `.reveal-right` slide
 *  in horizontally for alternating "island" layouts.
 * ────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 620ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 620ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal-left  { transform: translateX(-44px); }
.reveal-right { transform: translateX(44px); }

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Staggered children — each successive island lags the previous one */
.stagger > .reveal:nth-child(1) { --reveal-delay: 0ms; }
.stagger > .reveal:nth-child(2) { --reveal-delay: 90ms; }
.stagger > .reveal:nth-child(3) { --reveal-delay: 180ms; }
.stagger > .reveal:nth-child(4) { --reveal-delay: 270ms; }
.stagger > .reveal:nth-child(5) { --reveal-delay: 360ms; }
.stagger > .reveal:nth-child(6) { --reveal-delay: 450ms; }
.stagger > .reveal:nth-child(7) { --reveal-delay: 540ms; }
.stagger > .reveal:nth-child(8) { --reveal-delay: 630ms; }

/* Toast keeps its own little entrance (not scroll-driven) */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respect reduced-motion preferences — show everything instantly */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Fallback: if JS is disabled, never leave content hidden */
.no-js .reveal,
.no-js .reveal-left,
.no-js .reveal-right {
  opacity: 1;
  transform: none;
}

/* ──────────────────────────────────────────────────────────
 *  Home — alternating "islands"
 * ────────────────────────────────────────────────────────── */
.home-island {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  align-items: center;
  gap: clamp(18px, 3vw, 48px);
  padding: clamp(22px, 3.5vw, 48px);
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(217, 79, 61, 0.08), transparent 70%),
    linear-gradient(155deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow-soft);
}

.home-island-reverse { grid-template-columns: 0.55fr 1.45fr; }
.home-island-reverse .home-island-body { order: 2; }
.home-island-reverse .home-island-visual { order: 1; }
.home-island-reverse {
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(224, 134, 63, 0.08), transparent 70%),
    linear-gradient(155deg, var(--surface), var(--surface-strong));
}

.island-eyebrow {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-primary);
}

.home-island-body h2 { margin-bottom: 10px; }
.home-island-body p { max-width: 60ch; }

.island-link {
  display: inline-block;
  margin-top: var(--space-3);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--c-primary);
  text-decoration: none;
}
.island-link:hover { color: var(--c-secondary); }

.home-island-visual {
  display: grid;
  place-items: center;
}

.visual-chip {
  width: clamp(96px, 12vw, 150px);
  height: clamp(96px, 12vw, 150px);
  border-radius: var(--radius-l);
  display: grid;
  place-items: center;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  background:
    radial-gradient(circle at 30% 25%, rgba(217, 79, 61, 0.22), transparent 65%),
    linear-gradient(145deg, rgba(38, 36, 44, 0.9), rgba(20, 19, 24, 0.95));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-soft);
}

@media (max-width: 760px) {
  .home-island,
  .home-island-reverse { grid-template-columns: 1fr; text-align: left; }
  .home-island-reverse .home-island-body { order: 1; }
  .home-island-reverse .home-island-visual { order: 2; }
  .home-island-visual { justify-self: start; }
}

/* Closing CTA band */
.home-cta {
  text-align: center;
  padding: clamp(28px, 4vw, 56px) clamp(18px, 3vw, 40px);
  border-radius: var(--radius-l);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(217, 79, 61, 0.12), transparent 70%),
    linear-gradient(160deg, var(--surface-strong), var(--bg-1));
  box-shadow: var(--shadow-heavy);
}
.home-cta h2 { margin-bottom: 8px; }
.home-cta p { max-width: 54ch; margin: 0 auto var(--space-4); }

/* ──────────────────────────────────────────────────────────
 *  Guide cards (scenario walkthroughs)
 * ────────────────────────────────────────────────────────── */
.guide-card {
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow-soft);
}

.guide-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.guide-num {
  flex-shrink: 0;
  width: clamp(44px, 6vw, 58px);
  height: clamp(44px, 6vw, 58px);
  display: grid;
  place-items: center;
  border-radius: var(--radius-m);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--c-secondary), var(--c-primary));
  box-shadow: var(--shadow-soft);
}

.guide-head h2 { margin: 0; }

.guide-steps {
  list-style: none;
  counter-reset: gstep;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.guide-steps li {
  counter-increment: gstep;
  position: relative;
  padding: 12px 14px 12px 46px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  font-size: var(--fs-sm);
}

.guide-steps li::before {
  content: counter(gstep);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--c-primary);
  background: rgba(217, 79, 61, 0.12);
  border: 1px solid var(--line-strong);
}

.guide-note {
  margin: var(--space-3) 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--c-primary);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: rgba(217, 79, 61, 0.07);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* Changelog security tag */
.changelog-tag-security {
  background: rgba(224, 85, 106, 0.16);
  color: var(--danger);
  border: 1px solid rgba(224, 85, 106, 0.34);
}

/* ──────────────────────────────────────────────────────────
 *  Forum
 * ────────────────────────────────────────────────────────── */
.forum-thread-list {
  display: grid;
  gap: 2px;
}

.forum-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: 130ms ease;
}

.forum-thread-row:hover {
  background: rgba(217, 79, 61, 0.06);
  border-color: var(--line);
}

.forum-thread-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.forum-thread-title {
  font-weight: 700;
  font-size: var(--fs-base);
}

.forum-thread-meta {
  display: flex;
  gap: 14px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.forum-flag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.forum-flag.pin  { background: rgba(217, 154, 78, 0.18); color: var(--c-warm); border: 1px solid rgba(217, 154, 78, 0.35); }
.forum-flag.lock { background: rgba(224, 85, 106, 0.16); color: var(--danger); border: 1px solid rgba(224, 85, 106, 0.32); }
.forum-flag.op   { background: rgba(217, 79, 61, 0.16); color: var(--c-primary); border: 1px solid var(--line-strong); }
.forum-flag.solved { background: rgba(74, 175, 110, 0.18); color: #4aaf6e; border: 1px solid rgba(74, 175, 110, 0.38); }

.forum-post {
  padding: 16px 18px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: linear-gradient(155deg, var(--surface), var(--surface-strong));
  margin-bottom: 10px;
}

.forum-post-op {
  border-color: var(--line-strong);
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(217, 79, 61, 0.06), transparent 70%),
    linear-gradient(155deg, var(--surface), var(--surface-strong));
}

.forum-post-deleted { opacity: 0.55; }

.forum-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.forum-post-author {
  font-weight: 800;
  color: var(--c-primary);
  font-size: var(--fs-sm);
}

.forum-post-body {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.forum-post-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
  text-decoration: underline;
  min-height: auto;
  padding: 0;
}
.forum-post-del:hover { color: var(--danger); }

/* ──────────────────────────────────────────────────────────
 *  Dashboard — role banner + feature toggles
 * ────────────────────────────────────────────────────────── */
.dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface), var(--surface-strong));
}
.dash-banner strong { display: block; color: var(--text); }
.dash-banner .small { color: var(--text-muted); }
.dash-banner-admin {
  border-color: var(--line-strong);
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(217, 79, 61, 0.1), transparent 70%),
    linear-gradient(150deg, var(--surface), var(--surface-strong));
}

.feature-toggle-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.feature-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.feature-toggle strong { display: block; color: var(--text); font-size: var(--fs-sm); }
.feature-toggle .small { color: var(--text-muted); }

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  transition: 180ms ease;
}
.switch-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: 180ms ease;
}
.switch input:checked + .switch-track {
  background: linear-gradient(130deg, var(--c-secondary), var(--c-primary));
  border-color: var(--line-strong);
}
.switch input:checked + .switch-track::before {
  transform: translateX(20px);
  background: var(--on-primary);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────
 *  Breakpoint overrides
 * ────────────────────────────────────────────────────────── */

/* ── ≤860px: collapse nav into hamburger ────────────────── */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    gap: 2px;
  }

  .site-nav.nav-open { display: flex; }

  .site-nav a,
  .site-nav .nav-note,
  .site-nav .nav-cta,
  .site-nav .nav-dd-summary {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    text-align: left;
  }

  /* Dropdowns expand inline inside the collapsed mobile nav */
  .site-nav .nav-dd { width: 100%; }
  .site-nav .nav-dd-menu {
    position: static;
    min-width: 0;
    padding: 2px 0 2px 14px;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-note { max-width: 100%; }
}

/* ── ≤480px: small phone polish ─────────────────────────── */
@media (max-width: 480px) {
  body { padding: 10px 8px 24px; }

  .card,
  .section-shell,
  .hero-section,
  .auth-panel,
  .auth-card { border-radius: var(--radius-m); }

  .topbar { border-radius: var(--radius-l); }

  h1 { letter-spacing: -0.01em; }
}

/* ──────────────────────────────────────────────────────────
 *  Print
 * ────────────────────────────────────────────────────────── */
@media print {
  .topbar, .site-footer, .toast-container, .backdrop-grid, .backdrop-glow,
  .nav-toggle { display: none !important; }

  body {
    background: white;
    color: black;
    padding: 0;
  }

  .card, .section-shell, .hero-section {
    border: 1px solid #999;
    box-shadow: none;
    background: white;
    color: black;
  }
}

/* ── Analytics dashboard ─────────────────────────────────── */
.an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.an-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.an-num { font-family: "Space Grotesk", sans-serif; font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.an-health { font-family: "Space Grotesk", sans-serif; font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 800; line-height: 1; color: var(--c-primary); }
.an-bar-track { height: 10px; background: rgba(184, 178, 196, 0.14); border-radius: 999px; overflow: hidden; }
.an-bar-fill { height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-secondary)); border-radius: 999px; transition: width 0.5s ease; }
.an-chart { width: 100%; height: 130px; display: block; }
.an-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); }
.an-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.an-rule-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: var(--text-muted); font-size: 11px; font-style: italic; font-weight: 700; cursor: pointer; margin-left: 7px; vertical-align: middle; user-select: none; }
.info-tip:hover, .info-tip:focus { color: var(--text); border-color: var(--line-strong); outline: none; }
.info-pop { position: fixed; z-index: 200; display: none; max-width: 280px; background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.45; color: var(--text); box-shadow: var(--shadow-heavy); pointer-events: none; }
