:root {
  --bg: #171620;
  --sidebar-bg: #1b1a23;
  --surface: #21212b;
  --surface-2: #262530;
  --surface-3: #2d2b38;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(242,166,202,.24);
  --text: #f8f5fa;
  --muted: #aaa4b1;
  --muted-2: #817a88;
  --pink: #f2a6ca;
  --pink-strong: #e889bc;
  --pink-soft: #ffd5e8;
  --lavender: #c9a8ff;
  --green: #7edca9;
  --danger: #ff8fa1;
  --radius: 18px;
  --sidebar: 272px;
  --font: "Inter", sans-serif;
  --display: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% -5%, rgba(201,168,255,.09), transparent 30rem),
    radial-gradient(circle at 10% 7%, rgba(242,166,202,.08), transparent 27rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.ambient {
  position: fixed;
  z-index: -2;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .22;
}
.ambient-a { width: 360px; height: 360px; right: -140px; top: -110px; background: var(--lavender); }
.ambient-b { width: 320px; height: 320px; left: -150px; bottom: -110px; background: var(--pink); }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity .3s ease;
}
.boot-screen.done { opacity: 0; pointer-events: none; }
.boot-screen span { color: var(--muted); font-size: 14px; }

.sofra-orb, .auth-mark, .brand-orb, .hero-logo, .empty-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--pink-soft), var(--pink) 48%, var(--lavender));
  color: #281321;
  font-family: var(--display);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.sofra-orb { width: 58px; height: 58px; border-radius: 18px; font-size: 25px; animation: float 2.7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

.media-slot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.media-slot.has-media {
  padding: 0 !important;
  background: #15141c !important;
  color: transparent;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 76px 22px;
  position: relative;
}
.back-home {
  position: absolute;
  top: 26px;
  left: 28px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.back-home:hover { color: var(--text); }
.auth-card {
  width: min(650px, 100%);
  padding: 50px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(31,30,41,.94);
  box-shadow: 0 32px 100px rgba(0,0,0,.28);
  text-align: center;
}
.auth-mark { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 26px; font-size: 31px; }
.eyebrow {
  color: #d8a9c1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  margin-bottom: 7px;
}
.auth-card h1 {
  margin: 12px 0 16px;
  font: 700 clamp(34px, 5.5vw, 56px)/1.04 var(--display);
  letter-spacing: -.045em;
}
.auth-card > p {
  max-width: 540px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.discord-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--pink-soft), #d8c1ff);
  color: #21121d;
  text-decoration: none;
  font-weight: 800;
  transition: .18s ease;
}
.discord-login:hover { transform: translateY(-1px); filter: brightness(1.03); }
.discord-login svg { width: 21px; height: 21px; }
.security-note {
  max-width: 520px;
  margin: 24px auto 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  color: #948d9b;
  font-size: 12px;
  line-height: 1.55;
}
.security-note span { color: var(--pink); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0,1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  min-width: 0;
  padding: 20px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(27,26,35,.96);
}
.panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  color: inherit;
  text-decoration: none;
}
.brand-orb { width: 42px; height: 42px; border-radius: 14px; font-size: 19px; }
.panel-brand strong { display: block; font: 700 18px var(--display); letter-spacing: -.03em; }
.panel-brand small, .user-chip small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 11px; }

.guild-select-wrap {
  padding: 14px 8px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.guild-select-wrap label, .nav-group-title {
  color: #8d8492;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}
.guild-select-wrap label { display: block; margin-bottom: 8px; }
.guild-select-wrap select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #16151d;
  color: var(--text);
  font-size: 12px;
}
.guild-select-wrap select:focus { border-color: var(--line-strong); }

.panel-nav {
  min-height: 0;
  margin-top: 10px;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #3b3744 transparent;
}
.nav-group-title {
  padding: 15px 12px 6px;
}
.nav-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aaa3b1;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.035); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(242,166,202,.12), rgba(201,168,255,.05));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(242,166,202,.10);
}
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 24px;
  border-radius: 7px;
  color: #c59ab1;
  font-size: 15px;
}
.nav-item.active .nav-icon { color: var(--pink); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line);
}
.user-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.user-chip > div:last-child { min-width: 0; }
.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: #2a2732 center/cover no-repeat;
}
.user-chip strong {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.sidebar-footer > a { color: var(--muted-2); font-size: 11px; text-decoration: none; }
.sidebar-footer > a:hover { color: var(--text); }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgba(7,6,10,.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.workspace { min-width: 0; }
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 45;
  min-width: 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(23,22,32,.91);
  backdrop-filter: blur(18px);
}
.header-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.workspace-header h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 19px var(--display);
  letter-spacing: -.03em;
}
.workspace-header .eyebrow { margin-bottom: 2px; font-size: 8px; }
.mobile-menu {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}
.mobile-menu:hover { background: rgba(255,255,255,.04); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}
.btn.ghost { background: rgba(255,255,255,.025); color: #b9b2bf; }
.btn.ghost:hover { background: rgba(255,255,255,.055); color: var(--text); }
.btn.pink {
  border-color: rgba(242,166,202,.2);
  background: linear-gradient(135deg, var(--pink-soft), #d7baff);
  color: #24151f;
}
.btn.pink:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:disabled { opacity: .44; cursor: not-allowed; transform: none !important; filter: none !important; }
.unsaved-pill {
  padding: 7px 9px;
  border: 1px solid rgba(242,166,202,.16);
  border-radius: 999px;
  background: rgba(242,166,202,.07);
  color: #ffcbe1;
  font-size: 10px;
  font-weight: 700;
}

.empty-state {
  min-height: calc(100vh - 76px);
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 38px 22px;
  text-align: center;
}
.empty-icon { width: 60px; height: 60px; margin-bottom: 17px; border-radius: 19px; font-size: 25px; }
.empty-state h2 { margin: 0 0 7px; font: 700 24px var(--display); letter-spacing: -.03em; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

.content, .server-picker {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 32px 30px 84px;
}
.panel-page { display: none; min-width: 0; animation: fadeUp .22s ease; }
.panel-page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(33,33,43,.94);
  box-shadow: 0 14px 36px rgba(0,0,0,.10);
}
.hero-card {
  position: relative;
  min-height: 205px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 31px;
  background:
    radial-gradient(circle at 83% 8%, rgba(242,166,202,.13), transparent 35%),
    radial-gradient(circle at 70% 120%, rgba(201,168,255,.09), transparent 36%),
    var(--surface);
}
.hero-copy { min-width: 0; }
.hero-card h2 {
  margin: 15px 0 9px;
  font: 700 clamp(30px, 4.5vw, 48px)/1.05 var(--display);
  letter-spacing: -.045em;
}
.hero-card p { max-width: 590px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.hero-logo { width: 88px; height: 88px; margin-left: 20px; border-radius: 27px; font-size: 37px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: #c3bdc7;
  font-size: 10px;
}
.status-badge i { width: 7px; height: 7px; border-radius: 50%; background: #8c8592; }
.status-badge i.online { background: var(--green); box-shadow: 0 0 12px rgba(126,220,169,.45); }
.status-badge i.offline { background: var(--danger); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}
.stat-card { padding: 18px; }
.stat-card span {
  color: #8f8796;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.stat-card strong { display: block; margin: 7px 0 2px; font: 700 27px var(--display); }
.stat-card small { color: var(--muted-2); font-size: 10px; }

.section-heading {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 31px 0 14px;
}
.section-heading > div { min-width: 0; }
.section-heading h2 { margin: 0 0 5px; font: 700 24px var(--display); letter-spacing: -.035em; }
.section-heading p { max-width: 680px; margin: 0; color: #97909e; font-size: 12px; line-height: 1.55; }
.compact-heading { margin-top: 25px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.module-card {
  min-width: 0;
  padding: 18px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.module-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--surface-2); }
.module-card-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.module-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.module-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(242,166,202,.08);
  color: var(--pink);
  font-size: 17px;
}
.module-card h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.module-card p { margin: 10px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.module-state {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #918997;
  font-size: 9px;
}
.module-state.on { background: rgba(126,220,169,.09); color: #9ce6bd; }

.switch-row {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #c5bec9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.switch-row input, .feature-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i, .feature-toggle::after {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #34313d;
  transition: .18s ease;
}
.switch-row i::after, .feature-toggle::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #9b939f;
  transition: .18s ease;
}
.switch-row input:checked + i, .feature-toggle:has(input:checked)::after {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
}
.switch-row input:checked + i::after, .feature-toggle:has(input:checked)::before {
  transform: translateX(17px);
  background: #fff;
}

.two-column {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 13px;
}
.welcome-layout { grid-template-columns: minmax(0,1.08fr) minmax(340px,.92fr); }
.form-card { min-width: 0; padding: 21px; }
.narrow-form { width: min(730px,100%); }
.form-section-title {
  margin: 0 0 17px;
  color: #e8e1eb;
  font: 700 14px var(--display);
  letter-spacing: -.02em;
}
.form-card label {
  min-width: 0;
  display: block;
  margin: 0 0 15px;
  color: #c8c1cc;
  font-size: 11px;
  font-weight: 700;
}
.form-card label:last-child { margin-bottom: 0; }
.form-card small, label small {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}
.form-card input:not([type="checkbox"]):not([type="color"]),
.form-card textarea,
.form-card select,
.settings-grid input,
.settings-grid select,
.option-search {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #17161e;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-card input:not([type="checkbox"]):not([type="color"]),
.form-card select,
.settings-grid input,
.settings-grid select,
.option-search { min-height: 43px; }
.form-card textarea { min-height: 88px; padding-top: 11px; padding-bottom: 11px; resize: vertical; line-height: 1.55; }
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus,
.option-search:focus {
  border-color: rgba(242,166,202,.32);
  box-shadow: 0 0 0 3px rgba(242,166,202,.055);
}
.form-card select[multiple] {
  min-height: 116px;
  height: auto;
  padding: 6px;
}
.form-card select[multiple] option { padding: 7px 8px; border-radius: 6px; }
.form-card select[multiple] option:checked { background: #533447 linear-gradient(0deg,#533447,#533447); color: #fff; }

.split-fields { min-width: 0; display: grid; grid-template-columns: minmax(120px,.7fr) minmax(0,1.3fr); gap: 11px; }
.split-fields input[type="color"] {
  display: block;
  width: 100%;
  height: 43px;
  margin-top: 7px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #17161e;
}

.preview-card {
  min-width: 0;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.preview-label {
  margin-bottom: 14px;
  color: #817987;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}
.discord-preview {
  width: 100%;
  min-width: 0;
  margin: auto 0;
  padding: 17px 18px;
  overflow: hidden;
  border-left: 4px solid var(--pink);
  border-radius: 6px;
  background: #313338;
  color: #f2f3f5;
}
.preview-author { margin-bottom: 12px; color: #dbdee1; font-size: 11px; font-weight: 700; }
.preview-title { margin-bottom: 6px; color: #fff; font-size: 16px; font-weight: 800; line-height: 1.3; }
.preview-body { color: #dbdee1; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-image { display: block; width: 100%; max-height: 220px; margin-top: 13px; border-radius: 6px; object-fit: cover; }
.preview-footer { margin-top: 13px; color: #b5bac1; font-size: 9px; }

.settings-grid {
  min-width: 0;
  display: grid;
  gap: 12px;
}
.settings-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.checkbox-card {
  min-width: 0;
  min-height: 43px;
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #17161e;
  cursor: pointer;
}
.checkbox-card input {
  position: static;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--pink-strong);
}
.checkbox-card span {
  min-width: 0;
  color: #d2cbd5;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.category-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 11px;
  margin-bottom: 13px;
}
.category-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.category-top label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  color: #e4dde7;
  font-size: 11px;
  font-weight: 700;
}
.category-top input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: var(--pink-strong); }
.category-top span { min-width: 0; overflow-wrap: anywhere; }
.category-card select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #17161e;
  color: var(--text);
  font-size: 11px;
  text-transform: capitalize;
}

.feature-toggle {
  position: relative;
  min-width: 0;
  min-height: 66px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 !important;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.feature-toggle:last-of-type { border-bottom: 0; }
.feature-toggle > div { min-width: 0; padding-right: 58px; }
.feature-toggle strong { display: block; color: #eee9f0; font-size: 12px; }
.feature-toggle small { margin-top: 4px; }
.feature-toggle::after { content: ""; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.feature-toggle::before { top: 50%; right: 22px; left: auto; transform: translateY(-50%); }
.feature-toggle:has(input:checked)::before { transform: translate(17px,-50%); }

.read-only-field {
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
}
.read-only-field strong { display: block; margin-top: 7px; color: var(--pink-soft); font-size: 14px; }

.info-box {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(242,166,202,.11);
  border-radius: 11px;
  background: rgba(242,166,202,.045);
  color: #9e95a3;
  font-size: 10px;
  line-height: 1.55;
}
.reward-list { display: grid; gap: 10px; }
.reward-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1.5fr) minmax(110px,.6fr) 42px;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.reward-row label { min-width: 0; margin: 0; color: #c8c1cc; font-size: 10px; font-weight: 700; }
.reward-row select, .reward-row input {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin-top: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #17161e;
  color: var(--text);
  font-size: 11px;
}
.remove-reward {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #aaa2ad;
  font-size: 19px;
  cursor: pointer;
}
.remove-reward:hover { color: var(--danger); border-color: rgba(255,143,161,.2); }

.appearance-card { padding-bottom: 18px; }
.media-help { margin-bottom: 16px; }
.appearance-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 11px;
}
.media-field {
  min-width: 0;
  margin: 0 !important;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #1b1a23;
}
.media-field > span { display: block; min-width: 0; }
.media-field b { display: block; color: #e8e1ea; font-size: 11px; }
.media-field-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.media-demo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(242,166,202,.13);
  border-radius: 11px;
  background: rgba(242,166,202,.07);
  color: var(--pink);
  font-size: 17px;
}
.media-field input { margin-top: 0 !important; }

.server-picker { display: block; }
.picker-heading {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}
.picker-heading h2 { margin: 0 0 6px; font: 700 29px var(--display); letter-spacing: -.04em; }
.picker-heading p { max-width: 690px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.server-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.server-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(135deg,#3a3141,#26232d) center/cover no-repeat;
  color: var(--pink-soft);
  font-weight: 800;
}
.server-details { min-width: 0; }
.server-details h3 { margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.install-state { color: var(--muted-2); font-size: 10px; }
.install-state.installed { color: #9ce6bd; }
.server-action { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.server-empty { grid-column: 1/-1; padding: 24px; color: var(--muted); font-size: 12px; }

.toast-stack {
  position: fixed;
  z-index: 6000;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(340px, calc(100vw - 36px));
  gap: 8px;
}
.toast {
  padding: 12px 14px;
  border: 1px solid rgba(126,220,169,.18);
  border-radius: 11px;
  background: #25262d;
  color: #dbf5e6;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
  font-size: 11px;
  line-height: 1.45;
}
.toast.error { border-color: rgba(255,143,161,.18); color: #ffd4db; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8,7,10,.66);
  backdrop-filter: blur(5px);
}
.modal-card {
  width: min(430px,100%);
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #24232d;
  box-shadow: 0 26px 70px rgba(0,0,0,.35);
}
.modal-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(242,166,202,.10);
  color: var(--pink);
  font-weight: 800;
}
.modal-card h2 { margin: 0 0 8px; font: 700 21px var(--display); }
.modal-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 1040px) {
  :root { --sidebar: 244px; }
  .content, .server-picker { padding-left: 24px; padding-right: 24px; }
  .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-column, .welcome-layout { grid-template-columns: 1fr; }
  .preview-card { min-height: 300px; }
  .settings-grid.three { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  :root { --radius: 15px; }
  body { background: var(--bg); }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(86vw, 338px);
    max-width: 338px;
    padding: 18px 14px max(18px, env(safe-area-inset-bottom));
    transform: translateX(-103%);
    box-shadow: 26px 0 70px rgba(0,0,0,.28);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; }
  .sidebar.open + .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .panel-brand { padding-bottom: 15px; }
  .brand-orb { width: 40px; height: 40px; }
  .panel-brand strong { font-size: 17px; }
  .nav-group-title { padding-top: 13px; }
  .nav-item { min-height: 40px; }
  .sidebar-footer { padding-bottom: env(safe-area-inset-bottom); }

  .workspace-header {
    height: 70px;
    padding: 0 15px;
    gap: 10px;
  }
  .workspace-header .eyebrow { display: none; }
  .workspace-header h1 { font-size: 18px; }
  .mobile-menu { display: grid; place-items: center; }
  .header-actions {
    display: none;
  }
  .header-actions.active {
    position: fixed;
    z-index: 65;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(32,31,40,.96);
    box-shadow: 0 14px 45px rgba(0,0,0,.30);
    backdrop-filter: blur(18px);
  }
  .header-actions .unsaved-pill { margin-right: auto; align-self: center; }
  .header-actions .btn { min-height: 38px; padding: 0 12px; }
  .content, .server-picker {
    width: 100%;
    padding: 22px 16px calc(104px + env(safe-area-inset-bottom));
  }
  .empty-state { min-height: calc(100vh - 70px); }
  .hero-card {
    min-height: 0;
    align-items: flex-start;
    padding: 22px;
  }
  .hero-card h2 { font-size: clamp(28px,9vw,38px); }
  .hero-logo { width: 64px; height: 64px; margin-left: 4px; border-radius: 20px; font-size: 28px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 9px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 23px; }
  .section-heading {
    align-items: flex-start;
    gap: 14px;
    margin: 25px 0 12px;
  }
  .section-heading h2 { font-size: 21px; }
  .section-heading p { font-size: 11px; }
  .switch-row { margin-top: 2px; }
  .module-grid { grid-template-columns: 1fr; gap: 9px; }
  .module-card { padding: 15px; }
  .two-column, .welcome-layout { gap: 10px; }
  .form-card { padding: 16px; }
  .form-section-title { margin-bottom: 14px; }
  .split-fields { grid-template-columns: 1fr; gap: 0; }
  .preview-card { min-height: 0; padding: 16px; }
  .discord-preview { margin: 0; }
  .settings-grid.three { grid-template-columns: 1fr; gap: 10px; }
  .checkbox-card { min-height: 45px; }
  .category-grid { grid-template-columns: 1fr; gap: 9px; }
  .appearance-grid { grid-template-columns: 1fr; }
  .reward-row { grid-template-columns: minmax(0,1fr) 88px 40px; gap: 8px; }
  .server-grid { grid-template-columns: 1fr; }
  .picker-heading { align-items: flex-start; }
  .picker-heading h2 { font-size: 25px; }
  .server-card { grid-template-columns: 43px minmax(0,1fr) auto; padding: 14px; }
  .server-icon { width: 43px; height: 43px; }
  .server-action { min-height: 38px; padding: 0 11px; }
  .toast-stack { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
}

@media (max-width: 430px) {
  .content, .server-picker { padding-left: 12px; padding-right: 12px; }
  .workspace-header { padding-left: 10px; padding-right: 10px; }
  .hero-card { gap: 14px; padding: 18px; }
  .hero-logo { width: 54px; height: 54px; border-radius: 17px; font-size: 23px; }
  .hero-card p { font-size: 11px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .section-heading { flex-wrap: wrap; }
  .section-heading .switch-row { margin-left: auto; }
  .reward-row { grid-template-columns: 1fr 72px 38px; }
  .reward-row select, .reward-row input, .remove-reward { height: 40px; }
  .server-card { grid-template-columns: 42px minmax(0,1fr); }
  .server-action { grid-column: 1/-1; width: 100%; }
  .media-field-row { grid-template-columns: 38px minmax(0,1fr); }
  .media-demo { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
