:root {
  --bg: #111318;
  --bg-raised: #1a1d24;
  --bg-input: #0d0f13;
  --border: #2a2e38;
  --text: #e6e8ee;
  --muted: #9097a6;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #3ba55d;
  --danger: #e5484d;
  --warning: #f0b232;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: #8ea1ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
code { background: var(--bg-input); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.block { display: block; }
[hidden] { display: none !important; }

/* Layout */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg-raised); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand-mark { color: var(--accent); }
.topbar-user { display: flex; align-items: center; gap: 0.6rem; }
.topbar-user form { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; }
.shell { display: block; max-width: 1200px; margin: 0 auto; }
.shell.with-sidebar { display: grid; grid-template-columns: 250px 1fr; max-width: 1400px; }
.content { padding: 1.5rem; min-width: 0; }
.sidebar { border-right: 1px solid var(--border); padding: 1rem 0.75rem; min-height: calc(100vh - 57px); position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow-y: auto; }
.sidebar-guild { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; margin-bottom: 0.75rem; color: var(--text); }
.sidebar-guild img { width: 36px; height: 36px; border-radius: 50%; }
.nav-link { display: flex; gap: 0.6rem; padding: 0.45rem 0.6rem; border-radius: 6px; color: var(--muted); font-size: 0.93rem; }
.nav-link:hover { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--bg-raised); color: var(--text); font-weight: 600; }
.nav-back { margin-top: 1rem; border-top: 1px solid var(--border); border-radius: 0; padding-top: 0.9rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.actions { display: flex; gap: 0.5rem; }

/* Components */
.card { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card.empty { text-align: center; color: var(--muted); padding: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 1px solid transparent; border-radius: 6px; padding: 0.55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; color: #fff; background: var(--border); text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); filter: none; }
.btn-secondary { background: #3a3f4b; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: transparent; border-color: #5c2a2c; color: #ff8a8d; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1.05rem; }
.badge { display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: #2a2e38; color: var(--muted); font-weight: 600; white-space: nowrap; }
.badge.on { background: rgba(59, 165, 93, 0.18); color: #6ddb8f; }
.badge.live { background: rgba(229, 72, 77, 0.2); color: #ff7b7f; }
.badge.vip { background: rgba(0, 176, 244, 0.18); color: #6fd3ff; }
.badge.music { background: rgba(245, 197, 66, 0.15); color: #f7d774; }
.tier-mark { font-size: 0.9em; }
.gold-gem { color: #f5c542; text-shadow: 0 0 6px rgba(245, 197, 66, 0.75), 0 0 1px #fff3c4; font-style: normal; }
.tag { font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 4px; background: #2a2e38; font-weight: 600; white-space: nowrap; }
.tag-p-twitch { background: rgba(145, 70, 255, 0.25); color: #c4a1ff; }
.tag-p-youtube { background: rgba(255, 0, 0, 0.2); color: #ff8a8a; }
.tag-p-kick { background: rgba(83, 252, 24, 0.15); color: #8ff56b; }
.tag-ban { background: rgba(229, 72, 77, 0.2); color: #ff8a8d; }
.tag-kick, .tag-timeout { background: rgba(240, 178, 50, 0.18); color: #ffd27a; }
.tag-warn { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.tag-unban, .tag-untimeout { background: rgba(59, 165, 93, 0.18); color: #6ddb8f; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: rgba(59, 165, 93, 0.12); border-color: rgba(59, 165, 93, 0.4); color: #8be3a6; }
.flash-error { background: rgba(229, 72, 77, 0.12); border-color: rgba(229, 72, 77, 0.4); color: #ff9c9f; }

/* Forms */
.form { max-width: 820px; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
label { font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=number], input:not([type]), select, textarea {
  width: 100%; background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.55rem 0.7rem; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
.section-title { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.form > .section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { margin-top: 1rem; }
.toggle { display: flex; align-items: flex-start; gap: 0.7rem; font-weight: 500; margin-bottom: 0.9rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { flex: none; width: 38px; height: 22px; border-radius: 999px; background: #3a3f4b; position: relative; transition: background 0.15s; margin-top: 1px; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle input:checked + .switch { background: var(--success); }
.toggle input:checked + .switch::after { transform: translateX(16px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.25rem 1rem; max-height: 220px; overflow-y: auto; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem; }
.checklist label { font-weight: 400; display: flex; gap: 0.45rem; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.25rem; }
.reward-row, .role-row { display: grid; gap: 0.5rem; margin-bottom: 0.5rem; }
.reward-row { grid-template-columns: 110px 1fr; }
.role-row { grid-template-columns: 1.3fr 1fr 130px; }
.filter-bar { display: flex; gap: 0.5rem; max-width: 460px; margin: 1rem 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; background: var(--bg-raised); }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.pre { white-space: pre-wrap; max-width: 420px; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.user-cell { display: flex; align-items: center; gap: 0.6rem; }
tr.edit-row td { padding-top: 0; }
/* Analytics charts (public/analytics.js). Series colors validated on the dark surface */
:root { --series-1: #3987e5; --series-2: #d95926; --viz-grid: #262a33; --viz-base: #3a3f4b; --good-text: #3fbf63; }
.range-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0 1.25rem; }
.range-tab { padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.range-tab:hover { color: var(--text); background: var(--bg-raised); }
.range-tab.active { color: var(--text); border-color: var(--accent); background: rgba(88, 101, 242, 0.15); font-weight: 600; }
.stat-value.up { color: var(--good-text); }
.stat-value.down { color: #ff8a8d; }
.viz-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin-bottom: 1rem; }
.viz-grid > .card { margin-bottom: 0; }
.viz-card { margin: 0; }
.viz-card figcaption h3 { margin: 0; }
.viz-card figcaption p { margin: 0.15rem 0 0.5rem; }
.viz { width: 100%; min-height: 220px; }
.viz-svg { display: block; max-width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.viz-svg .viz-gridline { stroke: var(--viz-grid); stroke-width: 1; }
.viz-svg .viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-svg .viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-svg .viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-svg .viz-area { opacity: 0.1; }
.viz-svg .viz-dot { stroke: var(--bg-raised); stroke-width: 2; }
.viz-svg .viz-cross { stroke: var(--viz-base); stroke-width: 1; }
.viz-svg .s-1.viz-line { stroke: var(--series-1); } .viz-svg .s-1.viz-area, .viz-svg .s-1.viz-dot { fill: var(--series-1); }
.viz-svg .s-2.viz-line { stroke: var(--series-2); } .viz-svg .s-2.viz-area, .viz-svg .s-2.viz-dot { fill: var(--series-2); }
.viz-svg .viz-col { fill: var(--series-1); opacity: 0.85; }
.viz-svg .viz-col.peak { opacity: 1; }
.viz-empty { padding: 3rem 0; text-align: center; }
.viz-legend { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--muted); }
.key-1 { background: var(--series-1); } .key-2 { background: var(--series-2); }
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: #0d0f13; border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem; font-size: 0.8rem; color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); font-variant-numeric: tabular-nums; }
.viz-tip div { color: var(--muted); }
.rank-bars { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.rank-bars li { display: grid; grid-template-columns: minmax(0, 9rem) 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 8px; border-radius: 999px; background: var(--bg-input); overflow: hidden; }
.rank-track span { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.rank-value { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

/* Server templates */
.tpl-picker { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin: 1rem 0 1.5rem; }
.tpl-pick { margin: 0; display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; color: var(--text); }
.tpl-pick:hover { border-color: #3a3f4b; text-decoration: none; }
.tpl-pick.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tpl-icon { font-size: 1.6rem; }
.tpl-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .tpl-layout { grid-template-columns: 1fr; } }
.tpl-h { margin: 0 0 0.5rem; }
.dc-sidebar { background: #2b2d31; border-radius: 8px; padding: 0 0 0.75rem; color: #949ba4; font-size: 0.92rem; overflow: hidden; }
.dc-server-name { padding: 0.75rem 1rem; color: #f2f3f5; font-weight: 700; border-bottom: 1px solid #1f2023; margin-bottom: 0.5rem; display: flex; justify-content: space-between; }
.dc-category { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 0.75rem 0.2rem 0.6rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.dc-lock { text-transform: none; font-weight: 600; color: #f0b232; white-space: nowrap; }
.dc-channel { display: flex; align-items: center; gap: 0.4rem; margin: 1px 0.5rem; padding: 0.3rem 0.5rem; border-radius: 4px; }
.dc-channel:hover { background: #35373c; color: #dbdee1; }
.dc-hash { width: 1.1rem; text-align: center; color: #80848e; }
.dc-tag { margin-left: auto; font-size: 0.68rem; padding: 0 0.35rem; border-radius: 3px; background: #1e1f22; color: #949ba4; }
.tpl-roles { display: grid; gap: 0.45rem; }
.tpl-role .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.5rem; }
.tpl-list { margin: 0; padding-left: 1.1rem; }
.tpl-list li { margin: 0.25rem 0; }
.dc-message.tpl-rules { max-width: none; margin: 0 0 1rem; }
.tpl-apply { margin-top: 0.5rem; }
.tpl-alert { display: flex; gap: 0.5rem; }
.tpl-alert select { flex: 0 0 auto; width: auto; }

/* Owner page: bot status preview */
.presence-preview { margin: 0.25rem 0 1rem; padding-left: 1.2rem; }
.presence-preview li { margin: 0.2rem 0; }

/* Front page */
.landing { max-width: 1100px; margin: 0 auto; }
.landing .hero { padding: 3.5rem 0 1.5rem; }
.landing .hero h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0 0 0.75rem; }
.landing .lead { max-width: 640px; margin: 0 auto 1.5rem; font-size: 1.1rem; color: var(--muted); }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 1.1rem; color: var(--muted); font-size: 0.95rem; }
.hero-note a { color: #6fd3ff; text-decoration: none; font-weight: 600; }
.trial-text, .hero-note strong { color: var(--good-text); }
.landing-section { padding: 2.5rem 0 1rem; }
.landing-section h2 { text-align: center; font-size: 1.7rem; margin: 0 0 0.4rem; }
.section-lead { text-align: center; max-width: 620px; margin: 0 auto 1.5rem; }
.center { text-align: center; }
.cat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.cat { margin: 0; }
.cat h3 { margin: 0 0 0.6rem; }
.cat ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.cat li { margin: 0.3rem 0; }
.cat li::marker { color: var(--accent); }
.vip-section { margin-top: 2rem; padding: 2.5rem clamp(1rem, 3vw, 2rem) 1.5rem; border: 1px solid rgba(111, 211, 255, 0.3); border-radius: 16px; background: linear-gradient(180deg, rgba(0, 176, 244, 0.08), transparent 60%); }
.vip-head { text-align: center; }
.vip-badge { display: inline-block; padding: 0.25rem 0.8rem; border-radius: 999px; background: rgba(0, 176, 244, 0.18); color: #6fd3ff; font-weight: 700; margin-bottom: 0.6rem; }
.vip-section .feature-grid { margin-top: 1rem; text-align: left; }
.landing .landing-plans { margin: 1.5rem auto 0.75rem; }
.limits-details { max-width: 640px; margin: 1rem auto 0; }
.limits-details summary { cursor: pointer; }
.faq-grid { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); max-width: 900px; margin: 1rem auto 0; }
.faq-grid h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.faq-grid p { margin: 0; }
.landing-cta { text-align: center; padding: 3rem 0 1rem; }
.landing-cta h2 { margin: 0 0 1rem; }
@media (max-width: 600px) {
  .landing .hero { padding-top: 2rem; }
  .hero-actions .btn { width: 100%; }
}

/* Buying VIP */
.nav-upgrade { color: #6fd3ff; font-weight: 600; margin-top: 0.4rem; }
.plan-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); max-width: 640px; margin: 1rem 0 0.5rem; }
.plan { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; }
.plan-best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-head { display: flex; justify-content: space-between; align-items: center; }
.plan-head h3 { margin: 0; }
.plan-price { font-size: 2rem; font-weight: 700; }
.plan-price .muted { font-size: 1rem; font-weight: 400; }
.plan .btn { margin-top: auto; }
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-bottom: 1rem; }
.feature-grid .card { margin: 0; }
.feature-grid h3 { margin: 0 0 0.35rem; }
.feature-grid p { margin: 0; }
.limit-upgrade { display: inline-block; margin-top: 0.4rem; font-size: 0.8rem; color: #6fd3ff; text-decoration: none; }
.limit-upgrade:hover { text-decoration: underline; }
.site-footer { text-align: center; padding: 1.5rem 1rem 2rem; font-size: 0.8rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.legal { max-width: 720px; }
.legal h2 { margin-top: 1.5rem; }

/* Limits (src/limits.js) */
.limit-meter { max-width: 420px; margin: 0.25rem 0 1.25rem; }
.limit-text { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.limit-text strong { color: var(--text); }
.limit-reached { color: var(--warning); font-weight: 600; }
.limit-bar { height: 6px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border); overflow: hidden; }
.limit-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.limit-meter.full .limit-bar span { background: var(--warning); }
.limit-list { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.limit-list .limit-meter { margin: 0; }

/* Anti-nuke and backups */
.card.notice { border-color: rgba(240, 178, 50, 0.45); background: rgba(240, 178, 50, 0.07); }
.card.notice-danger { border-color: rgba(229, 72, 77, 0.5); background: rgba(229, 72, 77, 0.08); }
.card ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.card li { margin: 0.25rem 0; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled { opacity: 0.6; }
.row-actions form.inline { display: inline; }
.inline-details { position: relative; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.restore-form { position: absolute; right: 0; z-index: 5; width: min(340px, 80vw); margin-top: 0.4rem; padding: 0.9rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); text-align: left; }
.radio { display: flex; gap: 0.55rem; align-items: flex-start; margin-bottom: 0.7rem; cursor: pointer; }
.radio input { margin-top: 0.2rem; }

/* Branding preview: a Discord-style message with an embed */
.dc-message { display: flex; gap: 0.75rem; max-width: 560px; margin: 0.75rem 0; padding: 0.75rem; background: #313338; border-radius: 8px; color: #dbdee1; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--accent); }
.dc-body { min-width: 0; flex: 1; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-name .dc-bot { font-size: 0.65rem; font-weight: 600; background: var(--accent); color: #fff; border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: 2px; }
.dc-embed { margin-top: 0.35rem; background: #2b2d31; border-left: 4px solid var(--accent); border-radius: 4px; padding: 0.6rem 0.75rem; }
.dc-embed-title { font-weight: 600; color: #f2f3f5; margin-bottom: 0.25rem; }
.dc-embed-footer { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.75rem; color: #b5bac1; }
.dc-embed-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.card-preview { display: block; width: 100%; max-width: 640px; height: auto; border-radius: 12px; margin: 0.75rem 0; background: var(--bg-input); }
.color-input { width: 72px; height: 40px; padding: 2px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.edit-form { max-width: none; margin-top: 0.75rem; }
.big-code { font-size: 1.2rem; padding: 0.4em 0.8em; user-select: all; }

/* Dashboard */
.guild-grid, .feature-grid, .module-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.guild-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.guild-card { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1.4rem 1rem; text-align: center; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.guild-card:hover { border-color: var(--accent); text-decoration: none; }
.guild-card.dim img, .guild-card.dim .guild-fallback { opacity: 0.55; }
.guild-card img { width: 72px; height: 72px; border-radius: 50%; }
.guild-fallback { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); font-weight: 700; color: #fff; }
.guild-fallback.big { width: 72px; height: 72px; font-size: 1.6rem; }
.module-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.module-card { color: var(--text); margin: 0; }
.module-card:hover { border-color: var(--accent); text-decoration: none; }
.module-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.module-icon { font-size: 1.5rem; }
.module-card p { margin: 0; font-size: 0.9rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.hero { text-align: center; padding: 4rem 0 2rem; }
.hero h1 { font-size: 2.6rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 0.75rem auto 2rem; }
.feature-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 3rem; text-align: left; }

@media (max-width: 820px) {
  .shell.with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .sidebar-guild { width: 100%; }
  .nav-back { border-top: 0; margin-top: 0; padding-top: 0.45rem; }
  .content { padding: 1rem; }
  .role-row { grid-template-columns: 1fr; }
  .topbar-user span { display: none; }
}

/* Command permissions */
.perm-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; margin-top: 1rem; }
.perm-list { display: flex; flex-direction: column; gap: 0.2rem; }
.perm-group { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1rem 0 0.35rem; }
.perm-group:first-child { margin-top: 0; }
.perm-group h3 { margin: 0; font-size: 0.95rem; }
.perm-group .btn.active { border-color: var(--accent); color: var(--text); }
.perm-cmds { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; color: var(--muted); word-spacing: 0.3rem; }
.perm-item { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.65rem; border: 1px solid transparent; border-radius: 6px; color: var(--text); text-decoration: none; }
.perm-item:hover { background: var(--bg-raised); text-decoration: none; }
.perm-item.active { border-color: var(--accent); background: var(--bg-raised); }
.perm-rule { font-size: 0.8rem; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.perm-rule.perm-custom { color: #6fd3ff; }
.perm-rule.perm-off { color: #ff8a8d; }
.perm-edit { position: sticky; top: 4.5rem; }
.perm-title { margin: 0; }
.perm-note { background: rgba(240, 178, 50, 0.1); border: 1px solid rgba(240, 178, 50, 0.3); border-radius: 6px; padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.perm-radio { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; margin: 0.2rem 0; }
.perm-radio input { width: auto; }
@media (max-width: 800px) {
  .perm-layout { grid-template-columns: 1fr; }
  .perm-edit { position: static; }
}

/* Embed builder */
.emb-layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 1rem; }
.emb-form { max-width: none; }
.emb-editing { background: rgba(88, 101, 242, 0.12); border: 1px solid rgba(88, 101, 242, 0.4); border-radius: 6px; padding: 0.55rem 0.75rem; margin-top: 0; }
.emb-toolbar { position: sticky; top: 3.6rem; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; padding: 0.4rem; margin-bottom: 1rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; }
.emb-toolbar button { min-width: 2rem; height: 2rem; padding: 0 0.45rem; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
.emb-toolbar button:hover { border-color: var(--accent); }
.emb-toolbar select { width: auto; height: 2rem; padding: 0 0.4rem; }
.emb-toggle { margin-top: 0.5rem; }
.emb-color { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.emb-color label { width: 100%; }
.emb-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.emb-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.emb-fields { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; }
.emb-field { display: grid; grid-template-columns: 1fr auto auto; gap: 0.4rem; padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; }
.emb-field textarea { grid-column: 1 / -1; }
.emb-field select { width: auto; }
.emb-actions { position: sticky; bottom: 0; background: var(--bg-raised); padding: 0.75rem 0; margin-bottom: -0.5rem; }
.emb-preview-wrap { position: sticky; top: 4.5rem; }
.emb-msg { max-width: none; margin-top: 0; }
.emb-msg .dc-head { display: flex; align-items: baseline; gap: 0.35rem; color: #f2f3f5; }
.emb-msg .dc-bot { font-size: 0.65rem; font-weight: 600; background: var(--accent); color: #fff; border-radius: 3px; padding: 0 4px; }
.emb-msg .dc-time { font-size: 0.75rem; color: #949ba4; }
.emb-msg .dc-avatar-blank { display: block; }
.emb-msg .dc-content { margin-top: 0.15rem; overflow-wrap: anywhere; }
.emb-msg .dc-embed { display: flex; gap: 1rem; max-width: 520px; padding: 0.6rem 1rem 0.9rem 0.75rem; }
.emb-msg .dc-embed-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; line-height: 1.375; }
.emb-msg .dc-author { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.875rem; color: #f2f3f5; margin-top: 0.25rem; }
.emb-msg .dc-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.emb-msg .dc-author a, .emb-msg .dc-title a { color: inherit; }
.emb-msg .dc-title { font-weight: 600; font-size: 1rem; color: #f2f3f5; margin-top: 0.25rem; overflow-wrap: anywhere; }
.emb-msg .dc-title a { color: #00a8fc; }
.emb-msg .dc-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.25rem; }
.emb-msg .dc-field-name { font-weight: 600; color: #f2f3f5; margin-bottom: 0.1rem; overflow-wrap: anywhere; }
.emb-msg .dc-image { display: block; max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 0.5rem; object-fit: contain; align-self: flex-start; }
.emb-msg .dc-thumb { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; margin-top: 0.5rem; }
.emb-msg .dc-footer { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.75rem; color: #b5bac1; }
.emb-msg .dc-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.emb-msg [hidden] { display: none !important; }
.dc-md, .emb-msg .dc-content { overflow-wrap: anywhere; color: #dbdee1; }
.emb-msg a { color: #00a8fc; }
.emb-msg code { background: #1e1f22; border-radius: 3px; padding: 0.1em 0.3em; font-size: 0.85em; }
.emb-msg pre { background: #1e1f22; border: 1px solid #1a1b1e; border-radius: 4px; padding: 0.5rem; margin: 0.25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.emb-msg pre code { padding: 0; background: none; }
.emb-msg blockquote { margin: 0.15rem 0; padding: 0 0 0 0.75rem; border-left: 4px solid #4e5058; }
.emb-msg ul, .emb-msg ol { margin: 0.15rem 0; padding-left: 1.4rem; }
.emb-msg .dc-h1, .emb-msg .dc-h2, .emb-msg .dc-h3 { margin: 0.4rem 0 0.2rem; color: #f2f3f5; line-height: 1.25; }
.emb-msg .dc-h1 { font-size: 1.5rem; }
.emb-msg .dc-h2 { font-size: 1.25rem; }
.emb-msg .dc-h3 { font-size: 1rem; }
.emb-msg .dc-sub { font-size: 0.75rem; color: #949ba4; }
.emb-msg .dc-blank { height: 1.2em; }
.emb-msg .dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.emb-msg .dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; transition: color 0.1s; }
.emb-msg .dc-spoiler:hover { color: #dbdee1; background: #2e2f34; }
.emb-msg .dc-ts { background: rgba(255, 255, 255, 0.06); border-radius: 3px; padding: 0 2px; }
tr.row-active td { background: rgba(88, 101, 242, 0.1); }
@media (max-width: 1000px) {
  .emb-layout { grid-template-columns: 1fr; }
  .emb-preview-wrap { position: static; order: -1; }
  .emb-toolbar { top: 0; }
}
/* Channel picker laid out like Discord's channel list */
.checklist.channel-tree { display: flex; flex-direction: column; gap: 0; max-height: 340px; padding: 0.4rem 0.5rem; }
.channel-tree label { display: flex; flex-shrink: 0; align-items: center; gap: 0.45rem; padding: 0.2rem 0.35rem; border-radius: 4px; cursor: pointer; min-width: 0; overflow: visible; line-height: 1.4; }
.channel-tree input { flex-shrink: 0; width: auto; margin: 0; }
.channel-tree label:hover { background: rgba(255, 255, 255, 0.04); }
.channel-tree .ct-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.channel-tree .ct-category { margin-top: 0.6rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.channel-tree .ct-category:first-child { margin-top: 0; }
.channel-tree .ct-whole { margin-left: auto; flex-shrink: 0; font-size: 0.7rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.8; }
.channel-tree .ct-category ~ .ct-channel { padding-left: 1.6rem; }
.channel-tree .ct-icon { width: 1.1rem; flex-shrink: 0; text-align: center; color: var(--muted); }

/* Join our Discord */
.btn-discord { display: inline-flex; align-items: center; gap: 0.45rem; background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; text-decoration: none; }
.discord-icon { flex-shrink: 0; }
.topbar-discord { margin-left: auto; margin-right: 0.75rem; }
@media (max-width: 600px) {
  .topbar-discord span { display: none; }
  .topbar-discord { padding-left: 0.5rem; padding-right: 0.5rem; }
}
/* Applications */
.app-forms { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-bottom: 1.5rem; }
.app-form-card { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; }
.app-form-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.app-pending { font-weight: 600; color: #fee75c; }
.app-form-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.badge.app-pending { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.badge.app-accepted { background: rgba(59, 165, 93, 0.18); color: #6ddb8f; }
.badge.app-denied { background: rgba(229, 72, 77, 0.2); color: #ff8a8d; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.tab { padding: 0.45rem 0.85rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { display: inline-block; min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: #2a2e38; font-size: 0.75rem; text-align: center; }
.app-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.app-questions { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; counter-reset: q; }
.app-q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 0.4rem; align-items: center; padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; counter-increment: q; }
.app-q-num::before { content: counter(q) "."; color: var(--muted); font-weight: 600; }
.app-q select { width: auto; }
.app-q-hint { grid-column: 2 / -1; font-size: 0.85rem; }
.input-suffix { display: flex; align-items: center; gap: 0.5rem; }
.input-suffix input { width: 6rem; }
.btn-success { background: #248046; border-color: #248046; color: #fff; }
.btn-success:hover { background: #1a6334; border-color: #1a6334; color: #fff; }
.app-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.app-who { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.app-who .avatar { width: 44px; height: 44px; }
.app-answer { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.app-question { font-weight: 600; margin-bottom: 0.25rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.app-reason { margin: 0.5rem 0 0; padding-left: 0.75rem; border-left: 3px solid var(--border); color: var(--muted); }
@media (max-width: 800px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-q { grid-template-columns: auto minmax(0, 1fr) auto; }
  .app-q select { grid-column: 2; }
  .app-q-hint { grid-column: 2 / -1; }
}
.emb-msg .dc-buttons { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.emb-msg .dc-button { display: inline-flex; align-items: center; gap: 0.35rem; height: 32px; padding: 0 1rem; border-radius: 4px; background: #5865f2; color: #fff; font-size: 0.875rem; font-weight: 500; }

/* Front page highlights */
.highlight-grid { margin-top: 1rem; }
.highlight .badge { margin-bottom: 0.5rem; }
.highlight h3 { margin-top: 0; }

/* Owner page performance monitor */
.perf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1rem; }
.perf-head h2 { margin-bottom: 0.25rem; }
.perf-ranges { margin-bottom: 0; border-bottom: 0; }
.perf-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin: 0.75rem 0 0; }
.perf-headline { margin-right: 0.5rem; }
.perf-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: #2a2e38; color: var(--muted); }
.perf-chip b { font-weight: 700; }
.st-good { color: #6ddb8f; } .perf-chip.st-good { background: rgba(59, 165, 93, 0.15); }
.st-warning { color: #ffd27a; } .perf-chip.st-warning { background: rgba(240, 178, 50, 0.15); }
.st-critical { color: #ff8a8d; } .perf-chip.st-critical { background: rgba(229, 72, 77, 0.18); }
.st-unknown { color: var(--muted); }
.perf-tiles .stat { gap: 0.1rem; }
.perf-tiles .stat-value { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.perf-charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin-bottom: 1.5rem; }
.perf-chart { margin: 0; min-width: 0; }
.perf-chart h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.legend:empty { display: none; }
/* Bot owner viewing someone else's server */
.access-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: var(--radius); background: rgba(240, 178, 50, 0.1); border: 1px solid rgba(240, 178, 50, 0.35); }
.access-banner > span { flex: 1 1 260px; }
.access-banner input[name=reason] { flex: 2 1 260px; width: auto; }
.access-banner select { width: auto; }
.access-banner.access-on { background: rgba(59, 165, 93, 0.1); border-color: rgba(59, 165, 93, 0.35); }
/* Dashboard admins and bot staff */
.admins-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 1rem; }
.admin-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0.3rem 1rem; padding: 0.6rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; max-height: 360px; overflow-y: auto; }
.admin-pages label { display: flex; align-items: center; gap: 0.45rem; font-weight: 400; }
.admin-pages input { width: auto; margin: 0; flex-shrink: 0; }
.admin-pages .admin-all { grid-column: 1 / -1; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 0.2rem; }
.admin-card { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 0.75rem; }
.admin-who { display: flex; align-items: center; gap: 0.6rem; }
.admin-who .avatar { width: 36px; height: 36px; }
.admin-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.admin-actions { justify-content: flex-start; }
.staff-h { margin-top: 1.25rem; }
@media (max-width: 800px) { .admins-layout { grid-template-columns: 1fr; } }