:root {
  --bg: #07061a;
  --bg-2: #0c0b24;
  --card: rgba(20, 18, 52, .78);
  --card-2: #1c1a45;
  --line: #27245a;
  --line-2: #363273;
  --text: #ece9ff;
  --muted: #9d98cf;
  --faint: #6b67a3;
  --accent: #a78bfa;
  --accent-2: #8b5cf6;
  --accent-ink: #1a0b3d;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb7185;
  --info: #67e8f9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* ---------- deep space backdrop: nebulas + three layers of stars ---------- */
body::before, body::after {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
}
body::before {
  background:
    radial-gradient(900px 520px at 85% -5%, rgba(139, 92, 246, .22), transparent 65%),
    radial-gradient(700px 480px at -5% 105%, rgba(236, 72, 153, .12), transparent 65%),
    radial-gradient(600px 400px at 40% 60%, rgba(56, 189, 248, .05), transparent 70%);
}
/* ---------- big planet in the bottom-right corner (and a small moon) ---------- */
html { --d: clamp(400px, 54vw, 860px); }
html::before, html::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; background-repeat: no-repeat; background-size: 100% 100%;
}
html::before {
  width: var(--d); height: var(--d); right: calc(var(--d) * -.3); bottom: calc(var(--d) * -.3);
  background-image: url(/planet.svg);
  opacity: .95; filter: blur(3px);
}
html.gl-planet::before, html.gl-planet::after { display: none; } /* planet.js drew the WebGL planet instead */
html::after {
  width: calc(var(--d) * .085); height: calc(var(--d) * .085);
  right: calc(var(--d) * .66); bottom: calc(var(--d) * .62);
  background-image: url(/moon.svg);
  opacity: .9;
}
body::after {
  z-index: -2;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 260px 160px, #e9d5ff, transparent),
    radial-gradient(1px 1px at 330px 40px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 80px 220px, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 400px 280px, #c4b5fd, transparent),
    radial-gradient(1px 1px at 190px 330px, rgba(255,255,255,.75), transparent),
    radial-gradient(1px 1px at 470px 120px, rgba(255,255,255,.55), transparent);
  background-size: 500px 380px;
  opacity: .55;
  animation: drift 120s linear infinite;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: -500px 380px; } }
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } .ship, .shooting-star { display: none; } }

.card, .panel, .stat, .kv > div, .hero, .bot-row, .modal, .login-card { backdrop-filter: blur(6px); }

/* ---------- ships & logo ---------- */
.logo svg { width: 60%; height: 60%; }
.ship { position: fixed; z-index: 0; pointer-events: none; width: 46px; opacity: .85; filter: drop-shadow(0 0 8px rgba(167, 139, 250, .6)); }
.ship.one { top: 18%; left: -60px; animation: fly1 26s linear infinite; }
.ship.two { top: 72%; left: -60px; width: 30px; opacity: .6; animation: fly2 38s linear infinite 6s; }
@keyframes fly1 { 0% { transform: translate(0, 0) rotate(8deg); } 100% { transform: translate(calc(100vw + 120px), -120px) rotate(8deg); } }
@keyframes fly2 { 0% { transform: translate(0, 0) rotate(-6deg); } 100% { transform: translate(calc(100vw + 120px), 90px) rotate(-6deg); } }
.shooting-star {
  position: fixed; top: 12%; right: 10%; width: 140px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,.9), transparent); border-radius: 2px;
  transform: rotate(-25deg); opacity: 0; animation: shoot 9s ease-in infinite 2s;
}
@keyframes shoot { 0%, 85% { opacity: 0; transform: translate(0, 0) rotate(-25deg); } 88% { opacity: 1; } 100% { opacity: 0; transform: translate(-320px, 150px) rotate(-25deg); } }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav a.active { box-shadow: inset 2px 0 0 var(--accent); }
.side-ship { margin: 0 8px; padding: 12px; border-radius: var(--radius); border: 1px dashed var(--line-2); color: var(--muted); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.side-ship svg { width: 28px; flex: none; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-4px) rotate(-4deg); } }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.m0 { margin: 0; }
.tag.engine-az { color: #fde68a; border-color: rgba(250, 204, 21, .45); background: rgba(250, 204, 21, .1); }
.az-dot { font-size: 12px; }
.secret-blur:not(:focus) { filter: blur(5px); }
a.tab, .nav a, a.btn { text-decoration: none !important; }
.mt { margin-top: 14px; }
.grow { flex: 1; min-width: 160px; }
.stack { display: grid; gap: 12px; }
.panel > textarea.input { margin-top: 8px; }
.panel > .hint { margin-top: 8px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #221f4d; border-color: #4a4590; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(242, 87, 93, .1); border-color: rgba(242, 87, 93, .5); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--card-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }

label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 260px; padding: 12px; font: 12.5px/1.55 var(--mono); resize: vertical; tab-size: 2; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167, 139, 250, .15); }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.error-box {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(242, 87, 93, .1); border: 1px solid rgba(242, 87, 93, .35);
  color: #ffb3b6; font-size: 13px;
}

/* ---------- login ---------- */
.login-page {
  position: relative; z-index: 1;
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(600px 320px at 50% 0%, rgba(167, 139, 250, .16), transparent 70%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px; box-shadow: var(--shadow);
  display: grid; gap: 18px;
}
.login-card header { display: grid; gap: 6px; text-align: center; justify-items: center; }
.login-card form { display: grid; gap: 14px; }
.login-foot { text-align: center; font-size: 12px; color: var(--faint); }

.login-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: -4px 0 0; }
.tab-btn { flex: 1; padding: 10px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: grid; gap: 16px; }

.oauth-buttons { display: grid; gap: 10px; }
.btn.oauth { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px; font-weight: 600; }
.btn.oauth.discord { background: #5865F2; color: white; border: none; }
.btn.oauth.discord:hover { background: #4752C4; }
.btn.oauth.google { background: white; color: #1f1f1f; border: 1px solid #dadce0; }
.btn.oauth.google:hover { background: #f8f9fa; }

.or-divider { position: relative; text-align: center; margin: 4px 0; }
.or-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or-divider span { position: relative; background: var(--card); padding: 0 12px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #a78bfa, #6d28d9);
  color: var(--accent-ink); font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 18px rgba(167, 139, 250, .25);
}
.logo.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; box-shadow: none; }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px;
  background: rgba(8, 6, 26, .8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; cursor: pointer; color: var(--text);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2); color: var(--accent); font-weight: 700; font-size: 12px;
}
.menu {
  position: absolute; right: 24px; top: 56px; min-width: 190px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: grid; z-index: 20;
}
.menu button {
  text-align: left; background: none; border: 0; color: var(--text);
  padding: 9px 10px; border-radius: 6px; font: inherit; cursor: pointer;
}
.menu button:hover { background: var(--card-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- bot cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bot-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 14px; cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.bot-card:hover { border-color: var(--line-2); background: #17153a; transform: translateY(-1px); }
.bot-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bot-card .name { font-weight: 650; font-size: 15px; }
.bot-card .server { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-top: 2px; word-break: break-all; }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.meta div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.meta .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.meta .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bot-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-card .macro { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online { color: var(--ok); background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .3); }
.pill.online::before { box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.pill.connecting, .pill.reconnecting, .pill.waiting { color: var(--info); background: rgba(103, 232, 249, .08); border-color: rgba(103, 232, 249, .3); }
.pill.login { color: var(--warn); background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .35); }
.pill.stopped { color: var(--danger); background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .35); }

.empty {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; display: grid; gap: 10px; justify-items: center;
}
.empty .logo { margin-bottom: 4px; }

/* ---------- detail view ---------- */
.back { margin-bottom: 14px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head .title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ms-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 18px; border-radius: var(--radius);
  background: rgba(245, 185, 66, .07); border: 1px solid rgba(245, 185, 66, .35);
}
.ms-banner .code {
  font: 700 22px/1 var(--mono); letter-spacing: .12em; color: var(--warn);
  padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.ms-banner .txt { flex: 1; min-width: 220px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 550;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.console {
  height: 460px; overflow-y: auto; padding: 12px 14px;
  background: #05041a; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 12.5px/1.6 var(--mono);
}
.console .ln { white-space: pre-wrap; word-break: break-word; }
.console .t { color: var(--faint); margin-right: 8px; }
.console .warn { color: var(--warn); }
.console .error { color: var(--danger); }
.console .chat { color: #d9d6f5; }
.console .chat .tag { color: var(--info); }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

details.help { margin-top: 12px; color: var(--muted); font-size: 13px; }
details.help summary { cursor: pointer; color: var(--text); }
details.help code { font-family: var(--mono); font-size: 12px; color: var(--accent); }
details.help ul { padding-left: 18px; margin: 8px 0 0; display: grid; gap: 4px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 16px;
}
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

table.users { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.users th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.users td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.users td:last-child { text-align: right; white-space: nowrap; }
.secret {
  font: 600 15px var(--mono); padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); user-select: all; word-break: break-all;
}

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast {
  background: var(--card-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: 360px; font-size: 13.5px;
  animation: pop .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- shell with sidebar ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: rgba(10, 8, 32, .72); backdrop-filter: blur(10px); border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 4px 8px 6px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550; text-decoration: none;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { background: rgba(167, 139, 250, .12); color: var(--accent); }
.side-foot { margin-top: auto; position: relative; }
.side-foot .user-chip { width: 100%; border-radius: var(--radius-sm); padding: 8px; }
.uname-wrap { display: grid; text-align: left; line-height: 1.25; }
.role { font-size: 11.5px; color: var(--faint); }
.menu.up { position: absolute; left: 0; right: 0; bottom: 56px; top: auto; }
.mobilebar { display: none; }
main { max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 28px 64px; min-width: 0; }

/* ---------- bot list ---------- */
.list { display: grid; gap: 8px; }
.bot-row {
  display: grid; grid-template-columns: minmax(180px, 1.4fr) 110px 1fr 1fr 90px auto;
  align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.bot-row:hover { border-color: var(--line-2); background: #17153a; }
.bot-row .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-row .cell { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-row .cell b { color: var(--text); font-weight: 550; }
.list-head { display: grid; grid-template-columns: minmax(180px, 1.4fr) 110px 1fr 1fr 90px auto; gap: 14px; padding: 0 14px; font-size: 12px; color: var(--faint); }
.head-avatar {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: linear-gradient(145deg, #2c2766, #17153a); color: var(--accent); border: 1px solid var(--line-2);
}
.head-avatar.lg { width: 48px; height: 48px; font-size: 20px; border-radius: 10px; }
.head-avatar.head-steve { object-fit: cover; image-rendering: pixelated; background: #17153a; }
.who .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who > div { min-width: 0; }

/* ---------- cards / sections ---------- */
.section { display: grid; gap: 12px; margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kv > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 650; font-size: 15px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--bg-2); margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar.food > i { background: #e0a040; }
.bar.low > i { background: var(--danger); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: grid; gap: 10px; align-content: start;
}
.card.click { cursor: pointer; transition: border-color .15s, background .15s; }
.card.click:hover { border-color: var(--line-2); background: #17153a; }
.card .title { font-weight: 650; }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.tag.ok { color: var(--accent); border-color: rgba(167, 139, 250, .3); background: rgba(167, 139, 250, .08); }
.tag.bad { color: var(--danger); border-color: rgba(242, 87, 93, .3); background: rgba(242, 87, 93, .08); }

/* ---------- macro builder ---------- */
.builder-top { display: grid; grid-template-columns: 1fr 140px 140px; gap: 12px; align-items: end; }
.steps { display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: 26px 190px 1fr auto; gap: 10px; align-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
}
.step .num { color: var(--faint); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.step .fields { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.step .fields .input { height: 32px; }
.step .fields .f { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.step .fields .f .input { width: 90px; }
.step .fields .f.wide { flex: 1; min-width: 180px; }
.step .fields .f.wide .input { width: 100%; }
.step select.type { height: 32px; }
.step .tools { display: flex; gap: 2px; }
.icon-btn {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; font: 13px/1 inherit;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); border-color: var(--line-2); }
.icon-btn.del:hover { color: var(--danger); }
.nested { grid-column: 2 / -1; border-left: 2px solid var(--line-2); padding-left: 12px; display: grid; gap: 8px; }
.add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-row select { max-width: 240px; height: 32px; }
.trigger { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; }
.trigger .row .input { height: 32px; }

/* ---------- macro builder v2: icons, colors, palette, drag & drop ---------- */
.cat-talk { --cat: #60a5fa; } .cat-time { --cat: #94a3b8; } .cat-flow { --cat: #c084fc; } .cat-move { --cat: #4ade80; }
.cat-look { --cat: #22d3ee; } .cat-hand { --cat: #fb923c; } .cat-note { --cat: #f472b6; }
.step {
  grid-template-columns: 16px 40px 1fr auto; align-items: start; gap: 12px;
  padding: 10px 10px 10px 8px; border-left: 3px solid var(--cat, var(--line-2));
  background: linear-gradient(90deg, color-mix(in srgb, var(--cat, #888) 9%, transparent), transparent 40%), var(--bg-2);
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.step:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat, #888) 35%, transparent); }
.step.dragging { opacity: .4; }
.step.drop-here { box-shadow: 0 -3px 0 0 var(--accent); }
.step .grip { color: var(--faint); cursor: grab; padding-top: 9px; font-size: 14px; line-height: 1; }
.step-ico {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 21px; border-radius: 10px;
  background: color-mix(in srgb, var(--cat, #888) 16%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--cat, #888) 40%, transparent);
}
.step-main { display: grid; gap: 6px; min-width: 0; }
.step-title { font-weight: 650; font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; }
.step-title .num { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.step .tools { padding-top: 4px; }
.step > .nested { grid-column: 2 / -1; margin-top: 4px; }
.nested { border-left: 2px dashed color-mix(in srgb, var(--cat, #c084fc) 50%, transparent); }
.drop-empty { padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 6px; }
.palette.compact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tile {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text); background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  border-bottom: 2px solid color-mix(in srgb, var(--cat, #888) 60%, transparent); transition: transform .08s, background .15s;
}
.tile:hover { background: color-mix(in srgb, var(--cat, #888) 18%, var(--card-2)); transform: translateY(-1px); }
.tile-ico { font-size: 17px; }
.palette.compact .tile { padding: 4px 6px; }
.palette.compact .tile-ico { font-size: 15px; }
.icon-strip { display: flex; flex-wrap: wrap; gap: 4px; font-size: 16px; }
@media (max-width: 760px) {
  .step { grid-template-columns: 34px 1fr auto; }
  .step .grip { display: none; }
  .step-ico { width: 34px; height: 34px; font-size: 18px; }
}

/* ---------- block editor (connected puzzle blocks) ---------- */
.cat-start { --cat: #8b5cf6; } .cat-logic { --cat: #eab308; } .cat-menu { --cat: #14b8a6; }
.c-mid {
  background: var(--fill); border: 1px solid var(--edge); border-left: 0; margin: -1px 0; padding: 3px 12px 3px 30px; width: 230px;
  font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, .9); border-radius: 0 8px 8px 0; margin-left: 0; position: relative;
}
.c-mid::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; background: var(--fill); }
.lib-tools { margin-bottom: 16px; }
.lib-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lib-card .icon-strip { font-size: 18px; }
.lib-card.official { border-color: rgba(167, 139, 250, .45); box-shadow: 0 0 24px rgba(139, 92, 246, .12); }
.official-tag { color: #e9d5ff; border-color: rgba(167, 139, 250, .6); background: rgba(139, 92, 246, .25); }
.lib-desc { color: var(--text); opacity: .9; white-space: pre-wrap; line-height: 1.5; }
.cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; }
.cond select.input { width: auto; max-width: 260px; }
.builder-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.palette-col {
  position: sticky; top: 14px; display: grid; gap: 10px; padding: 14px; max-height: calc(100vh - 28px); overflow-y: auto;
  background: #110f2c; border: 1px solid var(--line); border-radius: var(--radius);
}
.pal-group { display: grid; gap: 6px; }
.pal-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-top: 4px; }
.card.workspace { background: #110f2c; }
.scripts { display: grid; gap: 22px; }
.add-script { justify-self: start; }
.bscript { display: grid; justify-items: start; }

/* block body: solid category color, white text, a notch on top and a bump below so they lock together */
.mblock, .hat {
  --fill: color-mix(in srgb, var(--cat, #888) 82%, #000);
  --edge: color-mix(in srgb, var(--cat, #888) 55%, #000);
  position: relative; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}
.b-head, .hat {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 42px; padding: 7px 10px 7px 12px; background: var(--fill);
  border: 1px solid var(--edge); border-radius: 8px; box-shadow: 0 2px 0 var(--edge);
}
.mblock > .b-head::before {
  content: ""; position: absolute; top: -1px; left: 20px; width: 28px; height: 7px;
  background: #110f2c; border: 1px solid var(--edge); border-top: 0; border-radius: 0 0 7px 7px;
}
.mblock::after, .hat::after {
  content: ""; position: absolute; bottom: -7px; left: 20px; width: 28px; height: 8px; z-index: 2;
  background: var(--fill); border: 1px solid var(--edge); border-top: 0; border-radius: 0 0 7px 7px; box-shadow: 0 2px 0 var(--edge);
}
.mblock { cursor: grab; min-width: 260px; max-width: 100%; }
.mblock:active { cursor: grabbing; }
.mblock.dragging { opacity: .35; }
.b-ico { font-size: 19px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.b-label { font-weight: 750; font-size: 13.5px; }
.b-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.b-fields .f, .hat .hat-txt { color: rgba(255, 255, 255, .9); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.b-fields .f .input, .b-fields .f select, .hat .input, .b-fields .f.wide .input {
  height: 28px; border-radius: 14px; border: 0; padding: 0 10px; background: rgba(255, 255, 255, .94); color: #1b1240; font-weight: 600; text-shadow: none;
}
.b-fields .f .input { width: 70px; }
.b-fields .f select.input { width: auto; max-width: 280px; padding-right: 28px; }
.b-fields .f.item-type { flex: 0 1 190px; min-width: 150px; }
.b-fields .input.bad { box-shadow: 0 0 0 2px #fb7185; }
.b-fields .f.wide { flex: 1; min-width: 160px; }
.b-fields .f.wide .input { width: 100%; }
.b-fields .hint { color: rgba(255, 255, 255, .7); }
.b-fields .check { color: #fff; font-size: 12.5px; }
.hat .input { width: 200px; }
.hat .input.short { width: 64px; }
.hat-in.wide { flex: 1; min-width: 140px; }
.hat-in.wide .input { width: 100%; }
.b-tools { display: flex; gap: 2px; margin-left: auto; }
.b-tool {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .25); cursor: pointer;
  background: rgba(0, 0, 0, .18); color: #fff; font: 13px/1 inherit; display: grid; place-items: center;
}
.b-tool:hover { background: rgba(0, 0, 0, .35); }
.b-tool.del:hover { background: #e11d48; border-color: #e11d48; }

/* hat (start) block: rounded top like a cap */
.hat { border-radius: 18px 18px 8px 8px; padding: 10px 12px 9px 14px; min-width: 300px; font-size: 14px; }
.hat b { font-weight: 800; }

/* C-shaped loop block */
.c-block > .b-head { border-radius: 8px 8px 8px 0; }
.c-mouth {
  border-left: 18px solid var(--fill); box-shadow: inset 1px 0 0 var(--edge);
  padding: 2px 0 2px 12px; min-height: 22px; margin-top: -1px;
}
.c-foot {
  background: var(--fill); border: 1px solid var(--edge); border-radius: 0 8px 8px 8px; box-shadow: 0 2px 0 var(--edge);
  padding: 4px 12px; font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .85); width: 230px; margin-top: -1px;
}
.c-block::after { bottom: -7px; }

/* gaps between blocks: "+" to insert, drop zone while dragging */
.bstack { display: grid; justify-items: start; }
.gap { position: relative; height: 12px; width: 100%; display: flex; align-items: center; padding-left: 64px; transition: height .12s; }
.gap-plus {
  opacity: 0; height: 20px; min-width: 20px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer;
  background: var(--card-2); color: var(--text); font: 700 12px/1 Inter, sans-serif; transition: opacity .12s, transform .12s; z-index: 3;
}
.gap:hover .gap-plus, .bstack:hover > .gap.last .gap-plus { opacity: 1; }
.gap-plus:hover { background: var(--accent); color: var(--accent-ink); transform: scale(1.08); }
.gap.last { height: 34px; padding-left: 0; }
.gap.last .gap-plus { opacity: .75; height: 26px; padding: 0 12px; border-style: dashed; }
.gap.over { height: 40px; }
.gap.over::before {
  content: "drop here"; position: absolute; left: 0; right: 30%; top: 4px; bottom: 4px; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 8px; color: var(--accent); font-size: 12px; font-weight: 700; background: rgba(167, 139, 250, .08);
}
.gap.over .gap-plus { opacity: 0; }

/* palette blocks are smaller versions */
.pal-block { min-width: 0; width: 100%; }
.pal-block .b-head { min-height: 34px; padding: 5px 10px; }
.pal-block .b-label { font-size: 12.5px; }
.pal-block::after { display: none; }

/* insert menu */
.insert-menu {
  position: absolute; z-index: 70; width: 320px; padding: 10px; display: grid; gap: 8px;
  background: #15133a; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.insert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.insert-menu .tile { width: 100%; }

@media (max-width: 1000px) {
  .builder-grid { grid-template-columns: 1fr; }
  .palette-col { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .palette-col > .title, .palette-col > .muted { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mblock, .hat { min-width: 0; width: 100%; }
  .c-foot { width: auto; }
}

/* ---------- control ---------- */
.control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
/* the WASD control pad (named dpad so it can't clash with the .pad padding helper) */
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 48px); gap: 6px; justify-content: center; }
.dpad .btn { height: 100%; padding: 0; font-weight: 700; }
.dpad .w { grid-column: 2; grid-row: 1; }
.dpad .a { grid-column: 1; grid-row: 2; }
.dpad .s { grid-column: 2; grid-row: 2; }
.dpad .d { grid-column: 3; grid-row: 2; }
.dpad .jump { grid-column: 1 / -1; grid-row: 3; }
.btn.on { background: rgba(167, 139, 250, .15); border-color: rgba(167, 139, 250, .5); color: var(--accent); }
.hotbar { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.hotbar .btn { padding: 0; height: 38px; }
.kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); }

/* ---------- point of view ---------- */
.pov { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.map-wrap { background: #05041a; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; place-items: center; }
.map-wrap canvas { width: 100%; max-width: 620px; aspect-ratio: 1; image-rendering: pixelated; border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.pov { grid-template-columns: minmax(0, 1fr) 320px; }

/* ---------- 3D first-person view ---------- */
.pov3d-host { min-width: 0; }
.pov3d {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #05041a; border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(76, 29, 149, .35);
  user-select: none;
}
.pov3d:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }
.pov3d > canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.pov3d.offline > canvas { filter: grayscale(1) brightness(.35); }
.pov3d-msg { padding: 40px; text-align: center; color: var(--muted); }
.pov3d-ui { position: absolute; inset: 0; pointer-events: none; font: 600 13px var(--mono); color: #fff; text-shadow: 0 1px 2px #000; }
.pov3d-ui button, .pov3d-ui canvas { pointer-events: auto; }
.pov3d-cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 400 22px var(--mono); opacity: .85; }
.pov3d-info { position: absolute; left: 12px; top: 10px; background: rgba(0, 0, 0, .35); padding: 4px 8px; border-radius: 6px; }
.pov3d-mini { position: absolute; right: 10px; top: 10px; }
.pov3d-mini canvas.minimap { width: 150px; height: 150px; border-radius: 8px; border: 2px solid rgba(196, 181, 253, .55); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.pov3d-bars { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); display: flex; gap: 22px; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.pov3d-bars .hearts { color: #ff4d6d; }
.pov3d-bars .food { font-size: 11px; }
.pov3d-hotbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .45); border-radius: 6px; }
.pov3d-hotbar .slot {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center;
  background: rgba(139, 139, 160, .25); border: 2px solid rgba(255, 255, 255, .15); border-radius: 4px; pointer-events: auto;
}
.pov3d-hotbar .slot.sel { border-color: #fff; background: rgba(167, 139, 250, .35); }
.pov3d-hotbar .ico { font-size: 19px; }
.pov3d-hotbar .abbr { font-size: 10px; text-transform: uppercase; }
.pov3d-hotbar b { position: absolute; right: 2px; bottom: 0; font-size: 11px; }
.pov3d-btns { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.pov3d-btn.act { display: grid; place-items: center; touch-action: none; }
.pov3d-btn.act .pix { width: 20px; height: 20px; }
.pov3d-btn.act.on { background: rgba(232, 57, 77, .55); border-color: #ff8a98; }
/* real item pictures (16x16 textures), kept sharp when scaled up */
img.tex { width: 24px; height: 24px; image-rendering: pixelated; pointer-events: none; user-select: none; }
.pov3d-hotbar img.tex { width: 26px; height: 26px; }
.pm-slot img.tex { width: 26px; height: 26px; }
.pov3d-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(15, 12, 40, .6); color: #fff; font-size: 15px; cursor: pointer; backdrop-filter: blur(4px);
}
.pov3d-btn:hover { background: rgba(139, 92, 246, .55); }
.pov3d-arrows { position: absolute; left: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 36px); gap: 4px; }
.pov3d-arrows .up { grid-column: 2; grid-row: 1; }
.pov3d-arrows .left { grid-column: 1; grid-row: 2; }
.pov3d-arrows .jump { grid-column: 2; grid-row: 2; }
.pov3d-arrows .right { grid-column: 3; grid-row: 2; }
.pov3d-arrows .down { grid-column: 2; grid-row: 3; }
.pov3d-hint {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px;
  background: rgba(15, 12, 40, .8); font: 600 13px Inter, sans-serif; opacity: 0; transition: opacity .2s;
}
.pov3d-hint.show { opacity: 1; }
@media (max-width: 760px) {
  .pov3d-mini canvas.minimap { width: 96px; height: 96px; }
  .pov3d-hotbar .slot { width: 28px; height: 28px; }
  .pov3d-hotbar img.tex, .pm-slot img.tex { width: 20px; height: 20px; }
  .pov3d-bars { bottom: 44px; font-size: 10px; }
}
.pov-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
canvas.clickable { cursor: crosshair; }
.takeover {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card);
}
.takeover.auto { border-color: rgba(103, 232, 249, .35); background: rgba(103, 232, 249, .06); }
.takeover.mine { border-color: rgba(167, 139, 250, .5); background: rgba(167, 139, 250, .1); box-shadow: 0 0 24px rgba(139, 92, 246, .18); }
.takeover.off { opacity: .75; }
.btn:disabled:hover { background: var(--card-2); border-color: var(--line-2); }
.ent-list { display: grid; gap: 4px; max-height: 300px; overflow-y: auto; font-size: 13px; }
.ent-list div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--bg-2); border-radius: 6px; }

/* ---------- accounts dashboard ---------- */
.hero {
  display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: stretch;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.hero-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; display: grid; align-content: center; min-width: 170px; }
.hero-stat .big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.hero-actions .btn { height: 44px; padding: 0 18px; font-weight: 700; }
.acct-card { padding: 0; gap: 0; overflow: hidden; }
.acct-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.acct-toolbar h2 { font-size: 16px; }
.acct-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acct-tools .btn, .acct-toolbar > .btn { height: 38px; }
.acct-sort select { width: 150px; height: 38px; }
.acct-search { width: 220px; }
.acct-search .input { height: 38px; }

.board-hint { padding: 12px 16px 0; font-size: 13px; }

/* ---------- public landing page ---------- */
.landing { display: block; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 20px 24px; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.lp-links { display: flex; align-items: center; gap: 20px; }
.lp-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.lp-links a:hover { color: var(--text); }
.lp-links a.btn { color: var(--text); }
.lp-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 56px 24px 72px; }
.lp-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(167, 139, 250, .14); border: 1px solid rgba(167, 139, 250, .35); color: #d8ccff; font-size: 12.5px; font-weight: 600; }
.lp-hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.025em; margin: 18px 0 0; }
.grad { background: linear-gradient(100deg, #c4b5fd, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { font-size: 17px; color: var(--muted); line-height: 1.6; margin: 16px 0 0; max-width: 46ch; }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 12px; }
.lp-hero-art svg { width: 100%; height: auto; filter: drop-shadow(0 18px 50px rgba(139, 92, 246, .3)); }
.lp-section { max-width: 1080px; margin: 0 auto; padding: 44px 24px; }
.lp-section h2 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
.lp-note { margin: 0 0 20px; font-size: 14px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.lp-feat h3 { font-size: 16px; margin: 0 0 8px; }
.lp-feat p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.lp-plan { display: flex; flex-direction: column; gap: 10px; position: relative; }
.lp-plan.best { border-color: rgba(167, 139, 250, .55); box-shadow: 0 0 30px rgba(139, 92, 246, .14); }
.lp-tag { position: absolute; top: -10px; right: 14px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; }
.lp-plan-name { font-weight: 700; font-size: 15px; color: var(--muted); }
.lp-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.lp-price span { font-size: 14px; font-weight: 600; color: var(--muted); }
.lp-plan ul { list-style: none; margin: 4px 0 auto; padding: 0; display: grid; gap: 8px; }
.lp-plan li { font-size: 14px; color: var(--muted); padding-left: 22px; position: relative; }
.lp-plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.lp-plan .btn { margin-top: 14px; justify-content: center; }
.lp-final { text-align: center; padding: 60px 24px 72px; }
.lp-final h2 { font-size: 30px; margin: 0 0 8px; }
.lp-final .btn { margin-top: 20px; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1080px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); font-weight: 600; }
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; padding: 32px 20px 48px; }
  .lp-hero-art { display: none; }
  .lp-hero h1 { font-size: 34px; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-links { gap: 14px; }
}
/* proxy board: one lane per proxy, drag accounts between lanes to assign them */
.proxy-board { display: grid; gap: 10px; padding: 12px 16px; }
.proxy-lane { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); transition: border-color .12s, box-shadow .12s; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.lane-name { font-weight: 700; font-size: 14px; }
.lane-head .pc-type { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lane-count { margin-left: auto; min-width: 22px; text-align: center; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.lane-body .acct-table { font-size: 13px; }
.lane-body .acct-table thead { display: none; } /* the lane header already names the group */
.lane-empty { padding: 20px; text-align: center; color: var(--faint); font-size: 13px; }
/* while dragging an account, outline every lane; highlight the one under the cursor */
#acct-body.dragging-acct .proxy-lane { border-style: dashed; border-color: var(--line-2); }
.proxy-lane.over { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(139, 92, 246, .18); }
.proxy-lane.over .lane-empty { color: var(--accent); }
.acct-table tbody tr[draggable=true] { cursor: grab; }
.acct-table tbody tr[draggable=true]:active { cursor: grabbing; }
#acct-body.dragging-acct .acct-table tbody tr { cursor: grabbing; }
.group-head { padding: 14px 16px 6px; font-size: 14px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.acct-table th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.acct-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.acct-table tbody tr { cursor: pointer; transition: background .12s; }
.acct-table tbody tr:hover { background: #17153a; }
.acct-table tbody tr:last-child td { border-bottom: 0; }
.acct-table td.sel, .acct-table th:first-child { width: 36px; padding-left: 16px; }
.acct-table input[type=checkbox], .acct-toolbar input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.acct-table .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-table .sub { font-size: 12px; color: var(--muted); }
.ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-img { width: 36px; height: 36px; border-radius: 6px; image-rendering: pixelated; flex: none; background: var(--card-2); }
.type-tag { font: 700 11px var(--mono); letter-spacing: .06em; padding: 4px 10px; border-radius: 6px; background: rgba(224, 160, 64, .14); color: #e6b15a; }
.status-txt { font-weight: 650; }
.status-txt.ok { color: var(--ok); }
.status-txt.warn { color: var(--warn); }
.status-txt.info { color: var(--info); }
.status-txt.bad { color: var(--danger); }
.status-txt.muted { color: var(--muted); }
/* accounts table v2: status chips, notes, pins, connect/disconnect selected */
.connect-btn { background: rgba(74, 222, 128, .16); border-color: rgba(74, 222, 128, .55); color: #86efac; font-weight: 700; }
.connect-btn:hover { background: rgba(74, 222, 128, .28); border-color: #4ade80; }
.disconnect-btn { background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .5); color: #fda4af; font-weight: 700; }
.disconnect-btn:hover { background: rgba(251, 113, 133, .26); border-color: #fb7185; }
.acct-table th.count { width: 44px; color: var(--muted); font-size: 13px; text-transform: none; letter-spacing: 0; }
.acct-table td.face { width: 44px; padding-right: 0; }
.acct-table .nm { font-weight: 650; }
.acct-table tbody tr.pinned { background: rgba(167, 139, 250, .05); }
.acct-table td.acts { width: 1%; white-space: nowrap; }
.acct-table td.acts .row { flex-wrap: nowrap; gap: 4px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 650;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.status-chip.ok { color: var(--ok); background: rgba(74, 222, 128, .08); border-color: rgba(74, 222, 128, .3); }
.status-chip.warn { color: var(--warn); background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .35); }
.status-chip.info { color: var(--info); background: rgba(103, 232, 249, .07); border-color: rgba(103, 232, 249, .3); }
.status-chip.bad { color: var(--danger); background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .35); }
.chip-ico { font-size: 10px; line-height: 1; }
.chip-ico.spin { display: inline-block; animation: spin 1s linear infinite; font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.note-in { height: 34px; min-width: 160px; background: rgba(12, 11, 36, .7); }
.note-in.saved { box-shadow: 0 0 0 2px rgba(74, 222, 128, .6); }
.icon-btn.pin { opacity: .35; filter: grayscale(1); font-size: 14px; }
.icon-btn.pin:hover { opacity: .8; }
.icon-btn.pin.on { opacity: 1; filter: none; }
.sel-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: rgba(167, 139, 250, .06); border-bottom: 1px solid var(--line); }
.sel-bar select { height: 30px; width: 170px; }
.pad { padding: 18px 16px; }
.acct-card .empty { border: 0; }
.guides-card { margin-top: 16px; padding: 18px; }
.guides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.guide {
  text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; color: var(--text); font: inherit; display: grid; gap: 4px; transition: border-color .15s, background .15s;
}
.guide:hover { border-color: rgba(167, 139, 250, .45); background: #15133a; }
.guide { padding: 0 0 14px; overflow: hidden; gap: 6px; }
.guide > .title, .guide > .muted { padding: 0 14px; }
.guide-art {
  height: 96px; margin-bottom: 6px; display: grid; place-items: center;
  background: radial-gradient(120px 60px at 50% 60%, rgba(139, 92, 246, .25), transparent 70%), linear-gradient(180deg, #120f33, #0c0a24);
  border-bottom: 1px solid var(--line);
}
.guide-art svg { height: 86px; width: auto; transition: transform .25s; }
.guide:hover .guide-art svg { transform: translateY(-3px) scale(1.04); }
/* macro tab */
.macro-hero h2 { font-size: 20px; margin-top: 2px; }
.icon-strip.big { font-size: 22px; gap: 6px; }
.icon-strip.big span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line-2); }
.icon-strip.big span.cur { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(74, 222, 128, .35); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(74, 222, 128, .12); } }
.now-step { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(74, 222, 128, .06); border: 1px solid rgba(74, 222, 128, .25); }
.card.dim { opacity: .6; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }

/* ---------- earnings tab ---------- */
.earn-total { font-size: 34px; letter-spacing: -.02em; margin: 2px 0 0; color: var(--ok); font-variant-numeric: tabular-nums; }
.earn-hero .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.earn-hero .hero-stat { min-width: 0; padding: 12px 16px; }
.earn-hero .hero-stat .num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.earn-hero .hero-stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.earn-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.earn-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.earn-bar { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--line-2); transition: height .3s; }
.earn-bar.on { background: linear-gradient(180deg, var(--ok), #2a8f55); }
.earn-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.earn-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 5px 8px; border-radius: 6px; }
.earn-row:nth-child(odd) { background: var(--bg-2); }
.earn-row .amt { color: var(--ok); font-weight: 700; font-variant-numeric: tabular-nums; }
.earn-row .msg { color: var(--text); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.earn-row .when { font-size: 12px; white-space: nowrap; }

/* themed scrollbars everywhere (thin, dark track, square purple thumb) instead of the white default */
* { scrollbar-width: thin; scrollbar-color: #5b4a9e transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4a3d86; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #7b5fd6; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- pixel icons + Minecraft-style GUI look (macros, Macro tab, library, 3D chat) ---------- */
:root { --pixel: "Pixelify Sans", "JetBrains Mono", monospace; }
.pix { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.pix svg { width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .45)); }
.btn .pix { width: 16px; height: 16px; margin-right: 2px; }
.btn.sm .pix { width: 14px; height: 14px; }
.ico-title, .pal-title { display: flex; align-items: center; gap: 8px; }
.pal-title { font-family: var(--pixel); font-size: 17px; letter-spacing: .02em; }
.pal-label { font-family: var(--pixel); font-size: 12.5px; letter-spacing: .06em; color: var(--muted); }
.now-step { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* blocks: square corners, 2px dark outline, light top-left bevel and dark bottom-right bevel */
.b-head, .hat, .c-foot, .c-mid {
  border-radius: 0 !important; border: 2px solid #120d22;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .28), inset -2px -3px 0 rgba(0, 0, 0, .32), 0 3px 0 rgba(0, 0, 0, .35);
}
.hat { border-radius: 0 !important; padding-top: 11px; }
.hat::before { content: ""; position: absolute; left: -2px; right: 40%; top: -8px; height: 8px; background: var(--fill); border: 2px solid #120d22; border-bottom: 0; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .28); }
.mblock > .b-head::before { border-radius: 0; border: 2px solid #120d22; border-top: 0; top: -2px; height: 8px; }
.mblock::after, .hat::after {
  border-radius: 0; border: 2px solid #120d22; border-top: 0; bottom: -8px; height: 9px;
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, .2), inset -2px -2px 0 rgba(0, 0, 0, .3);
}
.c-mouth { border-left-width: 18px; box-shadow: inset 2px 0 0 #120d22, -2px 0 0 #120d22; margin-left: 0; }
.c-block > .b-head { border-radius: 0; }
.b-label, .hat b, .c-foot, .c-mid { font-family: var(--pixel); font-weight: 700; letter-spacing: .03em; text-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.b-label { font-size: 15px; }
.pal-block .b-label { font-size: 13.5px; }
.c-foot, .c-mid { font-size: 12.5px; }
.b-ico { width: 22px; height: 22px; }
.pal-block .b-ico { width: 20px; height: 20px; }
.b-fields .f .input, .b-fields .f select, .hat .input, .b-fields .f.wide .input {
  border-radius: 0; border: 2px solid #120d22; background: #f4f1ff; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .15);
}
.b-tool { border-radius: 0; border: 2px solid rgba(0, 0, 0, .45); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .25); }
.gap-plus { border-radius: 0; font-family: var(--pixel); }
.gap.over::before { border-radius: 0; font-family: var(--pixel); }

/* insert menu tiles = stone-like buttons */
.tile {
  border-radius: 0; border: 2px solid #120d22; font-family: var(--pixel); font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--cat, #888) 22%, #23204a);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .14), inset -2px -2px 0 rgba(0, 0, 0, .35);
}
.tile:hover { background: color-mix(in srgb, var(--cat, #888) 40%, #23204a); }
.tile-ico { width: 20px; height: 20px; }
.insert-menu { border-radius: 0; border: 2px solid #120d22; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .08), var(--shadow); }

/* icon strips look like inventory slots */
.icon-strip { gap: 3px; }
.icon-strip > .pix {
  width: 26px; height: 26px; padding: 3px; background: #2b2748;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .45), inset -2px -2px 0 rgba(255, 255, 255, .1);
}
.icon-strip.big { gap: 4px; }
.icon-strip.big > .pix { width: 38px; height: 38px; padding: 5px; border: 0; border-radius: 0; }
.icon-strip.big > .pix.cur { background: #1f4d2c; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .45), 0 0 0 2px var(--ok); animation: pulse 1.6s ease-in-out infinite; }

/* ---------- 3D view: open menu (chest / shop) as a clickable GUI ---------- */
.pov3d-menu { position: absolute; inset: 0; display: none; place-items: center; z-index: 6; background: rgba(0, 0, 0, .45); }
.pov3d-menu.open { display: grid; pointer-events: auto; }
.pm-win {
  background: #2b2748; border: 2px solid #120d22; padding: 10px 12px 12px; max-width: min(92%, 560px); max-height: 86%; overflow-y: auto;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .14), inset -2px -2px 0 rgba(0, 0, 0, .4), 0 8px 30px rgba(0, 0, 0, .6);
  font-family: var(--pixel); color: #fff;
}
.pm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pm-title { flex: 1; font-size: 16px; text-shadow: 2px 2px 0 rgba(0, 0, 0, .4); word-break: break-word; }
.pm-x { pointer-events: auto; }
.pm-grid { display: grid; grid-template-columns: repeat(9, 34px); grid-auto-rows: 34px; gap: 2px; justify-content: center; }
.pm-hot { margin-top: 4px; }
.pm-label { font-size: 12px; color: #b9b3e0; margin: 8px 0 3px; text-align: center; }
.pm-slot {
  position: relative; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  background: #1f1b38; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5), inset -2px -2px 0 rgba(255, 255, 255, .08);
}
.pm-slot.pm-empty { cursor: default; }
.pm-slot:not(.pm-empty):hover { background: #3a3566; }
.pm-slot .ico { font-size: 18px; line-height: 1; }
.pm-slot .abbr { font-size: 9px; text-transform: uppercase; color: #cfcaf0; }
.pm-slot b { position: absolute; right: 1px; bottom: -1px; font-size: 11px; text-shadow: 1px 1px 0 #000; }
/* server dialog (1.21.6+): text + a grid of buttons instead of slots */
.pm-dialog { display: none; }
.pov3d-menu.dlg .pm-dialog { display: block; min-width: min(420px, 86vw); }
.pov3d-menu.dlg .pm-grid, .pov3d-menu.dlg .pm-label { display: none !important; }
.pd-body { text-align: center; color: #d9d4f5; font-size: 13px; line-height: 1.45; margin: 4px 0 12px; }
.pd-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pd-btn {
  --gap: 6px; flex: 0 0 calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols)); min-width: 0;
  font-family: var(--pixel); font-size: 14px; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
  padding: 9px 8px; cursor: pointer; background: #6b6683; border: 2px solid #120d22;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .28), inset -2px -2px 0 rgba(0, 0, 0, .4);
}
.pd-btn:hover { background: #7e78a0; }
.pd-btn:active { background: #575272; }
.pd-note { margin-top: 10px; font-size: 12px; color: #a9a3d0; text-align: center; }
.pm-tip { display: none; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); max-width: 80%; padding: 6px 10px; background: rgba(10, 6, 26, .96); border: 2px solid #4a3d86; pointer-events: none; }
.pm-tip.show { display: block; }
.pm-tip-name { font-size: 13px; }
.pm-tip-lore { font-size: 12px; color: #b9b3e0; }
@media (max-width: 760px) { .pm-win { max-width: 94%; } .pm-grid { grid-template-columns: repeat(9, 28px); grid-auto-rows: 28px; } .pm-slot { width: 28px; height: 28px; } .pm-slot .ico { font-size: 15px; } }

/* ---------- 3D view chat (T or /) ---------- */
.pov3d-chat { position: absolute; left: 12px; bottom: 140px; width: min(56%, 520px); display: grid; gap: 4px; font: 500 14px/1.35 var(--pixel); }
.pov3d-chatlog { display: grid; gap: 1px; max-height: 190px; overflow: hidden; align-content: end; }
.pov3d-chatlog .cl { padding: 1px 6px; background: rgba(0, 0, 0, .45); text-shadow: 2px 2px 0 #000; word-break: break-word; transition: opacity .6s; }
.pov3d-chatlog .cl.old { opacity: 0; }
.pov3d-chatlog .cl.warn { color: #ffd23f; }
.pov3d-chatlog .cl.error { color: #ff6b7d; }
.pov3d-chatbar { display: none; }
.pov3d-chattip { justify-self: start; padding: 2px 7px; background: rgba(0, 0, 0, .35); font-size: 12px; opacity: .75; }
.pov3d-chat.open { left: 8px; right: 8px; bottom: 8px; width: auto; z-index: 5; }
.pov3d-chat.open .pov3d-chatlog { max-height: 60%; max-height: 260px; overflow-y: auto; pointer-events: auto; }
.pov3d-chat.open .cl.old { opacity: 1; }
.pov3d-chat.open .pov3d-chatbar { display: block; pointer-events: auto; }
.pov3d-chat.open .pov3d-chattip { display: none; }
.pov3d-chatbar input {
  width: 100%; height: 34px; padding: 0 10px; border: 2px solid #000; background: rgba(0, 0, 0, .72); color: #fff;
  font: 500 15px var(--pixel); outline: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.pov3d-chatbar input::placeholder { color: rgba(255, 255, 255, .45); }
@media (max-width: 760px) { .pov3d-chat { bottom: 130px; width: 70%; font-size: 12px; } .pov3d-chattip { display: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .guides { grid-template-columns: 1fr 1fr; }
  .acct-table .hide-md { display: none; }
  .bot-row, .list-head { grid-template-columns: minmax(160px, 1fr) 110px 1fr auto; }
  .bot-row .hide-md, .list-head .hide-md { display: none; }
  .pov { grid-template-columns: 1fr; }
  .pov-info { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    height: 56px; padding: 0 16px; background: rgba(8, 6, 26, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
  main { padding: 20px 16px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .console { height: 360px; }
  .bot-row, .list-head { grid-template-columns: 1fr auto; }
  .bot-row .hide-sm, .list-head .hide-sm { display: none; }
  .builder-top { grid-template-columns: 1fr 1fr; }
  .builder-top > :first-child { grid-column: 1 / -1; }
  .step { grid-template-columns: 34px 1fr auto; }
  .step > .nested { grid-column: 1 / -1; }
  .hero { grid-template-columns: 1fr; }
  .hero-stat { min-width: 0; }
  .guides { grid-template-columns: 1fr; }
  .acct-table .hide-sm { display: none; }
  .acct-search, .acct-sort select { width: 100%; }
  .acct-toolbar > .btn { width: 100%; }
  .acct-tools { width: 100%; }
  .acct-tools > * { flex: 1; }
  .proxy-board { padding: 10px; }
}

/* ---------- landing v2: starfield, pixel feature icons, plan cards, compare table ---------- */
body.landing { position: relative; }
.lp-stars {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(236, 233, 255, .85) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(196, 181, 253, .7) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 33% 62%, rgba(236, 233, 255, .5) 50%, transparent 50%),
    radial-gradient(2px 2px at 88% 48%, rgba(196, 181, 253, .6) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 58% 86%, rgba(236, 233, 255, .45) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 6% 78%, rgba(196, 181, 253, .5) 50%, transparent 50%),
    radial-gradient(900px 500px at 78% -8%, rgba(139, 92, 246, .16), transparent 70%),
    radial-gradient(700px 420px at 8% 102%, rgba(244, 114, 182, .09), transparent 70%);
}

.lp-hero h1 { font-size: clamp(34px, 5.2vw, 56px); font-weight: 900; line-height: 1.04; letter-spacing: -.03em; }
.lp-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; margin: 22px 0 0; padding: 0; }
.lp-trust li { font-size: 13px; font-weight: 600; color: var(--faint); padding-left: 18px; position: relative; }
.lp-trust li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); }

.lp-feat { display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, transform .15s; }
.lp-feat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.lp-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px;
  border: 2px solid #120d22; background: linear-gradient(160deg, #2a2560, #1a1742);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .16), inset -2px -2px 0 rgba(0, 0, 0, .3); }
.lp-ico .pix { width: 20px; height: 20px; }

.lp-cycle { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 11, 36, .7); }
.lp-cycle-btn { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.lp-cycle-btn:hover { color: var(--text); }
.lp-cycle-btn.active { background: var(--accent); color: var(--accent-ink); }
.lp-save { padding: 2px 8px; border-radius: 999px; background: rgba(74, 222, 128, .18);
  color: var(--ok); font-size: 11px; font-weight: 800; }
.lp-cycle-btn.active .lp-save { background: rgba(26, 11, 61, .22); color: var(--accent-ink); }

.lp-plan { gap: 8px; }
.lp-plan.best { transform: scale(1.02); }
.lp-plan-head { display: flex; align-items: center; gap: 12px; }
.lp-plan-num { display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 2px solid #120d22; background: linear-gradient(160deg, #3a2f86, #221d52);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .18), inset -2px -2px 0 rgba(0, 0, 0, .3);
  font-family: var(--pixel); font-size: 16px; font-weight: 700; color: #e9d5ff; }
.lp-plan-name { font-size: 20px; font-weight: 900; letter-spacing: .01em; color: var(--text); }
.lp-plan-tag { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.lp-price { font-size: 42px; margin-top: 6px; }
.lp-price-note { font-size: 12.5px; color: var(--faint); font-weight: 600; margin-top: -2px; }
.lp-slots { margin: 12px 0 4px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: rgba(10, 9, 30, .55); font-size: 14px; color: var(--muted); font-weight: 600; }
.lp-slots b { font-size: 20px; font-weight: 900; color: var(--text); margin-right: 6px; }
.lp-tag { top: -11px; right: 50%; transform: translateX(50%); white-space: nowrap; padding: 4px 14px; }

.lp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.lp-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.lp-table th { text-align: center; padding: 14px 16px; font-size: 13px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.lp-table th:first-child { text-align: left; }
.lp-table td { padding: 11px 16px; text-align: center; color: var(--muted); border-bottom: 1px solid rgba(39, 36, 90, .5); }
.lp-table td:first-child { text-align: left; color: var(--text); font-weight: 500; }
.lp-table tbody tr:last-child td { border-bottom: 0; }
.lp-table tr:not(.lp-table-group):hover td { background: rgba(167, 139, 250, .05); }
.lp-table-group td { padding: 14px 16px 8px; font-family: var(--pixel); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); background: rgba(10, 9, 30, .45); font-weight: 700; }
.lp-table .yes { color: var(--ok); font-weight: 800; }
.lp-table .no { color: var(--faint); }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; }
  .lp-hero-art { order: -1; max-width: 380px; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-plan.best { transform: none; }
  .lp-links a:not(.btn) { display: none; }
}

/* ---------- plan badge on a landing feature card ---------- */
.lp-feat-plan { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 8px;
  border-radius: 999px; background: rgba(167, 139, 250, .16); border: 1px solid rgba(167, 139, 250, .4);
  color: #d8ccff; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }

/* ---------- dashboard v2: same space + pixel language as the landing page ---------- */
/* (The nebula backdrop already comes from body::before near the top of this file, on every
   page. An extra layer here would just override it, so there isn't one.) */

.page-head h1 { font-size: 26px; font-weight: 900; letter-spacing: -.025em; }
.page-head p { font-size: 13.5px; }

/* active nav: pixel-accent bar instead of a soft inset line */
.nav a.active { box-shadow: inset 3px 0 0 var(--accent); }

/* tabs pick up the landing's underline treatment */
.tab { position: relative; font-weight: 600; }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--accent); }

/* stat tiles get the beveled block edge used by the macro blocks */
.hero-stat { border: 2px solid #120d22; border-radius: var(--radius-sm);
  background: linear-gradient(160deg, #191545, #12102f);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .1), inset -2px -2px 0 rgba(0, 0, 0, .28); }
.hero-stat .big { font-weight: 900; letter-spacing: -.03em; }

/* table headers in the pixel face, like the compare table */
.acct-table th, .lp-table th { font-family: var(--pixel); font-size: 12.5px; letter-spacing: .07em; }
.acct-table tbody tr:hover td { background: rgba(167, 139, 250, .05); }

/* macro palette tiles read as little blocks */
.tile { transition: transform .1s, border-color .1s; }
.tile:hover { transform: translateY(-1px); border-color: var(--line-2); }

/* the locked-feature / empty states */
.empty h2 { font-weight: 900; letter-spacing: -.02em; }

/* billing page plan cards sit on a dark panel like the rest of the dashboard */
.lp-grid.plans .lp-plan { background: var(--card); }

/* admin looking at another user's panel */
.viewas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1);
  color: #fde68a; font-size: 13.5px; font-weight: 600; }
.viewas b { color: #fff; }

/* Keep the starfield on its own layer too, so it never repaints mid-scroll. */
.lp-stars { transform: translateZ(0); }

/* Biggest scroll win: backdrop-filter is compositing work per element per frame, and the
   rule above matches one element per card and per account row. Keep the frosted look only
   where there is ever one on screen (topbar, sidebar, modal); cards get a touch more
   opacity instead so they read the same without the blur. */
.card, .panel, .stat, .kv > div, .hero, .bot-row { backdrop-filter: none; }
:root { --card: rgba(20, 18, 52, .9); }

/* The starfield used to drift by animating background-position, which is not a composited
   property: it repainted a full-viewport stack of 8 radial gradients every frame, forever,
   and scroll input queued behind that. Same motion, done with transform instead, so the GPU
   just slides an existing layer and nothing repaints. The layer is grown past the viewport
   so the moving edges never come into view. */
body::after { inset: -520px; will-change: transform; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-500px, 380px, 0); }
}

/* ---------- servers page: bot pool, server cards, drag targets ---------- */
.sv-pool { gap: 12px; }
.sv-pool-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sv-pool-head .title { margin: 0; }
.sv-pool-head .muted { margin-left: auto; }
.sv-count { padding: 4px 11px; border-radius: 999px; background: rgba(167, 139, 250, .14);
  border: 1px solid rgba(167, 139, 250, .3); color: #d8ccff; font-size: 12px; font-weight: 700; white-space: nowrap; }

.sv-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sv-chip { display: flex; align-items: center; gap: 9px; padding: 9px 13px; cursor: grab;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2);
  font-size: 13.5px; font-weight: 600; transition: border-color .15s, transform .12s, box-shadow .15s; }
.sv-chip:hover { border-color: var(--line-2); transform: translateY(-1px); }
.sv-chip:active { cursor: grabbing; }
.sv-chip.dragging { opacity: .45; }
.sv-chip.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(139, 92, 246, .35); }
.sv-grip { color: var(--faint); font-size: 13px; letter-spacing: -2px; cursor: grab; }
.sv-chip .head-img { width: 24px; height: 24px; border-radius: 4px; image-rendering: pixelated; }
.sv-chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.sv-dot.online { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.sv-dot.connecting, .sv-dot.reconnecting, .sv-dot.waiting { background: var(--info); }
.sv-dot.login { background: var(--warn); }
.sv-dot.stopped { background: var(--danger); }
.sv-chip-x { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 12px; padding: 0 0 0 2px; }
.sv-chip-x:hover { color: var(--danger); }

.sv-card { gap: 14px; position: relative; transition: border-color .15s, box-shadow .15s; }
.sv-card.armed { border-style: dashed; border-color: var(--line-2); }
.sv-card.over, .sv-pool.over { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 34px rgba(139, 92, 246, .3); }
.sv-card-head { display: flex; align-items: center; gap: 13px; }
.sv-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sv-addr { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }

/* little grass-block style server mark */
.sv-ico { position: relative; width: 30px; height: 30px; flex: none; border: 2px solid #120d22;
  background: #8f8aa8; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .2), inset -2px -2px 0 rgba(0, 0, 0, .3); }
.sv-ico-top { position: absolute; left: 0; right: 0; top: 0; height: 8px; background: #5fd35a; }
.sv-ico-mid { position: absolute; left: 0; right: 0; top: 8px; height: 3px; background: #2f8f3a; }

.sv-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 84px; border: 2px dashed var(--line-2); border-radius: var(--radius-sm);
  color: var(--faint); font-size: 13.5px; font-weight: 600; }
.sv-drop-ico { font-size: 18px; }
.sv-card.over .sv-drop { border-color: var(--accent); color: var(--accent); }
.sv-empty { color: var(--faint); font-size: 13.5px; }

.sv-menu-wrap { position: relative; flex: none; }
.sv-dots { border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer;
  padding: 2px 8px; border-radius: var(--radius-sm); font-size: 15px; line-height: 1; }
.sv-dots:hover { background: var(--card-2); border-color: var(--line); color: var(--text); }
.sv-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 20; min-width: 132px;
  display: grid; padding: 5px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card-2); box-shadow: var(--shadow); }
.sv-menu-item { border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px;
  text-align: left; padding: 8px 11px; border-radius: 6px; cursor: pointer; }
.sv-menu-item:hover { background: rgba(167, 139, 250, .14); }
.sv-menu-item.danger { color: var(--danger); }
.sv-menu-item.danger:hover { background: rgba(251, 113, 133, .14); }

@media (max-width: 760px) {
  .sv-pool-head .muted { margin-left: 0; width: 100%; order: 3; }
  .sv-chip { flex: 1 1 100%; }
  .sv-chip-name { max-width: none; flex: 1; }
}
/* bots that have never connected have no skin yet, so headImg falls back to a letter tile */
.sv-chip .head-avatar { width: 24px; height: 24px; border-radius: 4px; font-size: 12px; flex: none; }

/* the proxy board reuses the server card; its badge is a type letter, not a grass block */
.sv-ico.proxy { display: grid; place-items: center; background: linear-gradient(160deg, #3a2f86, #221d52);
  font-family: var(--pixel); font-size: 15px; font-weight: 700; color: #e9d5ff; }
.sv-card-head { flex-wrap: wrap; }
.sv-card-head .tag { white-space: nowrap; }
@media (max-width: 760px) {
  .sv-card-head .grow { flex: 1 1 100%; }
}
/* the shared VPS pool card sits above the private proxies and is not editable */
.sv-ico.proxy.shared { background: linear-gradient(160deg, #2a2560, #16143a); color: #9d98cf; }

/* a server's own icon from the Minecraft server list, in place of the drawn block */
.sv-ico.img { border: 2px solid #120d22; background: none; box-shadow: none;
  image-rendering: pixelated; object-fit: cover; }
/* ================= macro builder v3: numbered step rows ================= */
.cat-data { --cat: #f0abfc; }
.script { display: grid; gap: 0; }
.scripts { display: grid; gap: 18px; }
.workspace .script + .script { margin-top: 0; }

/* the "WHEN ..." trigger card that sits on top of a step list */
.tcard {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  margin: 10px 0 2px; padding: 12px 12px 12px 14px;
  background: linear-gradient(90deg, rgba(167, 139, 250, .16), rgba(167, 139, 250, .04) 60%, transparent), var(--card-2);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
}
.tcard-main { display: grid; gap: 6px; min-width: 0; }
.tcard-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tcard-when {
  font-family: var(--pixel); font-size: 13px; letter-spacing: .1em; color: var(--accent);
  background: rgba(167, 139, 250, .14); border: 1px solid rgba(167, 139, 250, .35); border-radius: 4px; padding: 2px 7px;
}
.tcard-top select.input { width: auto; max-width: 240px; height: 32px; }
.tcard-top .f { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tcard-top .f .input { height: 32px; width: 170px; }
.tcard-top .f .input.short { width: 62px; }
.tcard-top .f.wide { flex: 1; min-width: 180px; }
.tcard-top .f.wide .input { width: 100%; }

/* one step */
.srows { display: grid; }
.sitem { display: grid; }
.srow {
  display: grid; grid-template-columns: 18px 26px 34px minmax(130px, 1fr) minmax(0, 1.25fr) 30px;
  gap: 10px; align-items: center; padding: 9px 8px 9px 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cat, #888) 13%, transparent), transparent 55%), var(--card-2);
  border: 1px solid var(--line); border-left: 3px solid var(--cat, var(--line-2)); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s, opacity .12s;
}
.srow:hover { border-color: var(--line-2); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cat, #888) 30%, transparent); }
.srow.dragging { opacity: .35; }
.sr-grip { color: var(--faint); cursor: grab; text-align: center; font-size: 15px; line-height: 1; user-select: none; }
.sr-grip:active { cursor: grabbing; }
.sr-num { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.sr-ico {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--cat, #888) 20%, #1a1740); border: 2px solid #120d22;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .12), inset -2px -2px 0 rgba(0, 0, 0, .35);
}
.sr-ico .pix { width: 22px; height: 22px; }
.sr-ico.big { width: 38px; height: 38px; }
.sr-ico.big .pix { width: 24px; height: 24px; }
.sr-main { min-width: 0; display: grid; gap: 2px; }
.sr-name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.sr-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.sr-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.sr-fields .f { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.sr-fields .f .input, .sr-fields .f select.input { height: 30px; width: 74px; padding: 0 8px; }
.sr-fields .f select.input { width: auto; max-width: 210px; }
.sr-fields .f.wide { flex: 1 1 150px; }
.sr-fields .f.wide .input { width: 100%; }
.sr-fields .f.item-type { flex: 0 1 170px; }
.sr-fields .hint { font-size: 11px; color: var(--faint); flex-basis: 100%; text-align: right; }
.sr-fields .check { font-size: 12px; color: var(--muted); }
.sr-fields .input.bad { box-shadow: 0 0 0 2px #fb7185; }
.sr-fields .cond { justify-content: flex-end; }
.sr-dots {
  width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; font: 16px/1 inherit;
  background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted);
}
.sr-dots:hover { background: var(--card); color: var(--text); border-color: var(--line-2); }

/* nested lists inside Repeat / Repeat while / If */
.sr-kids { margin: 0 0 0 26px; padding-left: 14px; border-left: 2px dashed color-mix(in srgb, var(--cat, #c084fc) 55%, transparent); }
.sr-branch { font-family: var(--pixel); font-size: 13px; letter-spacing: .06em; color: var(--muted); padding: 6px 0 0; }
.sr-none { font-size: 12px; color: var(--faint); padding: 4px 0 0 4px; }

/* the space a dragged row drops into */
.sr-drop { height: 8px; border-radius: 4px; transition: height .1s, background .1s; }
.sr-drop.over { height: 30px; background: rgba(167, 139, 250, .1); box-shadow: inset 0 0 0 2px var(--accent); }

/* the dashed "+ Add step" row at the end of every list */
.sr-add {
  margin-top: 2px; width: 100%; padding: 10px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--muted); background: transparent; border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
}
.sr-add:hover { color: var(--accent); border-color: var(--accent); background: rgba(167, 139, 250, .06); }

/* the ⋯ menu on a row */
.row-menu {
  position: absolute; z-index: 70; min-width: 170px; padding: 5px; display: grid; gap: 1px;
  background: #15133a; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.row-menu button {
  text-align: left; padding: 7px 10px; background: none; border: 0; border-radius: 6px;
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.row-menu button:hover { background: var(--card-2); }
.row-menu button.danger { color: var(--danger); }
.row-menu hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; }

/* the ADD STEP dialog: two columns of cards */
.addstep { display: grid; gap: 12px; }
.addstep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.addstep-group {
  grid-column: 1 / -1; font-family: var(--pixel); font-size: 13px; letter-spacing: .08em;
  color: var(--faint); text-transform: uppercase; margin-top: 6px;
}
.addstep-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; text-align: left;
  padding: 10px; cursor: pointer; font: inherit; color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat, #888) 12%, transparent), transparent 70%), var(--card-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); transition: transform .08s, border-color .12s;
}
.addstep-card:hover { border-color: color-mix(in srgb, var(--cat, #888) 60%, transparent); transform: translateY(-1px); }
.addstep-txt { display: grid; gap: 3px; min-width: 0; }
.addstep-txt b { font-size: 13.5px; font-weight: 700; }
.addstep-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.modal:has(.addstep) { max-width: 760px; }

@media (max-width: 900px) {
  .srow { grid-template-columns: 18px 24px 34px minmax(0, 1fr) 30px; row-gap: 8px; }
  .sr-fields { grid-column: 3 / -1; justify-content: flex-start; }
  .sr-fields .hint { text-align: left; }
  .addstep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .srow { grid-template-columns: 24px 34px minmax(0, 1fr) 30px; }
  .sr-grip { display: none; }
  .sr-fields { grid-column: 1 / -1; }
  .sr-kids { margin-left: 8px; padding-left: 10px; }
}

/* library detail dialog: description left, step outline right */
.modal:has(.lib-detail) { max-width: 980px; }
.lib-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.lib-detail .lib-desc { font-size: 14.5px; line-height: 1.6; }
.ol-title { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.ol-list { display: grid; gap: 8px; }
.ol-kids { display: grid; gap: 8px; margin: 8px 0 0 17px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.ol-kids > .ol-list { margin: 0; }
.ol-branch { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.ol-row, .ol-trigger { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ol-trigger { margin: 14px 0 8px; }
.ol-trigger:first-of-type { margin-top: 0; }
.ol-ico {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px;
  background: color-mix(in srgb, var(--cat, #888) 30%, #1a1740);
}
.ol-ico.trig { background: #7c3aed; }
.ol-ico .pix { width: 20px; height: 20px; }
.ol-name { font-weight: 700; font-size: 14px; color: var(--text); }
.ol-desc { font-size: 13.5px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.lib-card.click { cursor: pointer; }
@media (max-width: 760px) { .lib-detail { grid-template-columns: 1fr; } }
/* legal pages and docs */
main.legal { max-width: 820px; margin: 0 auto; padding: 36px 24px 56px; line-height: 1.7; }
main.legal h1 { font-size: 36px; font-weight: 900; margin: 0 0 4px; }
main.legal h2 { font-size: 21px; margin: 34px 0 8px; scroll-margin-top: 80px; }
main.legal h3 { font-size: 16px; margin: 20px 0 4px; }
main.legal p, main.legal li { color: var(--muted); font-size: 15px; }
main.legal p { margin: 8px 0; }
main.legal ul, main.legal ol { padding-left: 22px; margin: 8px 0; display: grid; gap: 5px; }
main.legal strong, main.legal b { color: var(--text); }
main.legal a { color: var(--accent); }
main.legal code { font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .07); color: var(--text); }
.ph { background: rgba(250, 204, 21, .18); color: #fde68a; padding: 0 4px; border-radius: 4px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 9px 12px; border: 1px solid var(--line); color: var(--muted); }
.legal-table th { color: var(--text); background: rgba(255, 255, 255, .04); }
.legal-table td:first-child { color: var(--text); }
.docs-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 8px; max-width: 1120px; margin: 0 auto; padding: 0 24px; align-items: start; }
.docs-nav { position: sticky; top: 76px; display: grid; gap: 2px; padding-top: 40px; }
.docs-nav b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 6px; }
.docs-nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.docs-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.lp-foot a { color: inherit; }
@media (max-width: 860px) { .docs-wrap { grid-template-columns: 1fr; } .docs-nav { position: static; padding-top: 16px; grid-template-columns: repeat(2, 1fr); } }