/*
 * Copyright (c) 2026 Sudolix (sudolix.com). All rights reserved.
 * Proprietary and confidential. Copying, modifying, distributing or using this code,
 * in whole or in part, without written permission from Sudolix is not allowed.
 */

:root {
  --bg: #0e0e10;
  --raised: #151517;
  --raised-2: #1b1b1e;
  --line: #29292d;
  --line-2: #38383d;
  --text: #f3f1ec;
  --muted: #a09c94;
  --faint: #6f6c66;
  --accent: #7096f8;
  --btn: #3b68de;
  --btn-hover: #4a78ec;
  --danger: #ff9b8f;
  --danger-bg: #b93a2e;
  --ok: #8fd6a3;
  --ok-bg: #1d2a20;
  --warn: #e8c477;
  --warn-bg: #2c2618;
  --bad-bg: #2f1c1a;
  --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1 { font-family: var(--display); font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; }
h2 { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.005em; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.icon { flex: none; }
.offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.noscript { padding: 40px 20px; text-align: center; color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; font-size: 15px; }
.btn.primary { background: var(--btn); color: #fff; }
.btn.primary:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { background: var(--raised-2); }
.btn.danger { background: var(--danger-bg); color: #fff; }
.btn.danger:hover { background: #c94538; }
.btn.danger-ghost { background: transparent; border-color: #5a2a25; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, .icon-btn:focus-visible, .link:focus-visible, .tab:focus-visible, .tile:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--raised-2); color: var(--text); }
.link { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-decoration: none; }
.link:hover { color: var(--accent); }

/* forms */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="time"], select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 5px;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[readonly] { color: var(--muted); }
input:disabled, select:disabled { opacity: 0.55; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--btn); flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); }
.field small, .check small { font-size: 13px; color: var(--faint); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check small { display: block; }
.check a { color: var(--accent); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.checks.tight { gap: 10px 28px; }
.form { display: flex; flex-direction: column; gap: 22px; }
.form.narrow { max-width: 620px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; }
.inline { display: flex; gap: 8px; }
.inline > * { min-width: 0; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.inline-form .field { flex: 1 1 200px; }
.hint { font-size: 13px; color: var(--faint); margin-top: 14px; }
.hint.pad, .pad { padding: 16px 22px; }
.hint.pad { margin: 0; border-top: 1px solid var(--line); }

/* sign in */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth-logo { height: 30px; width: auto; align-self: flex-start; margin-bottom: 10px; }
.auth-card h1 { font-size: 22px; }

/* layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--raised);
}
.side-logo { display: block; padding: 4px 8px 22px; }
.side-logo img { display: block; height: 26px; width: auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.side-link:hover { background: var(--raised-2); color: var(--text); }
.side-link.on { background: var(--raised-2); color: var(--text); }
.side-link.on .icon { color: var(--accent); }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 12px 4px 0 8px; border-top: 1px solid var(--line); }
.side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.side-user span { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 36px 36px 72px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > .page-head { margin-bottom: 4px; }
.demo-bar { padding: 8px 32px; background: var(--warn-bg); color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--line); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions.center { justify-content: center; }
.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty p { color: var(--muted); max-width: 440px; }
.empty .btn, .empty .head-actions { margin-top: 10px; }
.cards .empty { grid-column: 1 / -1; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }

/* server cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}
.server-card:hover { border-color: var(--line-2); background: var(--raised-2); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-top h3 { font-size: 16px; }
.addr { color: var(--muted); }
.card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.label { display: block; font-size: 12px; color: var(--faint); margin-bottom: 2px; }
.bar { height: 4px; margin-top: 8px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 4px; white-space: nowrap; background: var(--raised-2); color: var(--muted); }
.chip.state-running { background: var(--ok-bg); color: var(--ok); }
.chip.state-starting, .chip.state-stopping { background: var(--warn-bg); color: var(--warn); }
.chip.state-crashed { background: var(--bad-bg); color: var(--danger); }
.tag { display: inline-block; margin-left: 8px; font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--raised-2); color: var(--muted); font-weight: 500; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--danger); }

/* new server */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  text-align: left;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.tile span { font-size: 13px; color: var(--muted); }
.tile:hover { border-color: var(--line-2); }
.tile.on { border-color: var(--accent); background: #161a26; }

/* server page */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.crumb:hover { color: var(--text); }
.server-head-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.addr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.addr-btn:hover { border-color: var(--line-2); }
.addr-btn .icon { color: var(--muted); }
.tabs { display: flex; gap: 2px; margin: 28px 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab-body { display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.panel > h2 { margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.stat { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; min-width: 0; }
.stat .label { margin-bottom: 6px; }
.stat .bar + .spark { margin-top: 10px; }
.stat strong { display: block; font-size: 22px; font-weight: 600; white-space: nowrap; }
.stat em { font-style: normal; font-size: 14px; font-weight: 400; color: var(--muted); }
.stat small { font-size: 13px; color: var(--faint); }
.spark { display: block; width: 100%; height: 26px; margin-top: 4px; color: var(--accent); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; white-space: nowrap; }
td.row-actions { display: table-cell; text-align: right; }
td.row-actions > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
td.row-actions > .switch { display: inline-block; }
.banner { padding: 12px 14px; background: var(--raised-2); border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.banner strong { color: var(--text); }
.banner p + .copy-row { margin-top: 10px; }
.copy-row { display: flex; gap: 8px; }

/* console */
.console-wrap { background: #0a0a0c; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.console {
  height: min(58vh, 560px);
  min-height: 300px;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c9c5bc;
}
.ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.ln.cmd { color: var(--text); font-weight: 600; }
.ln.sys { color: var(--accent); }
.ln.warn { color: var(--warn); }
.ln.err { color: var(--danger); }
.console-in { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--raised); }
.console-in input { border: 0; background: transparent; padding: 0; font-size: 13px; }
.console-in input:focus { outline: none; }
.console-in:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.prompt { color: var(--accent); font-weight: 700; }

/* tables, files */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar.plain { padding: 0 0 12px; border: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.crumbs .sep { color: var(--faint); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--faint); padding: 12px 22px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--raised-2); }
.table .num { text-align: right; white-space: nowrap; }
.table tr.off td:not(.row-actions) { opacity: 0.5; }
.file-name { display: inline-flex; align-items: center; gap: 9px; text-align: left; overflow-wrap: anywhere; }
.file-name .icon { color: var(--muted); }
.drop.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.editor { display: block; width: 100%; height: min(60vh, 600px); min-height: 280px; padding: 14px 18px; border: 0; border-radius: 0; background: #0a0a0c; font-size: 13px; line-height: 1.6; resize: vertical; white-space: pre; }
.editor:focus { outline: none; }

/* mods */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-creds { margin-top: 10px; color: var(--text); line-height: 1.7; }
.subtab { padding: 7px 13px; background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.subtab:hover { color: var(--text); }
.subtab.on { background: var(--raised-2); border-color: var(--line-2); color: var(--text); }
.search { position: relative; margin-bottom: 18px; }
.search .icon { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.search input { padding-left: 38px; height: 42px; background: var(--raised); }
.addons { display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.addon { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-top: 1px solid var(--line); }
.addon:first-child { border-top: 0; }
.addon img, .addon-blank { width: 48px; height: 48px; border-radius: 8px; flex: none; background: var(--raised-2); object-fit: cover; }
.addon-blank { display: flex; align-items: center; justify-content: center; color: var(--faint); }
.addon-text { flex: 1; min-width: 0; }
.addon-text p { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* switch */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 10px; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); }
.switch input:checked + span { background: var(--btn); }
.switch input:checked + span::after { left: 18px; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-color: #4a2622; }
.danger-zone h2 { margin-bottom: 4px; }

/* dialog, toasts */
.dialog { width: min(440px, calc(100vw - 32px)); padding: 0; background: var(--raised); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog-in { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.dialog-body { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.dialog-body .hint { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { max-width: 380px; padding: 10px 14px; background: var(--raised-2); border: 1px solid var(--line-2); border-radius: 6px; font-size: 14px; }
.toast.error { border-color: #5a2a25; color: var(--danger); }
.toast.out { opacity: 0; transition: opacity 0.3s; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); gap: 10px; }
  .side-logo { padding: 0 6px 0 2px; }
  .side-nav { flex-direction: row; justify-content: flex-end; }
  .side-link span { display: none; }
  .side-foot { border: 0; padding: 0; }
  .side-user { display: none; }
  .page { padding: 22px 16px 56px; }
  .demo-bar { padding: 8px 16px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .row2, .row3, .checks { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .toolbar, .addon { padding-left: 12px; padding-right: 12px; }
  .addon { flex-wrap: wrap; }
  .addon-text { flex-basis: calc(100% - 62px); }
  .panel { padding: 16px; }
  .auth-card { padding: 24px 20px; }
  #toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .console { height: 52vh; }
}

@media (prefers-reduced-motion: reduce) {
  .toast.out { transition: none; }
}

/* schedule form */
.inline > select { flex: 1 1 150px; }
.inline > .inline { flex: 1 1 130px; }
.inline input[type="time"], .inline input[type="number"] { min-width: 96px; }
.inline-form .field:has(.inline) { flex-basis: 320px; }

/* sign-in notice: no accent line */
.center { text-align: center; }
.link.accent, .check a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: inherit; }
.wide-card { grid-column: 1 / -1; }
.wide-card h2 { margin-bottom: 6px; }

/* what went wrong */
.problem { padding: 20px 24px; background: var(--bad-bg); border: 1px solid #5a2a25; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.problem h2 { color: var(--danger); }
.problem p { color: #e6d5d1; }
.problem-line { width: 100%; padding: 8px 10px; background: #0a0a0c; border-radius: 4px; color: var(--muted); overflow-wrap: anywhere; }

/* bot builder */
.modules { display: flex; flex-direction: column; gap: 14px; }
.module { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.module.on { border-color: var(--line-2); }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; }
.module-head h3 { font-size: 16px; margin-bottom: 2px; }
.module-body { padding: 20px 22px 22px; border-top: 1px solid var(--line); }
.items { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.item { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.item-fields { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.item-fields > * { flex: 1 1 100%; }
.item-fields > .w-s { flex: 1 1 140px; }
.item-fields > .w-m { flex: 2 1 220px; }
.save-bar { position: sticky; bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px 12px 20px;
  background: var(--raised-2); border: 1px solid var(--accent); border-radius: 8px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--raised-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.copy-row input { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  .module-head, .module-body { padding-left: 16px; padding-right: 16px; }
  .item { flex-direction: column; }
  .save-bar { flex-direction: column; align-items: stretch; text-align: center; }
}

.gap-top { margin-top: 14px; }
.dialog-body textarea { min-height: 160px; font-size: 12.5px; }

/* hosting group, support, security, admin */
.side-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.side-label { padding: 6px 10px 4px; font-size: 12px; color: var(--faint); font-weight: 600; }
.side-group .side-link { padding-left: 18px; }
.badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--btn); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.link.strong { font-weight: 600; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { padding: 16px 20px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; max-width: 760px; }
.msg.staff { border-color: #2c3a5e; background: #141826; align-self: flex-end; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #d9d5cc; }
.gap-bottom { margin-bottom: 16px; }
.setup-key { padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 32px; margin-top: 14px; padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; width: max-content; max-width: 100%; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting select { width: auto; min-width: 220px; flex: none; }
.setting h3 { margin-bottom: 2px; }
.narrow-inline { max-width: 340px; }
.search.slim { margin: 0; width: 260px; max-width: 100%; }
.search.slim input { height: 36px; }
.search.slim .icon { top: 10px; }
.toolbar h2 { margin: 0; }
@media (max-width: 900px) {
  .side-group { flex-direction: row; margin: 0; }
  .side-label { display: none; }
  .side-group .side-link { padding-left: 10px; }
  .badge { margin-left: 4px; }
}
@media (max-width: 600px) {
  .setting { flex-direction: column; align-items: stretch; }
  .setting select { width: 100%; }
  .codes { grid-template-columns: 1fr; width: 100%; }
}

/* setup check and getting started */
.setup-check.has-problems { border-color: #5a4a1f; }
.setup-check .title-row { margin-bottom: 6px; }
.check-list { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li { padding: 10px 14px; background: var(--warn-bg); border-radius: 5px; color: #eadcb8; }
.todo { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.todo li { display: flex; align-items: center; gap: 12px; }
.todo .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--ok); }
.todo li.done { color: var(--faint); }
.todo li.done .tick { background: var(--ok-bg); border-color: transparent; }
.todo a { text-decoration: underline; text-underline-offset: 3px; }

/* the demo's own door on the sign-in page */
.auth-alt { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }

input[type="color"] { width: 64px; height: 40px; padding: 4px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 5px; cursor: pointer; }

/* AI assistant */
.tag.ai { margin-left: 0; background: #1c2540; color: #9db6ff; }
.ai-result { margin-top: 18px; padding: 18px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ai-result h3 { margin: 0; }
.ai-changes { margin: 0; padding-left: 20px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.problem-ai { width: 100%; padding: 12px 14px; background: #0a0a0c; border-radius: 5px; }
.problem-ai .title-row { margin-bottom: 4px; }

/* Self-role panels */
.role-panels { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.role-panel { width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 12px; }
.role-panel h4 { margin: 0; font-size: 15px; }

/* Plans and billing */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plan-top h3 { font-size: 16px; margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: 8px; }
.plan-price strong { font-size: 28px; font-weight: 600; }
.plan-points { margin: 0; padding-left: 18px; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.plan-action { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-buy { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.bill-table td, .bill-table th { vertical-align: top; }

/* Two-step setup QR code: always dark on white, whatever the theme, so phone cameras can read it */
.qr { display: block; width: 200px; height: 200px; margin: 10px 0 12px; padding: 0; background: #fff; border-radius: 6px; image-rendering: pixelated; }

/* Other products: CrystalVR */
.cvr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cvr-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cvr-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; }
.cvr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cvr-colors { display: flex; gap: 20px; flex-wrap: wrap; }
.cvr-colors input[type="color"] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); }
.cvr-pick { display: flex; gap: 8px; align-items: center; min-width: 0; max-width: 100%; }
.cvr-pick select { min-width: 0; max-width: 340px; }
/* CrystalVR Control */
.cvr-live { display: flex; flex-direction: column; gap: 12px; }
.cvr-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cvr-chatbox { width: 100%; max-width: 520px; padding: 14px 16px; background: #050506; border: 1px solid var(--line-2); border-radius: 14px;
  color: #fff; text-align: center; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cvr-chatbox.empty { color: var(--faint); }
.cvr-send { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cvr-send h3 { margin: 0; }
.cvr-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
.cvr-toggles.single { grid-template-columns: minmax(0, 1fr); }
.cvr-group { display: flex; flex-direction: column; min-width: 0; }
.cvr-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.cvr-toggle.sub { padding: 6px 0 6px 18px; border-top: 0; }
.cvr-toggle.sub .cvr-toggle-text span { font-size: 14px; color: var(--muted); }
.cvr-toggle-text { display: flex; flex-direction: column; min-width: 0; }
.cvr-toggle-text small { font-size: 13px; color: var(--faint); }
.cvr-toggle .switch { flex: none; }
.cvr-toggle select { width: auto; min-width: 140px; flex: none; }
.cvr-msgs { display: flex; flex-direction: column; gap: 8px; }
.cvr-msg { display: flex; gap: 8px; align-items: center; min-width: 0; }
.cvr-msg > input, .cvr-msg > select { flex: 1; min-width: 0; }
.cvr-msg-actions { display: flex; gap: 4px; flex: none; }
.cvr-count { flex: none; width: 56px; text-align: right; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cvr-look { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cvr-readonly { margin: 0; padding: 9px 0; color: var(--text); }
.cvr-settings { position: relative; }
.cvr-savebar { position: sticky; bottom: 16px; align-self: flex-end; margin-top: -8px; padding: 8px 14px; font-size: 13px; color: var(--text);
  background: var(--raised-2); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
input.invalid { outline: 2px solid var(--danger); outline-offset: 1px; }
input.invalid + small { color: var(--danger); }
.cvr-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cvr-board li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 6px; min-width: 0; }
.cvr-board li.mine { background: var(--raised-2); border-top-color: var(--accent); border-right-color: var(--accent); border-bottom-color: var(--accent); }
.cvr-rank { width: 44px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.cvr-board-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.cvr-board-avatar.blank { display: inline-flex; align-items: center; justify-content: center; background: var(--raised-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.cvr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cvr-time { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .cvr-stats { grid-template-columns: 1fr; }
  .cvr-pick { width: 100%; }
  .cvr-pick select { flex: 1; max-width: none; }
  .cvr-toggles, .cvr-look { grid-template-columns: minmax(0, 1fr); }
  .cvr-msgs .cvr-msg { flex-wrap: wrap; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .cvr-msgs .cvr-msg > input { flex-basis: 100%; }
  .cvr-msgs .cvr-count { width: auto; text-align: left; margin-right: auto; }
  .cvr-board li { gap: 8px; padding: 8px; }
  .cvr-rank { width: 34px; font-size: 13px; }
  .cvr-time { font-size: 13px; }
}
