:root {
  color-scheme: dark;
  --bg: #08070d;
  --surface: rgba(20, 17, 31, 0.88);
  --surface-strong: #171322;
  --surface-soft: #211a31;
  --border: rgba(255, 255, 255, 0.09);
  --muted: #a69eb5;
  --text: #f7f4ff;
  --purple: #9a5cff;
  --purple-bright: #bd8cff;
  --pink: #f35bc4;
  --green: #52d68b;
  --red: #ff647c;
  --yellow: #f7c95c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(118, 64, 201, 0.16), transparent 38rem),
    linear-gradient(180deg, #0b0913 0%, #08070d 65%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.16;
  pointer-events: none;
}
.ambient-one { width: 24rem; height: 24rem; background: var(--purple); top: 18rem; right: -10rem; }
.ambient-two { width: 20rem; height: 20rem; background: var(--pink); bottom: -10rem; left: -8rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: 76px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 7, 13, 0.74);
  backdrop-filter: blur(22px);
}

.brand { display: inline-flex; align-items: center; gap: 0.8rem; width: max-content; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--purple), #5e2fa6 62%, #28183a);
  box-shadow: 0 10px 30px rgba(135, 70, 230, 0.35);
  font: 800 1.2rem/1 Georgia, serif;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 0.1rem; color: var(--muted); font-size: 0.72rem; }

.topnav { display: flex; gap: 1.6rem; color: var(--muted); font-size: 0.9rem; }
.topnav a:hover { color: var(--text); }
.account { justify-self: end; display: flex; align-items: center; gap: 0.7rem; }
.account img { width: 34px; height: 34px; border-radius: 50%; }
.account-name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-shell { width: min(1480px, 94vw); margin: 0 auto; padding: 3.5rem 0 5rem; }
.loading-card { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.loader { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  align-items: center;
  gap: 5vw;
  min-height: 68vh;
}
.eyebrow { color: var(--purple-bright); text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 800; }
.hero h1 { max-width: 13ch; margin: 1rem 0 1.25rem; font: 700 clamp(3rem, 7vw, 6.8rem)/.94 Georgia, serif; letter-spacing: -.055em; }
.hero h1 span { color: var(--purple-bright); font-style: italic; }
.hero-copy > p { max-width: 42rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.24rem); line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .72rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 700;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); border-color: rgba(189, 140, 255, .5); }
.button.primary { border-color: transparent; background: linear-gradient(135deg, var(--purple), #6f37c5); box-shadow: 0 12px 35px rgba(130, 66, 220, .28); }
.button.danger { color: #ffdce2; background: rgba(255, 100, 124, .12); border-color: rgba(255, 100, 124, .3); }
.button.ghost { background: transparent; }
.button.small { min-height: 35px; padding: .45rem .7rem; font-size: .8rem; }
.button[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.hero-panel, .card, .panel, .legal-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.hero-panel { padding: 1.1rem; border-radius: 26px; transform: rotate(1.1deg); }
.preview-window { overflow: hidden; border: 1px solid var(--border); border-radius: 19px; background: #0e0b16; }
.preview-top { display: flex; align-items: center; gap: .4rem; height: 42px; padding: 0 1rem; border-bottom: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #443b53; }
.dot:first-child { background: var(--pink); }
.preview-body { display: grid; grid-template-columns: 104px 1fr; min-height: 420px; }
.preview-nav { padding: 1rem .75rem; border-right: 1px solid var(--border); background: #0b0911; }
.preview-nav span { display: block; height: 9px; margin: .7rem 0; border-radius: 5px; background: #292038; }
.preview-nav span:nth-child(2) { width: 74%; background: var(--purple); }
.preview-content { padding: 1.3rem; }
.preview-heading { width: 58%; height: 18px; margin-bottom: 1rem; border-radius: 9px; background: #eee9f8; }
.preview-line { width: 92%; height: 9px; margin: .6rem 0; border-radius: 5px; background: #302840; }
.preview-line.short { width: 62%; }
.preview-cards { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem; margin-top: 1.6rem; }
.preview-card { min-height: 104px; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(145deg, #1c1628, #120e1b); }

.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0 4rem; }
.feature { padding: 1.25rem; border-top: 1px solid var(--border); }
.feature strong { display: block; margin-bottom: .45rem; }
.feature p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

.support-widget-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 350px); align-items: center; gap: clamp(1.5rem, 5vw, 5rem); margin: 1rem 0 4rem; padding: clamp(1.4rem, 4vw, 3rem); border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.support-widget-copy h2 { max-width: 14ch; margin: .7rem 0 1rem; font: 700 clamp(2rem, 4vw, 3.6rem)/1 Georgia, serif; }
.support-widget-copy p { max-width: 38rem; color: var(--muted); line-height: 1.7; }
.discord-widget { display: block; width: 100%; max-width: 350px; min-height: 500px; border: 0; border-radius: 14px; background: #202225; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.page-heading h1 { margin: .35rem 0 0; font: 700 clamp(2.2rem, 4vw, 4rem)/1 Georgia, serif; letter-spacing: -.04em; }
.page-heading p { max-width: 42rem; color: var(--muted); }

.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.guild-card { display: flex; flex-direction: column; min-height: 210px; padding: 1.35rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.guild-head { display: flex; align-items: center; gap: .9rem; }
.guild-icon { display: grid; place-items: center; flex: 0 0 50px; width: 50px; height: 50px; border-radius: 16px; background: linear-gradient(135deg, #36264d, #171020); object-fit: cover; font-weight: 800; }
.guild-card h2 { margin: 0; font-size: 1.04rem; }
.guild-card p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.guild-actions { display: flex; gap: .6rem; margin-top: auto; padding-top: 1.4rem; }
.badge { display: inline-flex; width: max-content; padding: .25rem .52rem; border-radius: 999px; background: rgba(82,214,139,.12); color: #8ce6af; font-size: .72rem; font-weight: 800; }
.badge.offline { color: #f5cc72; background: rgba(247,201,92,.1); }

.dashboard-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.sidebar { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; padding: .75rem; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 12, 23, .86); }
.server-chip { display: flex; align-items: center; gap: .75rem; padding: .65rem; margin-bottom: .6rem; }
.server-chip img, .server-chip .guild-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
.server-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-chip small { color: var(--muted); }
.side-group { margin: 1rem 0 .45rem; padding: 0 .6rem; color: #786d88; text-transform: uppercase; letter-spacing: .12em; font-size: .64rem; font-weight: 900; }
.side-link { display: flex; width: 100%; padding: .68rem .75rem; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; }
.side-link:hover, .side-link.active { color: var(--text); background: var(--surface-soft); }
.side-link.active { box-shadow: inset 3px 0 var(--purple); }

.content { min-width: 0; }
.panel { overflow: hidden; border-radius: 20px; }
.panel-header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.6rem; border-bottom: 1px solid var(--border); }
.panel-header h1, .panel-header h2 { margin: 0; font: 700 1.7rem/1.1 Georgia, serif; }
.panel-header p { margin: .45rem 0 0; color: var(--muted); line-height: 1.5; }
.panel-body { padding: 1.6rem; }
.message-tool-section { margin-top: 1rem; padding: 1.15rem; border: 1px solid var(--border); border-radius: 14px; background: #0e0b16; }
.message-tool-section + .message-tool-section { margin-top: 1rem; }
.message-tool-section h2 { margin: 0; font-size: 1.05rem; }
.message-tool-section > p { margin: .35rem 0 1rem; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.message-composer-form { display: grid; gap: 1rem; }
.composer-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #151020; }
.composer-mode-bar strong, .composer-mode-bar small { display: block; }
.composer-mode-bar small { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.composer-mode-control { display: flex; align-items: center; gap: .65rem; font-size: .78rem; font-weight: 800; }
.composer-mode-label { min-width: 42px; color: var(--purple-bright); text-align: right; }
.message-composer { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: 1rem; align-items: start; }
.message-composer-editor { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: 13px; background: #0b0911; }
.embed-editor { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.embed-editor[hidden] { display: none; }
.embed-editor-heading, .embed-fields-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.embed-editor-heading h3, .embed-fields-heading h3 { margin: 0; font-size: .88rem; }
.embed-editor-heading small, .embed-fields-heading small { display: block; margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.embed-fields-editor { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.embed-field-rows { display: grid; gap: .7rem; }
.embed-field-row { display: grid; grid-template-columns: minmax(150px, .6fr) minmax(220px, 1fr) auto; gap: .65rem; align-items: start; padding: .7rem; border: 1px solid var(--border); border-radius: 10px; background: #100d18; }
.embed-field-row .textarea { min-height: 74px; }
.embed-field-controls { display: grid; gap: .45rem; }
.discord-preview { position: sticky; top: 92px; min-width: 0; overflow: hidden; border: 1px solid #313338; border-radius: 13px; background: #313338; box-shadow: 0 14px 34px rgba(0,0,0,.24); }
.discord-preview-heading { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem .9rem; color: #f2f3f5; background: #2b2d31; border-bottom: 1px solid #1e1f22; }
.discord-preview-heading strong { font-size: .78rem; }
.discord-preview-heading small { color: #b5bac1; font-size: .68rem; }
.discord-message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: .75rem; min-height: 160px; padding: 1rem; color: #dbdee1; }
.discord-message-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: white; background: linear-gradient(135deg, #a259ff, #5b21b6); font-weight: 900; }
.discord-message-body { min-width: 0; }
.discord-message-identity { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; line-height: 1; }
.discord-message-identity strong { color: #f2f3f5; font-size: .9rem; }
.discord-message-identity time { color: #949ba4; font-size: .65rem; }
.discord-bot-badge { padding: .16rem .28rem; border-radius: 3px; color: white; background: #5865f2; font-size: .58rem; font-weight: 900; }
.discord-message-content, .discord-embed-description, .discord-embed-field div { margin-top: .35rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.4; }
.discord-embed-preview { position: relative; max-width: 520px; margin-top: .45rem; overflow: hidden; border-radius: 4px; background: #2b2d31; }
.discord-embed-preview::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--embed-color, #5865f2); }
.discord-embed-body { min-width: 0; padding: .75rem 1rem .75rem .95rem; }
.discord-embed-author { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; color: #f2f3f5; font-size: .72rem; }
.discord-embed-author img, .discord-embed-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.discord-embed-title { display: block; color: #00a8fc; font-size: .86rem; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.discord-embed-description { color: #dbdee1; }
.discord-embed-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .6rem; margin-top: .65rem; }
.discord-embed-field { grid-column: 1 / -1; min-width: 0; }
.discord-embed-field.inline { grid-column: span 4; }
.discord-embed-field strong { display: block; color: #f2f3f5; font-size: .72rem; overflow-wrap: anywhere; }
.discord-embed-image { display: block; width: 100%; max-height: 330px; margin-top: .75rem; border-radius: 4px; object-fit: contain; object-position: left center; }
.discord-embed-thumbnail { position: absolute; z-index: 1; top: .75rem; right: .75rem; width: 72px; height: 72px; border-radius: 4px; object-fit: cover; }
.discord-embed-preview:has(.discord-embed-thumbnail) .discord-embed-body { padding-right: 94px; }
.discord-embed-footer { display: flex; align-items: center; gap: .4rem; margin-top: .65rem; color: #b5bac1; font-size: .64rem; line-height: 1.35; }
.discord-preview-empty { margin-top: .45rem; color: #949ba4; font-size: .76rem; font-style: italic; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { min-width: 0; }
.field.wide, .field[data-kind="textarea"], .field[data-kind="list"], .field[data-kind="json"], .field[data-kind="multirole"], .field[data-kind="multi_choice"] { grid-column: 1 / -1; }
.field-label { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; font-size: .82rem; font-weight: 800; }
.field-help { margin: .4rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #0e0b16;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(154,92,255,.12); }
.textarea { min-height: 108px; resize: vertical; line-height: 1.5; }
.code-input { min-height: 220px; font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: .8rem; tab-size: 2; }
.select[multiple] { min-height: 150px; }
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: #0e0b16; }
.toggle { position: relative; width: 44px; height: 24px; appearance: none; border-radius: 999px; background: #3b3349; transition: background .15s ease; }
.toggle::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.toggle:checked { background: var(--purple); }
.toggle:checked::after { transform: translateX(20px); }
.choice-list { display: flex; flex-wrap: wrap; gap: .55rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: #0e0b16; }
.choice { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .6rem; border-radius: 8px; background: var(--surface-soft); font-size: .8rem; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 1.35rem; margin-top: 1.35rem; border-top: 1px solid var(--border); }

.save-state { display: grid; gap: .25rem; margin-bottom: 1.25rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #100d18; }
.save-state strong { font-size: .86rem; }
.save-state p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.save-state.saved { border-color: rgba(82,214,139,.38); background: rgba(82,214,139,.08); }
.save-state.dirty { border-color: rgba(247,201,92,.38); background: rgba(247,201,92,.08); }

.staff-role-overview { margin-bottom: 1.25rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: #0e0b16; }
.staff-role-heading h2 { margin: 0; font-size: 1rem; }
.staff-role-heading p { margin: .35rem 0 .85rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.staff-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.staff-role-card { display: grid; gap: .45rem; padding: .85rem; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.staff-role-card.valid { border-color: rgba(82,214,139,.3); }
.staff-role-card.invalid { border-color: rgba(255,100,124,.32); }
.staff-role-card strong { font-size: .82rem; }
.staff-role-card p, .staff-role-card small { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
.badge.valid { color: #8ce6af; background: rgba(82,214,139,.12); }
.badge.invalid { color: #ff9bad; background: rgba(255,100,124,.12); }

.current-selection { margin-top: 1.35rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: #0e0b16; }
.current-selection-heading h2 { margin: 0; font-size: 1rem; }
.current-selection-heading p { margin: .35rem 0 .85rem; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0; }
.selection-item { min-width: 0; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.selection-item dt { margin-bottom: .3rem; color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.selection-item dd { margin: 0; font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }
.change-attribution { display: flex; align-items: center; gap: .7rem; margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.change-attribution strong { display: block; font-size: .8rem; }
.change-attribution p, .change-attribution small { display: block; margin: .2rem 0 0; color: var(--muted); font-size: .72rem; line-height: 1.4; overflow-wrap: anywhere; }
.change-avatar { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.collection-list { display: grid; gap: .7rem; margin-top: 1.4rem; }
.collection-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #100d18; }
.collection-row strong { display: block; overflow-wrap: anywhere; }
.collection-row small { display: block; margin-top: .25rem; color: var(--muted); overflow-wrap: anywhere; }
.row-actions { display: flex; gap: .45rem; }
.empty { padding: 2.5rem 1rem; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 12px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.module-card { display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: #100d18; }
.module-card h3 { margin: 0 0 .35rem; font-size: .92rem; }
.module-card p { margin: .55rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.module-card .badge { font-size: .64rem; }
.module-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .9rem; }
.module-note { display: block; margin-top: auto; padding-top: .9rem; color: #786d88; font-size: .7rem; line-height: 1.4; }

.audit-list { display: grid; gap: .6rem; }
.audit-item { padding: .9rem; border-left: 2px solid var(--purple); background: #100d18; }
.audit-item strong { font-size: .85rem; }
.audit-item p { margin: .35rem 0 0; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.audit-changes { margin: .55rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .76rem; line-height: 1.55; overflow-wrap: anywhere; }

.setup-warning { max-width: 760px; margin: 1rem auto; padding: 1.3rem; border: 1px solid rgba(247,201,92,.25); border-radius: 16px; background: rgba(247,201,92,.07); }
.setup-warning code { color: #f8d987; }
.legal-card { max-width: 850px; margin: 1rem auto; padding: clamp(1.4rem, 4vw, 3rem); border-radius: 22px; }
.legal-card h1 { font: 700 2.7rem/1 Georgia, serif; }
.legal-card h2 { margin-top: 2rem; }
.legal-card p, .legal-card li { color: var(--muted); line-height: 1.7; }

.toast { position: fixed; z-index: 50; right: 1.3rem; bottom: 1.3rem; max-width: 380px; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #21182f; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #321721; border-color: rgba(255,100,124,.35); }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero h1 { max-width: 11ch; }
  .hero-panel { max-width: 600px; transform: none; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .support-widget-section { grid-template-columns: 1fr; }
  .discord-widget { justify-self: center; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .message-composer { grid-template-columns: 1fr; }
  .discord-preview { position: static; }
  .sidebar { position: static; display: flex; gap: .35rem; overflow-x: auto; max-height: none; padding: .55rem; }
  .server-chip, .side-group { display: none; }
  .side-link { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .side-link.active { box-shadow: inset 0 -3px var(--purple); }
}

@media (max-width: 620px) {
  .topbar { padding: 0 4%; }
  .account-name { display: none; }
  .app-shell { width: 92vw; padding-top: 2rem; }
  .hero h1 { font-size: 3.4rem; }
  .feature-strip, .form-grid, .staff-role-grid, .selection-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: start; flex-direction: column; }
  .panel-header, .panel-body { padding: 1.15rem; }
  .collection-row { grid-template-columns: 1fr; }
  .composer-mode-bar, .embed-editor-heading, .embed-fields-heading { align-items: flex-start; flex-direction: column; }
  .embed-field-row { grid-template-columns: 1fr; }
  .embed-field-controls { display: flex; justify-content: space-between; }
  .discord-embed-field.inline { grid-column: 1 / -1; }
  .row-actions { justify-content: flex-start; }
}

/* 2026 Lex visual system */
[hidden] { display: none !important; }

:root {
  --bg: #050308;
  --surface: #0d0914;
  --surface-strong: #120b1c;
  --surface-soft: #171020;
  --border: rgba(181, 74, 255, .24);
  --border-strong: rgba(193, 79, 255, .48);
  --muted: #a89aba;
  --muted-deep: #746681;
  --text: #f7f1ff;
  --purple: #9d00ff;
  --purple-bright: #c35cff;
  --pink: #ef3dff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

html { width: 100%; overflow-x: hidden; background: #050308; }
body {
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 6%, rgba(145, 0, 255, .10), transparent 28rem),
    radial-gradient(circle at 15% 36%, rgba(97, 22, 153, .08), transparent 32rem),
    #050308;
}

.ambient { opacity: .08; filter: blur(140px); }
.ui-icon { flex: 0 0 auto; width: 1rem; height: 1rem; }

.topbar {
  display: block;
  min-height: 66px;
  padding: 0;
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(181, 74, 255, .28);
  border-radius: 0;
  background: rgba(5, 3, 8, .94);
  backdrop-filter: blur(24px);
}
.topbar-inner {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
  align-items: center;
  gap: 1rem;
  width: min(1600px, calc(100% - 48px));
  min-height: 66px;
  margin: 0 auto;
  padding: 0 18px;
}
.brand { gap: .65rem; }
.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(200, 83, 255, .5);
  border-radius: 10px;
  background: #000;
  box-shadow: 0 0 24px rgba(164, 43, 255, .2);
  object-fit: cover;
}
.brand strong { font-size: .9rem; letter-spacing: .01em; }
.brand small { color: #746681; font-size: .62rem; }
.topnav { gap: .35rem; font-size: .78rem; }
.topnav a {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 36px;
  padding: .45rem .62rem;
  border-radius: 8px;
  color: #a998bc;
  transition: color .15s ease, background .15s ease;
}
.topnav a span { color: #b154ed; font-size: .8rem; }
.topnav a:hover { color: white; background: rgba(157, 0, 255, .1); }

.account { position: relative; min-width: 0; }
.account-login { border-color: rgba(187, 70, 255, .52); }
.account-menu-wrap { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: 220px;
  min-height: 40px;
  padding: .3rem .58rem .3rem .34rem;
  border: 1px solid rgba(190, 71, 255, .48);
  border-radius: 12px;
  color: var(--text);
  background: #11091a;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: #b238ff; background: #190c25; }
.account-avatar, .account-avatar-fallback {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  color: #fff;
  background: linear-gradient(145deg, #b000ff, #6e00b5);
  font-size: .7rem;
  font-weight: 900;
}
.account-trigger-copy { min-width: 0; text-align: left; }
.account-trigger-copy strong, .account-trigger-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger-copy strong { font-size: .75rem; }
.account-trigger-copy small { margin-top: .1rem; color: #746681; font-size: .58rem; }
.account-chevron { margin-left: .1rem; color: #9c8aaa; transition: transform .15s ease; }
.account-trigger[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + .6rem);
  right: 0;
  width: min(270px, 88vw);
  overflow: hidden;
  border: 1px solid rgba(185, 62, 255, .48);
  border-radius: 14px;
  background: #0c0712;
  box-shadow: 0 22px 65px rgba(0, 0, 0, .72);
}
.account-popover-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(185, 62, 255, .18);
}
.account-popover-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.account-popover-summary strong, .account-popover-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover-summary strong { font-size: .78rem; }
.account-popover-summary small { margin-top: .15rem; color: #766981; font-size: .62rem; }
.account-online { color: #69e6a4; font-size: .62rem; font-weight: 800; }
.account-online::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .3rem; border-radius: 50%; background: #69e6a4; }
.account-popover-links { display: grid; padding: .55rem; }
.account-menu-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  min-height: 38px;
  padding: .58rem .7rem;
  border: 0;
  border-radius: 8px;
  color: #b8a8c7;
  background: transparent;
  font-size: .74rem;
  text-align: left;
}
.account-menu-item .ui-icon { color: #81549e; }
.account-menu-item:hover { color: #fff; background: rgba(163, 39, 255, .11); }
.account-menu-logout { margin: 0 .55rem .55rem; width: calc(100% - 1.1rem); border-top: 1px solid rgba(185, 62, 255, .16); border-radius: 0 0 8px 8px; color: #ff6c86; }
.account-menu-logout .ui-icon { color: #ff6c86; }

.app-shell { width: min(1440px, 94vw); padding: 2.4rem 0 5rem; }
.app-shell.landing-shell {
  width: 100%;
  margin-top: 0;
  padding: 0 0 4rem;
  border: 0;
  background: #06030a;
}

.landing-hero {
  position: relative;
  display: block;
  min-height: 450px;
  overflow: hidden;
  padding-block: clamp(3.2rem, 7vw, 5.5rem);
  padding-inline: max(3rem, calc((100vw - 1600px) / 2 + 3rem));
  border: 0;
  border-bottom: 1px solid rgba(180, 44, 255, .2);
  border-radius: 0;
  background:
    linear-gradient(90deg, #06030a 0%, rgba(6, 3, 10, .98) 42%, rgba(6, 3, 10, .62) 70%, rgba(6, 3, 10, .45) 100%),
    url("/assets/lex-wordmark.png?v=20260623-r5") right center / auto 100% no-repeat,
    #06030a;
  isolation: isolate;
}
.landing-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 25% 50%, rgba(139, 18, 235, .11), transparent 28rem);
  pointer-events: none;
}
.hero-wordmark {
  display: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 650px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .72rem;
  border: 1px solid rgba(180, 51, 255, .48);
  border-radius: 999px;
  background: rgba(126, 0, 207, .08);
  font-size: .64rem;
}
.hero-eyebrow .ui-icon { width: .75rem; height: .75rem; }
.hero-title { max-width: none !important; margin: 1.45rem 0 1rem !important; font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif !important; font-size: clamp(3rem, 5.2vw, 4.7rem) !important; font-style: normal !important; font-weight: 950 !important; line-height: .98 !important; letter-spacing: -.055em !important; }
.hero .hero-title .hero-title-line { display: block; color: #f5effa; font-style: normal; }
.hero .hero-title .hero-title-secondary { color: #b96cff; }
.hero .hero-title .hero-title-accent { margin-top: .15rem; color: #bd00ff; text-shadow: 0 0 35px rgba(178, 0, 255, .18); }
.hero-description { max-width: 520px !important; color: #a99cb6 !important; font-size: clamp(.88rem, 1.1vw, 1rem) !important; line-height: 1.7 !important; }
.hero-actions { gap: .65rem; margin-top: 1.7rem; }
.hero-actions .button { min-height: 42px; border-color: rgba(255, 255, 255, .18); background: rgba(12, 8, 17, .78); font-size: .78rem; }
.hero-actions .button.primary { border-color: rgba(191, 67, 255, .65); background: linear-gradient(135deg, #a500ff, #7100b7); }

.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 0;
  border-bottom: 1px solid rgba(180, 44, 255, .26);
  background: #0b0710;
}
.landing-stat { display: flex; align-items: center; gap: .85rem; min-height: 94px; padding: 1.25rem 1.6rem; border-right: 1px solid rgba(180, 44, 255, .18); }
.landing-stat:last-child { border-right: 0; }
.landing-stat-icon, .feature-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(181, 54, 255, .5);
  border-radius: 10px;
  color: #c34fff;
  background: rgba(143, 0, 230, .12);
}
.landing-stat strong, .landing-stat small { display: block; }
.landing-stat strong { font-size: 1.08rem; }
.landing-stat small { margin-top: .15rem; color: #7d6c89; font-size: .65rem; }

.landing-features { padding: clamp(2.6rem, 6vw, 4rem) clamp(1.7rem, 4vw, 2.8rem); }
.landing-section-heading { max-width: 650px; margin: 0 auto 2rem; text-align: center; }
.landing-section-heading h2 { margin: .65rem 0 .5rem; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.landing-section-heading p { margin: 0; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: min(1500px, 100%); margin: 0 auto; }
.feature-card {
  min-height: 190px;
  padding: 1.6rem;
  border: 1px solid rgba(181, 54, 255, .28);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(17, 10, 25, .96), rgba(10, 6, 15, .96));
  box-shadow: inset 0 1px rgba(255, 255, 255, .015);
  transition: transform .18s ease, border-color .18s ease;
}
.feature-card:hover { transform: translateY(-2px); border-color: rgba(194, 71, 255, .5); }
.feature-card h3 { margin: 1rem 0 .55rem; font-size: .95rem; }
.feature-card p { margin: 0; color: #7f708c; font-size: .78rem; line-height: 1.7; }
.feature-icon { width: 40px; height: 40px; }

.landing-support { width: min(1500px, calc(100% - clamp(3.4rem, 8vw, 5.6rem))); margin: 0 auto; border-color: rgba(181, 54, 255, .35); border-radius: 16px; background: linear-gradient(135deg, #0f0917, #09060e); }
.landing-support .support-widget-copy h2 { max-width: 12ch; color: #f8f1ff; }

.hero-panel, .card, .panel, .legal-card { border-color: rgba(181, 54, 255, .24); background: rgba(13, 9, 20, .96); }
.panel { border-radius: 14px; }
.panel-header { border-bottom-color: rgba(181, 54, 255, .18); }

.dashboard-layout { grid-template-columns: 268px minmax(0, 1fr); gap: 1rem; align-items: start; }
.dashboard-mobile-bar, .sidebar-backdrop, .sidebar-close { display: none; }
.sidebar {
  position: sticky;
  top: 82px;
  display: block;
  max-height: calc(100vh - 98px);
  overflow: auto;
  padding: .55rem;
  border: 1px solid rgba(181, 54, 255, .22);
  border-radius: 14px;
  background: rgba(10, 6, 15, .98);
  scrollbar-width: thin;
  scrollbar-color: rgba(175, 59, 245, .32) transparent;
}
.sidebar-header { display: flex; align-items: center; }
.server-chip { flex: 1; gap: .65rem; min-width: 0; margin: 0 0 .35rem; padding: .72rem; border-bottom: 1px solid rgba(181, 54, 255, .16); }
.server-chip:hover { background: rgba(158, 32, 235, .07); }
.server-chip img, .server-chip .guild-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
.server-chip > span:last-child { min-width: 0; }
.server-chip strong { font-size: .76rem; }
.server-chip small { display: block; margin-top: .18rem; overflow: hidden; color: #746681; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.side-group { margin: .95rem 0 .34rem; padding: 0 .55rem; color: #664279; font-size: .58rem; letter-spacing: .13em; }
.side-link {
  align-items: center;
  gap: .72rem;
  min-height: 38px;
  padding: .55rem .7rem;
  border-radius: 8px;
  color: #a996ba;
  font-size: .72rem;
}
.side-link .ui-icon { width: .9rem; height: .9rem; color: #79518f; }
.side-link:hover { color: #f7efff; background: rgba(148, 25, 222, .1); }
.side-link.active { color: #d899ff; background: rgba(137, 12, 207, .19); box-shadow: inset 2px 0 #b82dff; }
.side-link.active .ui-icon { color: #c34fff; }
.sidebar-footer { margin-top: 1rem; padding: .65rem .25rem .2rem; border-top: 1px solid rgba(181, 54, 255, .16); }
.sidebar-footer-link { display: flex; align-items: center; gap: .6rem; padding: .6rem; border-radius: 8px; color: #806e8c; font-size: .68rem; }
.sidebar-footer-link:hover { color: #fff; background: rgba(148, 25, 222, .1); }
.content { min-width: 0; }

@media (max-width: 1050px) {
  .topbar-inner { grid-template-columns: minmax(150px, 1fr) auto minmax(140px, 1fr); }
  .topnav { gap: .1rem; }
  .topnav a { padding-inline: .45rem; }
  .landing-stat { padding-inline: 1rem; }
}

@media (max-width: 900px) {
  .topbar { width: 100%; margin: 0; }
  .topbar-inner { grid-template-columns: 1fr auto; width: calc(100% - 24px); padding-inline: 0; }
  .topnav { display: none; }
  .app-shell { width: calc(100% - 16px); }
  .app-shell.landing-shell { width: 100%; padding-top: 0; }
  .landing-hero { min-height: 520px; padding: 3.5rem 1.6rem; }
  .hero-copy { max-width: 640px; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); }
  .landing-stat:nth-child(2) { border-right: 0; }
  .landing-stat:nth-child(-n+2) { border-bottom: 1px solid rgba(180, 44, 255, .18); }
  .support-widget-section { grid-template-columns: 1fr; }

  .dashboard-layout { display: grid; grid-template-columns: 1fr; }
  .dashboard-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem;
    border: 1px solid rgba(181, 54, 255, .24);
    border-radius: 12px;
    background: #0d0914;
  }
  .dashboard-mobile-title small, .dashboard-mobile-title strong { display: block; }
  .dashboard-mobile-title small { color: #746681; font-size: .6rem; }
  .dashboard-mobile-title strong { margin-top: .15rem; max-width: 45vw; overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-menu-button { min-height: 36px; padding: .5rem .7rem; font-size: .7rem; }
  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 88vw);
    max-height: none;
    padding: .75rem;
    border-width: 0 1px 0 0;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 24px 0 70px rgba(0, 0, 0, .65);
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 8px; color: #a996ba; background: rgba(145, 24, 217, .1); font-size: 1.4rem; }
  .sidebar-backdrop { position: fixed; z-index: 70; inset: 0; display: block; border: 0; background: rgba(0, 0, 0, .68); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .server-chip { display: flex; }
  .side-group { display: block; }
  .side-link { display: flex; width: 100%; white-space: normal; }
}

@media (max-width: 620px) {
  .topbar-inner { min-height: 62px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand small { display: none; }
  .account-trigger-copy { display: none; }
  .account-trigger { padding-right: .38rem; }
  .account-popover { position: fixed; top: 70px; right: 4vw; width: 92vw; }
  .hero-title { font-size: clamp(2.55rem, 13vw, 4rem) !important; }
  .landing-hero { min-height: 545px; padding-top: 3rem; }
  .hero-description { font-size: .86rem !important; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .landing-hero {
    background:
      linear-gradient(180deg, rgba(6, 3, 10, .82), rgba(6, 3, 10, .94)),
      url("/assets/lex-wordmark.png?v=20260623-r5") center bottom / auto 56% no-repeat,
      #06030a;
  }
  .landing-stats { grid-template-columns: 1fr; }
  .landing-stat { border-right: 0; border-bottom: 1px solid rgba(180, 44, 255, .18); }
  .landing-stat:last-child { border-bottom: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 170px; padding: 1.3rem; }
  .landing-features { padding-block: 3.5rem; }
  .landing-support { padding: 1.25rem; }
  .discord-widget { min-height: 430px; height: 430px; }
  .dashboard-menu-button span { display: none; }
}
