:root {
  --bg: #0a0f1c;
  --panel: #111829;
  --panel-2: #172036;
  --line: #23304a;
  --text: #e6ecf7;
  --muted: #91a0bb;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --blurple: #5865f2;
  --good: #3ba55d;
  --bad: #ed4245;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 24px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 24px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(10,15,28,.85); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; }
.logo { width: 34px; height: 34px; display: block; filter: drop-shadow(0 4px 10px rgba(37,99,235,.45)); }
.topbar nav { flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--text); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 30px; height: 30px; border-radius: 50%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: .15s; }
.btn.primary { background: linear-gradient(180deg, #4f8ff7, #2563eb); color: #fff; box-shadow: 0 6px 20px -8px rgba(59,130,246,.7); }
.btn.primary:hover { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: transparent; border-color: #5c2a2b; color: #ff8a8c; }
.btn.danger:hover { background: #2a1516; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: default; }

/* Home */
.hero { padding: 96px 24px 64px; text-align: center; background: radial-gradient(800px 400px at 50% -10%, rgba(59,130,246,.25), transparent); }
.hero-inner { max-width: 760px; margin: 0 auto; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.accent { color: var(--accent); }
.lead { font-size: 18px; color: var(--muted); max-width: 600px; margin: 0 auto 28px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { max-width: 1080px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature p { color: var(--muted); margin: 0; }
.f-emoji { font-size: 26px; margin-bottom: 8px; }
.foot { text-align: center; color: var(--muted); padding: 40px 24px 60px; }

/* Server picker */
.wrap { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.wrap.center { text-align: center; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.server { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; transition: .15s; }
.server:hover { border-color: var(--accent); transform: translateY(-1px); }
.server .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; }
.server .icon img { width: 100%; height: 100%; }
.server .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server .sub { font-size: 13px; color: var(--muted); }
.server.invite { opacity: .7; }

/* App layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 61px); }
.sidebar { border-right: 1px solid var(--line); padding: 18px 12px; background: var(--panel); }
.guild-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.guild-head img, .guild-head .ph { width: 40px; height: 40px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; }
.guild-head .gname { font-weight: 700; line-height: 1.2; }
.tab { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.tab:hover { background: var(--panel-2); color: var(--text); }
.tab.active { background: rgba(59,130,246,.14); color: var(--accent-2); }
.tab .off { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.content { padding: 32px; max-width: 920px; }
.content > h2 { font-size: 26px; }
.content > .desc { color: var(--muted); margin-top: -4px; margin-bottom: 24px; }

/* Cards & fields */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 16px; }
.card .hint { color: var(--muted); font-size: 13px; margin: -4px 0 14px; }
.field { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field label { font-weight: 600; }
.field .help { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
select, input[type=text], input[type=number], textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px 11px; font: inherit; }
select:focus, input:focus, textarea:focus { outline: 2px solid rgba(59,130,246,.5); border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row > .btn { flex: none; }
.savebar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Toggle */
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #3a3f4b; border-radius: 24px; cursor: pointer; transition: .2s; }
.slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--good); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Modules list */
.module { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.module:first-child { border-top: 0; }
.module .m-emoji { font-size: 22px; width: 32px; text-align: center; }
.module .m-text { flex: 1; }
.module .m-name { font-weight: 600; }
.module .m-desc { color: var(--muted); font-size: 13px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.war { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; }
.war .side { background: var(--panel-2); border-radius: 10px; padding: 16px; }
.war .pts { font-size: 32px; font-weight: 800; color: var(--accent); }
.war .vs { font-weight: 800; color: var(--muted); }

/* Tables & chips */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.pill.on { color: #7ee2a0; border-color: #24563a; }
.pill.off { color: var(--muted); }
.app-q { font-weight: 600; margin-top: 10px; }
.app-a { color: var(--muted); white-space: pre-wrap; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--panel-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: #24563a; }
.toast.bad { border-color: #5c2a2b; }

/* Mobile */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
  .guild-head { display: none; }
  .tab { white-space: nowrap; width: auto; }
  .content { padding: 20px 16px; }
  .field { grid-template-columns: 1fr; gap: 8px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .user span { display: none; }
}
.t-emoji { width: 20px; text-align: center; }
.switch { display: inline-block; vertical-align: middle; }
.actions { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Blue theme extras */
.hero { background: radial-gradient(900px 420px at 50% -10%, rgba(59,130,246,.30), transparent), radial-gradient(500px 300px at 85% 20%, rgba(96,165,250,.10), transparent); }
.hero-logo { width: 88px; height: 88px; margin: 0 auto 18px; display: block; filter: drop-shadow(0 12px 30px rgba(37,99,235,.55)); }
.accent { background: linear-gradient(90deg, #60a5fa, #3b82f6 60%, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.feature:hover, .stat:hover { border-color: #2f4670; }
.war .pts { color: var(--accent-2); }
.tab.active { box-shadow: inset 3px 0 0 var(--accent); }

/* Public pages */
.topbar nav { display: flex; gap: 20px; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); }
.brand.small { font-size: 16px; }
.brand.small .logo { width: 26px; height: 26px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 24px 24px; background: var(--panel); }
.foot-inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.foot-links { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 32px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.copyright { text-align: center; font-size: 13px; margin: 24px 0 0; }
.proof { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; padding: 8px 24px 24px; }
.proof div { text-align: center; }
.proof b { display: block; font-size: 32px; font-weight: 800; color: var(--accent-2); }
.proof span { color: var(--muted); }
.band { max-width: 1080px; margin: 32px auto 0; padding: 40px 24px; text-align: center; border-radius: var(--radius); background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(129,140,248,.10)); border: 1px solid #2a3f66; }
.band .btn { margin-top: 8px; }
.wrap.narrow { max-width: 760px; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .92em; }
.search { width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 14px 16px; font: inherit; font-size: 16px; margin: 12px 0 16px; }
.search:focus { outline: 2px solid rgba(59,130,246,.5); border-color: var(--accent); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.toc a { text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; color: var(--muted); }
.toc a:hover { color: var(--text); border-color: var(--accent); }
.cmd-group { margin-top: 32px; }
.cmd-group h2 { font-size: 22px; margin-bottom: 2px; }
.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.cmd { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.cmd-name { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent-2); display: flex; align-items: center; gap: 8px; }
.cmd-name .pill { font-family: Inter, sans-serif; font-weight: 500; color: var(--muted); }
.cmd-desc { color: var(--muted); margin-top: 2px; }
.subs { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.subs code { color: var(--text); margin-right: 4px; }
.lb td.rank { font-size: 18px; width: 48px; }
.lb tr:nth-child(2) td { background: rgba(59,130,246,.07); }
.faq { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--accent-2); font-size: 20px; line-height: 1; }
.faq[open] summary::after { content: '–'; }
.faq p { color: var(--muted); margin: 0 0 16px; }
.legal h2 { font-size: 20px; margin-top: 28px; }
.legal p, .legal li { color: #c3cde0; }
.legal a { color: var(--accent-2); }
@media (max-width: 760px) {
  .topbar nav { gap: 14px; overflow-x: auto; font-size: 14px; }
  .foot-links { grid-template-columns: repeat(2, auto); }
  .brand { font-size: 16px; }
}
