@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- brand gradient (autumn amber/orange, matching the Air Studios logo) ---- */
  --brand-1: #EA580C; /* dark orange */
  --brand-2: #F97316; /* orange, the logo's "A" */
  --brand-3: #FBBF24; /* amber/gold, the "A" highlight */
  --brand-1-rgb: 234, 88, 12;
  --brand-2-rgb: 249, 115, 22;
  --brand-3-rgb: 251, 191, 36;
  --brand-gradient: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --discord-blurple: #5865F2; /* Discord's own brand color — kept fixed on Discord-specific buttons regardless of site theme */
  --discord-blurple-hover: #4752c4;

  /* ---- surfaces ---- */
  --bg-deep: #020203;
  --bg-base: #06070a;
  --bg-elevated: #0d0f16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --surface-solid: #101219;

  /* ---- text ---- */
  --fg: #F2F2F5;
  --fg-muted: #9093A6;
  --fg-faint: #5C5F70;

  /* ---- semantic ---- */
  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.14);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --warning: #F59E0B;

  /* ---- borders / rings ---- */
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ring: var(--brand-1);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--brand-1); color: #fff; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg-base); }
* { scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }

/* ================= shared motion ================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(40px, -30px) scale(1.12) rotate(8deg); }
  100% { transform: translate(-30px, 25px) scale(0.96) rotate(-6deg); }
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--success); }
  50% { opacity: 0.55; box-shadow: 0 0 16px var(--success); }
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.stagger-in > * { animation: fadeUp 420ms var(--ease-out) both; }
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 40ms; }
.stagger-in > *:nth-child(3) { animation-delay: 80ms; }
.stagger-in > *:nth-child(4) { animation-delay: 120ms; }
.stagger-in > *:nth-child(5) { animation-delay: 160ms; }
.stagger-in > *:nth-child(6) { animation-delay: 200ms; }
.stagger-in > *:nth-child(n+7) { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ================= login screen ================= */
#login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(var(--brand-1-rgb),0.16), transparent 70%),
    var(--bg-deep);
}

.login-photo {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(2,2,3,0.75) 0%, rgba(2,2,3,0.92) 70%, var(--bg-deep) 100%),
    url('https://images.unsplash.com/photo-1557683316-973673baf926?q=80&w=1600&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  filter: blur(2px) saturate(1.15);
  opacity: 0.55;
  transform: scale(1.06);
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.32;
  pointer-events: none;
  will-change: transform;
  animation: blobDrift 22s var(--ease-out) infinite alternate;
}
.login-blob.blob-a { width: 480px; height: 480px; background: var(--brand-1); top: -160px; left: -140px; }
.login-blob.blob-b { width: 560px; height: 560px; background: var(--brand-3); bottom: -180px; right: -120px; animation-duration: 28s; animation-delay: -9s; }
.login-blob.blob-c { width: 380px; height: 380px; background: var(--brand-2); top: 40%; left: 50%; margin-left: -190px; animation-duration: 34s; animation-delay: -15s; opacity: 0.2; }

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-5);
  animation: popIn 480ms var(--ease-spring);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  text-align: center;
}

.login-3d-stage {
  position: relative; width: 104px; height: 104px; margin: 0 auto var(--space-4);
  perspective: 900px;
  animation: fadeUp 500ms var(--ease-out) 80ms both, loginLogoFloat 5s ease-in-out 600ms infinite;
}
.login-3d-stage .logo-glow {
  position: absolute; inset: -70%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--brand-2-rgb),0.42), rgba(var(--brand-1-rgb),0.14) 60%, transparent 75%);
  filter: blur(28px);
  animation: loginGlowPulse 4.5s ease-in-out infinite;
}
.login-3d-stage .logo-ground-shadow {
  position: absolute; left: 50%; bottom: -12px; width: 72%; height: 16px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse, rgba(0,0,0,0.65), transparent 72%);
  transform: translateX(-50%); filter: blur(3px);
}
@keyframes loginGlowPulse { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.login-logo {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: 22px;
  background: var(--brand-gradient);
  padding: 3px;
  box-shadow: 0 0 0 1px var(--border-strong), 0 16px 34px -8px rgba(var(--brand-1-rgb),0.6), 0 0 34px -6px rgba(var(--brand-2-rgb),0.45);
  transform-style: preserve-3d; will-change: transform;
  transition: transform 500ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes loginLogoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-3d-stage { animation: fadeUp 500ms var(--ease-out) 80ms both; }
}
.login-logo img, .login-logo .login-logo-fallback {
  width: 100%; height: 100%; border-radius: 19px; object-fit: cover; display: block;
  background: var(--bg-elevated);
}
.login-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; color: #fff;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 var(--space-1);
  letter-spacing: -0.01em;
}

.login-card p.subtitle {
  color: var(--fg-muted);
  margin: 0 0 var(--space-5);
  font-size: 14px;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0 0 var(--space-5);
}
.login-features span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

/* ================= shared form elements ================= */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--space-2); color: var(--fg-muted); }
.field { margin-bottom: var(--space-4); }

input[type="text"], input[type="password"], input[type="time"], input[type="number"],
input[type="url"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 44px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
textarea { min-height: 88px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb),0.22);
  outline: none;
  background: var(--surface-solid);
}
select {
  cursor: pointer; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239093A6' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2F2F5' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F97316' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
select:disabled { cursor: not-allowed; opacity: 0.55; }
select option { background: var(--surface-solid); color: var(--fg); }

.field-color-wrap { position: relative; }
.field-color-swatch {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 22px; height: 22px; border-radius: 6px; pointer-events: none;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), 0 0 0 3px var(--bg-elevated);
}
.field-color-wrap input { padding-left: 44px; font-family: var(--font-mono); }

.helper-text { font-size: 12px; color: var(--fg-faint); margin-top: var(--space-1); }
.error-text { font-size: 13px; color: var(--danger); margin-top: var(--space-2); min-height: 18px; }

/* buttons */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease, opacity 150ms ease, box-shadow 200ms ease;
}
.btn::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 36%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-18deg); transition: left 600ms cubic-bezier(0.16,1,0.3,1); pointer-events: none;
}
.btn:hover::before { left: 130%; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled::before { display: none; }

.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 6px 16px -4px rgba(var(--brand-1-rgb),0.5); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 10px 28px -6px rgba(var(--brand-1-rgb),0.75), 0 0 0 1px rgba(var(--brand-3-rgb),0.3); }

.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--fg); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: rgba(var(--brand-1-rgb),0.5); box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb),0.12); }

.btn-destructive { background: transparent; border-color: rgba(239,68,68,0.4); color: var(--danger); }
.btn-destructive:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }

.btn-block { width: 100%; }

.btn-discord { background: var(--discord-blurple); color: #fff; text-decoration: none; }
.btn-discord:hover { background: var(--discord-blurple-hover); box-shadow: 0 0 0 4px rgba(var(--brand-1-rgb),0.25), 0 10px 24px -8px rgba(88,101,242,0.6); }
.btn-disabled-config { opacity: 0.5; pointer-events: none; }

.btn-icon { min-height: 36px; min-width: 36px; padding: 0; border-radius: var(--radius-sm); background: var(--surface); border-color: var(--border); }
.btn-icon:hover { background: var(--surface-hover); }
.btn-icon svg { width: 16px; height: 16px; }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-hover); border: 1px solid var(--border); transition: background 200ms ease, border-color 200ms ease, box-shadow 250ms ease; position: relative; flex-shrink: 0; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--fg-muted); box-shadow: 0 1px 3px rgba(0,0,0,0.4); transition: transform 220ms var(--ease-spring), background-color 150ms ease; }
.switch input:checked + .track { background: var(--brand-gradient); border-color: transparent; box-shadow: 0 0 14px -2px rgba(var(--brand-2-rgb),0.65); }
.switch input:checked + .track .thumb { transform: translateX(18px); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35), 0 0 6px rgba(255,255,255,0.5); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }
.switch .switch-label { font-size: 14px; font-weight: 500; }

/* chip / tag input (banned words) */
.chip-input { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 44px; }
.chip-input:focus-within { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb),0.22); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-hover); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 500; animation: popIn 180ms var(--ease-out); }
.chip button { background: none; border: none; color: var(--fg-muted); cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chip button:hover { background: var(--danger-bg); color: var(--danger); }
.chip-input input { flex: 1; min-width: 120px; border: none; background: none; min-height: 32px; padding: 4px; box-shadow: none !important; }

/* role pill picker (autorole) */
.role-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.role-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 600; transition: all 150ms ease; user-select: none; }
.role-pill:hover { border-color: rgba(var(--brand-1-rgb),0.4); background: var(--surface-hover); }
.role-pill.active { background: rgba(var(--brand-1-rgb),0.18); border-color: var(--brand-1); color: #fff; box-shadow: 0 0 0 1px rgba(var(--brand-1-rgb),0.3), 0 4px 14px -4px rgba(var(--brand-1-rgb),0.5); }
.role-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); flex-shrink: 0; transition: background-color 150ms ease, box-shadow 150ms ease; }
.role-pill.active .dot { background: var(--brand-3); box-shadow: 0 0 6px var(--brand-3); }

/* ================= app shell ================= */
#app-shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100dvh; animation: fadeIn 300ms var(--ease-out); }

#sidebar {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-base));
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; background: var(--brand-gradient); flex-shrink: 0; box-shadow: 0 4px 12px -2px rgba(var(--brand-1-rgb),0.5); }
.brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; font-size: 16px; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: dotPulse 2.4s ease-in-out infinite; margin-left: 2px; }

.nav-group-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); padding: var(--space-3) var(--space-3) 6px; }
nav.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  padding: 9px 12px 9px 16px; border-radius: var(--radius-sm); color: var(--fg-muted);
  cursor: pointer; border: 1px solid transparent; min-height: 40px; font-size: 13.5px; font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  background: none; text-align: left; width: 100%;
}
.nav-item svg { flex-shrink: 0; width: 17px; height: 17px; }
.nav-item:hover { background: var(--surface); color: var(--fg); }
.nav-item[aria-current="page"] { background: rgba(var(--brand-1-rgb),0.14); color: #fff; border-color: rgba(var(--brand-1-rgb),0.35); }
.nav-item[aria-current="page"]::before {
  content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 999px;
  background: var(--brand-gradient); box-shadow: 0 0 8px var(--brand-1);
}

#sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-hover) center/cover no-repeat; border: 1px solid var(--border); flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#main { padding: var(--space-6); max-width: 1080px; }

#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-6); flex-wrap: wrap;
  background: radial-gradient(120% 160% at 0% 0%, rgba(var(--brand-2-rgb),0.08), transparent 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- animated guild picker (replaces the plain native <select> visually) ---------- */
.guild-picker { position: relative; min-width: 280px; }
.guild-picker-trigger {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 6px 10px 6px 6px; cursor: pointer; text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.guild-picker-trigger:hover { background: var(--surface); border-color: var(--border); }
.guild-picker-trigger[aria-expanded="true"] {
  background: var(--surface); border-color: rgba(var(--brand-1-rgb),0.5);
  box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb),0.16);
}
.guild-picker-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.guild-picker-text .server-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-picker-chevron { width: 18px; height: 18px; color: var(--fg-faint); flex-shrink: 0; transition: transform 220ms var(--ease-spring); }
.guild-picker-trigger[aria-expanded="true"] .guild-picker-chevron { transform: rotate(180deg); color: var(--brand-2); }

.server-icon {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  background: var(--surface-hover) center/cover no-repeat; border: 1px solid var(--border); flex-shrink: 0;
  transition: background-image 200ms ease, box-shadow 300ms ease;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff;
}
.server-icon.is-swapping { animation: serverIconPop 420ms var(--ease-spring); }
@keyframes serverIconPop { 0% { transform: scale(0.7) rotate(-8deg); opacity: 0.4; } 60% { transform: scale(1.08) rotate(2deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.server-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.server-meta { font-size: 12px; color: var(--fg-muted); }

.guild-picker-panel {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  max-height: 360px; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.65), 0 0 0 1px rgba(var(--brand-1-rgb),0.08);
  padding: 6px;
}
.guild-picker-panel.is-open { display: block; }
.guild-picker-empty { padding: var(--space-4); text-align: center; font-size: 13px; color: var(--fg-faint); }
.guild-picker-option {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: 8px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: none; cursor: pointer; text-align: left; color: var(--fg);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.guild-picker-option:hover, .guild-picker-option:focus-visible { background: rgba(var(--brand-1-rgb),0.12); border-color: rgba(var(--brand-1-rgb),0.3); outline: none; }
.guild-picker-option[aria-selected="true"] { background: rgba(var(--brand-1-rgb),0.16); border-color: rgba(var(--brand-1-rgb),0.4); }
.guild-picker-option-icon {
  width: 32px; height: 32px; border-radius: 9px; background: var(--surface-hover) center/cover no-repeat; border: 1px solid var(--border);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: #fff;
}
.guild-picker-option-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.guild-picker-option-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-picker-option-meta { font-size: 11.5px; color: var(--fg-faint); }
.guild-picker-option-check { width: 16px; height: 16px; color: var(--brand-2); flex-shrink: 0; opacity: 0; }
.guild-picker-option[aria-selected="true"] .guild-picker-option-check { opacity: 1; }

h1.page-title {
  font-family: var(--font-display); font-size: 26px; margin: 0 0 var(--space-1); letter-spacing: -0.01em;
  display: flex; align-items: center; gap: var(--space-3);
}
p.page-subtitle { color: var(--fg-muted); margin: 0 0 var(--space-5); font-size: 14px; max-width: 640px; }

.page-title-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  background: var(--brand-gradient); color: #fff;
  box-shadow:
    0 10px 24px -8px rgba(var(--brand-1-rgb),0.6),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -7px 11px -5px rgba(0,0,0,0.3);
  transform-style: preserve-3d; will-change: transform;
  transition: transform 400ms var(--ease-spring);
}
.page-title-icon svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
@media (prefers-reduced-motion: reduce) {
  .page-title-icon { transition: none; }
}

[data-page-section]:not(.hidden) { animation: fadeUp 340ms var(--ease-out); }

.card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(160% 100% at 0% 0%, rgba(var(--brand-2-rgb),0.12), transparent 55%),
    var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 28px -20px rgba(0,0,0,0.6);
  transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.card:hover {
  border-color: rgba(var(--brand-1-rgb),0.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 20px 40px -24px rgba(var(--brand-1-rgb),0.55);
}
.card h2 {
  font-size: 15px; margin: 0 0 var(--space-4); font-weight: 700; font-family: var(--font-display);
  display: flex; align-items: center; gap: 8px;
}
.card h2::before {
  content: ''; width: 6px; height: 6px; border-radius: 2px; background: var(--brand-gradient); flex-shrink: 0;
  box-shadow: 0 0 8px rgba(var(--brand-2-rgb),0.6);
}

.row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.row + .row { margin-top: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.02em; }
.badge-on { background: var(--success-bg); color: var(--success); }
.badge-off { background: var(--surface-hover); color: var(--fg-muted); }
.badge-brand { background: rgba(var(--brand-1-rgb),0.16); color: #FDBA74; }

.schedule-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: var(--space-2); gap: var(--space-3); flex-wrap: wrap; animation: fadeUp 250ms var(--ease-out); background: var(--bg-elevated); }
.schedule-item .meta { font-size: 13px; color: var(--fg-muted); }
.schedule-item .chan { font-family: var(--font-mono); font-weight: 600; }

.empty-state { text-align: center; color: var(--fg-muted); padding: var(--space-6) var(--space-4); font-size: 14px; }
.empty-state code { background: var(--surface-hover); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }
.empty-state::before {
  content: ''; display: block; width: 44px; height: 44px; margin: 0 auto var(--space-3);
  border-radius: 50%; background: var(--surface-hover); border: 1px dashed var(--border-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239093A6' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v4l3 2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 20px;
}

/* ================= ticket option editor ================= */
.ticket-option-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); animation: fadeUp 250ms var(--ease-out) both;
}
.ticket-option-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.ticket-option-title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--fg-muted); }
.ticket-option-actions { display: flex; gap: 4px; }
.ticket-option-fields { display: grid; grid-template-columns: 70px 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-3); }
.ticket-option-fields .field { margin-bottom: 0; }
.ticket-option-qtitles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }
.ticket-option-qtitles .field { margin-bottom: 0; }
@media (max-width: 860px) {
  .ticket-option-fields, .ticket-option-qtitles { grid-template-columns: 1fr; }
}

/* ================= live badge & activity feed ================= */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--success);
  background: var(--success-bg); border: 1px solid rgba(34,197,94,0.3);
  padding: 4px 10px 4px 8px; border-radius: var(--radius-pill);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: dotPulse 1.6s ease-in-out infinite; }
.live-badge.is-paused { color: var(--fg-muted); background: var(--surface); border-color: var(--border); }
.live-badge.is-paused .live-dot { background: var(--fg-faint); animation: none; }
#overview-updated { font-size: 12.5px; color: var(--fg-faint); }

.activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: 13px; animation: fadeUp 300ms var(--ease-out) both;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface-hover); color: var(--fg-muted); margin-top: 1px;
}
.activity-icon svg { width: 13px; height: 13px; }
.activity-text { flex: 1; line-height: 1.5; }
.activity-text b { font-weight: 700; }
.activity-time { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; margin-top: 2px; }

/* ================= overview stat cards ================= */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.stat-card:hover {
  border-color: rgba(var(--brand-1-rgb),0.35); transform: translateY(-2px);
  box-shadow: 0 16px 30px -22px rgba(var(--brand-1-rgb),0.55);
}
.stat-card::after {
  content: ''; position: absolute; top: -40%; right: -30%; width: 140px; height: 140px; border-radius: 50%;
  background: var(--brand-gradient); opacity: 0.12; filter: blur(30px);
}
.stat-card .stat-label { font-size: 12px; color: var(--fg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; transition: color 200ms ease; }
.stat-card .stat-icon { position: absolute; top: var(--space-4); right: var(--space-4); width: 18px; height: 18px; color: var(--fg-faint); }
.stat-card.flash-up .stat-value { color: var(--success); animation: flashPop 900ms var(--ease-out); }
.stat-card.flash-down .stat-value { color: var(--danger); animation: flashPop 900ms var(--ease-out); }
@keyframes flashPop { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ================= skeleton loaders ================= */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm); }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-card { height: 90px; border-radius: var(--radius); }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; display: inline-block; }

/* ================= commands catalog page ================= */
.commands-toolbar { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; align-items: center; }
.commands-search { flex: 1; min-width: 220px; }
.commands-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--fg-muted); cursor: pointer;
  transition: all 150ms ease; white-space: nowrap;
}
.filter-chip:hover { color: var(--fg); border-color: var(--border-strong); }
.filter-chip.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

.commands-summary { font-size: 13px; color: var(--fg-muted); margin-bottom: var(--space-3); }

.commands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.command-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(var(--brand-2-rgb),0.09), transparent 60%),
    linear-gradient(165deg, var(--surface-hover) 0%, var(--surface) 65%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); display: flex; flex-direction: column; gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 200ms ease, transform 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}
.command-card::before {
  content: ''; position: absolute; top: -40%; left: -20%; width: 60%; height: 180%;
  background: linear-gradient(115deg, transparent, rgba(var(--brand-2-rgb),0.1), transparent);
  transform: translateX(-120%) skewX(-12deg); transition: transform 500ms ease; pointer-events: none;
}
.command-card:hover {
  border-color: rgba(var(--brand-1-rgb),0.45); transform: translateY(-2px); background-color: var(--surface-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 16px 30px -20px rgba(var(--brand-1-rgb),0.55), 0 0 0 1px rgba(var(--brand-2-rgb),0.18);
}
.command-card:hover::before { transform: translateX(220%) skewX(-12deg); }
.command-card.is-disabled { opacity: 0.55; }
.command-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.command-card-name {
  font-family: var(--font-mono); font-weight: 700; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 5px 11px; border-radius: var(--radius-sm);
  background: rgba(var(--brand-1-rgb),0.13); border: 1px solid rgba(var(--brand-1-rgb),0.3);
  color: #FDBA74;
}
.command-card-desc { font-size: 13px; color: var(--fg-muted); line-height: 1.5; flex: 1; }
.command-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 2px; border-top: 1px solid var(--border); margin-top: 2px; }
.command-card-foot .badge-brand { background: rgba(var(--brand-2-rgb),0.14); color: #FDBA74; border: 1px solid rgba(var(--brand-2-rgb),0.32); }
.type-pill { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.type-pill.type-slash { background: rgba(var(--brand-1-rgb),0.15); color: #FDBA74; border-color: rgba(var(--brand-1-rgb),0.32); }
.type-pill.type-prefix { background: rgba(var(--brand-3-rgb),0.15); color: #FDE68A; border-color: rgba(var(--brand-3-rgb),0.32); }

/* ================= toast ================= */
#toast {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px; max-width: 340px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: transform 200ms var(--ease-out), opacity 200ms ease; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.toast-error { border-color: var(--danger); }
#toast.toast-ok { border-color: var(--success); }

/* ================= language switcher =================
   Lives in one fixed spot in the layout — inside the login card before
   sign-in, inside the sidebar footer once inside the dashboard — never a
   floating element that chases you around while you scroll. app-motion.js
   moves the single #lang-picker node between the two slots below. */
.lang-picker-slot:empty { display: none; }
.lang-picker { position: relative; width: 100%; }
.lang-picker-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--fg);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color 150ms ease, box-shadow 200ms ease, background-color 150ms ease;
}
.lang-picker-trigger:hover { border-color: rgba(var(--brand-1-rgb),0.5); background: var(--surface-hover); }
.lang-picker-trigger[aria-expanded="true"] { border-color: rgba(var(--brand-1-rgb),0.6); box-shadow: 0 0 0 3px rgba(var(--brand-1-rgb),0.18); }
.lang-picker-flag { width: 19px; height: 14px; border-radius: 3px; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); background: var(--surface-hover); }
.lang-picker-flag svg, .lang-picker-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lang-picker-label { flex: 1; text-align: left; }
.lang-picker-chevron { width: 15px; height: 15px; color: var(--fg-faint); flex-shrink: 0; transition: transform 220ms var(--ease-spring); }
.lang-picker-trigger[aria-expanded="true"] .lang-picker-chevron { transform: rotate(180deg); color: var(--brand-2); }
.lang-picker-panel {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 -20px 50px -20px rgba(0,0,0,0.65), 0 0 0 1px rgba(var(--brand-1-rgb),0.08);
  padding: 8px; display: none; flex-direction: column; gap: 6px;
}
.lang-picker-panel.is-open { display: flex; }
.lang-picker-search {
  min-height: 36px !important; padding: 8px 12px !important; font-size: 13px !important;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.lang-picker-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lang-picker-option {
  display: flex; align-items: center; gap: 10px; width: 100%; flex-shrink: 0;
  padding: 9px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: none; cursor: pointer; text-align: left; color: var(--fg); font-size: 13px; font-weight: 600;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.lang-picker-option:hover, .lang-picker-option:focus-visible { background: rgba(var(--brand-1-rgb),0.12); border-color: rgba(var(--brand-1-rgb),0.3); outline: none; }
.lang-picker-option[aria-selected="true"] { background: rgba(var(--brand-1-rgb),0.16); border-color: rgba(var(--brand-1-rgb),0.4); }
.lang-picker-option .lang-picker-flag { width: 20px; height: 15px; }
.lang-picker-empty { text-align: center; padding: var(--space-4); font-size: 13px; color: var(--fg-faint); }

/* login-screen context: the trigger sits centered under the form, compact */
#lang-picker-slot-login { margin-top: var(--space-4); display: flex; justify-content: center; }
#lang-picker-slot-login .lang-picker { width: auto; min-width: 150px; }

/* ================= bot status page ================= */
.status-hero-card {
  display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap;
}
.status-orb-wrap { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.status-orb-glow {
  position: absolute; inset: -30%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--brand-2-rgb),0.25), transparent 75%);
  filter: blur(10px);
}
.status-orb {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface-hover); border: 1px solid var(--border-strong);
  transition: background 400ms ease, box-shadow 400ms ease, border-color 400ms ease;
}
.status-orb.is-connecting {
  background: radial-gradient(circle at 35% 30%, var(--fg-muted), var(--fg-faint) 70%);
  border-color: transparent;
  animation: statusOrbSoftPulse 1.4s ease-in-out infinite;
}
.status-orb.is-online {
  background: radial-gradient(circle at 35% 30%, #6ee7a0, var(--success) 70%);
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.14), 0 0 30px 4px rgba(34,197,94,0.5);
  animation: statusOrbPulse 2.4s ease-in-out infinite;
}
.status-orb.is-starting {
  background: radial-gradient(circle at 35% 30%, #fcd34d, var(--warning) 70%);
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(245,158,11,0.16), 0 0 26px 3px rgba(245,158,11,0.5);
  animation: statusOrbPulse 1.3s ease-in-out infinite;
}
.status-orb.is-offline {
  background: radial-gradient(circle at 35% 30%, #f9a8a8, var(--danger) 70%);
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(239,68,68,0.14), 0 0 24px 2px rgba(239,68,68,0.4);
}
@keyframes statusOrbPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(34,197,94,0.14), 0 0 30px 4px rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 0 0 10px rgba(34,197,94,0.10), 0 0 42px 8px rgba(34,197,94,0.65); }
}
@keyframes statusOrbSoftPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.status-hero-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.status-label { font-family: var(--font-display); font-size: 22px; font-weight: 700; transition: color 300ms ease; }
.status-label.is-connecting { color: var(--fg-muted); }
.status-label.is-online { color: var(--success); }
.status-label.is-starting { color: var(--warning); }
.status-label.is-offline { color: var(--danger); }
.status-sub { font-size: 13.5px; color: var(--fg-muted); max-width: 480px; line-height: 1.5; }
.status-hero-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.status-fleet { font-size: 12.5px; color: var(--fg-muted); font-weight: 600; white-space: nowrap; }
.status-updated { font-size: 11.5px; color: var(--fg-faint); white-space: nowrap; }

.status-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.status-metric-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.status-metric-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.status-metric-label { font-size: 12px; color: var(--fg-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.status-metric-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; transition: color 200ms ease; }
.status-metric-value.is-good { color: var(--success); }
.status-metric-value.is-ok { color: var(--warning); }
.status-metric-value.is-bad { color: var(--danger); }
.status-sparkline { width: 100%; height: 28px; display: block; }
.status-sparkline polyline { fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }

#status-refresh-btn svg { transition: transform 500ms var(--ease-spring); }
#status-refresh-btn.is-spinning svg { animation: statusRefreshSpin 800ms linear infinite; }
@keyframes statusRefreshSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .status-orb.is-online, .status-orb.is-starting, .status-orb.is-connecting { animation: none; }
  #status-refresh-btn.is-spinning svg { animation: none; }
}

/* ================= security score ================= */
.security-score-card {
  background:
    radial-gradient(70% 130% at 8% 15%, rgba(var(--brand-2-rgb),0.14), transparent 60%),
    linear-gradient(160deg, var(--surface), var(--surface-hover));
  border: 1px solid var(--border-strong);
}
.security-score-head { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-3); }
.security-score-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; min-width: 180px; }
.security-score-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.security-score-badge { font-family: var(--font-display); font-weight: 700; font-size: 13px; padding: 6px 16px; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.03em; transition: background 300ms ease, color 300ms ease; }
.security-score-badge.level-basic { background: var(--danger-bg); color: var(--danger); }
.security-score-badge.level-good { background: rgba(245,158,11,0.16); color: var(--warning); }
.security-score-badge.level-strong { background: rgba(var(--brand-2-rgb),0.18); color: #FDBA74; }
.security-score-badge.level-maximum { background: var(--success-bg); color: var(--success); }
.security-score-bar-track { width: 100%; height: 12px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); overflow: hidden; }
.security-score-bar-fill { height: 100%; border-radius: 999px; background: var(--brand-gradient); transition: width 500ms var(--ease-spring); box-shadow: 0 0 12px rgba(var(--brand-2-rgb),0.5); }
.security-score-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-3); }
.security-chip { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); color: var(--fg-muted); transition: all 200ms ease; }
.security-chip.is-active { background: var(--success-bg); border-color: rgba(34,197,94,0.35); color: var(--success); }

/* ---------- security gauge: animated 3D-ish radial ring ---------- */
.security-gauge {
  position: relative; width: 108px; height: 108px; flex-shrink: 0;
  filter: drop-shadow(0 8px 20px rgba(var(--brand-1-rgb),0.35));
}
.security-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.security-gauge-track { fill: none; stroke: var(--bg-elevated); stroke-width: 10; }
.security-gauge-fill {
  fill: none; stroke: url(#security-gauge-gradient); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 314.159; stroke-dashoffset: 314.159;
  transition: stroke-dashoffset 700ms var(--ease-spring);
}
.security-gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.security-gauge-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; }
.security-gauge-max { font-size: 10px; color: var(--fg-faint); font-weight: 600; letter-spacing: 0.03em; }
@media (prefers-reduced-motion: reduce) {
  .security-gauge-fill { transition: none; }
}

/* ================= sub-tabs (whitelist systems, etc.) ================= */
.subtab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.subtab { font-size: 12.5px; font-weight: 700; padding: 8px 16px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); color: var(--fg-muted); cursor: pointer; transition: all 150ms ease; }
.subtab:hover { color: var(--fg); border-color: var(--border-strong); }
.subtab.active { background: var(--brand-gradient); color: #fff; border-color: transparent; }

.section-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); }
.section-divider h2 { margin: 0; white-space: nowrap; }
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ================= panel list (ticket panels, invites, counting) ================= */
.panel-list { display: flex; flex-direction: column; gap: var(--space-3); }
.panel-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); flex-wrap: wrap; animation: fadeUp 250ms var(--ease-out) both; }
.panel-item-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.panel-item-meta { font-size: 12.5px; color: var(--fg-muted); margin-top: 2px; }
.panel-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.leaderboard-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: var(--surface); }

/* backend-not-yet-available notice, distinct from a plain empty state */
.empty-state-missing { text-align: center; color: var(--fg-muted); padding: var(--space-6) var(--space-4); font-size: 13.5px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty-state-missing .missing-badge { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warning); background: rgba(245,158,11,0.14); padding: 3px 10px; border-radius: 999px; margin-bottom: var(--space-2); }

.online-members-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.online-member { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 5px 12px 5px 5px; font-size: 12.5px; font-weight: 600; }
.online-member .om-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-hover) center/cover no-repeat; position: relative; }
.online-member .om-avatar::after { content:''; position:absolute; right:-1px; bottom:-1px; width:7px; height:7px; border-radius:50%; background:var(--success); border:1.5px solid var(--bg-elevated); }

/* ================= responsive ================= */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  #app-shell { grid-template-columns: 1fr; }
  #sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: var(--space-3); }
  .brand-name, .nav-group-label { display: none; }
  nav.nav-list { flex-direction: row; }
  .nav-item { padding: 9px 12px; }
  #sidebar-footer { margin-top: 0; margin-left: auto; border-top: none; padding-top: 0; flex-direction: row; align-items: center; }
  .user-name { display: none; }
  #main { padding: var(--space-4); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: var(--space-5) var(--space-4); }
  #topbar { flex-direction: column; align-items: stretch; }
  .guild-picker { min-width: 0; width: 100%; }
}
