:root {
  --bg: #0b0c10;
  --bg-2: #0f1116;
  --surface: #14161d;
  --surface-2: #1a1d26;
  --surface-3: #222631;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #eceef3;
  --text-2: #c3c7d2;
  --muted: #8a90a0;
  --accent: #e0b23a;
  --accent-2: #f3cf6b;
  --accent-ink: #1b1403;
  --accent-soft: rgba(224, 178, 58, 0.12);
  --accent-line: rgba(224, 178, 58, 0.35);
  --danger: #f06a5b;
  --danger-soft: rgba(240, 106, 91, 0.12);
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, 0.12);
  --blurple: #5865f2;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
  --topbar-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.55;
  font-size: 15px;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-2);
}

a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bg-aura {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(600px 300px at 15% -5%, rgba(224, 178, 58, 0.1), transparent 70%),
    radial-gradient(500px 300px at 90% 0%, rgba(88, 101, 242, 0.08), transparent 70%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-2), #a4790f) center / cover no-repeat;
  box-shadow: 0 6px 18px rgba(224, 178, 58, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.user-chip img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.user-chip .name {
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--danger);
}

/* ---------- Shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 80px;
}

.view {
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.tiny {
  font-size: 0.8rem;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--text-2);
}

.hint {
  margin: 4px 0 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.error-text {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.08s,
    filter 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(224, 178, 58, 0.22), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(240, 106, 91, 0.35);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-blurple {
  background: var(--blurple);
  color: #fff;
}

.btn-blurple:hover {
  filter: brightness(1.08);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-sm .ic {
  width: 15px;
  height: 15px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- Landing ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding: 36px 0 48px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 18px 0 18px;
}

.grad {
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 50%, #c98a12);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: 1.08rem;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 0 28px;
}

.lede strong {
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.fineprint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.fineprint strong {
  color: var(--text-2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill.online .dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.status-pill.offline .dot {
  background: var(--danger);
}

/* hero mock */
.hero-art {
  position: relative;
}

.hero-art::before {
  content: '';
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(224, 178, 58, 0.18), transparent);
  filter: blur(20px);
}

.mock {
  position: relative;
  display: grid;
  grid-template-columns: 30% 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
}

.mock-side,
.mock-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.mock-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mock-ava {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-2), #a4790f);
}

.mock-line {
  height: 8px;
  border-radius: 6px;
  background: var(--surface-3);
}

.mock-line.on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  height: 14px;
}

.w40 { width: 40%; }
.w50 { width: 50%; }
.w55 { width: 55%; }
.w60 { width: 60%; }
.w70 { width: 70%; }

.mock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mock-stats span {
  height: 52px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.mock-switch {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
}

.mock-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
}

.mock-switch.on {
  background: var(--accent);
}

.mock-switch.on::after {
  left: 15px;
  background: #fff;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
}

.feature:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.feature strong {
  display: block;
  margin: 12px 0 4px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.f-ic {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- Page heads ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-head .muted {
  margin-top: 4px;
}

.section-label {
  margin: 36px 0 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- Server picker ---------- */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.guild-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.15s,
    transform 0.15s,
    background 0.15s;
}

.guild-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(224, 178, 58, 0.1), rgba(88, 101, 242, 0.05) 45%, transparent 75%);
  pointer-events: none;
}

.guild-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.guild-card[aria-busy='true'] {
  opacity: 0.6;
  cursor: progress;
}

.guild-card .gc-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.guild-card .gc-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-card .gc-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.guild-card .gc-foot {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.guild-card .gc-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.guild-card.invite .gc-cta {
  color: var(--text-2);
}

.guild-card.invite {
  background: var(--bg-2);
  border-style: dashed;
}

.guild-ico {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-3);
  object-fit: cover;
  border: 2px solid var(--surface);
}

.guild-ico.letter {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text-2);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  grid-column: 1 / -1;
}

.empty .f-ic {
  width: 48px;
  height: 48px;
}

.empty p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
}

/* ---------- Dashboard ---------- */
.dash {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.dash-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  display: flex;
  flex-direction: column;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
}

.nav-back .ic {
  width: 16px;
  height: 16px;
}

.nav-back:hover {
  color: var(--accent);
}

.nav-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.nav-head .guild-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.nav-head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nav-head-text strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  margin: 16px 12px 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.8;
}

.tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
}

.tab:hover {
  color: var(--text);
  background: var(--surface);
}

.tab.active {
  color: var(--accent-2);
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.dash-main {
  min-width: 0;
}

/* ---------- Cards ---------- */
.card {
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.accent-card {
  background:
    linear-gradient(180deg, rgba(224, 178, 58, 0.06), transparent 60%),
    var(--surface);
  border-color: var(--accent-line);
}

.card-head {
  margin-bottom: 18px;
}

.card-head .muted {
  margin-top: 4px;
  font-size: 0.88rem;
}

.card-head.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-head.sub {
  margin: 22px 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.card.prose ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-2);
}

.card.prose li {
  margin-bottom: 8px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.split.builder {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.split > .card {
  margin-bottom: 0;
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  font: inherit;
  color: inherit;
}

button.stat {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

button.stat:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.stat .s-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--text-2);
}

.stat.on .s-ic {
  background: var(--ok-soft);
  color: var(--ok);
}

.stat.accent .s-ic {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
}

.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--muted);
}

.badge.on {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  min-width: 0;
}

.field > span {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.field-row.compact .field {
  margin-bottom: 12px;
}

.readonly {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  color: var(--muted);
}

input[type='text'],
input[type='number'],
input[type='url'],
textarea,
select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.92rem;
  padding: 10px 12px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}

input::placeholder,
textarea::placeholder {
  color: #5d6373;
}

input:hover,
textarea:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select:not([multiple]) {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

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

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

.search-field {
  position: relative;
}

.search-field .ic {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-field input {
  padding-left: 38px;
}

/* color input swatch */
.color-wrap {
  position: relative;
}

.color-wrap input[type='text'] {
  padding-left: 44px;
}

.color-wrap input[type='color'] {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: none;
  cursor: pointer;
}

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

.color-wrap input[type='color']::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

/* ---------- Switch rows ---------- */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.switch-row + .field,
.switch-row + .field-row {
  margin-top: 8px;
}

.sr-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-text strong {
  font-weight: 600;
  font-size: 0.92rem;
}

.sr-text small {
  color: var(--muted);
  font-size: 0.8rem;
}

input.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s;
}

input.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #9aa0ae;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition:
    transform 0.18s,
    background 0.18s;
}

input.switch:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input.switch:checked::after {
  transform: translateX(18px);
  background: #fff;
}

input.switch:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin-top: 26px;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
}

.mini-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.field-row.tk-embed-fields {
  grid-template-columns: 1fr 1.4fr auto;
  align-items: start;
}

/* ---------- Disclosure ---------- */
.disclosure {
  margin: 6px 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.disclosure summary {
  list-style: none;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.disclosure[open] summary::before {
  transform: rotate(45deg);
}

.disclosure[open] {
  padding: 0 14px 4px;
}

.disclosure[open] summary {
  padding: 12px 0;
}

/* ---------- Role / channel picker (enhanced multi-select) ---------- */
select.enhanced {
  display: none;
}

.picker {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}

.picker:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  min-height: 42px;
  align-items: center;
}

.picker-chips .placeholder {
  color: #5d6373;
  font-size: 0.88rem;
  padding: 0 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}

.chip .sw {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.chip button:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip button .ic {
  width: 12px;
  height: 12px;
}

.picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
}

.picker-search .ic {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.picker-search input[type='text'] {
  border: none;
  background: transparent;
  box-shadow: none !important;
  padding: 9px 0;
  min-height: 0;
  font-size: 0.85rem;
}

.picker-list {
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding: 4px;
}

.picker-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.picker-opt:hover {
  background: var(--surface-2);
  color: var(--text);
}

.picker-opt .box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
}

.picker-opt .box .ic {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  opacity: 0;
}

.picker-opt.sel {
  color: var(--text);
}

.picker-opt.sel .box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.picker-opt.sel .box .ic {
  opacity: 1;
}

.picker-opt .sw {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.picker-empty {
  padding: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Save bar ---------- */
.save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 12px 14px 12px 20px;
  border-radius: var(--radius);
  background: rgba(26, 29, 38, 0.92);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.save-bar.dirty {
  border-color: var(--accent-line);
}

.save-bar.dirty .muted::before {
  content: '● ';
  color: var(--accent);
}

/* ---------- Lists ---------- */
.panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-list.scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

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

.panel-row .muted.tiny {
  margin-top: 2px;
}

.invite-row .ir-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.invite-row .ir-side {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 10px;
}

.rank.r1 {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-row .who {
  display: flex;
  align-items: center;
  min-width: 0;
}

.board-row .count {
  font-weight: 700;
}

.list-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 0.88rem;
}

/* ---------- Ticket departments ---------- */
.dept-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 18px;
}

.dept-row {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.dept-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dept-row-head strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.dept-row-head strong::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-dept-remove {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.btn-dept-remove:hover {
  color: var(--danger);
  border-color: rgba(240, 106, 91, 0.35);
}

.dept-row .field > .muted.tiny {
  font-weight: 400;
  color: var(--muted);
}

.dept-summary {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.dept-summary strong {
  color: var(--text);
}

/* ---------- Discord preview ---------- */
.preview-card {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  background: #313338;
  border-color: rgba(0, 0, 0, 0.3);
}

.preview-card h3 {
  color: #dbdee1;
}

.dc-msg {
  display: flex;
  gap: 14px;
  font-family: 'gg sans', 'Noto Sans', var(--font);
}

.dc-ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, var(--accent-2), #a4790f) center / cover no-repeat;
}

.dc-body {
  min-width: 0;
  flex: 1;
}

.dc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.dc-name strong {
  color: #f2f3f5;
  font-weight: 600;
}

.dc-bot {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--blurple);
  color: #fff;
}

.dc-time {
  font-size: 0.72rem;
  color: #949ba4;
}

.dc-content {
  color: #dbdee1;
  font-size: 0.93rem;
  margin-bottom: 4px;
  word-break: break-word;
}

.dc-embed {
  display: flex;
  gap: 16px;
  max-width: 440px;
  padding: 10px 16px 14px 14px;
  border-radius: 4px;
  background: #2b2d31;
  border-left: 4px solid var(--embed-color, #1e1f22);
}

.dc-embed-main {
  min-width: 0;
  flex: 1;
}

.dc-title {
  color: #f2f3f5;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 4px 0;
  word-break: break-word;
}

.dc-desc {
  color: #dbdee1;
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.dc-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.dc-field b {
  display: block;
  color: #f2f3f5;
  font-size: 0.8rem;
}

.dc-field span {
  color: #dbdee1;
  font-size: 0.82rem;
}

.dc-foot {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #b5bac1;
}

.dc-thumb {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
}

.dc-placeholder {
  color: #80848e;
  font-style: italic;
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s ease;
  max-width: 360px;
  font-size: 0.9rem;
  font-weight: 500;
}

.toast::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.toast.ok::before {
  background: var(--ok);
}

.toast.err::before {
  background: var(--danger);
}

.toast.err {
  border-color: rgba(240, 106, 91, 0.4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Skeleton ---------- */
.skeleton {
  height: 118px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border: 1px solid var(--border);
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .split,
  .split.builder {
    grid-template-columns: 1fr;
  }
  .preview-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-art {
    max-width: 520px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .dash-nav {
    position: static;
    min-width: 0;
  }
  .nav-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .nav-group {
    display: none;
  }
  .tab {
    flex: none;
    background: var(--surface);
    border: 1px solid var(--border);
  }
  .tab.active {
    box-shadow: none;
    border-color: var(--accent-line);
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 20px 16px 80px;
  }
  .topbar {
    padding: 0 16px;
  }
  .brand-tag,
  .user-chip .name {
    display: none;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 18px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .field-row.tk-embed-fields {
    grid-template-columns: 1fr;
  }
  .mini-check {
    margin-top: 0;
  }
  .save-bar .muted {
    display: none;
  }
  .save-bar .btn {
    width: 100%;
  }
}
