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

:root {
  color-scheme: dark;

  /* Core Brand */
  --primary: #7c3aed;          /* electric purple */
  --primary-bright: #a855f7;   /* lighter purple */
  --primary-glow: rgba(124, 58, 237, 0.35);
  --on-primary: #ffffff;

  /* Legacy alias kept for compat */
  --accent-blue: #a855f7;

  /* Ink (text) */
  --ink: #f0f0f8;
  --ink-muted: #9ca3af;
  --ink-subtle: #6b7280;

  /* Surfaces — deep indigo-grey */
  --canvas: #0a0a0f;
  --surface-1: #13131f;
  --surface-2: #1a1a2e;
  --surface-3: #252540;

  /* Borders */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-soft: rgba(255, 255, 255, 0.04);

  /* Per-Module Accent Colors */
  --product-terraform: #a855f7;    /* purple — General / Roles */
  --product-terraform-bright: #c084fc;
  --product-vault: #f59e0b;        /* amber — Premium */
  --product-consul: #ef4444;       /* red — Antinuke / Automod */
  --product-waypoint: #06b6d4;     /* teal — Welcome */
  --product-waypoint-deep: #0891b2;
  --product-vagrant: #3b82f6;      /* blue — Music */
  --product-nomad: #10b981;        /* green — Leveling */
  --product-boundary: #f97316;     /* orange — VC Guard */
  --product-leetcode: #ffa116;     /* leetcode orange */

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --visited: #a855f7;

  /* Fonts */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Spacing Scale */
  --sp-hair: 1px;
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 96px;
}

/* Core reset & defaults */
* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  background: radial-gradient(ellipse at 30% 20%, #1a0f2e 0%, var(--canvas) 60%);
  color: var(--ink);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.50;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

#app {
  width: 100%;
  min-height: 100dvh;
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Links */
a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Typography styles */
h1 {
  font-family: var(--font-family);
  font-size: 56px; /* display-lg */
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -1.6px;
  margin: 0;
}

h2 {
  font-family: var(--font-family);
  font-size: 40px; /* display-md */
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: -1.0px;
  margin: 0;
}

h3 {
  font-family: var(--font-family);
  font-size: 22px; /* card-title */
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.4px;
  margin: 0;
}

h4 {
  font-family: var(--font-family);
  font-size: 20px; /* subhead */
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.2px;
  margin: 0;
}

/* Eyebrows - Labels above sections */
.eyebrow,
.nav-title,
.menu-title,
.field label {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.23;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: var(--sp-xs);
}

/* Boot & Login */
.boot,
.login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-lg);
  padding: var(--sp-lg);
  background: var(--canvas);
}

.login-card {
  width: min(520px, 100%);
  padding: var(--sp-xl);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  border-radius: 12px;
}

.login-card .brand-mark {
  width: 56px;
  height: 56px;
  margin-bottom: var(--sp-lg);
  font-size: 26px;
}

.login-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-xl);
  flex-wrap: wrap;
}

/* Brand Mark logo styling */
.brand-mark,
.guild-fallback {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink);
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

/* App Shell Layout */
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 64px minmax(calc(100dvh - 64px), auto);
  overflow: visible;
  background: var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  min-width: 0;
  height: 64px;
  padding: 0 var(--sp-lg);
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}

.brand,
.top-left,
.user-pill,
.guild-picker,
.guild-button,
.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-left {
  flex: 1 1 auto;
  overflow: visible;
}

.brand {
  flex: 0 0 auto;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.4px;
}

.brand .brand-mark {
  width: 30px;
  height: 30px;
}

/* Guild Switcher Dropdown */
.guild-picker {
  position: relative;
  flex: 1 1 260px;
  min-width: 130px;
  max-width: min(360px, 42vw);
}

.guild-button {
  width: 100%;
  min-height: 36px;
  padding: 3px 12px 3px 5px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-1);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
  font-weight: 500;
}

.guild-button:hover,
.guild-picker.open .guild-button {
  background: var(--surface-2);
  border-color: var(--ink-subtle);
}

.picker-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid var(--ink-muted);
  border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
}

.guild-picker.open .chevron {
  transform: rotate(225deg) translate(-2px, -1px);
}

.guild-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: none;
  width: min(360px, calc(100vw - 24px));
  max-height: min(360px, calc(100dvh - 80px));
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-1);
}

.guild-picker.open .guild-menu {
  display: block;
}

.menu-title {
  padding: 8px 12px;
  margin-bottom: 4px;
}

.guild-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  border: none;
  transition: background 0.12s ease;
}

.guild-option:hover,
.guild-option.active {
  background: var(--surface-2);
}

.guild-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.guild-option small {
  color: var(--ink-muted);
  font-size: 11px;
}

.guild-action {
  min-width: 58px;
  padding: 4px 8px;
  border-radius: 9999px; /* pill */
  text-align: center;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}

.guild-action.manage {
  color: var(--success);
  background: rgba(0, 202, 142, 0.12);
  border: 1px solid var(--success);
}

.guild-action.invite {
  color: var(--accent-blue);
  background: rgba(43, 137, 255, 0.12);
  border: 1px solid var(--accent-blue);
}

.menu-empty {
  padding: 12px;
  color: var(--ink-subtle);
}

/* User Pill Profile */
.user-pill {
  flex: 0 0 auto;
  gap: 8px;
  padding: var(--sp-xxs) var(--sp-sm) var(--sp-xxs) var(--sp-xxs);
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}

.user-identity {
  gap: 8px;
  min-width: 0;
}

.user-pill strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.logout-button {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 9999px;
  color: var(--ink-muted);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  border: none;
}

.logout-button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

/* Avatars & Icons - Rounded.full (circular) */
.avatar,
.guild-icon,
.brand-avatar,
.server-icon,
.discord-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9999px;
  overflow: hidden;
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
}

.avatar img,
.guild-icon img,
.brand-avatar img,
.server-icon img,
.discord-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
  opacity: 0;
}

.avatar.loaded img,
.guild-icon.loaded img,
.brand-avatar.loaded img,
.server-icon.loaded img,
.discord-avatar.loaded img {
  opacity: 1;
}

.avatar-letter {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.avatar.loaded .avatar-letter,
.guild-icon.loaded .avatar-letter,
.brand-avatar.loaded .avatar-letter,
.server-icon.loaded .avatar-letter {
  opacity: 0;
}

.guild-menu .guild-icon {
  width: 28px;
  height: 28px;
}

.guild-picker .guild-icon,
.user-pill .avatar {
  width: 27px;
  height: 27px;
}

/* Sidebar & Navigation */
.layout {
  display: flex;
  min-height: calc(100dvh - 64px);
  height: auto;
  overflow: visible;
}

.sidebar {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  align-self: start;
  min-height: calc(100dvh - 64px);
  max-height: calc(100dvh - 64px);
  padding: var(--sp-lg) var(--sp-md) var(--sp-lg) var(--sp-xl);
  overflow-y: auto;
  border-right: 1px solid var(--hairline);
  background: var(--canvas);
  flex: 0 0 344px;
  width: 344px;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xxs);
}

.nav-title {
  margin: var(--sp-md) 0 var(--sp-xxs) var(--sp-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink-muted);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
  border: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface-1);
}

.nav-item.active {
  color: var(--ink);
  background: var(--surface-2);
}

/* Page specific accents for active navigation items */
.nav-item[data-nav="general"].active,
.nav-item[data-nav="roles"].active,
.nav-item[data-nav="prefix"].active,
.nav-item[data-nav="overview"].active {
  box-shadow: inset 3px 0 0 var(--primary) !important;
  background: rgba(124, 58, 237, 0.12) !important;
}

.nav-item[data-nav="music"].active {
  box-shadow: inset 3px 0 0 var(--product-vagrant) !important;
}

.nav-item[data-nav="leveling"].active {
  box-shadow: inset 3px 0 0 var(--product-nomad) !important;
}

.nav-item[data-nav="vcguard"].active {
  box-shadow: inset 3px 0 0 var(--product-boundary) !important;
}

.nav-item[data-nav="welcome"].active {
  box-shadow: inset 3px 0 0 var(--product-waypoint) !important;
}

.nav-item[data-nav="leetcode"].active {
  box-shadow: inset 3px 0 0 var(--product-leetcode) !important;
}

.nav-item[data-nav="premium"].active {
  box-shadow: inset 3px 0 0 var(--product-vault) !important;
}

.nav-item[data-nav="automod"].active,
.nav-item[data-nav="antinuke"].active {
  box-shadow: inset 3px 0 0 var(--product-consul) !important;
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nav-icon,
.mini-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: var(--ink-muted);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  font-size: 10px;
  font-weight: 600;
}

.nav-icon svg,
.mini-icon svg {
  width: 14px;
  height: 14px;
}

.nav-item.active .nav-icon {
  color: var(--ink);
  background: var(--surface-3);
  border-color: var(--ink-subtle);
}

/* Nav Status Dot Indicator */
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--surface-3);
  flex: 0 0 auto;
}

.nav-dot.on {
  background: var(--success);
}

/* Content Area */
.content {
  min-width: 0;
  min-height: calc(100dvh - 64px);
  height: auto;
  overflow: visible;
  padding: var(--sp-xl) var(--sp-xxl) var(--sp-xxl) var(--sp-xl);
  background: var(--canvas);
  flex: 1 1 0%;
}

.page {
  width: 100%;
  max-width: 960px;
}

.page.wide {
  max-width: 1120px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: var(--sp-xl);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title h1 {
  font-size: 40px; /* display-md */
}

.page-title p {
  margin: var(--sp-xs) 0 0;
  color: var(--ink-muted);
  font-size: 16px;
}

.title-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  font-weight: 700;
  font-size: 22px;
}

.title-icon svg {
  width: 24px;
  height: 24px;
}

/* Accent labels */
.accent {
  color: var(--accent-blue);
}

/* Generic Layout Primitives */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-md);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Cards & Panels - Charcoal Surface Lift */
.card,
.panel,
.setting-row {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px; /* rounded.lg */
  background: var(--surface-1);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.card {
  min-height: 164px;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.card h3,
.panel h2 {
  margin: 0;
  font-size: 22px; /* card-title */
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.4px;
}

.card p,
.panel p,
.muted {
  color: var(--ink-muted);
}

.card p {
  margin: 0;
  font-size: 14px; /* body-sm */
  line-height: 1.71;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.panel {
  padding: var(--sp-lg);
}

.panel + .panel {
  margin-top: var(--sp-md);
}

.panel-head,
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title h2 {
  margin: 0;
}

.panel-title p {
  margin: var(--sp-xxs) 0 0;
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

.setting-grid.single {
  grid-template-columns: 1fr;
}

/* Fields & Helper Type */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  margin-bottom: 0;
}

.field small {
  color: var(--ink-subtle);
  font-size: 13px; /* caption */
  line-height: 1.38;
  margin-top: 4px;
}

.image-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--sp-xs);
  align-items: center;
}

.image-source-row > .input {
  min-width: 0;
}

.hidden-file {
  display: none;
}

/* Inputs, Textarea, Select */
.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 8px; /* rounded.md */
  background: var(--surface-1);
  outline: 0;
  font-size: 16px;
  padding: 10px 14px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.input:hover,
.select:hover,
.textarea:hover {
  background: var(--surface-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  background: var(--surface-1);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-1);
  border-color: var(--hairline-soft);
  color: var(--ink-subtle);
  cursor: not-allowed;
}

.input,
.select {
  min-height: 42px;
}

.select:not([multiple]) {
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.select[multiple] {
  height: 122px;
  padding: 8px;
}

.select option {
  color: var(--ink);
  background: var(--surface-2);
}

.select option:checked {
  background: var(--accent-blue);
  color: var(--white);
}

.textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.5;
}

/* Checklists & Lists */
.check-list {
  display: grid;
  gap: 6px;
  max-height: 172px;
  min-height: 44px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-1);
}

.check-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: var(--sp-xxs) var(--sp-xs);
  border-radius: 6px;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
}

.check-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.check-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Checkbox (20px x 20px, rounded.xs 4px) */
.check-box {
  width: 20px;
  height: 20px;
  border: 1px solid var(--ink-subtle);
  border-radius: 4px;
  background: var(--surface-2);
  position: relative;
}

.check-item input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
}

/* Purple checked icon — white checkmark inside purple box */
.check-item input:checked + .check-box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 4px;
  height: 8px;
  border: solid var(--on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-item input:focus + .check-box {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.check-item input:disabled + .check-box {
  border-color: var(--hairline-soft);
  background: var(--surface-1);
  cursor: not-allowed;
}

.check-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-empty {
  padding: 10px;
  color: var(--ink-subtle);
}

/* Buttons (Primary, Secondary, Ghost, Destructive) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px; /* rounded.md */
  font-family: var(--font-family);
  font-size: 14px; /* button */
  font-weight: 600;
  line-height: 1.29;
  cursor: pointer;
  text-decoration: none;
  padding: 10px 18px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

/* Primary Button (Electric Purple) */
.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn.primary:active {
  background: var(--primary);
}

/* Secondary Button (Charcoal surface-2) */
.btn:not(.primary):not(.danger):not(.ghost) {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.btn:not(.primary):not(.danger):not(.ghost):hover {
  background: var(--surface-3);
  border-color: var(--ink-subtle);
}

/* Ghost Button */
.btn.ghost {
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  border: none;
}

.btn.ghost:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* Danger Button (Consul red) */
.btn.danger {
  background: var(--product-consul);
  color: var(--on-primary);
}

.btn.danger:hover {
  background: #ff4c43;
}

/* Button Sizes */
.btn.small {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 32px;
}

.btn.medium {
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
}

.btn.large {
  padding: 16px 28px;
  font-size: 16px;
  min-height: 48px;
}

.btn:disabled {
  background: var(--surface-1);
  border-color: var(--hairline-soft);
  color: var(--ink-subtle);
  cursor: not-allowed;
}

/* Switches & Toggles (Modern round corner style) */
.toggle {
  display: inline-grid;
  align-items: center;
  width: 48px;
  height: 26px;
  padding: 3px;
  border-radius: 9999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.16s ease;
  border: 1px solid var(--hairline);
}

.toggle input {
  display: none;
}

.toggle:has(input:disabled) {
  border-color: var(--hairline-soft);
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle span {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: var(--ink-muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.toggle input:checked + span {
  transform: translateX(22px);
  background: var(--on-primary);
}

.toggle:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
}

/* Small Toggles for Cards and Sidebar */
.toggle.small {
  width: 32px;
  height: 18px;
  padding: 2px;
  border: 1px solid var(--hairline);
}

.toggle.small span {
  width: 12px;
  height: 12px;
}

.toggle.small input:checked + span {
  transform: translateX(14px);
}

.small-toggle {
  display: inline-grid;
  align-items: center;
  width: 32px;
  height: 18px;
  padding: 2px;
  border-radius: 9999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
  border: 1px solid var(--hairline);
  box-sizing: border-box;
}

.small-toggle span {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: var(--ink-muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.small-toggle.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.small-toggle.checked span {
  transform: translateX(14px);
  background: var(--on-primary);
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.card.disabled-card {
  opacity: 0.6;
  border-color: var(--hairline-soft);
}

.card.disabled-card h3,
.card.disabled-card p {
  color: var(--ink-subtle);
}

/* Pills & Chips */
.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 9999px; /* rounded.pill */
  background: var(--surface-1);
  color: var(--ink-muted);
  font-size: 13px; /* caption */
  font-weight: 500;
  line-height: 1.38;
}

/* Status variants */
.status-pill.on {
  color: var(--success);
  background: rgba(0, 202, 142, 0.12);
  border: 1px solid var(--success);
}

.status-pill.warn {
  color: var(--warning);
  background: rgba(255, 207, 37, 0.12);
  border: 1px solid var(--warning);
}

.status-pill.error,
.status-pill.bad {
  color: var(--error);
  background: rgba(230, 43, 30, 0.12);
  border: 1px solid var(--error);
}

/* Bottom Save bar */
.savebar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(140%);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 16px;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.15);
  z-index: 90;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.savebar.show {
  transform: translateX(-50%) translateY(0);
}

.savebar strong {
  white-space: nowrap;
  font-family: var(--font-family);
  font-size: 14px;
}

/* Preview Blocks */
.preview {
  padding: var(--sp-lg);
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}

/* Welcome Tabs */
.welcome-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  margin-bottom: var(--sp-lg);
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
}

.welcome-tabs button {
  min-width: 0;
  min-height: 38px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.welcome-tabs button.active {
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.dynamic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: var(--sp-md);
}

.dynamic-head h2 {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.dynamic-head p {
  max-width: 720px;
  margin: var(--sp-xs) 0 0;
  color: var(--ink-muted);
}

.toggle-with-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}

.dynamic-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: var(--sp-md);
  align-items: start;
}

.dynamic-library {
  display: grid;
  gap: var(--sp-md);
}

.dynamic-card {
  display: grid;
  gap: var(--sp-xs);
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-1);
}

.dynamic-card.active {
  border-color: var(--product-waypoint);
  background: var(--surface-2);
}

.dynamic-card-preview {
  width: 100%;
  min-height: 164px;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  cursor: pointer;
}

.dynamic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.dynamic-card-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.dynamic-card-meta span {
  color: var(--ink-subtle);
  font-size: 12px;
}

.dynamic-card-actions {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.dynamic-new {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: var(--sp-lg);
  border: 1px dashed var(--ink-subtle);
  border-radius: 12px;
  color: var(--ink-muted);
  background: var(--surface-1);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.dynamic-new span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: var(--sp-xs);
  border-radius: 9999px;
  background: var(--surface-2);
  font-size: 18px;
}

.dynamic-new:hover {
  background: var(--surface-2);
  border-color: var(--ink-muted);
}

.dynamic-editor {
  margin-top: 0;
}

.image-editor-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

.image-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 380px;
  padding: var(--sp-lg);
  overflow: hidden;
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  background: var(--canvas);
}

.dynamic-svg {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  touch-action: none;
  user-select: none;
}

.dynamic-svg .dynamic-layer {
  cursor: move;
}

.dynamic-svg .layer-outline {
  stroke: var(--accent-blue);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.dynamic-svg .resize-handle {
  fill: var(--accent-blue);
  stroke: var(--ink);
  stroke-width: 2;
  cursor: nwse-resize;
  vector-effect: non-scaling-stroke;
}

.dynamic-svg .layer-hitbox {
  pointer-events: all;
}

.editor-controls-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--sp-lg);
  align-items: start;
}

.layer-panel,
.inspector-panel {
  min-width: 0;
}

.layer-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}

.layer-panel strong {
  margin-bottom: 4px;
}

.layer-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink-muted);
  background: var(--surface-2);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--hairline);
  transition: background 0.12s ease, color 0.12s ease;
}

.layer-panel button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.layer-panel button.active {
  background: var(--on-primary);
  color: var(--primary);
  border-color: var(--on-primary);
}

.layer-panel button span {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--surface-3);
  border-radius: 4px;
  text-transform: uppercase;
}

.layer-panel button.active span {
  background: var(--surface-2);
  color: var(--ink);
}

.layer-add-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--hairline);
}

.layer-add-row button {
  min-height: 32px;
  color: var(--ink);
  background: var(--surface-3);
  justify-content: center;
}

.layer-add-row button:hover {
  background: var(--surface-2);
}

.layer-action-strip {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.inspector-panel {
  background: var(--surface-1);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  max-height: 560px;
  overflow-y: auto;
}

.inspector-section-title {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
  grid-column: 1 / -1;
}

.inspector-section-title:first-of-type {
  margin-top: 0;
}

.layer-enabled-row {
  min-height: 44px;
  padding: 0 2px;
  grid-column: 1 / -1;
}

/* Color input */
input[type="color"].input {
  padding: 4px;
  height: 44px;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

input[type="color"].input::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"].input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

input[type="color"].input::-moz-color-swatch {
  border: none;
  border-radius: 4px;
}

/* Discord Mock Message */
.discord-message {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: var(--sp-md);
  background: var(--canvas);
}

.discord-avatar {
  width: 42px;
  height: 42px;
}

.discord-name {
  font-weight: 600;
}

.discord-bot {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #5865f2;
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
}

.discord-content {
  margin-top: 4px;
  color: var(--ink-muted);
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Mini stat badges */
.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.mini-stat {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
}

.mini-stat strong {
  display: block;
  font-family: var(--font-family);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
}

.mini-stat span {
  color: var(--ink-subtle);
  font-weight: 600;
}

/* Server Selector */
.page.server-chooser-page {
  max-width: none;
  width: 100%;
}

.server-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  align-items: end;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.server-tools {
  display: grid;
  gap: var(--sp-xs);
  padding: var(--sp-md);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-1);
}

.server-search {
  min-height: 42px;
}

.server-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.server-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}

.server-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-md);
  margin: var(--sp-xxs) 0 var(--sp-md);
}

.server-section-head h2 {
  font-size: 28px;
}

.server-section-head p {
  margin: var(--sp-xxs) 0 0;
  color: var(--ink-muted);
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: var(--sp-sm);
}

.server-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 86px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-muted);
}

.server-card[hidden] {
  display: none;
}

.server-card-main {
  min-width: 0;
}

.server-card h3 {
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-card p {
  margin: 5px 0 0;
  color: var(--ink-subtle);
}

.server-icon {
  width: 48px;
  height: 48px;
}

.server-status {
  min-width: 70px;
  padding: 4px 8px;
  border-radius: 9999px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.server-status.ready {
  color: var(--success);
  background: rgba(0, 202, 142, 0.12);
  border: 1px solid var(--success);
}

.server-status.invite {
  color: var(--accent-blue);
  background: rgba(43, 137, 255, 0.12);
  border: 1px solid var(--accent-blue);
}

.server-empty {
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  color: var(--ink-subtle);
  text-align: center;
  font-weight: 600;
  background: var(--surface-1);
}

/* Premium Status Badge Grid */
.premium-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.premium-status-card {
  margin: 0;
}

.premium-status-body {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding-left: 0;
}

.premium-status-body strong {
  font-size: 18px;
  font-weight: 600;
}

.premium-status-body span {
  color: var(--ink-muted);
}

/* Security Protections */
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-xs);
  margin-top: var(--sp-md);
}

.security-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-weight: 500;
}

.security-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  flex: 0 0 auto;
}

.security-dot.on {
  background: var(--success);
}

.empty {
  width: min(540px, 100%);
  padding: var(--sp-lg);
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}

/* Toast Messages */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: var(--sp-md);
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  z-index: 120;
  font-family: var(--font-family);
  font-size: 14px;
}

.toast.good {
  border-color: var(--success);
}

.toast.bad {
  border-color: var(--error);
}

/* Tooltips */
.tooltip {
  position: absolute;
  z-index: 100;
  max-width: 260px;
  padding: 8px 12px;
  background: var(--surface-3);
  color: var(--ink);
  font-family: var(--font-family);
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
}

/* Product Specific Chromatic Card and Button Overrides in Overview page using CSS :has() */
.card:has(button[data-nav="general"]),
.card:has(button[data-nav="roles"]) {
  border-color: var(--product-terraform);
}
.card:has(button[data-nav="general"]):hover,
.card:has(button[data-nav="roles"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(123, 66, 188, 0.12));
}
.card:has(button[data-nav="general"]) .btn,
.card:has(button[data-nav="roles"]) .btn {
  background: var(--product-terraform);
  color: var(--ink);
  border-color: var(--product-terraform);
}
.card:has(button[data-nav="general"]) .btn:hover,
.card:has(button[data-nav="roles"]) .btn:hover {
  background: var(--product-terraform-bright);
}

.card:has(button[data-nav="music"]) {
  border-color: var(--product-vagrant);
}
.card:has(button[data-nav="music"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(24, 104, 242, 0.12));
}
.card:has(button[data-nav="music"]) .btn {
  background: var(--product-vagrant);
  color: var(--ink);
  border-color: var(--product-vagrant);
}
.card:has(button[data-nav="music"]) .btn:hover {
  background: #3982ff;
}

.card:has(button[data-nav="leveling"]) {
  border-color: var(--product-nomad);
}
.card:has(button[data-nav="leveling"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(0, 202, 142, 0.12));
}
.card:has(button[data-nav="leveling"]) .btn {
  background: var(--product-nomad);
  color: var(--ink);
  border-color: var(--product-nomad);
}
.card:has(button[data-nav="leveling"]) .btn:hover {
  background: #14dfa6;
}

.card:has(button[data-nav="vcguard"]) {
  border-color: var(--product-boundary);
}
.card:has(button[data-nav="vcguard"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(242, 76, 83, 0.12));
}
.card:has(button[data-nav="vcguard"]) .btn {
  background: var(--product-boundary);
  color: var(--ink);
  border-color: var(--product-boundary);
}
.card:has(button[data-nav="vcguard"]) .btn:hover {
  background: #ff5f66;
}

.card:has(button[data-nav="welcome"]) {
  border-color: var(--product-waypoint);
}
.card:has(button[data-nav="welcome"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(20, 198, 203, 0.12));
}
.card:has(button[data-nav="welcome"]) .btn {
  background: var(--product-waypoint);
  color: var(--primary);
  border-color: var(--product-waypoint);
}
.card:has(button[data-nav="welcome"]) .btn:hover {
  background: var(--product-waypoint-deep);
}

.card:has(button[data-nav="premium"]) {
  border-color: var(--product-vault);
}
.card:has(button[data-nav="premium"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(255, 207, 37, 0.12));
}
.card:has(button[data-nav="premium"]) .btn {
  background: var(--product-vault);
  color: var(--primary);
  border-color: var(--product-vault);
}
.card:has(button[data-nav="premium"]) .btn:hover {
  background: #ffe066;
}

.card:has(button[data-nav="automod"]),
.card:has(button[data-nav="antinuke"]) {
  border-color: var(--product-consul);
}
.card:has(button[data-nav="automod"]):hover,
.card:has(button[data-nav="antinuke"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(230, 43, 30, 0.12));
}
.card:has(button[data-nav="automod"]) .btn,
.card:has(button[data-nav="antinuke"]) .btn {
  background: var(--product-consul);
  color: var(--ink);
  border-color: var(--product-consul);
}
.card:has(button[data-nav="automod"]) .btn:hover,
.card:has(button[data-nav="antinuke"]) .btn:hover {
  background: #ff3c30;
}

.card:has(button[data-nav="leetcode"]) {
  border-color: var(--product-leetcode);
}
.card:has(button[data-nav="leetcode"]):hover {
  background: linear-gradient(135deg, var(--surface-1), rgba(255, 161, 22, 0.12));
}
.card:has(button[data-nav="leetcode"]) .btn {
  background: var(--product-leetcode);
  color: var(--primary);
  border-color: var(--product-leetcode);
}
.card:has(button[data-nav="leetcode"]) .btn:hover {
  background: #ffb84d;
}

/* LeetCode Embed Config Components */
.var-ref-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  align-items: center;
  font-size: 0.85rem;
}
.var-ref-grid code {
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--product-leetcode);
  font-weight: 600;
}
.var-ref-grid span {
  color: var(--text-2);
}

.csv-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.csv-table-wrap {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.csv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.csv-table th,
.csv-table td {
  padding: 6px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.csv-table th {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.csv-table td:last-child {
  width: 36px;
  text-align: center;
}
.csv-table code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.82rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover {
  background: var(--surface-2);
}
.btn-icon.danger:hover {
  background: rgba(237, 66, 69, 0.15);
  color: #ED4245;
}
.btn-icon svg,
.btn-icon i {
  width: 14px;
  height: 14px;
}

/* Responsive Overrides */
@media (max-width: 980px) {
  .layout {
    flex-direction: column;
    min-height: calc(100dvh - 64px);
  }

  .sidebar {
    position: sticky;
    top: 64px;
    z-index: 3;
    max-width: 100%;
    min-height: 0;
    max-height: none;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
    flex: 0 0 auto;
    width: 100%;
  }

  .nav-group {
    flex-direction: row;
    align-items: center;
  }

  .nav-title {
    display: none;
  }

  .nav-item {
    width: max-content;
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid var(--hairline);
    border-radius: 0;
  }

  .content {
    min-height: calc(100dvh - 100px);
    height: auto;
    overflow: visible;
    padding: 24px 16px 92px;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand > span {
    display: none;
  }

  .grid,
  .grid.three,
  .security-grid,
  .dynamic-grid,
  .image-editor-grid,
  .editor-controls-grid,
  .setting-grid,
  .server-hero,
  .server-grid,
  .server-summary,
  .premium-status-grid,
  .mini-stat-grid {
    grid-template-columns: 1fr;
  }

  .dynamic-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layer-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layer-panel strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 8px;
    padding: 0 8px;
  }

  .guild-picker {
    flex-basis: auto;
    min-width: 0;
    max-width: none;
  }

  .guild-button {
    padding-right: 8px;
  }

  .guild-menu {
    left: 0;
    width: min(340px, calc(100vw - 16px));
  }

  .user-pill {
    gap: 6px;
    padding: 3px 6px 3px 4px;
  }

  .user-pill strong,
  .logout-button {
    display: none;
  }

  .sidebar {
    gap: 8px;
    padding: 10px 8px;
  }

  .sidebar-actions {
    flex: 0 0 auto;
  }

  .nav-group {
    flex: 0 0 auto;
  }

  .nav-item {
    min-height: 38px;
    padding: 0 10px;
  }

  .nav-dot {
    display: none;
  }

  .content {
    padding: 20px 10px 108px;
  }

  .page-head {
    margin-bottom: 20px;
  }

  .page-title {
    align-items: flex-start;
    gap: 12px;
  }

  .page-title h1 {
    font-size: 28px;
  }

  .page-title p {
    font-size: 15px;
  }

  .title-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 18px;
  }

  .panel,
  .card {
    padding: 15px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .panel-head > .toggle {
    flex: 0 0 auto;
  }

  .panel-title {
    align-items: flex-start;
  }

  .welcome-tabs {
    grid-template-columns: 1fr;
  }

  .dynamic-head {
    display: grid;
  }

  .toggle-with-label {
    justify-content: space-between;
    width: 100%;
  }

  .dynamic-library,
  .layer-panel,
  .field-pair,
  .color-grid,
  .image-source-row {
    grid-template-columns: 1fr;
  }

  .image-source-row .btn {
    width: 100%;
  }

  .dynamic-card-preview,
  .dynamic-new {
    min-height: 150px;
  }

  .image-stage {
    min-height: 220px;
    padding: 10px;
  }

  .card {
    min-height: auto;
  }

  .server-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .server-status {
    grid-column: 1 / -1;
    width: max-content;
  }

  .server-card .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .server-icon {
    width: 36px;
    height: 36px;
  }

  .card h3,
  .panel h2 {
    font-size: 18px;
  }

  .select[multiple] {
    height: 112px;
  }

  .check-list {
    max-height: 140px;
  }

  .check-item {
    min-height: 36px;
  }

  .discord-message {
    grid-template-columns: 34px 1fr;
    gap: 10px;
  }

  .discord-avatar {
    width: 34px;
    height: 34px;
  }

  .savebar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: translateY(140%);
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .savebar.show {
    transform: translateY(0);
  }
}

@media (max-width: 380px) {
  .btn {
    padding: 0 11px;
  }

  .nav-icon,
  .mini-icon {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .nav-label {
    gap: 8px;
  }
}
