/* Sleepy Manager dashboard: uses The Sleepy Labs brand (same palette and font as thesleepylabs.com)
 *
 * To rebrand: change the values in the "Brand" block below (colours, fonts, corner rounding).
 * Everything else reads from these, so nothing further down needs touching.
 */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff") format("woff");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* ===== Brand ===== */
  /* The Sleepy Labs palette: same values as the website's site.css (see Branding/BRAND.md) */
  --brand: #8b5cf6;          /* lilac-deep: the bot's embed colour */
  --brand-strong: #7c4ddb;   /* lilac-strong: white text on this passes contrast */
  --brand-soft: #b794ff;     /* lilac: links, accents and primary buttons */
  --brand-soft-hover: #cdb4ff;
  --brand-ink: #12081f;      /* text on lilac buttons */
  --brand-glow: rgba(139, 92, 246, 0.22);

  --night: #07050d;          /* ink: page background */
  --dusk: #0e0a19;           /* ink-2: panels */
  --haze: #171127;           /* ink-3: inputs, hover */
  --line: #261c3d;           /* borders */
  --moon: #f3ecff;           /* main text */
  --mist: #b7a8d6;           /* secondary text */
  --faint: #958ab3;          /* hints */

  --ok: #5fcfa9;
  --warn: #f5b65a;           /* ember, as on the website */
  --danger: #f07a8b;

  --series-joins: #9b6cd6;   /* chart colours, checked for colour blindness */
  --series-leaves: #c97a2a;

  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-small: 8px;
  --radius: 14px;
  --radius-large: 22px;
  /* ===== end of brand ===== */

  --shadow-pop: 0 18px 40px rgba(3, 2, 8, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--night);
  color: var(--moon);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { display: block; }
a { color: var(--brand-soft); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--moon); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; font-stretch: 112%; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
code, .code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--haze); border-radius: 5px; padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--mist); }
.hint { color: var(--faint); font-size: 13px; }

/* ---------- buttons and fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--haze); color: var(--moon);
  font: 600 14px/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-soft); color: var(--moon); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-soft-hover); border-color: var(--brand-soft-hover); color: var(--brand-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--mist); }
.btn-ghost:hover { background: var(--haze); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-small { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--haze); color: var(--moon);
  border: 1px solid var(--line); border-radius: var(--radius-small);
  font: 400 14px/1.4 var(--font-body);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mist) 50%), linear-gradient(135deg, var(--mist) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover, textarea:hover { border-color: #3a2c5c; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-glow); }
.field-error { color: var(--danger); font-size: 13px; }
.has-error input, .has-error select, .has-error textarea, .has-error .picker { border-color: var(--danger); }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 40px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--moon); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--brand-strong); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
.switch-text { display: grid; gap: 2px; }
.switch-text strong { font-weight: 600; }

/* ---------- login ---------- */

.login {
  min-height: 100vh; display: grid; align-items: center;
  padding: 48px clamp(20px, 8vw, 120px);
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 78% 26%, rgba(183, 148, 255, 0.16), transparent 30%),
    radial-gradient(ellipse at 20% 120%, rgba(139, 92, 246, 0.18), transparent 55%),
    var(--night);
}
.moon {
  position: absolute; top: clamp(40px, 12vh, 120px); right: clamp(30px, 14vw, 220px);
  width: clamp(120px, 18vw, 220px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset clamp(-26px, -3.6vw, -16px) clamp(-10px, -1.4vw, -6px) 0 0 #f3ecff;
  filter: drop-shadow(0 0 40px rgba(183, 148, 255, 0.35));
}
.sky span { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #f3ecff; opacity: 0.5; }
.login-card { position: relative; max-width: 520px; display: grid; gap: 22px; }
.login-avatar { width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--brand); background: var(--dusk); }
.login h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -0.01em; }
.login-title { display: flex; align-items: flex-end; gap: 6px; }
.zzz { display: inline-flex; align-items: flex-end; gap: 0.05em; margin-left: 0.18em; vertical-align: 0.35em; white-space: nowrap;
  font-family: var(--font-display); color: var(--brand-soft); font-weight: 500; }
.zzz span { display: inline-block; opacity: 0; animation: drift 2.4s ease-out forwards; }
.zzz span:nth-child(1) { font-size: 0.26em; animation-delay: 0.4s; }
.zzz span:nth-child(2) { font-size: 0.34em; animation-delay: 0.8s; }
.zzz span:nth-child(3) { font-size: 0.43em; animation-delay: 1.2s; }
@keyframes drift {
  0% { opacity: 0; transform: translate(0, 8px); }
  60% { opacity: 1; }
  100% { opacity: 0.85; transform: translate(4px, -10px); }
}
.login-lead { font-size: 18px; color: var(--mist); max-width: 44ch; }
.login-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.login-actions .btn { min-height: 48px; padding: 0 22px; font-size: 15px; }
.login-note { color: var(--faint); font-size: 14px; max-width: 46ch; }
.login-error { border-left: 3px solid var(--warn); padding: 8px 14px; background: rgba(233, 185, 85, 0.08); border-radius: 0 var(--radius-small) var(--radius-small) 0; color: var(--moon); }

/* ---------- app shell ---------- */

.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--dusk) 0 263px, var(--line) 263px 264px, transparent 264px); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 16px; background: var(--dusk); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; color: var(--moon); text-decoration: none; }
.brand .brand-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand span { font: 600 18px/1 var(--font-display); }
.switcher {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  background: var(--haze); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--moon); text-decoration: none; text-align: left;
}
.switcher:hover { border-color: var(--brand-soft); color: var(--moon); }
.switcher-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-sub { font-size: 12px; color: var(--mist); }
.switcher > div { min-width: 0; flex: 1; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--mist); text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--haze); color: var(--moon); }
.nav a[aria-current="page"] { background: rgba(139, 92, 246, 0.2); color: var(--moon); }
.nav a[aria-current="page"] svg { color: var(--brand-soft); }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #22101a; font-size: 12px; font-weight: 700; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.sidebar-foot .user-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.sidebar-foot .who { min-width: 0; flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar { display: none; }
.main { min-width: 0; padding: 36px clamp(20px, 4vw, 52px) 120px; }
.page { max-width: 1120px; display: grid; gap: 28px; }
.page-head { display: grid; gap: 6px; }
.page-head p { color: var(--mist); max-width: 70ch; }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }

.panel { background: var(--dusk); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head p { color: var(--mist); font-size: 14px; }
.guild-icon { width: 40px; height: 40px; border-radius: 12px; flex: none; background: var(--haze); object-fit: cover;
  display: grid; place-items: center; font: 600 15px/1 var(--font-display); color: var(--brand-soft); }
.guild-icon.big { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

/* ---------- servers ---------- */

.server-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius-large); background: var(--dusk); overflow: hidden; }
.server-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 18px; }
.server-row + .server-row { border-top: 1px solid var(--line); }
.server-row:hover { background: rgba(23, 17, 39, 0.6); }
.server-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-meta { color: var(--mist); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--haze); color: var(--mist); }
.pill.admin { background: rgba(139, 92, 246, 0.22); color: var(--brand-soft); }
.pill.warn { background: rgba(233, 185, 85, 0.14); color: var(--warn); }
.pill.ok { background: rgba(95, 207, 169, 0.13); color: var(--ok); }
.pill.danger { background: rgba(240, 122, 139, 0.14); color: var(--danger); }

/* ---------- overview ---------- */

.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px; border-radius: var(--radius-large); background: linear-gradient(120deg, rgba(139, 92, 246, 0.28), rgba(139, 92, 246, 0.08)); border: 1px solid rgba(183, 148, 255, 0.35); }
.banner p { color: var(--mist); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }

.checklist { display: grid; gap: 4px; }
.check { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 4px; }
.check + .check { border-top: 1px solid var(--line); }
.check-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.check-mark.ok { background: rgba(95, 207, 169, 0.16); color: var(--ok); }
.check-mark.todo { background: rgba(233, 185, 85, 0.16); color: var(--warn); }
.check-text strong { display: block; font-weight: 600; }
.check-text span { color: var(--mist); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 14px 16px; display: grid; gap: 2px; }
.stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
.stat:not(:nth-child(3n + 1)) { border-left: 1px solid var(--line); }
.stat-value { font: 600 28px/1.1 var(--font-display); }
.stat-label { color: var(--mist); font-size: 14px; }
.stat-change { color: var(--faint); font-size: 12px; }

/* chart */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; font-size: 14px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; color: var(--mist); }
.chart-legend strong { color: var(--moon); font-weight: 600; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.swatch.joins { background: var(--series-joins); }
.swatch.leaves { background: var(--series-leaves); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font: 500 11px var(--font-body); }
.chart .bar-joins { fill: var(--series-joins); }
.chart .bar-leaves { fill: var(--series-leaves); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover, .chart .hit.active { fill: rgba(239, 235, 247, 0.05); }
.tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: #0e0a19; border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 13px; display: grid; gap: 4px; }
.tooltip strong { font-weight: 600; }
.tooltip div { display: flex; align-items: center; gap: 8px; color: var(--mist); }
.tooltip div b { margin-left: auto; color: var(--moon); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { color: var(--mist); font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* feed (logs and alerts) */
.feed { display: grid; }
.feed-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 4px; align-items: start; }
.feed-row + .feed-row { border-top: 1px solid var(--line); }
.feed-time { color: var(--faint); font-size: 13px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.feed-body { display: grid; gap: 4px; min-width: 0; }
.feed-kind { font-size: 12px; color: var(--mist); font-weight: 600; }
.feed-summary { overflow-wrap: anywhere; }
.mention { display: inline-block; padding: 0 4px; border-radius: 4px; background: rgba(139, 92, 246, 0.2); color: var(--brand-soft); font-weight: 500; }
.mention.role { background: rgba(170, 162, 194, 0.14); color: var(--moon); }
.mention .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: var(--mist); }
.empty { padding: 34px 12px; text-align: center; color: var(--mist); display: grid; gap: 6px; justify-items: center; }
.empty strong { color: var(--moon); font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.more { display: flex; justify-content: center; padding-top: 12px; }

.alert-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.alert-level { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; }
.alert-level.danger { background: rgba(240, 122, 139, 0.16); }
.alert-level.warn { background: rgba(233, 185, 85, 0.14); }
.alert-level.info { background: rgba(170, 162, 194, 0.14); }
.alert-row.unread .alert-name::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--brand-soft); vertical-align: 2px; }
.alert-name { font-weight: 600; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--faint); font-size: 13px; }


/* ---------- settings ---------- */

.section { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; padding: 26px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-intro { display: grid; gap: 6px; align-content: start; }
.section-intro p { color: var(--mist); font-size: 14px; }
.section-body { display: grid; gap: 20px; min-width: 0; }
.field-desc { color: var(--mist); font-size: 13px; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* role picker */
.picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; min-height: 44px;
  background: var(--haze); border: 1px solid var(--line); border-radius: var(--radius-small); position: relative; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--dusk); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mist); flex: none; }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--mist); cursor: pointer; font-size: 14px; line-height: 1; }
.chip button:hover { background: var(--haze); color: var(--moon); }
.picker-add { border: 0; background: transparent; color: var(--brand-soft); font: 600 13px var(--font-body); padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.picker-add:hover { background: var(--dusk); }
.menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(360px, 100%); max-height: 300px; overflow-y: auto;
  background: #0e0a19; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; }
.menu input { margin-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--moon); font: 500 14px var(--font-body); text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--haze); }
.menu-item:disabled { color: var(--faint); cursor: not-allowed; background: transparent; }
.menu-item small { display: block; color: var(--faint); font-size: 12px; font-weight: 400; }
.menu-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--mist); }
.menu-empty { padding: 10px; color: var(--faint); font-size: 13px; }

.placeholders { display: flex; flex-wrap: wrap; gap: 6px; }
.placeholders button { border: 1px dashed var(--line); background: transparent; color: var(--brand-soft); border-radius: 8px; padding: 3px 8px; font: 500 13px ui-monospace, Menlo, monospace; cursor: pointer; }
.placeholders button:hover { border-color: var(--brand-soft); }

/* Discord-style preview of the welcome message */
.preview { background: #313338; border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; }
.preview-label { color: var(--faint); font-size: 12px; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; font-family: "gg sans", var(--font-body); }
.dc-msg .dc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.dc-author { font-weight: 600; color: #f2f3f5; display: flex; align-items: center; gap: 6px; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; }
.dc-embed { margin-top: 4px; display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 12px; max-width: 520px;
  background: #2b2d31; border-left: 4px solid var(--brand); border-radius: 4px; padding: 10px 14px 12px 12px; color: #dbdee1; font-size: 14px; }
.dc-embed .dc-thumb { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; }
.dc-title { color: #f2f3f5; font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.dc-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-foot { margin-top: 8px; font-size: 12px; color: #b5bac1; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }

.kind-list { display: grid; gap: 14px; }
.level-tag { font-size: 12px; font-weight: 600; margin-left: 6px; }
.level-tag.danger { color: var(--danger); }
.level-tag.warn { color: var(--warn); }
.level-tag.info { color: var(--mist); }

.savebar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px; width: min(640px, calc(100% - 32px));
  background: #0e0a19; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-pop); }
.savebar p { flex: 1; font-weight: 600; }
.savebar[hidden] { display: none; }
.form-error { border-left: 3px solid var(--danger); padding: 10px 14px; background: rgba(240, 122, 139, 0.08); border-radius: 0 var(--radius-small) var(--radius-small) 0; }

code { white-space: nowrap; }
.feed-summary code { white-space: normal; }
.input-prefix { display: flex; align-items: center; background: var(--haze); border: 1px solid var(--line); border-radius: var(--radius-small); }
.input-prefix span { padding-left: 12px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.input-prefix input { border: 0; background: transparent; padding-left: 4px; }
.input-prefix input:focus { box-shadow: none; }
.input-prefix:focus-within { border-color: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-glow); }

/* logs filters */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.person-filter { position: relative; }
.person-filter .chip { margin-top: 2px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--haze); border-radius: 999px; }
.tabs button { border: 0; background: transparent; color: var(--mist); font: 600 13px var(--font-body); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--brand-strong); color: #fff; }

/* toasts and loading */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100% - 36px)); }
.toast { padding: 12px 16px; border-radius: var(--radius); background: #0e0a19; border: 1px solid var(--line); border-left: 4px solid var(--brand); box-shadow: var(--shadow-pop); }
.toast.error { border-left-color: var(--danger); }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--mist); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand-soft); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens ---------- */

/* modules in the sidebar */
.nav-module { display: flex; align-items: center; gap: 4px; }
.nav-module > a, .nav-module > .nav-static { flex: 1; min-width: 0; }
.nav-static { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--faint); font-weight: 500; }
.nav-static svg { width: 18px; height: 18px; flex: none; }
.nav-module.off > a, .nav-module.off > .nav-static { opacity: 0.55; }
.nav-switch { flex: none; position: relative; width: 34px; height: 20px; margin-right: 6px; padding: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background 0.15s; }
.nav-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--moon); transition: transform 0.15s; }
.nav-switch[aria-checked="true"] { background: var(--brand-strong); }
.nav-switch[aria-checked="true"]::after { transform: translateX(14px); }
.nav-switch:disabled { cursor: default; opacity: 0.6; }
.nav-switch:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
/* hit area: 34x20 is small on phones */
.nav-switch::before { content: ""; position: absolute; inset: -12px -6px; }

/* Overview module cards */
.module-cards + .hint { margin-top: 14px; }
.module-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.module-card { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--haze); }
.module-card.off { opacity: 0.7; }
.module-card p { color: var(--mist); font-size: 14px; margin: 0; }
.module-card .btn { justify-self: start; }
.module-card-top { display: flex; align-items: center; gap: 10px; }
.module-card-top strong { flex: 1; }
.module-card-top .nav-switch { margin-right: 0; }
.module-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(139, 92, 246, 0.18); color: var(--brand-soft); }
.module-icon svg { width: 18px; height: 18px; }

/* Premium switches and the unlock pop-up */
.premium-tag { margin-left: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; vertical-align: 1px; }
.premium-tag svg { width: 11px; height: 11px; }
.locked-switch { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; width: 100%; }
.locked-switch .switch-track { display: grid; place-items: center; background: var(--line); }
.locked-switch .switch-track::after { display: none; }
.locked-switch .switch-track svg { width: 13px; height: 13px; color: var(--mist); }
.locked-switch:hover .switch-track { background: rgba(139, 92, 246, 0.35); }
.locked-switch:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 3px; border-radius: 8px; }
.locked-btn svg { width: 14px; height: 14px; }
.unlock-dialog { max-width: 420px; width: calc(100% - 32px); border: 1px solid rgba(183, 148, 255, 0.45); border-radius: var(--radius-large);
  background: var(--ink-2, #0e0a19); color: var(--moon); padding: 26px; text-align: center; box-shadow: var(--shadow-pop); }
.unlock-dialog::backdrop { background: rgba(5, 3, 12, 0.7); }
.unlock-dialog h2 { margin: 6px 0 8px; }
.unlock-dialog p { color: var(--mist); margin: 0 0 18px; }
.unlock-dialog .row-actions { justify-content: center; }
.unlock-star { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(139, 92, 246, 0.2); color: var(--brand-soft); }
.unlock-star svg { width: 24px; height: 24px; }
.premium-features { display: grid; gap: 8px; }
.pfeature { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--haze); }
.pfeature > svg { width: 18px; height: 18px; color: var(--brand-soft); }
.pfeature-text { display: grid; gap: 2px; }
.pfeature-state { display: flex; align-items: center; gap: 8px; }
.pfeature-state .pill svg { width: 11px; height: 11px; }
.soon-head { font-size: 14px; margin: 18px 0 8px; color: var(--mist); }

/* Setup wizard */
.wiz { display: grid; gap: 22px; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiz-top h1 { margin: 0; }
.wiz-rail { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.wiz-rail li { flex: 1 1 0; min-width: 92px; }
.wiz-rail button { width: 100%; display: grid; justify-items: start; gap: 8px; padding: 10px 2px 0; border: 0; border-top: 3px solid var(--line);
  background: none; color: var(--faint); font: 600 13px var(--font-body); text-align: left; cursor: pointer; }
.wiz-rail button:disabled { cursor: default; }
.wiz-rail li.done button { border-top-color: var(--brand-strong); color: var(--mist); }
.wiz-rail li.now button { border-top-color: var(--brand-soft); color: var(--moon); }
.wiz-rail button:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
.wiz-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; font-size: 11px; }
.wiz-rail li.done .wiz-dot { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.wiz-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); gap: 36px; align-items: start; }
.wiz-main { display: grid; gap: 14px; align-content: start; }
.wiz-count { margin: 0; color: var(--faint); font-size: 13px; font-weight: 600; }
.wiz-title { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }
.wiz-title:focus { outline: none; }
.wiz-lead { margin: 0; color: var(--mist); max-width: 60ch; font-size: 16px; line-height: 1.55; }
.wiz-fields { display: grid; gap: 16px; margin-top: 6px; }
.wiz-callout { display: grid; gap: 12px; justify-items: start; padding: 16px 18px; border-left: 3px solid var(--brand-soft);
  background: rgba(139, 92, 246, 0.1); border-radius: 0 var(--radius-small) var(--radius-small) 0; }
.wiz-callout p { margin: 0; }
.wiz-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.perm-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.perm-list li { display: flex; align-items: baseline; gap: 10px; }
.perm-mark { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: rgba(95, 207, 169, 0.15); color: var(--ok); }
.perm-list li.missing .perm-mark { background: rgba(233, 185, 85, 0.18); color: var(--warn); }
.admin-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-small);
  border: 1px solid rgba(233, 185, 85, 0.45); background: rgba(233, 185, 85, 0.08); }
.admin-status.ok { border-color: rgba(95, 207, 169, 0.45); background: rgba(95, 207, 169, 0.08); }
.admin-status > div { display: grid; gap: 2px; }
.admin-status.ok .perm-mark { background: rgba(95, 207, 169, 0.2); color: var(--ok); }
.admin-status:not(.ok) .perm-mark { background: rgba(233, 185, 85, 0.2); color: var(--warn); }
.perm-groups { display: grid; gap: 14px; }
.perm-group h3 { margin: 0 0 6px; font-size: 14px; color: var(--moon); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.perm-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); }
.perm-chips li.on { background: rgba(95, 207, 169, 0.1); border-color: rgba(95, 207, 169, 0.35); color: var(--moon); }
.perm-chips li.on > span:first-child { color: var(--ok); }
.perm-chips li.off { color: var(--faint); }
.level-list { display: grid; gap: 8px; }
.level { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--haze);
  color: var(--moon); font: inherit; text-align: left; cursor: pointer; }
.level:hover { border-color: rgba(183, 148, 255, 0.5); }
.level.on { border-color: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-soft) inset; background: rgba(139, 92, 246, 0.12); }
.level:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
.level-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.level-name .premium-pill { margin-left: 0; }
.level-sum { color: var(--mist); font-size: 14px; }
.level ul { margin: 6px 0 0; padding-left: 18px; color: var(--moon); font-size: 14px; display: grid; gap: 3px; }
.wiz-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 22px; margin: 6px 0 0; font-size: 15px; }
.wiz-summary dt { color: var(--mist); }
.wiz-summary dd { margin: 0; }
.wiz-preview { position: sticky; top: 20px; }
.preview-stack { display: grid; gap: 14px; }

/* Animated wizard: drifting starfield, moon progress, slider, typing dots, celebration */
.wiz { position: relative; isolation: isolate; }
.wiz-sky { position: absolute; inset: -40px -24px auto; height: 520px; z-index: -1; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 30%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); }
.wiz-sky span { position: absolute; inset: -60px; background-repeat: repeat; animation: sky-drift 90s linear infinite alternate; }
.wiz-sky span:first-child { background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, rgba(243, 236, 255, .9), transparent 60%),
    radial-gradient(1px 1px at 120px 80px, rgba(183, 148, 255, .9), transparent 60%),
    radial-gradient(1.4px 1.4px at 220px 20px, rgba(243, 236, 255, .7), transparent 60%),
    radial-gradient(1px 1px at 300px 140px, rgba(243, 236, 255, .6), transparent 60%);
  background-size: 340px 180px; opacity: .55; }
.wiz-sky span:last-child { background-image:
    radial-gradient(1.8px 1.8px at 60px 110px, rgba(183, 148, 255, .8), transparent 60%),
    radial-gradient(1.2px 1.2px at 260px 60px, rgba(243, 236, 255, .8), transparent 60%);
  background-size: 420px 220px; opacity: .45; animation: sky-drift 140s linear infinite alternate-reverse, twinkle 6s ease-in-out infinite; }
@keyframes sky-drift { to { transform: translate3d(-60px, -40px, 0); } }
@keyframes twinkle { 50% { opacity: .2; } }
.wiz-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wiz-moon { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(183, 148, 255, .45)); }
.moon-dark { fill: rgba(183, 148, 255, .12); stroke: rgba(183, 148, 255, .35); stroke-width: 1; }
.moon-lit { fill: #e9ddff; }
.moon-shadow { transition: transform .9s cubic-bezier(.22, 1, .36, 1); }
.wiz-rail li.now .wiz-dot { box-shadow: 0 0 0 0 rgba(183, 148, 255, .55); animation: dot-glow 2.6s ease-in-out infinite; }
@keyframes dot-glow { 50% { box-shadow: 0 0 0 6px rgba(183, 148, 255, 0); } }
.wiz-rail button { transition: color .3s, border-color .5s; }
.wiz .btn { transition: transform .12s ease, background-color .2s, box-shadow .2s; }
.wiz .btn:active:not(:disabled) { transform: scale(.97); }
.wiz .btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 4px rgba(183, 148, 255, .18); }
.level-slider { display: grid; gap: 10px; padding: 6px 2px 0; }
.level-slider input[type="range"] { --p: 66%; -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: none; margin: 0; cursor: pointer; }
.level-slider input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-strong) var(--p), var(--line) var(--p)); }
.level-slider input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--line); }
.level-slider input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--brand-strong); }
.level-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%;
  background: #f3ecff; border: 4px solid var(--brand-strong); box-shadow: 0 0 0 6px rgba(183, 148, 255, .18); transition: transform .15s; }
.level-slider input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f3ecff; border: 4px solid var(--brand-strong);
  box-shadow: 0 0 0 6px rgba(183, 148, 255, .18); }
.level-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.level-slider input[type="range"]:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 4px; border-radius: 999px; }
.level-ticks { position: relative; height: 24px; margin: 0 12px; }
.level-tick { position: absolute; top: 0; transform: translateX(-50%); border: 0; background: none; color: var(--faint);
  font: 600 13px var(--font-body); cursor: pointer; padding: 4px 6px; transition: color .25s; white-space: nowrap; }
.level-tick:nth-child(1) { left: 0; transform: none; margin-left: -12px; }
.level-tick:nth-child(2) { left: 33.333%; }
.level-tick:nth-child(3) { left: 66.666%; }
.level-tick:nth-child(4) { left: auto; right: -12px; transform: none; }
.level-tick.on { color: var(--moon); }
.level-tick:focus-visible { outline: 2px solid var(--brand-soft); border-radius: 6px; }
.level-card { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid rgba(183, 148, 255, .35); border-radius: var(--radius-small); background: rgba(139, 92, 246, .1); }
.level-card p { margin: 0; }
.level-card ul { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 3px; font-size: 14px; }
.dc-typing { display: flex; align-items: center; gap: 8px; padding-left: 54px; color: #b5bac1; font-size: 13px; }
.dc-typing strong { color: #dbdee1; }
.dc-dots { display: inline-flex; gap: 3px; }
.dc-dots i { width: 6px; height: 6px; border-radius: 50%; background: #b5bac1; animation: typing-dot 1s ease-in-out infinite; }
.dc-dots i:nth-child(2) { animation-delay: .15s; } .dc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(7, 5, 13, .82); backdrop-filter: blur(6px); }
.celebrate-card { display: grid; justify-items: center; gap: 14px; text-align: center; }
.celebrate-card p { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--moon); }
.celebrate-moon { width: 110px; height: 110px; filter: drop-shadow(0 0 30px rgba(183, 148, 255, .7)); }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.burst-star { position: absolute; left: 0; top: 0; width: 8px; height: 8px; opacity: 0;
  background: radial-gradient(circle, #fff 0 30%, #b794ff 60%, transparent 70%); border-radius: 50%; }
.burst-star.big { width: 14px; height: 14px; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); background: #f3ecff; border-radius: 0; }
@media (prefers-reduced-motion: reduce) {
  .wiz-sky span, .wiz-rail li.now .wiz-dot, .dc-dots i { animation: none; }
  .moon-shadow, .wiz-rail button, .wiz .btn { transition: none; }
}

/* The Discord-looking preview (Discord's own colours, so it reads as "in Discord") */
.dc-win { margin: 0; border-radius: 10px; overflow: hidden; background: #313338; color: #dbdee1; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  font: 15px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; }
.dc-win-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #1f2023; color: #f2f3f5; font-weight: 600; }
.dc-hash { color: #80848e; font-size: 20px; line-height: 1; }
.dc-win-body { display: grid; gap: 14px; padding: 16px; min-height: 120px; }
.dc-win figcaption { padding: 10px 16px 12px; background: #2b2d31; color: #b5bac1; font-size: 13px; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.dc-avatar-blank { display: grid; place-items: center; background: #5865f2; color: #fff; font-size: 13px; font-weight: 700; }
.dc-msg-main { min-width: 0; display: grid; gap: 4px; }
.dc-msg-head { display: flex; align-items: center; gap: 6px; }
.dc-msg-head strong { color: #f2f3f5; font-weight: 600; }
.dc-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-content { overflow-wrap: anywhere; }
.dc-embed-box { display: grid; gap: 6px; max-width: 432px; padding: 10px 14px 12px 12px; border-left: 4px solid #8b5cf6; border-radius: 4px; background: #2b2d31; font-size: 14px; }
.dc-embed-title { color: #f2f3f5; font-weight: 700; }
.dc-embed-desc { white-space: pre-line; overflow-wrap: anywhere; }
.dc-embed-row { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.dc-embed-fname { color: #f2f3f5; font-weight: 600; font-size: 13px; }
.dc-embed-fval { white-space: pre-line; overflow-wrap: anywhere; }
.dc-embed-foot { color: #b5bac1; font-size: 12px; }
.dc-system { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: rgba(240, 71, 71, 0.08); color: #b5bac1; font-size: 14px; font-style: italic; }
.dc-system svg { width: 18px; height: 18px; flex: none; color: #f23f43; }
.dc-win code, .dc-win strong code { font-size: 13px; }

/* Modules page and Overview summary */
.module-group { margin-bottom: 26px; }
.module-group > h2 { font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mist); margin: 0 0 12px; }
.module-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.module-card { min-height: 150px; }
.module-card-foot .premium-pill { margin-left: 0; display: inline-flex; gap: 4px; }
.module-card-foot .premium-pill svg { width: 12px; height: 12px; }
.module-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.module-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--haze); color: var(--moon); text-decoration: none; font-size: 14px; }
.module-chip svg { width: 16px; height: 16px; color: var(--brand-soft); }
a.module-chip:hover { border-color: var(--brand-soft); }
.module-chip.off { opacity: 0.55; }
.chip-state { font-size: 11px; font-weight: 700; color: var(--mist); }
.modules-summary .panel-head .btn svg { width: 15px; height: 15px; }

/* Premium */
.premium-pill { background: rgba(183, 148, 255, 0.2); color: var(--brand-soft); margin-left: auto; }
.nav a .premium-pill { font-size: 11px; padding: 0 8px; }
.premium-banner { border-color: rgba(183, 148, 255, 0.45); background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.06)); }
.slot-meter { display: flex; gap: 6px; }
.slot-meter span { flex: 1; max-width: 48px; height: 8px; border-radius: 999px; background: var(--line); }
.slot-meter span.used { background: var(--brand-strong); }
.slots { display: grid; gap: 8px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.slot .guild-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.slot.over { border-color: rgba(233, 185, 85, 0.5); }
.slot-text { flex: 1; min-width: 0; display: grid; }
.slot-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tier-card { display: grid; gap: 6px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--haze); }
.tier-card.current { border-color: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-soft) inset; }
.tier-card ul { margin: 6px 0; padding-left: 18px; color: var(--mist); display: grid; gap: 4px; font-size: 14px; }
.tier-card .btn { justify-self: stretch; }
.tier-name { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.tier-price { font-size: 26px; font-weight: 700; }
.tier-price span { font-size: 14px; font-weight: 500; color: var(--mist); }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feature { display: flex; gap: 10px; align-items: flex-start; }
.feature svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand-soft); }
.feature > div { display: grid; gap: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Moderation page */
.tab-pill { margin-left: 6px; font-size: 10px; padding: 0 6px; }
.case-filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 10px; }
.case-export { align-self: end; }
.case-list, .report-list { display: grid; gap: 8px; margin-top: 8px; }
.case { border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--haze); }
.case.undone { opacity: 0.6; }
.case-head { width: 100%; display: grid; grid-template-columns: 56px 130px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-small); }
.case-head:hover { background: rgba(139, 92, 246, 0.08); }
.case-head:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: -2px; }
.case-no { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--mist); }
.case-kind { justify-self: start; white-space: nowrap; }
.k-ban, .k-tempban, .k-softban { background: rgba(240, 122, 139, 0.14); color: var(--danger); }
.k-kick, .k-timeout { background: rgba(233, 185, 85, 0.14); color: var(--warn); }
.k-unban, .k-untimeout { background: rgba(95, 207, 169, 0.13); color: var(--ok); }
.k-warn, .k-automod { background: rgba(139, 92, 246, 0.18); color: var(--brand-soft); }
.case-who { display: grid; min-width: 0; }
.case-who strong, .case-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-reason { color: var(--mist); font-size: 14px; }
.case-meta { display: flex; gap: 6px; align-items: center; color: var(--mist); font-size: 13px; white-space: nowrap; }
.case-detail { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: grid; gap: 12px; }
.case-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
.case-facts dt { color: var(--mist); }
.case-facts dd { margin: 0; overflow-wrap: anywhere; }
.case-evidence ul { margin: 6px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.case-history-when { color: var(--mist); font-size: 13px; }
.case-edit { display: grid; gap: 10px; }
.danger-text { color: var(--danger); }
.report { border: 1px solid var(--line); border-radius: var(--radius-small); padding: 12px 14px; display: grid; gap: 8px; background: var(--haze); }
.report.handled { opacity: 0.75; }
.report-top { display: flex; align-items: center; gap: 10px; }
.report-top .hint { margin-left: auto; }
.report blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--moon); white-space: pre-wrap; overflow-wrap: anywhere; }
.report-head { display: flex; justify-content: flex-start; margin-bottom: 6px; }
.dm-preview { display: grid; gap: 4px; padding: 12px 14px; border-left: 4px solid var(--brand-strong); border-radius: 0 var(--radius-small) var(--radius-small) 0; background: var(--haze); white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-preview p { margin: 0; color: var(--mist); }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
fieldset.plain:disabled { opacity: 0.55; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--mist); font-weight: 600; }

/* Automod page */
.am-tabs { display: flex; flex-wrap: wrap; border-radius: var(--radius-large); margin: 4px 0 8px; }
.am-tabs button { position: relative; }
.tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--danger); vertical-align: middle; }
.kind-list, .am-rules { display: grid; gap: 14px; }
.am-rule { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-small); }
.am-rule.off .am-nums { opacity: 0.5; }
.am-nums { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-left: 52px; }
.am-num { display: inline-flex; align-items: center; gap: 8px; color: var(--mist); font-size: 14px; }
.am-num input, .field > input[type="number"] { width: 96px; }
.list-box { display: grid; gap: 4px; }
.list-box textarea { width: 100%; resize: vertical; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 14px; }
.am-steps { display: grid; gap: 10px; }
.am-step { display: grid; grid-template-columns: auto 130px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.am-alert { display: inline-flex; align-items: center; gap: 8px; color: var(--mist); font-size: 14px; white-space: nowrap; cursor: pointer; }
.am-alert input { width: 18px; height: 18px; accent-color: var(--brand); }
.am-step .btn svg { width: 16px; height: 16px; }
.am-cmds { display: grid; gap: 8px; }
.am-cmds > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.am-list { display: grid; gap: 6px; padding-left: 18px; color: var(--mist); }
/* Automod "Try a message": a bench to test settings on, set apart from the forms below */
.am-try { display: grid; gap: 12px; margin: 6px 0 18px; padding: 18px 20px; background: var(--dusk);
  border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); }
.am-try-head h2 { margin: 0; font-size: 18px; }
.am-try-head p { margin: 4px 0 0; color: var(--mist); font-size: 14px; }
.am-try-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.am-try-row textarea { width: 100%; resize: vertical; min-height: 46px; }
.am-try-actions { display: flex; gap: 10px; }
.am-try-actions select { max-width: 200px; }
.am-try-out:empty { display: none; }
.am-try-out { display: grid; gap: 6px; }
.am-try-hits { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.am-try-hits li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px;
  border-radius: var(--radius-small); background: rgba(240, 122, 139, 0.1); border: 1px solid rgba(240, 122, 139, 0.35); }
.am-try-hits li > span:not(.hint) { color: var(--danger); }
.am-try-clean { margin: 0; padding: 8px 12px; border-radius: var(--radius-small); color: var(--ok);
  background: rgba(95, 207, 169, 0.08); border: 1px solid rgba(95, 207, 169, 0.3); }
.am-try-out .hint { margin: 0; }
.am-always { margin: 0 0 4px; }
.am-sentence { align-items: center; padding-left: 0; color: var(--mist); font-size: 14px; }
.am-sentence .field { margin: 0; }
.am-sentence.off { opacity: 0.5; }
.am-partners { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.am-partners li { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--haze); font-size: 14px; }
.am-partners .btn svg { width: 14px; height: 14px; }
.am-partner-add { display: flex; gap: 8px; }
.am-partner-add input { flex: 1; min-width: 0; }

@media (max-width: 1000px) {
  .wiz-body { grid-template-columns: minmax(0, 1fr); }
  .wiz-preview { position: static; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow-pop); }
  .shell.menu-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(5, 3, 12, 0.6); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: rgba(7, 5, 13, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 24px 16px 120px; }
  h1 { font-size: 25px; }
}
@media (max-width: 620px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(n) { border-left: 0; border-top: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .stat:nth-child(2n) { border-left: 1px solid var(--line); }
  .row-2 { grid-template-columns: minmax(0, 1fr); }
  .feed-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .alert-row { grid-template-columns: 34px minmax(0, 1fr); }
  .alert-row > .btn { grid-column: 2; justify-self: start; }
  .server-row { grid-template-columns: auto minmax(0, 1fr); }
  .server-row > .btn { grid-column: 2; justify-self: start; }
  .dc-embed { grid-template-columns: minmax(0, 1fr); }
  .dc-embed .dc-thumb { display: none; }
  .savebar { border-radius: var(--radius-large); flex-wrap: wrap; }
  .am-nums { padding-left: 0; }
  .tier-cards, .feature-list { grid-template-columns: minmax(0, 1fr); }
  .wiz-body { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .wiz-preview { position: static; }
  .wiz-rail li { min-width: 74px; }
  .wiz-rail button { font-size: 12px; }
  .wiz-title { font-size: 25px; }
  .wiz-summary { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .wiz-summary dd { margin-bottom: 8px; }
  .pfeature { grid-template-columns: 20px minmax(0, 1fr); }
  .pfeature-state { grid-column: 2; }
  .case-filters { grid-template-columns: minmax(0, 1fr); }
  .case-head { grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; }
  .case-head .case-who { grid-column: 1 / -1; grid-row: 2; }
  .case-head .case-meta { grid-column: 1 / -1; white-space: normal; flex-wrap: wrap; }
  .case-facts { grid-template-columns: minmax(0, 1fr); }
  .case-facts dt { margin-top: 6px; }
  .am-step { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); }
  .am-step > select, .am-step > label:nth-of-type(2) { grid-column: 1; }
  .am-step > .btn { grid-column: 2; grid-row: 1; }
  .am-cmds > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .am-try { padding: 14px; }
  .am-try-row { grid-template-columns: minmax(0, 1fr); }
  .am-try-actions select { flex: 1; max-width: none; min-width: 0; }
  .moon { opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .zzz span { opacity: 0.85; }
}

/* ---------- cookie notice, legal links, legal pages ---------- */

.cookie-notice { position: fixed; left: 18px; bottom: 18px; z-index: 45; width: min(420px, calc(100% - 36px));
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px;
  background: #0e0a19; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: 14px; }
.cookie-notice p { flex: 1; color: var(--mist); }
.legal-links { display: flex; gap: 14px; font-size: 13px; }
.legal-links a { color: var(--faint); }
.legal-links a:hover { color: var(--moon); }
.sidebar .legal-links { padding: 0 6px; }
.login .legal-links { margin-top: 4px; }
.section-gap { margin-top: 26px; }
.stats-note { margin-top: 12px; }
.content { min-width: 0; }

.legal { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.legal-top .brand span { font-size: 20px; }
.legal h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 8px; }
.legal .updated { color: var(--faint); margin-bottom: 30px; }
.legal h2 { margin: 34px 0 10px; }
.legal p, .legal li { color: #e4dcf5; max-width: 70ch; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 22px; margin: 10px 0; display: grid; gap: 6px; }
.legal .summary { padding: 16px 20px; border-radius: var(--radius); background: var(--dusk); border: 1px solid var(--line); margin-bottom: 8px; }
.legal footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.img-fallback { display: grid; place-items: center; background: var(--haze); color: var(--brand-soft);
  font: 600 13px/1 var(--font-display); overflow: hidden; }
.login-avatar.img-fallback { font-size: 28px; }
.menu-pic { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; font-size: 11px; }

.chip-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: none; }
.menu-item .chip-avatar { width: 24px; height: 24px; }

.brand-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; font-size: 12px; }
.me-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; font-size: 12px; }
.dc-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; font-size: 14px; }
.dc-thumb { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; font-size: 22px; }
.guild-icon.img-fallback { border-radius: 12px; }
.chip-avatar.img-fallback { font-size: 9px; }

/* Six-section sidebar + the tab row at the top of each section */
.nav a .nav-label { flex: 1; min-width: 0; }
.nav-off { margin-left: auto; font-size: 11px; padding: 0 8px; color: var(--faint); }
.section-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.section-tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mist); font-weight: 600; text-decoration: none; }
.section-tabs a:hover { color: var(--moon); }
.section-tabs a[aria-current="page"] { color: var(--moon); border-bottom-color: var(--brand-soft); }
.section-tabs a:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: -2px; border-radius: 8px; }
.coming-panel { display: grid; gap: 10px; justify-items: start; }
.coming-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--mist); }
.nav a .nav-premium { padding: 2px 6px; }
.nav a .nav-premium svg { width: 12px; height: 12px; }

/* Help centre */
.nav a.nav-help { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 14px; }
.page-top { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.page-top.no-tabs { border-bottom: 0; margin: 0; }
.page-top .section-tabs { margin: 0; border-bottom: 0; flex: 1; }
.page-help { margin-left: auto; padding-bottom: 10px; }
.page-help a { display: inline-flex; align-items: center; gap: 6px; color: var(--mist); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.page-help a:hover { color: var(--moon); }
.page-help svg { width: 16px; height: 16px; }
.help-search { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--haze); color: var(--faint); }
.help-search svg { width: 18px; height: 18px; flex: none; }
.help-search input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 12px 0; color: var(--moon); }
.help-search:focus-within { border-color: var(--brand-soft); }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.help-card { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-large); background: var(--haze); color: var(--mist); text-decoration: none; }
.help-card strong { color: var(--moon); font-size: 16px; }
.help-card:hover, .help-card:focus-visible { border-color: var(--brand-soft); }
.help-card[hidden] { display: none; }
.help-back { color: var(--mist); font-weight: 600; text-decoration: none; }
.help-back:hover { color: var(--moon); }
.help-article { display: block; max-width: 760px; line-height: 1.6; }
.help-article h2, .help-article h3 { margin: 22px 0 8px; font-size: 18px; }
.help-article h2:first-child, .help-article h3:first-child { margin-top: 0; }
.help-article ul { padding-left: 20px; display: grid; gap: 6px; }
.help-article code { padding: 1px 6px; border-radius: 6px; background: var(--haze); }

/* ---------- Security & Anti-Nuke ---------- */
.sec-body { display: grid; gap: 20px; }
.sec-owned { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 18px; }
.sec-owned:disabled { opacity: 0.6; }
.banner.sec-lock { justify-content: flex-start; flex-wrap: nowrap; background: var(--haze); border-color: var(--line); }
.banner.sec-lock svg { width: 20px; height: 20px; flex: none; color: var(--brand-soft); }
.banner.danger { background: linear-gradient(120deg, rgba(240, 122, 139, 0.26), rgba(240, 122, 139, 0.07)); border-color: rgba(240, 122, 139, 0.5); }
.banner.danger h2 { margin: 0 0 4px; font-size: 19px; }
.btn-danger { background: rgba(240, 122, 139, 0.14); border-color: rgba(240, 122, 139, 0.55); color: #ffd0d7; }
.sec-emergency .btn-danger { background: var(--danger); border-color: var(--danger); color: #2a0710; min-width: 110px; }
.sec-emergency .btn-danger:hover { background: #f8a0ad; color: #2a0710; }

.sec-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.sec-hero { display: flex; align-items: center; gap: 26px; overflow: hidden; position: relative;
  background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, 0.22), transparent 60%), var(--dusk); }
.sec-hero-text { display: grid; gap: 4px; min-width: 0; }
.sec-hero-text h2 { margin: 0; font: 600 26px/1.15 var(--font-display); }
.sec-hero-text p { margin: 0; color: var(--mist); }
.sec-kicker { color: var(--brand-soft); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.score-moon { --tone: var(--ok); position: relative; width: 140px; height: 140px; flex: none; }
.score-moon.warn { --tone: var(--warn); }
.score-moon.danger { --tone: var(--danger); }
.moon-svg { width: 100%; height: 100%; overflow: visible; }
.moon-track { fill: none; stroke: var(--line); stroke-width: 8; }
.moon-arc { fill: none; stroke: var(--tone); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--tone)); }
.moon-disc { fill: #efe6ff; filter: drop-shadow(0 0 14px rgba(243, 236, 255, 0.35)); }
.moon-shade { fill: #1b1430; }
.score-num { position: absolute; inset: 0; display: grid; place-items: center; font: 700 30px/1 var(--font-display);
  color: #fff; text-shadow: 0 1px 6px rgba(7, 5, 13, 0.9), 0 0 2px rgba(7, 5, 13, 0.9); }
.sec-emergency { display: grid; gap: 4px; align-content: start; }
.sec-emergency .panel-head { margin-bottom: 4px; }
.sec-emergency-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.sec-emergency-row + .sec-emergency-row { border-top: 1px solid var(--line); }
.sec-emergency-row p { margin: 2px 0 0; }

.sec-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sec-level { display: grid; gap: 8px; align-content: start; text-align: left; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--haze); color: var(--moon); font: inherit; cursor: pointer; }
.sec-level:hover:not(:disabled) { border-color: var(--brand-soft); }
.sec-level:disabled { cursor: default; }
.sec-level strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; }
.sec-level ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; color: var(--mist); font-size: 13px; }
.sec-level.on { border-color: var(--brand-soft); background: rgba(139, 92, 246, 0.16); box-shadow: 0 0 0 1px var(--brand-soft) inset; }
.sec-level.off.on { border-color: var(--danger); background: rgba(240, 122, 139, 0.1); box-shadow: 0 0 0 1px var(--danger) inset; }

.sec-limits { display: grid; gap: 2px; }
.sec-limit { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 140px); gap: 12px; align-items: center; padding: 8px 0; }
.sec-limit + .sec-limit { border-top: 1px solid var(--line); }
.sec-limit .field-error { grid-column: 1 / -1; }
.sec-limit input::placeholder { color: var(--faint); font-size: 12px; }
.sec-limit.has-error input { border-color: var(--danger); }
.sec-snap { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; cursor: pointer; }
.sec-snap input { width: 18px; height: 18px; accent-color: var(--brand); }
.sec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0; }
.sec-stats .stat:nth-child(n) { border-top: 0; border-left: 0; }
.sec-stats .stat + .stat { border-left: 1px solid var(--line); }
.sec-emoji { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-emoji-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--haze); font-size: 22px; cursor: pointer; }
.sec-emoji-btn[aria-pressed="true"] { border-color: var(--brand-soft); background: rgba(139, 92, 246, 0.22); box-shadow: 0 0 0 1px var(--brand-soft) inset; }
.sec-preview .dc-win { margin: 0; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 54px; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; }
.dc-button.ok { background: #248046; }
.sec-honey-setup { align-items: flex-end; }
.sec-honey-setup .field { min-width: 240px; }
.level-security { display: grid; gap: 4px; margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(183, 148, 255, 0.25); font-size: 14px; }
.level-security strong { display: flex; align-items: center; gap: 6px; }
.level-security svg { width: 16px; height: 16px; color: var(--brand-soft); }
.confirm-dialog { text-align: center; }

@media (max-width: 1000px) {
  .sec-top { grid-template-columns: minmax(0, 1fr); }
  .sec-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .sec-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .score-moon { width: 116px; height: 116px; }
  .sec-levels { grid-template-columns: minmax(0, 1fr); }
  .sec-limit { grid-template-columns: minmax(0, 1fr) 96px; }
  .sec-limit .hint { grid-column: 1 / -1; margin-top: -6px; }
  .sec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-stats .stat:nth-child(3) { border-left: 0; }
  .sec-stats .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .sec-emergency-row { flex-wrap: wrap; }
  .dc-buttons { padding-left: 0; }
}
.picker-empty { color: var(--faint); font-size: 14px; }
@media (max-width: 620px) {
  .check { grid-template-columns: 26px minmax(0, 1fr); }
  .check > :nth-child(3) { grid-column: 2; justify-self: start; }
}
@media (max-width: 620px) {
  .page-top .section-tabs { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .page-top .section-tabs::-webkit-scrollbar { display: none; }
  .section-tabs a { flex: none; white-space: nowrap; }
}

/* ---------- live updates ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.live-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.live-dot.on { color: var(--mist); }
.live-dot.on .live-mark { background: var(--ok); box-shadow: 0 0 0 0 rgba(95, 207, 169, 0.5); animation: live-pulse 2.4s ease-out infinite; }
.live-dot.down .live-mark { background: var(--warn); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 207, 169, 0.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(95, 207, 169, 0); } }
.sidebar-foot { flex-wrap: wrap; }
.sidebar-foot .live-dot { order: 3; flex-basis: 100%; padding: 0 2px 2px; }
.live-bar { position: fixed; z-index: 60; left: 50%; top: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; padding: 12px 14px 12px 18px;
  border-radius: var(--radius); background: var(--dusk); border: 1px solid var(--line); border-left: 4px solid var(--brand-soft); box-shadow: var(--shadow-pop);
  animation: live-bar-in 0.22s ease-out; }
@keyframes live-bar-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.alarm-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 18px; border-radius: var(--radius-small);
  background: rgba(240, 122, 139, 0.12); border: 1px solid rgba(240, 122, 139, 0.4); color: var(--moon); font-weight: 600; text-decoration: none; }
.alarm-banner svg { color: var(--danger); flex: none; }
.alarm-banner:hover { background: rgba(240, 122, 139, 0.18); }
.alarm-banner.inline { margin: 0; }

/* ---------- profile menu (sidebar foot) ---------- */
.profile { position: relative; flex: 1; min-width: 0; }
.profile-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--moon); font: inherit; cursor: pointer; text-align: left; }
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: var(--haze); }
.profile-btn:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
.profile-btn svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.profile-btn .who { min-width: 0; flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { top: auto; bottom: calc(100% + 6px); width: 100%; min-width: 200px; }
.profile-menu svg { width: 18px; height: 18px; flex: none; }
a.menu-item { text-decoration: none; }

/* ---------- admin area (owner only) ---------- */
.admin-area { min-height: 100vh; display: flex; flex-direction: column; }
.admin-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 24px; min-height: 60px;
  background: rgba(7, 5, 13, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.admin-top .brand { display: flex; align-items: center; gap: 10px; color: var(--moon); font-weight: 700; text-decoration: none; flex: none; }
.admin-top .brand span { font-family: var(--font-display); letter-spacing: 0.02em; }
.admin-tabs.section-tabs { margin: 0; border-bottom: 0; flex: 1; align-self: stretch; align-items: stretch; flex-wrap: nowrap; }
.admin-tabs a { display: flex; align-items: center; }
.admin-top-end { display: flex; align-items: center; gap: 14px; flex: none; }
.admin-main { padding: 28px 24px 60px; width: 100%; max-width: 1400px; margin: 0 auto; }
.admin-page { display: grid; gap: 18px; }
.admin-page .page-head { margin: 0; }
.admin-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-tools input[type="search"] { flex: 1; min-width: 220px; }
.admin-tools select { width: auto; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--dusk); color: var(--mist); font: 600 13px var(--font-body); cursor: pointer; }
.filter-chip:hover { color: var(--moon); border-color: #3a2c5c; }
.filter-chip[aria-pressed="true"] { background: var(--brand-glow); border-color: var(--brand-soft); color: var(--moon); }
.filter-chip:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; }
.filter-count { padding: 0 6px; border-radius: 999px; background: var(--haze); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--dusk); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 10px 14px; color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover, .admin-table tr.picked { background: var(--haze); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table a { color: inherit; text-decoration: none; }
.admin-table a:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 2px; border-radius: 6px; }
.cell-server, .person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-server .guild-icon { width: 32px; height: 32px; }
.person-text { display: grid; min-width: 0; }
.person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-id { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; align-content: flex-start; }
.cell-pills .premium-pill, .person-name .premium-pill { margin-left: 0; }
.slot-names { display: block; color: var(--faint); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plain-link { color: inherit; text-decoration: none; }
.panel-title { margin: 0 0 6px; font-size: 18px; }
.gift-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-top: 12px; }
.gift-form input { flex: 1; min-width: 200px; }
.gift-form select { width: auto; }
.gift-form .field-error { flex-basis: 100%; margin: 0; }
.admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.bars { display: grid; gap: 10px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 140px) minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: 14px; }
.bar-label { color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--haze); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand-soft); }
.bar-fill.danger { background: var(--danger); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--mist); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; margin: 0; }
.fact dt { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.fact dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.fact dd .person-id { display: block; font-weight: 400; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.role-chip { padding: 2px 10px; }
.detail-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(3, 2, 8, 0.55); animation: fade-in 0.2s ease-out; }
.detail { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(560px, 100%); overflow-y: auto; background: var(--night);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: detail-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes detail-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.detail-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--night); border-bottom: 1px solid var(--line); }
.detail-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { padding: 20px 22px 40px; display: grid; gap: 22px; }
.detail-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-hero > div { flex: 1; min-width: 0; }
.detail-hero h2 { margin: 0; overflow-wrap: anywhere; }
.detail-hero p { margin: 2px 0 0; }
.detail-hero .profile-pic { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; font-size: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 15px; color: var(--mist); }
.detail-score { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.shared-list { display: grid; gap: 10px; }
.shared-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--dusk); }
.shared-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; flex: 1; }
@media (max-width: 900px) {
  .admin-table .col-wide { display: none; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .admin-top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px 0; }
  .admin-top-end { margin-left: auto; }
  .admin-top-end .btn { padding-inline: 10px; }
  .admin-tabs.section-tabs { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
  .admin-tabs.section-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs a { flex: none; white-space: nowrap; }
  .admin-main { padding: 20px 16px 48px; }
  .admin-table td { padding: 10px; }
  .admin-table .person-id, .admin-table .slot-names { display: none; }
  .admin-table .person-name { white-space: normal; overflow-wrap: break-word; min-width: 84px; }
  .admin-table .person .me-pic { display: none; }
  .detail { width: 100%; border-left: 0; }
  .detail-body { padding: 18px 16px 36px; }
  .bar-row { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 40px; }
  .admin-tools select, .gift-form select, .gift-form .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot.on .live-mark { animation: none; }
  .live-bar, .detail, .detail-scrim { animation: none; }
}
.live-dot.paused .live-mark { background: var(--faint); }

/* ---------- how long history is kept + downloads ---------- */
.keep-notice { margin-bottom: 16px; }
.keep-notice strong { display: block; margin-bottom: 2px; }
.keep-notice a, .keep-hint a { color: var(--brand-soft); font-weight: 600; white-space: nowrap; }
.keep-hint { margin: 0 0 12px; }
.export-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.export-buttons .btn[disabled] { opacity: 0.7; cursor: progress; }

/* a case opened from a Discord "Open in dashboard" link */
.case.case-linked { border-color: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-soft); scroll-margin-top: 80px; }

/* ---------- case screenshots ---------- */
.ev-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.ev-shot { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden; background: var(--haze); }
.ev-shot img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.2s ease; }
.ev-shot:hover { border-color: var(--brand-soft); }
.ev-shot:hover img { transform: scale(1.04); }
.ev-drop { margin: 8px 0 4px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--haze);
  display: grid; gap: 6px; transition: border-color 0.15s ease, background 0.15s ease; }
.ev-drop:focus-visible, .ev-drop.over { border-color: var(--brand-soft); background: rgba(139, 92, 246, 0.1); }
.ev-drop.busy { opacity: 0.75; cursor: progress; }
.ev-drop.full { opacity: 0.6; }
.ev-drop-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ev-drop-text { color: var(--mist); font-size: 14px; }
.ev-space { color: var(--faint); font-size: 12px; }
.ev-shot-wrap { display: grid; gap: 4px; }
.ev-shot-wrap .ev-remove { justify-self: start; }
.ev-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; overflow-wrap: anywhere; }
.ev-remove { padding-block: 2px; font-size: 12px; }
.ev-remove.armed { background: rgba(248, 113, 113, 0.14); }
.ev-notes { margin: 8px 0 0; padding: 0; list-style: none; }
.ev-notes li { color: var(--faint); font-size: 13px; font-style: italic; }
@media (prefers-reduced-motion: reduce) { .ev-shot img, .ev-drop { transition: none; } .ev-shot:hover img { transform: none; } }

/* ---------- verify channel checker (Security → Verification) ---------- */
.sec-verify-status { border-left: 3px solid var(--warn); padding-left: 14px; margin-bottom: 14px; }
.sec-verify-status.ok { border-left-color: var(--ok); }
.sec-verify-status.none { border-left-color: var(--brand-soft); }
.sec-verify-problems { margin: 8px 0 0; padding-left: 18px; }
.sec-verify-problems li { margin: 3px 0; }
.sec-verify-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
@media (max-width: 640px) { .sec-verify-status .panel-head { flex-direction: column; align-items: stretch; } }
.sec-honey-tip.banner { margin: 0 0 14px; }
.sec-honey-tip.hint { display: flex; gap: 6px; align-items: center; margin: 0 0 14px; }
.sec-honey-tip.hint svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
/* recommended anti-raid setup (checklist + one button) */
.sec-recommended { border-left: 3px solid var(--brand); }
.sec-recommended.ok { border-left-color: var(--ok); }
.sec-checklist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.sec-checklist li { display: flex; gap: 10px; align-items: baseline; }
.sec-checklist li.todo { color: var(--moon); }
.sec-checklist li.ok, .sec-checklist li.info { color: var(--mist); }
.sec-check-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; line-height: 1; transform: translateY(3px); }
.sec-checklist li.ok .sec-check-mark { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.sec-checklist li.todo .sec-check-mark { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.sec-checklist li.info .sec-check-mark { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-soft); font-style: italic; }
@media (max-width: 640px) { .sec-recommended .panel-head { flex-direction: column; align-items: stretch; } }
.sec-setup-done { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--mist); }
.sec-setup-done ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.sec-setup-done p { margin: 4px 0 0; }
