:root {
  --bg: #0a0e14;
  --panel: #121821;
  --line: #243041;
  --text: #e7eef8;
  --muted: #8b9bb0;
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2a44 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #142033 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
aside {
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.92);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.logo { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  font-weight: 800;
}
.mark-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
a.discord-invite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #5865F2;
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
}
a.discord-invite[disabled], a.discord-invite.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.logo strong { display: block; }
.logo small { color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 6px; }
.nav {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.nav.active, .nav:hover {
  color: var(--text);
  background: #172033;
  border-color: var(--line);
}
.aside-foot { margin-top: auto; display: grid; gap: 8px; }
.aside-foot label { font-size: 12px; color: var(--muted); }
input {
  width: 100%;
  background: #0d131c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
}
button.ghost { background: #1b2636; }
main { padding: 24px 28px 40px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
h1 { margin: 0; font-size: 1.6rem; }
.muted { color: var(--muted); margin: 6px 0 0; }
.hidden { display: none !important; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card, .panel {
  background: rgba(18, 24, 33, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.card h3 { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat { margin: 8px 0 0; font-size: 2rem; font-weight: 700; }
.stat.sm { font-size: 1.2rem; }
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.table { display: grid; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 110px 1fr 1.2fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #0d131c;
  border-radius: 8px;
  border: 1px solid #1a2433;
  font-size: .92rem;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  background: #1e293b;
  color: #cbd5e1;
}
.tag.ban { background: rgba(239,68,68,.15); color: #fca5a5; }
.tag.kick { background: rgba(245,158,11,.15); color: #fcd34d; }
.tag.warn, .tag.detection { background: rgba(59,130,246,.15); color: #93c5fd; }
.steps { color: var(--muted); line-height: 1.7; }
code { color: #93c5fd; }
.wl-add { display: flex; gap: 8px; margin-bottom: 12px; }
.wl-add input { flex: 1; }
.tiny { font-size: 11px; margin: 6px 0 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip {
  background: #1a2330;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .85rem;
  color: #c7d2fe;
}
.hidden { display: none !important; }
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
.stack label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.stack h3 { margin: 22px 0 8px; font-size: 1rem; color: #9ec1ff; }
.stack input, .stack textarea {
  width: 100%;
  background: #0d131c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
.checks { display: grid; gap: 8px; margin: 10px 0; }
.checks label { color: var(--text); font-size: 0.92rem; margin: 0; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modules { display: grid; gap: 8px; }
.mod-row {
  display: grid;
  grid-template-columns: 1fr 110px 90px;
  gap: 8px;
  align-items: center;
  background: #0d131c;
  border: 1px solid #1a2433;
  border-radius: 8px;
  padding: 8px 10px;
}

/* —— Settings page —— */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 980px;
  padding-bottom: 48px;
}
.settings-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(18, 24, 33, 0.95);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.settings-hero h2 { margin: 0 0 6px; font-size: 1.35rem; }
.settings-hero .muted { margin: 0; max-width: 52ch; line-height: 1.5; }
.btn-save {
  flex-shrink: 0;
  background: linear-gradient(180deg, #4b8fff, #2563eb);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}
.settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0.96) 70%, transparent);
}
.settings-jump button {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #121821;
  cursor: pointer;
  font-family: inherit;
}
.settings-jump button:hover {
  color: var(--text);
  border-color: #3b82f6;
  background: #172033;
}
.settings-jump button.active {
  color: #fff;
  border-color: #3b82f6;
  background: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.settings-pane {
  scroll-margin-top: 0;
}
.settings-card {
  background: rgba(18, 24, 33, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px 22px;
  scroll-margin-top: 56px;
}
.settings-card-accent {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.settings-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1a2433;
}
.settings-card-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--text);
}
.settings-card-head .muted {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 70ch;
}
.settings-step {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #93c5fd;
  background: #0d131c;
  border: 1px solid #243041;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.field-grid-2 { grid-template-columns: 1fr 1fr; }
.field-span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #b6c4d8;
  margin: 0;
}
.field .req {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.7rem;
  margin-left: 4px;
  text-transform: uppercase;
}
.field .opt {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.7rem;
  margin-left: 4px;
  text-transform: uppercase;
}
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.settings-card input:not([type="checkbox"]):not([type="radio"]),
.settings-card textarea {
  width: 100%;
  background: #0d131c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.settings-card input[type="checkbox"],
.settings-card input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.4; }
.field-help, .hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.hint { margin-bottom: 10px; }
.check-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.check-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #1a2433;
  background: #0d131c;
  cursor: pointer;
  color: var(--text);
}
.check-card:hover { border-color: #334155; }
.check-card input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--accent);
}
.check-card strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.check-card small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.settings-page .modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.settings-page .mod-row {
  grid-template-columns: minmax(140px, 1.4fr) 140px 120px;
  padding: 12px 14px;
}
.settings-page .mod-row span:first-child {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.settings-footer-save {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px dashed #2a3a50;
  background: rgba(13, 19, 28, 0.7);
}
@media (max-width: 900px) {
  .field-grid,
  .field-grid-2,
  .check-cards { grid-template-columns: 1fr; }
  .settings-hero { flex-direction: column; }
  .settings-footer-save { flex-direction: column; align-items: stretch; }
  .settings-page .mod-row { grid-template-columns: 1fr; }
}
.settings-page .mod-en-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.settings-page .mod-en-label input { width: auto; }
.settings-page .mod-pun {
  width: 100%;
  background: #0d131c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* —— Motion —— */
@media (prefers-reduced-motion: no-preference) {
  @keyframes tabIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes paneIn {
    from { opacity: 0; transform: translateX(18px); filter: blur(2px); }
    to { opacity: 1; transform: none; filter: none; }
  }
  @keyframes titleIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes cardRise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes rowIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  @keyframes softPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12); }
  }

  .tab-enter {
    animation: tabIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .pane-enter {
    animation: paneIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .title-enter {
    animation: titleIn 0.28s ease both;
  }

  .nav {
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  }
  .nav:hover { transform: translateX(3px); }
  .nav.active {
    transform: translateX(3px);
    border-color: rgba(59, 130, 246, 0.45);
    background: linear-gradient(90deg, #1a2740, #172033);
  }

  .cards .card {
    animation: cardRise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .cards .card:nth-child(1) { animation-delay: 0.02s; }
  .cards .card:nth-child(2) { animation-delay: 0.07s; }
  .cards .card:nth-child(3) { animation-delay: 0.12s; }
  .cards .card:nth-child(4) { animation-delay: 0.17s; }
  .cards .card:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.4);
  }

  .panel, .settings-hero, .settings-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }
  .settings-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
  }

  .settings-jump button {
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  }
  .settings-jump button:hover { transform: translateY(-1px); }
  .settings-jump button.active {
    animation: softPulse 1.8s ease infinite;
  }

  .btn-save, a.discord-invite, button:not(.nav):not(.ghost):not([data-settings-tab]) {
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.2s ease;
  }
  .btn-save:hover, a.discord-invite:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }
  .btn-save:active, a.discord-invite:active, button:active {
    transform: translateY(1px);
  }

  .check-card {
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  }
  .check-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
  }

  .row, .mod-row {
    animation: rowIn 0.28s ease both;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  }
  .row:hover, .mod-row:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateX(2px);
  }

  .field input, .field textarea, .settings-card input:not([type="checkbox"]), .settings-card textarea {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .field input:focus, .field textarea:focus,
  .settings-card input:not([type="checkbox"]):focus,
  .settings-card textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  }

  .user-chip {
    transition: transform 0.2s ease, border-color 0.2s ease;
  }
  .mark-img {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .logo:hover .mark-img {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  }

  aside {
    animation: tabIn 0.4s ease both;
  }
  main {
    animation: tabIn 0.45s 0.05s ease both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-enter, .pane-enter, .title-enter,
  .cards .card, .row, .mod-row, aside, main {
    animation: none !important;
  }
}

/* Only WH overview switch */
.onlywh-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(34, 197, 94, 0.08), transparent 45%),
    rgba(18, 24, 33, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.onlywh-card.is-on {
  border-color: rgba(45, 212, 191, 0.45);
  background:
    linear-gradient(120deg, rgba(45, 212, 191, 0.14), transparent 50%),
    rgba(18, 24, 33, 0.95);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12), 0 16px 40px rgba(0, 0, 0, 0.25);
}
.onlywh-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.onlywh-card h2 {
  margin: 4px 0 6px;
  font-size: 1.35rem;
}
.onlywh-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.onlywh-state {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
}
.onlywh-card.is-on .onlywh-state {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.12);
}
.switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 32px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: #1a2330;
  border: 1px solid var(--line);
  transition: 0.2s ease;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #94a3b8;
  transition: 0.2s ease;
}
.switch input:checked + .slider {
  background: rgba(45, 212, 191, 0.25);
  border-color: rgba(45, 212, 191, 0.5);
}
.switch input:checked + .slider::before {
  transform: translateX(26px);
  background: #5eead4;
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.55);
}
@media (max-width: 720px) {
  .onlywh-card { flex-direction: column; align-items: flex-start; }
}
