/* Percy Bot Dashboard — matches the admin/account design language. */

/* ── Cross-document view transitions ──────────────────────────────────────
   dashboard.css only loads on dashboard pages, so this scopes the transition
   to dashboard-internal navigation. The chrome (top bar + sidebar) carries a
   stable `view-transition-name`, so it stays put while only the content area
   crossfades -- this removes the full sidebar repaint/flash on every load.
   Browsers without cross-document view transitions ignore this and fall back
   to a normal navigation (no regression). */
@view-transition { navigation: auto; }

.percy-topbar { view-transition-name: percy-topbar; }

/* Freeze the persistent chrome: no fade/move, so it reads as continuous. */
::view-transition-group(dash-sidebar),
::view-transition-group(percy-topbar),
::view-transition-old(dash-sidebar),
::view-transition-new(dash-sidebar),
::view-transition-old(percy-topbar),
::view-transition-new(percy-topbar) {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

.dash-h1-glyph { color: var(--brand, #d97757); font-size: 0.8em; margin-right: 0.15rem; }

/* Page header. The app shell (shell.css, loaded after this file) restyles it; the standalone
   server picker (site/guilds.html) still relies on these. */
.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--box-border);
    margin-bottom: 1.5rem;
}
.dashboard-header > div:first-child { min-width: 0; }
.dashboard-header h1 { font-size: 1.5rem; font-weight: 700; }
.dashboard-header p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }

.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── Shared staggered entrance ───────────────────────────────────────────
   Add `dash-rise` to any block for a gentle rise-and-fade on load; set
   `--i` on grid children for a cascade. Guarded for reduced-motion below. */
@keyframes dash-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
.dash-rise {
    animation: dash-rise 0.5s both;
    animation-delay: calc(var(--i, 0) * 45ms);
}
@media (prefers-reduced-motion: reduce) {
    .dash-rise { animation: none; }
}


/* ── Page info / help callout (shared by feature pages) ──────────────── */

.dash-pageinfo {
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem 1.15rem;
    margin-bottom: 1.5rem;
    border-radius: 0.625rem;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    border-left: 3px solid var(--branding);
}
.dash-pageinfo-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--branding);
}
.dash-pageinfo-body {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-muted);
}
.dash-pageinfo-body strong { color: var(--foreground); font-weight: 600; }
.dash-pageinfo-body p { margin: 0 0 0.4rem; }
.dash-pageinfo-body p:last-child { margin-bottom: 0; }
.dash-pageinfo-body code {
    font-size: 0.74rem;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    background: var(--box);
    border: 1px solid var(--box-border);
}
.dash-pageinfo-body a { color: var(--link-text); }
.dash-pageinfo-tips {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 0.4rem 1.1rem;
    margin-top: 0.5rem;
    list-style: none;
    padding: 0;
}
.dash-pageinfo-tips li {
    font-size: 0.76rem;
    color: var(--text-muted);
    padding-left: 0.9rem;
    position: relative;
}
.dash-pageinfo-tips li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--branding);
    font-weight: 700;
}

.dashboard-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.15s;
}
.dashboard-back:hover { color: var(--branding); }



.dashboard-empty {
    text-align: center;
    padding: 4rem 1rem;
    background:
        radial-gradient(90% 120% at 50% 0%, var(--branding-dim), transparent 60%),
        var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.9rem;
}

.dashboard-empty h1 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}
.dashboard-empty p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* -- "Invite Percy" call-to-action (empty state) -- */

/* `a.` qualifier + explicit hover colour so the white label beats the global
   `a:not(.button)` link colour (which tints it dark coral, unreadable on the
   blurple gradient in light mode). */
a.invite-percy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: min(22rem, 100%);
    margin: 2rem auto 0;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #5865f2 0%, #7d5cff 100%);
    box-shadow: 0 8px 24px -8px rgba(88, 101, 242, 0.65);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

a.invite-percy-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: 0 12px 30px -8px rgba(88, 101, 242, 0.8);
}

.invite-percy-btn:active {
    transform: translateY(0);
}

.invite-percy-btn img {
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
}

/* -- Logged-out welcome / landing page -- */

.percy-hero {
    text-align: center;
    max-width: 680px;
    margin: 2rem auto 3rem;
    padding: 3rem 1.5rem 0;
}

.percy-hero-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: var(--branding-dim);
    color: var(--branding);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.percy-hero-title {
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 1.25rem;
}
.percy-hero-title .branding { color: var(--branding); }

.percy-hero-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--foreground);
    margin: 0 0 1rem;
}



.percy-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

/* The hero reuses the gradient pill button but sizes it to its content
   inside the flex row (overrides the centered full-width empty-state rule). */
.percy-hero-actions .invite-percy-btn {
    width: auto;
    margin: 0;
}

.percy-hero-secondary {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.percy-hero-secondary:hover {
    color: var(--branding);
    border-color: var(--branding);
}











/* -- Guild grid (server list) -- */





/* A coral corner glow that blooms on hover. */









/* ── Server list sections (Managed / In / Add Percy) ─────────────── */







/* "Add Percy" cards are visually muted until hovered, signalling they're a
   call-to-action rather than a live server you can open. */






/* Compact "Add" action in the Your Servers header — a small, self-contained
   button (not the big blurple invite pill). Subtle box-styled chip with a coral
   hover, sized to its content so it tucks neatly beside the heading. */







.guild-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.7rem;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--box-border);
    transition: border-color 0.18s ease;
}

.guild-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.25rem;
}
.guild-icon-placeholder.large {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}


.guild-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.guild-members {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* -- Guild detail header -- */

.guild-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--box-border);
    border-radius: 0.9rem;
    background:
        radial-gradient(110% 160% at 0% 0%, var(--branding-dim), transparent 55%),
        var(--box);
    margin-bottom: 1.5rem;
}
/* Let the name block shrink and wrap long guild names instead of shoving the
   "Manage Members" action past the edge on narrow/mobile screens. */
.guild-header-meta {
    flex: 1 1 auto;
    min-width: 0;
}
.guild-header-action {
    flex-shrink: 0;
}
.guild-header-icon {
    width: 64px;
    height: 64px;
    border-radius: 0.8rem;
    object-fit: cover;
    border: 1px solid color-mix(in srgb, var(--branding) 40%, var(--box-border));
    box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--branding) 70%, transparent);
}
.guild-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

/* -- Config sections (reuses account-section pattern) -- */

.config-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.4rem;
    border-radius: 0.8rem;
    background: var(--box);
    border: 1px solid var(--box-border);
    transition: border-color 0.18s ease;
}
.config-section:hover {
    border-color: color-mix(in srgb, var(--branding) 30%, var(--box-border));
}
.config-section h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
/* Coral terminal glyph before each config section title. */
.config-section h2::before {
    content: "✻";
    color: var(--branding);
    font-size: 0.9em;
    text-transform: none;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.config-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    margin-bottom: 1rem;
}

/* Compact list of switches: one bordered box, label left, switch right, 1px dividers. */
.toggle-stack {
    border: 1px solid var(--box-border);
    border-radius: 0.375rem;
    background: var(--box-shade);
    margin-bottom: 1rem;
}
.toggle-stack > .config-toggle {
    border: none;
    border-radius: 0;
    background: transparent;
}
.toggle-stack > .config-toggle + .config-toggle {
    border-top: 1px solid var(--box-border);
}

.config-toggle > div,
.config-field > div:not(.dc-message):not(.template-vars) {
    display: flex;
    flex-direction: column;
}

.config-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
}
.config-value {
    font-size: 0.85rem;
}
.config-value em {
    color: var(--text-muted);
    font-style: normal;
}

/* Checkbox toggle styling (matches admin toggles) */
.config-toggle input[type="checkbox"] {
    appearance: none;
    width: 2.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: var(--form-input-background);
    border: 1px solid var(--form-input-border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.config-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.15s, background 0.15s;
}
.config-toggle input[type="checkbox"]:checked {
    background: var(--branding-dim);
    border-color: var(--branding);
}
.config-toggle input[type="checkbox"]:checked::after {
    transform: translateX(1rem);
    background: var(--branding);
}
.config-toggle input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: default;
}

/* -- Form elements -- */

.config-select,
.config-input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    background: var(--form-input-background);
    border: 1.5px solid var(--form-input-border);
    border-radius: 0.375rem;
    color: var(--foreground);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.config-select:hover,
.config-input:hover {
    border-color: color-mix(in srgb, var(--branding) 45%, var(--form-input-border));
    background: var(--box-shade);
}
.config-select:focus,
.config-input:focus {
    outline: none;
    border-color: var(--form-input-focus-border);
    background: var(--box-shade);
    box-shadow: 0 0 0 3px var(--branding-dim);
}
.config-input::placeholder { color: var(--text-muted); }

/* Custom chevron + readable option list for selects (native control is hard
   to theme; this gives them clearer affordance and contrast). */
select.config-select {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 1.1rem) calc(50% - 2px),
        calc(100% - 0.75rem) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2rem;
}
select.config-select:hover,
select.config-select:focus {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--branding) 50%),
        linear-gradient(135deg, var(--branding) 50%, transparent 50%);
    background-position:
        calc(100% - 1.1rem) calc(50% - 2px),
        calc(100% - 0.75rem) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}
select.config-select option {
    background: var(--box);
    color: var(--foreground);
}
/* Multi-selects keep the native arrow-less look but still gain contrast. */
select.config-select[multiple] {
    background-image: none;
    padding-right: 0.65rem;
}

.config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--box-border);
}

.config-description {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.3;
}

.config-section-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

/* -- Subsection titles within a config-section (e.g. Role/Channel Multipliers) -- */
.subsection-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin: 1.75rem 0 0.75rem;
}
.subsection-title:first-of-type {
    margin-top: 0.75rem;
}

/* -- Inline "add" rows: select(s) + value + button on a single line -- */
.inline-add-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
}
/* Override the default full-width form fields so they sit inline. */
.inline-add-form .config-input {
    width: auto;
}
.inline-add-form select.config-input {
    flex: 0 1 14rem;
    min-width: 9rem;
}
.inline-add-form input[type="number"].config-input {
    flex: 0 0 7rem;
    width: 7rem;
}
.inline-add-form input[type="text"].config-input {
    flex: 1 1 14rem;
    min-width: 10rem;
}
.inline-add-form .button {
    flex-shrink: 0;
}

/* -- Role color swatch + colored name (level reward roles table) -- */
.role-swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    margin-right: 0.45rem;
    vertical-align: middle;
    border: 1px solid var(--box-border);
}
.role-name {
    vertical-align: middle;
}

/* -- Preset action row (e.g. "Generate preset roles") -- */
.preset-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
}
.preset-row .config-description {
    margin-top: 0;
}

/* Add a touch of breathing room between a table and the add-row below it. */
.config-section .data-table-wrap + .inline-add-form {
    margin-top: 1rem;
}

/* -- Login page discord button (lives here to avoid modifying auth.css) -- */






/* -- Setup banner -- */

.setup-banner {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info-text);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}
.setup-banner.warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

/* -- Tab navigation -- */

.config-tabs {
    display: table;
    gap: 0;
    border-bottom: 1px solid var(--box-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.config-tabs::-webkit-scrollbar {
    display: none;
}
.config-tabs button[role="tab"] {
    background: transparent;
    border: none;
    padding: 0.6rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex: 0 0 auto;
}
.config-tabs button[role="tab"]:hover {
    color: var(--foreground);
}
.config-tabs button[aria-selected="true"] {
    color: var(--branding);
    border-bottom-color: var(--branding);
}

/* -- Unsaved changes banner -- */

.unsaved-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--box);
    border-top: 1px solid var(--branding);
    box-shadow: 0 -4px 24px rgba(0,0,0,.5);
    z-index: 9998;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.unsaved-banner.visible {
    transform: translateY(0);
    opacity: 1;
}
.unsaved-banner-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--branding);
}
.unsaved-banner-actions {
    display: flex;
    gap: 0.5rem;
}

/* -- Toast notifications -- */

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background: var(--box);
    border: 1px solid var(--box-border);
    color: var(--foreground);
    font-size: 0.85rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
}
.toast.visible {
    opacity: 1;
    transform: translateY(0);
}
.toast-success {
    border-left: 3px solid var(--success-text);
}
.toast-error {
    border-left: 3px solid var(--error-text);
}
.toast-warning {
    border-left: 3px solid var(--warning-text);
}
.toast-action {
    margin-left: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 0.35rem;
    border: 1px solid var(--box-border);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.toast-action:hover {
    background: var(--box-border);
}

/* -- Sentinel status -- */

.sentinel-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
}
.sentinel-status.active {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}
.sentinel-status.inactive {
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    color: var(--text-muted);
}

/* -- Sentinel setup callout (floating) -- */

.gk-setup-callout {
    position: relative;
    padding: 1rem 1.25rem;
    margin: 1.5rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, var(--warning-bg) 0%, color-mix(in srgb, var(--warning-bg) 60%, var(--box)) 100%);
    border: 1px solid var(--warning-border);
    box-shadow: 0 0 20px color-mix(in srgb, var(--warning-border) 25%, transparent),
                inset 0 1px 0 color-mix(in srgb, var(--warning-text) 6%, transparent);
    overflow: hidden;
    animation: gk-callout-in 0.4s ease-out;
}
@keyframes gk-callout-in {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to   { opacity: 1; transform: translateY(0); }
}
.gk-setup-callout-pulse {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning-text);
    animation: gk-pulse 2s ease-in-out infinite;
}
@keyframes gk-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning-text) 40%, transparent); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 6px transparent; }
}
.gk-setup-callout-content {
    padding-left: 1.25rem;
}
.gk-setup-callout-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--warning-text);
    margin-bottom: 0.35rem;
}
.gk-setup-callout-content p {
    margin: 0;
    font-size: 0.78rem;
    color: color-mix(in srgb, var(--warning-text) 80%, var(--text));
    line-height: 1.5;
}
.gk-setup-callout-content code {
    font-size: 0.72rem;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    background: color-mix(in srgb, var(--warning-border) 30%, transparent);
}
.gk-setup-link,
.mod-setup-link {
    color: var(--warning-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gk-setup-link:hover,
.mod-setup-link:hover {
    color: var(--text);
}
.gk-setup-callout-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* -- Sentinel disabled toggle state -- */

.config-toggle.gk-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* -- Sentinel required tag -- */

.gk-required-tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1em 0.4em;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--warning-text);
    background: color-mix(in srgb, var(--warning-border) 25%, transparent);
    border: 1px solid var(--warning-border);
    border-radius: 3px;
    vertical-align: middle;
}

/* -- Sentinel info box -- */

.gk-info {
    background: var(--box);
    border: 1px solid var(--box-border);
    border-left: 3px solid var(--branding);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.gk-info p { margin: 0 0 0.5rem; }
.gk-info p:last-child { margin-bottom: 0; }
.gk-info strong { color: var(--branding-bright); font-weight: 600; }
.gk-info-heading {
    color: var(--foreground);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-top: 0.9rem;
    margin-bottom: 0.3rem;
}
.gk-info ul,
.gk-info ol { margin: 0 0 0.7rem; padding-left: 1.3rem; }
.gk-info li { margin-bottom: 0.3rem; }
.gk-info ol { list-style: decimal; }
.gk-info-discord {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.85rem !important;
    padding-top: 0.85rem;
    border-top: 1px solid var(--box-border);
    color: var(--info-text);
    font-size: 0.8rem;
}
.gk-info-icon {
    color: var(--branding);
    font-size: 1.1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

/* -- Moderation: ignore list & lockdown controls -- */

.mod-ignore-add,
.mod-lockdown-add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.mod-ignore-add .config-select { flex: 1 1 220px; }
.mod-ignore-add .config-input { flex: 1 1 180px; }
.mod-lockdown-add .config-select { flex: 1 1 260px; }
.mod-ignore-add .button,
.mod-lockdown-add .button { flex-shrink: 0; align-self: flex-start; }

/* Multi-select needs to override the global `select { height: 2rem }` so all
   rows are visible, and gets a modern padded/rounded option list. */
.mod-lockdown-add select[multiple] {
    height: auto;
    min-height: 170px;
    max-height: 260px;
    padding: 0.35rem;
    overflow-y: auto;
    scrollbar-width: thin;
}
.mod-lockdown-add select[multiple] option {
    padding: 0.4rem 0.6rem;
    margin-bottom: 2px;
    border-radius: 0.375rem;
    font-size: 0.82rem;
    color: var(--foreground);
    cursor: pointer;
    transition: background 0.12s;
}
.mod-lockdown-add select[multiple] option:hover {
    background: var(--box-shade);
}
.mod-lockdown-add select[multiple] option:checked {
    background: var(--branding) linear-gradient(0deg, var(--branding), var(--branding));
    color: #fff;
    font-weight: 600;
}

/* On mobile, tapping the multi-select opens the OS picker overlay, so the tall
   inline 6-row box is wasted space. Collapse it to a normal-height control and
   let it size to the row instead of forcing a wide min-basis. */
@media (max-width: 768px) {
    .mod-lockdown-add select[multiple] {
        min-height: 0;
        max-height: none;
        height: 2.5rem;
    }
    .mod-lockdown-add .config-select {
        flex: 1 1 auto;
    }
}

/* -- Sortable table headers (table.sortable via table-sort.js) -- */

th.th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.12s;
}
th.th-sortable::after {
    content: "\2195"; /* ↕ */
    margin-left: 0.35rem;
    font-size: 0.72em;
    opacity: 0.35;
    vertical-align: middle;
}
th.th-sortable:hover {
    color: var(--foreground);
}
th.th-sortable[aria-sort="ascending"]::after {
    content: "\2191"; /* ↑ */
    opacity: 1;
    color: var(--branding);
}
th.th-sortable[aria-sort="descending"]::after {
    content: "\2193"; /* ↓ */
    opacity: 1;
    color: var(--branding);
}

/* -- Sentinel message status -- */

.gk-message-status {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.3em 0.6em;
    border-radius: 4px;
}
.gk-message-status.sent {
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}
.gk-message-status.not-sent {
    color: var(--text-muted);
    background: var(--box-shade);
    border: 1px solid var(--box-border);
}

/* -- Members page -- */

.members-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.members-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}

.members-table-wrap {
    overflow-x: auto;
    border-radius: 0.625rem;
    border: 1px solid var(--box-border);
    background: var(--box);
    width: 100%;
}

.members-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.members-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: 1px solid var(--box-border);
    background: var(--box-shade);
    white-space: nowrap;
}
/* Column 1 is the select checkbox (sized by .col-check); the rest follow. */
.members-table th:nth-child(2) { width: 25%; }  /* Member */
.members-table th:nth-child(3) { width: 15%; }  /* Joined */
.members-table th:nth-child(4) { width: auto; } /* Roles */
.members-table th:nth-child(5) { width: 14%; }  /* Actions */

.members-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--box-border);
    vertical-align: middle;
}
.members-table tr:last-child td {
    border-bottom: none;
}
.members-table tbody tr {
    transition: background 0.1s;
}
.members-table tbody tr:hover {
    background: var(--box-shade);
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}
.member-cell:hover .member-name {
    text-decoration: underline;
}
.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}
.member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.member-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-username {
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    overflow: hidden;
    max-height: 3.2rem;
}
.member-actions {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
    justify-content: flex-end;
}
.member-joined {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 9999px;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--foreground);
    white-space: nowrap;
}

.members-pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* -- Modal -- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-overlay[hidden] {
    display: none;
}
.modal-card {
    background: var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.625rem;
    padding: 1.5rem;
    max-width: 560px;
    width: 92%;
    /* Cap height so tall modals (e.g. create poll) scroll instead of
       overflowing the viewport and getting clipped top and bottom. */
    max-height: 90vh;
    overflow-y: auto;
}
.modal-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}
.modal-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* -- Segmented control (compact inline radio toggle) -- */
.segmented {
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.2rem;
    background: var(--box-2, rgba(255,255,255,.03));
    border: 1px solid var(--box-border);
    border-radius: 0.5rem;
}
/* The faint-white fallback above is invisible on a light background, so the
   track disappears. Give it a real subtle surface in light mode (dark mode
   keeps its original tint). */
[data-theme="light"] .segmented {
    background: var(--box-shade);
}
.segmented input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.segmented label {
    margin: 0;
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 0.28rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--text-muted);
    transition: background .15s ease, color .15s ease;
    user-select: none;
}
.segmented label:hover {
    color: var(--text);
}
.segmented input[type="radio"]:checked + label {
    background: var(--branding);
    color: #fff;
}
.segmented input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--branding);
    outline-offset: 1px;
}

/* -- Badge -- */

.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    border-radius: 0.25rem;
    background: var(--branding-dim);
    color: var(--branding);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none;
}
/* Semantic badge tints (fall back to the branding base when unstyled). */
.badge-muted { background: var(--box-shade); color: var(--text-muted); }
.badge-info { background: rgba(88, 101, 242, 0.18); color: #8b93f8; }
.badge-success { background: rgba(67, 181, 129, 0.18); color: #57d99a; }
.rarity-common { background: rgba(154, 160, 166, 0.18); color: #9aa0a6; text-transform: capitalize; }
.rarity-uncommon { background: rgba(87, 242, 135, 0.15); color: #57f287; text-transform: capitalize; }
.rarity-rare { background: rgba(59, 130, 246, 0.18); color: #6ea0f8; text-transform: capitalize; }
.rarity-epic { background: rgba(168, 85, 247, 0.18); color: #c08af9; text-transform: capitalize; }
.rarity-legendary { background: rgba(245, 158, 11, 0.18); color: #f5ae2d; text-transform: capitalize; }
.badge-danger { background: rgba(240, 71, 71, 0.18); color: #f87171; }

/* -- Comic feed cards -- */

.comic-feeds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.comic-feed-card {
    --brand-a: #4b4b52;
    --brand-b: #2b2b30;
    --brand-glow: rgba(217, 119, 87, 0.35);
    background: var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.85rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.comic-feed-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--brand-a) 60%, transparent);
    box-shadow: 0 10px 26px -12px var(--brand-glow);
}

/* Brand-themed banner with logo */
.comic-feed-banner {
    position: relative;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand-a) 85%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, var(--brand-a) 0%, var(--brand-b) 100%);
    overflow: hidden;
}
.comic-feed-banner::after {
    /* subtle diagonal sheen */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 60%, rgba(255, 255, 255, 0.08) 75%, transparent 85%);
    pointer-events: none;
}
.comic-feed-logo {
    max-height: 58px;
    max-width: 78%;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
    z-index: 1;
}
.comic-feed-format-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 1;
    padding: 0.18rem 0.5rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

/* Per-brand palettes */
.comic-feed-card.brand-marvel { --brand-a: #ed1d24; --brand-b: #7a0c10; --brand-glow: rgba(237, 29, 36, 0.4); }
.comic-feed-card.brand-dc     { --brand-a: #0476f2; --brand-b: #042f73; --brand-glow: rgba(4, 118, 242, 0.4); }
.comic-feed-card.brand-manga  { --brand-a: #f5821f; --brand-b: #7d2b9e; --brand-glow: rgba(245, 130, 31, 0.4); }

.comic-feed-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 1.15rem 0.85rem;
}
.comic-feed-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}
.comic-feed-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.comic-feed-value {
    color: var(--foreground);
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comic-feed-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0 1.15rem 1.1rem;
    margin-top: auto;
}

/* -- Metric tiles -- */

.metric-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metric-tile {
    position: relative;
    background: var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.7rem;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
/* A coral accent line along the top edge, revealed on hover. */
.metric-tile::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--branding), transparent);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.metric-tile:hover {
    border-color: color-mix(in srgb, var(--branding) 45%, var(--box-border));
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--branding) 65%, transparent);
}
.metric-tile:hover::before { opacity: 1; }

.tile-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.tile-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-value time {
    font-size: 0.82rem;
    font-weight: 500;
}

.tile-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* -- Data tables (generic) -- */

.data-table-wrap {
    overflow-x: auto;
    border-radius: 0.625rem;
    border: 1px solid var(--box-border);
    background: var(--box);
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    border-bottom: 1px solid var(--box-border);
    background: var(--box-shade);
}
.data-table td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr {
    transition: background 0.1s;
}
.data-table tbody tr:hover {
    background: var(--box-shade);
}
.data-table .numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.data-table td.col-actions {
    display: flex;
    text-align: right;
    white-space: nowrap;
    gap: 0.35rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
    align-items: center;
}

/* Right-align action buttons in any row cell, even those not tagged
   .col-actions (e.g. economy, temp-channels, highlights). Matches only
   .button (real actions) so status toggles keep their place. Kept as a
   separate rule so a browser without :has() support only drops this, not
   the .col-actions rule above. */
.data-table tbody td:has(> .button) {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    text-align: right;
}

/* -- Data table: responsive card layout on mobile -- */
@media (max-width: 768px) {
    .data-table thead { display: none; }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td { display: block; }
    .data-table tbody tr {
        padding: 0.6rem 0.75rem;
        border-bottom: 1px solid var(--box-border);
    }
    .data-table tbody tr:last-child { border-bottom: none; }
    .data-table td {
        padding: 0.2rem 0;
        text-align: left;
    }
    .data-table td[data-label]::before {
        content: attr(data-label) ":\00a0";
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    .data-table td.col-actions,
    .data-table tbody td:has(> .button) {
        display: flex;
        justify-content: center;
        padding-top: 0.4rem;
    }
    .data-table .numeric { text-align: left; }
    .data-table .empty-row td { padding: 0.6rem 0; }
    .data-table .empty-row td::before { display: none; }
    .data-table .temp-active-row td { padding: 0.4rem 0; }
    .data-table .tags-check-col { display: none; }
}

/* -- Status pills -- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pill.active, .pill.running, .pill.up {
    color: var(--success-text);
    background: var(--success-bg);
}
.pill.ended, .pill.stopped, .pill.down {
    color: var(--error-text);
    background: var(--error-bg);
}
.pill.pending, .pill.unknown {
    color: var(--text-muted);
    background: var(--box-shade);
}
.pill.dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

/* -- Empty states -- */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.empty-state h3 {
    font-size: 1rem;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

/* -- Command management -- */

.command-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.command-card {
    background: var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.command-card.disabled {
    opacity: 0.5;
}
.command-name {
    font-weight: 500;
    font-size: 0.85rem;
}
.command-category {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* -- Chart panels -- */




/* -- Leaderboard -- */




.leaderboard-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2rem;
    text-align: center;
}
.leaderboard-rank.gold { color: #fbbf24; }
.leaderboard-rank.silver { color: #94a3b8; }
.leaderboard-rank.bronze { color: #d97706; }





/* -- Utility -- */

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}



.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.section-header h2 {
    font-weight: 600;
    margin: 0;
}

/* -- XP over-time chart -- */

.xp-chart {
    position: relative;
    min-height: 240px;
    width: 100%;
}
.xp-chart .chart-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.xp-chart .u-wrap {
    border-radius: 0.375rem;
}
.xp-chart .u-legend {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.4rem 0 0;
}
.xp-chart .u-legend .u-series th {
    font-weight: 600;
    color: var(--foreground);
}

/* -- User lookup profile -- */

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 0.625rem;
    background: var(--box);
    border: 1px solid var(--box-border);
    margin-bottom: 1.5rem;
}
.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--box-border);
}
.user-profile-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.user-profile-info .user-username {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.user-profile-info .user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.user-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}
.user-not-in-guild {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--warning-text);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.case-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.case-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--box-border);
}
.case-entry:last-child {
    border-bottom: none;
}
.case-index {
    min-width: 2.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    padding-top: 0.15rem;
}
.case-body {
    flex: 1;
    min-width: 0;
}
.case-action {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: capitalize;
}
.case-action.warn { color: var(--warning-text); }
.case-action.ban, .case-action.tempban, .case-action.softban, .case-action.kick { color: var(--error-text); }
.case-action.mute, .case-action.tempmute, .case-action.timeout { color: var(--info-text, #60a5fa); }
.case-action.unban, .case-action.unmute { color: var(--success-text); }
.case-reason {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.case-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.case-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    align-items: center;
}
.case-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    font: inherit;
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}
.case-actions button:hover { color: var(--foreground); }
.case-actions .case-delete:hover { color: var(--error-text); }
.case-actions button:disabled { opacity: 0.5; cursor: default; }
.case-edit-form {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}
.case-edit-input {
    flex: 1;
    min-width: 160px;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    background: var(--form-input-background);
    border: 1px solid var(--form-input-border);
    border-radius: 0.375rem;
    color: var(--foreground);
}

.badge-status {
    font-size: 0.65rem;
    text-transform: capitalize;
}
.badge-online { background: #43b581; color: #fff; }
.badge-idle { background: #fba31c; color: #1a1a1a; }
.badge-dnd { background: #f04747; color: #fff; }
.badge-offline { background: #747f8d; color: #fff; }
.badge-flag {
    font-size: 0.6rem;
    text-transform: capitalize;
    background: var(--box-border);
    color: var(--foreground);
}

.tile-sub {
    font-size: 0.7em;
    color: var(--text-muted);
    font-weight: 400;
}
.tile-value-small {
    font-size: 0.75rem;
    word-break: break-all;
}

.user-top-commands {
    margin-top: 0.75rem;
}
.user-top-commands h3 {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.top-commands-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.top-commands-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--box-border);
    font-size: 0.8rem;
}
.top-commands-list li:last-child {
    border-bottom: none;
}
.cmd-name {
    font-weight: 500;
    color: var(--foreground);
    font-family: inherit;
}
.cmd-uses {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.name-history-group {
    margin-bottom: 1rem;
}
.name-history-group h3 {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.name-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.name-history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--box-border);
    font-size: 0.8rem;
}
.name-history-list li:last-child {
    border-bottom: none;
}
.name-value {
    font-weight: 500;
    font-family: inherit;
}
.name-date {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.section-count {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.5rem;
}
.avatar-grid-loading {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.avatar-history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.avatar-history-item img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--box-border);
}
.avatar-date {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 1rem;
    }
    .metric-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .members-table {
        min-width: 600px;
    }
    .command-grid {
        grid-template-columns: 1fr;
    }
    .user-profile-header {
        flex-direction: column;
        text-align: center;
    }
    .user-profile-info .user-meta {
        justify-content: center;
    }
}

/* ─── Audit Log Flags ─────────────────────────────────────── */
.audit-flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.audit-flag-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--box-border);
    background: var(--box-shade);
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}
.audit-flag-item:hover {
    border-color: var(--branding, #d97757);
}
.audit-flag-item input[type="checkbox"] {
    accent-color: var(--branding, #d97757);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.audit-flag-item input[type="checkbox"]:checked + span {
    color: var(--foreground, #eee);
}
.audit-flag-item span {
    color: var(--text-muted, #888);
}

/* ===========================================================================
   Shared dashboard primitives
   Recurring rules lifted out of per-page <style> blocks and inline styles so
   every page can share them. Page-specific styling lives in pages/<page>.css.
   =========================================================================== */

/* -- Shared animations (used by music, audit-log, stats, …) -- */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -- Spacing utilities (replace one-off inline margins) -- */
.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: 0.5rem; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1rem; }
.mt-xs { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.ml-auto { margin-left: auto; }

/* -- Small layout helpers -- */
.m-0 { margin: 0; }

.nowrap { white-space: nowrap; }
.inline-block { display: inline-block; }
.d-block { display: block; }
.resize-v { resize: vertical; }
.fs-xs { font-size: 0.75rem; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-col-full { grid-column: 1 / -1; }
/* Truncate overflowing cell text with an ellipsis (pair with a title attr). */
.truncate-cell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Search box sizing (members/commands directories). */
.search-input { max-width: 320px; }

/* -- Status text colours (shared by stat tiles, labels, …) -- */
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-error { color: var(--error-text); }

/* -- Modal form body: consistent spacing for stacked form controls.
      Replaces the per-input inline margins the CRUD modals used to carry. -- */
.modal-form { margin-top: 1rem; }
.modal-form .config-input,
.modal-form .config-select,
.modal-form textarea { margin-bottom: 0.75rem; }
.modal-form .config-toggle { margin-bottom: 0; }
.modal-form > :last-child { margin-bottom: 0; }

/* -- Modal width modifiers (compose with .modal-card) -- */
.modal-card.w-sm { max-width: 400px; }
.modal-card.w-md { max-width: 560px; }
.modal-card.w-lg { max-width: 680px; }
.modal-card.w-xl { max-width: 760px; }

/* -- Compact form inputs (shared by filter/inline forms) -- */


/* -- Custom Bot Profile — Discord-style card editor + crop modal -- */
.cb-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 820px) {
    .cb-layout { grid-template-columns: 1fr; }
}

/* Card — Discord profile style */
.cb-card {
    border-radius: 8px;
    overflow: hidden;
    background: #111214;
    border: none;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,0.4);
}

/* Banner — Discord ratio 17:6 ≈ 35.3% padding */
.cb-banner-area {
    aspect-ratio: 17 / 6;
    background: var(--cb-accent, var(--branding));
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.cb-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cb-banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cb-accent, var(--branding)) 0%, color-mix(in srgb, var(--cb-accent, var(--branding)) 60%, #000) 100%);
}
.cb-banner-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.45);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.cb-banner-area:hover .cb-banner-btn { opacity: 0.7; }

/* Body */
.cb-body {
    padding: 12px 16px 0;
    position: relative;
}

/* Avatar */
.cb-avatar-area {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 6px solid #111214;
    margin-top: -48px;
    overflow: hidden;
    background: #2b2d31;
    cursor: pointer;
    position: relative;
    display: inline-block;
}
.cb-avatar-area:hover .cb-avatar-overlay { opacity: 1; }
.cb-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.cb-avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    background: var(--branding);
    border-radius: 50%;
}
.cb-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 50%;
}
.cb-avatar-overlay svg { color: #fff; }

/* Profile info */
.cb-profile-info {
    background: #1e1f22;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 16px;
}
.cb-username-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cb-username {
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    border: none;
    color: #f2f3f5;
    padding: 1px 4px;
    border-radius: 3px;
    width: 100%;
    max-width: 200px;
    outline: none;
    transition: background 0.12s;
}
.cb-username:hover { background: #2b2d31; }
.cb-username:focus { background: #2b2d31; outline: 1px solid rgba(217,119,87,0.5); outline-offset: -1px; }
.cb-bot-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    background: var(--branding);
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.cb-bot-badge svg { fill: #fff; }
.cb-section-divider {
    height: 1px;
    background: #2b2d31;
    margin: 10px 0;
}
.cb-about-section {}
.cb-section-title {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #b5bac1;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.cb-about-textarea {
    display: block;
    width: 100%;
    font-size: 0.82rem;
    font-family: inherit;
    color: #dbdee1;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    resize: none;
    outline: none;
    line-height: 1.4;
    transition: background 0.12s;
}
.cb-about-textarea:hover { background: #2b2d31; }
.cb-about-textarea:focus { background: #2b2d31; outline: 1px solid rgba(217,119,87,0.5); outline-offset: -1px; }
.cb-about-textarea::placeholder { color: #6d6f78; }
.cb-charcount {
    display: block;
    text-align: right;
    font-size: 0.62rem;
    color: #6d6f78;
    margin-top: 4px;
}

/* Actions bar */
.cb-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: #111214;
}
.cb-reset-btn {
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    transition: background 0.12s, opacity 0.12s;
    background: transparent;
    color: #b5bac1;
}
.cb-reset-btn:hover { color: #fff; text-decoration: underline; }
.cb-reset-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Sidebar tips */
.cb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.cb-tip-card {
    border: 1px solid var(--box-border);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--box-shade);
}
.cb-tip-card h4 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--branding);
    margin: 0 0 8px;
}
.cb-tip-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cb-tip-card li {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.cb-tip-card li strong {
    color: var(--foreground);
}

/* -- Crop Modal (Discord-style, Cropper.js) -- */
.cb-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.cb-crop-modal[hidden] { display: none; }
.cb-crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
}
.cb-crop-dialog {
    position: relative;
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 920px;
    max-height: 100%;
    overflow: hidden;
}

/* Header */
.cb-crop-header {
    position: relative;
    text-align: center;
    padding: 16px 24px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cb-crop-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    font-weight: 600;
    color: #f2f3f5;
    margin: 0;
}
.cb-crop-text-btn {
    background: none;
    border: none;
    color: #b5bac1;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.1s;
}
.cb-crop-text-btn:hover { color: #fff; }
.cb-crop-close-btn {
    background: none;
    border: none;
    color: #b5bac1;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: color 0.1s, background 0.1s;
}
.cb-crop-close-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Content area */
.cb-crop-content {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 640px;
    max-height: calc(100vh - 200px);
}
.cb-crop-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: #111214;
}
.cb-crop-container img {
    display: block;
    max-width: 100%;
}

/* Floating zoom controls overlay */
.cb-crop-controls {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: 80%;
    max-width: 360px;
    background: rgba(30,31,34,0.85);
    backdrop-filter: blur(10px);
    border: 1px solid #3f4147;
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 2;
}
.cb-crop-zoom {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #80848e;
}
.cb-crop-zoom input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #3f4147;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}
.cb-crop-zoom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.cb-crop-zoom input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Footer */
.cb-crop-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: #232428;
}
.cb-crop-footer-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.cb-crop-btn-secondary, .cb-crop-btn-primary {
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    transition: background 0.12s;
}
.cb-crop-btn-secondary {
    background: #4e5058;
    color: #fff;
}
.cb-crop-btn-secondary:hover { background: #6d6f78; }
.cb-crop-btn-primary {
    background: var(--branding);
    color: #fff;
}
.cb-crop-btn-primary:hover { background: var(--branding-bright); }

/* Cropper.js overrides */
.cb-crop-container .cropper-view-box {
    outline: 3px solid #fff;
}
.cb-crop-container .cropper-face {
    background: transparent;
}
.cb-crop-container .cropper-modal {
    background: rgba(0,0,0,0.55);
}
.cb-crop-container .cropper-line {
    background-color: rgba(255,255,255,0.8);
    height: 2px;
    width: 2px;
}
.cb-crop-container .cropper-dashed {
    border-color: rgba(255,255,255,0.7);
    border-width: 2px;
    border-style: solid;
}
.cb-crop-container .cropper-point {
    background-color: #fff;
    width: 10px;
    height: 10px;
    opacity: 1;
}

/* -- Version badge -- */

.percy-version-badge {
    font-size: 0.65em;
    font-weight: 500;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    background: var(--branding-dim);
    color: var(--branding);
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* Temp channels — live spawned-channel chips shown under each hub row. */
.temp-active-row > td { padding-top: 0; border-top: none; }
.temp-active-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.1rem 0 0.4rem;
}
.temp-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    font-size: 0.72rem;
}
.temp-active-icon { opacity: 0.8; font-size: 0.7rem; }
.temp-active-name { color: var(--foreground); }
.temp-active-count {
    min-width: 1.1rem;
    text-align: center;
    padding: 0 0.35rem;
    border-radius: 9999px;
    background: var(--branding-dim);
    color: var(--branding);
    font-weight: 600;
}

/* Giveaways — duration amount + unit pair. */
.gw-duration-row { display: flex; gap: 0.5rem; }
.gw-duration-row .config-input { flex: 1; }
.gw-duration-row .config-select { flex: 0 0 7rem; }

/* Tags — toolbar, selection column, search. */
.tags-toolbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tags-search { margin-bottom: 1rem; max-width: 22rem; }
.tags-check-col { width: 2rem; text-align: center; }
.tags-check-col input { cursor: pointer; }
.tag-preview-meta { color: var(--text-muted); font-size: 0.75rem; margin: -0.4rem 0 0.75rem; }
.import-fail-list { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.8rem; color: var(--text-muted); }
.import-fail-list code { color: var(--foreground); }

/* Owned-tag chips on user profile pages. */
.user-tags-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.user-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    background: var(--box-shade);
    border: 1px solid var(--box-border);
    font-size: 0.78rem;
    text-decoration: none;
    color: var(--foreground);
}
a.user-tag-chip:hover { border-color: var(--branding); }
.user-tag-uses {
    min-width: 1.1rem;
    text-align: center;
    padding: 0 0.35rem;
    border-radius: 9999px;
    background: var(--branding-dim);
    color: var(--branding);
    font-weight: 600;
    font-size: 0.72rem;
}

/* AI tab — per-channel override summary badges. */
.ai-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    margin: 0.1rem 0.15rem 0.1rem 0;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.ai-badge-on {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.ai-badge-off {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

/* ─── Setup status (guild config page) ───────────────────────────── */
.health-card > summary { cursor: pointer; list-style: none; }
.health-card > summary::-webkit-details-marker { display: none; }
.health-card > summary h2 { margin: 0; }
.health-card > summary h2::before { content: "▸"; color: var(--text-muted); font-size: 0.9em; transition: transform 0.15s; }
.health-card[open] > summary h2::before { transform: rotate(90deg); }
.health-card[open] > summary { margin-bottom: 0.5rem; }
.health-card h2 { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.health-count { font-size: 0.75rem; font-weight: 600; padding: 0.15em 0.6em; border-radius: 999px;
    color: var(--warning-text, #fbbf24); background: var(--warning-bg, rgba(251,191,36,0.1)); }
.health-count.ok { color: var(--success-text, #4ade80); background: var(--success-bg, rgba(74,222,128,0.1)); }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.health-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0.8rem;
    border: 1px solid var(--box-border); border-radius: 8px; }
.health-item .button { margin-left: auto; flex-shrink: 0; }
.health-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-top: 0.4rem; flex-shrink: 0; background: var(--text-muted); }
.health-ok .health-dot { background: var(--success-text, #4ade80); }
.health-attention { border-color: var(--warning-border, rgba(251,191,36,0.35)); }
.health-attention .health-dot { background: var(--warning-text, #fbbf24); }
.health-body { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.health-label { font-weight: 600; }
.health-state { font-size: 0.78rem; color: var(--text-muted); }
.health-problems { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; overflow-wrap: anywhere; }
.health-off { margin-top: 0.75rem; }
.health-off summary { cursor: pointer; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }

/* ─── Message templates: placeholder chips, preview, test send ─────── */
.template-vars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.template-var { display: inline-flex; align-items: center; width: auto; min-width: 0; height: 24px; padding: 2px 8px; font: 12px var(--font-mono, monospace);
    border-radius: 4px; border: 1px solid var(--box-border); background: var(--box-shade); color: var(--foreground); cursor: pointer; white-space: nowrap; }
.template-var:hover, .template-var:focus-visible { border-color: var(--branding); }
/* Discord-style message preview (.dc-*), matching Discord's dark theme */
.dc-message { display: grid; grid-template-columns: 40px 1fr; column-gap: 16px; margin-top: 0.6rem; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-1); color: var(--text);
    font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.375; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; align-self: start; }
.dc-body { min-width: 0; }
.dc-header { display: flex; align-items: baseline; gap: 4px; }
.dc-name { color: var(--text); font-size: 16px; font-weight: 500; }
.dc-bot-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 0 4px; border-radius: 3px; align-self: center; line-height: 15px; }
.dc-time { color: var(--text-faint); font-size: 12px; margin-left: 4px; }
.dc-content { overflow-wrap: anywhere; max-height: 50vh; overflow-y: auto; }
.dc-content code { background: var(--surface-3); border-radius: 3px; padding: 0.2em; font-family: Consolas, "Andale Mono", monospace; font-size: 85%; }
.dc-pre { background: var(--surface-3); border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin: 4px 0 0; white-space: pre-wrap; }
.dc-pre code { padding: 0; font-size: 0.875rem; }
.dc-h { font-weight: 700; margin: 8px 0 0; }



.dc-sub { font-size: 13px; color: var(--text-faint); }
.dc-list { margin: 0 0 0 16px; padding: 0; list-style: disc; }
ol.dc-list { list-style: decimal; }
.dc-list .dc-list { margin-left: 16px; list-style: circle; }
.dc-quote { margin: 0; padding: 0 8px 0 12px; position: relative; }
.dc-quote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: var(--line); }
.dc-content a.dc-link { color: #00a8fc; text-decoration: none; }
.dc-content a.dc-link:hover { color: #00a8fc; text-decoration: underline; }
.dc-mention { background: rgba(88, 101, 242, 0.25); color: color-mix(in srgb, #5865f2 70%, var(--text)); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-timestamp { background: var(--surface-3); border-radius: 3px; padding: 0 2px; }
.dc-emoji { width: 1.375em; height: 1.375em; vertical-align: bottom; }
.dc-spoiler { background: var(--surface-3); color: transparent; border-radius: 3px; cursor: pointer; }
.dc-embeds { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 6px; }
.dc-embeds a { display: block; max-width: 100%; }
.dc-media { display: block; max-width: min(100%, 520px); max-height: 360px; border-radius: 8px; background: var(--surface-3); }
/* Tag preview: wide by default, drag the corner to resize on desktop. */
#tag-modal .modal-card { width: min(860px, 94vw); max-width: 94vw; min-width: min(360px, 94vw); resize: horizontal; }
#tag-modal .dc-content { max-height: 65vh; }
.dc-spoiler--open { background: rgba(255, 255, 255, 0.1); color: inherit; }
.template-actions { margin-top: 0.6rem; display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

.picker-warning { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--warning-text, #fbbf24); }
.picker-filter { margin-bottom: 0.35rem; }

/* Pill picker: what pickers.js turns every select[multiple] into. */
.multi-picker { position: relative; min-width: 0; }
.mod-lockdown-add .multi-picker { flex: 1 1 260px; }
.multi-picker-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    min-height: 40px; padding: 5px 8px; cursor: text;
    border: 1px solid var(--line); border-radius: var(--radius-md, 10px); background: var(--surface-1);
    transition: border-color var(--dur-base, .15s), box-shadow var(--dur-base, .15s);
}
.multi-picker-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.multi-pill {
    display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
    padding: 2px 2px 2px 10px; border-radius: var(--radius-pill, 999px);
    background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); color: var(--text);
    font-size: 13px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere;
}
.multi-pill-remove {
    display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--text-muted);
    font-size: 16px; line-height: 1; cursor: pointer;
}
.multi-pill-remove:hover { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
.multi-pill-remove:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.multi-picker-input {
    flex: 1 1 120px; min-width: 80px; height: 28px; padding: 0 4px;
    border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px;
}
.multi-picker-list {
    position: absolute; z-index: 30; inset: calc(100% + 4px) 0 auto 0;
    max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 4px; list-style: none;
    border: 1px solid var(--line); border-radius: var(--radius-md, 10px);
    background: var(--surface-1); box-shadow: var(--shadow-pop);
}
.multi-picker-option { padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.multi-picker-option:hover, .multi-picker-option.active { background: var(--surface-3); }
.multi-picker-empty { padding: 8px 10px; color: var(--text-faint); }
@media (max-width: 640px) {
    /* 16px stops iOS zooming into the field; bigger targets for thumbs. */
    .multi-picker-input { font-size: 16px; height: 34px; }
    .multi-pill { font-size: 14px; padding-block: 3px; }
    .multi-pill-remove { width: 28px; height: 28px; }
    .multi-picker-option { padding: 12px; }
    .multi-picker-list { max-height: min(50vh, 320px); }
}

/* ─── Quick setup panels ─────────────────────────────────────────── */
.quick-setup { border-color: var(--branding-dim, rgba(255,123,114,0.3)); }
div.quick-setup { border: 1px solid var(--branding-dim, rgba(255,123,114,0.3)); border-radius: 8px; padding: 1rem; margin: 1rem 0 1.5rem; }
.quick-setup-step { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.4rem; }
.quick-setup-step legend { font-weight: 600; margin-bottom: 0.4rem; }
.quick-check { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; cursor: pointer; padding: 0.55rem 0.75rem;
    border: 1px solid var(--box-border); border-radius: 8px; background: var(--box-shade); }
.quick-check:hover, .quick-check:has(input:checked) { border-color: var(--branding); }
.quick-check .quick-title { font-weight: 600; }
.quick-check .config-description { font-size: 0.78rem; flex-basis: 100%; padding-left: 1.6rem; }
.quick-grid { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.quick-grid legend { grid-column: 1 / -1; }
.quick-setup-step select { width: 100%; }
.quick-setup-actions { display: flex; gap: 0.75rem; }

/* ─── Role menus ─────────────────────────────────────────────────── */
.rm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.rm-id { font-size: 0.8rem; font-weight: 400; }
.rm-add { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.rm-add .config-select, .rm-add .config-input { flex: 1 1 160px; min-width: 0; }
.rm-inline-warn { display: block; }
.role-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: middle; }

/* -- Landing page sections (templates/site/landing.html) -- */

.home section { margin-bottom: 3.5rem; }
.home h2 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 800; }

.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    background: var(--box);
    border: 1px solid var(--box-border);
    border-radius: 0.8rem;
    text-align: center;
}
.home-stats strong { display: block; font-size: 1.6rem; color: var(--branding); }
.home-stats span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.home-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 2rem;
    align-items: center;
}
.home-row-flip .home-copy { order: 2; }
.home-copy p { color: var(--text-muted); line-height: 1.6; margin: 0 0 0.75rem; }
.home-copy ul { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.6; font-size: 0.92rem; }
.home-more { color: var(--branding); font-weight: 600; text-decoration: none; }
.home-more:hover { text-decoration: underline; }
.home-tag {
    font-size: 0.7rem; font-weight: 600; vertical-align: middle; padding: 0.15rem 0.55rem;
    border-radius: 999px; background: var(--branding-dim); color: var(--branding);
    text-transform: uppercase; letter-spacing: 0.06em;
}

.home-media-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.home-media-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.home-shot { display: block; width: auto; max-width: 100%; height: auto; margin-inline: auto; border-radius: 0.6rem; border: 1px solid var(--box-border); }
.home-shot-ph {
    display: flex; width: 100%; align-items: center; justify-content: center;
    background: var(--box); color: var(--text-muted); font-size: 0.8rem;
}

.home-wide { text-align: center; }
.home-wide p { color: var(--text-muted); margin: 0 0 1.25rem; }

.home-steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.home-steps li {
    counter-increment: step; padding: 1.2rem; background: var(--box);
    border: 1px solid var(--box-border); border-radius: 0.8rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-muted);
}
.home-steps li::before { content: counter(step); display: block; font-size: 1.6rem; font-weight: 800; color: var(--branding); }
.home-steps li strong { color: var(--foreground); }

.home-module-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.home-module {
    display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 1rem; text-decoration: none;
    color: var(--foreground); background: var(--box); border: 1px solid var(--box-border); border-radius: 0.7rem;
}
.home-module:hover { border-color: var(--branding); }
.home-module span { font-size: 0.8rem; color: var(--text-muted); }

.home-final { text-align: center; }

@media (max-width: 760px) {
    .home-row { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .home-row-flip .home-copy { order: 0; }
}

/* Side-by-side shots of different sizes sit centred against each other instead of top-left. */
.home-media-grid { align-items: center; justify-items: center; }
img.home-shot { cursor: zoom-in; }
img.home-shot:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 3px; }

/* Click-to-zoom (static/js/site/zoom.js): only opacity/transform animate, so it stays smooth. */
.home-zoom {
    padding: 0; border: 0; background: transparent; max-width: none; max-height: none;
    overflow: visible; cursor: zoom-out;
}
.home-zoom::backdrop { background: rgb(0 0 0 / 0.78); }
.home-zoom img {
    display: block; height: auto; max-width: 94vw; max-height: 90vh; object-fit: contain;
    border-radius: 0.6rem; box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.5);
    opacity: 0; transform: scale(0.92); transition: opacity 0.16s ease, transform 0.16s ease;
    will-change: transform, opacity;
}
.home-zoom.open img { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .home-zoom img { transition: none; } }
