/* --- Colors -----------------------------------------------------------------
   Light by default; dark follows the system unless a theme is picked
   (data-theme on <html>). The accent color comes from data-accent. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9ecf1;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --danger: #d92d20;
  --ok: #079455;
  --ink: #000;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-lift: 0 12px 32px rgb(16 24 40 / 12%), 0 2px 6px rgb(16 24 40 / 6%);
  --radius: 12px;
  --radius-sm: 8px;
  --gap: 16px;
  --pad: 20px;
  --topbar: 56px;
  --sidebar: 252px;

  --accent: #5865f2;
  --accent-2: #8b5cf6;
  --accent-text: #ffffff;

  /* Case actions. */
  --c-ban: #ef4444;
  --c-softban: #f43f5e;
  --c-unban: #22c55e;
  --c-kick: #f97316;
  --c-timeout: #f59e0b;
  --c-untimeout: #14b8a6;
  --c-warn: #eab308;
  --c-note: #3b82f6;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --surface: #161920;
    --surface-2: #1d2129;
    --surface-3: #262b35;
    --text: #eceef2;
    --muted: #98a2b3;
    --border: #2a2f3a;
    --danger: #f97066;
    --ok: #47cd89;
    --ink: #fff;
    --shadow: 0 1px 2px rgb(0 0 0 / 35%);
    --shadow-lift: 0 16px 40px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #161920;
  --surface-2: #1d2129;
  --surface-3: #262b35;
  --text: #eceef2;
  --muted: #98a2b3;
  --border: #2a2f3a;
  --danger: #f97066;
  --ok: #47cd89;
  --ink: #fff;
  --shadow: 0 1px 2px rgb(0 0 0 / 35%);
  --shadow-lift: 0 16px 40px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

[data-accent="violet"] { --accent: #7c3aed; --accent-2: #d946ef; }
[data-accent="pink"] { --accent: #db2777; --accent-2: #f97316; }
[data-accent="orange"] { --accent: #ea580c; --accent-2: #eab308; }
[data-accent="gold"] { --accent: #b45309; --accent-2: #f43f5e; }
[data-accent="green"] { --accent: #059669; --accent-2: #06b6d4; }
[data-accent="cyan"] { --accent: #0891b2; --accent-2: #6366f1; }
[data-accent="red"] { --accent: #e11d48; --accent-2: #f97316; }

[data-density="compact"] {
  --gap: 10px;
  --pad: 14px;
  font-size: 13.5px;
}

/* Feature colors, used by icon chips and stat tiles. */
.tone-blue { --tone: #3b82f6; }
.tone-pink { --tone: #ec4899; }
.tone-red { --tone: #ef4444; }
.tone-amber { --tone: #f59e0b; }
.tone-green { --tone: #10b981; }
.tone-purple { --tone: #8b5cf6; }
.tone-cyan { --tone: #06b6d4; }
.tone-gray { --tone: #64748b; }
.tone-accent { --tone: var(--accent); }

.act-ban { --act: var(--c-ban); }
.act-softban { --act: var(--c-softban); }
.act-unban { --act: var(--c-unban); }
.act-kick { --act: var(--c-kick); }
.act-timeout { --act: var(--c-timeout); }
.act-untimeout { --act: var(--c-untimeout); }
.act-warn { --act: var(--c-warn); }
.act-note { --act: var(--c-note); }

/* --- Base --------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 14.5px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  /* A soft wash of the accent colors behind everything, so pages don't sit on flat grey. */
  background:
    radial-gradient(1100px 520px at 85% -120px, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% -80px, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 1rem/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}

h3 {
  font-size: 0.95rem;
  margin: 18px 0 8px;
}

a {
  color: var(--accent);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: 600 0.72rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.icon {
  flex: none;
  width: 18px;
  height: 18px;
}

.icon.small {
  width: 16px;
  height: 16px;
}

.icon.tiny {
  width: 14px;
  height: 14px;
}

.muted,
.help {
  color: var(--muted);
}

.help {
  font-size: 0.86rem;
  margin: 0 0 10px;
}

.error-text {
  color: var(--danger);
}

.danger-text {
  color: var(--danger) !important;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

/* --- Top bar ------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar);
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

/* A thin accent stripe under the top bar. */
.topbar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

.brand span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav-toggle {
  display: none;
}

.search-button {
  justify-content: flex-start;
  gap: 8px;
  width: min(340px, 40vw);
  min-height: 36px;
  margin-inline-start: 24px;
  padding: 4px 8px 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
}

.search-button:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--text);
}

.search-label {
  flex: 1;
  text-align: start;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.account {
  position: relative;
}

.account-button {
  gap: 8px;
  min-height: 38px;
  padding: 3px 8px 3px 4px;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--border);
}

.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar.placeholder {
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.account-name {
  max-width: 18ch;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

/* Dropdowns: the account menu and the server switcher. */
.menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  animation: pop 0.12s ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item .icon {
  color: var(--muted);
}

.menu-item select {
  min-height: 30px;
  padding: 2px 8px;
}

.main {
  margin: 0 auto;
  padding: 32px 20px 120px;
}

/* --- Controls ------------------------------------------------------------------ */

button,
.button,
select,
input,
textarea {
  font: inherit;
  color: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: break-word;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

button:active,
.button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  color: var(--accent-text);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

.primary:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, var(--ink)), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
}

.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}

.ghost:hover {
  background: var(--surface-2);
}

.danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
}

.danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.small {
  min-height: 30px;
  padding: 2px 10px;
  font-size: 0.86rem;
}

/* "icon small" is a size, not a small button. */
svg.small {
  min-height: 0;
  padding: 0;
}

.big {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 1.02rem;
}

.icon-button {
  min-height: 36px;
  width: 36px;
  padding: 0;
  background: transparent;
  border-color: var(--border);
}

.icon-button:hover {
  background: var(--surface-2);
}

.link-button {
  min-height: 0;
  padding: 2px 4px;
  background: none;
  color: var(--accent);
  font-weight: 600;
}

select,
input,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

select:hover,
input:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.language,
select.auto {
  width: auto;
}

textarea {
  resize: vertical;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* An on/off switch: <span class="switch"><input type="checkbox"></span>, or
   <label class="switch"><input type="checkbox"> text</label>. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  transition: inset-inline-start 0.15s ease;
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::before {
  inset-inline-start: 20px;
}

/* --- Cards and layout ------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}

.content > * + *,
form.settings > * + * {
  margin-top: var(--gap);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--tone, var(--accent)) 13%, transparent);
  color: color-mix(in srgb, var(--tone, var(--accent)) 85%, var(--ink));
}

.chip-icon.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.chip-icon.sm .icon {
  width: 16px;
  height: 16px;
}

.chip-icon.lg {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.chip-icon.lg .icon {
  width: 22px;
  height: 22px;
}

/* Page headers and number tiles get a solid, glossy chip. */
.hero .chip-icon.lg,
.stat .chip-icon {
  background: linear-gradient(135deg, var(--tone, var(--accent)), color-mix(in srgb, var(--tone, var(--accent)) 60%, #1e1b4b));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 25%),
    0 6px 16px color-mix(in srgb, var(--tone, var(--accent)) 35%, transparent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar .help {
  margin: 0;
}

.toolbar input[type="search"] {
  flex: 1 1 200px;
  width: auto;
}

/* Page header: a tinted band in the page's color with a few soft shapes on the far side. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 22%, var(--border));
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--tone, var(--accent)) 13%, var(--surface)) 0%, var(--surface) 70%);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 28%;
  pointer-events: none;
  background: linear-gradient(135deg, var(--tone, var(--accent)), var(--accent-2));
  opacity: 0.12;
  transform: rotate(18deg);
}

.hero::before {
  width: 190px;
  height: 190px;
  inset-inline-end: -40px;
  top: -70px;
}

.hero::after {
  width: 96px;
  height: 96px;
  inset-inline-end: 150px;
  bottom: -58px;
  opacity: 0.08;
  transform: rotate(-12deg);
}

.hero h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* The overview header, painted in the server's gradient with its icon. */
.hero-banner {
  border: none;
  color: #fff;
  box-shadow: 0 14px 34px rgb(16 24 40 / 16%);
}

.hero-banner::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  transform: none;
  opacity: 1;
  background: radial-gradient(rgb(255 255 255 / 16%) 1.4px, transparent 1.6px) 0 0 / 16px 16px;
  mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
}

.hero-banner::after {
  width: 220px;
  height: 220px;
  inset-inline-end: 40px;
  bottom: -150px;
  background: #fff;
  opacity: 0.12;
}

.hero.hero-banner p {
  color: rgb(255 255 255 / 85%);
}

.hero-banner .guild-icon {
  border: 3px solid rgb(255 255 255 / 85%);
  box-shadow: 0 8px 20px rgb(0 0 0 / 20%);
}

.hero-banner .guild-icon.placeholder {
  background: rgb(255 255 255 / 22%);
  color: #fff;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero p {
  margin: 4px 0 0;
  max-width: 75ch;
  color: var(--muted);
}

.hero-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* On / off badge for a feature. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.status.on {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: color-mix(in srgb, var(--ok) 85%, var(--ink));
}

.status.on::before {
  opacity: 1;
}

.section-title {
  margin-top: 28px;
}

.login {
  max-width: 420px;
  margin: 10vh auto 0;
  padding: 36px 28px;
  text-align: center;
  display: grid;
  gap: 14px;
  justify-items: center;
}

/* The login card opens with an accent band behind the logo. */
.login {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: 52px;
}

.login::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 96px;
  z-index: -1;
  background:
    radial-gradient(rgb(255 255 255 / 20%) 1.3px, transparent 1.5px) 0 0 / 12px 12px,
    linear-gradient(120deg, var(--accent), var(--accent-2));
}

.login-art img {
  display: block;
  border: 4px solid var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
}

.loading,
.empty {
  text-align: center;
  padding: 24px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-inline-end: 8px;
  vertical-align: -3px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Placeholders while a page loads. */
.skeleton {
  display: grid;
  gap: 14px;
}

.sk {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.sk-title {
  width: 40%;
  height: 30px;
}

.sk-line {
  width: 65%;
  height: 14px;
  margin-bottom: 10px;
}

.sk-card {
  height: 180px;
  border-radius: var(--radius);
}

.sk-card.short {
  height: 110px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.badge,
.count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-accent {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

.badge-pink {
  background: rgb(236 72 153 / 12%);
  border-color: rgb(236 72 153 / 25%);
  color: color-mix(in srgb, #db2777 80%, var(--ink));
}

.badge-red {
  background: rgb(239 68 68 / 12%);
  border-color: rgb(239 68 68 / 25%);
  color: color-mix(in srgb, #dc2626 80%, var(--ink));
}

.badge-amber {
  background: rgb(245 158 11 / 13%);
  border-color: rgb(245 158 11 / 28%);
  color: color-mix(in srgb, #b45309 80%, var(--ink));
}

.badge-cyan {
  background: rgb(6 182 212 / 12%);
  border-color: rgb(6 182 212 / 25%);
  color: color-mix(in srgb, #0e7490 80%, var(--ink));
}

.badge-green {
  background: rgb(16 185 129 / 12%);
  border-color: rgb(16 185 129 / 25%);
  color: color-mix(in srgb, #047857 80%, var(--ink));
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* --- Servers -------------------------------------------------------------------- */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.server {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.server:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-lift);
}

.server-banner {
  position: relative;
  height: 64px;
}

/* Halftone dots over the server gradient, fading in from the far side. */
.server-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(rgb(255 255 255 / 20%) 1.3px, transparent 1.5px) 0 0 / 12px 12px;
  mask-image: linear-gradient(100deg, transparent 30%, #000 90%);
}

.banner-muted.server-banner::after {
  content: none;
}

.server-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 14px;
}

.server-body .guild-icon {
  margin-top: -20px;
  border: 3px solid var(--surface);
}

.server.faded {
  opacity: 0.75;
}

.server-name {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  padding-top: 8px;
}

.server-body .badge {
  margin-top: 8px;
}

.banner-0 { background: linear-gradient(120deg, #6366f1, #ec4899); }
.banner-1 { background: linear-gradient(120deg, #06b6d4, #3b82f6); }
.banner-2 { background: linear-gradient(120deg, #f97316, #e11d48); }
.banner-3 { background: linear-gradient(120deg, #10b981, #84cc16); }
.banner-4 { background: linear-gradient(120deg, #8b5cf6, #06b6d4); }
.banner-5 { background: linear-gradient(120deg, #f59e0b, #ef4444); }
.banner-6 { background: linear-gradient(120deg, #ec4899, #f59e0b); }
.banner-7 { background: linear-gradient(120deg, #14b8a6, #6366f1); }
.banner-muted { background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--border) 12px 24px); }

.guild-icon {
  flex: none;
  border-radius: 30%;
  object-fit: cover;
}

.guild-icon.xs {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.guild-icon.sm {
  width: 34px;
  height: 34px;
  font-size: 0.75rem;
}

.guild-icon.md {
  width: 48px;
  height: 48px;
}

.guild-icon.lg {
  width: 56px;
  height: 56px;
}

.guild-icon.placeholder {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 750;
}

/* --- One server: sidebar and pages ------------------------------------------------ */

.in-guild .main {
  max-width: none;
  padding: 0;
}

.guild-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar));
}

.sidebar {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - var(--topbar));
  padding: 14px 12px 24px;
  overflow-y: auto;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  scrollbar-width: thin;
}

.content {
  width: 100%;
  padding: 28px 32px 120px;
}

/* On wide screens settings cards flow into two columns, filled top to bottom
   like a masonry wall, so pages use the whole width without gaps under short cards. */
.settings-cards > * + * {
  margin-top: var(--gap);
}

@media (min-width: 1400px) {
  .settings-cards {
    columns: 2;
    column-gap: var(--gap);
  }

  .settings-cards > * {
    break-inside: avoid;
    margin: 0 0 var(--gap);
  }

  .settings-cards > * + * {
    margin-top: 0;
  }

  /* Side-by-side editors with a live preview need the full width. */
  .settings-cards > .embed-layout {
    column-span: all;
  }

  /* A page with one card keeps it full width. */
  .settings-cards:has(> :only-child) {
    columns: auto;
  }
}

@media (min-width: 2300px) {
  .settings-cards:not(:has(> :only-child)) {
    columns: 3;
  }
}

.nav-scrim {
  display: none;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-weight: 600;
}

.switcher-wrap {
  position: relative;
}

.switcher {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: start;
}

.switcher:hover,
.switcher[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.switcher-text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.switcher-text strong,
.switcher-text .muted {
  overflow-wrap: anywhere;
}

.switcher-text .muted {
  font-size: 0.78rem;
  font-weight: 500;
}

.switcher-menu {
  inset-inline: 0;
  min-width: 0;
}

.nav {
  display: grid;
  gap: 14px;
}

.nav-section {
  display: grid;
  gap: 1px;
}

.nav-heading {
  margin: 0 10px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: color-mix(in srgb, var(--text) 85%, var(--muted));
  text-decoration: none;
  font-weight: 550;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  color: color-mix(in srgb, var(--accent) 85%, var(--ink));
  font-weight: 650;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  inset-block: 7px;
  inset-inline-start: -12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--accent), var(--accent-2));
}

[dir="rtl"] .nav-link.active::before {
  border-radius: 4px 0 0 4px;
}

/* Each page keeps its own color in the sidebar. */
.nav-icon {
  display: inline-grid;
  place-items: center;
  color: color-mix(in srgb, var(--tone) 80%, var(--muted));
}

.nav-link:hover .nav-icon {
  color: var(--tone);
}

.nav-link.active .nav-icon {
  color: inherit;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}

.sidebar-note {
  margin: 0 6px;
}

/* --- Search (Ctrl+K) -------------------------------------------------------------- */

dialog.search {
  width: min(620px, calc(100vw - 24px));
  margin: 12vh auto auto;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.search-input,
.search-input:focus,
.search-input:hover {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 6px 0;
  font-size: 1.05rem;
  color: var(--text);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.search-results li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search-results li > .grow {
  display: grid;
  line-height: 1.3;
}

.search-results li .muted {
  font-size: 0.8rem;
}

.search-results li.selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.search-results li.empty {
  justify-content: center;
  cursor: default;
}

/* --- Overview -------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--gap);
}

.stat {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  background:
    radial-gradient(160px 110px at 100% 0%, color-mix(in srgb, var(--tone) 13%, transparent), transparent 70%),
    var(--surface);
}

/* A strip of the tile's color along the top. */
.stat::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 30%, var(--accent-2)));
}

a.stat {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

a.stat:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-weight: 550;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.feature:hover {
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 45%, var(--border));
  background: color-mix(in srgb, var(--tone, var(--accent)) 6%, var(--surface));
}

.feature.on {
  border-color: color-mix(in srgb, var(--tone) 35%, var(--border));
  background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 11%, var(--surface)), var(--surface) 80%);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: var(--gap);
}

.grid-2 > .card {
  margin: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.legend-chip {
  min-height: 28px;
  padding: 2px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--act) 40%, transparent);
  background: color-mix(in srgb, var(--act) 12%, transparent);
  color: color-mix(in srgb, var(--act) 70%, var(--ink));
  font-size: 0.84rem;
}

.legend-chip[aria-pressed="false"] {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--act);
}

.legend-chip[aria-pressed="false"] .legend-dot {
  background: var(--border);
}

.chart {
  position: relative;
  padding-top: 18px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 190px;
  overflow: visible;
}

.chart .grid {
  stroke: var(--border);
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.chart .seg {
  fill: var(--act);
}

.chart .bar-hit {
  fill: transparent;
}

.chart .bar:hover .bar-hit {
  fill: color-mix(in srgb, var(--accent) 8%, transparent);
}

.chart-max {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.meters {
  display: grid;
  gap: 8px;
}

.meter-row {
  display: grid;
  grid-template-columns: minmax(90px, 9rem) 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.meter-row:hover {
  background: var(--surface-2);
}

.meter-label {
  font-weight: 550;
  font-size: 0.9rem;
}

.meter,
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.meter-fill,
.progress-fill {
  display: block;
  height: 100%;
  width: var(--fill);
  border-radius: inherit;
}

.meter-fill {
  background: var(--act);
}

.progress-fill {
  background: var(--accent);
}

.meter-value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.leaders,
.recent,
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.leaders a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.leaders a:hover {
  background: var(--surface-2);
}

.rank {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.rank-1 { background: #fde68a; color: #78350f; }
.rank-2 { background: #e2e8f0; color: #1e293b; }
.rank-3 { background: #fed7aa; color: #7c2d12; }

.leader-name {
  flex: 1;
  min-width: 0;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.recent {
  margin-bottom: 12px;
}

.recent li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.recent li:last-child {
  border-bottom: none;
}

.recent-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.recent-text > * {
  overflow-wrap: anywhere;
}

.recent-text .muted {
  font-size: 0.85rem;
}

.recent-date {
  font-size: 0.8rem;
  white-space: nowrap;
}

.setup .toolbar {
  margin-bottom: 8px;
}

.setup .card-title {
  margin: 0;
}

.steps {
  margin-top: 12px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.step-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  color: #fff;
}

.steps li.done .step-mark {
  background: var(--ok);
  border-color: var(--ok);
}

.steps li.done > .grow,
.steps li.skipped > .grow {
  color: var(--muted);
}

.steps li.skipped > .grow {
  text-decoration: line-through;
}

.step-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.setup.folded .toolbar {
  margin-bottom: 0;
}

/* --- Activity --------------------------------------------------------------------- */

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.activity-row {
  display: flex;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.activity-head a {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
}

.activity-head .muted {
  font-size: 0.82rem;
}

.activity-summary {
  margin: 2px 0 0;
}

.activity-lines {
  margin: 6px 0 0;
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

/* --- Settings --------------------------------------------------------------------- */

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  max-width: 760px;
}

.field:last-child {
  margin-bottom: 0;
}

.field .help {
  margin: 0;
}

.field-label {
  font-weight: 700;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}

.switch-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.switch-text {
  display: grid;
  gap: 2px;
}

.switch-text .help {
  margin: 0;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 16px;
}

.checks.scroll {
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
}

.checks .empty {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 2px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.check:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
  flex: none;
}

.check-list .link-button {
  font-size: 0.85rem;
}

.check span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--role-color, #99aab5);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--role-color, #99aab5) 25%, transparent);
}

.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 25%, transparent), var(--shadow-lift);
  font-weight: 700;
  animation: rise 0.18s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* --- Tables (cases, roles) -------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

.table-wrap.flush {
  padding: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.cases .act-row td:first-child {
  border-inline-start: 4px solid var(--act);
}

.cases .number {
  white-space: nowrap;
}

.cases .date {
  min-width: 110px;
  font-size: 0.85rem;
  color: var(--muted);
}

.cases .number {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cases .person {
  min-width: 130px;
}

.person-button {
  display: grid;
  justify-items: start;
  gap: 0;
  min-height: 0;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 8px;
  background: none;
  font-weight: inherit;
  text-align: start;
}

.person-button:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.person-button .name {
  font-weight: 700;
  word-break: break-word;
}

.person-button .id {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.cases .reason {
  min-width: 180px;
  white-space: pre-wrap;
  word-break: break-word;
}

.action-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.duration {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.row-actions {
  display: grid;
  gap: 6px;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, var(--act) 16%, transparent);
  color: color-mix(in srgb, var(--act) 68%, var(--ink));
}

.roles .role-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-width: 160px;
}

/* Each group of roles starts with its name and how many roles it shows. */
.roles .group-row th {
  padding-top: 16px;
  background: transparent;
  color: var(--ink);
  border-bottom: 2px solid var(--border);
}

.roles .group-row:hover th {
  background: transparent;
}

/* --- Case filters ----------------------------------------------------------------- */

.filter-panel .legend {
  margin-bottom: 4px;
}

.more-filters summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
  width: fit-content;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.filter-grid .field {
  margin: 0;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  font-size: 0.82rem;
}

.filter-chip:hover {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.push-end {
  margin-inline-start: auto;
}

/* --- Dialogs and messages ------------------------------------------------------- */

dialog {
  width: min(520px, calc(100vw - 32px));
  color: var(--text);
}

dialog::backdrop {
  background: rgb(10 10 20 / 55%);
  backdrop-filter: blur(3px);
}

dialog textarea {
  margin-top: 4px;
}

.appearance h2 {
  margin-bottom: 4px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segment {
  min-height: 32px;
  padding: 4px 14px;
  background: none;
  color: var(--muted);
}

.segment[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--text);
}

/* The accent picker's swatches are bigger than the embed builder's ones further down. */
.appearance .swatch {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.accent-blurple { --swatch: #5865f2; }
.accent-violet { --swatch: #7c3aed; }
.accent-pink { --swatch: #db2777; }
.accent-orange { --swatch: #ea580c; }
.accent-gold { --swatch: #b45309; }
.accent-green { --swatch: #059669; }
.accent-cyan { --swatch: #0891b2; }
.accent-red { --swatch: #e11d48; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow-lift);
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

/* --- Small screens ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .in-guild .nav-toggle {
    display: inline-flex;
  }

  .guild-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset-block: var(--topbar) 0;
    inset-inline-start: 0;
    z-index: 40;
    width: min(300px, 86vw);
    height: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.25));
  }

  [dir="rtl"] .sidebar {
    transform: translateX(105%);
  }

  .nav-open .sidebar {
    transform: none;
  }

  .nav-open .nav-scrim {
    display: block;
    position: fixed;
    inset: var(--topbar) 0 0 0;
    z-index: 39;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.45);
  }

  .content {
    padding: 20px 16px 120px;
  }

  .search-button {
    width: auto;
    margin-inline-start: auto;
  }

  .search-button .search-label,
  .search-button kbd {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding-inline: 12px;
  }

  .brand span {
    display: none;
  }

  .hero {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .hero-text {
    flex-basis: calc(100% - 64px);
  }

  .hero-extra {
    width: 100%;
  }

  h1 {
    font-size: 1.35rem;
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .push-end {
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Automod ---------------------------------------------------------------------- */

.rules {
  display: grid;
  gap: 10px;
}

.rule {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.rule:has(.rule-head input:checked) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.rule-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}

.rule-body .field {
  margin-bottom: 0;
}

.rule-body .field.wide {
  grid-column: 1 / -1;
  max-width: none;
}

.rule:not(:has(.rule-head input:checked)) .rule-body {
  opacity: 0.6;
}

/* --- Community ------------------------------------------------------------------ */

.message-box {
  display: grid;
  gap: 2px;
}

.char-count {
  justify-self: end;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.panel-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 10px;
}

.panel-list li {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.panel-list .badge {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* --- Custom commands ------------------------------------------------------------ */

.tag-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.tag-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tag-row input,
.tag-row textarea {
  background: var(--surface);
}

.tag-slash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

.tag-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tag-row .toolbar {
  flex-wrap: nowrap;
}

.tag-list,
.tag-row {
  min-width: 0;
}

.tag-row .tag-name {
  width: 0;
  min-width: 0;
  flex: 1;
}

.responder-row .toolbar {
  flex-wrap: wrap;
}

.responder-row .responder-trigger {
  flex: 1 1 180px;
  min-width: 0;
}

.responder-row select {
  width: auto;
}

.responder-row .responder-channel select {
  max-width: 220px;
}

@media (max-width: 560px) {
  .responder-row .responder-match,
  .responder-row .responder-channel,
  .responder-row .responder-channel select {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
}

.boost-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.boost-row select {
  width: 100%;
}

.boost-row .boost-multiplier {
  width: 80px;
}

/* --- Scheduled messages ----------------------------------------------------------- */

.scheduled-form .grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: start;
  margin-bottom: 12px;
}

.scheduled-form textarea {
  width: 100%;
}

.scheduled-actions {
  justify-content: flex-end;
}

.scheduled-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.scheduled-row {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.scheduled-content {
  margin: 8px 0 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --- Members ---------------------------------------------------------------------- */

.tip.danger {
  background: rgb(239 68 68 / 10%);
  border-color: color-mix(in srgb, #ef4444 40%, var(--border));
}

.stack {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.stack > .card {
  margin: 0;
}

.member-avatar {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.member-avatar.md {
  width: 40px;
  height: 40px;
}

.member-avatar.lg {
  width: 72px;
  height: 72px;
}

.member-avatar.placeholder {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.member-avatar.lg.placeholder {
  font-size: 1.5rem;
}

.member-names {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-names > * {
  overflow-wrap: anywhere;
}

.member-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.member-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.member-header .badges {
  margin-top: 6px;
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.member-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.member-list a:hover {
  background: var(--surface-2);
}

.member-list .member-names {
  flex: 1;
}

.member-list .muted {
  font-size: 0.85rem;
}

.member-grid {
  align-items: start;
}

.member-summary {
  margin-bottom: 12px;
}

.timeline {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 14px;
}

.timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 6px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--act, var(--accent));
}

.timeline-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.timeline-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
}

.timeline-reason {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-by {
  font-size: 0.8rem;
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.history-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* --- Leveling --------------------------------------------------------------------- */

.reward-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
  min-width: 0;
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.reward-row input,
.reward-row select {
  background: var(--surface);
}

.reward-row .reward-level {
  width: 5.5em;
  flex: none;
}

.reward-role {
  min-width: 0;
}

.reward-role select {
  width: 100%;
}

.leaderboard {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.leaderboard li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 0;
}

.leaderboard li:nth-child(odd) {
  background: var(--surface-2);
}

.board-rank {
  width: 2.5em;
  flex: none;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.board-name {
  display: grid;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.board-name strong,
.board-name .muted {
  overflow-wrap: anywhere;
}

.board-name:hover strong {
  text-decoration: underline;
}

.board-progress {
  width: 120px;
  flex: none;
}

.pager {
  margin-top: 12px;
}

.center {
  text-align: center;
}

@media (max-width: 600px) {
  .board-progress {
    display: none;
  }

  .reward-row {
    flex-wrap: wrap;
  }

  .reward-role {
    flex-basis: 100%;
    order: 3;
  }
}

.leaderboard .progress {
  background: var(--border);
}

.leaderboard .badge {
  min-width: 5.5em;
  text-align: center;
}

/* --- Tickets ---------------------------------------------------------------------- */

.ticket-filters {
  flex-wrap: wrap;
}

.ticket-filters input[type="search"] {
  min-width: 12em;
}

.ticket-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 4px;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.ticket-row:hover {
  background: var(--surface-2);
}

.ticket-number {
  width: 3.5em;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.ticket-main {
  display: grid;
  flex: 1;
  min-width: 0;
}

.ticket-subject,
.ticket-main .muted {
  overflow-wrap: anywhere;
}

.ticket-title {
  margin: 0;
  font-size: 1.4rem;
}

.ticket-subject-full {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 12px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.transcript {
  margin: 0;
  padding: 12px;
  max-height: 70vh;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --- Anti-nuke --------------------------------------------------------------------- */

.limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.limit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
}

.limit input {
  width: 76px;
}

.trusted-name:empty {
  display: none;
}

/* Ban appeals */
.appeal-page {
  max-width: 640px;
  margin: 6vh auto 0;
  padding: 28px;
  display: grid;
  gap: 14px;
}

.appeal-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.appeal-head h1 {
  margin: 0;
  font-size: 1.4rem;
  overflow-wrap: anywhere;
}

.appeal-form {
  display: grid;
  gap: 14px;
}

.appeal-form .button.big,
.appeal-form button.big {
  justify-self: start;
}

.appeal-answer {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.appeal-answer:first-of-type {
  border-top: 0;
}

.appeal-answer p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-row input {
  flex: 1;
  min-width: 0;
}

/* Ticket categories (a collapsible card on the Tickets page) */
.collapsible > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.collapsible > summary::-webkit-details-marker {
  display: none;
}

.collapsible > summary::after {
  content: "";
  margin-inline-start: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.collapsible[open] > summary::after {
  transform: rotate(-135deg);
}

.collapsible > summary .muted {
  font-weight: 400;
}

.collapsible[open] > summary {
  margin-bottom: 12px;
}

.category-row {
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.category-row :is(input, select, textarea) {
  background: var(--surface);
}

.category-row .field {
  max-width: none;
  margin-bottom: 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.7fr) minmax(0, 1.5fr);
  gap: 0 12px;
}

.category-grid .field:nth-child(4) {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Embed builder */
.embed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: var(--gap);
  align-items: start;
}

.embed-form > * + * {
  margin-top: var(--gap);
}

.embed-side {
  position: sticky;
  top: 72px;
}

.embed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.embed-grid .field,
.embed-form .field {
  max-width: none;
  align-content: start;
}

.link-bar {
  flex-wrap: nowrap;
}

.link-bar input {
  min-width: 0;
}

@media (max-width: 640px) {
  .link-bar {
    flex-wrap: wrap;
  }
}

.embed-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.embed-color-row input[type="color"] {
  width: 44px;
  min-height: 34px;
  padding: 2px;
}

.swatches {
  display: flex;
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.embed-field-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.embed-field-row :is(input, textarea) {
  background: var(--surface);
}

.embed-actions {
  position: sticky;
  bottom: 12px;
}

.embed-actions[hidden] {
  display: flex;
}

.sent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}

.sent-row:hover {
  background: var(--surface-2);
}

/* The preview looks like Discord's dark theme whatever the dashboard's theme. */
.embed-preview {
  background: #313338;
  color: #dbdee1;
  border-radius: 10px;
  padding: 14px 12px;
  overflow: hidden;
}

.discord-message {
  display: flex;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.375;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}

.discord-body {
  min-width: 0;
  flex: 1;
}

.discord-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.discord-head strong {
  color: #f2f3f5;
}

.discord-head .muted {
  color: #949ba4;
  font-size: 0.75rem;
}

.discord-bot-tag {
  background: #5865f2;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.discord-content,
.discord-embed-description,
.discord-embed-field div {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-preview a {
  color: #00a8fc;
}

.embed-preview code {
  background: #2b2d31;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.85em;
}

.embed-preview .mention {
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  padding: 0 2px;
  border-radius: 3px;
}

.embed-preview .muted {
  color: #949ba4;
}

.discord-embed {
  display: flex;
  gap: 16px;
  max-width: 432px;
  margin-top: 6px;
  padding: 10px 14px 14px 12px;
  background: #2b2d31;
  border-left: 4px solid var(--embed-color, #1e1f22);
  border-radius: 4px;
}

.discord-embed.no-color {
  border-left-color: #1e1f22;
}

.discord-embed-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
}

.discord-embed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f2f3f5;
}

.discord-embed-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.discord-embed-title {
  font-weight: 700;
  color: #f2f3f5;
}

.discord-embed-description {
  font-size: 0.875rem;
}

.discord-embed-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.discord-embed-field {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  min-width: 0;
}

.discord-embed-field.inline {
  grid-column: auto;
}

.discord-embed-field strong {
  color: #f2f3f5;
}

.discord-embed-field > strong {
  display: block;
  margin-bottom: 2px;
}

.discord-embed-image {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 4px;
}

.discord-embed-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
}

.discord-embed-footer {
  font-size: 0.75rem;
  color: #b5bac1;
}

@media (max-width: 1100px) {
  .embed-layout {
    grid-template-columns: 1fr;
  }

  .embed-side {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .embed-grid {
    grid-template-columns: 1fr;
  }
}

.link-bar > .muted {
  white-space: nowrap;
}

.small-text {
  font-size: 0.82rem;
}

/* Server stats */
.segmented.wrap {
  display: flex;
  flex-wrap: wrap;
}
.counter-edit {
  display: flex;
  gap: 8px;
  align-items: center;
}
.counter-edit input {
  flex: 1;
  min-width: 0;
}
.counter-row .counter-edit {
  margin-bottom: 4px;
}

/* Sticky messages */
.ticket-main .sticky-preview {
  white-space: pre-line;
}
@media (min-width: 640px) {
  .sent-row .row-actions {
    grid-auto-flow: column;
  }
}

/* Leaderboard periods */
.board-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

/* Backup page: what a restore would change. */
.backup-review {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.backup-review h3 {
  margin: 12px 0 6px;
  font-size: 0.95rem;
}

.backup-list {
  margin: 0 0 8px;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

/* --- Permissions ---------------------------------------------------------------- */

.perm-tabs .segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.preset-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}

.preset-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.preset-option input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  flex: none;
  box-shadow: none;
  accent-color: var(--accent);
}

.preset-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.preset-text strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.preset-text .help {
  margin: 0;
}

.preset-points {
  margin: 4px 0 0;
  padding-inline-start: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.preset-points li + li {
  margin-top: 2px;
}

.perm-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 14px;
}

.perm-current {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.perm-current .help {
  margin: 0;
}

.perm-review {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.perm-review h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.change-list {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.change-list li {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.change-values,
.command-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}

.command-chips code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.8rem;
}

.command-rules {
  display: grid;
  gap: 6px;
}

.command-rule {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.command-rule > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.command-rule > summary::-webkit-details-marker {
  display: none;
}

.command-rule > summary::after {
  content: "";
  margin-inline-start: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.command-rule[open] > summary::after {
  transform: rotate(-135deg);
}

.command-rule .badges {
  min-width: 0;
}

.command-name {
  font-weight: 700;
}

.command-rule-body {
  display: grid;
  gap: 12px;
  padding: 4px 12px 12px;
}

.command-rule-body .field {
  margin: 0;
}

.command-rule-body .checks.scroll {
  max-height: 220px;
  background: var(--surface);
}

.route-group + .route-group {
  margin-top: 14px;
}

.route-group h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.route-grid {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 14px;
}

.route-grid .field-label {
  overflow-wrap: anywhere;
}

.route-grid .field,
.route-grid .field:last-child {
  margin: 0 0 12px;
}

/* --- Guide ---------------------------------------------------------------------- */

.guide-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--gap);
}

.guide-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--gap);
}

.guide-part-card {
  display: grid;
  align-content: start;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.guide-part-card .chip-icon {
  margin-bottom: 6px;
}

.guide-part-card strong {
  font-size: 1.05rem;
}

.guide-part-card .muted {
  font-size: 0.88rem;
}

.guide-count {
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.guide-part-card:hover,
.guide-row:hover,
.guide-pager-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-lift);
}

.guide-part-card:hover {
  transform: translateY(-2px);
}

.guide-list {
  display: grid;
  gap: 10px;
}

.guide-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--pad);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-row > .grow {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.guide-row .muted {
  font-size: 0.88rem;
}

.guide-row-part {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guide-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.guide-crumbs a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.guide-crumbs [aria-current] {
  color: var(--text);
  font-weight: 600;
}

[dir="rtl"] .guide-crumbs .icon,
[dir="rtl"] .guide-pager .icon {
  transform: scaleX(-1);
}

.guide-siblings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--gap);
}

.guide-sibling {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.guide-sibling:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.guide-sibling[aria-current] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.guide-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.guide-body > p,
.guide-body .tip {
  margin: 0;
}

.guide-steps,
.guide-tips {
  margin: 6px 0 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 6px;
}

.guide-table td:first-child {
  width: 34%;
  font-weight: 600;
}

.guide-commands td:first-child {
  font-weight: 400;
}

.guide-table td code,
.guide-body li code,
.guide-body p code,
.guide-row code,
.hero p code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font: 0.85em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.guide-example pre {
  margin: 6px 0 0;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: 0.85rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.guide-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.guide-pager-link {
  display: grid;
  gap: 4px;
  padding: 14px var(--pad);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.guide-pager-link .muted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.guide-pager-link.next {
  text-align: end;
}

.guide-pager-link.next .muted {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .guide-pager {
    grid-template-columns: 1fr;
  }

  /* Each row of a guide table becomes a small block: the command, then what it does. */
  .guide-table thead {
    display: none;
  }

  .guide-table tr {
    display: grid;
    border-bottom: 1px solid var(--border);
  }

  .guide-table tbody tr:last-child {
    border-bottom: none;
  }

  .guide-table td,
  .guide-table td:first-child {
    width: auto;
    border-bottom: none;
  }

  .guide-table td:first-child {
    padding-bottom: 2px;
  }

  .guide-table td:last-child {
    padding-top: 2px;
  }
}

/* --- Landing page (logged out) ------------------------------------------------------ */

/* Narrower than the dashboard so lines stay readable on wide screens. */
.landing {
  display: grid;
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
}

/* A full-color band in the accent gradient, with made-up bot messages on the far side. */
.landing-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 40px;
  padding: 56px 52px;
  border-radius: calc(var(--radius) + 10px);
  color: #fff;
  background:
    radial-gradient(600px 340px at 85% 40%, rgb(255 255 255 / 18%), transparent 70%),
    linear-gradient(125deg, color-mix(in srgb, var(--accent) 85%, #0b0820), var(--accent) 45%, var(--accent-2));
  box-shadow: 0 24px 60px color-mix(in srgb, var(--accent) 30%, transparent), 0 4px 12px rgb(16 24 40 / 12%);
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(rgb(255 255 255 / 18%) 1.4px, transparent 1.6px) 0 0 / 18px 18px;
  mask-image: linear-gradient(100deg, transparent 30%, #000 90%);
}

.landing-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  inset-inline-end: -90px;
  bottom: -220px;
  border-radius: 30%;
  background: #fff;
  opacity: 0.1;
  transform: rotate(22deg);
}

.landing-copy {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 18px rgb(0 0 0 / 18%);
}

.landing-tagline {
  margin: 0;
  max-width: 54ch;
  font-size: 1.12rem;
  line-height: 1.55;
  color: rgb(255 255 255 / 88%);
}

.landing-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 22%);
  font-weight: 600;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-invite,
.landing-invite:hover {
  background: #fff;
  color: color-mix(in srgb, var(--accent) 80%, #000);
  border-color: transparent;
  box-shadow: 0 8px 22px rgb(0 0 0 / 18%);
}

.landing-invite:hover {
  transform: translateY(-1px);
}

.landing-login,
.landing-login:hover {
  background: rgb(255 255 255 / 14%);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 40%);
}

.landing-login:hover {
  background: rgb(255 255 255 / 22%);
}

.landing-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(255 255 255 / 90%);
}

.landing-points li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.landing-points .icon {
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 50%;
  background: rgb(255 255 255 / 22%);
}

.landing-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  background: rgb(0 0 0 / 20%);
  border: 1px solid rgb(255 255 255 / 22%);
  backdrop-filter: blur(4px);
}

.landing-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(255 255 255 / 60%);
}

.landing-status.on::before {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgb(74 222 128 / 25%);
  animation: pulse 2s ease-in-out infinite;
}

.landing-status.off::before {
  background: #fca5a5;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgb(74 222 128 / 0%);
  }
}

/* Three Discord-style messages, staggered like a chat. */
.landing-art {
  display: grid;
  gap: 14px;
}

.landing-demo {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #313338;
  color: #dbdee1;
  box-shadow: 0 18px 40px rgb(0 0 0 / 28%);
  animation: float 6s ease-in-out infinite;
}

.landing-demo:nth-child(2) {
  margin-inline-start: 36px;
  animation-delay: -2s;
}

.landing-demo:nth-child(3) {
  margin-inline-end: 24px;
  animation-delay: -4s;
}

.landing-demo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.landing-demo > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.landing-demo-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 650;
  color: #f2f3f5;
}

.landing-demo-bot {
  padding: 0 5px;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
}

.landing-demo-embed {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border-inline-start: 4px solid var(--tone);
  border-radius: 4px;
  background: #2b2d31;
  font-size: 0.84rem;
}

.landing-demo-embed strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f2f3f5;
}

.landing-demo-embed .icon {
  width: 15px;
  height: 15px;
  color: var(--tone);
}

@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}

/* The live numbers: one band, split into cells. */
.landing-stats-band {
  margin-top: -28px;
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.landing-stat {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 20px 22px;
}

.landing-stat + .landing-stat {
  border-inline-start: 1px solid var(--border);
}

.landing-stat .chip-icon {
  margin-bottom: 6px;
}

.landing-stat strong {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.landing-stat span:last-child {
  font-size: 0.85rem;
  color: var(--muted);
}

.landing-stat.tone-green strong {
  color: var(--tone);
}

/* The 30-day uptime: one bar a day, along the bottom of the band. */
.landing-uptime {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 18px 22px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, #10b981 8%);
}

.landing-uptime-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 16px;
  font-size: 0.9rem;
}

.landing-uptime-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.landing-uptime-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.landing-uptime-live.on::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgb(16 185 129 / 25%);
  animation: pulse 2s ease-in-out infinite;
}

.uptime-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  height: 34px;
}

.uptime-bar {
  border-radius: 4px;
  background: var(--border);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.uptime-bar:hover {
  transform: scaleY(1.12);
  filter: brightness(1.1);
}

.uptime-bar.up {
  background: #10b981;
}

.uptime-bar.dip {
  background: #f59e0b;
}

.uptime-bar.down {
  background: #ef4444;
}

.landing-uptime-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.landing-status-uptime {
  padding-inline-start: 8px;
  border-inline-start: 1px solid rgb(255 255 255 / 30%);
  font-variant-numeric: tabular-nums;
}

.sk-stat {
  height: 108px;
  margin: 1px;
}

.landing-section {
  display: grid;
  gap: 8px;
  scroll-margin-top: 80px;
}

.landing-section h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-intro {
  margin: 0 0 12px;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.landing-feature {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  margin: 0;
  background:
    radial-gradient(200px 120px at 100% 0%, color-mix(in srgb, var(--tone) 11%, transparent), transparent 70%),
    var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.landing-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--tone) 40%, var(--border));
}

.landing-feature h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.landing-feature p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.landing-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.landing-commands code {
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tone) 10%, var(--surface-2));
  color: color-mix(in srgb, var(--tone) 70%, var(--text));
  font-size: 0.78rem;
  white-space: nowrap;
}

/* How it works: three numbered cards. */
.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-step {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  margin: 0;
  padding-top: 26px;
}

.landing-step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  font-weight: 800;
}

.landing-step h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 1.08rem;
}

.landing-step h3 .icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.landing-step p {
  margin: 0;
  color: var(--muted);
}

.landing-step .landing-step-action {
  margin-top: 6px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  color: var(--accent-text);
  box-shadow: none;
}

/* What the dashboard gives staff: a plain list, no cards. */
.landing-dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 28px;
}

.landing-dash-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.landing-dash-item h3 {
  margin: 4px 0 2px;
  font-size: 1rem;
}

.landing-dash-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Native <details>, so it works without script and stays keyboard friendly. */
.landing-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px var(--gap);
}

.landing-faq details {
  margin: 0;
  padding: 0;
}

.landing-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.landing-faq summary::-webkit-details-marker {
  display: none;
}

.landing-faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.15s ease;
}

.landing-faq details[open] summary::after {
  transform: rotate(45deg);
}

.landing-faq details p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
}

/* The closing call to action: a tinted band like the page headers. */
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 36px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface)));
}

.landing-cta h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.landing-cta p {
  margin: 4px 0 0;
  color: var(--muted);
}

.landing-cta .landing-invite {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  color: var(--accent-text);
}

.landing-cta .landing-login {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.landing-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: -24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.landing-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.landing-footer :is(a, .link-button) {
  padding: 0;
  text-decoration: none;
  color: var(--muted);
  font-weight: 550;
}

.landing-footer :is(a, .link-button):hover {
  color: var(--accent);
}

/* --- Terms and Privacy pages (src/dashboard/legal) --------------------------- */

.legal {
  max-width: 76ch;
  margin: 0 auto;
  line-height: 1.65;
}

.legal h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal h2 {
  margin: 40px 0 8px;
  font-size: 1.3rem;
  font-weight: 750;
  scroll-margin-top: 80px;
}

.legal h3 {
  margin: 24px 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
}

.legal p,
.legal ul {
  margin: 8px 0;
}

.legal li + li {
  margin-top: 4px;
}

.legal a {
  color: var(--accent);
}

.legal code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.9em;
}

.legal-updated {
  color: var(--muted);
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 24px 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.92rem;
}

.legal-toc a {
  text-decoration: none;
  font-weight: 550;
}

.legal-table {
  overflow-x: auto;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.legal :is(th, td) {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.legal-placeholder {
  color: var(--danger);
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.legal-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}

.legal-footer a:hover,
.legal-footer a[aria-current] {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-art {
    display: none;
  }

  .landing-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-stat:nth-child(3n + 1) {
    border-inline-start: 0;
  }

  .landing-stat:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

  .landing-features,
  .landing-dash {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .landing {
    gap: 44px;
  }

  .landing-hero {
    padding: 36px 22px;
  }

  .landing-stats-band {
    margin-top: -20px;
  }

  .landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-stat:nth-child(n) {
    border-inline-start: 0;
    border-top: 0;
  }

  .landing-stat:nth-child(even) {
    border-inline-start: 1px solid var(--border);
  }

  .landing-stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .landing-stat {
    padding: 16px;
  }

  .landing-uptime {
    padding: 16px;
  }

  .uptime-bars {
    gap: 2px;
    height: 28px;
  }

  .landing-features,
  .landing-steps,
  .landing-dash,
  .landing-faq {
    grid-template-columns: 1fr;
  }

  /* Icon (or step number) beside the title, to keep the long list short. */
  .landing-feature,
  .landing-step {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: none;
    align-items: center;
    column-gap: 12px;
    padding-top: var(--pad, 18px);
  }

  .landing-feature > *,
  .landing-step > * {
    grid-column: 1 / -1;
  }

  .landing-feature > .chip-icon,
  .landing-step > .landing-step-number {
    grid-column: 1;
  }

  .landing-feature h3,
  .landing-step h3 {
    grid-column: 2;
    margin: 0;
  }

  .landing-step .landing-step-action {
    justify-self: stretch;
  }

  .landing-actions,
  .landing-actions .button {
    width: 100%;
  }

  .landing-cta {
    padding: 22px;
  }
}

/* --- Rumble style ------------------------------------------------------------------
   An optional game-style look (Appearance > Style): chunky Lilita One headings,
   bold outlines, hard comic shadows and full-color page headers. Everything here
   sits under data-style="rumble" on <html>, so the clean style is untouched.
   Lilita One is under the SIL Open Font License (fonts/LilitaOne-OFL.txt). */

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lilita-one-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lilita-one-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root[data-style="rumble"] {
  --display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --pop: 4px 4px 0 var(--outline);
  --pop-sm: 2px 2px 0 var(--outline);
  --radius: 14px;
}

/* Warm paper in light mode, deep purple at night. */
@media (prefers-color-scheme: light) {
  :root[data-style="rumble"]:not([data-theme="dark"]) {
    --bg: #fff6e6;
    --surface-2: #fff3dd;
    --border: #eadbc2;
    --outline: #24183f;
  }
}

:root[data-style="rumble"][data-theme="light"] {
  --bg: #fff6e6;
  --surface-2: #fff3dd;
  --border: #eadbc2;
  --outline: #24183f;
}

@media (prefers-color-scheme: dark) {
  :root[data-style="rumble"]:not([data-theme="light"]) {
    --bg: #130f20;
    --surface: #1c1730;
    --surface-2: #241e3b;
    --surface-3: #2e2749;
    --border: #3a3158;
    --outline: #050309;
  }
}

:root[data-style="rumble"][data-theme="dark"] {
  --bg: #130f20;
  --surface: #1c1730;
  --surface-2: #241e3b;
  --surface-3: #2e2749;
  --border: #3a3158;
  --outline: #050309;
}

[data-style="rumble"] body {
  background:
    radial-gradient(color-mix(in srgb, var(--outline) 9%, transparent) 1.1px, transparent 1.4px) 0 0 / 18px 18px,
    radial-gradient(1100px 520px at 85% -120px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(900px 480px at -10% -80px, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

[data-style="rumble"] :is(h1, h2, .brand span, .stat-value, .guide-part-card strong, .landing h1) {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

[data-style="rumble"] h2 {
  font-size: 1.2rem;
}

[data-style="rumble"] .topbar {
  border-bottom: 2px solid var(--outline);
}

[data-style="rumble"] .topbar::after {
  bottom: -6px;
  height: 4px;
}

[data-style="rumble"] .sidebar {
  border-inline-end: 2px solid var(--outline);
}

/* Cards, menus and dialogs: a bold outline and a hard offset shadow. */
[data-style="rumble"] :is(.card, .menu, dialog.search, .switcher) {
  border: 2px solid var(--outline);
  box-shadow: var(--pop);
}

[data-style="rumble"] :is(.server, a.stat, .guide-part-card):hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--outline);
}

/* Page headers turn into full-color banners. */
[data-style="rumble"] .hero {
  border: 2px solid var(--outline);
  box-shadow: 6px 6px 0 var(--outline);
  color: #fff;
}

/* The overview keeps the server's own gradient. */
[data-style="rumble"] .hero:not(.hero-banner) {
  background: linear-gradient(120deg, var(--tone, var(--accent)), color-mix(in srgb, var(--tone, var(--accent)) 50%, var(--accent-2)));
}

[data-style="rumble"] .hero::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  transform: none;
  opacity: 1;
  background: radial-gradient(rgb(255 255 255 / 22%) 1.5px, transparent 1.8px) 0 0 / 14px 14px;
  mask-image: linear-gradient(100deg, transparent 30%, #000 85%);
}

/* A diagonal slash across the far end. */
[data-style="rumble"] .hero::after {
  width: 90px;
  height: 260%;
  inset-inline-end: 120px;
  top: -80%;
  bottom: auto;
  border-radius: 0;
  background: #fff;
  opacity: 0.14;
  transform: rotate(24deg);
}

[data-style="rumble"] .hero h1 {
  font-size: 2rem;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 28%);
}

[data-style="rumble"] .hero p {
  color: rgb(255 255 255 / 90%);
}

[data-style="rumble"] .hero .chip-icon.lg {
  background: #fff;
  color: color-mix(in srgb, var(--tone, var(--accent)) 85%, #000);
  border: 2px solid var(--outline);
  box-shadow: var(--pop-sm);
}

[data-style="rumble"] .hero .guild-icon {
  border: 2px solid var(--outline);
  box-shadow: var(--pop-sm);
}

/* Icon chips become solid stickers. */
[data-style="rumble"] .chip-icon {
  background: var(--tone, var(--accent));
  color: #fff;
  border: 2px solid var(--outline);
  box-shadow: var(--pop-sm);
}

[data-style="rumble"] .stat::before {
  height: 6px;
}

[data-style="rumble"] .stat-value {
  font-size: 2.1rem;
}

[data-style="rumble"] :is(.primary, .ghost, .danger) {
  border: 2px solid var(--outline);
  box-shadow: var(--pop-sm);
  font-weight: 700;
}

[data-style="rumble"] :is(.primary, .ghost, .danger):hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--outline);
}

[data-style="rumble"] :is(.primary, .ghost, .danger):active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

[data-style="rumble"] .nav-link.active {
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2)));
  color: #fff;
  border: 2px solid var(--outline);
  box-shadow: var(--pop-sm);
}

[data-style="rumble"] .nav-link.active::before {
  content: none;
}

[data-style="rumble"] .nav-heading {
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--accent) 60%, var(--muted));
}

[data-style="rumble"] .feature {
  border-width: 2px;
}

[data-style="rumble"] .feature.on {
  border-color: var(--outline);
  box-shadow: var(--pop-sm);
}

[data-style="rumble"] :is(.status.on, .count-pill) {
  border: 2px solid var(--outline);
}

[data-style="rumble"] .server-banner {
  border-bottom: 2px solid var(--outline);
}

[data-style="rumble"] .server-body .guild-icon {
  border: 2px solid var(--outline);
}

[data-style="rumble"] .login::before {
  border-bottom: 2px solid var(--outline);
}

[data-style="rumble"] .login-art img {
  border: 2px solid var(--outline);
  box-shadow: var(--pop);
}

[data-style="rumble"] .landing-hero {
  border: 2px solid var(--outline);
  box-shadow: 6px 6px 0 var(--outline);
}

[data-style="rumble"] :is(.landing-section h2, .landing-cta h2) {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

[data-style="rumble"] :is(.landing-stats, .landing-demo) {
  border: 2px solid var(--outline);
  box-shadow: var(--pop);
}

[data-style="rumble"] .landing-uptime {
  border-top: 2px solid var(--outline);
}

[data-style="rumble"] .uptime-bar:not(.none) {
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 18%);
}

[data-style="rumble"] .landing-stat strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.9rem;
}

[data-style="rumble"] .landing-step-number {
  border: 2px solid var(--outline);
  font-family: var(--display);
  font-weight: 400;
}
