/*
  SpiderBot dashboard. One dark theme: carbon surfaces, a single red thread of accent, and cut corners taken
  from the logo's faceted shapes. Tokens first, then base, components, the app shell, and pages.
  Red means "act here" or "you are here". Green means a feature is on. Nothing else uses those two colors.
*/
@font-face { font-family: "Geist"; src: url("../fonts/geist.woff2?v=1") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono.woff2?v=1") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-500.woff2?v=1") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-600.woff2?v=1") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("../fonts/chakra-petch-700.woff2?v=1") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #09080a;
  --bg-2: #0d0c0f;
  --panel: #121015;
  --panel-2: #18161c;
  --panel-3: #221f27;
  --line: #25222a;
  --line-2: #38333e;
  --text: #f4f0ef;
  --text-2: #b3acb3;
  --text-3: #766f78;
  --red: #ff2b44;
  --red-2: #ff5468;
  --red-text: #ff8090;
  --red-soft: rgb(255 43 68 / .12);
  --ring: rgb(255 43 68 / .65);
  --green: #3ddc97;
  --amber: #f5b83d;
  --blue: #5aa9ff;
  --sky: #38c6f4;
  --orange: #fb923c;
  --violet: #a78bfa;
  --danger: #ff6b6b;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Chakra Petch", "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --sidebar: 264px;
  --shadow: 0 18px 44px -18px rgb(0 0 0 / .75);
  /* Corners. Browsers without corner-shape get plain rounded corners. */
  --r-card: 12px;
  --r-ctl: 8px;
  --r-tag: 5px;
  --corner: round;
}
@supports (corner-shape: bevel) {
  :root { --r-card: 4px 16px 4px 16px; --r-ctl: 3px 9px 3px 9px; --r-tag: 2px 6px 2px 6px; --corner: round bevel round bevel; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--red-text); text-decoration: none; }
a:hover { color: #ffb0ba; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 clamp(1.65rem, 2.6vw, 2.1rem)/1.15 var(--display); letter-spacing: -.01em; }
h2, h3 { font-size: 1rem; font-weight: 600; letter-spacing: -.005em; }
code, kbd { font: .84em var(--mono); background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 5px; padding: .08em .4em; color: var(--text); }
kbd { color: var(--text-2); font-size: .72rem; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgb(255 43 68 / .3); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 28px; height: 28px; }
.muted { color: var(--text-2); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dot-sep::before { content: "·"; margin: 0 .5em; color: var(--text-3); }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .5rem .8rem; border-radius: 6px; background: var(--red); color: #fff; }
.skip-link:focus { top: 1rem; }

/* ---- Buttons --------------------------------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 38px; padding: 0 1.05rem; border: 1px solid transparent; border-radius: var(--r-ctl); corner-shape: var(--corner);
  font: 600 .9rem/1 var(--display); letter-spacing: .02em; color: var(--text); cursor: pointer; white-space: nowrap;
  background: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: default; }
.button-primary { background: var(--red); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 8px 22px -10px var(--red); }
.button-primary:hover { background: var(--red-2); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 8px 26px -8px var(--red); }
.button-secondary { background: var(--panel-3); border-color: var(--line-2); }
.button-secondary:hover { background: #2c2832; border-color: #4a4452; color: var(--text); }
.button-ghost { border-color: var(--line-2); color: var(--text-2); }
.button-ghost:hover { background: var(--panel-2); color: var(--text); border-color: #4a4452; }
.button-danger { background: rgb(255 107 107 / .09); border-color: rgb(255 107 107 / .4); color: #ffa1a1; }
.button-danger:hover { background: rgb(255 107 107 / .18); color: #ffc9c9; }
.button-sm { min-height: 31px; padding: 0 .75rem; font-size: .82rem; }
.button-lg { min-height: 48px; padding: 0 1.4rem; font-size: 1rem; }
.icon-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-ctl); corner-shape: var(--corner);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-button:hover { background: var(--panel-3); color: var(--text); }
.icon-button:disabled { opacity: .35; cursor: default; }

/* ---- People and servers ---------------------------------------------------------------------------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-3); object-fit: cover; flex: none; }
.avatar-sm { width: 24px; height: 24px; }
.avatar-lg { width: 40px; height: 40px; }
.avatar-xl { width: 68px; height: 68px; }
.guild-icon { width: 36px; height: 36px; border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--panel-3); object-fit: cover; flex: none; }
.guild-icon-sm { width: 24px; height: 24px; font-size: .6rem; }
.guild-icon-lg { width: 56px; height: 56px; border-radius: var(--r-card); font-size: 1.05rem; }
.guild-icon-xl { width: 76px; height: 76px; border-radius: var(--r-card); font-size: 1.4rem; }
.guild-initials { display: grid; place-items: center; font: 700 .8rem var(--display); color: var(--red-text); background: linear-gradient(150deg, #3a0d15, #17131a 70%); }
.person { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 500; white-space: nowrap; }
a.person:hover { color: var(--red-text); }

/* ---- Tags: action pills, statuses, counts ------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: var(--r-tag); corner-shape: var(--corner);
  font: 600 .7rem/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--tone, var(--text-2)); background: color-mix(in srgb, var(--tone, var(--text-3)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone, var(--text-3)) 32%, transparent);
}
.pill-warn, .segment-warn, .bar-warn { --tone: var(--amber); }
.pill-timeout, .segment-timeout, .bar-timeout { --tone: var(--blue); }
.pill-removetimeout, .segment-removetimeout, .bar-removetimeout { --tone: var(--sky); }
.pill-kick, .segment-kick, .bar-kick { --tone: var(--orange); }
.pill-ban, .segment-ban, .bar-ban { --tone: var(--danger); }
.pill-unban, .segment-unban, .bar-unban { --tone: var(--green); }
.pill-jail, .segment-jail, .bar-jail { --tone: var(--violet); }
.pill-unjail, .segment-unjail, .bar-unjail { --tone: var(--green); }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; margin-left: .35rem; font: 600 .68rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.status-pill::before { content: ""; width: 6px; height: 6px; rotate: 45deg; background: currentColor; }
.status-active { color: var(--red-text); }
.status-reversed { color: var(--green); }
.status-boosting { color: var(--green); }
.status-grace { color: var(--amber); }
.case-head .status-pill, .table td > .status-pill:first-child { margin-left: 0; }
.count { padding: .05rem .45rem; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font: 500 .72rem var(--mono); }
.tag-app { display: inline-block; margin-left: .3rem; padding: 0 .3rem; border-radius: 4px; background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; vertical-align: middle; }
.tag-staff { display: inline-block; margin-left: .35rem; padding: .05rem .4rem; border-radius: var(--r-tag); corner-shape: var(--corner); background: var(--red-soft); border: 1px solid rgb(255 43 68 / .45); color: var(--red-text); font: 600 .62rem var(--display); letter-spacing: .1em; vertical-align: middle; }
.chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 .75rem; border-radius: var(--r-ctl); corner-shape: var(--corner);
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font: 500 .8rem var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { color: var(--text); background: var(--panel-2); }
.chip.is-active { color: #fff; background: var(--red-soft); border-color: rgb(255 43 68 / .6); }

/* A small diamond light: grey when a feature is off, green when it is on. */
.led { display: inline-block; width: 8px; height: 8px; flex: none; rotate: 45deg; background: var(--line-2); transition: background .2s, box-shadow .2s; }
.led.is-on { background: var(--green); box-shadow: 0 0 0 3px rgb(61 220 151 / .14), 0 0 10px rgb(61 220 151 / .55); }
/* A fold whose form has an on switch lights its summary from that switch, so the light follows unsaved changes.
   A fold with places to choose (input[data-place]) also needs one checked, as a rule with no channel makes nothing. */
.fold:has(input[data-led]) > summary .led { background: var(--line-2); box-shadow: none; }
.fold:has(input[data-led]:checked):not(:has(input[data-place])) > summary .led,
.fold:has(input[data-led]:checked):has(input[data-place]:checked) > summary .led { background: var(--green); box-shadow: 0 0 0 3px rgb(61 220 151 / .14), 0 0 10px rgb(61 220 151 / .55); }

/* ---- Alerts and toast --------------------------------------------------------------------------------- */
.alert { padding: .75rem 1rem; margin-bottom: 1rem; border-radius: var(--r-ctl); corner-shape: var(--corner); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); }
.alert-error { color: #ffc9c9; background: rgb(255 107 107 / .09); border-color: rgb(255 107 107 / .35); }
.alert ul { margin: 0; padding-left: 1.1rem; }
/* A refused change, inside the form that sent it. */
.form-error { margin: 0; }
.card > .form-error { margin: 0 1.35rem 1.1rem; }
.form-error p + p { margin-top: .35rem; }
.validation-summary-valid { display: none; }
.toast {
  position: fixed; right: 1.25rem; top: 1.25rem; z-index: 80; max-width: min(420px, calc(100vw - 2.5rem));
  display: flex; align-items: center; gap: .7rem; padding: .8rem 1.1rem .8rem 1rem;
  border-radius: var(--r-ctl); corner-shape: var(--corner); background: #10201a; border: 1px solid rgb(61 220 151 / .4);
  color: #b4f5d8; box-shadow: var(--shadow); font-weight: 500; animation: toast-in .25s ease-out; transition: opacity .4s, transform .4s;
}
.toast::before { content: ""; width: 8px; height: 8px; flex: none; rotate: 45deg; background: var(--green); box-shadow: 0 0 10px var(--green); }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---- Cards, groups, and setting rows ------------------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); corner-shape: var(--corner); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.35rem .5rem; }
.card-head h2 { font: 600 .95rem var(--display); letter-spacing: .02em; }
.card-body { padding: .5rem 1.35rem 1.25rem; }
.card-foot { padding: .2rem 1.35rem 1.1rem; }
.card-note { padding: 0 1.35rem .5rem; }
.link-arrow { display: inline-flex; align-items: center; gap: .3rem; font-size: .84rem; font-weight: 500; }
.empty-inline { padding: 1.4rem 1.35rem; color: var(--text-2); }
.empty-state { max-width: 460px; margin: clamp(2rem, 10vh, 6rem) auto; text-align: center; display: grid; justify-items: center; gap: .75rem; }
.empty-state p { color: var(--text-2); }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-card); corner-shape: var(--corner); background: var(--red-soft); color: var(--red-text); margin-bottom: .25rem; }

/* A titled part of a page: a diamond, a label, and a hairline running off to the right. */
.group { margin-top: 2.4rem; scroll-margin-top: 1.5rem; }
.group:first-child { margin-top: 0; }
.group-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .9rem; }
.group-head h2 { display: flex; align-items: center; gap: .65rem; font: 600 .78rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.group-head h2::before { content: ""; width: 7px; height: 7px; rotate: 45deg; background: var(--red); box-shadow: 0 0 8px rgb(255 43 68 / .7); }
.group-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); order: 1; }
.group-head > :not(h2) { order: 2; }
.group-note { margin: -.3rem 0 .9rem; color: var(--text-2); font-size: .88rem; max-width: 74ch; }
.group > .card + .card, .group > .library + .card, .group > .card + .library { margin-top: .75rem; }
.narrow { max-width: 1000px; }

/* One setting: what it is on the left, its control on the right. */
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 330px); gap: .9rem 2.5rem; align-items: center; padding: 1.15rem 1.35rem; margin: 0; border: 0; scroll-margin-top: 1.5rem; }
.row + .row { border-top: 1px solid var(--line); }
.row-text h3 { display: flex; align-items: center; gap: .6rem; font-size: .98rem; }
.row-text p { margin-top: .25rem; color: var(--text-2); font-size: .875rem; max-width: 64ch; }
.row-text .button { margin-top: .7rem; }
.row-control { display: grid; gap: .5rem; min-width: 0; }
.row-control .label { margin-bottom: 0; }
.row.is-wide { grid-template-columns: minmax(0, 1fr); }
.row-emoji { font-size: 1.05rem; line-height: 1; }
/* The row's light follows its main control without any script. */
.row:has([data-led]) .row-text h3::before, .log-row strong::before {
  content: ""; width: 8px; height: 8px; flex: none; rotate: 45deg; background: var(--line-2); transition: background .2s, box-shadow .2s;
}
.row:has(select[data-led] option:not([value=""]):checked) .row-text h3::before,
.row:has(input[data-led]:checked) .row-text h3::before,
.log-row:has(option:not([value=""]):checked) strong::before { background: var(--green); box-shadow: 0 0 0 3px rgb(61 220 151 / .14), 0 0 10px rgb(61 220 151 / .55); }
/* Arriving from search or a link flashes the place you were sent to. */
/* A feature switched on that still needs its channel lights amber, with a line saying what's missing. */
.card:has(select[data-needs] option[value=""]:checked) .row:has(input[data-led]:checked) .row-text h3::before {
  background: var(--amber); box-shadow: 0 0 0 3px rgb(245 184 61 / .14), 0 0 10px rgb(245 184 61 / .5);
}
.row-text .row-warn { display: none; color: var(--amber); }
.card:has(select[data-needs] option[value=""]:checked) .row:has(input[data-led]:checked) .row-warn { display: block; }
.row-control > .button { justify-self: start; }
.row:target, .card:target, .group:target > .card:first-of-type { animation: land 1.8s ease-out; }
@keyframes land { 0%, 35% { background-color: rgb(255 43 68 / .1); box-shadow: inset 2px 0 0 var(--red); } }

/* ---- Forms -------------------------------------------------------------------------------------------- */
.input {
  width: 100%; min-height: 40px; padding: .5rem .8rem; border-radius: var(--r-ctl); corner-shape: var(--corner);
  border: 1px solid var(--line-2); background: #0b0a0d; color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover:not(:disabled, :focus) { border-color: #4a4452; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.input:disabled { opacity: .6; }
select.input { appearance: none; padding-right: 2.2rem; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
.input.code { font-family: var(--mono); font-size: .82rem; line-height: 1.5; }
/* A hex value with a picker swatch beside it; the text field is what saves. */
.color-field { display: flex; gap: .5rem; align-items: center; }
.color-swatch { flex: none; width: 40px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner); background: #0b0a0d; cursor: pointer; }
.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 4px; }
.color-swatch::-moz-color-swatch { border: 0; border-radius: 4px; }
.label { display: block; margin-bottom: .4rem; font: 600 .7rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.field { display: grid; gap: .1rem; margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.field-error { color: #ffa1a1; font-size: .82rem; }
.field-error:empty, .field-validation-valid { display: none; }
.hint { margin-top: .35rem; color: var(--text-3); font-size: .8rem; }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.bare { margin: 0; padding: 0; border: 0; min-width: 0; }
.stack { display: grid; gap: 1rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.page-save { margin-top: 1.25rem; justify-content: flex-end; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
.split .field { margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--red); width: 16px; height: 16px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner); background: #0b0a0d; }
.segment { position: relative; display: flex; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 .8rem; border-radius: var(--r-tag); corner-shape: var(--corner); cursor: pointer;
  color: var(--text-2); font-size: .84rem; font-weight: 500; transition: background .12s, color .12s;
}
.segment span:hover { color: var(--text); background: var(--panel-2); }
.segment input:checked + span { color: var(--tone, #fff); background: color-mix(in srgb, var(--tone, var(--red)) 18%, var(--panel-3)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--red)) 55%, transparent); }
.segment input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
/* A read-only choice: no hover, no pointer, and dimmed so it doesn't look clickable. */
.segment input:disabled + span { cursor: default; opacity: .55; }
.segment input:disabled + span:hover { color: var(--text-2); background: none; }
.segment input:disabled:checked + span:hover { color: var(--tone, #fff); background: color-mix(in srgb, var(--tone, var(--red)) 18%, var(--panel-3)); }

.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-row { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; }
/* Several related switches in one setting row, one per line. */
.switch-list { display: grid; gap: .7rem; justify-items: start; }
.switch-track { position: relative; width: 42px; height: 24px; flex: none; border-radius: 8px; corner-shape: bevel; background: var(--panel-3); border: 1px solid var(--line-2); transition: background .15s, border-color .15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 5px; corner-shape: bevel; background: var(--text-3); transition: transform .15s, background .15s; }
.switch input:checked + .switch-track { background: rgb(61 220 151 / .22); border-color: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: var(--green); box-shadow: 0 0 10px rgb(61 220 151 / .6); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ring); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }

/* Member search */
.combo { position: relative; }
.combo-icon { position: absolute; left: .75rem; top: 11px; color: var(--text-3); pointer-events: none; }
.combo-input { padding-left: 2.3rem; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: .35rem; list-style: none;
  border-radius: var(--r-ctl); corner-shape: var(--corner); border: 1px solid var(--line-2); background: var(--panel-2); box-shadow: var(--shadow);
  max-height: 320px; overflow: auto;
}
.combo-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 5px; cursor: pointer; }
.combo-option.is-active, .combo-option:hover { background: var(--panel-3); }
.combo-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-meta { color: var(--text-3); font-size: .78rem; }

/* Searchable pickers */
.select-search { position: relative; min-width: 0; }
.select-button {
  display: block; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 2.2rem; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.select-button:disabled { cursor: default; opacity: .6; }
.select-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); min-width: 220px; padding: .4rem;
  border-radius: var(--r-ctl); corner-shape: var(--corner); border: 1px solid var(--line-2); background: var(--panel-2); box-shadow: var(--shadow);
}
.select-filter { min-height: 34px; padding: .35rem .6rem; }
.select-list { position: static; margin-top: .35rem; padding: 0; border: 0; box-shadow: none; background: none; max-height: 260px; }
.select-option { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-option.is-selected { color: var(--red-text); font-weight: 600; }
.select-empty { padding: .5rem .55rem; list-style: none; }
/* An open picker turns its chevron up. */
.select-button[aria-expanded="true"], .multi-pick.is-open .multi-field { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.select-button[aria-expanded="true"], .multi-pick.is-open .multi-chevron {
  background-image: linear-gradient(135deg, transparent 50%, var(--text-2) 50%), linear-gradient(45deg, var(--text-2) 50%, transparent 50%);
}
/* Multi-select: the chosen items as chips inside one field, and a list that opens below it (dashboard.js builds it
   from a .role-picker-list checklist, which stays in the form, hidden). */
.multi-pick { position: relative; min-width: 0; }
/* One line of chips comes out as tall as the single-select's button; more lines grow it, and the tools stay on the first. */
.multi-field {
  position: relative; display: flex; align-items: flex-start; gap: .3rem; min-height: calc(1.55em + 1rem + 2px);
  padding: calc((1.55em + 1rem - 26px) / 2) 6px; cursor: pointer;
}
.multi-field:has(> .multi-toggle:focus-visible) { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.multi-toggle { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.multi-toggle:focus-visible { outline: none; }
.multi-chips { position: relative; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.multi-placeholder { padding-left: calc(.8rem - 6px); line-height: 26px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-chip {
  display: inline-flex; align-items: center; gap: .4rem; min-width: 0; max-width: 100%; height: 26px; padding: 0 2px 0 .5rem;
  border: 1px solid var(--line-2); border-radius: var(--r-tag); corner-shape: var(--corner); background: var(--panel-3);
  font-size: .84rem; line-height: 1; color: var(--text);
}
.multi-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-chip.is-missing { border-style: dashed; background: transparent; color: var(--text-3); }
.multi-chip-x {
  position: relative; display: grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 3px;
  background: none; color: var(--text-3); cursor: pointer; pointer-events: auto; transition: color .12s, background .12s;
}
.multi-chip-x .icon { width: 12px; height: 12px; }
.multi-chip-x:hover { color: var(--red-text); background: var(--red-soft); }
.multi-chip-x:focus-visible { outline-offset: 0; color: var(--text); }
.multi-tools { position: relative; display: flex; align-items: center; align-self: flex-start; gap: .2rem; height: 26px; flex: none; pointer-events: none; }
.multi-tools > button { pointer-events: auto; }
.multi-count { font: 600 .72rem var(--display); letter-spacing: .04em; color: var(--text-3); pointer-events: none; }
.multi-count.is-full { color: var(--amber); }
.multi-clear {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none;
  color: var(--text-3); cursor: pointer; transition: color .12s, background .12s;
}
.multi-clear:hover { color: var(--red-text); background: var(--red-soft); }
/* A thin line between clearing and the chevron, which is drawn as on the single-select's button. */
.multi-tools::after { content: ""; order: 1; width: 1px; height: 18px; background: var(--line-2); }
.multi-pick:not(.has-chips) .multi-tools::after, .multi-pick.is-readonly .multi-tools::after { display: none; }
.multi-chevron {
  order: 2; width: 10px; height: 100%; margin: 0 2px 0 .2rem; background-repeat: no-repeat; background-size: 5px 5px; background-position: 0 50%, 5px 50%;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
}
/* The faint ring keeps dark role colors visible on dark chips. */
.multi-dot { width: 8px; height: 8px; flex: none; transform: rotate(45deg); border-radius: 1px; background: var(--dot, var(--text-3)); box-shadow: 0 0 0 1px rgb(255 255 255 / .2); }
.multi-icon { width: 13px; height: 13px; flex: none; color: var(--text-3); }
.multi-initial {
  display: grid; place-items: center; width: 18px; height: 18px; flex: none; margin-left: -.25rem; border-radius: 50%;
  background: var(--line-2); color: var(--text); font: 600 .62rem var(--display);
}
.multi-avatar { width: 18px; height: 18px; flex: none; margin-left: -.25rem; border-radius: 50%; background: var(--line-2); object-fit: cover; }
.multi-option .multi-avatar, .multi-option .multi-initial { width: 22px; height: 22px; margin-left: 0; }
/* The @username or ID stays whole where it can; the name gives way first. */
.multi-meta { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.multi-chip.is-missing .multi-dot, .multi-option.is-missing .multi-dot { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
.multi-pick.is-readonly .multi-field { cursor: default; opacity: .7; }
.multi-pick.is-readonly .multi-chevron { display: none; }
.multi-pick.is-readonly .multi-chip { padding-right: .5rem; }
.multi-pick.is-readonly .multi-toggle { cursor: default; }
.multi-pick.is-readonly .multi-field:hover { border-color: var(--line-2); }
.multi-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.multi-note { margin: .4rem .2rem 0; color: var(--amber); font-size: .8rem; }
/* A member search that opens upward grows away from the field, so its search box stays put, next to the field, as results come in. */
.multi-pop.is-up.has-search { display: flex; flex-direction: column-reverse; }
.multi-pop.is-up.has-search .multi-list { margin: 0 0 .35rem; }
.multi-pop.is-up.has-search .multi-note { margin: 0 .2rem .4rem; }
.multi-list:focus { outline: none; }
.multi-option { display: flex; align-items: center; gap: .55rem; color: var(--text-2); }
.multi-option.is-selected { color: var(--text); }
.multi-option.is-missing .multi-name { color: var(--text-3); }
.multi-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.multi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-check {
  position: relative; width: 16px; height: 16px; flex: none; border: 1px solid var(--line-2); border-radius: 3px; corner-shape: bevel;
  background: #0b0a0d; transition: background .12s, border-color .12s;
}
.multi-option.is-selected .multi-check { border-color: var(--red); background: var(--red); }
.multi-option.is-selected .multi-check::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* On a phone the chips get the room: no line before the chevron, and the count only once it's full. */
@media (max-width: 480px) {
  .multi-tools::after, .multi-count:not(.is-full) { display: none; }
}
@media (pointer: coarse) {
  .multi-chip-x::after { content: ""; position: absolute; inset: -6px -4px; }
  .multi-option { min-height: 42px; }
}
/* An ordered multi-select's Order list: the picks in the order they're saved, each with Move up and Move down. */
.multi-order { margin-top: .6rem; }
.multi-order-head { margin: 0 0 .35rem; font: 600 .7rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.multi-order-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.multi-order-row {
  display: flex; align-items: center; gap: .55rem; min-width: 0; min-height: 36px; padding: 0 2px 0 .65rem;
  border: 1px solid var(--line); border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--bg-2); font-size: .88rem;
}
.multi-order-number { min-width: 1.1rem; font: 600 .78rem var(--display); font-variant-numeric: tabular-nums; color: var(--text-3); }
.multi-order-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.multi-order-row.is-missing .multi-order-name { color: var(--text-3); }
.multi-order-tools { display: flex; flex: none; gap: 2px; }
.multi-order-tools .icon-button { width: 30px; height: 30px; }
.role-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
/* Without scripts, an empty member list shows only the box for adding one (.multi-fallback), which scripts hide. */
[data-member-search] > .role-picker-list:not(:has(.role-option)) { display: none; }
.role-picker-list + .multi-fallback { margin-top: .6rem; }
.role-picker-list { display: grid; max-height: 220px; overflow-y: auto; padding: .35rem; border: 1px solid var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner); background: #0b0a0d; }
.role-option { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; border-radius: 5px; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.role-option:hover { background: var(--panel-2); color: var(--text); }
.role-option input { accent-color: var(--red); }
.role-option:has(input:checked) { color: var(--text); background: var(--red-soft); }
.role-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.option-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.option-table th { text-align: left; font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 0 .6rem .45rem 0; }
.option-table td { padding: .35rem .6rem .35rem 0; vertical-align: middle; }
.option-table td:first-child { white-space: nowrap; font-weight: 500; }
.option-table td:last-child, .option-table th:last-child { padding-right: 0; }
.option-emoji { max-width: 90px; }

/* ---- Menus and expanding cards ------------------------------------------------------------------------ */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: var(--r-ctl); corner-shape: var(--corner); color: var(--text-2); }
.user-chip:hover, .user-menu[open] .user-chip { background: var(--panel-2); color: var(--text); }
.user-name { font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); min-width: 200px; padding: .35rem;
  border-radius: var(--r-ctl); corner-shape: var(--corner); border: 1px solid var(--line-2); background: var(--panel-2); box-shadow: var(--shadow);
}
.sidebar .menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; }
.menu-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 5px;
  background: none; color: var(--text-2); font: 500 .9rem var(--font); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--panel-3); color: var(--text); }
.menu-item.danger:hover { color: #ffa1a1; }

.fold > summary { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.35rem; }
.fold > summary:hover .fold-title { color: #fff; }
.fold-title { font-weight: 600; }
.fold-meta { color: var(--text-2); font-size: .86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-chevron { margin-left: auto; color: var(--text-3); transition: transform .15s; }
.fold[open] > summary .fold-chevron { transform: rotate(180deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { display: grid; gap: 1rem; padding: 1.2rem 1.35rem 1.35rem; }
.fold-body + .fold-body { border-top: 1px solid var(--line); }
.fold-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
/* The fold that adds an item leads its list. It's an action, so it's red where the items aren't: a red-tinted edge
   and a faint red wash while shut, a red plus and title, and a brighter edge on hover. Solid, as dashed means deleted. */
.fold-new { border-color: rgb(255 43 68 / .28); transition: border-color .15s, background-color .15s; }
.fold-new:not([open]) { background: linear-gradient(100deg, rgb(255 43 68 / .07), transparent 55%), var(--bg-2); }
.fold-new:not([open]):has(> summary:hover) { border-color: rgb(255 43 68 / .55); background-color: var(--panel); }
.fold-new[open] { border-color: var(--line); }
.fold-new > summary .fold-plus { color: var(--red-2); }
.fold-new > summary .fold-title { color: var(--red-text); }
.fold-new[open] > summary .fold-title { color: var(--text); }
.fold-new > summary:hover .fold-title { color: #fff; }
/* A long fold split into titled parts (fold-body blocks), with its buttons in a footer. */
.part-head { display: flex; align-items: center; gap: .55rem; font: 600 .98rem var(--display); letter-spacing: .01em; color: var(--text); }
.part-head::before { content: ""; width: 6px; height: 6px; flex: none; rotate: 45deg; background: var(--text-3); }
.fold-foot { padding: 1rem 1.35rem 1.25rem; border-top: 1px solid var(--line); }

/* ---- Tables ------------------------------------------------------------------------------------------- */
.table-card { overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.toolbar .combo { flex: 1 1 260px; max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { padding: .65rem 1.1rem; text-align: left; color: var(--text-3); font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; background: var(--bg-2); white-space: nowrap; }
.table td { padding: .8rem 1.1rem; border-top: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background .1s, box-shadow .1s; }
.table tbody tr:hover { background: rgb(255 255 255 / .02); box-shadow: inset 2px 0 0 var(--red); }
.table .sub { display: block; margin-top: .3rem; color: var(--text-3); font-size: .78rem; white-space: nowrap; }
.booster-shared { color: var(--text-2); white-space: nowrap; }
.table .reason { min-width: 16rem; max-width: 30rem; color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.case-link { font: 500 .86rem var(--mono); color: var(--text); }
.case-link:hover { color: var(--red-text); }
.muted-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .2em; }
.muted-link:hover { color: var(--text); }
.pager { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.1rem; border-top: 1px solid var(--line); }

/* ---- Dialogs: actions and search ---------------------------------------------------------------------- */
.dialog { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-card); corner-shape: var(--corner); background: var(--panel); color: var(--text); box-shadow: 0 40px 120px -20px rgb(0 0 0 / .85); }
.dialog::backdrop { background: rgb(5 4 6 / .78); backdrop-filter: blur(4px); }
.dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.35rem .5rem; }
.dialog-head h2 { font: 700 1.15rem var(--display); }
.dialog-body { padding: .5rem 1.35rem .25rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.35rem; border-top: 1px solid var(--line); background: var(--bg-2); }

.palette { width: min(620px, calc(100vw - 2rem)); margin-top: 11vh; overflow: hidden; }
.palette-field { display: flex; align-items: center; gap: .75rem; padding: 0 1.1rem; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette-field input { flex: 1; min-width: 0; height: 54px; border: 0; background: none; color: var(--text); font: 400 1.02rem var(--font); outline: none; }
.palette-list { max-height: min(54vh, 430px); overflow-y: auto; padding: .4rem; }
.palette-group { padding: .7rem .7rem .3rem; font: 600 .66rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 6px; color: var(--text-2); }
.palette-item .icon, .palette-item .guild-icon { color: var(--text-3); }
.palette-item span:first-of-type { color: var(--text); font-weight: 500; }
.palette-where { margin-left: auto; color: var(--text-3); font-size: .78rem; white-space: nowrap; }
.palette-item.is-active { background: var(--red-soft); box-shadow: inset 2px 0 0 var(--red); }
.palette-item.is-active .icon { color: var(--red-text); }
.palette-empty { padding: 1.5rem; text-align: center; color: var(--text-2); }
.palette-foot { display: flex; gap: 1.1rem; padding: .6rem 1.1rem; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--text-3); font-size: .76rem; }

/* ---- Unsaved changes ---------------------------------------------------------------------------------- */
/* With scripts on, one bar saves every changed section, so each section's own Save button steps aside. */
.js form[data-save] .save-inline { display: none; }
.savebar { position: fixed; z-index: 70; left: 0; right: 0; bottom: 1.1rem; display: flex; justify-content: center; padding: 0 1rem; pointer-events: none; transform: translateY(140%); opacity: 0; transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .2s; }
.is-app .savebar { left: var(--sidebar); }
.savebar.is-shown { transform: none; opacity: 1; }
.savebar-inner {
  pointer-events: auto; display: flex; align-items: center; gap: 1rem; width: min(680px, 100%); padding: .65rem .7rem .65rem 1.1rem;
  border: 1px solid var(--line-2); border-radius: var(--r-card); corner-shape: var(--corner); background: #1b181f; box-shadow: 0 24px 60px -12px #000, 0 0 0 1px rgb(0 0 0 / .5);
}
.savebar-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; font-weight: 500; }
.savebar-text::before { content: ""; width: 8px; height: 8px; flex: none; rotate: 45deg; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.savebar.has-error .savebar-inner, .savebar.is-shaking .savebar-inner { border-color: var(--red); }
.savebar.has-error .savebar-text { color: #ffc9c9; }
.savebar.has-error .savebar-text::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
.savebar.is-shaking .savebar-inner { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ---- App shell ---------------------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: .85rem;
  padding: 1rem .8rem .8rem; background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: .15rem .35rem; }
.sidebar-close { display: none; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font: 700 1rem var(--display); letter-spacing: .14em; text-transform: uppercase; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 50%; filter: drop-shadow(0 0 8px rgb(255 43 68 / .5)); }
.switcher { position: relative; }
.switcher-current { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: var(--r-card); corner-shape: var(--corner); border: 1px solid var(--line); background: var(--panel); transition: border-color .15s, background .15s; }
.switcher-current:hover, .switcher[open] .switcher-current { border-color: var(--line-2); background: var(--panel-2); }
.switcher-text { display: grid; min-width: 0; flex: 1; }
.switcher-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-hint { color: var(--text-3); font-size: .74rem; }
.switcher-current > .icon { color: var(--text-3); }
.switcher-menu { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 360px; overflow: auto; padding: .35rem; border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.switcher-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 5px; color: var(--text-2); font-size: .9rem; font-weight: 500; }
.switcher-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-item:hover { background: var(--panel-3); color: var(--text); }
.switcher-all { border-top: 1px solid var(--line); margin-top: .25rem; border-radius: 0 0 5px 5px; }
.palette-open {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 36px; padding: 0 .55rem 0 .7rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-ctl); corner-shape: var(--corner); background: none; color: var(--text-3); font: 400 .88rem var(--font); text-align: left;
}
.palette-open:hover { border-color: var(--line-2); color: var(--text-2); background: var(--panel); }
.palette-open span { flex: 1; }

/* Navigation hangs off a thread; the page you are on is the lit knot on it. */
.nav { flex: 1; align-content: start; display: grid; }
.nav-label { margin: 1.15rem .7rem .45rem; color: var(--text-3); font: 600 .66rem var(--display); letter-spacing: .18em; text-transform: uppercase; }
.nav-group:first-child .nav-label { margin-top: .35rem; }
.nav-links { display: grid; gap: 2px; margin-left: 1.05rem; padding-left: .6rem; border-left: 1px solid var(--line); }
.nav-link { position: relative; display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 6px; color: var(--text-2); font-weight: 500; font-size: .92rem; transition: color .12s, background .12s; }
.nav-link::before { content: ""; position: absolute; left: calc(-.6rem - 4.5px); top: 50%; width: 8px; height: 8px; translate: 0 -50%; rotate: 45deg; background: var(--bg-2); border: 1px solid var(--line-2); opacity: 0; transition: opacity .12s; }
.nav-link .icon { color: var(--text-3); transition: color .12s; }
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link:hover::before { opacity: 1; }
.nav-link.is-active { color: #fff; background: linear-gradient(90deg, var(--red-soft), transparent 90%); }
.nav-link.is-active::before { opacity: 1; background: var(--red); border-color: var(--red); box-shadow: 0 0 10px var(--red); }
.nav-link.is-active .icon { color: var(--red-text); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: .6rem; }
.sidebar-foot .user-chip { width: 100%; }
.sidebar-foot .user-name { flex: 1; }

.main { position: relative; min-width: 0; }
/* A corner of web behind every page. */
.main::before, .is-site::before {
  content: ""; position: absolute; top: 0; right: 0; width: min(640px, 70%); aspect-ratio: 1; pointer-events: none; opacity: .13;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640' fill='none' stroke='%23ff2b44' stroke-width='1'%3E%3Cpath d='M640 0L-259 47M640 0L-229 233M640 0L-155 423M640 0L-39 590M640 0L111 728M640 0L288 828M640 0L468 883M640 0L624 900M578 3Q585 9 580 16Q588 20 585 29Q594 32 593 41Q602 41 604 50Q613 49 616 57Q624 53 628 61Q634 55 639 62M512 7Q526 18 516 33Q533 42 527 60Q545 65 543 84Q562 85 565 104Q583 100 590 118Q606 110 616 126Q628 115 638 128M436 11Q459 29 443 53Q469 67 460 96Q489 104 486 134Q516 135 520 165Q550 160 560 188Q586 176 601 200Q621 183 636 204M350 15Q382 41 360 75Q397 96 384 136Q425 148 421 190Q464 192 470 235Q511 227 527 267Q564 250 585 285Q613 260 635 290M253 20Q295 55 265 100Q315 128 297 182Q352 198 347 255Q404 257 412 314Q468 304 488 357Q538 334 566 381Q603 347 633 388M143 26Q197 70 159 129Q223 164 200 234Q271 254 264 327Q337 330 347 403Q419 390 445 458Q509 429 545 489Q593 446 631 498M21 32Q89 87 41 160Q121 205 93 291Q180 316 172 407Q263 411 276 502Q365 486 398 571Q477 534 522 609Q582 555 629 620M-119 40Q-36 107 -94 197Q4 251 -31 357Q76 387 66 499Q178 504 193 615Q303 595 343 700Q440 654 495 746Q569 680 627 760'/%3E%3C/svg%3E") top right / contain no-repeat;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000 12%, transparent 72%); mask-image: radial-gradient(circle at 100% 0, #000 12%, transparent 72%);
}
.mobile-bar { display: none; }
.content { position: relative; width: min(1240px, 100%); margin-inline: auto; padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1rem, 3.2vw, 2.75rem) 7rem; }
.sidebar-scrim { display: none; }
#main:focus { outline: none; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.9rem; }
.eyebrow { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; font: 600 .7rem var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--red-text); }
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: #fff; }
.eyebrow .icon { transform: rotate(180deg); }
.page-sub { margin-top: .5rem; color: var(--text-2); max-width: 68ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Long pages get a list of their parts on the right. */
.page-cols { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 2.75rem; align-items: start; }
.page-main { min-width: 0; }
.toc { position: sticky; top: 1.75rem; display: grid; gap: 1px; }
.toc-label { margin-bottom: .55rem; font: 600 .66rem var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.toc a { position: relative; padding: .32rem 0 .32rem .9rem; border-left: 1px solid var(--line); color: var(--text-3); font-size: .86rem; transition: color .12s; }
.toc a:hover { color: var(--text); }
.toc a.is-current { color: var(--text); border-left-color: var(--line-2); }
.toc a.is-current::before { content: ""; position: absolute; left: -4.5px; top: 50%; width: 8px; height: 8px; translate: 0 -50%; rotate: 45deg; background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ---- Overview ----------------------------------------------------------------------------------------- */
.guild-hero { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 2rem; }
.guild-hero-text { flex: 1; min-width: 220px; }
.guild-hero-text p { margin-top: .4rem; font-size: .9rem; }
.status { display: inline-flex; align-items: center; gap: .5rem; }
.status::before { content: ""; width: 8px; height: 8px; rotate: 45deg; background: var(--text-3); }
.status-online::before { background: var(--green); box-shadow: 0 0 0 3px rgb(61 220 151 / .14), 0 0 10px rgb(61 220 151 / .55); }
.readout { display: flex; margin: 0; }
.readout div { padding: 0 1.4rem; border-left: 1px solid var(--line); }
.readout div:last-child { padding-right: 0; }
.readout dt { font: 600 .64rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.readout dd { margin: .2rem 0 0; font: 600 1.55rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.readout dd small { font: 400 .8rem var(--font); color: var(--text-3); }

.attention { border-color: rgb(245 184 61 / .4); background: linear-gradient(120deg, rgb(245 184 61 / .07), transparent 55%), var(--panel); }
.attention .count { color: var(--amber); }
.attention-list { list-style: none; margin: 0; padding: 0 1.35rem .6rem; }
.attention-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); }
.attention-list li:first-child { border-top: 0; }
.attention-area { color: var(--amber); font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.attention-text { font-size: .9rem; }

.module-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.module-tile { position: relative; display: grid; align-content: start; gap: .5rem; height: 100%; padding: 1.05rem 1.2rem 1.1rem; color: var(--text); transition: border-color .15s, background .15s, transform .15s; }
.module-tile:hover { color: var(--text); border-color: #4a4452; background: var(--panel-2); transform: translateY(-2px); }
.module-head { display: flex; align-items: center; gap: .65rem; }
.module-head > .icon { color: var(--text-3); }
.module-tile:hover .module-head > .icon { color: var(--red-text); }
.module-name { flex: 1; font: 600 1rem var(--display); letter-spacing: .01em; }
.module-state { display: inline-flex; align-items: center; gap: .45rem; font: 600 .66rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.module-state.is-on { color: var(--green); }
.module-summary { line-height: 1.45; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: .75rem; align-items: start; }
.action-bars { display: grid; gap: .1rem; padding: .35rem .75rem; }
.action-bar { display: grid; grid-template-columns: 8.4rem 1fr 2rem; align-items: center; gap: .75rem; padding: .4rem .55rem; border-radius: 6px; color: var(--text); }
.action-bar .pill { justify-self: start; }
.action-bar:hover { background: var(--panel-2); color: var(--text); }
.bar-track { height: 6px; background: var(--panel-3); overflow: hidden; transform: skewX(-24deg); }
.bar-fill { display: block; height: 100%; min-width: 0; background: var(--tone, var(--red)); transition: width .4s; }
.bar-count { text-align: right; font: 500 .9rem var(--mono); }
.feed { margin: 0; padding: .25rem .6rem .75rem; list-style: none; }
.feed-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: start; padding: .65rem .75rem; border-radius: 6px; }
.feed-item:hover { background: var(--panel-2); }
.feed-body p:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.feed-reason { margin-top: .15rem; color: var(--text-2); font-size: .88rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.leaderboard { margin: 0; padding: .25rem .6rem .75rem; list-style: none; }
.leader { display: grid; grid-template-columns: auto minmax(5rem, 9rem) 1fr 2rem; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: 6px; color: var(--text); }
.leader:hover { background: var(--panel-2); color: var(--text); }
.leader-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip { display: grid; gap: .4rem; padding: 1.1rem 1.35rem; }
.tip p { max-width: 90ch; }

/* ---- Moderation --------------------------------------------------------------------------------------- */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem; align-items: start; padding: 1.35rem; margin-bottom: .75rem; }
.profile h2 { font: 700 1.3rem var(--display); display: flex; align-items: center; }
.profile-main > p { margin-top: .15rem; font-size: .88rem; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .65rem; color: var(--text-2); font-size: .85rem; }
.profile-meta > span:not(.pill) { display: inline-flex; align-items: center; gap: .35rem; }
.role-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.role { display: inline-flex; align-items: center; gap: .4rem; padding: .12rem .55rem; border-radius: var(--r-tag); corner-shape: var(--corner); background: var(--panel-2); border: 1px solid var(--line-2); font-size: .78rem; color: var(--text-2); }
.role::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--role); }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; max-width: 22rem; }
.profile-foot { grid-column: 1 / -1; display: grid; gap: .85rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .8rem; border-radius: var(--r-ctl); corner-shape: var(--corner); color: var(--text-2); font-weight: 500; font-size: .88rem; }
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.is-active { background: var(--red-soft); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 43 68 / .5); }
.tally { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.tally-item { display: inline-flex; align-items: center; gap: .45rem; font: 500 .9rem var(--mono); }
.tally-item.is-zero { opacity: .4; }

/* Cases */
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .75rem; align-items: start; }
.case-facts { padding: 1.35rem; display: grid; gap: 1.1rem; }
.case-facts dl { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .8rem 1rem; margin: 0; }
.case-facts dt { color: var(--text-3); font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; padding-top: .3rem; }
.case-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.case-facts .reason { white-space: pre-wrap; overflow-wrap: anywhere; display: block; }
.inline-form summary { width: max-content; }
.inline-form form, .note-form { display: grid; gap: .5rem; }
.inline-form form { margin-top: .75rem; }
.inline-form form button, .note-form button { justify-self: start; }
.note-form { padding: .25rem 1.35rem 1.35rem; }
.timeline { list-style: none; margin: 0; padding: .5rem 1.35rem 1rem; display: grid; gap: .1rem; }
.timeline li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: .9rem; padding-bottom: 1rem; }
.timeline li::before { content: ""; position: absolute; left: 5.5px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 10px; height: 10px; margin: 6px 1px 0; rotate: 45deg; background: var(--panel-3); border: 1px solid var(--text-3); }
.timeline-note .timeline-dot { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 30%, var(--panel)); }
.timeline-reasonedited .timeline-dot { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 30%, var(--panel)); }
.timeline-reversed .timeline-dot, .timeline-expired .timeline-dot { border-color: var(--green); background: color-mix(in srgb, var(--green) 30%, var(--panel)); }
.timeline-text { margin-top: .3rem; padding: .5rem .75rem; border-left: 2px solid var(--line-2); background: var(--panel-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }

/* Staff rules: one fold per role or member, one row per action with its access, longest length, and limit. */
.role-mark { width: 9px; height: 9px; flex: none; rotate: 45deg; background: var(--role-color, var(--text-3)); }
.staff-fold.is-missing { border-style: dashed; background: transparent; }
.staff-fold.is-missing .fold-title { color: var(--text-3); }
.staff-fold.is-missing .role-mark { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
.staff-locked { margin: 0; color: var(--text-2); font-size: .88rem; }
/* The rows share the grid's columns, so the column heads line up with every row's controls. */
.staff-grid { display: grid; grid-template-columns: 8.5rem max-content minmax(8.5rem, 10.5rem) minmax(11rem, 15rem); column-gap: 1.1rem; }
.staff-head, .staff-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; row-gap: .5rem; align-items: center; }
.staff-head { padding-bottom: .45rem; font: 600 .66rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.staff-row { padding: .5rem 0; border-top: 1px solid var(--line); }
.staff-row.is-reversal { padding-top: .25rem; border-top: 0; }
.staff-action { font-weight: 600; }
.staff-row.is-reversal .staff-action { display: flex; align-items: center; gap: .45rem; padding-left: .2rem; color: var(--text-2); font-weight: 500; font-size: .9rem; }
.staff-row.is-reversal .staff-action::before { content: ""; width: 8px; height: 8px; flex: none; translate: 0 -3px; border: solid var(--line-2); border-width: 0 0 1px 1px; }
.staff-cell-label { display: none; }
.staff-length { display: grid; gap: .35rem; min-width: 0; }
.staff-length:has(option[value=""]:checked) .staff-permanent { display: none; }
.staff-permanent { font-size: .82rem; }
.staff-limit { min-width: 0; }
.staff-limit-fields { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .4rem; }
.staff-length .input, .staff-limit .input { min-height: 34px; padding-top: .3rem; padding-bottom: .3rem; font-size: .88rem; }
/* A Block lets nothing through, so its length and limit don't count. */
.staff-row:has(.segment-block input:checked) :is(.staff-length, .staff-limit) { opacity: .3; pointer-events: none; }
.staff-access .segment span { min-height: 28px; padding: 0 .7rem; font-size: .82rem; }
.segment-discord { --tone: #c6cad1; }
.segment-allow { --tone: var(--green); }
.segment-block { --tone: var(--danger); }
.staff-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.staff-foot > .button:last-child { margin-left: auto; }
.staff-preset { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.staff-preset .input { width: auto; min-width: 13rem; min-height: 31px; padding-top: .2rem; padding-bottom: .2rem; font-size: .84rem; }
/* With JavaScript a preset fills the fold for review, so there's nothing to apply. */
.js .staff-preset-apply { display: none; }
.staff-preset-note { margin: 0; }
.target-form:has(input[name="add.Kind"][value="member"]:checked) .only-role,
.target-form:not(:has(input[name="add.Kind"][value="member"]:checked)) .only-member { display: none; }
.preset-list { display: grid; gap: .3rem; margin: -.25rem 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: .84rem; }
.preset-list strong { margin-right: .35rem; color: var(--text); font-weight: 600; }
/* How Rules Combine lists the precedence, open until there are rules. */
.rule-order { margin: 0; padding: 1rem 1.35rem 1.2rem 2.6rem; gap: .35rem; color: var(--text-2); font-size: .88rem; }
.rule-order li::marker { color: var(--text-3); }
.check-search { padding: 1.1rem 1.35rem .2rem; max-width: 30rem; }
.check-head { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.35rem .6rem; }
.check-head .button { margin-left: auto; }
.check-list { display: grid; margin: 0; padding: 0 1.35rem 1rem; list-style: none; }
.check-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: .3rem 1rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); }
.check-row.is-reversal { padding-top: .2rem; border-top: 0; }
.check-row.is-reversal .check-action { color: var(--text-2); font-weight: 500; padding-left: .9rem; }
.check-action { font-weight: 600; }
.check-access .status-pill { margin-left: 0; }
.status-allowed { color: var(--green); }
.status-blocked { color: var(--danger); }
.check-usage.is-spent { color: var(--amber); }

/* ---- Messages ----------------------------------------------------------------------------------------- */
.callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.35rem; margin-bottom: 1.5rem; border-color: rgb(255 43 68 / .5); background: linear-gradient(120deg, var(--red-soft), transparent 60%), var(--panel); }
.place { grid-template-columns: minmax(180px, 1fr) minmax(0, 1.7fr) minmax(88px, auto); gap: .9rem 1.25rem; align-items: end; }
.place .row-text { align-self: center; }
.place-fields .label { margin-bottom: .35rem; }
.place-toggle { min-height: 40px; }
.place-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; align-items: center; margin: 0; padding: 0; border: 0; min-width: 0; }
.place-toggle { display: flex; align-items: center; gap: .65rem; }
.place-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.moderation-messages { padding: 1.2rem 1.35rem 1.35rem; display: grid; gap: .9rem; }
.moderation-messages fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.moderation-table td:first-child { width: 170px; }
.moderation-table tr.is-all td { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.moderation-table tr.is-all + tr td { padding-top: .8rem; }
.choice-cell { display: flex; align-items: center; gap: .6rem; }
.choice-cell .input, .choice-cell .select-search { flex: 1; min-width: 0; }
.choice-cell .icon-button { flex: none; margin-left: -.25rem; border-color: var(--line-2); }
.icon-button-space { flex: none; width: calc(34px - .25rem); }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .75rem; }
.library-item { display: grid; gap: .35rem; padding: 1.05rem 1.2rem; align-content: start; }
.library-name { font: 600 1rem var(--display); color: var(--text); }
.library-name:hover { color: var(--red-text); }
.library-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.post-list { list-style: none; margin: 0; padding: .35rem 1.35rem; display: grid; }
.post-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; }
.post-list li + li { border-top: 1px solid var(--line); }
.post-list a:not(.button) { color: var(--text); }
.panel-post-row { display: flex; gap: .5rem; }
/* New message: pick Embeds or Components V2 first. */
.new-message { position: relative; }
.new-message > summary .icon-sm { margin-left: -.15rem; transition: transform .15s; }
.new-message[open] > summary .icon-sm { transform: rotate(180deg); }
.new-message-menu { width: min(340px, calc(100vw - 2rem)); }
.new-message-menu .menu-item { align-items: flex-start; }
.new-message-kind { display: grid; gap: .15rem; }
.new-message-kind strong { color: var(--text); font-weight: 600; }
.new-message-kind span { color: var(--text-2); font-size: .82rem; line-height: 1.4; }
.panel-post-row .input, .panel-post-row .select-search { flex: 1; min-width: 0; }

/* Message editor: the builder card on the left, the preview and posted copies on the right. */
.message-editor { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .75rem; align-items: start; }
.message-fields { display: grid; margin: 0; padding: 0; border: 0; min-width: 0; }
.editor-part { display: grid; gap: .6rem; min-width: 0; margin: 0; padding: 1.1rem 1.35rem; border: 0; scroll-margin-top: 1.5rem; }
.editor-part + .editor-part, .message-fields + .editor-part { border-top: 1px solid var(--line); }
.editor-part > .label { margin: 0; }
.editor-part > .hint { margin: 0; }
.editor-type-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.editor-type-row > .label { margin: 0; }
.segment-button {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 .85rem; border: 0; border-radius: var(--r-tag); corner-shape: var(--corner);
  background: none; color: var(--text-2); font: 500 .84rem var(--font); cursor: pointer; transition: background .12s, color .12s;
}
.segment-button:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
.segment-button[aria-pressed="true"] { color: #fff; background: color-mix(in srgb, var(--red) 18%, var(--panel-3)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 55%, transparent); }
.segment-button:disabled { cursor: default; }
.segment-button:disabled:not([aria-pressed="true"]) { opacity: .5; }
.segment-button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.builder-history { display: flex; gap: .1rem; margin-left: auto; }
.builder-history .icon-button { width: 32px; height: 32px; }
.builder-form.is-busy .builder { opacity: .55; pointer-events: none; transition: opacity .2s; }

.builder-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .35rem .75rem; }
.builder-head .label { margin: 0; }
.builder-usage { color: var(--text-3); font-size: .78rem; }
.counter { font: 500 .72rem var(--mono); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.counter.is-near { color: var(--amber); }
.counter.is-over { color: var(--danger); font-weight: 700; }
.builder { display: grid; gap: .6rem; min-width: 0; }
.builder-classic, .builder-components { display: grid; gap: 1.1rem; min-width: 0; }
.builder-section { display: grid; gap: .55rem; min-width: 0; scroll-margin-top: 1.5rem; }
.builder-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.builder-section-head .label { margin: 0; }
.builder-count { font: 500 .72rem var(--mono); color: var(--text-3); }
.builder-list { display: grid; gap: .5rem; min-width: 0; }
.builder-empty { padding: .85rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner); color: var(--text-2); font-size: .86rem; }
.builder-add { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.builder-add .hint { margin: 0 0 0 .25rem; }
.builder-add-label { margin-right: .1rem; color: var(--text-3); font-size: .8rem; }
.chip-add { gap: .35rem; }
.chip-add .icon { width: 12px; height: 12px; color: var(--red-text); }
.chip:disabled { opacity: .45; cursor: default; }
.chip:disabled:hover { color: var(--text-2); background: transparent; }
.chip-sm { min-height: 26px; padding: 0 .6rem; font-size: .76rem; }
.chip[aria-pressed="true"] { color: #fff; background: var(--red-soft); border-color: rgb(255 43 68 / .6); }
.builder.is-readonly .builder-tools, .builder.is-readonly .builder-add { display: none; }

/* A card per embed, block, or row: it folds up to its header, which says what's in it. */
.builder-card {
  min-width: 0; border: 1px solid var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--panel-2);
  box-shadow: inset 3px 0 0 var(--stripe, transparent);
}
.builder-card .builder-card { background: var(--panel); }
.builder-card-head { display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: .3rem .35rem .3rem .8rem; cursor: pointer; user-select: none; }
.builder-card[open] > .builder-card-head { border-bottom: 1px solid var(--line); }
.builder-card-head:hover .builder-card-title strong { color: var(--text); }
.builder-chevron { flex: none; color: var(--text-3); transform: rotate(-90deg); transition: transform .15s; }
details[open] > summary > .builder-chevron { transform: none; }
.builder-card-title { flex: 1; display: flex; align-items: baseline; gap: .55rem; min-width: 0; overflow: hidden; white-space: nowrap; }
.builder-card-title strong { flex: 0 0 auto; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 600 .72rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); transition: color .12s; }
.builder-card-sub { flex: 1 1 0; min-width: 4rem; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); font-size: .85rem; }
.builder-card-sub:empty { min-width: 0; }
.builder-badge {
  flex: none; padding: .12rem .45rem; border-radius: var(--r-tag); corner-shape: var(--corner); border: 1px solid rgb(255 107 107 / .4);
  background: rgb(255 107 107 / .1); color: #ffa1a1; font: 600 .64rem var(--display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; cursor: help;
}
.builder-tools { display: flex; align-items: center; gap: .05rem; flex: none; }
.builder-tools .icon-button { width: 30px; height: 30px; }
.builder-tools [data-op="remove"]:hover { color: #ffa1a1; background: rgb(255 107 107 / .1); }
/* What a card needs fixed, under its header, so it reads without hovering the badge. */
.builder-problems { display: grid; gap: .2rem; margin: 0; padding: .5rem .7rem; list-style: none; border: 1px solid rgb(255 107 107 / .28); border-radius: var(--r-ctl); corner-shape: var(--corner); background: rgb(255 107 107 / .06); color: #ffa1a1; font-size: .82rem; line-height: 1.4; }
.builder-problems li { display: flex; align-items: baseline; gap: .5rem; }
.builder-problems li::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; transform: translateY(-2px); }
.builder-card-body:has(> .builder-part) > .builder-problems { margin: .8rem 0 .1rem; }
.builder-card-body { display: grid; gap: .75rem; min-width: 0; padding: .85rem .9rem .95rem; }
.builder-card-body:has(> .builder-part) { gap: 0; padding-top: 0; padding-bottom: 0; }
.builder-children { display: grid; gap: .55rem; padding-left: .75rem; border-left: 1px solid var(--line-2); }
/* Parts of an embed: Author, Body, Fields, Images, Footer. */
.builder-part + .builder-part { border-top: 1px solid var(--line); }
.builder-part > summary { display: flex; align-items: center; gap: .5rem; padding: .7rem 0; font: 600 .8rem var(--display); letter-spacing: .03em; color: var(--text-2); }
.builder-part > summary:hover { color: var(--text); }
.builder-part-body { display: grid; gap: .7rem; min-width: 0; padding: .05rem 0 1rem; }
/* A field of an embed: smaller than a card, with the same tools. */
.builder-item { display: grid; gap: .6rem; min-width: 0; padding: .55rem .75rem .8rem; border: 1px solid var(--line); border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--panel); }
.builder-item-head { display: flex; align-items: center; gap: .5rem; min-height: 32px; margin-right: -.4rem; }

.builder-field { display: grid; gap: .3rem; min-width: 0; }
.builder-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; min-width: 0; }
.builder-field .label { margin: 0; }
.builder-field .hint { margin: 0; }
.builder-field .input { min-height: 38px; }
.builder-field textarea { resize: vertical; min-height: 4.5rem; font-family: var(--font); line-height: 1.45; }
.builder-content textarea { min-height: 5.5rem; }
.builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; align-items: end; }
.builder-button { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 5.5rem; gap: .5rem; align-items: end; }
.builder-image { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.builder-image .check { min-height: 38px; }
/* A row's buttons and a gallery's images: a small numbered heading with the item's tools, then its fields. */
.builder-subitem { display: grid; gap: .35rem; min-width: 0; }
.builder-list > .builder-subitem + .builder-subitem { padding-top: .55rem; border-top: 1px dashed var(--line-2); }
.builder-subitem-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 30px; margin-right: -.3rem; }
.builder-subitem-title { color: var(--text-3); font: 600 .66rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.builder-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.builder-warning { display: flex; align-items: baseline; gap: .5rem; margin: 0; color: var(--amber); font-size: .82rem; }
.builder-warning::before { content: ""; width: 6px; height: 6px; flex: none; rotate: 45deg; background: currentColor; transform: translate(-1px, -1px); }

/* Colors: Discord's presets, SpiderBot red, any color, or none. */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.swatch {
  position: relative; width: 26px; height: 26px; padding: 0; border: 1px solid rgb(255 255 255 / .14); border-radius: 6px; corner-shape: var(--corner);
  background: var(--swatch); cursor: pointer; transition: box-shadow .12s, transform .12s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch[aria-pressed="true"], .swatch-custom.is-pressed { box-shadow: 0 0 0 2px var(--panel-2), 0 0 0 4px var(--text); }
.builder-card .builder-card .swatch[aria-pressed="true"], .builder-card .builder-card .swatch-custom.is-pressed { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.swatch-custom { display: inline-block; background: conic-gradient(from 90deg, #ff2b44, #f1c40f, #2ecc71, #38c6f4, #9b59b6, #ff2b44); }
.swatch-custom.is-pressed { background: var(--swatch); }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatches .chip-sm { margin-left: .15rem; }
fieldset:disabled .swatch { cursor: default; transform: none; }

.builder-notice {
  display: flex; align-items: flex-start; gap: .75rem; padding: .65rem .45rem .7rem .9rem; border: 1px solid var(--line-2); border-radius: var(--r-ctl); corner-shape: var(--corner);
  background: var(--panel-2); color: var(--text-2); font-size: .88rem;
}
.builder-notice.is-info { border-color: rgb(61 220 151 / .35); background: rgb(61 220 151 / .06); }
.builder-notice.is-confirm { border-color: rgb(245 184 61 / .45); background: rgb(245 184 61 / .07); }
.builder-notice.is-error { border-color: rgb(255 107 107 / .4); background: rgb(255 107 107 / .08); color: #ffc9c9; }
.builder-notice-text { flex: 1; display: grid; gap: .45rem; min-width: 0; padding-top: .2rem; }
.builder-notice-text p { color: var(--text); }
.builder-notice.is-error .builder-notice-text p { color: inherit; }
.builder-notice ul { display: grid; gap: .2rem; margin: 0; padding-left: 1.1rem; }
.builder-notice .icon-button { width: 28px; height: 28px; flex: none; }

.variables > summary, .builder-json > summary { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.variables > summary .label, .builder-json > summary .label { margin: 0; }
.variables > summary .muted, .builder-json > summary .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-part > summary .fold-chevron { flex: none; margin-left: auto; color: var(--text-3); transition: transform .15s; }
.editor-part[open] > summary .fold-chevron { transform: rotate(180deg); }
.variable-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.variable-chips .chip { min-height: 24px; padding: 0 .45rem; font: .74rem var(--mono); border-radius: 5px; }
.builder-options { display: grid; gap: .5rem; }
.builder-pings .check { align-items: flex-start; }
.builder-pings .check input { margin-top: .2rem; flex: none; }
.builder-pings details summary { cursor: pointer; }
.builder-pings .role-picker-list { margin-top: .5rem; }
.builder-json textarea { margin-top: .15rem; }

/* Save stays in reach at the bottom of a long message, and says when something isn't saved. */
.message-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .9rem 1.35rem;
  border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; corner-shape: var(--corner); background: rgb(18 16 21 / .92); backdrop-filter: blur(10px);
}
@supports (corner-shape: bevel) { .message-actions { border-radius: 0 0 4px 16px; } }
.builder-status { display: none; align-items: center; gap: .55rem; color: #ffd98a; font-size: .88rem; font-weight: 500; }
.builder-status::before { content: ""; width: 8px; height: 8px; flex: none; rotate: 45deg; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.message-actions.is-dirty .builder-status { display: inline-flex; }
.message-actions.is-dirty .message-actions-note { display: none; }
.editor-side { display: grid; gap: .75rem; align-content: start; position: sticky; top: 1.25rem; }
.preview-note { padding: .75rem 1.35rem 1.2rem; }
.posts { padding-bottom: 1.2rem; }
.posts-form { padding: .5rem 1.35rem 0; }
.posts-empty { padding: .25rem 1.35rem 0; }

/* Discord's own look, so the preview reads as the real message. */
.discord { display: flex; gap: .85rem; margin: .25rem 1.35rem 0; padding: 1rem; border-radius: 8px; background: #313338; color: #dbdee1; font-family: "gg sans", var(--font); font-size: .95rem; line-height: 1.375; }
.discord-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.discord-message { min-width: 0; flex: 1; }
.discord-author { font-weight: 600; color: #f2f3f5; margin-bottom: .2rem; }
.discord-app { margin-left: .25rem; padding: 0 .3rem; border-radius: 4px; background: #5865f2; color: #fff; font-size: .62rem; font-weight: 700; vertical-align: .15em; }
.discord-time-now { margin-left: .3rem; color: #949ba4; font-size: .75rem; font-weight: 500; }
.discord-body { display: grid; gap: .5rem; max-width: 520px; min-width: 0; }
.discord-card { display: grid; gap: .5rem; }
.discord-card.is-card { padding: .75rem 1rem; border-radius: 8px; border-left: 4px solid var(--card-accent, #ff1f35); background: #2b2d31; }
.discord-card.is-spoiler > * { filter: blur(6px); }
.discord-card-main { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.discord-thumb { width: 72px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; }
.discord-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; }
.discord-gallery.count-2, .discord-gallery.count-4 { grid-template-columns: 1fr 1fr; }
.discord-gallery.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.discord-gallery img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.discord-gallery img.is-spoiler { filter: blur(14px); }
.discord-gallery-empty { padding: .75rem; border: 1px dashed #4e5058; border-radius: 8px; color: #949ba4; font-size: .85rem; }
.discord-separator { height: 4px; }
.discord-separator.is-large { height: 16px; }
.discord-separator.has-line { height: 1px; margin: .25rem 0; background: #3f4147; }
.discord-separator.has-line.is-large { margin: .6rem 0; }
.discord-rows { display: grid; gap: .4rem; }
.discord-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.discord-link-button { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; padding: .3rem .85rem; border-radius: 8px; background: #4e5058; color: #fff; font-size: .88rem; font-weight: 500; }
.discord-link-icon { width: 14px; height: 14px; flex: none; }
.discord-link-button .discord-emoji { width: 1.1rem; height: 1.1rem; vertical-align: 0; }
.discord-text { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.discord-text h1, .discord-text h2, .discord-text h3 { margin: .2rem 0 .3rem; color: #f2f3f5; line-height: 1.25; font-family: inherit; font-weight: 700; letter-spacing: 0; text-transform: none; }
.discord-text h1 { font-size: 1.5rem; } .discord-text h2 { font-size: 1.25rem; } .discord-text h3 { font-size: 1.05rem; }
.discord-text small { display: block; color: #949ba4; font-size: .8rem; }
.discord-text code { padding: .05rem .25rem; border: 0; border-radius: 4px; background: #1e1f22; font-family: var(--mono); font-size: .85em; color: inherit; }
.discord-text a, .discord-embed a { color: #00a8fc; }
.discord-text a:hover, .discord-embed a:hover { text-decoration: underline; }
.discord-text blockquote { margin: 0; padding-left: .7rem; border-left: 4px solid #4e5058; }
.discord-codeblock { margin: .2rem 0; padding: .5rem .65rem; border: 1px solid #1e1f22; border-radius: 4px; background: #2b2d31; font: .82rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.discord-embed .discord-codeblock { background: #1e1f22; }
.discord-codeblock code { padding: 0; background: none; font: inherit; }
.discord-list { display: flex; gap: .45rem; padding-left: calc(.3rem + var(--depth, 0) * 1.3rem); }
.discord-list-mark { flex: none; min-width: .7rem; text-align: right; }
.discord-emoji { display: inline-block; width: 1.375em; height: 1.375em; vertical-align: -.3em; object-fit: contain; }
.discord-time { padding: 0 .15rem; border-radius: 3px; background: rgb(255 255 255 / .06); }
.discord-spoiler { padding: 0 .2rem; border-radius: 3px; background: #1e1f22; color: transparent; }
.discord-mention { padding: 0 .15rem; border-radius: 3px; background: rgb(88 101 242 / .3); color: #c9cdfb; font-weight: 500; }
/* Classic embeds: a color bar, then author, title, description, fields, and images, with the thumbnail top right. */
.discord-embed { max-width: 516px; padding: .125rem 1rem 1rem .75rem; border-left: 4px solid var(--embed-color, #1e1f22); border-radius: 4px; background: #2b2d31; }
.discord-embed-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.discord-embed-grid > * { grid-column: 1; min-width: 0; }
.discord-embed-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #f2f3f5; font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.discord-embed-author a { color: #f2f3f5; }
.discord-embed-author-icon { width: 24px; height: 24px; flex: none; border-radius: 50%; object-fit: cover; }
.discord-embed-title { margin-top: 8px; color: #f2f3f5; font-size: 1rem; font-weight: 600; line-height: 1.375; overflow-wrap: anywhere; }
.discord-embed-description { margin-top: 8px; font-size: .875rem; line-height: 1.125rem; }
.discord-embed-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.discord-embed-field { grid-column: 1 / -1; min-width: 0; font-size: .875rem; line-height: 1.125rem; }
.discord-embed-field.is-inline { grid-column: span 4; }
.has-thumb .discord-embed-field.is-inline { grid-column: span 6; }
.discord-embed-field-name { margin-bottom: 2px; color: #f2f3f5; font-weight: 600; overflow-wrap: anywhere; }
.discord-embed-thumb { grid-column: 2; grid-row: 1 / 6; width: 80px; height: 80px; margin: 8px 0 0 16px; border-radius: 4px; object-fit: cover; }
.discord-embed-image { grid-column: 1 / -1; justify-self: start; max-width: 100%; max-height: 300px; margin-top: 16px; border-radius: 4px; object-fit: contain; }
.discord-embed-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #b5bac1; font-size: .75rem; font-weight: 500; line-height: 1rem; }
.discord-embed-footer-icon { width: 20px; height: 20px; flex: none; border-radius: 50%; object-fit: cover; }
.discord img.is-broken { min-width: 64px; min-height: 48px; background: #1e1f22; outline: 1px dashed #4e5058; outline-offset: -1px; }

/* Server logs */
.log-all { display: grid; gap: .1rem; max-width: 360px; }
.log-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.log-row { display: grid; gap: .45rem; }
.log-row > span { display: grid; gap: .1rem; }
.log-row strong { display: flex; align-items: center; gap: .55rem; font-weight: 600; }

/* ---- Public site -------------------------------------------------------------------------------------- */
.is-site { position: relative; overflow-x: hidden; }
.is-site::before { width: min(820px, 90%); opacity: .2; }
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); background: rgb(9 8 10 / .78); border-bottom: 1px solid var(--line); }
.topbar-inner, .site-main > .container, .hero, .features { width: min(1160px, calc(100% - 2.5rem)); margin-inline: auto; }
.topbar-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar-nav { display: flex; align-items: center; gap: .75rem; }
.topbar-link { color: var(--text-2); font-weight: 500; font-size: .92rem; padding: .4rem .6rem; border-radius: 6px; }
.topbar-link:hover { color: var(--text); background: var(--panel-2); }
.site-main { position: relative; padding-bottom: 4rem; }
.container { padding-top: clamp(1.5rem, 4vw, 2.75rem); }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(2.5rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.04; letter-spacing: -.02em; margin: 1.1rem 0 1.2rem; }
.lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--text-2); max-width: 34rem; }
.gradient-text { background: linear-gradient(100deg, #ffa3ae, var(--red) 55%, #b80a22); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-tag { display: inline-flex; align-items: center; gap: .6rem; font: 600 .72rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.pulse { width: 8px; height: 8px; rotate: 45deg; background: var(--green); box-shadow: 0 0 0 0 rgb(61 220 151 / .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgb(61 220 151 / 0); } 100% { box-shadow: 0 0 0 0 rgb(61 220 151 / 0); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero .alert { margin-top: 1.25rem; }
/* A few posts from different channels, fanned out so each one reads as a different feature. */
.showcase { position: relative; display: grid; gap: .8rem; padding-top: 3.5rem; }
.hero-emblem { position: absolute; z-index: 0; top: -1.5rem; right: -1rem; width: min(260px, 52%); height: auto; border-radius: 50%; filter: drop-shadow(0 0 40px rgb(255 43 68 / .45)); animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-2deg); } }
.show { position: relative; z-index: 1; margin: 0; padding: .85rem 1rem 1rem; border-radius: var(--r-card); corner-shape: var(--corner); background: #313338; border: 1px solid var(--line-2); box-shadow: 0 24px 70px -30px rgb(255 43 68 / .4), var(--shadow); color: #dbdee1; font-size: .88rem; line-height: 1.4; }
.show:nth-child(2) { margin-right: 14%; }
.show:nth-child(3) { margin-left: 8%; margin-right: 4%; }
.show:nth-child(4) { margin-left: 16%; }
.show figcaption { display: flex; align-items: center; gap: .3rem; margin-bottom: .6rem; font: 600 .72rem var(--mono); color: #949ba4; }
.show-message { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; }
.show-avatar { width: 36px; height: 36px; border-radius: 50%; }
.show-author { font-weight: 600; color: #f2f3f5; margin-bottom: .2rem; }
.show-card { display: grid; gap: .15rem; padding: .65rem .85rem; border-radius: 8px; border-left: 4px solid var(--red); background: #2b2d31; }
.show-card-gold { border-left-color: #f0b232; }
.show-card strong { color: #f2f3f5; font-weight: 600; }
.show-title { margin-bottom: .2rem; font-weight: 700; color: #f2f3f5; }
.show-card blockquote { margin: .3rem 0 0; padding-left: .55rem; border-left: 3px solid #4e5058; color: #b5bac1; }
.show-button { justify-self: start; margin-top: .45rem; padding: .3rem .75rem; border-radius: 6px; background: #4e5058; color: #fff; font-size: .8rem; font-weight: 500; }

.features { padding-top: clamp(1.5rem, 4vw, 3rem); }
.features-head { margin-bottom: 1.25rem; }
.features-head h2 { font: 600 clamp(1.4rem, 2.6vw, 1.9rem) var(--display); letter-spacing: -.01em; }
.features-head p { margin-top: .35rem; color: var(--text-2); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: .75rem; }
.feature { padding: 1.25rem; border-radius: var(--r-card); corner-shape: var(--corner); background: rgb(18 16 21 / .8); border: 1px solid var(--line); transition: border-color .15s ease; }
.feature:hover { border-color: var(--line-2); }
.feature h3 { margin: .9rem 0 .35rem; font: 600 1.02rem var(--display); }
.feature p { color: var(--text-2); font-size: .9rem; }
.feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--red-soft); color: var(--red-text); }

/* Server picker */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.server-card { position: relative; display: block; overflow: hidden; border-radius: var(--r-card); corner-shape: var(--corner); background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: transform .15s, border-color .15s, box-shadow .15s; }
.server-card:hover { color: var(--text); transform: translateY(-2px); border-color: rgb(255 43 68 / .55); box-shadow: 0 16px 40px -18px rgb(255 43 68 / .5); }
.server-banner { display: block; height: 70px; background: linear-gradient(150deg, #3d0c15, #17131a 75%); }
.server-banner[style] { background: var(--banner) center / cover; filter: blur(18px) saturate(1.3) brightness(.6); transform: scale(1.4); }
.server-body { position: relative; display: grid; justify-items: start; gap: .35rem; padding: 0 1.15rem 1.15rem; margin-top: -28px; }
.server-body .guild-icon { outline: 4px solid var(--panel); }
.server-name { font: 600 1.02rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; margin-top: .35rem; }
.server-cta { display: inline-flex; align-items: center; gap: .3rem; color: var(--red-text); font-size: .85rem; font-weight: 500; }
.server-card.is-invite .server-cta { color: var(--text-2); }
.server-card.is-invite { opacity: .8; }
.server-card.is-invite:hover { opacity: 1; }
.loading-note { padding: 1rem 0; }

/* ---- Tickets ------------------------------------------------------------------------------------------ */
/* Fields for channel or thread tickets and member or role blocks follow their switch. A question's fields follow its
   kind: each names the kinds it's for (for-short, for-dropdown, ...), and the rest hide. The kind is the Answer, or for
   a Dropdown what its Shows setting picks (Dropdown for your own options, User, Role, Mentionable, or Channel). */
.type-form:has(input[name="Type.Location"][value="Thread"]:checked) .only-channel,
.type-form:not(:has(input[name="Type.Location"][value="Thread"]:checked)) .only-thread,
.question:has([name="Question.Kind"] option[value="Short"]:checked) .for-kind:not(.for-short),
.question:has([name="Question.Kind"] option[value="Paragraph"]:checked) .for-kind:not(.for-paragraph),
.question:has([name="Question.Kind"] option[value="Dropdown"]:checked):has([name="Question.Shows"] option[value="Dropdown"]:checked) .for-kind:not(.for-dropdown),
.question:has([name="Question.Kind"] option[value="Dropdown"]:checked):has([name="Question.Shows"] option[value="User"]:checked) .for-kind:not(.for-user),
.question:has([name="Question.Kind"] option[value="Dropdown"]:checked):has([name="Question.Shows"] option[value="Role"]:checked) .for-kind:not(.for-role),
.question:has([name="Question.Kind"] option[value="Dropdown"]:checked):has([name="Question.Shows"] option[value="Mentionable"]:checked) .for-kind:not(.for-mentionable),
.question:has([name="Question.Kind"] option[value="Dropdown"]:checked):has([name="Question.Shows"] option[value="Channel"]:checked) .for-kind:not(.for-channel),
.question:has([name="Question.Kind"] option[value="Radio"]:checked) .for-kind:not(.for-radio),
.question:has([name="Question.Kind"] option[value="Checkboxes"]:checked) .for-kind:not(.for-checkboxes),
.question:has([name="Question.Kind"] option[value="Checkbox"]:checked) .for-kind:not(.for-checkbox),
.question:has([name="Question.Kind"] option[value="File"]:checked) .for-kind:not(.for-file),
.question:has([name="Question.Kind"] option[value="Info"]:checked) .for-kind:not(.for-info),
.block-form:has(input[name="Block.Kind"][value="role"]:checked) .only-member,
.block-form:not(:has(input[name="Block.Kind"][value="role"]:checked)) .only-role { display: none; }
/* A dropdown's Shows sits beside its Answer (below it where both don't fit), and the Answer takes the whole width when
   Shows is hidden. */
.question-answer { display: flex; flex-wrap: wrap; gap: 1rem .6rem; }
.question-answer > * { flex: 1 1 12rem; min-width: 0; }
/* A type's button color picker shows each of Discord's colors in its own tone. */
.segment-primary { --tone: #8e97f7; }
.segment-secondary { --tone: #c6cad1; }
.segment-success { --tone: var(--green); }
.segment-danger { --tone: var(--danger); }
/* A fold's problems, listed under its summary, the same amber as Needs Attention. */
.fold-flag { flex: none; color: var(--amber); font: 600 .66rem var(--display); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.fold-issues { display: grid; gap: .4rem; margin: 0; padding: .85rem 1.35rem; list-style: none; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, rgb(245 184 61 / .08), transparent 60%); font-size: .88rem; }
.fold-issues li { display: flex; gap: .6rem; align-items: baseline; }
.fold-issues li::before { content: ""; width: 6px; height: 6px; flex: none; rotate: 45deg; translate: 0 -1px; background: var(--amber); }
/* A step a fold is missing that isn't a fault, such as a ticket type no panel offers, with the link that does it. */
.fold-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .85rem 1.35rem; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: .88rem; }
.fold-note p { margin: 0; }
/* What a picker's place lacks right now, under its hint. */
.field-warn { display: flex; gap: .5rem; align-items: baseline; color: var(--amber); }
.field-warn::before { content: ""; width: 6px; height: 6px; flex: none; rotate: 45deg; translate: 0 -1px; background: currentColor; }
/* Each question of a type's form is a small card of its own, with its tools in a header. */
.type-form + .fold-body { border-top: 1px solid var(--line); }
.questions .part-head .count { margin-left: .2rem; color: var(--text-3); font: 500 .74rem var(--font); letter-spacing: 0; }
.questions > .hint { margin: -.5rem 0 0; }
.question { display: grid; gap: .9rem; padding: .85rem 1rem 1rem; border: 1px solid var(--line); border-radius: var(--r-ctl); corner-shape: var(--corner); background: var(--bg-2); }
.question-head { display: flex; align-items: center; gap: .5rem; min-height: 28px; }
.question-number { font: 600 .7rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.question-tools { display: flex; gap: .15rem; margin-left: auto; }
.question-tools .icon-button { width: 30px; height: 30px; }
.question-new { gap: 0; border-style: dashed; background: transparent; }
.question-new[open] { gap: .9rem; border-style: solid; background: var(--bg-2); }
.question-new > summary { cursor: pointer; list-style: none; color: var(--text-2); }
.question-new > summary::-webkit-details-marker { display: none; }
.question-new > summary:hover, .question-new > summary:hover .question-number { color: var(--text); }
.question-new > summary .icon { color: var(--red-text); }
/* Saves for a type and a panel sit in the fold's footer but belong to its form, so they hide like inline saves. */
.js button.save-inline[form] { display: none; }
.block-table .is-expired td { color: var(--text-3); }
.block-table .is-expired .person { color: var(--text-2); }
.block-action { width: 1%; text-align: right; }
/* Ticket List: status chips and the order on one line, the other filters in a row under them. */
.status-open { color: var(--green); }
.status-closed { color: var(--text-2); }
.status-deleted { color: var(--text-3); }
.ticket-waiting { color: var(--amber); }
.table .ticket-waiting { color: var(--amber); font-weight: 500; }
.ticket-sort { margin-left: auto; }
.ticket-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 11rem)) minmax(0, 15rem) minmax(0, 7rem) auto; gap: .75rem; align-items: end; padding: .85rem 1.1rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ticket-filters .field { margin: 0; }
.ticket-filters .combo { max-width: none; }
.ticket-filter-actions { display: flex; gap: .5rem; }
.ticket-table tbody tr.is-waiting { box-shadow: inset 2px 0 0 var(--amber); }
.ticket-table td { vertical-align: middle; }
.ticket-table .ticket-id { white-space: nowrap; }
.rating { color: var(--amber); letter-spacing: .05em; white-space: nowrap; }
/* A ticket: its facts, answers, and people beside the timeline, then the transcript across the page. */
.ticket-head .page-sub { display: flex; flex-wrap: wrap; align-items: center; row-gap: .25rem; }
.ticket-head .status-pill { margin-left: 0; }
.ticket-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.ticket-actions form { display: contents; }
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; align-items: start; }
.ticket-side { display: grid; gap: .75rem; min-width: 0; }
.ticket-side .case-facts dl { grid-template-columns: 8.5rem minmax(0, 1fr); }
.ticket-side .case-facts .fact-text { flex-basis: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.card-empty { padding: 0 1.35rem 1.2rem; color: var(--text-3); font-size: .9rem; }
.answers { display: grid; gap: .25rem; margin: 0; padding: .1rem 1.35rem 1.25rem; }
.answers dt { margin-top: .6rem; color: var(--text-3); font: 600 .68rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.answers dt:first-child { margin-top: 0; }
.answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.answers dd.has-files { white-space: normal; }
.answer-files { display: grid; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.answer-file { font-weight: 600; }
.participants { display: grid; margin: 0; padding: 0 1.35rem .9rem; list-style: none; }
.participants li { display: flex; align-items: center; gap: .55rem; padding: .5rem 0; border-top: 1px solid var(--line); min-width: 0; }
.participants li:first-child { border-top: 0; }
.participants .tag-staff, .participants .tag-member { margin-left: 0; }
.participant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.participant-count { margin-left: auto; color: var(--text-3); font-size: .82rem; white-space: nowrap; }
.tag-member { display: inline-block; padding: .05rem .4rem; border-radius: var(--r-tag); corner-shape: var(--corner); border: 1px solid var(--line-2); color: var(--text-2); font: 600 .62rem var(--display); letter-spacing: .1em; text-transform: uppercase; }
.ticket-timeline { padding-top: .75rem; }
.timeline-claimed .timeline-dot, .timeline-reopened .timeline-dot { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 30%, var(--panel)); }
.timeline-opened .timeline-dot, .timeline-transcriptsaved .timeline-dot { border-color: var(--green); background: color-mix(in srgb, var(--green) 30%, var(--panel)); }
.timeline-closed .timeline-dot, .timeline-deleted .timeline-dot, .timeline-deletedoutside .timeline-dot { border-color: var(--red); background: color-mix(in srgb, var(--red) 30%, var(--panel)); }
.timeline-closerequested .timeline-dot, .timeline-reminded .timeline-dot, .timeline-dmfailed .timeline-dot, .timeline-transcriptfailed .timeline-dot { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 30%, var(--panel)); }
.transcript-card { margin-top: .75rem; }
.transcript-card .card-note { color: var(--text-2); font-size: .88rem; }
.transcript-card .card-head { flex-wrap: wrap; }
.transcript-tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.transcript-partial { margin: .25rem 1.35rem .75rem; color: var(--amber); }
.transcript-frame { display: block; width: calc(100% - 2.7rem); height: min(78vh, 900px); margin: .5rem 1.35rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-ctl); corner-shape: var(--corner); background: #313338; }
.transcript-files { display: grid; gap: .1rem; margin: 0; padding: 0 1.35rem 1.1rem; list-style: none; }
.transcript-files li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem 0; min-width: 0; }
.transcript-files a { overflow-wrap: anywhere; }
.transcript-card .card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.alert-actions { margin-top: .6rem; }
.timeline-rated .timeline-dot { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 30%, var(--panel)); }

/* Ticket Stats: a row of figures, then tables of numbers, right-aligned so they line up. */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin: 0; }
.stat { display: grid; align-content: start; gap: .3rem; min-width: 0; padding: 1rem 1.15rem 1.05rem; }
.stat dt { font: 600 .64rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.stat dd { margin: 0; min-width: 0; }
.stat .stat-value { margin-top: .15rem; font: 600 1.7rem/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.stat-star { margin-left: .1rem; color: var(--amber); font-size: 1.15rem; }
.stat-note { color: var(--text-3); font-size: .8rem; }
.stat-note a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .2em; }
.stat-note a:hover { color: var(--text); }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table td { vertical-align: middle; }
.stats-table tbody th { padding: .8rem 1.1rem; border-top: 1px solid var(--line); background: none; color: var(--text); font: 500 .9rem var(--font); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; vertical-align: middle; }
.stats-table .sub { white-space: nowrap; }
.stats-foot { padding-top: .85rem; border-top: 1px solid var(--line); max-width: none; }

/* ---- Smaller screens ---------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .page-cols { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(var(--sidebar), 86vw); transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: none; box-shadow: 30px 0 80px rgb(0 0 0 / .6); }
  .sidebar-close { display: inline-grid; }
  .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / .55); }
  .mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; background: rgb(9 8 10 / .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mobile-title { flex: 1; font: 600 1rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .is-app .savebar { left: 0; }
  .row, .place, .place-fields, .split, .cols-2, .log-grid, .case-grid, .message-editor, .hero { grid-template-columns: minmax(0, 1fr); }
  .place-actions { justify-content: flex-start; }
  .editor-side { position: static; }
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .readout { width: 100%; }
  .readout div:first-child { padding-left: 0; border-left: 0; }
  .moderation-table, .moderation-table tbody, .moderation-table tr, .moderation-table td { display: block; width: auto; }
  .moderation-table thead { display: none; }
  .moderation-table td { padding: .25rem 0; }
  .moderation-table td:first-child { width: auto; padding-top: .9rem; }
  /* Stacked, each cell names its column. */
  .moderation-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .3rem; font: 600 .66rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
  .moderation-table tr.is-all td { padding-bottom: .25rem; border-bottom: 0; }
  .moderation-table tr.is-all td:last-child { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
  /* Members' booster roles and the ticket block list stack into one block per row. */
  .booster-table, .booster-table tbody, .booster-table tr, .booster-table td,
  .block-table, .block-table tbody, .block-table tr, .block-table td { display: block; width: auto; }
  .booster-table thead, .block-table thead { display: none; }
  .booster-table tr, .block-table tr { padding: .8rem 0; border-top: 1px solid var(--line); }
  .booster-table tr:first-child, .block-table tr:first-child { border-top: 0; }
  .booster-table td, .block-table td { padding: .15rem 1.1rem; border: 0; }
  .block-table .reason { min-width: 0; }
  .block-table .block-action { text-align: left; padding-top: .45rem; }
  /* A ticket stacks its cards; the ticket list stacks each ticket into a block, each cell naming its column. */
  .ticket-grid { grid-template-columns: minmax(0, 1fr); }
  .ticket-actions { justify-content: flex-start; }
  .ticket-sort { margin-left: 0; }
  .ticket-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-filters .ticket-filter-wide { grid-column: 1 / -1; }
  .ticket-table td.is-empty { display: none; }
  .ticket-table, .ticket-table tbody, .ticket-table tr, .ticket-table td { display: block; width: auto; }
  .ticket-table thead { display: none; }
  .ticket-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
  .ticket-table tr:first-child { border-top: 0; }
  .ticket-table td { padding: 0; border: 0; min-width: 0; }
  .ticket-table td.ticket-id { grid-column: 1 / -1; }
  .ticket-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; font: 600 .62rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
  .ticket-table .person { white-space: normal; }
  /* Ticket Stats: two figures a row, and each table row a block of labeled numbers. */
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-table, .stats-table tbody, .stats-table tr, .stats-table td, .stats-table tbody th { display: block; width: auto; }
  .stats-table thead { display: none; }
  .stats-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem 1rem; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
  .stats-table tr:first-child { border-top: 0; }
  .stats-table td, .stats-table tbody th { padding: 0; border: 0; min-width: 0; }
  .stats-table tbody th { grid-column: 1 / -1; }
  .stats-table .num { text-align: left; }
  .stats-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; font: 600 .62rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
  .transcript-frame { width: calc(100% - 1.5rem); margin: .5rem .75rem .9rem; height: 70vh; }
  /* A lone switch stays beside its text, as on wider screens. */
  .row:has(> .row-control > .switch:only-child) { grid-template-columns: minmax(0, 1fr) auto; }
  .callout { flex-direction: column; align-items: flex-start; }
  /* The page's buttons sit on the left here, so their menu opens to the right. */
  .new-message-menu { left: 0; right: auto; }
}
/* Staff rules: each action's controls stack under its name, each with its own label. */
@media (max-width: 760px) {
  .staff-head { display: none; }
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .75rem; }
  .staff-row { row-gap: .55rem; padding: .85rem 0; }
  .staff-action, .staff-access { grid-column: 1 / -1; }
  .staff-cell-label { display: block; margin-bottom: 0; }
  .staff-length.is-empty { display: none; }
  .staff-row.is-reversal { padding-top: .1rem; }
  .check-row { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .check-row > :nth-child(n + 3) { grid-column: 2; }
  .check-row > .is-empty { display: none; }
}
@media (max-width: 480px) {
  .staff-grid { grid-template-columns: minmax(0, 1fr); }
  .staff-foot > .button:last-child { margin-left: 0; }
  .check-head { flex-wrap: wrap; }
  .check-row { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .check-row > :nth-child(n + 3) { grid-column: auto; }
  .check-row.is-reversal .check-action { padding-left: 0; }
}
@media (max-width: 560px) {
  /* Feature tiles turn into compact rows, icon beside the text. */
  .feature { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .9rem; padding: 1rem; }
  .feature-icon { grid-row: span 2; }
  .feature h3 { margin: 0; align-self: end; }
  .topbar-inner, .hero, .features, .site-main > .container { width: calc(100% - 2rem); }
  .user-menu .user-name { display: none; }
  .attention-list li { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .action-bar { grid-template-columns: 7.4rem 1fr 2rem; }
  .toolbar .combo { max-width: none; }
  .feed-item { grid-template-columns: auto minmax(0, 1fr); }
  .feed-item time { grid-column: 2; }
  .readout div { padding: 0 .9rem; }
  .savebar-inner { flex-wrap: wrap; }
  .inline-fields { grid-template-columns: minmax(0, 1fr); }
  .ticket-side .case-facts dl { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .ticket-side .case-facts dd { margin-bottom: .6rem; }
  /* A fold's summary line drops below its title rather than squeezing it. */
  .fold > summary { flex-wrap: wrap; row-gap: .3rem; }
  .fold-meta { order: 1; flex-basis: 100%; white-space: normal; }
  .fold > summary .led ~ .fold-meta { padding-left: calc(8px + .8rem); }
  /* The message builder stacks its paired fields, and a button's label and link take whole lines. */
  .editor-part { padding: 1rem; }
  .message-actions { padding: .8rem 1rem; }
  .builder-grid { grid-template-columns: minmax(0, 1fr); }
  .builder-button, .builder-image { grid-template-columns: minmax(0, 1fr) auto; }
  .builder-button > .builder-field:first-child, .builder-image > .builder-field:first-child { grid-column: 1 / -1; }
  .builder-button > .builder-emoji { width: 5.5rem; }
  .builder-card-body { padding: .75rem .7rem .85rem; }
  .builder-card-body:has(> .builder-part) { padding: 0 .7rem; }
  .builder-card-head { padding-left: .6rem; }
  /* The card's name stays; its summary gives way to the badge and tools. */
  .builder-card-sub { min-width: 0; }
  .builder-children { padding-left: .5rem; }
  .builder-history { order: 1; }
  .type-switch { order: 2; }
  .discord { margin: .25rem 1rem 0; padding: .75rem; gap: .6rem; }
  .discord-avatar { width: 32px; height: 32px; }
  .preview-note { padding: .75rem 1rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Live navigation: a thin bar while the next page loads, shown only if it takes a moment. */
body.is-loading::after {
  content: ""; position: fixed; inset: 0 0 auto; height: 2px; z-index: 1000; transform-origin: left;
  background: linear-gradient(90deg, var(--red), var(--red-text));
  animation: live-progress 1.2s ease-out .12s both;
}
@keyframes live-progress { from { transform: scaleX(0); opacity: 1; } 80% { transform: scaleX(.85); } to { transform: scaleX(.95); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { body.is-loading::after { animation: none; transform: scaleX(.6); } }

/* Small fixes that belong with their components above. */
h1 .pill { vertical-align: middle; margin-left: .4rem; font-size: .72rem; }
.segmented { width: fit-content; max-width: 100%; }
.role-picker-list:not(:has(.role-option))::after { content: "Nothing to choose from yet"; padding: .45rem .5rem; color: var(--text-3); font-size: .86rem; }
.palette-field input::-webkit-search-cancel-button { display: none; }
.card-note + form { padding-top: .6rem; }
