/* Warden's dashboard: the design guide's tokens (warden/docs/DESIGN.md §2) as the landing's, Cinzel for display, Inter for the rest. */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(cinzel.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(inter.woff2) format("woff2"); }
:root {
  --bg-void: #050a18; --bg-surface: #0b1430; --bg-raised: #111c3d; --bg-glass: rgba(5, 10, 24, 0.65);
  --border-subtle: rgba(126, 181, 253, 0.12); --border-strong: rgba(126, 181, 253, 0.28);
  --flame-600: #0254e4; --flame-600-hover: #0a5ff0; --flame-500: #1b78fc; --flame-400: #11a4fa; --flame-200: #7eb5fd;
  --flame-mist: rgba(2, 84, 228, 0.22); --spark: #46f9fc; --bronze-500: #b37554;
  --text-primary: #eef2fa; --text-secondary: #a7b3cc; --text-muted: #7d8aa8; --danger: #ff5c7a;
  --radius-sm: 4px; --radius-md: 8px; --ease: 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: "Cinzel", Georgia, serif; --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glow-flame: 0 0 0 1px rgba(126, 181, 253, 0.35), 0 0 24px -4px rgba(27, 120, 252, 0.55), 0 0 64px -12px rgba(2, 84, 228, 0.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; font: 400 1rem/1.6 var(--font-ui); color: var(--text-primary);
  background: radial-gradient(ellipse 70% 36rem at 70% -8rem, var(--flame-mist), transparent), var(--bg-void); background-attachment: fixed;
}
p { color: var(--text-secondary); }
a { color: var(--flame-400); }
:focus-visible { outline: 2px solid var(--flame-200); outline-offset: 2px; }
h1, h2, .brand strong { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.25rem; border: 0;
  border-radius: var(--radius-sm); background: var(--flame-600); color: #fff; font: 600 1rem var(--font-ui); text-decoration: none;
  white-space: nowrap; cursor: pointer; transition: background-color var(--ease), box-shadow var(--ease);
}
.button:is(:hover, :focus-visible) { background: var(--flame-600-hover); color: #fff; box-shadow: var(--glow-flame); }
.button.quiet { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-strong); }
.button.quiet:is(:hover, :focus-visible) { color: var(--text-primary); background: var(--bg-raised); }
.cta { box-shadow: var(--glow-flame); }

.top-bar { position: sticky; top: 0; z-index: 10; background: var(--bg-glass); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-subtle); }
.top-bar nav, .page { max-width: 60rem; margin-inline: auto; padding-inline: 1rem; }
.top-bar nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 0 0.4rem rgba(27, 120, 252, 0.35)); }
.brand strong { color: var(--text-primary); font-size: 1.35rem; letter-spacing: 0.12em; }
.who { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--bronze-500); }
.page { padding-block: 2rem 4rem; }
.page-title { font-size: clamp(1.6rem, 2vw + 1rem, 2.25rem); margin: 0 0 0.5rem; }
.error { color: var(--danger); }

.signed-out { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18vh 1rem 4rem; }
.signed-out h1 { font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem); margin: 1rem 0 0.25rem; }
.signed-out-logo { width: 96px; height: 96px; filter: drop-shadow(0 0 1.2rem rgba(27, 120, 252, 0.45)); }
.lede { max-width: 34rem; margin: 0 auto 1.5rem; }
@media (max-width: 30rem) { .who-name { display: none; } }

/* The page loader, RaidSlot's pattern: Warden's star breathing in its flame, the sparks lighting in turn; with reduced
   motion, a slow fade. index.html's boot loader is the same, hidden once the app has drawn. */
.page-loader { display: flex; align-items: center; justify-content: center; min-height: 50vh; padding: 2rem 0; }
.boot-loader { min-height: 80vh; }
#app:not(:empty) ~ .boot-loader { display: none; }
.loader-mark { display: block; width: 72px; height: auto; overflow: visible; }
.loader-star { fill: var(--flame-400); }
.loader-spark { fill: var(--spark); }
@media (prefers-reduced-motion: no-preference) {
  .loader-mark { animation: loader-breathe 1.8s ease-in-out infinite; }
  .loader-spark { opacity: 0.2; animation: loader-spark 1.8s ease-in-out infinite; }
  .loader-spark.s1 { animation-delay: 0.15s; } .loader-spark.s2 { animation-delay: 0.3s; } .loader-spark.s3 { animation-delay: 0.45s; }
}
@media (prefers-reduced-motion: reduce) { .loader-mark { animation: loader-fade 2.4s ease-in-out infinite; } }
@keyframes loader-breathe {
  0%, 100% { transform: scale(0.92); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(27, 120, 252, 0.7)); }
}
@keyframes loader-spark { 0%, 15% { opacity: 0.2; } 40%, 70% { opacity: 1; } 100% { opacity: 0.2; } }
@keyframes loader-fade { 50% { opacity: 0.6; } }

/* The servers picker: one row per server, its icon or initial, name and state, and Configure or Invite; Warden's servers lit
   with the bronze edge of the guide's featured cards. */
.server-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.server-row {
  display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem; min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.server-row.installed { background: var(--bg-raised); border-color: var(--border-strong); border-left: 3px solid var(--bronze-500); }
.server-badge {
  position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 50%;
  background: var(--bg-void); border: 1px solid var(--border-strong); font: 600 1.25rem var(--font-display); color: var(--flame-200);
}
.server-icon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.server-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.server-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-state { font-size: 0.875rem; color: var(--text-muted); }
.server-row.installed .server-state { color: var(--text-secondary); }
.button.disabled { opacity: 0.5; cursor: not-allowed; }
.empty { margin-top: 1.5rem; }
.notice { max-width: 34rem; margin: 0 auto 1.5rem; padding: 0.75rem 1rem; border: 1px solid var(--flame-400); border-radius: var(--radius-md); background: var(--bg-raised); }
.notice p { margin: 0 0 0.75rem; }
/* "Give me access" (#3205, C3): the notice inside the section whose channel it's about. */
.own-access { max-width: none; margin: 0.5rem 0 1rem; }
.own-access p:last-child { margin-bottom: 0; }
.own-access-wrap > .said:empty { display: none; }
.page .lede { margin-inline: 0; }
@media (max-width: 30rem) { .server-row { gap: 0.75rem; padding: 0.75rem; } .server-row .button { padding: 0 0.9rem; } }

/* A server's tabs (Widgets.tabs): a row that wraps, the selected tab underlined in flame. */
.tabs { margin-bottom: 1.5rem; }
.tablist { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 1.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.tab {
  min-height: 44px; padding: 0 1rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
  color: var(--text-secondary); font: 600 1rem var(--font-ui); cursor: pointer; transition: color var(--ease), border-color var(--ease);
}
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--flame-400); }

/* A tab's editor: the form, and beside it (under it on a phone) the preview. */
.editor { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .editor { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .editor-side { position: sticky; top: 5rem; align-self: start; } }
.editor-main, .editor-side { padding: 1.25rem; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); min-width: 0; }
.section-title { margin: 0 0 0.75rem; font-size: 1.05rem; font-weight: 600; }
.editor-main .section-title:not(:first-child) { margin-top: 1.75rem; }
label { display: block; margin-bottom: 0.35rem; color: var(--text-primary); font-weight: 500; }
.field {
  display: block; width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--text-primary); font: 400 1rem/1.5 var(--font-ui);
}
textarea.field { resize: vertical; }
.field:focus-visible { border-color: var(--flame-200); }
.field-help { margin: 0.4rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
.field-help code { padding: 1px 6px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--flame-200); font-size: 0.8125rem; }
.warning { color: #ffc46b; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }
.button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.button:active:not(:disabled) { transform: scale(0.98); }
.said { min-height: 1.6em; margin: 0.75rem 0 0; text-align: right; }

/* A Discord message as its dark theme draws it, so the colours are Discord's, not ours (the Python dashboard's). */
.discord-message { display: flex; gap: 0.875rem; padding: 0.875rem 1rem; background: #313338; color: #dbdee1; border-radius: var(--radius-sm); font-size: 0.9375rem; }
.discord-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.discord-body { flex: 1; min-width: 0; }
.discord-body p { margin: 0; color: inherit; }
.discord-author { line-height: 1.4; }
.discord-author strong { color: #f2f3f5; font-weight: 600; }
.discord-body .discord-text { margin-top: 0.125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.discord-mention { padding: 0 2px; border-radius: 3px; font-weight: 500; background: rgba(88, 101, 242, 0.3); color: #c9cdfb; }
.discord-app { margin-left: 0.25rem; padding: 0 0.3rem; border-radius: 3px; vertical-align: 1px; background: #5865f2; color: #fff; font-size: 0.625rem; font-weight: 600; }

/* The Moderation tab: panels side by side on a wide screen (the mod log, the filter), full width for AutoMod and warnings. */
.mod-grid { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .mod-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mod-grid .wide { grid-column: 1 / -1; } }
.panel { padding: 1.25rem; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); min-width: 0; }
.inline-form { display: flex; gap: 0.75rem; }
.inline-form .field { flex: 1; min-width: 0; }
.list-title { margin: 1.25rem 0 0.5rem; font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--border-subtle); }
.row-text { min-width: 0; overflow-wrap: anywhere; }
.row-note { color: var(--text-muted); }
.row-head, .reason { margin: 0; }
.reason { color: var(--text-primary); white-space: pre-wrap; }
.warning-row { align-items: flex-start; }
@media (max-width: 30rem) { .warning-row { flex-wrap: wrap; } }
.button.small { padding: 0 0.85rem; font-size: 0.875rem; flex: none; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #1a0208; }
.button.danger:is(:hover, :focus-visible) { background: #ff7a93; color: #1a0208; }
.empty-list { color: var(--text-muted); }
.status-ok { color: var(--spark); }
.levels { margin: 1rem 0 0; padding: 0; border: 0; }
.levels legend { margin-bottom: 0.5rem; color: var(--text-primary); font-weight: 600; }
.level { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.6rem; font-weight: 400; color: var(--text-secondary); }
.level input { flex: none; accent-color: var(--flame-500); }
.level strong { color: var(--text-primary); }
.member-warnings { margin-top: 1.25rem; padding-top: 0.25rem; }

/* The welcome card (#3206): its switch, the link beside its button, and the card under the preview's message. */
.switch { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; margin: 0.5rem 0 0.75rem; cursor: pointer; }
.switch input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--flame-600); }
.inline-field { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.inline-field .field { flex: 1 1 14rem; width: auto; min-width: 0; }
.editor-main input[type="file"].field { padding: 0.5rem; }
.discord-attachment { display: block; width: 100%; max-width: 100%; height: auto; margin-top: 0.5rem; border-radius: var(--radius-sm); }
.editor-main .field-help + label { margin-top: 0.9rem; }

/* The Join roles tab: each list's roles as pills with Remove, a role Warden can't give marked and why; switches; the Sync's progress. */
.role-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; padding: 0; }
.role-chips.inline { display: inline-flex; margin: 0 0 0 0.5rem; gap: 0.35rem; vertical-align: middle; }
.role-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; max-width: 100%; padding: 0.15rem 0.25rem 0.15rem 0.65rem;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-raised); }
.role-pill { color: var(--flame-200); font-weight: 600; overflow-wrap: anywhere; }
.role-chips.inline .role-pill { padding: 0 0.5rem; border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 0.875rem; }
.role-chip.broken, .role-pill.broken { border-color: #ffc46b; }
.role-chip-problem { flex-basis: 100%; padding: 0 0.5rem 0.2rem 0; color: #ffc46b; }
.chip-remove { min-width: 32px; min-height: 32px; border: 0; border-radius: 50%; background: none; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; }
.chip-remove:is(:hover, :focus-visible) { color: var(--text-primary); background: var(--bg-surface); }
.join-tab .switch { margin: 0.4rem 0; min-height: 0; font-weight: 400; color: var(--text-secondary); cursor: pointer; }
.switch-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 1rem; }
.switch-save .switch { flex: 1 1 16rem; }
.user-role-form { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.user-role-form .field { flex: 1 1 14rem; width: auto; min-width: 0; }
.form-actions.start { justify-content: flex-start; }
.sync-last { margin: 0.75rem 0 0; }
.sync-status { margin-top: 1rem; }
.sync-status progress { width: 100%; height: 0.6rem; accent-color: var(--flame-400); }
.sync-status p { margin: 0.4rem 0 0; }
.sync-status summary { cursor: pointer; color: var(--text-primary); }
.join-tab .field-label { margin-top: 1rem; }

/* The Logs tab (#3209): the channel and the events side by side on a wide screen, a switch per event. */
.logs-tab .logs-grid { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .logs-tab .logs-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.logs-tab .log-events { margin: 0; padding: 0; border: 0; min-width: 0; }
.logs-tab .switch { margin: 0.25rem 0; font-weight: 400; color: var(--text-secondary); }
.logs-tab .field-help + label { display: block; margin-top: 0.9rem; }

/* The Role buttons tab (#3210, C21): the panels as cards, the button rows, and the preview's embed and buttons. */
.panels-tab .panel-list { margin-bottom: 1.5rem; }
.panels-tab .panel-cards { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.panels-tab .panel-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 44px; padding: 0.75rem; text-align: left; cursor: pointer;
  font: inherit; color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.panels-tab .panel-card:is(:hover, :focus-visible), .panels-tab .panel-card.open { border-color: var(--border-strong); box-shadow: var(--glow-flame); }
.panels-tab .panel-thumb { flex: none; width: 4rem; height: 2rem; overflow: hidden; border-radius: var(--radius-sm); background: #313338; }
.panels-tab .panel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panels-tab .panel-thumb-embed { display: block; height: 100%; border-left: 3px solid #5865f2; }
.panels-tab .panel-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; overflow-wrap: anywhere; }
.panels-tab .panel-card-title { color: var(--text-primary); }
.panels-tab .panel-card-meta { font-size: 0.875rem; }
.panels-tab .panel-card-open { flex: none; color: var(--text-muted); font-size: 0.875rem; }
.panels-tab .panel-button-row { flex-wrap: wrap; }
.panels-tab .panel-button-row .row-text { flex: 1 1 12rem; display: flex; flex-direction: column; }
.panels-tab .row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.panels-tab .button-edit { flex-basis: 100%; }
.panels-tab .button-fields { display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.panels-tab .discord-embed { margin-top: 0.25rem; padding: 0.5rem 0.75rem 0.75rem; max-width: 32rem; background: #2b2d31; border-left: 4px solid #5865f2; border-radius: var(--radius-sm); }
.panels-tab .discord-body .discord-embed-title { margin-top: 0.25rem; color: #f2f3f5; font-weight: 600; overflow-wrap: anywhere; }
.panels-tab .discord-embed-title.empty { color: #80848e; }
.panels-tab .discord-body .discord-embed-text { margin-top: 0.35rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.panels-tab .discord-embed-image { display: block; width: 100%; height: auto; margin-top: 0.75rem; border-radius: var(--radius-sm); }
.panels-tab .discord-image-error { margin-top: 0.5rem; color: var(--danger); }
.panels-tab .discord-body .discord-hint { margin-top: 0.5rem; color: #949ba4; font-size: 0.875rem; }
.panels-tab .discord-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.panels-tab .discord-button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 32px; padding: 0 1rem; border-radius: 3px;
  background: #4e5058; color: #fff; font-size: 0.875rem; font-weight: 500; max-width: 100%; overflow-wrap: anywhere; }
.panels-tab .editor-main :is(.field, .inline-field) + label { margin-top: 0.9rem; }

/* The Settings tab (#3214): the manager roles full width, the time zone and the embed colour side by side on a wide screen. */
.settings-tab .settings-grid { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .settings-tab .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .settings-tab .wide { grid-column: 1 / -1; } }
.settings-tab .manager-roles { display: grid; gap: 0 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); margin: 0.75rem 0 0; padding: 0; border: 0; min-width: 0; }
.settings-tab .switch { margin: 0.25rem 0; font-weight: 400; color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }
.settings-tab .switch.unavailable { color: var(--text-muted); cursor: not-allowed; }
.settings-tab .row-note { color: var(--text-muted); }
.settings-tab .field-help + label { margin-top: 0.9rem; }
.settings-tab .form-actions.split { justify-content: space-between; align-items: center; }
.settings-tab .color-row { display: flex; align-items: center; gap: 0.75rem; }
.settings-tab .color-row input { width: 3.5rem; height: 44px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-raised); cursor: pointer; }
.settings-tab .color-row code { color: var(--flame-200); }
/* Warden in this server: the form, and beside it (under it on a phone) Discord's profile card. */
.settings-tab .profile-editor { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .settings-tab .profile-editor { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } .settings-tab .profile-editor > .said { grid-column: 1 / -1; } }
.settings-tab .profile-form .field + label { margin-top: 0.9rem; }
.settings-tab .image-pick { margin-top: 1.25rem; }
.settings-tab .form-heading { margin: 0 0 0.5rem; font-size: 1rem; }
.settings-tab .form-heading small { color: var(--text-muted); font-weight: 400; }
.settings-tab .image-pick-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-start; }
.settings-tab .image-pick-inputs { flex: 1 1 12rem; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
.settings-tab .image-pick-inputs input[type="file"] { max-width: 100%; color: var(--text-secondary); }
.settings-tab .image-pick-thumb { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg-raised); border: 1px solid var(--border-strong); }
.settings-tab .image-pick-thumb.banner { width: 96px; height: 34px; border-radius: var(--radius-sm); }
.settings-tab .bot-card { position: relative; overflow: hidden; border-radius: var(--radius-md); background: #232428; max-width: 22rem; }
.settings-tab .bot-card-banner { display: block; width: 100%; height: 7.5rem; object-fit: cover; background: #5865f2; }
.settings-tab .bot-card-avatar { position: absolute; top: 4.5rem; left: 1rem; width: 80px; height: 80px; border-radius: 50%; border: 6px solid #232428; background: #232428; }
.settings-tab .bot-card-body { padding: 3rem 1rem 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; color: #f2f3f5; overflow-wrap: anywhere; }
.settings-tab .bot-card-body small { flex-basis: 100%; color: #b5bac1; }
.settings-tab .bot-card-body p { flex-basis: 100%; margin: 0.5rem 0 0; color: #dbdee1; white-space: pre-wrap; }
.settings-tab .discord-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 0.7rem; font-weight: 600; }

/* The Voice tab (#3212): room between a field and the next label; an active channel's owner and name wrap on a phone. */
.voice-tab :is(.field, .field-help, .warning) + label { margin-top: 0.9rem; }
.voice-tab .row { flex-wrap: wrap; }

/* Stats (#3213): series colours checked for colour-blind separation on --bg-surface; text never wears them. */
.stats-tab { --series-1: #3b8bf0; --series-2: #c8784a; }
.stats-tab .stats-head { margin-bottom: 1.5rem; }
.stats-tab .periods { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.stats-tab .tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.stats-tab .tile { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 1rem; background: var(--bg-raised); border-radius: var(--radius-md); min-width: 0; }
.stats-tab .tile-label { font-size: 0.875rem; color: var(--text-muted); }
.stats-tab .tile-value { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stats-tab .stats-grid { display: grid; gap: 1.5rem 2rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .stats-tab .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.stats-tab .plot { display: block; width: 100%; height: auto; overflow: visible; }
.stats-tab .grid line { stroke: var(--border-subtle); stroke-width: 1; }
.stats-tab .grid text, .stats-tab .x-labels text { fill: var(--text-muted); font-size: 17px; font-variant-numeric: tabular-nums; }
.stats-tab .baseline { stroke: var(--border-strong); stroke-width: 1; }
.stats-tab .series-1 { fill: var(--series-1); }
.stats-tab .series-2 { fill: var(--series-2); }
.stats-tab .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stats-tab .end { stroke: var(--bg-surface); stroke-width: 2; }
.stats-tab .end-label { fill: var(--text-primary); font-size: 18px; font-weight: 600; }
.stats-tab .hit { fill: transparent; }
.stats-tab .hit:hover { fill: rgba(126, 181, 253, 0.08); }
.stats-tab .legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0 0 0.5rem; padding: 0; list-style: none; font-size: 0.875rem; color: var(--text-secondary); }
.stats-tab .legend li { display: flex; align-items: center; gap: 0.4rem; }
.stats-tab .chart-empty { margin: 0; color: var(--text-muted); }
.stats-tab .hbars { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.stats-tab .hbars li { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; }
.stats-tab .hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.stats-tab .hbar { display: block; width: 100%; }
.stats-tab .hbar-value, .stats-tab .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.stats-tab .stats-table { width: 100%; border-collapse: collapse; }
.stats-tab .stats-table :is(th, td) { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border-subtle); text-align: left; }
.stats-tab .stats-table th { font-weight: 500; color: var(--text-secondary); }
.stats-tab .stats-table th.num { text-align: right; }
.stats-tab .table-scroll { overflow-x: auto; max-height: 24rem; margin-top: 0.75rem; }
.stats-tab summary { cursor: pointer; color: var(--text-secondary); }

/* The Roles tab (#3211): the roles as cards in their colour, a lock on those the member can't change; a role's members. */
.roles-tab .role-list { margin-top: 1.5rem; }
.roles-tab .role-cards { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.roles-tab .role-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 44px; padding: 0.75rem; text-align: left; cursor: pointer;
  font: inherit; color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.roles-tab .role-card:is(:hover, :focus-visible) { border-color: var(--border-strong); box-shadow: var(--glow-flame); }
.roles-tab .role-card.locked { opacity: 0.75; }
.roles-tab .role-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.roles-tab .role-card-top { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.roles-tab .role-card-note { color: var(--text-muted); overflow-wrap: anywhere; }
.roles-tab .role-perms { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.roles-tab .perm-chip, .roles-tab .perm-more { padding: 0 0.45rem; border: 1px solid #ffc46b; border-radius: 999px; color: #ffc46b; font-size: 0.75rem; }
.roles-tab .perm-more { border-color: var(--border-strong); color: var(--text-muted); }
.roles-tab .role-members { flex: none; color: var(--text-muted); }
.roles-tab .swatch { flex: none; width: 0.85rem; height: 0.85rem; border-radius: 50%; background: #99aab5; }
.roles-tab .swatch.none { background: transparent; border: 1px solid var(--border-strong); }
.roles-tab .role-heading { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; }
.roles-tab .back-link { margin: 0 0 0.75rem; }
.roles-tab .panel .rows { margin-top: 0.75rem; }
.roles-tab .pager { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.75rem; }
.roles-tab fieldset.plain { margin: 0; padding: 0; border: 0; min-width: 0; }
.roles-tab .role-editor { margin-bottom: 1.5rem; }
.roles-tab .role-fields { display: grid; gap: 0.75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.roles-tab .perm-grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.roles-tab .perm-grid.compact .perm-option { padding: 0.4rem 0.6rem; }
.roles-tab .perm-option { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-raised); font-weight: 400; cursor: pointer; }
.roles-tab .perm-option.dangerous { border-color: rgba(255, 196, 107, 0.45); }
.roles-tab .perm-option.unavailable { opacity: 0.55; cursor: not-allowed; }
.roles-tab .perm-option input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--flame-600); }
.roles-tab .perm-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.roles-tab .perm-text small { color: var(--text-muted); }
.roles-tab .perm-label { color: var(--text-primary); }
.roles-tab .perm-label .perm-chip { margin-left: 0.35rem; }
.roles-tab .perm-missing { color: #ffc46b !important; }
.roles-tab .perm-advanced { margin-top: 1rem; }
.roles-tab .perm-advanced summary { cursor: pointer; color: var(--text-primary); min-height: 44px; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.roles-tab .perm-advanced summary small { color: var(--text-muted); }
.roles-tab .perm-group { margin: 1rem 0 0.4rem; color: var(--text-primary); font-weight: 600; }
.roles-tab .confirm-dangerous { margin-top: 1rem; }
.roles-tab .confirm-dangerous .warning { color: #ffc46b; }
.roles-tab .danger-zone summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; }
/* Bulk changes and purges (#3211, C25): the form, its preview and the job's progress; a member's roles. */
.roles-tab .bulk-panel { margin-top: 1.5rem; }
.roles-tab .bulk-extra { margin-top: 0.75rem; }
.roles-tab .purge .sync-status, .roles-tab .bulk-panel .sync-status { margin-top: 0.75rem; }
.roles-tab .row .role-card-top { flex: 1; }
/* A role's channel access (#3211, C26): a tri-state switch per channel and key permission; the table scrolls in its card. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.roles-tab .access-scroll { overflow-x: auto; margin-top: 0.75rem; border: 1px solid var(--border-subtle); border-radius: 8px; }
.roles-tab .access-table { width: 100%; border-collapse: collapse; }
.roles-tab .access-table th, .roles-tab .access-table td { padding: 0.4rem 0.6rem; text-align: center; border-top: 1px solid var(--border-subtle); white-space: nowrap; }
.roles-tab .access-table th[scope="row"], .roles-tab .access-table thead th:first-child, .roles-tab .access-category th { text-align: left; }
.roles-tab .access-category th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.roles-tab .channel-mark { color: var(--text-muted); margin-right: 0.35rem; }
.roles-tab .tri { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.roles-tab .tri label { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; cursor: pointer; color: var(--text-muted); }
.roles-tab .tri input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.roles-tab .tri label:has(input:focus-visible) { outline: 2px solid var(--flame-400); outline-offset: -2px; }
.roles-tab .tri-allow:has(input:checked), .roles-tab .tri-key.tri-allow { background: #1f7a4d; color: #fff; }
.roles-tab .tri-inherit:has(input:checked), .roles-tab .tri-key.tri-inherit { background: var(--border-strong); color: #fff; }
.roles-tab .tri-deny:has(input:checked), .roles-tab .tri-key.tri-deny { background: #a3283f; color: #fff; }
.roles-tab .access-legend { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); }
.roles-tab .tri-key { display: inline-flex; width: 1.4rem; height: 1.4rem; align-items: center; justify-content: center; border-radius: 4px; }
.roles-tab .danger-outline { color: var(--danger); border-color: var(--danger); }
.roles-tab .confirm .button.danger { margin-top: 0.75rem; white-space: normal; text-align: left; min-height: 44px; }
.roles-tab .panel + .panel, .roles-tab .role-editor + .panel { margin-top: 1.5rem; }
.roles-tab .role-card-item { display: flex; align-items: stretch; gap: 0.35rem; min-width: 0; }
.roles-tab .role-card-item .role-card { flex: 1; min-width: 0; }
.roles-tab .role-move { display: flex; flex-direction: column; gap: 0.35rem; flex: none; }
.roles-tab .role-move .step { flex: 1; min-width: 44px; min-height: 0; padding: 0 0.6rem; }
