/* Interstice dashboard — single lightweight stylesheet, no build step. */
:root {
  --bg: #0a0b11;
  --bg-soft: #0e1018;
  --panel: #131621;
  --panel-2: #181c2a;
  --panel-3: #1e2334;
  --border: #252a3b;
  --border-soft: #1d2130;
  --text: #f1f2f8;
  --text-soft: #c9ccdc;
  --muted: #888ea6;
  --muted-2: #626880;
  --accent: #8b7cf6;
  --accent-strong: #7565ef;
  --accent-soft: rgba(139, 124, 246, 0.14);
  --blue: #38bdf8;
  --green: #43d19a;
  --green-soft: rgba(67, 209, 154, 0.12);
  --yellow: #f0c45c;
  --yellow-soft: rgba(240, 196, 92, 0.12);
  --red: #f07373;
  --red-soft: rgba(240, 115, 115, 0.12);
  --discord-bg: #313338;
  --discord-panel: #2b2d31;
  --discord-container: #232428;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: rgba(139, 124, 246, 0.35); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #30364c transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #30364c; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- primitives ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.kicker {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #c9c4ff;
  background: rgba(139, 124, 246, 0.09);
  border: 1px solid rgba(139, 124, 246, 0.22);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(67, 209, 154, 0.12);
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #3a4058; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 40px; width: auto; }
.brand-name { color: var(--text); font-size: 19px; font-weight: 720; letter-spacing: -0.035em; }
.brand-compact { gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; }
.brand-compact img { width: 30px; height: 30px; }
.brand-small { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.brand-small img { width: 22px; height: 22px; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--panel-3); }
.avatar-sm { width: 26px; height: 26px; }
.avatar-lg { width: 38px; height: 38px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-soft); font-size: 13px; font-weight: 550;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.015);
}
.lang-switch { display: inline-flex; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.lang-switch a, .lang-switch button {
  background: transparent; border: 0; color: var(--muted);
  padding: 5px 9px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.lang-switch a.active, .lang-switch button.active { background: var(--panel-3); color: var(--text); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 14px; font-weight: 600; font-size: 13px;
  background: var(--panel-2); color: var(--text);
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-strong); color: #fff; box-shadow: 0 8px 22px rgba(117, 101, 239, .2); }
.btn-primary:hover { background: #8577f7; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-soft); }
.btn-ghost:hover { background: var(--panel); border-color: #333950; }
.btn-ghost.active { background: var(--accent-soft); border-color: rgba(139,124,246,.35); color: #d9d4ff; }
.btn-danger { background: rgba(240, 115, 115, .12); color: #ffabab; border-color: rgba(240, 115, 115, .24); }
.btn-danger:hover { background: rgba(240, 115, 115, .2); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 12px 20px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border-soft); border-radius: 8px;
  background: var(--panel); color: var(--text-soft); font-size: 15px;
}
.icon-btn:hover { background: var(--panel-3); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 99px;
  background: var(--accent-soft); color: #c5bdff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.badge.green { background: var(--green-soft); color: #9ee9cb; }
.badge.red { background: var(--red-soft); color: #ffb1b1; }
.badge.gray { background: var(--panel-3); color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 99px;
  padding: 6px 11px; font-size: 11px; color: var(--muted);
}
.status-pill.danger { border-color: rgba(240,115,115,.25); color: #ffb3b3; background: var(--red-soft); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(67,209,154,.1); }
.status-dot.offline { background: var(--red); }
.notice {
  display: flex; gap: 8px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); padding: 12px 14px; color: var(--text-soft);
  font-size: 13px; margin-bottom: 16px;
}
.notice strong { white-space: nowrap; }
.notice-warning { border-color: rgba(240,196,92,.22); background: var(--yellow-soft); color: #f6df9f; }
.notice-danger { border-color: rgba(240,115,115,.24); background: var(--red-soft); color: #ffc0c0; }
.notice-info { border-color: rgba(56,189,248,.2); background: rgba(56,189,248,.08); color: #b9e9ff; }
.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

/* ---------- landing ---------- */
.landing-body {
  position: relative; overflow-x: hidden; min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1100px 700px at 18% -10%, rgba(124, 108, 246, .2), transparent 60%),
    radial-gradient(900px 600px at 92% 10%, rgba(56, 189, 248, .08), transparent 55%),
    #090a10;
}
.ambient { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; opacity: .35; }
.ambient-a { width: 420px; height: 420px; background: #4c3fbb; top: 500px; left: -250px; }
.ambient-b { width: 360px; height: 360px; background: #0e7490; top: 150px; right: -220px; opacity: .2; }
.site-header {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1220px; width: 100%; margin: 0 auto; padding: 24px 28px;
}
.button-reset { border: 0; background: transparent; padding: 0; color: inherit; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.hero {
  position: relative; z-index: 1;
  max-width: 1220px; width: 100%; margin: 0 auto; padding: 74px 28px 40px;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: 60px; align-items: center;
}
.hero-simple { flex: 1; min-height: calc(100vh - 170px); padding-top: 48px; padding-bottom: 60px; position: relative; overflow: hidden; }
.hero-banner {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .18;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.8) 45%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.8) 45%, transparent 95%);
}
.hero-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-copy, .hero-visual { position: relative; z-index: 1; min-width: 0; }
.hero-copy h1 {
  font-size: clamp(44px, 5vw, 68px); font-weight: 720; letter-spacing: -0.045em;
  margin: 22px 0 20px; max-width: 620px;
  background: linear-gradient(115deg, #fff 20%, #d8d2ff 55%, #9fd8fa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: #c0c6da; font-size: 17px; line-height: 1.65; max-width: 540px; }
.hero-actions { display: flex; align-items: stretch; gap: 12px; margin: 30px 0 22px; flex-wrap: wrap; }
.discord-mark { font-size: 16px; }
.hero-meta { display: flex; gap: 12px; align-items: center; color: var(--muted-2); font-size: 12px; margin-top: 18px; }
.hero-visual { position: relative; }
.mock-window {
  border: 1px solid rgba(255,255,255,.09); border-radius: 18px; overflow: hidden;
  background: #10121b; box-shadow: 0 35px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(139,124,246,.06) inset;
  transform: perspective(1400px) rotateY(-7deg) rotateX(2deg);
  transition: transform .4s ease;
}
.mock-window:hover { transform: perspective(1400px) rotateY(-2deg) rotateX(0); }
.mock-top { display: flex; align-items: center; gap: 6px; padding: 11px 13px; background: #171a25; border-bottom: 1px solid #222737; }
.mock-top span { width: 8px; height: 8px; border-radius: 50%; background: #3a4055; }
.mock-top span:first-child { background: #e05d64; }
.mock-top span:nth-child(2) { background: #d9a343; }
.mock-top span:nth-child(3) { background: #47b97b; }
.mock-top b { margin-left: auto; color: #777e98; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.mock-body { display: grid; grid-template-columns: 128px 1fr; min-height: 360px; }
.mock-sidebar { background: #0d0f16; border-right: 1px solid #202533; padding: 18px 13px; }
.mock-server { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, #8b7cf6, #38bdf8); margin-bottom: 20px; opacity: .9; }
.mock-line { height: 7px; background: #242a3c; border-radius: 4px; margin: 13px 0; }
.mock-content { padding: 26px 26px 30px; background: #161923; }
.mock-heading { width: 45%; height: 14px; border-radius: 5px; background: #30374c; margin-bottom: 22px; }
.mock-card { border-radius: 10px; background: #1c202d; padding: 18px; margin-bottom: 15px; }
.mock-card.container-accent { border-left: 3px solid var(--accent); }
.mock-line.w-90 { width: 90%; } .mock-line.w-80 { width: 80%; } .mock-line.w-70 { width: 70%; }
.mock-line.w-60 { width: 60%; } .mock-line.w-50 { width: 50%; }
.mock-sep { height: 1px; background: #2b3142; margin: 17px 0; }
.mock-buttons { display: flex; gap: 8px; }
.mock-btn { width: 84px; height: 27px; border-radius: 6px; background: #2c3245; }
.mock-btn.primary { background: var(--accent-strong); }
.mock-row { display: flex; gap: 7px; margin-top: 16px; }
.mock-chip { height: 22px; width: 62px; background: #272d3e; border-radius: 5px; }
.features { position: relative; z-index: 1; max-width: 1220px; margin: 0 auto; padding: 70px 28px 90px; }
.section-head { max-width: 660px; margin-bottom: 28px; }
.section-head h2 { font-size: 34px; letter-spacing: -0.035em; font-weight: 680; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-card {
  border: 1px solid var(--border-soft); border-radius: 16px;
  background: linear-gradient(160deg, rgba(24,28,42,.8), rgba(14,16,24,.7));
  padding: 22px; min-height: 205px;
}
.feature-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 19px; margin-bottom: 20px; background: var(--accent-soft); color: #c7beff;
  border: 1px solid rgba(139,124,246,.18);
}
.feature-icon.green { background: var(--green-soft); color: #9de7c9; border-color: rgba(67,209,154,.16); }
.feature-icon.blue { background: rgba(56,189,248,.1); color: #a9e6ff; border-color: rgba(56,189,248,.16); }
.feature-icon.yellow { background: var(--yellow-soft); color: #f5df9d; border-color: rgba(240,196,92,.16); }
.feature-card h3 { font-size: 16px; margin-bottom: 9px; }
.feature-card p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.site-footer {
  max-width: 1220px; width: 100%; margin: 0 auto; padding: 26px 28px 34px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted-2); font-size: 12px; border-top: 1px solid rgba(255,255,255,.05);
}

/* ---------- app shell ---------- */
.app-body { background: var(--bg); min-height: 100vh; }
.topbar-wide { max-width: 1220px; margin: 0 auto; padding: 18px 28px; display: flex; justify-content: space-between; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.page-wrap { max-width: 1120px; margin: 0 auto; padding: 40px 28px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.page-head h1 { font-size: 34px; letter-spacing: -0.035em; }
.page-head p { margin-top: 8px; }
.guild-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guild-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: var(--panel); padding: 15px;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.guild-card:hover { border-color: #353b54; background: var(--panel-2); transform: translateY(-1px); }
.guild-card-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.guild-card-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-icon { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--panel-3); flex: 0 0 auto; }
.guild-fallback { display: grid; place-items: center; font-size: 18px; font-weight: 700; color: #d9d5ff; background: linear-gradient(145deg, #2a2551, #1d3040); }
.guild-icon-sm { width: 36px; height: 36px; border-radius: 10px; }
.chev { color: var(--muted-2); font-size: 14px; }
.empty-state {
  border: 1px dashed #2c3246; border-radius: 18px; padding: 60px 28px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(19,22,33,.5);
}
.empty-state h2 { font-size: 22px; }
.empty-state p { color: var(--muted); max-width: 440px; }
.empty-icon { font-size: 30px; color: var(--muted-2); }
.center-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; gap: 12px; }
.error-code { font-size: 76px; font-weight: 750; letter-spacing: -0.06em; color: #2f3549; line-height: 1; }
.center-page p { max-width: 540px; }

/* dashboard */
.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; align-self: start; display: flex; flex-direction: column;
  border-right: 1px solid var(--border-soft); background: #0d0f17; padding: 20px 18px 18px;
  z-index: 20;
}
.sidebar-head { padding: 3px 8px 20px; }
.guild-switcher {
  display: flex; align-items: center; gap: 11px; padding: 11px; width: 100%; text-align: left;
  border: 1px solid var(--border-soft); border-radius: 10px; background: var(--panel);
  margin-bottom: 20px;
}
.guild-switcher:hover { background: var(--panel-2); }
.guild-switcher-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.guild-switcher-text strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-switcher-text span { color: var(--muted-2); font-size: 10px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: 12px 12px; border-radius: 10px; font-weight: 550; font-size: 14px; text-align: left;
}
.nav-item:hover { background: var(--panel); color: var(--text-soft); }
.nav-item.active { background: var(--accent-soft); color: #d9d4ff; }
.nav-icon { width: 20px; text-align: center; color: var(--muted-2); font-size: 16px; }
.nav-item.active .nav-icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding: 14px 8px 2px; display: flex; flex-direction: column; gap: 10px; }
.sidebar-save { width: 100%; min-height: 42px; margin: 0 0 16px; }
.sidebar-save.is-clean { background: linear-gradient(120deg, rgba(38, 31, 63, .9), rgba(20, 21, 36, .95)); color: var(--text-soft); box-shadow: none; }
.sidebar-save:disabled { background: var(--panel-3); color: var(--muted); box-shadow: none; }
.bot-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sidebar-link { color: var(--muted-2); font-size: 11px; text-align: left; }
.sidebar-link:hover { color: var(--text-soft); }
.main-col { min-width: 0; }
.dashboard-topbar {
  height: 64px; border-bottom: 1px solid var(--border-soft);
  background: rgba(10, 11, 17, .82); backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap;
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 12px; min-width: 0; }
.crumbs-link { color: var(--muted-2); }
.crumbs-link:hover { color: var(--text); }
.crumbs strong { color: var(--text-soft); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--text); }
.content-wrap { max-width: 1120px; margin: 0 auto; padding: 32px 30px 100px; }
.section-head-page { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-head-page > div:first-child { min-width: 0; }
.section-head-page > .btn { flex: 0 0 auto; }
@media (max-width: 640px) { .section-head-page { flex-direction: column; } }
.section-head-page h1 { font-size: 27px; letter-spacing: -0.03em; }
.section-head-page p { color: var(--muted); margin-top: 6px; font-size: 13px; }
.content { display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 680px; }
.card-body { padding: 18px 20px 20px; }
.card-body.flush { padding-top: 12px; }
.card-body > .notice { margin-top: 20px; }
.card + .card { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: 14px; }
.grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--text-soft); display: flex; align-items: center; gap: 8px; }
.hint { color: var(--muted-2); font-size: 11px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; background: #0e111a; border: 1px solid #262c3f; border-radius: 8px;
  color: var(--text); padding: 8px 10px; font-size: 13px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: #9d8bff; box-shadow: 0 0 0 3px rgba(139,124,246,.18); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.select { cursor: pointer; }
.input[type="number"] { max-width: 180px; }
.input-group { display: flex; gap: 8px; align-items: center; }
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--text-soft); font-size: 12.5px; }
.checkbox-row input { accent-color: var(--accent); width: 15px; height: 15px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 11px 0; border-bottom: 1px solid var(--border-soft);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-text strong { font-weight: 550; font-size: 13px; }
.toggle-text span { color: var(--muted); font-size: 11px; }
.switch { position: relative; width: 34px; height: 20px; flex: 0 0 auto; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 99px; background: #2a3042; transition: .18s ease;
  border: 1px solid #343b50;
}
.switch .slider::before {
  content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px;
  border-radius: 50%; background: #8f96ad; transition: .18s ease;
}
.switch input:checked + .slider { background: var(--accent-strong); border-color: var(--accent-strong); }
.switch input:checked + .slider::before { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(139,124,246,.18); }
.switch input:disabled + .slider { opacity: .4; cursor: not-allowed; }
.pill-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel-3); border: 1px solid #2b3247; color: var(--text-soft);
  border-radius: 6px; padding: 2px 6px; font-size: 10.5px; max-width: 100%; min-width: 0;
}
.pill b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.pill button { border: 0; background: transparent; color: var(--muted-2); padding: 0 2px; font-size: 12px; }
.pill button:hover { color: var(--red); }
.multi-control {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #0e111a; border: 1px solid #262c3f; border-radius: 8px;
  min-height: 37px; padding: 5px 8px; cursor: pointer; overflow: hidden;
}
.multi-control:hover { border-color: #3c435c; }
.multi-control > span:first-child { min-width: 0; flex: 1; }
.multi-control .pill-list { margin: 0; flex-wrap: nowrap; overflow: hidden; gap: 4px; }
.multi-control .pill { flex: 0 1 auto; }
.multi-control .placeholder { color: var(--muted-2); font-size: 12px; }
.multi-control .chev { font-size: 11px; flex: 0 0 auto; }
.avatar-select { display: flex; align-items: center; gap: 9px; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }
.subhead { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin: 22px 0 10px; }
.subhead:first-child { margin-top: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .input { max-width: 240px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: 0; }
.list-row-main { min-width: 0; flex: 1; }
.list-row-main strong { display: block; font-size: 12.5px; font-weight: 550; }
.list-row-main span { color: var(--muted-2); font-size: 11px; }
.row-actions { display: flex; gap: 5px; }
.code-row { display: flex; gap: 6px; align-items: center; }
.code-row code { background: #0c0f17; border: 1px solid var(--border-soft); border-radius: 5px; padding: 2px 6px; font-size: 10.5px; color: #b6bdd4; }
.empty-mini { color: var(--muted-2); font-size: 12px; padding: 16px 0; text-align: center; border: 1px dashed var(--border); border-radius: 8px; }
.stat-strip { display: flex; gap: 24px; padding: 13px 0 2px; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { font-size: 16px; font-weight: 650; }
.stat span { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid rgba(255,255,255,.12); }
.right { text-align: right; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.command-disabled td { opacity: .48; }
.command-disabled .cmd-name { text-decoration: line-through; }
.message-preview {
  margin-top: 12px; border-radius: 10px; overflow: hidden;
  max-height: 230px; position: relative; background: #101219;
  border: 1px solid var(--border-soft);
}
.message-preview::after {
  content: ""; position: absolute; inset: auto 0 0; height: 28px;
  background: linear-gradient(transparent, #101219); pointer-events: none;
}
.message-preview .discord-preview { width: 100%; max-width: none; padding: 12px; box-shadow: none; border-radius: 0; min-height: 0; }
.message-preview .dc-avatar { width: 30px; height: 30px; font-size: 12px; }
.message-preview .dc-text { font-size: 12px; }
.message-preview .dc-container { padding: 10px 12px; }
.message-preview .dc-thumb { width: 54px; height: 54px; }
.economy-card {
  border: 1px solid var(--border-soft); border-radius: 10px;
  background: #10131c; padding: 13px 14px; margin-bottom: 10px;
}
.economy-card:last-of-type { margin-bottom: 0; }
.economy-card > .toolbar strong { font-size: 12.5px; color: var(--text-soft); }
.economy-card .toggle-row { padding: 7px 0; border-bottom: 0; }
.economy-card .subhead { margin: 13px 0 8px; }
.spacer { flex: 1; }
.emoji { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.22em; margin: 0 1px; }

/* tables */
.cmd-table { width: 100%; border-collapse: collapse; }
.cmd-table th {
  text-align: left; color: var(--muted-2); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--border);
}
.cmd-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; vertical-align: middle; }
.cmd-table tr:last-child td { border-bottom: 0; }
.cmd-table tr:hover td { background: rgba(255,255,255,.012); }
.cmd-name { font-family: "SFMono-Regular", Consolas, monospace; color: #d6d2ff; font-size: 12px; }
.cmd-cat { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.cmd-response { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 154px; }
.cmd-customize { flex: 0 0 auto; font-size: 14px; color: var(--muted); }
.cmd-customize:hover { color: var(--text); background: var(--panel-3); }
.command-override-help { margin: 0 0 10px; }
.editor-tabs.command-locale-tabs { display: inline-flex; width: auto; margin: 4px 0 16px; }
.command-ephemeral-row { margin: 0 0 12px; padding: 12px 0; }
.command-standard-block { margin: 14px 0 12px; }
.command-standard-block .confirm-text { margin: 0 0 12px; }
.command-custom-actions { margin: 12px 0; }
.command-locale-help { margin: 16px 0 0; }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 6, 10, .72); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  width: min(540px, 100%); max-height: min(80vh, 760px); overflow: auto;
  background: var(--panel); border: 1px solid #2d3347; border-radius: 16px;
  box-shadow: var(--shadow); animation: modalIn .18s ease;
}
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-soft); background: var(--panel); position: sticky; bottom: 0; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--text); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.picker-search { margin-bottom: 12px; }
.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 380px; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.picker-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 7px;
  color: var(--text-soft); font-size: 12.5px; cursor: pointer;
}
.picker-option:hover { background: var(--panel-2); }
.picker-option input { accent-color: var(--accent); }
.picker-option .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-group { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 12px 9px 4px; }
.picker-empty { color: var(--muted-2); padding: 20px 9px; text-align: center; font-size: 12px; }
.confirm-text { color: var(--text-soft); font-size: 13px; line-height: 1.6; }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 240px; max-width: 420px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid #2c3247;
  background: #171b27; box-shadow: 0 16px 40px rgba(0,0,0,.35);
  font-size: 12.5px; color: var(--text-soft); animation: toastIn .2s ease;
}
.toast.success { border-color: rgba(67,209,154,.3); }
.toast.error { border-color: rgba(240,115,115,.32); }
.toast .toast-icon { font-weight: 700; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- V2 editor ---------- */
.editor-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(4,5,8,.8);
  backdrop-filter: blur(10px); padding: 18px; display: flex;
}
.editor-shell {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid #2a3044; border-radius: 16px;
  box-shadow: 0 40px 120px rgba(0,0,0,.55); overflow: hidden;
}
.editor-head {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft); background: #0d0f17; flex: 0 0 auto;
}
.editor-head .title-block { display: flex; flex-direction: column; min-width: 0; }
.editor-head .title-block strong { font-size: 13.5px; }
.editor-head .title-block span { font-size: 10.5px; color: var(--muted-2); }
.editor-tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 8px; padding: 2px; }
.editor-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; padding: 5px 10px; font-size: 11px; font-weight: 600; }
.editor-tabs button.active { background: var(--panel-3); color: var(--text); }
.editor-head .spacer { flex: 1; }
.editor-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 16px; border-top: 1px solid var(--border-soft);
  color: var(--muted-2); font-size: 10.5px; background: #0d0f17;
}
.editor-body { flex: 1; min-height: 0; display: flex; }
.editor-tree {
  width: 294px; flex: 0 0 auto; border-right: 1px solid var(--border-soft);
  background: #0c0e15; overflow: auto; padding: 14px 11px;
}
.editor-tree-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 10px; color: var(--muted-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.tree-hint { padding: 0 6px 10px; color: var(--muted-2); font-size: 10.5px; line-height: 1.4; }
.tree-item { border-radius: 8px; }
.tree-row {
  display: flex; align-items: center; gap: 7px; padding: 8px 7px; border-radius: 7px;
  color: var(--muted); font-size: 12.5px; cursor: grab; user-select: none;
}
.tree-row:hover { background: #141824; color: var(--text-soft); }
.tree-row.selected { background: var(--accent-soft); color: #d9d4ff; }
.tree-row.dragging { opacity: .4; }
.tree-row.drop-above { box-shadow: inset 0 2px 0 var(--accent); }
.tree-row.drop-below { box-shadow: inset 0 -2px 0 var(--accent); }
.tree-row.drop-inside { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.tree-root-drop {
  display: none; align-items: center; justify-content: center;
  position: sticky; bottom: 0; margin: 8px 4px 2px; padding: 10px;
  border: 1px dashed #3c435c; border-radius: 7px; color: var(--muted-2);
  font-size: 10.5px; background: #0c0e15;
}
.editor-tree.dragging-active .tree-root-drop { display: flex; }
.tree-root-drop.root-over { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.tree-grip { color: #4b5268; font-size: 13px; line-height: 1; flex: 0 0 auto; }
.tree-row .tree-icon { width: 18px; text-align: center; color: var(--muted-2); font-size: 13px; flex: 0 0 auto; }
.tree-row .tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .tree-actions { display: none; gap: 2px; }
.tree-row:hover .tree-actions { display: flex; }
.tree-action { border: 0; background: transparent; color: var(--muted-2); font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.tree-action:hover { background: #262c3d; color: var(--text); }
.tree-children { margin-left: 14px; border-left: 1px solid #1c2130; padding-left: 5px; }
.add-menu { padding: 4px 4px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 8px; }
.add-menu .btn { width: 100%; justify-content: flex-start; font-size: 11px; }
.add-menu .add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.editor-preview {
  flex: 1; min-width: 0; overflow: auto; padding: 34px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(700px 400px at 50% 0, rgba(139,124,246,.06), transparent 60%),
    #0e1018;
}
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--muted-2); font-size: 10.5px; }
.preview-toolbar .seg { display: flex; gap: 3px; }
.preview-toolbar button { border: 1px solid var(--border-soft); background: var(--panel); color: var(--muted); border-radius: 5px; font-size: 10px; padding: 3px 7px; }
.preview-toolbar button.active { color: var(--text); background: var(--panel-3); }
#editor-preview-body { width: 100%; margin: auto 0; }
.discord-preview {
  margin: 0 auto; width: min(100%, 720px); background: var(--discord-bg);
  border-radius: 10px; padding: 20px 16px; min-height: 240px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.discord-preview.compact { width: min(100%, 480px); }
.dc-message { display: flex; gap: 12px; }
.dc-avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(145deg, #8b7cf6, #38bdf8); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.dc-avatar.app { background: #090a12; overflow: hidden; }
.dc-avatar.app img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.dc-main { min-width: 0; flex: 1; }
.dc-author { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.dc-author b { color: #f2f3f5; font-weight: 600; }
.dc-author .app-tag { background: #5865f2; color: #fff; border-radius: 3px; padding: 1px 4px; font-size: 9px; font-weight: 700; }
.dc-author .dc-time { color: #949ba4; font-size: 10px; }
.dc-components { display: flex; flex-direction: column; gap: 8px; }
.dc-selectable { border-radius: 7px; transition: outline-color .12s ease, background .12s ease; outline: 1px solid transparent; }
.dc-selectable:hover { outline-color: rgba(139,124,246,.35); }
.dc-selectable.selected { outline-color: var(--accent); background: rgba(139,124,246,.04); }
.dc-container { background: var(--discord-container); border-radius: 8px; border-left: 4px solid #5865f2; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.dc-container.spoiler { filter: blur(5px); }
.dc-text { color: #dbdee1; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-text h1, .dc-text h2, .dc-text h3 { color: #f2f3f5; margin: 4px 0 2px; line-height: 1.3; }
.dc-text h1 { font-size: 21px; } .dc-text h2 { font-size: 18px; } .dc-text h3 { font-size: 15px; }
.dc-text p { margin: 0; }
.dc-text a { color: #00a8fc; }
.dc-text code { background: #1e1f22; border-radius: 3px; padding: 1px 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.dc-text pre { background: #1e1f22; border: 1px solid #2b2d31; border-radius: 6px; padding: 8px 10px; overflow: auto; margin: 4px 0; }
.dc-text pre code { background: transparent; padding: 0; }
.dc-text blockquote { border-left: 3px solid #4e5058; padding-left: 10px; margin: 3px 0; color: #b5bac1; }
.dc-text ul, .dc-text ol { margin: 2px 0; padding-left: 20px; }
.dc-text .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc-text .spoiler.revealed { color: #dbdee1; background: #2b2d31; }
.dc-text .mention { background: rgba(88,101,242,.25); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc-text .timestamp { background: rgba(78,80,88,.35); border-radius: 3px; padding: 0 2px; font-size: .92em; }
.dc-separator { display: flex; align-items: center; height: 1px; background: #3f4147; margin: 3px 0; }
.dc-separator.large { margin: 12px 0; }
.dc-separator.hidden-line { background: transparent; height: 10px; }
.dc-section { display: flex; gap: 12px; align-items: stretch; }
.dc-section-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dc-thumb { width: 76px; height: 76px; border-radius: 7px; object-fit: cover; background: #1e1f22; flex: 0 0 auto; }
.dc-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.dc-gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; }
.dc-file { display: flex; align-items: center; gap: 10px; background: #2b2d31; border: 1px solid #3f4147; padding: 10px 12px; border-radius: 6px; color: #dbdee1; font-size: 12px; }
.dc-file .file-icon { width: 32px; height: 32px; border-radius: 6px; background: #4e5058; display: grid; place-items: center; color: #b5bac1; }
.dc-action-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dc-button {
  border: 0; border-radius: 4px; padding: 7px 13px; font-size: 12px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 5px; color: #fff; background: #4e5058;
}
.dc-button.primary { background: #5865f2; }
.dc-button.secondary { background: #4e5058; }
.dc-button.success { background: #248046; }
.dc-button.danger { background: #da373c; }
.dc-button.link { background: #4e5058; }
.dc-button:disabled { opacity: .55; }
.dc-select {
  flex: 1; min-width: 170px; display: flex; align-items: center; justify-content: space-between;
  background: #1e1f22; border: 1px solid #3f4147; border-radius: 4px; color: #b5bac1;
  font-size: 12px; padding: 8px 10px;
}
.dc-select .select-chevron { font-size: 9px; color: #949ba4; }
.dc-empty { border: 1px dashed #3f4147; border-radius: 8px; color: #7f8490; font-size: 12px; text-align: center; padding: 30px; }
.editor-props {
  width: 420px; flex: 0 0 auto; border-left: 1px solid var(--border-soft);
  background: #0d0f17; overflow: auto; padding: 18px;
}
.props-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.props-head strong { font-size: 13px; }
.props-empty { color: var(--muted-2); font-size: 12.5px; text-align: center; padding: 50px 10px; }
.props-section { border-top: 1px solid var(--border-soft); padding-top: 15px; margin-top: 15px; }
.props-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.props-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); font-weight: 700; margin-bottom: 10px; }
.mini-list { display: flex; flex-direction: column; gap: 5px; }
.mini-item { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--panel); font-size: 11.5px; }
.mini-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.editor-json { flex: 1; padding: 20px; overflow: auto; }
.editor-json textarea {
  width: 100%; min-height: calc(100vh - 260px); background: #0b0d14; border: 1px solid var(--border);
  border-radius: 10px; color: #c8d2ed; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px; line-height: 1.6; padding: 14px; resize: vertical;
}
.json-errors { margin-top: 10px; }
.json-errors .notice { margin-bottom: 5px; }
.attachment-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.attachment-chip { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 6px; padding: 4px 7px; font-size: 10.5px; color: var(--text-soft); }
.attachment-chip button { border: 0; background: transparent; color: var(--muted-2); }
.attachment-chip button:hover { color: var(--red); }
.editor-empty-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 12px; }
.chip-button { border: 1px dashed #323950; background: transparent; color: var(--muted); border-radius: 7px; padding: 7px 10px; font-size: 11.5px; }
.chip-button:hover { border-color: var(--accent); color: var(--text); }
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; }
.toggle-inline { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-soft); }
.toggle-inline input { accent-color: var(--accent); }
.path-badge { font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; color: var(--muted-2); background: #0b0d14; padding: 1px 5px; border-radius: 4px; }

/* ---------- tech branding ---------- */
.app-body {
  background:
    radial-gradient(900px 620px at 10% -10%, rgba(105, 44, 255, .14), transparent 62%),
    radial-gradient(700px 500px at 100% 0%, rgba(180, 92, 255, .08), transparent 60%),
    #080910;
}
.app-body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(139,124,246,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,124,246,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 12%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 12%, transparent 72%);
}
.app-body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background: url("/static/brand/banner.png") center / cover no-repeat;
}
.app-shell, .topbar-wide, .page-wrap { position: relative; z-index: 1; }
.brand-logo, .brand-compact img { border-radius: 9px; }
.brand-compact img { border-radius: 8px; }
.sidebar {
  background: linear-gradient(180deg, #110d20 0%, #0a0b13 45%, #08090f 100%);
  border-right-color: rgba(139, 124, 246, .16);
  box-shadow: inset -1px 0 0 rgba(139, 124, 246, .07);
}
.sidebar::after {
  content: ""; position: absolute; top: 0; right: -1px; width: 1px; height: 100%;
  background: linear-gradient(180deg, rgba(185, 120, 255, .65), rgba(139, 124, 246, .08) 38%, transparent 82%);
  pointer-events: none;
}
.topbar, .dashboard-topbar {
  background: linear-gradient(110deg, rgba(12, 10, 24, .92), rgba(7, 8, 14, .9));
  border-bottom-color: rgba(139, 124, 246, .14);
}
.guild-switcher {
  background: linear-gradient(140deg, rgba(39, 26, 73, .72), rgba(16, 17, 29, .9));
  border-color: rgba(139, 124, 246, .24);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(105, 44, 255, .26), rgba(139, 124, 246, .07));
  box-shadow: inset 2px 0 0 #a66bff;
}
.btn-primary {
  background: linear-gradient(120deg, #7624ff, #9d55ff);
  box-shadow: 0 10px 26px rgba(118, 36, 255, .24);
}
.btn-primary:hover { background: linear-gradient(120deg, #8a3cff, #b06bff); }
.sidebar-save { background: linear-gradient(120deg, #7624ff, #9d55ff); }
.sidebar-save.is-clean { background: linear-gradient(120deg, rgba(38, 31, 63, .9), rgba(20, 21, 36, .95)); }
.card {
  background: linear-gradient(155deg, rgba(23, 23, 40, .96), rgba(12, 13, 22, .97));
  border-color: rgba(139, 124, 246, .15);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .025);
  position: relative;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(166, 107, 255, .55), transparent);
  opacity: .55; pointer-events: none;
}
.guild-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(30, 23, 55, .88), rgba(13, 14, 24, .96));
  border-color: rgba(139, 124, 246, .22);
}
.guild-card::after {
  content: ""; position: absolute; width: 150px; height: 150px; right: -76px; bottom: -92px;
  border: 1px solid rgba(166, 107, 255, .32); transform: rotate(45deg); pointer-events: none;
}
.guild-card:hover {
  background: linear-gradient(145deg, rgba(43, 29, 79, .95), rgba(17, 18, 31, .98));
  border-color: rgba(166, 107, 255, .55);
  box-shadow: 0 0 34px rgba(105, 44, 255, .17);
}
.guild-icon { border: 1px solid rgba(166, 107, 255, .3); }
.page-head h1, .section-head-page h1 {
  background: linear-gradient(110deg, #fff 15%, #d8ccff 55%, #a66bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kicker { color: #a66bff; }
.page-head .status-pill, .badge { border: 1px solid rgba(166, 107, 255, .16); }
.empty-state { border-color: rgba(139, 124, 246, .16); background: rgba(14, 15, 26, .7); }

/* ---------- small, compositor-friendly motion ---------- */
.section-enter { animation: sectionIn .27s cubic-bezier(.2, .7, .25, 1) both; }
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.app-body, .landing-body { animation: pageIn .2s ease both; }
.page-leaving { animation: pageOut .12s ease both !important; pointer-events: none; }
@keyframes pageIn { from { opacity: .75; } to { opacity: 1; } }
@keyframes pageOut { to { opacity: 0; transform: scale(.998); } }
.nav-item { transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.lang-switch a, .lang-switch button { transition: background .15s ease, color .15s ease; }
.lang-switch a.active, .lang-switch button.active { box-shadow: inset 0 0 0 1px rgba(166, 107, 255, .24); }
.switch .slider { transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease; }
.switch .slider::before { transition: transform .18s cubic-bezier(.2, .8, .2, 1), background .18s ease, box-shadow .18s ease; }
.switch input:checked + .slider::before { box-shadow: 0 0 8px rgba(255, 255, 255, .35); }
.switch:active .slider { transform: scale(.97); }
.guild-card, .card { transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:active { transform: translateY(1px); }
.pill { transition: border-color .15s ease, background .15s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* responsive */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 42px; padding-top: 50px; }
  .hero-visual { max-width: 680px; min-width: 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-tree { width: 240px; }
  .editor-props { width: 360px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 60px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop {
    position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.5);
    display: block; opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
  }
  .mobile-backdrop.open { opacity: 1; pointer-events: auto; }
  .mobile-only { display: inline-flex !important; }
  .content-wrap { padding: 22px 18px 80px; }
  .dashboard-topbar { padding: 0 16px; }
  .guild-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-right .user-chip span { display: none; }
  .site-header { padding: 18px; }
  .hero { padding: 42px 18px 24px; }
  .features { padding: 48px 18px 64px; }
  .feature-grid { grid-template-columns: 1fr; }
  .plugin-grid { grid-template-columns: 1fr; }
  .editor-backdrop { padding: 0; }
  .editor-shell { border-radius: 0; border: 0; }
  .editor-body { flex-direction: column; overflow: auto; }
  .editor-tree {
    display: block; width: 100%; max-height: 260px;
    border-right: 0; border-bottom: 1px solid var(--border-soft);
  }
  .editor-preview { min-height: 320px; padding: 14px; }
  .editor-props { width: 100%; max-height: none; border-left: 0; border-top: 1px solid var(--border-soft); }
}
@media (hover: none) {
  .tree-row .tree-actions { display: flex; }
}
@media (max-width: 720px) {
  .hero-copy h1 { font-size: clamp(32px, 9.4vw, 42px); overflow-wrap: anywhere; }
  .hero-sub { font-size: 15px; max-width: 100%; }
  .site-footer { flex-direction: column; gap: 10px; }
  .editor-head .title-block span { display: none; }
  .editor-head { gap: 8px; flex-wrap: wrap; }
  .topbar .crumbs { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .stat-strip { flex-wrap: wrap; gap: 16px; }
}

.tv-button-row {
  display: grid;
  grid-template-columns: 22px minmax(140px, 1fr) 44px 72px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  position: relative;
}
.tv-button-row.dragging {
  opacity: .45;
}
.tv-button-row.drop-before {
  box-shadow: inset 0 2px 0 var(--accent);
}
.tv-button-row.drop-after {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tv-drag {
  color: var(--muted);
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  text-align: center;
}
.tv-drag:active {
  cursor: grabbing;
}
.tv-button-row .inline-actions {
  min-width: 70px;
  height: 32px;
  margin-top: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}
.tv-button-row .switch {
  justify-self: center;
}
.tv-move {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  vertical-align: middle;
  line-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.tv-move svg {
  width: 15px;
  height: 15px;
  display: block;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tv-move-boundary {
  cursor: default;
  opacity: .38;
  color: var(--muted-2);
  border-color: var(--border-soft);
}
.tv-move:disabled {
  opacity: 1;
  cursor: default;
}
.tv-button-row.muted {
  opacity: .55;
}
.tv-button-row .inline-actions.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.log-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}
.log-event-grid .toggle-row {
  border-bottom: 0;
  padding: 6px 0;
}

/* ---------- legal pages ---------- */
.legal-header { align-items: center; }
.legal-header-right { display: flex; align-items: center; gap: 18px; }
.legal-back { color: var(--muted); font-size: 12px; }
.legal-back:hover { color: var(--text); }
.legal-body { min-height: 100vh; }
.legal-page {
  position: relative; z-index: 1;
  width: min(820px, calc(100% - 48px));
  margin: 0 auto; padding: 34px 0 72px;
}
.legal-page .kicker { display: block; margin-bottom: 12px; }
.legal-page h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.045em; margin-bottom: 10px; }
.legal-page h2 { font-size: 18px; margin: 30px 0 8px; letter-spacing: -0.02em; }
.legal-page p { color: var(--text-soft); line-height: 1.7; font-size: 14px; }
.legal-page a { color: #b9adff; text-decoration: underline; text-underline-offset: 2px; }
.legal-updated { color: var(--muted-2) !important; font-size: 12px !important; }
.legal-intro { font-size: 15px !important; color: var(--text) !important; border-left: 2px solid var(--accent); padding-left: 14px; }
.legal-footer { max-width: 1220px; margin: 0 auto; padding: 22px 28px 34px; border-top: 1px solid rgba(255,255,255,.06); display: flex; gap: 18px; justify-content: center; }
.legal-footer a { color: var(--muted); font-size: 12px; }
.legal-footer a:hover { color: var(--text); }

/* ---------- guild picker groups / footer links ---------- */
.guild-section { margin-bottom: 30px; }
.guild-section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.guild-section-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.badge.accent { background: var(--accent-soft); color: #d8d1ff; border: 1px solid rgba(139,124,246,.28); }
.guild-card-invite { border-style: dashed; opacity: .9; }
.guild-card-invite:hover { border-style: solid; opacity: 1; }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a { color: var(--muted); font-size: 12px; }
.footer-links a:hover { color: var(--text); }
.sidebar-legal { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.sidebar-legal a { color: var(--muted-2); font-size: 10.5px; }
.sidebar-legal a:hover { color: var(--text-soft); }
.topbar-logout { margin-left: 2px; }

/* ---------- interaction polish ---------- */
.nav-item { position: relative; overflow: hidden; }
.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, #c9a7ff, #7624ff);
  opacity: 0;
  transform: scaleY(.45);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .8, .2, 1);
}
.nav-item.active::before { opacity: 1; transform: scaleY(1); }
.nav-item .nav-icon { transition: transform .24s cubic-bezier(.2, .8, .2, 1), color .18s ease; }
.nav-item.active .nav-icon { transform: translateX(1px) scale(1.06); }

.section-enter > * {
  animation: cardRise .38s cubic-bezier(.2, .75, .25, 1) both;
}
.section-enter > *:nth-child(2) { animation-delay: .035s; }
.section-enter > *:nth-child(3) { animation-delay: .07s; }
.section-enter > *:nth-child(4) { animation-delay: .105s; }
.section-enter > *:nth-child(5) { animation-delay: .14s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
#section-head.section-enter { animation: headIn .32s cubic-bezier(.2, .75, .25, 1) both; }
@keyframes headIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.modal { animation: modalIn .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.picker-option { transition: background .15s ease, transform .15s ease; }
.picker-option:hover { transform: translateX(2px); }
.sidebar-save:not(:disabled) { animation: saveReady .5s ease; }
@keyframes saveReady {
  0% { box-shadow: 0 0 0 0 rgba(139, 124, 246, .28); }
  100% { box-shadow: 0 10px 26px rgba(118, 36, 255, .24); }
}
.switch input:checked + .slider::before { animation: knobPop .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes knobPop {
  0% { transform: translateX(0) scale(.92); }
  70% { transform: translateX(15px) scale(1.04); }
  100% { transform: translateX(14px) scale(1); }
}
.btn, .guild-card, .modal-close { transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .18s ease; }

.card-reset { width: 30px; height: 30px; padding: 0; opacity: .55; }
.card-reset:hover { opacity: 1; }
.card-reset svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.player-cell { display: flex; align-items: center; gap: 9px; min-width: 200px; }
.player-cell > div { display: flex; flex-direction: column; min-width: 0; }
.player-cell .small { display: block; margin-top: 2px; }
.player-table td { vertical-align: middle; }

.player-table { table-layout: fixed; }
.player-table th.num, .player-table td.num { text-align: center; width: 120px; white-space: nowrap; }
.player-table th.balances, .player-table td.balances { width: 200px; text-align: left; }
.player-table th.actions, .player-table td.actions { width: 130px; text-align: right; }
.player-table .balance-list { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-soft); font-size: 12px; }
.player-table .balance-list b { color: var(--muted); font-weight: 600; }

.ticket-type-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.type-check {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text-soft); font-size: 12px; cursor: pointer;
}
.type-check input { accent-color: var(--accent); }


/* ---------- phone layout ---------- */
.mobile-save { flex: 0 0 auto; }

@media (max-width: 900px) {
  .dashboard-topbar {
    height: auto; min-height: 60px; padding: 8px 12px; gap: 8px;
  }
  .dashboard-topbar .crumbs { display: none; }
  .topbar-right { gap: 8px; min-width: 0; }
  .content-wrap { padding: 18px 14px calc(88px + env(safe-area-inset-bottom)); }
  .card-head { padding: 16px 14px 0; gap: 10px; }
  .card-body { padding: 14px 14px 18px; }
  .card-head h2 { font-size: 14px; }
  .card-head p { font-size: 11.5px; }
  .economy-card { padding: 12px; }
  .grid-2, .grid-3 { gap: 12px; }
  .input, .select, .textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .nav-item { min-height: 44px; }
  .icon-btn { width: 40px; height: 40px; }
  .sidebar { width: min(86vw, 300px); }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 14px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 14px; padding-right: 14px; }
  .toast-root { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .section-head-page h1 { font-size: 24px; }
  .section-head-page p { font-size: 12.5px; }
  .editor-preview { min-height: 240px; padding: 12px; }
  .editor-tree { max-height: 220px; }
  .editor-props { padding: 14px; }
  .table-wrap { margin-left: -4px; margin-right: -4px; }
}

@media (max-width: 560px) {
  .topbar-right .user-chip { display: none; }
  .lang-switch button { padding: 5px 7px; }
  .topbar-logout { padding: 7px 9px; font-size: 11px; }
  .mobile-save { min-width: 0; padding: 8px 10px; }
  .section-head-page h1 { font-size: 22px; }
  .card-head, .card-body { padding-left: 12px; padding-right: 12px; }
  .economy-card { padding: 10px; }
  .list-row { align-items: flex-start; flex-wrap: wrap; }
  .list-row .spacer { display: none; }
  .ticket-type-picker { gap: 6px; }
  .type-check { width: 100%; }
  .tv-button-row { grid-template-columns: 18px minmax(0, 1fr) 40px 62px; gap: 8px; }
  .footer, .site-footer { text-align: center; }
}

.mobile-save.is-clean { background: var(--panel-3); color: var(--text-soft); box-shadow: none; }


/* ---------- message builder overlay ---------- */
.builder-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: #111214;
  animation: fadeIn .15s ease;
}
.builder-frame {
  width: 100%; height: 100%; border: 0; display: block; background: #111214;
}
.builder-overlay-close {
  position: fixed; top: 12px; right: 14px; z-index: 401;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid #3f4147; background: rgba(17, 18, 20, .86);
  color: #b5bac1; font-size: 22px; line-height: 1;
}
.builder-overlay-close:hover { color: #fff; background: #2b2d31; }


/* landing polish */
.btn-discord { display: inline-flex; align-items: center; gap: 9px; }
.discord-logo { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-primary .discord-logo { color: #fff; }
.trust-row {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; color: var(--muted); font-size: 12px;
}
.trust-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #57f287;
  box-shadow: 0 0 0 4px rgba(87, 242, 135, .1);
}
.hero-visual { isolation: isolate; }
.mock-glow {
  position: absolute; inset: 9% -8% -8% 4%; z-index: -1;
  background:
    radial-gradient(45% 55% at 52% 38%, rgba(133, 71, 211, .42), transparent 72%),
    radial-gradient(35% 40% at 80% 70%, rgba(88, 101, 242, .2), transparent 72%);
  filter: blur(42px); opacity: .9;
}
.mock-window { animation: mockFloat 8s ease-in-out infinite; }
.mock-line {
  background: linear-gradient(90deg, #242a3c 20%, #313b5b 48%, #242a3c 76%);
  background-size: 220% 100%;
  animation: mockShimmer 5s ease-in-out infinite;
}
.reveal-on-scroll { animation: heroIn .75s cubic-bezier(.2,.8,.2,1) both; }
@keyframes mockFloat { 50% { translate: 0 -6px; } }
@keyframes mockShimmer { 50% { background-position: -120% 0; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .mock-window, .mock-line, .reveal-on-scroll { animation: none; }
}


/* guild list */
.guild-tools { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.guild-tools .input { max-width: 360px; }
.guild-tools .select { width: auto; min-width: 180px; }
.guild-action {
  color: #c9c3ff; font-size: 11.5px; font-weight: 600;
  opacity: 0; transform: translateX(-4px); transition: opacity .16s ease, transform .16s ease;
  white-space: nowrap;
}
.guild-card:hover .guild-action { opacity: 1; transform: translateX(0); }
.guild-invite-badge {
  background: rgba(133, 71, 211, .16) !important;
  border: 1px solid rgba(167, 139, 250, .28);
  color: #ddd6ff !important;
}
.guild-card-invite:hover {
  border-color: rgba(167, 139, 250, .5);
  background: linear-gradient(140deg, rgba(74, 52, 128, .35), var(--panel-2));
}
.guild-card-invite:hover .guild-invite-badge {
  background: #7c3aed !important; color: #fff !important;
}
.guild-skeleton { pointer-events: none; }
.skeleton-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(90deg, #1b2030, #2a3148, #1b2030);
  background-size: 220% 100%; animation: skeletonPulse 1.6s ease-in-out infinite;
}
.skeleton-lines { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.skeleton-lines span {
  height: 9px; border-radius: 5px; display: block;
  background: linear-gradient(90deg, #1b2030, #2a3148, #1b2030);
  background-size: 220% 100%; animation: skeletonPulse 1.6s ease-in-out infinite;
}
.skeleton-lines span:first-child { width: 52%; }
.skeleton-lines span:last-child { width: 30%; }
@keyframes skeletonPulse { 50% { background-position: -120% 0; } }
@media (max-width: 640px) {
  .guild-action { opacity: 1; transform: none; }
  .guild-tools .input, .guild-tools .select { max-width: none; width: 100%; }
}


/* disabled setting groups */
.settings-disabled {
  opacity: .45;
  pointer-events: none;
  user-select: none;
  filter: saturate(.7);
}
