/* DELTA — one stylesheet, navy and blue. Phone layout first (< 900px), desktop layout under the 900px query. */
/* The colours below are the default look. On the dashboard the picked bot can replace any of them (shared/bots.json
   "theme"); the ones registered here as colours fade instead of jumping when the bot is switched. */
@property --bg { syntax: '<color>'; inherits: true; initial-value: #252a3c; }
@property --page-1 { syntax: '<color>'; inherits: true; initial-value: #2b3147; }
@property --page-3 { syntax: '<color>'; inherits: true; initial-value: #20253a; }
@property --card { syntax: '<color>'; inherits: true; initial-value: #0d1724; }
:root {
  --bg: #252a3c;
  --page-1: #2b3147; /* page background: top-left corner, and --page-3 the bottom-right one */
  --page-3: #20253a;
  transition: --bg 0.6s var(--ease), --page-1 0.6s var(--ease), --page-3 0.6s var(--ease), --card 0.6s var(--ease);
  --card: #0d1724;
  --card-shadow: var(--card-shadow);
  --well: #050c18; /* behind logos and icons */
  --on-card: #eef3fa; /* text on --card (see the :where() rule below) */
  --on-card-muted: #6f88a6;
  --title-1: #fff; /* big headings fade from --title-1 to --title-2 */
  --title-2: #8aa3c4;
  --code: #9db4d3;
  --badge: transparent;
  --surface: #0d1724;
  --surface-hover: #12203a;
  --border: rgba(120, 160, 210, 0.08);
  --text: #eef3fa;
  --muted: #6f88a6;
  --icon: #3b5674;
  --accent: #eef3fa;
  --gradient: linear-gradient(90deg, #8a63f5, #5c7cfa);
  --radius: 32px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: 'Prompt', system-ui, sans-serif;
  --body: 'Prompt', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* The page background lives on html (not body): Safari's bounce area then shows --bg instead of a dark strip, and the
   .backdrop glow (z-index -1) stays on top of it. A background on body would paint over the glow. */
html { -webkit-text-size-adjust: 100%; background: radial-gradient(120% 90% at 0% 0%, var(--page-1), var(--bg) 55%, var(--page-3)) var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
body.is-locked { overflow: hidden; }
/* Everything painted with --card (or the navy inside it) takes the on-card text colours, so a theme can put dark text
   on a light page and still keep light text on its cards. :where() keeps this weaker than each component's own colour. */
:where(.btn--ghost, .icon-btn, .server, .sheet, .topnav, .switch, .dnav__item, .card, .toggle, .stat, .filters, .ban, .savebar, .input, .group, .items__item, .embed-edit, .modcard) {
  --text: var(--on-card); --muted: var(--on-card-muted); --title-1: #fff; --title-2: #8aa3c4; color: var(--text);
}
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, monospace; background: var(--card); border: 0; color: var(--code); border-radius: 6px; padding: 0.05em 0.4em; font-size: 0.92em; }
img { display: block; }

/* ---------- animated backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  /* A soft radial fade, not filter: blur(): a 90px blur on shapes this big made iPad Safari leave parts of the screen black while scrolling. */
  -webkit-mask-image: radial-gradient(closest-side, #000, rgba(0, 0, 0, 0.8) 25%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.22) 72%, rgba(0, 0, 0, 0.06) 88%, transparent);
  mask-image: radial-gradient(closest-side, #000, rgba(0, 0, 0, 0.8) 25%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.22) 72%, rgba(0, 0, 0, 0.06) 88%, transparent);
  opacity: 0.38; animation: drift 26s var(--ease) infinite alternate;
  transition: background-color 0.8s var(--ease); /* the picked bot's tint (dashboard) */
}
.backdrop span:nth-child(1) { background: var(--tint-1, #3a4f86); top: -25vmax; left: -15vmax; }
.backdrop span:nth-child(2) { background: var(--tint-2, #5a4aa8); bottom: -30vmax; right: -20vmax; animation-delay: -8s; }
.backdrop span:nth-child(3) { background: var(--tint-3, #2f6fd6); top: 30%; left: 40%; width: 30vmax; height: 30vmax; opacity: 0.08; animation-delay: -16s; }
.backdrop::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px; opacity: 0;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* ---------- splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 22px; text-align: center;
  background: var(--bg); cursor: pointer; outline: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}
.splash__mark {
  font: 700 clamp(56px, 16vw, 148px)/1 var(--display); letter-spacing: 0.18em; margin-right: -0.18em;
  background: linear-gradient(180deg, #fff, #6f88a6); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1.2s var(--ease) backwards;
}
.splash__hint {
  font-size: 13px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--muted); margin-right: -0.35em;
  animation: rise 1.2s 0.25s var(--ease) backwards, pulse 2.2s 1.4s ease-in-out infinite;
}
.splash.is-leaving { opacity: 0; transform: scale(1.08); filter: blur(10px); pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(color-mix(in srgb, var(--bg) 95%, transparent), color-mix(in srgb, var(--bg) 60%, transparent) 70%, transparent);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); letter-spacing: 0.14em; }
.brand__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--well); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6);
}
.brand__mark { position: relative; overflow: hidden; }
.brand__mark svg { width: 24px; height: 24px; transition: opacity 0.3s var(--ease); }
.brand__avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s var(--ease); }
.brand__avatar.is-in { opacity: 1; }
.brand__mark.has-avatar svg { opacity: 0; }
.mark path { fill: #fff; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar .topbar__login { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 500 16px/1 var(--body); color: #fff; background: var(--gradient); cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(124, 108, 248, 0.75); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn svg { width: 22px; height: 22px; fill: currentColor; }
.btn--ghost { background: var(--card); color: var(--text); }
.btn--ghost:hover { background: var(--surface-hover); box-shadow: none; }
.btn--small { min-height: 38px; padding: 0 16px; font-size: 14px; }

.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--card); color: var(--text); cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); transform: scale(1.06); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.is-muted { color: var(--icon); }
.icon-btn .i-off, .icon-btn.is-muted .i-on { display: none; }
.icon-btn.is-muted .i-off { display: block; }

/* ---------- landing (phone) ---------- */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 16px calc(112px + env(safe-area-inset-bottom));
}
.hero__visual { order: -1; position: relative; width: min(60vw, 240px); aspect-ratio: 1; margin: 8px 0 52px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.hero__title {
  margin: 0; font: 600 clamp(56px, 19vw, 96px)/0.95 var(--display); letter-spacing: 0.08em; margin-right: -0.08em;
  background: linear-gradient(180deg, var(--title-1) 35%, var(--title-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { margin: 16px auto 0; max-width: 34ch; color: var(--muted); }
.hero__text > * { animation: rise 0.9s var(--ease) backwards; }
.hero__text > :nth-child(2) { animation-delay: 0.08s; }
.hero__text > :nth-child(3) { animation-delay: 0.16s; }
.hero__text > :nth-child(4) { animation-delay: 0.24s; }

/* Phone: the login button sits in a bar at the bottom, in thumb reach. */
.hero__cta {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 5;
  min-height: 56px; font-size: 16px;
}
.note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.footer { display: none; }

/* logo tile + equalizer */
.tile {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 40px;
  background: radial-gradient(circle at 50% 50%, #0b1a30, #050c18 62%, #02060d);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(120, 160, 210, 0.05);
  animation: float 6s ease-in-out infinite;
}
.tile::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(70, 120, 220, 0.16), transparent 70%); animation: glow 4s ease-in-out infinite; }
.tile .mark { position: relative; width: 62%; }
.tile .mark path { animation: blink 6s var(--ease) infinite; transform-origin: center; transform-box: fill-box; }
.tile .mark path:nth-child(2) { animation-delay: 0.08s; }
.tile .mark path:nth-child(3) { animation-delay: 0.16s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes glow { 50% { opacity: 0.45; transform: scale(0.92); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.15); } }
.eq { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 4px; height: 26px; }
.eq i { width: 4px; height: 100%; border-radius: 2px; background: var(--gradient); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(3n) { animation-duration: 0.9s; }
.eq i:nth-child(3n+1) { animation-duration: 1.3s; animation-delay: -0.4s; }
.eq i:nth-child(4n) { animation-delay: -0.7s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.2); } 50% { transform: scaleY(1); } }

/* ---------- dashboard (phone) ---------- */
.user { display: flex; align-items: center; gap: 10px; }
.user__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--card); opacity: 0; transition: opacity 0.4s; }
.is-ready .user__avatar { opacity: 1; }
.user__name { display: none; font-weight: 600; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash { flex: 1; width: 100%; padding: 12px 16px calc(32px + env(safe-area-inset-bottom)); }
.dash__head { animation: rise 0.8s var(--ease) backwards; }
.dash__title { margin: 0; font: 700 clamp(30px, 9vw, 44px)/1.05 var(--display); overflow-wrap: anywhere; }
.dash__lead { margin: 10px 0 0; color: var(--muted); }

.servers { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.server {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px;
  padding: 14px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow);
  animation: rise 0.6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms);
  transition: background 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.server__icon { width: 48px; height: 48px; border-radius: 16px; object-fit: cover; background: var(--well); }
.server__icon--text { display: grid; place-items: center; font: 700 15px/1 var(--display); color: var(--muted); }
.server__info { min-width: 0; }
.server__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server__state { font-size: 13px; color: var(--muted); }
.server .btn--small { min-height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
/* On a phone the add button becomes a full-width row under the server name. */
@media (max-width: 899.98px) {
  .server:has(.btn) { grid-template-columns: 48px 1fr; }
  .server .btn--small { grid-column: 1 / -1; width: 100%; min-height: 42px; }
}

/* ---------- desktop (>= 900px) ---------- */
@media (min-width: 900px) {
  .topbar { padding: 22px 48px; }
  .topbar .topbar__login { display: inline-flex; }
  .user__name { display: block; }

  .hero {
    display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 64px; text-align: left;
    width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 48px 80px;
  }
  .hero__visual { order: 0; width: min(100%, 440px); margin: 0 auto; }
  .hero__title { font-size: clamp(96px, 11vw, 168px); }
  .hero__lead { margin-left: 0; font-size: 18px; max-width: 40ch; }
  .hero__cta { position: static; margin-top: 34px; min-height: 56px; padding: 0 30px; }
  .eq { height: 34px; gap: 6px; bottom: -44px; }
  .eq i { width: 6px; }
  .footer { display: block; padding: 24px 48px; color: var(--muted); font-size: 13px; }

  .dash { max-width: 1240px; margin: 0 auto; padding: 32px 48px 64px; }
  .dash__title { font-size: 56px; }
  .servers { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 36px; }
  .server { grid-template-columns: 56px 1fr; grid-template-rows: auto auto; padding: 24px; gap: 18px 14px; border-radius: var(--radius); }
  .server__icon { width: 56px; height: 56px; }
  .server .btn--small { grid-column: 1 / -1; justify-self: start; }
  .server .btn--small { width: 100%; }
  .server:hover { background: var(--surface-hover); transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- server settings sheet (phone: bottom sheet, desktop: side panel) ---------- */
.server .btn--ghost { background: #12203a; }
.server .btn--ghost:hover { background: #182a4a; }
.sheet {
  margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92dvh; padding: 0; border: 0; color: var(--text);
  background: var(--card); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8);
}
.sheet[open] { animation: sheet-up 0.45s var(--ease); }
.sheet::backdrop { background: rgba(8, 12, 24, 0.6); backdrop-filter: blur(4px); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet__body { display: grid; gap: 22px; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet__head .icon-btn { background: #12203a; flex: none; }
.sheet__title { margin: 0; font: 600 24px/1.15 var(--display); overflow-wrap: anywhere; }
.sheet__save { width: 100%; }
.sheet .note { margin: 0; }
.is-busy { opacity: 0.7; }

.field { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { display: flex; justify-content: space-between; padding: 0; font-weight: 500; color: var(--muted); }
.field__label output { color: var(--text); font-variant-numeric: tabular-nums; }

.effects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.effect { position: relative; cursor: pointer; }
.effect input { position: absolute; opacity: 0; pointer-events: none; }
.effect span {
  display: grid; gap: 2px; height: 100%; padding: 12px 14px; border-radius: 18px; background: #12203a;
  border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.effect b { font-weight: 500; }
.effect small { font-size: 12px; color: var(--muted); }
.effect:hover span { background: #182a4a; }
.effect input:checked + span { border-color: #7c6cf8; background: linear-gradient(135deg, rgba(138, 99, 245, 0.25), rgba(92, 124, 250, 0.18)); }
.effect input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.effect input:disabled + span { cursor: default; }

.range {
  --fill: 0%; appearance: none; -webkit-appearance: none; width: 100%; height: 8px; margin: 6px 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, #8a63f5, #5c7cfa) 0 / var(--fill) 100% no-repeat, #12203a;
}
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.range:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (min-width: 900px) {
  .sheet {
    margin: 0 0 0 auto; width: 440px; height: 100dvh; max-height: 100dvh; border-radius: 32px 0 0 32px;
    box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.8);
  }
  .sheet[open] { animation: sheet-in 0.45s var(--ease); }
  @keyframes sheet-in { from { transform: translateX(100%); } }
  .sheet__body { padding: 32px; gap: 26px; }
  .sheet__title { font-size: 30px; }
  .effects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field__hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.toggle {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-radius: 20px; background: #12203a; cursor: pointer;
}
.toggle__text { display: grid; gap: 2px; }
.toggle__text b { font-weight: 500; }
.toggle__text small { font-size: 12.5px; color: var(--muted); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__track { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; background: #22324e; transition: background 0.25s; }
.toggle__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.3s var(--ease);
}
.toggle input:checked + .toggle__track { background: var(--gradient); }
.toggle input:checked + .toggle__track::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--accent); outline-offset: 3px; }

.roles { display: flex; flex-wrap: wrap; gap: 8px; max-height: 196px; overflow-y: auto; }
.role { position: relative; cursor: pointer; max-width: 100%; }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role span {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 12px; border-radius: 999px;
  background: #12203a; border: 1px solid transparent; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.2s, border-color 0.2s;
}
.role i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.role:hover span { background: #182a4a; }
.role input:checked + span { border-color: #7c6cf8; background: linear-gradient(135deg, rgba(138, 99, 245, 0.25), rgba(92, 124, 250, 0.18)); }
.role input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet { overflow-y: auto; }

/* ======================================================================
   Bots: switcher, badges, DELTA dashboard, Bans tab
   ====================================================================== */

/* ---------- top nav (Servers / Bans) ---------- */
.topnav { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); }
.topnav__link { padding: 7px 12px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.topnav__link:hover { color: var(--text); }
.topnav__link.is-current { background: #12203a; color: var(--text); }
/* Phone: logo + buttons on the first row, Servers / Bans as a full-width row under them. */
@media (max-width: 899.98px) {
  .topbar:has(.topnav) { flex-wrap: wrap; row-gap: 10px; }
  .topbar:has(.topnav) .brand { margin-right: auto; }
  .topbar:has(.topnav) .topbar__actions { display: contents; }
  .topnav { order: 3; flex-basis: 100%; }
  .topnav__link { flex: 1; text-align: center; }
  .dnav { position: static; }
}

/* ---------- bot switcher ---------- */
.switch {
  position: relative; display: inline-flex; gap: 0; margin: 22px 0 0; padding: 5px; border-radius: 999px;
  background: var(--card); box-shadow: var(--card-shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.switch[hidden] { display: none; }
.switch__pill {
  position: absolute; top: 5px; bottom: 5px; left: 0; width: var(--w, 0); transform: translateX(var(--x, 0));
  border-radius: 999px; background: var(--gradient); box-shadow: 0 8px 22px -8px rgba(124, 108, 248, 0.8);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}
.switch__tab {
  position: relative; z-index: 1; min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: none;
  font: 500 15px/1 var(--body); color: var(--muted); cursor: pointer; white-space: nowrap; transition: color 0.3s;
}
.switch__tab[aria-selected="true"] { color: #fff; }
.switch__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 899.98px) { .switch { display: flex; } .switch__tab { flex: 1; padding: 0 12px; } }

.servers { transition: opacity 0.16s, transform 0.16s var(--ease); }
.servers.is-switching { opacity: 0; transform: translateY(6px); }

/* ---------- server cards: the picked bot's badge and its Add or Settings button ---------- */
.server { grid-template-columns: 48px 1fr; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted); border: 1px solid #22324e; background: var(--badge);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #22324e; }
.badge--on { color: var(--text); border-color: transparent; background: linear-gradient(135deg, rgba(138, 99, 245, 0.25), rgba(92, 124, 250, 0.18)), var(--badge); }
.badge--on::before { background: #7ee2a8; box-shadow: 0 0 6px #7ee2a8; }
.server__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.server__actions .btn--small { flex: 1 1 auto; width: auto; grid-column: auto; min-height: 40px; }
@media (min-width: 900px) { .server__actions .btn--small { flex: 0 1 auto; } }

/* ---------- DELTA dashboard (one server) ---------- */
.dview { flex: 1; width: 100%; padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); animation: rise 0.6s var(--ease) backwards; }
.dview[hidden] { display: none; }
.dview__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dview__icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; overflow: hidden; background: var(--well); font-weight: 700; color: var(--on-card-muted); }
.dview__icon img { width: 100%; height: 100%; object-fit: cover; }
.dview__name { min-width: 0; }
.dview__name .eyebrow { margin: 0 0 2px; }
.dview__title { margin: 0; font: 700 clamp(22px, 6vw, 34px)/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dview__body { display: grid; gap: 14px; }

.dnav { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; position: sticky; top: 108px; z-index: 5; }
.dnav__item {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--card); color: var(--muted); font-size: 14px; white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.dnav__item:hover { color: var(--text); background: var(--surface-hover); }
.dnav__item.is-current { color: #fff; background: var(--gradient); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3b4a66; flex: none; }
.dot--on { background: #7ee2a8; box-shadow: 0 0 6px rgba(126, 226, 168, 0.7); }
.dnav__item.is-current .dot { background: rgba(255, 255, 255, 0.5); }
.dnav__item.is-current .dot--on { background: #fff; }

.dpanel { display: grid; gap: 14px; min-width: 0; outline: none; }
.card { padding: 18px 16px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); display: grid; gap: 16px; min-width: 0; }
.card__title { margin: 0; font: 600 17px/1.3 var(--display); }
.dpanel .card { animation: rise 0.5s var(--ease) backwards; }

.modhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.modhead__title { margin: 0; font: 700 26px/1.1 var(--display); }
.modhead .dash__lead { margin-top: 4px; }
.toggle--head { flex: none; gap: 12px; padding: 10px 14px; background: var(--card); }
.toggle--small { padding: 10px 14px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 18px; border-radius: 24px; background: var(--card); }
.stat__value { font: 700 30px/1.1 var(--display); background: linear-gradient(180deg, var(--title-1) 35%, var(--title-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--muted); font-size: 13px; }
.toplist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toplist li { display: grid; grid-template-columns: 34px 36px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: #12203a; }
.toplist img, .toplist__ph { width: 36px; height: 36px; border-radius: 50%; background: var(--well); }
.toplist__pos { font-weight: 600; color: var(--muted); text-align: center; }
.toplist__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist__lvl { grid-column: 3; font-size: 12.5px; color: var(--muted); }
.modgrid { display: grid; gap: 8px; }
.modcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #12203a; transition: background 0.2s; }
.modcard:hover { background: #182a4a; }
.modcard__link { display: grid; gap: 2px; min-width: 0; }
.modcard__link b { font-weight: 500; }
.modcard__link small { font-size: 12.5px; color: var(--muted); }
.switch-only { position: relative; flex: none; cursor: pointer; display: inline-flex; }
.switch-only input { position: absolute; opacity: 0; pointer-events: none; }
.switch-only input:checked + .toggle__track { background: var(--gradient); }
.switch-only input:checked + .toggle__track::after { transform: translateX(20px); }
.switch-only input:focus-visible + .toggle__track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* inputs */
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1px solid transparent; background: #12203a; color: var(--text);
  font: 400 15px/1.4 var(--body); transition: border-color 0.2s, background 0.2s;
}
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option, select.input optgroup { background: #0d1724; color: var(--text); }
.input:hover { background: #162746; }
.input:focus { outline: none; border-color: #7c6cf8; }
.input.is-bad { border-color: #f0707a; }
.input--num { max-width: 160px; }
.input--color { width: 56px; min-height: 40px; padding: 4px; cursor: pointer; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-size: 14px; }

/* multi pickers */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 0 4px 0 12px; border-radius: 999px; background: linear-gradient(135deg, rgba(138, 99, 245, 0.25), rgba(92, 124, 250, 0.18)); font-size: 14px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip i { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.chip__x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.25); color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; }
.chip__x:hover { background: rgba(240, 112, 122, 0.5); }
.input--add { width: auto; min-height: 34px; padding: 4px 34px 4px 12px; border-radius: 999px; font-size: 14px; }

/* groups (automod filters ...) */
.group { display: grid; gap: 12px; padding: 14px; border-radius: 20px; background: #0a1320; border: 1px solid #16243c; transition: opacity 0.2s; }
.group__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group__head b { font-weight: 500; }
.group__body { display: grid; gap: 14px; }
.group.is-off .group__body { opacity: 0.45; }

/* item lists */
.items { display: grid; gap: 8px; }
.items__item { border-radius: 18px; background: #0a1320; border: 1px solid #16243c; overflow: hidden; }
.items__item > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 500; }
.items__item > summary::-webkit-details-marker { display: none; }
.items__item > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.25s var(--ease); flex: none; }
.items__item[open] > summary::before { transform: rotate(45deg); }
.items__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items__body { display: grid; gap: 14px; padding: 4px 14px 16px; }
.items__tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.items__add { justify-self: start; }
.btn--tiny { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--danger:hover { background: rgba(240, 112, 122, 0.25); }
.postrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

/* message editor + preview */
.msg__grid { display: grid; gap: 14px; }
.msg__edit { display: grid; gap: 12px; align-content: start; min-width: 0; }
.embed-edit { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: #0a1320; border: 1px solid #16243c; }
.embed-edit[hidden] { display: none; }
.efields { display: grid; gap: 10px; }
.efield { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: #0d1724; }
.mini-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.mini-check input { width: 18px; height: 18px; accent-color: #7c6cf8; }
.colorrow { display: flex; align-items: center; gap: 10px; }
.varchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.varchip { padding: 4px 9px; border: 0; border-radius: 8px; background: #12203a; color: #9db4d3; font: 12px/1.3 ui-monospace, monospace; cursor: pointer; }
.varchip:hover { background: #1b2d50; color: var(--text); }
.presets { margin-top: 2px; }
.preset { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #12203a; color: #9db4d3; font: 500 13px/1 var(--body); cursor: pointer; transition: background 0.2s, color 0.2s; }
.preset:hover { background: #1b2d50; color: var(--text); }
.msg__preview { display: grid; gap: 8px; align-content: start; min-width: 0; }
.pv { padding: 14px; border-radius: 18px; background: #313338; color: #dbdee1; font: 15px/1.375 'gg sans', 'Noto Sans', system-ui, sans-serif; }
.pv__msg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.pv__avatar { width: 40px; height: 40px; border-radius: 50%; background: #050c18; }
.pv__body { display: grid; gap: 4px; min-width: 0; }
.pv__name { display: flex; align-items: center; gap: 6px; }
.pv__name b { color: #fff; font-weight: 500; }
.pv__bot { padding: 0 4px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; }
.pv__time { color: #949ba4; font-size: 12px; }
.pv__content { overflow-wrap: anywhere; }
.pv__embed { display: flex; gap: 16px; max-width: 520px; padding: 10px 16px 14px 12px; border-left: 4px solid; border-radius: 4px; background: #2b2d31; }
.pv__main { display: grid; gap: 6px; min-width: 0; flex: 1; }
.pv__author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #fff; }
.pv__author img { width: 24px; height: 24px; border-radius: 50%; }
.pv__title { font-weight: 600; color: #fff; }
a.pv__title { color: #00a8fc; }
.pv__desc { font-size: 14px; overflow-wrap: anywhere; }
.pv__fields { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.pv__field { flex: 1 1 100%; min-width: 0; }
.pv__field.is-inline { flex: 1 1 140px; }
.pv__field b { display: block; color: #fff; font-weight: 600; }
.pv__image { max-width: 100%; border-radius: 4px; margin-top: 4px; }
.pv__thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; flex: none; }
.pv__footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b5bac1; }
.pv__footer img { width: 20px; height: 20px; border-radius: 50%; }
.pv code { padding: 0 3px; border-radius: 4px; background: #1e1f22; color: #dbdee1; }
.pv a { color: #00a8fc; }
.pv .mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, 0.3); color: #c9cdfb; }
.pv .h1 { display: block; font-size: 22px; } .pv .h2 { display: block; font-size: 19px; } .pv .h3 { display: block; font-size: 16px; }

/* save bar */
.savebar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-radius: 22px;
  background: rgba(13, 23, 36, 0.92); backdrop-filter: blur(10px); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.8);
  animation: sheet-up 0.4s var(--ease);
}
.savebar[hidden] { display: none; }
.savebar__text { flex: 1; font-size: 14px; color: var(--muted); min-width: 0; }
.savebar .btn[hidden] { display: none; }

@media (min-width: 900px) {
  .dview { max-width: 1240px; margin: 0 auto; padding: 24px 48px 120px; }
  .dview__icon { width: 56px; height: 56px; }
  .dview__body { grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
  .dnav { flex-direction: column; overflow: visible; margin: 0; padding: 0; position: sticky; top: 96px; }
  .dnav__item { border-radius: 14px; min-height: 42px; background: transparent; }
  .dnav__item:hover { background: var(--card); }
  .card { padding: 24px; border-radius: var(--radius); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .embed-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .efield { grid-template-columns: 1fr 1.4fr auto auto; align-items: end; }
  .savebar { left: 50%; right: auto; width: min(640px, calc(100% - 96px)); transform: translateX(-50%); animation: savebar-up 0.4s var(--ease); }
}
@keyframes savebar-up { from { transform: translate(-50%, calc(100% + 24px)); } }

/* ---------- Bans tab ---------- */
.login-card { margin-top: 24px; justify-items: start; }
.login-card[hidden], .bans-tools[hidden], [data-when][hidden] { display: none; }
.bans-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.filters { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); overflow-x: auto; max-width: 100%; }
.filter { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 500 14px/1 var(--body); cursor: pointer; transition: background 0.25s, color 0.25s; }
.filter[aria-selected="true"] { background: var(--gradient); color: #fff; }
.bans-search { flex: 1; min-width: 180px; border-radius: 999px; }
.bans-group { margin-top: 26px; display: grid; gap: 12px; }
.bans-grid { display: grid; gap: 10px; }
.ban { display: grid; gap: 14px; padding: 16px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); animation: rise 0.6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.ban--current { box-shadow: inset 0 0 0 1px rgba(240, 112, 122, 0.25), var(--card-shadow); }
.ban--ended { box-shadow: inset 0 0 0 1px rgba(126, 226, 168, 0.3), var(--card-shadow); }
.ban__head { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; }
.ban__over { margin: 0; font: 600 18px/1.2 var(--display); }
.facts { margin: 0; display: grid; gap: 8px; }
.facts__row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.ban__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.pill--pending { background: rgba(240, 196, 92, 0.16); color: #f0c45c; }
.pill--approved { background: rgba(126, 226, 168, 0.16); color: #7ee2a8; }
.pill--denied { background: rgba(240, 112, 122, 0.16); color: #f0707a; }
.appeal-qs { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .bans-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
  .ban { padding: 24px; border-radius: var(--radius); }
  .ban__head { grid-template-columns: 56px 1fr; }
  .ban__head .server__icon { width: 56px; height: 56px; }
}
