:root {
  --bg: #090305;
  --bg-elevated: #120609;
  --bg-card: #1a0b0e;
  --bg-card-solid: #1a0b0e;
  --bg-card-hover: #241014;
  --border: #38151b;
  --border-soft: #280e13;
  --text: #fdf2f4;
  --text-muted: #c49ba3;
  --text-faint: #7a5259;
  --brand: #ef4444;
  --brand-hover: #dc2626;
  --violet: #f43f5e;
  --cyan: #ff6b6b;
  --brand-glow: rgba(239, 68, 68, 0.35);
  --brand-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(220, 38, 38, 0.05));
  --text-gradient: linear-gradient(135deg, #ffffff 0%, #fca5a5 55%, #f87171 100%);
  --hero-gradient: linear-gradient(135deg, #fff, #fca5a5 60%, var(--brand));
  --green: #57f287;
  --yellow: #fee75c;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -20px rgba(0, 0, 0, 0.65);
  --shadow-lift: 0 24px 60px -18px rgba(239, 68, 68, 0.35), 0 12px 32px -10px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 30px 90px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}

:root[data-theme="light"] {
  --bg: #fdf3f4;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-card-hover: #fce8e9;
  --border: #f8d7da;
  --border-soft: #fae3e5;
  --text: #2b0f14;
  --text-muted: #804a52;
  --text-faint: #b3838a;
  --brand-glow: rgba(239, 68, 68, 0.16);
  --text-gradient: linear-gradient(135deg, #2b0f14 0%, #6b1f28 100%);
  --hero-gradient: linear-gradient(135deg, #2b0f14 0%, var(--brand) 55%, var(--violet) 100%);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 30px -14px rgba(60, 20, 25, 0.18);
  --shadow-pop: 0 30px 90px rgba(60, 20, 25, 0.25);
}

:root[data-theme="light"] .discord-preview { background: #fdf3f4; }
:root[data-theme="light"] .discord-preview .preview-embed { background: #ffffff; }
:root[data-theme="light"] .discord-preview { color: #2e3338; }
:root[data-theme="light"] .console-box { background: #ffffff; }
:root[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.86); }
:root[data-theme="light"] .hero-badge, :root[data-theme="light"] .status-pill { background: rgba(239, 68, 68, 0.08); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* banner.png is a fixed logo/wordmark graphic, not a tileable background
   texture — stretched full-bleed behind scrolling content it reads as
   duplicate ghost text under the real headings, so it's not used as a
   page background at all; the gradients below carry the atmosphere. */
body {
  position: relative;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 8% -10%, rgba(239, 68, 68, 0.22) 0%, transparent 60%),
    radial-gradient(1000px 560px at 108% 6%, rgba(220, 38, 38, 0.18) 0%, transparent 55%),
    radial-gradient(900px 600px at 50% 100%, rgba(244, 63, 94, 0.1) 0%, transparent 60%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: top left, top right, bottom center;
  background-size: auto, auto, auto;
  background-attachment: fixed, fixed, fixed;
}

:root[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 500px at 110% 10%, #fce8e9 0%, transparent 55%);
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--brand-glow); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #34394d; }

h1, h2, h3 { letter-spacing: -0.015em; }

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.main, .hero, .login-wrap { animation: rise-in 0.45s var(--ease); }

/* ---------- Top nav (public pages) ---------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 0;
  background: rgba(14, 5, 8, 0.85);
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] .topnav {
  background: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.brand:hover {
  transform: translateY(-1px);
}
.brand-logo {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}
.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand-highlight {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-dot-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #57F287;
  box-shadow: 0 0 0 0 rgba(87, 242, 135, 0.7);
  animation: dot-pulse 2s infinite;
  margin-left: 2px;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 242, 135, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(87, 242, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 242, 135, 0); }
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.nav-btn.active {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.nav-cta {
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.btn:hover { background: var(--bg-card-hover); border-color: #3a3f57; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 26px -6px var(--brand-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 10px 32px -6px rgba(239, 68, 68, 0.55); transform: translateY(-2px); }
.btn-danger { background: transparent; border-color: rgba(237, 66, 69, 0.4); color: var(--red); }
.btn-danger:hover { background: rgba(237, 66, 69, 0.12); border-color: rgba(237, 66, 69, 0.6); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Layout: app shell with sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(20, 10, 14, 0.95), rgba(12, 6, 8, 0.98));
  border-right: 1px solid var(--border-soft);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.guild-switcher { position: relative; margin-bottom: 10px; }

.sidebar .guild-name {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 18px 10px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border-soft);
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: color 0.15s ease;
}
.sidebar .guild-name:hover { color: var(--brand); }

.sidebar .guild-name img {
  width: 32px; height: 32px; border-radius: 10px; background: var(--bg-card);
}

.switcher-chevron { margin-left: auto; font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

.guild-switcher-menu {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 10px;
  right: 10px;
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}
.guild-switcher-menu.open { display: block; }
.guild-switcher-menu .switcher-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-muted); cursor: pointer;
}
.guild-switcher-menu .switcher-item:hover, .guild-switcher-menu .switcher-item.current { background: var(--bg-card-hover); color: var(--text); }
.guild-switcher-menu .switcher-item img, .guild-switcher-menu .switcher-item .icon-fallback {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.guild-switcher-menu .switcher-empty { padding: 10px; font-size: 12.5px; color: var(--text-faint); text-align: center; }

.sidebar a.navlink {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sidebar a.navlink:hover { background: var(--bg-card-hover); color: var(--text); transform: translateX(2px); }
.sidebar a.navlink.active {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22), rgba(220, 38, 38, 0.08));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.sidebar a.navlink.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand-gradient);
  box-shadow: 0 0 12px var(--brand-glow);
}

.sidebar .back-link { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); color: var(--text-faint); font-size: 13px; transition: color 0.15s ease; }
.sidebar .back-link:hover { color: var(--text-muted); }

.main {
  flex: 1;
  padding: 40px 46px 60px 46px;
  max-width: 1100px;
}

.page-header { margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--border-soft); }
.page-header h1 {
  margin: 0 0 6px 0;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--text-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-header p { margin: 0; color: var(--text-muted); font-size: 14px; max-width: 640px; line-height: 1.55; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}
.card h2 { margin: 0 0 4px 0; font-size: 16.5px; font-weight: 700; }
.card .card-desc { color: var(--text-muted); font-size: 13px; margin: 0 0 16px 0; line-height: 1.55; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}
.stat-tile:hover { transform: translateY(-2px); border-color: rgba(239, 68, 68, 0.35); }
.stat-tile::after {
  content: "";
  position: absolute; top: 0; right: 0; width: 110px; height: 110px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
}
.stat-tile .stat-value {
  font-size: 31px; font-weight: 800; letter-spacing: -0.02em;
  background: var(--text-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-tile .stat-label { color: var(--text-muted); font-size: 12.5px; margin-top: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

input[type="text"], input[type="number"], input[type="color"], textarea, select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
textarea { resize: vertical; min-height: 80px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: 0.2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .slider { background: var(--brand-gradient); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .toggle-label { font-weight: 600; font-size: 14px; }
.toggle-row .toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; padding: 11px 12px; border-bottom: 1px solid var(--border); }
td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color 0.12s ease; position: relative; }
tbody tr:hover { background: var(--bg-elevated); }
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-faint); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: rgba(87, 242, 135, 0.15); color: var(--green); }
.badge-red { background: rgba(237, 66, 69, 0.15); color: var(--red); }
.badge-yellow { background: rgba(254, 231, 92, 0.15); color: var(--yellow); }
.badge-brand { background: var(--brand-glow); color: #fca5a5; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: stretch;
}
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } }

.login-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.22), rgba(9, 3, 5, 0.6) 60%);
  border-right: 1px solid var(--border-soft);
}
@media (max-width: 860px) { .login-showcase { display: none; } }
.login-showcase::before {
  content: "";
  position: absolute; inset: -20%;
  background: radial-gradient(600px 400px at 20% 20%, rgba(239, 68, 68, 0.35), transparent 60%),
              radial-gradient(500px 400px at 90% 80%, rgba(220, 38, 38, 0.28), transparent 60%);
  pointer-events: none;
}
.login-showcase .content { position: relative; max-width: 420px; }
.login-showcase h2 { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px 0; background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-showcase p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 28px 0; }
.login-showcase .showcase-list { display: flex; flex-direction: column; gap: 14px; }
.login-showcase .showcase-item { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text); }
.login-showcase .showcase-item .icon { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-gradient-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

.login-card-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-pop), 0 0 35px rgba(239, 68, 68, 0.15);
}
.login-card .logo-circle {
  width: 68px; height: 68px; border-radius: 20px;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin: 0 auto 22px auto;
  box-shadow: 0 10px 34px var(--brand-glow);
}
.login-card .logo-circle img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { font-size: 23px; margin: 0 0 8px 0; font-weight: 800; }
.login-card p { color: var(--text-muted); font-size: 14px; margin: 0 0 28px 0; line-height: 1.5; }
.discord-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  background: var(--brand-gradient); color: white; font-weight: 700; font-size: 15px;
  border: none; cursor: pointer; transition: 0.15s;
  box-shadow: 0 8px 24px -6px var(--brand-glow);
}
.discord-btn:hover { background: var(--brand-hover); transform: translateY(-2px); box-shadow: 0 12px 30px -6px var(--brand-glow); color: white; }

/* ---------- Home / landing ---------- */
.hero { max-width: 900px; margin: 0 auto; padding: 108px 24px 64px 24px; text-align: center; position: relative; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 30px; font-size: 12.5px; font-weight: 600;
  background: var(--brand-gradient-soft); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5;
  margin-bottom: 22px;
}
.hero h1 { font-size: 54px; line-height: 1.06; margin: 0 0 20px 0; font-weight: 800; letter-spacing: -0.025em; background: var(--hero-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17.5px; color: var(--text-muted); margin: 0 0 34px 0; line-height: 1.6; max-width: 680px; margin-left: auto; margin-right: auto; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.stats-strip {
  max-width: 900px; margin: 0 auto 20px auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 760px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }
.stats-strip .stat {
  text-align: center; padding: 18px 10px; border-radius: var(--radius); background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.stats-strip .stat .num { font-size: 24px; font-weight: 800; background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats-strip .stat .label { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

.feature-grid { max-width: 1080px; margin: 60px auto; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(239,68,68,0), rgba(239,68,68,0));
  transition: background 0.25s ease; pointer-events: none;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(239, 68, 68, 0.4); box-shadow: var(--shadow-lift); }
.feature-card .icon {
  font-size: 22px; margin-bottom: 14px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-gradient-soft); border: 1px solid rgba(239, 68, 68, 0.25);
}
.feature-card h3 { margin: 0 0 6px 0; font-size: 15px; font-weight: 700; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }

.section-heading { text-align: center; max-width: 640px; margin: 0 auto 8px auto; padding: 0 24px; }
.section-heading h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px 0; background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-heading p { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; margin: 0; }

.home-footer {
  text-align: center; padding: 40px 24px 70px 24px; color: var(--text-faint); font-size: 13px;
  border-top: 1px solid var(--border-soft); margin-top: 40px;
}

/* ---------- Server picker ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.server-tile {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; gap: 14px; transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
}
.server-tile.clickable:hover { border-color: var(--brand); background: var(--bg-card-hover); transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.server-tile img, .server-tile .icon-fallback {
  width: 48px; height: 48px; border-radius: 14px; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.server-tile .server-name { font-weight: 600; font-size: 15px; }
.server-tile .server-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Embed builder ---------- */
.embed-builder { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .embed-builder { grid-template-columns: 1fr; } }

.discord-preview {
  background: #313338;
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'gg sans', 'Segoe UI', sans-serif;
  color: #dbdee1;
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow-card);
}
.discord-preview .preview-embed {
  border-left: 4px solid #ef4444;
  background: #2b2d31;
  border-radius: 4px;
  padding: 12px 16px;
  max-width: 520px;
}
.discord-preview .preview-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.discord-preview .preview-author img { width: 20px; height: 20px; border-radius: 50%; }
.discord-preview .preview-title { font-weight: 700; font-size: 15px; color: #fff; margin-bottom: 6px; }
.discord-preview .preview-desc { font-size: 14px; white-space: pre-wrap; line-height: 1.4; }
.discord-preview .preview-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.discord-preview .preview-field { font-size: 13px; }
.discord-preview .preview-field .fname { font-weight: 700; color: #fff; margin-bottom: 2px; }
.discord-preview .preview-image { margin-top: 10px; max-width: 100%; border-radius: 4px; display: block; }
.discord-preview .preview-thumb { float: right; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin-left: 10px; }
.discord-preview .preview-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b5bac1; margin-top: 10px; }
.discord-preview .preview-footer img { width: 18px; height: 18px; border-radius: 50%; }

.saved-embed-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.saved-embed-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }

/* ---------- Console ---------- */
.console-box {
  background: #05060a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 520px;
  overflow-y: auto;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  box-shadow: var(--shadow-card);
}
.console-line { padding: 3px 0; display: flex; gap: 10px; }
.console-line .ts { color: var(--text-faint); flex-shrink: 0; }
.console-line .tag { flex-shrink: 0; font-weight: 700; }
.console-line.mod .tag { color: var(--yellow); }
.console-line.message .tag { color: #f87171; }
.console-line.member .tag { color: var(--green); }
.console-line.system .tag { color: #c084fc; }
.console-status { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--text-muted); }
.console-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.console-status .dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 999; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: slide-in 0.2s ease; }
.toast.success { border-color: rgba(87,242,135,0.4); }
.toast.error { border-color: rgba(237,66,69,0.4); }
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Site-wide announcement banner ---------- */
.announcement-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 1200;
  max-width: min(640px, calc(100vw - 32px));
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 34px rgba(239, 68, 68, 0.45);
  padding: 14px 20px;
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s ease;
  pointer-events: none;
}
.announcement-banner.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.announcement-content { display: flex; align-items: flex-start; gap: 10px; color: #fff; font-size: 14px; line-height: 1.4; }
.announcement-icon { font-size: 18px; flex: 0 0 auto; }

/* ---------- Misc ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-chip { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; font-size: 13px; }
.tag-chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; line-height: 1; }
.tag-chip button:hover { color: var(--red); }

.avatar-sm { width: 28px; height: 28px; border-radius: 50%; }
.muted { color: var(--text-muted); }
.mono { font-family: 'Cascadia Code', Consolas, monospace; }

/* ---------- Sidebar sections + theme/palette controls ---------- */
.sidebar .nav-section {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  padding: 18px 12px 7px 12px;
}
.sidebar .nav-section:first-of-type { padding-top: 4px; }

.sidebar-tools { display: flex; gap: 8px; padding: 6px 10px 14px 10px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; font-size: 15px; transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text); border-color: rgba(239, 68, 68, 0.4); transform: translateY(-1px); }
.icon-btn.lockdown-active {
  background: rgba(237, 66, 69, 0.15);
  border-color: rgba(237, 66, 69, 0.5);
  color: var(--red);
  animation: lockdown-pulse 1.6s ease-in-out infinite;
}
@keyframes lockdown-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(237, 66, 69, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(237, 66, 69, 0); }
}

/* ---------- Command palette ---------- */
.palette-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 12vh; z-index: 1000; backdrop-filter: blur(4px);
}
.palette-overlay.open { display: flex; }
.palette-box {
  width: 100%; max-width: 560px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden;
}
.palette-input {
  width: 100%; border: none; background: transparent; color: var(--text);
  padding: 18px 20px; font-size: 16px; border-bottom: 1px solid var(--border);
}
.palette-input:focus { outline: none; box-shadow: none; }
.palette-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.palette-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; color: var(--text-muted);
}
.palette-item.active, .palette-item:hover { background: var(--bg-card-hover); color: var(--text); }
.palette-item .kbd { margin-left: auto; font-size: 11px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }

/* ---------- Modal / confirm dialog ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; animation: fade-in 0.15s ease; }
.modal-box {
  width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-pop);
}
.modal-box h3 { margin: 0 0 10px 0; font-size: 17px; }
.modal-box p { margin: 0 0 20px 0; color: var(--text-muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-sweep { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-tile { height: 80px; }

/* ---------- Progress / XP bar ---------- */
.xp-bar-track { background: var(--bg-elevated); border-radius: 20px; height: 10px; overflow: hidden; border: 1px solid var(--border); }
.xp-bar-fill { height: 100%; background: var(--brand-gradient); border-radius: 20px; transition: width 0.3s ease; }

/* ---------- Member browser ---------- */
.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.member-row img { width: 36px; height: 36px; border-radius: 10px; }
.member-row .name { font-weight: 600; font-size: 14px; }
.member-row .sub { font-size: 12px; color: var(--text-muted); }

/* ---------- Simple bar chart (analytics) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.bar-chart .bar { flex: 1; background: var(--brand-gradient); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bar-chart .bar:hover { filter: brightness(1.2); }
.chart-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 6px; }

/* ---------- Section chips for status ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--bg-elevated); border: 1px solid var(--border); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.status-pill .dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }
