/* Layout: crypt sidebar on the left, working area on the right; the embed editor
   splits into a form and a live Discord preview. Deliberately single dark theme. */
:root {
  --void: #0c090f;
  --crypt: #141018;
  --tomb: #1b1520;
  --raise: #231b29;
  --seam: #2e2335;
  --bone: #ece5d9;
  --ash: #a39aa6;
  --dust: #6f6475;
  --blood: #c4173a;
  --ember: #ef5b74;
  --moss: #74c69a;
  --amber: #e3ad55;
  --display: "Pirata One", "UnifrakturCook", Georgia, serif;
  --ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --gothic: "Cambria Math", "STIX Two Math", "Noto Sans Math", "Segoe UI Symbol", "Apple Symbols", serif;
  /* Discord's own preview colors */
  --dc-bg: #313338;
  --dc-embed: #2b2d31;
  --dc-text: #dbdee1;
  --dc-muted: #949ba4;
  --dc-link: #00a8fc;
  --dc-mention: rgba(88, 101, 242, 0.3);
  --dc-mention-fg: #c9cdfb;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--ui);
  font-size: 14.5px;
  line-height: 1.55;
}
.fog {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 35% at 70% -5%, rgba(196, 23, 58, 0.15), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(120, 80, 160, 0.10), transparent 70%);
}
a { color: var(--ember); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; }

/* Sidebar ---------------------------------------------------------------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--crypt), var(--void));
  border-right: 1px solid var(--seam);
  padding: 22px 16px 18px; display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px;
  border: 1px solid var(--blood); background: radial-gradient(circle, rgba(196,23,58,.35), transparent 70%);
}
.brand-name { font-family: var(--display); font-size: 30px; line-height: 1; text-shadow: 0 0 18px rgba(196,23,58,.5); }
.brand-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ash); }
.status-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-family: var(--mono); font-size: 12px; color: var(--ash);
  border: 1px solid var(--seam); padding: 4px 10px; background: var(--tomb);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dust); flex: none; }
.status-chip[data-state="online"] .dot { background: var(--moss); box-shadow: 0 0 8px var(--moss); }
.status-chip[data-state="connecting"] .dot { background: var(--amber); animation: pulse 1.2s infinite; }
.status-chip[data-state="error"] .dot { background: var(--blood); box-shadow: 0 0 8px var(--blood); }
@keyframes pulse { 50% { opacity: .3; } }
.guild-pick { display: grid; gap: 6px; }
.label, .eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--ash); text-decoration: none;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--bone); background: var(--tomb); }
.nav a[aria-current="page"] { color: var(--bone); background: var(--tomb); border-left-color: var(--blood); }
.glyph { width: 20px; text-align: center; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--dust); }

/* Main -------------------------------------------------------------------- */
.main { padding: 34px clamp(16px, 4vw, 48px) 120px; outline: none; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; margin-bottom: 26px; }
.page-head h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(36px, 5vw, 52px); line-height: 1; margin: 4px 0 0;
  text-shadow: 0 0 24px rgba(196,23,58,.35); text-wrap: balance;
}
.page-head p { margin: 6px 0 0; color: var(--ash); max-width: 62ch; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--crypt); border: 1px solid var(--seam); padding: 20px; min-width: 0; }
.card > h2, .card-title {
  font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.1; margin: 0 0 14px;
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title-row h2 { font-family: var(--display); font-weight: 400; font-size: 25px; margin: 0; }
.muted { color: var(--ash); }
.small { font-size: 12.5px; }
hr.seam { border: 0; border-top: 1px solid var(--seam); margin: 18px 0; }

/* Forms ------------------------------------------------------------------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; align-content: start; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.field > span:first-child { font-size: 12.5px; color: var(--ash); font-weight: 500; }
.hint { font-size: 12px; color: var(--dust); }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
  width: 100%; background: var(--void); border: 1px solid var(--seam); padding: 9px 11px; color: var(--bone);
  border-radius: 0; min-width: 0;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blood); outline: none; box-shadow: 0 0 0 3px rgba(196,23,58,.18); }
input[type="color"] { width: 46px; height: 38px; padding: 2px; background: var(--void); border: 1px solid var(--seam); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--blood); }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="text"] { font-family: var(--mono); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--blood); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--tomb); border: 1px solid var(--seam); color: var(--bone); padding: 9px 14px;
  font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--dust); background: var(--raise); }
.btn.primary { background: var(--blood); border-color: var(--blood); color: #fff; }
.btn.primary:hover { background: #d81d43; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(196,23,58,.6); color: var(--ember); background: transparent; }
.btn.danger:hover { background: rgba(196,23,58,.14); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border: 1px solid var(--seam); color: var(--ash); }
.pill.ok { color: var(--moss); border-color: rgba(116,198,154,.4); }
.pill.warn { color: var(--amber); border-color: rgba(227,173,85,.4); }
.pill.bad { color: var(--ember); border-color: rgba(196,23,58,.5); }
.notice { border-left: 3px solid var(--amber); background: linear-gradient(90deg, rgba(227,173,85,.10), transparent); padding: 12px 14px; margin-bottom: 16px; }
.notice.bad { border-left-color: var(--blood); background: linear-gradient(90deg, rgba(196,23,58,.12), transparent); }
.notice p { margin: 0; }

/* Summoning --------------------------------------------------------------- */
.summon { max-width: 720px; }
.summon-hero { text-align: left; padding: 28px; border: 1px solid var(--blood); background:
  radial-gradient(ellipse 80% 70% at 100% 0%, rgba(196,23,58,.18), transparent 70%), var(--crypt); }
.summon-hero h2 { font-family: var(--display); font-weight: 400; font-size: 40px; margin: 0 0 6px; line-height: 1; }
.token-row { display: flex; gap: 8px; margin-top: 18px; }
.token-row input { font-family: var(--mono); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: var(--ash); }
.steps li::before { content: counter(s, upper-roman) "."; font-family: var(--display); color: var(--blood); font-size: 20px; line-height: 1.2; }
.steps b { color: var(--bone); font-weight: 600; }
.bot-id { display: flex; align-items: center; gap: 14px; }
.bot-id img { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--blood); }
.bot-id .name { font-family: var(--display); font-size: 30px; line-height: 1; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.checklist .mark { font-family: var(--mono); }
.checklist .yes { color: var(--moss); }
.checklist .no { color: var(--ember); }
.server-list { display: grid; gap: 8px; }
.server { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--void); border: 1px solid var(--seam); }
.server img, .server .noicon { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.server .noicon { display: grid; place-items: center; background: var(--raise); font-family: var(--display); font-size: 18px; }

/* Editor ------------------------------------------------------------------ */
.editor { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.preview-col { position: sticky; top: 20px; display: grid; gap: 12px; min-width: 0; }
.toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--raise); border: 1px solid var(--seam); padding: 10px; margin-bottom: 16px;
}
.toolbar select { width: auto; padding: 6px 8px; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--seam); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; background: var(--void); border: 1px dashed var(--seam);
  color: var(--ash); cursor: pointer;
}
.chip:hover { color: var(--bone); border-color: var(--blood); border-style: solid; }
details.more { border: 1px solid var(--seam); padding: 0 14px; margin-bottom: 14px; background: var(--void); }
details.more summary { cursor: pointer; padding: 11px 0; color: var(--ash); font-weight: 500; }
details.more[open] { padding-bottom: 4px; }
.fields-list { display: grid; gap: 10px; margin-bottom: 10px; }
.field-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto; gap: 8px; align-items: center; }
.savebar {
  position: fixed; left: 250px; right: 0; bottom: 0; z-index: 20;
  padding: 12px clamp(16px, 4vw, 48px) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(20,16,24,.94); border-top: 1px solid var(--blood); backdrop-filter: blur(6px);
  display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  transform: translateY(110%); visibility: hidden; transition: transform .2s ease, visibility .2s;
}
.savebar.show { transform: none; visibility: visible; }
.savebar .msg { margin-right: auto; color: var(--ash); }

/* Discord preview */
.dc {
  background: var(--dc-bg); color: var(--dc-text); padding: 16px 16px 18px 16px; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.375; border: 1px solid #1e1f22; overflow-x: auto;
}
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #5865f2; object-fit: cover; }
.dc-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; position: relative; top: -1px; }
.dc-time { color: var(--dc-muted); font-size: 12px; }
.dc-content { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.dc-embed {
  margin-top: 6px; background: var(--dc-embed); border-left: 4px solid #c4173a; border-radius: 4px;
  max-width: 520px; padding: 10px 14px 14px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 14px;
}
.dc-embed > * { grid-column: 1; }
.dc-thumb { grid-column: 2; grid-row: 1 / span 6; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin-top: 6px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-top: 6px; color: #f2f3f5; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { font-weight: 600; font-size: 16px; margin-top: 8px; color: #f2f3f5; word-wrap: break-word; }
.dc-title a { color: var(--dc-link); text-decoration: none; }
.dc-desc { font-size: 14px; margin-top: 8px; white-space: pre-wrap; word-wrap: break-word; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.dc-field { font-size: 14px; grid-column: span 3; min-width: 0; }
.dc-field.inline { grid-column: span 1; }
.dc-field b { display: block; font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-field div { white-space: pre-wrap; word-wrap: break-word; }
.dc-image { grid-column: 1 / -1; max-width: 100%; border-radius: 4px; margin-top: 16px; }
.dc-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dc-muted); margin-top: 8px; }
.dc-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc a { color: var(--dc-link); }
.dc .mention { background: var(--dc-mention); color: var(--dc-mention-fg); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc code { background: #1e1f22; padding: 1px 4px; border-radius: 4px; font-family: Consolas, monospace; font-size: 85%; }
.dc blockquote { margin: 0; padding-left: 10px; border-left: 4px solid #4e5058; }
.dc .h1 { font-size: 22px; font-weight: 700; } .dc .h2 { font-size: 19px; font-weight: 700; } .dc .h3 { font-size: 16px; font-weight: 700; }
.dc .sub { font-size: 12px; color: var(--dc-muted); }
.dc-buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-buttons span { background: #4e5058; color: #fff; padding: 4px 14px; border-radius: 4px; font-size: 14px; }
.dc-buttons span.red { background: #da373c; }

/* Tables ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--seam); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--seam); vertical-align: middle; white-space: nowrap; }
th { font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ash); background: var(--tomb); }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }
.rank { font-family: var(--display); font-size: 20px; color: var(--blood); width: 34px; display: inline-block; }
.role-row input[type="text"] { min-width: 150px; }
.role-row.locked { opacity: .55; }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--dust); }

/* Music */
.np { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
.np img, .np .art { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--seam); }
.np .art { display: grid; place-items: center; font-size: 34px; background: var(--void); }
.np-title { font-size: 17px; font-weight: 600; word-wrap: break-word; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; }
.queue-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--seam); }
.queue-list li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-list .n { font-family: var(--mono); color: var(--dust); }

.logs { font-family: var(--mono); font-size: 12px; background: var(--void); border: 1px solid var(--seam); padding: 10px; max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.logs .warning { color: var(--amber); } .logs .error { color: var(--ember); }

.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--seam); color: var(--ash); }
.empty .big { font-family: var(--display); font-size: 30px; color: var(--bone); display: block; margin-bottom: 6px; }

.toasts { position: fixed; right: 18px; bottom: 80px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--raise); border: 1px solid var(--seam); border-left: 3px solid var(--moss); padding: 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: rise .2s ease; }
.toast.bad { border-left-color: var(--blood); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview-col { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .nav { grid-auto-flow: column; overflow-x: auto; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav a[aria-current="page"] { border-bottom-color: var(--blood); }
  .side-foot { display: none; }
  .savebar { left: 0; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .field-item { grid-template-columns: minmax(0, 1fr) auto auto; }
  .field-item textarea, .field-item input:nth-child(2) { grid-column: 1 / -1; }
  .token-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Navigation groups */
.nav-group { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--dust); padding: 12px 10px 4px; }
@media (max-width: 820px) { .nav-group { display: none; } }

/* Modules overview */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.module {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 196px;
  background: linear-gradient(180deg, var(--tomb), var(--crypt)); border: 1px solid var(--seam);
  color: var(--bone); text-decoration: none; overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.module::after {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,23,58,.16), transparent 70%); pointer-events: none;
}
.module:hover { transform: translateY(-3px); border-color: var(--blood); box-shadow: 0 14px 32px rgba(0,0,0,.45), 0 0 0 1px rgba(196,23,58,.25); }
.mod-icon {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; border-radius: 10px;
  background: var(--tile); box-shadow: 0 6px 18px color-mix(in srgb, var(--tile) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
}
.mod-name { font-family: var(--display); font-size: 25px; line-height: 1.05; margin-top: 4px; }
.mod-desc { color: var(--ash); font-size: 13.5px; line-height: 1.5; }
.mod-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-open { font-size: 12.5px; color: var(--ember); font-weight: 600; }

/* Checkbox lists */
.multi { display: grid; gap: 2px; max-height: 220px; overflow: auto; padding: 8px 10px; background: var(--void); border: 1px solid var(--seam); }
.multi .check { margin: 0; padding: 3px 0; }
@media (prefers-reduced-motion: reduce) { .module:hover { transform: none; } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--seam); margin-bottom: 18px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; color: var(--ash); cursor: pointer; font-weight: 500; margin-bottom: -1px; }
.tab.on { color: var(--bone); border-bottom-color: var(--blood); }
.tab:hover { color: var(--bone); }

/* Role rules */
.rule-card { border: 1px solid var(--seam); background: var(--void); padding: 14px; display: grid; gap: 10px; }
.rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rule-line select { width: auto; min-width: 0; max-width: 100%; }
.rule-word { color: var(--ash); font-size: 13px; }

/* Applications */
.apps { display: grid; gap: 14px; }
.app-card { background: var(--crypt); border: 1px solid var(--seam); border-left: 3px solid var(--amber); padding: 18px; display: grid; gap: 12px; }
.app-card.accepted { border-left-color: var(--moss); }
.app-card.denied { border-left-color: var(--dust); opacity: .8; }
.app-head { display: flex; align-items: center; gap: 12px; }
.app-head img, .app-head .noicon { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.app-head .pill { margin-left: auto; }
.app-name { font-weight: 600; font-size: 16px; }
.answers { margin: 0; display: grid; grid-template-columns: minmax(140px, 240px) minmax(0, 1fr); gap: 8px 18px; }
.answers dt { color: var(--ash); font-size: 13px; }
.answers dd { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-actions input { flex: 1 1 220px; width: auto; }
@media (max-width: 700px) { .answers { grid-template-columns: minmax(0, 1fr); } .answers dd { margin-bottom: 6px; } }
.app-head .noicon { display: grid; place-items: center; background: var(--raise); font-family: var(--display); font-size: 20px; }

/* Public website: signed-in user and server picker ----------------------------- */
.user-box { display: flex; align-items: center; gap: 10px; border: 1px solid var(--seam); background: var(--tomb); padding: 8px 10px; margin-top: auto; }
.user-box img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.user-box .who { min-width: 0; flex: 1; }
.user-box .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .who .small { font-size: 12px; color: var(--ash); }
.user-box button { background: none; border: 1px solid var(--seam); color: var(--ash); font: inherit; font-size: 12px; padding: 4px 8px; cursor: pointer; }
.user-box button:hover { color: var(--bone); border-color: var(--ember); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pick { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 20px 16px;
  background: var(--crypt); border: 1px solid var(--seam); color: var(--bone); text-decoration: none; cursor: pointer; font: inherit; }
.pick:hover { border-color: var(--ember); }
.pick img, .pick .noicon { width: 64px; height: 64px; border-radius: 50%; }
.pick .noicon { display: grid; place-items: center; background: var(--raise); font-size: 26px; }
.pick .pname { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .paction { font-size: 13px; color: var(--ember); }
.pick.add { border-style: dashed; }
.pick.add img, .pick.add .noicon { opacity: .55; filter: grayscale(.6); }
[hidden] { display: none !important; }
.user-box:not([hidden]) + .side-foot { margin-top: 0; }

/* Module on/off switches */
.module-wrap { position: relative; display: grid; }
.module-wrap .module { min-height: 196px; }
.mod-switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; cursor: pointer;
  background: var(--void); border: 1px solid var(--seam); border-radius: 999px; color: var(--ash); font: 600 12px var(--ui);
}
.module-wrap .mod-switch { position: absolute; right: 16px; bottom: 16px; z-index: 2; }
.module-wrap .mod-foot { padding-right: 80px; }
.mod-switch .knob { width: 30px; height: 18px; border-radius: 999px; background: var(--seam); position: relative; transition: background .15s ease; }
.mod-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ash); transition: transform .15s ease, background .15s ease; }
.mod-switch[aria-checked="true"] { color: var(--moss); border-color: rgba(116,198,154,.45); }
.mod-switch[aria-checked="true"] .knob { background: rgba(116,198,154,.35); }
.mod-switch[aria-checked="true"] .knob::after { transform: translateX(12px); background: var(--moss); }
.mod-switch:hover { border-color: var(--ember); }
.mod-switch:disabled { opacity: .6; cursor: wait; }
.module-wrap .mod-foot .mod-open { margin-left: auto; }

/* Quick setup */
.setup-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px; text-decoration: none; color: var(--bone);
  background: linear-gradient(90deg, rgba(196,23,58,.18), var(--crypt)); border: 1px solid var(--blood); }
.setup-banner:hover { background: linear-gradient(90deg, rgba(196,23,58,.28), var(--tomb)); }
.setup-banner .mod-open { margin-left: auto; white-space: nowrap; }
.setup-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--ash); }
.setup-progress .bar { flex: 1; max-width: 320px; height: 8px; background: var(--tomb); border: 1px solid var(--seam); }
.setup-progress .bar span { display: block; height: 100%; width: 0; background: var(--blood); transition: width .2s ease; }
.setup-list { display: grid; gap: 10px; }
.setup-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(200px, 300px); align-items: center; gap: 16px;
  padding: 14px 16px; background: var(--crypt); border: 1px solid var(--seam); }
.setup-text { display: grid; gap: 2px; min-width: 0; }
.setup-text span { color: var(--ash); font-size: 13.5px; }
.setup-control select { width: 100%; }
.setup-control .mod-switch { justify-self: start; }
@media (max-width: 640px) {
  .setup-row { grid-template-columns: 42px minmax(0, 1fr); }
  .setup-control { grid-column: 1 / -1; }
}
