/* ==========================================================================
   Portolab — Platform 4.0 design system
   Midnight indigo + ember. Top navigation, poster artwork, a control dock.
   Fonts are self-hosted (SIL OFL, see fonts/LICENSE.txt).
   ========================================================================== */

@font-face { font-family: "Manrope"; src: url("fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: dark;

  /* Surfaces: ink indigo, darkest to lightest */
  --bg: #07081a;
  --bg-2: #0b0c22;
  --surface: #11132c;
  --surface-2: #171a38;
  --surface-3: #1e2246;
  --surface-4: #282c58;

  --line: rgba(176, 168, 255, 0.09);
  --line-2: rgba(176, 168, 255, 0.15);
  --line-3: rgba(176, 168, 255, 0.24);

  --text: #f3f1ff;
  --text-2: #bdb9e2;
  --text-3: #8d89b8;
  --text-4: #615d8e;

  /* Brand: ember → magenta, with a violet companion */
  --ember: #ff6a3d;
  --ember-2: #ff8a63;
  --magenta: #ff4d8d;
  --violet: #a594ff;
  --violet-2: #c4b8ff;
  --violet-wash: rgba(165, 148, 255, 0.12);
  --ember-wash: rgba(255, 106, 61, 0.12);
  --grad: linear-gradient(115deg, #ff6a3d 0%, #ff4d8d 60%, #c25cff 100%);
  --on-grad: #1b0710;

  /* Status signals */
  --ok: #b6f36a;
  --ok-wash: rgba(182, 243, 106, 0.12);
  --busy: #ffc44d;
  --busy-wash: rgba(255, 196, 77, 0.12);
  --bad: #ff5470;
  --bad-wash: rgba(255, 84, 112, 0.12);
  --bad-line: rgba(255, 84, 112, 0.38);
  --off: #8d89b8;
  --off-wash: rgba(141, 137, 184, 0.13);
  --info: #6fd3ff;
  --info-wash: rgba(111, 211, 255, 0.11);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 10px 30px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--violet);

  --top-h: 64px;
  --gutter: clamp(16px, 3vw, 44px);
  --content: 1320px;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -200px, rgba(194, 92, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% -100px, rgba(255, 106, 61, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 450 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
svg { flex: none; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
code { overflow-wrap: anywhere; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.9em; font-variant-ligatures: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
b, strong { font-weight: 700; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 106, 61, 0.32); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r); background: var(--text); color: var(--bg); font-weight: 700; }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.wrap { overflow-wrap: anywhere; font-weight: 600; }
.link { color: var(--violet-2); text-decoration: underline; text-decoration-color: rgba(196, 184, 255, 0.4); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.footnote { color: var(--text-3); font-size: 13.5px; }

/* ---------- Test-preview ribbon ---------- */
.ribbon { position: relative; z-index: 40; background: repeating-linear-gradient(135deg, rgba(255, 196, 77, 0.16) 0 12px, rgba(255, 196, 77, 0.08) 12px 24px), #1a1508; border-bottom: 1px solid rgba(255, 196, 77, 0.35); color: #ffe4a8; font-size: 13px; }
.ribbon-in { max-width: var(--content); margin: 0 auto; padding: 7px var(--gutter); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ribbon .tag { display: inline-flex; align-items: center; gap: 7px; padding: 2px 9px; border-radius: 999px; background: var(--busy); color: #251900; font-weight: 800; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.ribbon .tag i { width: 6px; height: 6px; border-radius: 50%; background: #251900; animation: pulse 1.6s infinite; }
.ribbon .ver { font-weight: 700; color: #fff3d6; }
.ribbon .say { flex: 1 1 320px; color: #f1d79e; }
.ribbon a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #fff3d6; text-decoration: underline; text-underline-offset: 3px; }
.ribbon a svg { width: 13px; height: 13px; }
.chip-test { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--busy-wash); color: var(--busy); font-size: 11.5px; font-weight: 700; }

/* ---------- Top bar ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); background: rgba(7, 8, 26, 0.78); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--content); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; border-radius: var(--r); }
.logo-mark { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-sub { margin-top: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-3); }

.primary-nav { display: flex; align-items: center; gap: 2px; height: 100%; }
.primary-nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 14px; color: var(--text-2); font-weight: 650; font-size: 14px; border-radius: 0; transition: color .15s; }
.primary-nav a svg { width: 17px; height: 17px; opacity: .75; }
.primary-nav a:hover { color: var(--text); }
.primary-nav a[aria-current="page"] { color: var(--text); }
.primary-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.primary-nav a[aria-current="page"] svg { opacity: 1; color: var(--ember-2); }
.primary-nav.stacked { flex-direction: column; align-items: stretch; height: auto; gap: 2px; }
.primary-nav.stacked a { height: 44px; border-radius: var(--r); padding: 0 12px; }
.primary-nav.stacked a[aria-current="page"] { background: var(--surface-3); }
.primary-nav.stacked a[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.account > summary { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.account > summary:hover { border-color: var(--line-3); }
.account > summary .who { display: none; }
.account > summary .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .2s; }
.account[open] > summary .chev { transform: rotate(180deg); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 8px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: grid; gap: 2px; animation: pop .16s var(--ease); }
.menu-panel > a, .menu-panel .logout-form button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r); color: var(--text-2); font: 600 14px var(--font); background: none; border: 0; cursor: pointer; text-align: left; min-height: 0; }
.menu-panel > a:hover, .menu-panel .logout-form button:hover { background: var(--surface-3); color: var(--text); }
.menu-panel svg { width: 17px; height: 17px; }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.mnav { display: none; }
.mnav .sheet { width: min(320px, calc(100vw - 32px)); }
.mnav:not([open]) .sheet { display: none; }

.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #3a2f7a, #5a3a8a); color: #fff; font: 700 12px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset; }
.avatar.admin { background: var(--grad); color: var(--on-grad); }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who strong { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who > span { color: var(--text-3); font-size: 12.5px; }

/* ---------- Page ---------- */
.page { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: 32px var(--gutter) 72px; outline: none; }
.page > * + * { margin-top: 28px; }
.site-foot { border-top: 1px solid var(--line); color: var(--text-4); font-size: 13px; }
.foot-in { max-width: var(--content); margin: 0 auto; padding: 22px var(--gutter); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 600; }
.foot-brand .logo-mark { width: 22px; height: 22px; }

.kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember-2); }
.display { font-size: clamp(32px, 4.6vw, 54px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.lede { color: var(--text-2); font-size: 16.5px; max-width: 62ch; }
.lede b { color: var(--ok); }
.page-head { display: grid; gap: 12px; }
.page-head h1:not(.display) { font-size: 34px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "/"; color: var(--text-4); }
.crumbs a:hover { color: var(--text); }
.crumbs [aria-current] { color: var(--text-2); }

/* ---------- Buttons ---------- */
button, .button {
  --b-bg: var(--grad); --b-fg: var(--on-grad); --b-line: transparent;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-fg); font: 750 14px/1 var(--font); letter-spacing: 0.005em;
  cursor: pointer; white-space: nowrap; transition: transform .12s var(--ease), filter .15s, background-color .15s, border-color .15s, opacity .15s;
  box-shadow: 0 8px 22px -12px rgba(255, 77, 141, 0.7);
}
button svg, .button svg { width: 17px; height: 17px; }
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px); }
button:disabled, .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.secondary { --b-bg: var(--surface-3); --b-fg: var(--text); --b-line: var(--line-2); box-shadow: none; }
.secondary:hover { --b-bg: var(--surface-4); filter: none; }
.ghost { --b-bg: transparent; --b-fg: var(--text-2); --b-line: transparent; box-shadow: none; }
.ghost:hover { --b-bg: var(--surface-3); --b-fg: var(--text); filter: none; }
.danger { --b-bg: var(--bad-wash); --b-fg: #ff8fa2; --b-line: var(--bad-line); box-shadow: none; }
.danger:hover { --b-bg: rgba(255, 84, 112, 0.2); filter: none; }
.danger.solid { --b-bg: var(--bad); --b-fg: #22020a; --b-line: transparent; }
.danger-text { --b-fg: #ff8fa2; }
.danger-icon:hover { --b-fg: #ff8fa2; --b-bg: var(--bad-wash); }
.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.sm svg { width: 15px; height: 15px; }
.lg { min-height: 50px; padding: 0 24px; font-size: 15px; }
.icon { padding: 0; width: 42px; }
.icon.sm { width: 34px; }
.block { width: 100%; }
button[aria-busy="true"] { pointer-events: none; }
button[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
button[aria-busy="true"] svg { display: none; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 7px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 500 14.5px/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(165, 148, 255, 0.22); background: var(--surface); }
input[aria-invalid="true"], .has-error input, .has-error select, .has-error textarea { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255, 84, 112, 0.14); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); font: 700 13px var(--font); cursor: pointer; }
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23bdb9e2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
textarea { min-height: 110px; resize: vertical; }
.req { color: var(--ember-2); margin-left: 3px; }
.opt { margin-left: 8px; font-weight: 600; font-size: 11.5px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.08em; }
.helptext { display: block; margin-top: 7px; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.errorlist { margin: 7px 0 0; padding: 0; list-style: none; color: #ff8fa2; font-size: 13px; font-weight: 600; }
.errorlist.nonfield, .field-error { display: block; padding: 10px 13px; border-radius: var(--r); background: var(--bad-wash); border: 1px solid var(--bad-line); color: #ffb3c0; font-weight: 600; font-size: 13.5px; }
.field-error { margin-top: 10px; }
.field { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.form-grid .full, .form-grid .is-textarea, .form-grid .is-checkbox { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: inline-flex; margin: 0; }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }
.inline-fields { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-fields .field { flex: 1 1 220px; }

.switch-row { display: flex; align-items: flex-start; gap: 14px; margin: 0; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-weight: 600; }
.switch-row:hover { border-color: var(--line-2); }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; position: relative; width: 40px; height: 24px; margin-top: 1px; border-radius: 999px; background: var(--surface-4); transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s var(--ease); }
.switch-row input:checked + .switch { background: var(--grad); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { box-shadow: var(--ring); }
.switch-text { display: grid; gap: 2px; }
.switch-text .label { font-weight: 700; }
.switch-text .helptext { margin: 0; font-weight: 500; }

/* ---------- Status pills ---------- */
.status { --s: var(--off); --s-wash: var(--off-wash); display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 9px; border-radius: 999px; background: var(--s-wash); color: var(--s); font: 750 12px/1 var(--font); letter-spacing: 0.02em; white-space: nowrap; border: 1px solid color-mix(in srgb, var(--s) 30%, transparent); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.running { --s: var(--ok); --s-wash: var(--ok-wash); }
.status.running::before { box-shadow: 0 0 0 0 currentColor; animation: beacon 2s infinite; }
.status.starting, .status.restart_queued, .status.restarting, .status.updating, .status.creating, .status.archiving, .status.busy { --s: var(--busy); --s-wash: var(--busy-wash); }
.status.starting::before, .status.restarting::before, .status.updating::before, .status.creating::before, .status.archiving::before { animation: pulse 1.2s infinite; }
.status.error { --s: var(--bad); --s-wash: var(--bad-wash); }
.status.lg { height: 30px; min-height: 0; padding: 0 13px 0 11px; font-size: 13px; }
.status.plain::before { display: none; }
.status.plain { padding: 0 10px; }
.status.stale { opacity: .6; border-style: dashed; }

/* ---------- Messages + notices ---------- */
.messages { display: grid; gap: 8px; }
.msg { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 600; animation: pop .25s var(--ease); }
.msg-ic { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--info); -webkit-mask: radial-gradient(circle, #000 35%, transparent 37%), linear-gradient(#000 0 0); }
.msg.success { border-color: rgba(182, 243, 106, 0.35); background: linear-gradient(90deg, var(--ok-wash), transparent 70%), var(--surface-2); }
.msg.success .msg-ic { background: var(--ok); }
.msg.error { border-color: var(--bad-line); background: linear-gradient(90deg, var(--bad-wash), transparent 70%), var(--surface-2); }
.msg.error .msg-ic { background: var(--bad); }
.msg.warning { border-color: rgba(255, 196, 77, 0.35); }
.msg.warning .msg-ic { background: var(--busy); }
.msg.info .msg-ic { background: var(--info); }
.access-messages:empty { display: none; }
.access-messages { padding: 0 20px 4px; }

.notice { display: flex; align-items: flex-start; gap: 14px; padding: 15px 18px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface); }
.notice > svg { width: 20px; height: 20px; margin-top: 2px; }
.notice > div { flex: 1; min-width: 0; }
.notice p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.notice > .button { align-self: center; }
.notice.ok { border-color: rgba(182, 243, 106, 0.3); } .notice.ok > svg { color: var(--ok); }
.notice.warning { border-color: rgba(255, 196, 77, 0.35); background: linear-gradient(90deg, var(--busy-wash), transparent 60%), var(--surface); } .notice.warning > svg { color: var(--busy); }
.notice.error { border-color: var(--bad-line); background: linear-gradient(90deg, var(--bad-wash), transparent 60%), var(--surface); } .notice.error > svg { color: var(--bad); }

.page-message { display: none; }
.page-message.is-visible { display: block; padding: 14px 18px; border-radius: var(--r-lg); border: 1px solid var(--bad-line); background: var(--bad-wash); color: #ffc2cc; font-weight: 600; }
.page-message pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; color: #ffd6dd; }

.skeleton { display: inline-block; min-width: 3.5em; border-radius: 6px; color: transparent !important; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-4) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* ---------- Panels + empty states ---------- */
.panel { border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), rgba(17, 19, 44, 0.85)); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { font-size: 16.5px; display: inline-flex; align-items: center; gap: 10px; }
.panel-head h2 > svg, .panel-head h3 > svg { width: 18px; height: 18px; color: var(--ember-2); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 26px 20px; text-align: center; }
.empty strong { font-family: var(--display); font-size: 15.5px; font-weight: 650; }
.empty p { color: var(--text-3); font-size: 13.5px; max-width: 46ch; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--violet-wash); color: var(--violet-2); }
.empty-icon svg { width: 22px; height: 22px; }
.panel-head .hint { color: var(--text-3); font-size: 13px; font-weight: 600; }
.panel-body { padding: 20px; }
.n, .count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-4); color: var(--text-2); font: 700 11.5px/1 var(--font); }
.state { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; text-align: center; border-radius: var(--r-lg); border: 1px dashed var(--line-2); background: rgba(17, 19, 44, 0.5); }
.state strong { font-family: var(--display); font-size: 19px; font-weight: 650; }
.state p { color: var(--text-3); max-width: 46ch; }
.state .button, .state button { margin-top: 10px; }
.state.compact { padding: 26px 20px; border: 0; background: none; }
.state.compact strong { font-size: 15.5px; }
.state.quiet strong { color: var(--text-2); }
.state-ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--violet-wash); color: var(--violet-2); margin-bottom: 4px; }
.state-ic svg { width: 24px; height: 24px; }
.no-results { display: none; margin-top: 18px; }
.no-results.is-visible { display: grid; }

/* ---------- Artwork ---------- */
.art { --tint: #2b2466; position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--tint) 80%, #fff 8%), var(--tint) 45%, #0a0b20); }
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.art[data-game="valheim"] { --tint: #24435a; }
.art[data-game="factorio"] { --tint: #5a3a1c; }
.art[data-game="palworld"] { --tint: #1e5a6a; }
.art[data-game^="zomboid"] { --tint: #4a2626; }
.art[data-game="ats"] { --tint: #5a4a20; }
.art[data-game="kerbal-lmp"] { --tint: #1c3a66; }
.art[data-game^="minecraft"] { --tint: #2e5a2a; }
.art[data-game="terraria"] { --tint: #24506a; }
.art[data-game="satisfactory"] { --tint: #6a4a1a; }
.art[data-game="enshrouded"] { --tint: #2a3a5a; }
.art[data-game="vrising"] { --tint: #5a1a2a; }
.art[data-game="seven-days"] { --tint: #4a3a2a; }
.art[data-game="rust"] { --tint: #5a2e1a; }

/* ---------- Overview: deck + KPIs ---------- */
.deck { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 40px; }
.deck-copy { display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(92px, auto)) minmax(220px, 1.3fr); gap: 1px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.kpis.compact { grid-template-columns: repeat(3, minmax(0, 220px)); width: max-content; max-width: 100%; }
.kpi { display: grid; align-content: space-between; gap: 10px; padding: 14px 18px; background: var(--surface); min-width: 0; }
.kpi .k { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.kpi .k i { width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.kpi.running .k i { background: var(--ok); } .kpi.busy .k i { background: var(--busy); } .kpi.error .k i { background: var(--bad); }
.kpi .v { font: 700 28px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi.error .v:not(:empty) { color: var(--text); }
.kpi .v small { font-size: 14px; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi .s { color: var(--text-3); font-size: 12px; }
.stack-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-4); }
.stack-bar span { transition: width .5s var(--ease); }
.stack-bar .running { background: var(--ok); } .stack-bar .busy { background: var(--busy); } .stack-bar .error { background: var(--bad); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search > svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px !important; padding-right: 40px !important; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-3); font-size: 11.5px; }
.search input:focus ~ kbd { opacity: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { --b-bg: transparent; --b-fg: var(--text-3); min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; box-shadow: none; }
.seg button:hover { --b-fg: var(--text); filter: none; }
.seg button[aria-pressed="true"] { --b-bg: var(--surface-3); --b-fg: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 8px rgba(0, 0, 0, 0.35); }
.seg button .n { background: transparent; color: inherit; opacity: .7; min-width: 0; padding: 0; }
.seg button .n:empty { display: none; }
.views { margin-left: auto; }
.views svg { width: 16px; height: 16px; }
.result-count { color: var(--text-3); font-size: 13px; font-weight: 600; }
.result-count:empty { display: none; }

/* ---------- Server cards: grid (poster) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "art art" "id id" "addr addr" "mem ver" "act act"; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.card:hover { transform: translateY(-3px); border-color: var(--line-3); box-shadow: var(--shadow-lg); }
.card-art { grid-area: art; aspect-ratio: 16 / 10; border-radius: 0; }
.card-art > img { transition: transform .6s var(--ease); }
.card:hover .card-art > img { transform: scale(1.045); }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 8, 26, 0) 45%, rgba(17, 19, 44, 0.92) 100%); }
.card-status { position: absolute; top: 14px; left: 14px; z-index: 2; }
.card-status .status { background: rgba(7, 8, 26, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card-id { grid-area: id; position: relative; z-index: 1; margin-top: -44px; padding: 0 20px; min-width: 0; }
.card-game { display: block; color: var(--ember-2); font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-id h3 { margin-top: 4px; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.card-id h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-id h3 a { position: static; }
.card-owner { display: block; margin-top: 3px; color: var(--text-3); font-size: 13px; }
.card-addr { grid-area: addr; position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 16px 20px 0; padding: 8px 8px 8px 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.card-addr .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.card-addr::before { content: ""; flex: none; width: 15px; height: 15px; background: var(--text-4); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M2 8h12M8 2c1.8 1.7 2.6 3.7 2.6 6S9.8 12.3 8 14C6.2 12.3 5.4 10.3 5.4 8S6.2 3.7 8 2Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M2 8h12M8 2c1.8 1.7 2.6 3.7 2.6 6S9.8 12.3 8 14C6.2 12.3 5.4 10.3 5.4 8S6.2 3.7 8 2Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.card-addr .addr { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.card-addr code { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.card-addr .none { flex: 1; color: var(--text-4); font-size: 13px; }
.more-addr { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--surface-4); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.card-stat { display: grid; gap: 2px; padding: 14px 20px 0; min-width: 0; }
.card-stat.mem { grid-area: mem; } .card-stat.ver { grid-area: ver; text-align: right; }
.card-stat .lbl { color: var(--text-4); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.card-stat [data-role] { font: 650 15px/1.3 var(--display); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-stat .dim { color: var(--text-3); font-weight: 500; }
.card-actions { grid-area: act; position: relative; z-index: 1; display: flex; gap: 6px; padding: 16px 20px 20px; }
.card-actions .button:first-child { flex: 1; }
.card-new a { display: grid; place-content: center; justify-items: center; gap: 6px; height: 100%; min-height: 300px; border-radius: var(--r-xl); border: 1.5px dashed var(--line-3); color: var(--text-2); text-align: center; transition: border-color .2s, background .2s, color .2s; }
.card-new a:hover { border-color: var(--ember); background: var(--ember-wash); color: var(--text); }
.card-new .plus { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--grad); color: var(--on-grad); margin-bottom: 6px; box-shadow: 0 12px 30px -10px rgba(255, 77, 141, .7); }
.card-new .plus svg { width: 22px; height: 22px; }
.card-new strong { font-family: var(--display); font-size: 17px; }
.card-new small { color: var(--text-3); font-size: 13px; }

/* Copy button */
.copy-btn { --b-fg: var(--text-3); position: relative; z-index: 2; }
.copy-btn .ok { display: none; color: var(--ok); }
.copy-btn[data-copied="true"] .idle { display: none; }
.copy-btn[data-copied="true"] .ok { display: block; }

/* ---------- Server cards: list (scannable rows) ---------- */
.list-head { display: none; }
.cards.is-list { grid-template-columns: 1fr; gap: 0; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.is-list-wrap .list-head, .fleet.list-mode .list-head { display: grid; }
.list-head, .cards.is-list .card { grid-template-columns: minmax(240px, 2.2fr) 130px minmax(200px, 1.6fr) 100px minmax(90px, .8fr) 150px; column-gap: 18px; align-items: center; }
.list-head { padding: 0 18px 10px 18px; color: var(--text-4); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.list-head span:first-child { padding-left: 74px; }
.cards.is-list .card { grid-template-areas: "id status addr mem ver act"; padding: 12px 18px; border: 0; border-radius: 0; box-shadow: none; background: none; transform: none; }
.cards.is-list .card + .card { border-top: 1px solid var(--line); }
.cards.is-list .card:hover { background: var(--surface-2); }
.cards.is-list .card-art { position: absolute; left: 18px; top: 50%; width: 58px; height: 58px; aspect-ratio: auto; transform: translateY(-50%); border-radius: 12px; }
.cards.is-list .card-art::after { display: none; }
.cards.is-list .card:hover .card-art > img { transform: none; }
.cards.is-list .card-id { margin: 0; padding: 0 0 0 74px; min-height: 58px; display: flex; flex-direction: column; justify-content: center; }
.cards.is-list .card-id h3 { font-size: 16.5px; margin-top: 2px; }
.cards.is-list .card-game { font-size: 10.5px; }
.cards.is-list .card-owner { font-size: 12.5px; }
.cards.is-list .card-status { grid-area: status; position: static; }
.cards.is-list .card-status .status { background: var(--s-wash); backdrop-filter: none; }
.cards.is-list .card-addr { margin: 0; padding: 5px 5px 5px 10px; }
.cards.is-list .card-addr::before { display: none; }
.cards.is-list .card-addr .lbl, .cards.is-list .card-stat .lbl { display: none; }
.cards.is-list .card-stat { padding: 0; }
.cards.is-list .card-stat.ver { text-align: left; }
.cards.is-list .card-actions { padding: 0; justify-content: flex-end; }
.cards.is-list .card-actions .button:first-child { flex: none; }
.cards.is-list .card-new { display: none; }

/* ---------- Server hero (detail, create) ---------- */
.hero { position: relative; margin: -32px calc(50% - 50vw) 0; min-height: 360px; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art > img { object-position: center 35%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 8, 26, 0.25) 0%, rgba(7, 8, 26, 0.55) 45%, var(--bg) 100%), linear-gradient(90deg, rgba(7, 8, 26, 0.85) 0%, rgba(7, 8, 26, 0) 70%); }
.hero-in { width: 100%; max-width: var(--content); margin: 0 auto; padding: 30px var(--gutter) 34px; display: grid; gap: 30px; }
.hero .crumbs { color: rgba(243, 241, 255, 0.7); }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-copy { display: grid; gap: 10px; min-width: 0; max-width: 760px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 64px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; overflow-wrap: anywhere; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.hero-lede { color: var(--text-2); font-size: 16px; max-width: 60ch; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 13px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
.live-dot.is-stale::before { background: var(--busy); }
.connect-card { display: grid; gap: 4px; padding: 14px 14px 14px 18px; min-width: 280px; max-width: 100%; border-radius: var(--r-lg); background: rgba(17, 19, 44, 0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.connect-card .k { color: var(--text-3); font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.connect-card .v { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.connect-card strong { font: 600 17px/1.3 var(--mono); overflow-wrap: anywhere; }
.connect-card.is-empty strong { font-family: var(--font); color: var(--text-3); font-size: 15px; }
.connect-card .more { color: var(--violet-2); font-size: 12.5px; font-weight: 700; }
.feats { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(7, 8, 26, 0.55); border: 1px solid var(--line-2); color: var(--text-2); font-size: 12.5px; font-weight: 650; backdrop-filter: blur(6px); }
.tag svg { width: 12px; height: 12px; color: var(--ok); }

/* ---------- Console: dock + tabs ---------- */
.console { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "main dock"; gap: 28px; align-items: start; }
.dock { grid-area: dock; position: sticky; top: calc(var(--top-h) + 20px); }
.console-main { grid-area: main; min-width: 0; }
.dock-card { border-radius: var(--r-xl); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); overflow: hidden; }
.dock-live { display: grid; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stat .k { color: var(--text-3); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.stat strong { font: 650 17px/1.25 var(--display); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dock-live .s { color: var(--text-4); font-size: 12px; margin-top: -8px; }
.spark { width: 100%; height: 40px; }
.spark .base { stroke: var(--line-2); stroke-width: 1; }
.spark .area { fill: url(#spark-fill); }
.spark .line { fill: none; stroke: var(--ember); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.controls .inline-form { display: block; }
.controls .inline-form.wide { grid-column: 1 / -1; }
.controls .ctl { width: 100%; }
.controls form:first-child { grid-column: 1 / -1; }
.ctl.start { min-height: 48px; font-size: 15px; }
.dock-links { display: grid; padding: 8px; }
.dock-links a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r); color: var(--text-2); font-weight: 650; font-size: 14px; }
.dock-links a svg { width: 18px; height: 18px; color: var(--text-3); }
.dock-links a:hover { background: var(--surface-3); color: var(--text); }
.dock-links a.danger { color: #ff8fa2; }
.dock-links a.danger svg { color: currentColor; }
.dock-links a.danger:hover { background: var(--bad-wash); }

.tabs { position: sticky; top: var(--top-h); z-index: 5; display: flex; gap: 4px; margin-bottom: 22px; padding: 10px 0 0; background: linear-gradient(180deg, var(--bg) 80%, transparent); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { --b-bg: transparent; --b-fg: var(--text-3); min-height: 44px; padding: 0 14px; border-radius: 0; box-shadow: none; font-size: 14.5px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; flex: none; }
.tabs [role="tab"]:hover { --b-fg: var(--text); filter: none; }
.tabs [role="tab"][aria-selected="true"] { --b-fg: var(--text); border-bottom-color: var(--ember); }
.tab-panel { display: grid; gap: 20px; outline: none; }
.tab-panel + .tab-panel { margin-top: 36px; }
.tabs-ready .tab-panel + .tab-panel { margin-top: 0; }
.panel-title { font-size: 22px; }
.tabs-ready .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.address-list { display: grid; }
.address { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; }
.address + .address { border-top: 1px solid var(--line); }
.address .k { color: var(--text-3); font-size: 13px; font-weight: 700; }
.address code { font-size: 15px; color: var(--text); }
.port-grid { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 18px 20px 20px; }
.port { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); }
.port span { color: var(--text-3); font-size: 12.5px; font-weight: 650; }
.port strong { font: 650 18px var(--mono); overflow-wrap: anywhere; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool { display: grid; gap: 6px; align-content: start; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease), background .2s; }
.tool:hover { border-color: rgba(255, 106, 61, 0.45); background: linear-gradient(160deg, var(--ember-wash), transparent 60%), var(--surface); transform: translateY(-2px); }
.tool .ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ember-2); margin-bottom: 6px; }
.tool .ic svg { width: 20px; height: 20px; }
.tool strong { font-family: var(--display); font-size: 16.5px; }
.tool > span:not(.ic):not(.go) { color: var(--text-3); font-size: 13.5px; }
.tool .go { margin-top: 6px; color: var(--ember-2); font-weight: 750; font-size: 13.5px; }
.kv { display: grid; }
.kv > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; padding: 12px 20px; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { color: var(--text-3); font-size: 13.5px; font-weight: 650; }
.kv dd { font-size: 14px; overflow-wrap: anywhere; }
.secret { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; }
.secret svg { width: 14px; height: 14px; }
/* Metadata maps: nested settings listed one level deep, secrets masked. */
.meta-map { display: grid; gap: 4px; }
.meta-map.nested { margin: 3px 0 5px 2px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.mm-row { display: block; overflow-wrap: anywhere; }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-item p { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.danger-zone { border-color: var(--bad-line); background: linear-gradient(180deg, rgba(255, 84, 112, 0.06), transparent 50%), var(--surface); }
.danger-zone .panel-head { border-color: rgba(255, 84, 112, 0.18); }
.danger-zone .panel-head h2, .danger-zone .panel-head h3 { color: #ffb3c0; }

/* Access */
.people { display: grid; }
.person-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; min-width: 0; }
.person-row + .person-row { border-top: 1px solid var(--line); }
.person-row .who { flex: 1; }
.person-row.owner .avatar { background: var(--grad); color: var(--on-grad); }
.person-row.empty-row { padding-left: 64px; }
.role-tag { padding: 3px 9px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.role-tag.owner { background: var(--ember-wash); color: var(--ember-2); }
.manager-add { padding: 18px 20px 20px; border-top: 1px solid var(--line); background: rgba(7, 8, 26, 0.35); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.manager-add label { margin-bottom: 2px; font-size: 15px; font-family: var(--display); }
.manager-add .helptext { margin: 0 0 12px; }
.manager-add-row { display: flex; gap: 10px; }
.manager-add-row input { flex: 1; }
.manager-add .errorlist.nonfield { margin: 0 0 12px; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.role { padding: 16px 20px; background: var(--surface); }
.role strong { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 15px; }
.role strong::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--violet); }
.role.owner strong::before { background: var(--ember); }
.role.admin strong::before { background: var(--info); }
.role p { color: var(--text-3); font-size: 13.5px; margin-top: 4px; }

/* ---------- Dialogs ---------- */
dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(4, 4, 14, 0.72); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .2s var(--ease); }
.dialog-body { display: grid; gap: 10px; padding: 24px 24px 18px; }
.dialog-body h2 { font-size: 21px; }
.dialog-body p { color: var(--text-2); font-size: 14px; }
.dialog-body label { margin: 8px 0 0; }
.dialog-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--violet-wash); color: var(--violet-2); }
.dialog-icon.danger { background: var(--bad-wash); color: var(--bad); }
.dialog-icon svg { width: 22px; height: 22px; }
.char-count { justify-self: end; color: var(--text-4); font-size: 12px; }
.dialog-error { color: #ff8fa2; font-size: 13px; font-weight: 600; }
.ack { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.ack input { margin-top: 3px; accent-color: var(--bad); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: rgba(7, 8, 26, 0.35); }

/* ---------- Sub-page hero ---------- */
.subhero { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.subhero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, transparent 30%, var(--ember-wash)); }
.subhero-art { width: 96px; height: 96px; border-radius: 16px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8); }
.subhero-body { display: grid; gap: 6px; min-width: 0; }
.subhero h1 { font-size: clamp(24px, 3vw, 34px); overflow-wrap: anywhere; }

/* ---------- Catalog ---------- */
.catalog-head { gap: 14px; }
.stepper { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); font-size: 13px; font-weight: 700; }
.stepper b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: 11.5px; }
.stepper .current { color: var(--text); border-color: rgba(255, 106, 61, 0.45); background: var(--ember-wash); }
.stepper .current b { background: var(--grad); color: var(--on-grad); }
.catalog-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { --b-bg: var(--surface); --b-fg: var(--text-2); --b-line: var(--line-2); min-height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; box-shadow: none; }
.chip:hover { --b-line: var(--line-3); filter: none; }
.chip[aria-pressed="true"] { --b-bg: var(--text); --b-fg: var(--bg); --b-line: transparent; }
.chip .count { background: transparent; color: inherit; opacity: .6; padding: 0; min-width: 0; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.game-tile { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-height: 400px; height: 100%; padding: 64px 20px 20px; border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s, border-color .2s; }
.game-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 8, 26, 0.1) 20%, rgba(7, 8, 26, 0.6) 55%, rgba(7, 8, 26, 0.96) 100%); }
.game-tile > img { transition: transform .7s var(--ease); }
.game-tile:hover { transform: translateY(-4px); border-color: rgba(255, 106, 61, 0.55); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 106, 61, 0.25); }
.game-tile:hover > img { transform: scale(1.06); }
.game-tile .top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; }
.game-tile .cat { padding: 4px 10px; border-radius: 999px; background: rgba(7, 8, 26, 0.65); backdrop-filter: blur(8px); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.game-tile h3 { font-size: 23px; line-height: 1.05; }
.game-tile p { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.game-tile .feats .tag { font-size: 11.5px; padding: 3px 9px; }
.game-tile .feats .tag:nth-child(n+3) { display: none; }
.catalog > li { display: flex; flex-direction: column; }
.catalog > li > .game-tile { flex: 1; }
.game-tile .go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; min-height: 40px; border-radius: var(--r); background: rgba(243, 241, 255, 0.1); border: 1px solid var(--line-3); font-weight: 750; font-size: 13.5px; transition: background .2s, color .2s; }
.game-tile .go svg { width: 15px; height: 15px; }
.game-tile:hover .go { background: var(--grad); color: var(--on-grad); border-color: transparent; }
.picker-fallback { max-width: 460px; }

/* ---------- Wizard ---------- */
.hero.chosen { min-height: 320px; }
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "nav nav" "steps rail"; gap: 24px 28px; align-items: start; }
.wizard-steps { grid-area: nav; position: sticky; top: var(--top-h); z-index: 6; padding: 12px 0; background: linear-gradient(180deg, var(--bg) 75%, transparent); }
.wizard-steps .rail-steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.wizard-steps .rail-steps li { flex: 1 1 0; min-width: 150px; }
.wizard-steps .rail-steps a { position: relative; display: flex; align-items: center; gap: 10px; height: 100%; padding: 10px 14px 13px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--text-3); font-weight: 700; font-size: 13.5px; }
.wizard-steps .rail-steps a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 3px; border-radius: 3px; background: var(--surface-4); }
.rail-steps .n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font: 700 12px var(--display); }
.rail-steps .sub { display: block; color: var(--text-4); font-size: 12px; font-weight: 600; }
.rail-steps .flag { display: none; }
.rail-steps a[aria-current] { color: var(--text); border-color: rgba(255, 106, 61, 0.5); background: linear-gradient(180deg, var(--ember-wash), transparent), var(--surface); }
.rail-steps a[aria-current]::after { background: var(--grad); }
.rail-steps a[aria-current] .n { background: var(--grad); color: var(--on-grad); }
.rail-steps .is-done a { color: var(--text-2); }
.rail-steps .is-done a::after { background: var(--ok); opacity: .7; }
.rail-steps .is-done .n { background: var(--ok-wash); color: var(--ok); }
.rail-steps .is-error a { border-color: var(--bad-line); }
.rail-steps .is-error a::after { background: var(--bad); }
.rail-steps .is-error .n { background: var(--bad-wash); color: var(--bad); }
.wizard > *, .settings-layout > *, .console > * { min-width: 0; }
.wizard-steps { min-width: 0; overflow: hidden; }
.wizard .steps { grid-area: steps; display: grid; gap: 20px; min-width: 0; }
.wizard .rail { grid-area: rail; position: sticky; top: calc(var(--top-h) + 90px); display: grid; gap: 14px; }
.step-card { border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.step-head { display: flex; gap: 16px; padding: 22px 24px 4px; }
.step-head .n { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--grad); color: var(--on-grad); font: 700 15px var(--display); }
.step-copy h2 { font-size: 21px; outline: none; }
.step-copy p { color: var(--text-3); font-size: 14px; margin-top: 3px; }
.step-body { padding: 20px 24px 24px; }
.step-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.grow { flex: 1; }
.progress { color: var(--text-4); font-size: 12.5px; font-weight: 700; }
.wizard:not(.is-enhanced) .step-foot [data-wizard-nav], .wizard:not(.is-enhanced) .progress { display: none; }
.review { display: grid; gap: 14px; }
.review-group { border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.review-group h3 { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--surface-2); font-size: 14.5px; }
.review-group h3 button { --b-bg: transparent; --b-fg: var(--violet-2); min-height: 28px; padding: 0 10px; font-size: 13px; box-shadow: none; }
.review-group dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.review-group dt { color: var(--text-3); font-weight: 600; }
.review-group dd { overflow-wrap: anywhere; font-weight: 650; }
.review-group dd.unset { color: var(--text-4); font-weight: 500; }

.rail-card { display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.rail-card h3 { font-size: 14.5px; }
.rail-card ul, .rail-card ol { display: grid; gap: 9px; }
.rail-card li { display: flex; gap: 9px; color: var(--text-2); font-size: 13.5px; }
.rail-card li svg { width: 15px; height: 15px; margin-top: 3px; color: var(--ember-2); }
.rail-card ol { counter-reset: s; }
.rail-card ol li::before { counter-increment: s; content: counter(s); flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.req-list > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.req-list > div + div { border-top: 1px solid var(--line); }
.req-list dt { color: var(--text-3); }
.req-list dd { font-weight: 700; text-align: right; }
.links { display: grid; gap: 4px; }
.links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--violet-2); font-weight: 650; font-size: 13.5px; }
.links a:hover { background: var(--surface-2); }
.links svg { width: 13px; height: 13px; }

/* ---------- Settings ---------- */
.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail.index { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 14px; }
.rail.index .rail-steps { display: grid; gap: 2px; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.rail.index .rail-steps a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); color: var(--text-2); font-weight: 700; font-size: 13.5px; }
.rail.index .rail-steps a:hover { background: var(--surface-2); }
.rail.index .rail-steps a[aria-current] { background: var(--surface-3); }
.settings-layout .steps { display: grid; gap: 20px; min-width: 0; }
.savebar { position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-radius: var(--r-lg); background: rgba(23, 26, 56, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.savebar[data-dirty="true"] { border-color: rgba(255, 106, 61, 0.55); }
.savebar[data-dirty="true"] [data-dirty-note] { color: var(--ember-2); font-weight: 700; }

/* ---------- Split layouts, mods, editors ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.split.left { grid-template-columns: 280px minmax(0, 1fr); }
.split > div, .split > section { min-width: 0; }
.split > div:first-child { display: grid; gap: 18px; align-content: start; }
.sticky-col { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 16px; }
.page-stack { display: grid; gap: 18px; }
.lib-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--ember-2); }
.lib-ic svg { width: 16px; height: 16px; }
.file-list { display: grid; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 20px; border-left: 3px solid transparent; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.file-row.is-on { border-left-color: var(--ok); }
.file-main { display: grid; gap: 3px; min-width: 0; }
.file-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-3); font-size: 12.5px; min-width: 0; }
.file-meta code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }
.file-actions { display: flex; gap: 6px; }
.cfg { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.file-nav { display: grid; gap: 2px; padding: 10px; align-content: start; }
.cfg .file-nav { border-right: 1px solid var(--line); }
.file-nav a { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.file-nav a svg { width: 15px; height: 15px; margin-top: 1px; }
.file-nav a:hover { background: var(--surface-2); }
.file-nav a[aria-current] { background: var(--surface-3); color: var(--text); box-shadow: inset 3px 0 0 var(--ember); }
.file-nav .fn { display: block; font-weight: 700; }
.file-nav .fp { display: block; color: var(--text-4); font-size: 11.5px; }
.file-nav-empty { padding: 10px 12px; font-size: 13px; }
.cfg-edit { padding: 20px; display: grid; gap: 14px; min-width: 0; }
.editor { border-radius: var(--r-lg); border: 1px solid var(--line-2); background: #05061a; overflow: hidden; }
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-family: var(--mono); }
.editor-bar .file { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-bar svg { width: 14px; height: 14px; }
.editor textarea { min-height: 420px; border: 0; border-radius: 0; background: transparent; font: 13px/1.65 var(--mono); padding: 14px 16px; tab-size: 2; box-shadow: none !important; }
.editor.short textarea { min-height: 260px; }

/* ---------- Minecraft guide ---------- */
.guide { border-radius: var(--r-xl); border: 1px solid var(--line-2); background: linear-gradient(135deg, rgba(165, 148, 255, 0.08), transparent 50%), var(--surface); }
.guide > summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.guide > summary::-webkit-details-marker { display: none; }
.guide-ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--violet-wash); color: var(--violet-2); }
.guide-ic svg { width: 21px; height: 21px; }
.guide-title { flex: 1; display: grid; min-width: 0; }
.guide-title strong { font-family: var(--display); font-size: 16.5px; }
.guide-title span { color: var(--text-3); font-size: 13.5px; }
.guide-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-2); font-weight: 750; font-size: 13.5px; }
.guide-toggle svg { width: 14px; height: 14px; transition: transform .2s; }
.guide[open] .guide-toggle svg { transform: rotate(180deg); }
.guide .when-open, .guide[open] .when-closed { display: none; }
.guide[open] .when-open { display: inline; }
.guide-body { display: grid; gap: 16px; padding: 4px 20px 22px; border-top: 1px solid var(--line); }
.guide-h { margin-top: 14px; font-size: 15px; color: var(--violet-2); }
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.route { position: relative; display: grid; gap: 8px; align-content: start; padding: 16px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.route strong { color: var(--text); font-family: var(--display); font-size: 15.5px; }
.route.best { border-color: rgba(255, 106, 61, 0.45); background: linear-gradient(160deg, var(--ember-wash), transparent 60%), var(--bg-2); }
.route-n { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: var(--on-grad); font-weight: 800; font-size: 12px; }
.route-tag { justify-self: start; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.route.best .route-tag { background: var(--grad); color: var(--on-grad); }
.mini-steps { display: grid; gap: 6px; counter-reset: m; }
.mini-steps li { position: relative; padding-left: 26px; }
.mini-steps li::before { counter-increment: m; content: counter(m); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: 10.5px; font-weight: 800; color: var(--text-2); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.guide-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.guide-card h4 { font-family: var(--display); font-size: 15px; color: var(--text); }
.guide-card p + p { margin-top: 2px; }
.ticks { display: grid; gap: 7px; }
.ticks li { position: relative; padding-left: 20px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 9px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.guide-note { padding: 9px 12px; border-radius: var(--r); background: var(--violet-wash); color: var(--violet-2); font-size: 13px; }
.java-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.java-table th, .java-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.java-table th { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.fixes { display: grid; gap: 10px; }
.fixes dt { font-weight: 750; color: var(--text); }
.fixes dd { color: var(--text-3); }
.fixes-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; }
.guide-mini > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.guide-mini > summary::-webkit-details-marker { display: none; }
.guide-mini > summary > span:nth-child(2) { flex: 1; display: grid; }
.guide-mini > summary strong { font-family: var(--display); font-size: 14.5px; }
.guide-mini > summary span span { color: var(--text-3); font-size: 12.5px; }
.guide-mini .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform .2s; }
.guide-mini[open] .chev { transform: rotate(180deg); }
.gm-ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--violet-wash); color: var(--violet-2); }
.gm-ic svg { width: 17px; height: 17px; }
.gm-body { display: grid; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.gm-steps { display: grid; gap: 6px; counter-reset: g; }
.gm-steps li { position: relative; padding-left: 26px; display: block; }
.gm-steps li::before { counter-increment: g; content: counter(g); position: absolute; left: 0; top: 0; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: 10.5px; font-weight: 800; }
.gm-java > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.gm-java dt { color: var(--text-3); }
.gm-java dd { font-weight: 700; }
.gm-note { color: var(--text-3); font-size: 12.5px; }

/* ---------- Users ---------- */
.users-split { grid-template-columns: minmax(0, 1fr) 380px; }
.lookup-row { display: flex; gap: 10px; }
.lookup-row input { flex: 1; }
.lookup .helptext { margin-top: 10px; }
.people.result { border-top: 1px solid var(--line); }
.people.result .person-row { flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px 20px; text-align: left; color: var(--text-4); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - 40px); display: grid; grid-template-columns: minmax(380px, 520px) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; padding: 32px clamp(24px, 5vw, 64px); outline: none; background: var(--bg); position: relative; z-index: 2; box-shadow: 30px 0 80px -20px rgba(0, 0, 0, .8); }
.auth-top { margin-bottom: auto; }
.auth-card { display: grid; gap: 14px; margin: 48px 0; }
.auth-card h1 { font-size: 36px; letter-spacing: -0.035em; }
.auth-card form { display: grid; gap: 16px; margin-top: 8px; }
.auth-card .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.auth-card .lede { font-size: 15.5px; }
.lede.error { color: #ff9eb0; }
.auth-status { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--grad); color: var(--on-grad); box-shadow: 0 16px 40px -14px rgba(255, 77, 141, .8); }
.auth-status.err { background: var(--bad); color: #22020a; }
.auth-status svg { width: 26px; height: 26px; }
.auth-bottom { margin-top: auto; }
.auth-foot { color: var(--text-3); font-size: 13.5px; }
.auth-foot a { color: var(--violet-2); font-weight: 700; }
.auth-art { position: relative; overflow: hidden; isolation: isolate; background: var(--bg-2); }
.poster-wall { position: absolute; inset: -12% -8%; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 44%; gap: 18px; transform: rotate(-8deg); z-index: -1; }
.poster-wall .art { border-radius: 22px; box-shadow: var(--shadow-lg); }
.poster-wall .p2, .poster-wall .p5 { transform: translateY(14%); }
.auth-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--bg) 0%, rgba(7, 8, 26, 0.35) 25%, rgba(7, 8, 26, 0.05) 60%, rgba(7, 8, 26, 0.5) 100%), linear-gradient(0deg, rgba(7, 8, 26, 0.92) 0%, transparent 50%); }
.auth-pitch { position: absolute; left: clamp(28px, 5vw, 72px); right: 32px; bottom: clamp(28px, 6vh, 64px); display: grid; gap: 12px; max-width: 560px; }
.auth-pitch p { font: 700 clamp(34px, 4vw, 54px)/1.02 var(--display); letter-spacing: -0.04em; }
.auth-pitch em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch > span:last-child { color: var(--text-2); font-size: 15.5px; max-width: 46ch; }

/* ---------- Error + empty hero ---------- */
.error-state { margin: 6vh auto 0; max-width: 620px; padding: 56px 28px; border-style: solid; border-color: var(--line); background: radial-gradient(500px 220px at 50% 0%, rgba(255, 106, 61, 0.12), transparent 70%), var(--surface); }
.err-code { font: 700 96px/1 var(--display); letter-spacing: -0.06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-state .actions { margin-top: 8px; }
.hero-state { padding: 40px 24px 52px; border-style: solid; border-color: var(--line); background: var(--surface); }
.state-art { display: flex; justify-content: center; margin-bottom: 18px; }
.state-art .art { width: 120px; aspect-ratio: 3 / 4; border-radius: 16px; box-shadow: var(--shadow-lg); border: 3px solid var(--surface); }
.state-art .art:nth-child(1) { transform: rotate(-8deg) translateX(18px); }
.state-art .art:nth-child(2) { z-index: 1; transform: translateY(-10px); }
.state-art .art:nth-child(3) { transform: rotate(8deg) translateX(-18px); }

/* ---------- Motion ---------- */
@keyframes pulse { 50% { opacity: .35; } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(182, 243, 106, .55); } 80%, 100% { box-shadow: 0 0 0 6px rgba(182, 243, 106, 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .deck { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(200px, 1.6fr); }
  .list-head, .cards.is-list .card { grid-template-columns: minmax(220px, 2fr) 120px minmax(180px, 1.5fr) 90px 140px; }
  .list-head span:nth-child(5), .cards.is-list .card-stat.ver { display: none; }
  .cards.is-list .card { grid-template-areas: "id status addr mem act"; }
}
@media (max-width: 1100px) {
  .console { grid-template-columns: minmax(0, 1fr); grid-template-areas: "dock" "main"; }
  .dock { position: static; }
  .dock-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .dock-live { border-bottom: 0; border-right: 1px solid var(--line); grid-row: span 2; }
  .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .controls form:first-child { grid-column: auto; }
  .dock-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "steps" "rail"; }
  .wizard .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
  .split, .users-split, .split.left { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-main { box-shadow: none; max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 960px) {
  .primary-nav:not(.stacked) { display: none; }
  .mnav { display: block; }
  .account { display: none; }
  .list-head { display: none !important; }
  .cards.is-list .card { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "addr addr" "mem act"; row-gap: 10px; padding: 14px 16px; }
  .cards.is-list .card-art { top: 14px; transform: none; left: 16px; width: 52px; height: 52px; }
  .cards.is-list .card-id { padding-left: 66px; min-height: 52px; }
  .cards.is-list .card-stat.mem { align-self: center; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .rail.index { position: static; }
  .rail.index .rail-steps { display: flex; overflow-x: auto; }
  .rail.index .rail-steps li { flex: none; }
  .cfg { grid-template-columns: 1fr; }
  .cfg .file-nav { border-right: 0; border-bottom: 1px solid var(--line); }
  .role-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --top-h: 58px; }
  .page { padding-top: 22px; }
  .hero { margin-top: -22px; min-height: 300px; }
  .hero-row { flex-direction: column; align-items: stretch; }
  .connect-card { min-width: 0; }
  .kpis, .kpis.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); width: auto; }
  .kpi.mem { grid-column: 1 / -1; }
  .kpis.compact .kpi:last-child { grid-column: 1 / -1; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .filters { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .views { margin-left: auto; }
  .views span { display: none; }
  .dock-card { display: block; }
  .dock-live { border-right: 0; border-bottom: 1px solid var(--line); }
  .controls { grid-template-columns: 1fr 1fr; }
  .controls form:first-child { grid-column: 1 / -1; }
  .dock-links { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .address { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; row-gap: 2px; }
  .address .k { grid-column: 1 / -1; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; padding: 11px 16px; }
  .subhero { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .subhero-art { width: 64px; height: 64px; border-radius: 12px; }
  .subhero-back { grid-column: 1 / -1; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; }
  .file-actions { grid-column: 1 / -1; }
  .row-item { flex-direction: column; align-items: flex-start; }
  .manager-add-row, .lookup-row { flex-direction: column; }
  .notice { flex-wrap: wrap; }
  .notice > .button { margin-left: 34px; }
  .step-head, .step-body { padding-left: 18px; padding-right: 18px; }
  .step-foot { padding: 14px 18px; flex-wrap: wrap; }
  .table thead { display: none; }
  .table tr { display: grid; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 0; border: 0; }
  .table td[data-label]::before { content: attr(data-label) " · "; color: var(--text-4); font-size: 12px; }
  .savebar { flex-wrap: wrap; }
  .catalog { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .game-tile { padding: 56px 14px 14px; min-height: 250px; }
  .game-tile h3 { font-size: 18px; }
  .game-tile p, .game-tile .feats { display: none; }
  .wizard-steps .rail-steps li { min-width: 130px; }
  .rail-steps .sub { display: none; }
}
@media (max-width: 480px) {
  .brand-copy { display: none; }
  .new-btn .new-label { display: none; }
  .new-btn { width: 34px; padding: 0; }
  .cards { grid-template-columns: 1fr; }
  .display { font-size: 32px; }
  .seg button { padding: 0 10px; }
  .auth-card h1 { font-size: 30px; }
  .person-row { flex-wrap: wrap; }
  .person-row .inline-form { margin-left: 44px; }
}

/* ---------- Users & invites: account rows (scoped; server Access rows keep .person-row) ---------- */
.account-row { flex-wrap: nowrap; }
.account-row .who { min-width: 0; }
.account-row .who strong, .account-row .who > span { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.account-row .acct-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: none; }
.account-row .inline-form { flex: none; margin: 0; }
@media (max-width: 720px) {
  .account-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "av who" ". tags" ". act"; align-items: start; gap: 8px 12px; padding: 16px; }
  .account-row .avatar { grid-area: av; width: 40px; height: 40px; }
  .account-row .who { grid-area: who; }
  .account-row .acct-tags { grid-area: tags; }
  .account-row .inline-form { grid-area: act; margin: 4px 0 0; }
  .account-row .inline-form button { min-height: 40px; }
}

/* ---------- Zomboid console (read-only) ---------- */
.console-panel .panel-head { border-bottom: 0; }
.console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.console-state { flex: 1 1 220px; min-width: 0; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.console-updated { color: var(--text-4); font: 600 12.5px var(--display); font-variant-numeric: tabular-nums; }
.console-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.console-follow { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 4px; color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.console-follow input { width: 16px; height: 16px; accent-color: var(--ember); }
.console-note { margin: 0; padding: 8px 20px; background: var(--busy-wash); color: #ffe4a8; font-size: 13px; font-weight: 600; }
.console-note[hidden] { display: none; }
.console-out { margin: 0; padding: 14px 20px; max-height: min(68vh, 620px); min-height: 180px; overflow: auto; background: var(--bg); color: #d7d3f5; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; tab-size: 4; border-radius: 0 0 var(--r-lg) var(--r-lg); overscroll-behavior: contain; }
.console-out:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.console-empty { display: grid; place-items: center; min-height: 180px; padding: 24px 20px; color: var(--text-3); text-align: center; background: var(--bg); }
.console-empty[hidden] { display: none; }
.console-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .console-bar, .console-actions { padding-left: 16px; padding-right: 16px; }
  .console-out { padding: 12px 16px; font-size: 12px; max-height: 60vh; }
  .console-tools { width: 100%; }
}

/* ---------- Plans, billing, RAM (4.1) ---------- */
.bill-bars:empty { display: none; }
.bill-bars { display: grid; gap: 10px; max-width: var(--content); width: 100%; margin: 16px auto 0; padding: 0 var(--gutter); }
.bill-bars > .notice + .notice { margin-top: 0; }
.notice.info { border-color: rgba(111, 211, 255, 0.3); background: linear-gradient(90deg, var(--info-wash), transparent 60%), var(--surface); } .notice.info > svg, .notice.gate > svg { color: var(--info); }
.notice .note-dismiss { margin: 0; align-self: center; }
.chip-free { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--ok-wash); color: var(--ok); font: 750 12px var(--font); border: 1px solid rgba(182, 243, 106, 0.3); }
.muted.small { font-size: 13px; }

.ram-pill { --s: var(--busy); display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--s) 40%, transparent); background: color-mix(in srgb, var(--s) 13%, transparent); color: var(--s); font: 750 12.5px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ram-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ram-pill.state-critical, .ram-pill.state-over { --s: var(--bad); }
.ram-pill:hover { filter: brightness(1.12); }
@media (max-width: 560px) { .ram-pill { display: none; } }

.ram-meter { --s: var(--ok); display: grid; gap: 9px; min-width: 0; }
.ram-meter.state-warn { --s: var(--busy); } .ram-meter.state-critical, .ram-meter.state-over { --s: var(--bad); }
.ram-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ram-k { color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ram-v { font: 600 14px var(--display); color: var(--text-2); font-variant-numeric: tabular-nums; }
.ram-v b { font-size: 22px; color: var(--text); letter-spacing: -0.02em; }
.ram-bar { height: 10px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.ram-bar span { display: block; height: 100%; border-radius: inherit; background: var(--s); transition: width .5s var(--ease); }
.ram-sub { margin: 0; color: var(--text-3); font-size: 13px; }
.ram-meter.state-warn .ram-sub, .ram-meter.state-critical .ram-sub, .ram-meter.state-over .ram-sub { color: var(--text-2); }
.ram-sub a { color: var(--violet-2); font-weight: 700; margin-left: 4px; }
.ram-meter.compact { grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 6px 16px; padding: 12px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.ram-meter.compact .ram-sub { grid-column: 1 / -1; }
.ram-meter.compact .ram-v b { font-size: 17px; }
.ram-strip { margin-bottom: -8px; }
@media (max-width: 560px) { .ram-meter.compact { grid-template-columns: 1fr; } }

.upgrade-prompt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid rgba(165, 148, 255, 0.3); background: linear-gradient(90deg, var(--violet-wash), transparent 70%), var(--surface); }
.upgrade-prompt .state-ic { margin: 0; }
.upgrade-prompt h2 { font-size: 17px; }
.upgrade-prompt p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
@media (max-width: 640px) { .upgrade-prompt { grid-template-columns: 1fr; justify-items: start; } }

.ram-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ram-input input { max-width: 180px; font-variant-numeric: tabular-nums; }
.ram-unit { color: var(--text-3); font-weight: 700; font-size: 13px; margin-left: -6px; }
.ram-readout { color: var(--text-2); font: 650 14px var(--display); }
.ram-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ram-presets .chip[disabled] { opacity: .45; }
.ram-fit { margin: 10px 0 0; padding: 9px 12px; border-radius: var(--r); font-size: 13.5px; font-weight: 600; background: var(--busy-wash); color: #ffe4a8; }
.ram-fit.bad { background: var(--bad-wash); color: #ffb3c0; }
.ram-fit[hidden] { display: none; }

.start-locked { display: block; }
.controls .start-locked { grid-column: 1 / -1; }
.ctl.start.locked { width: 100%; --b-bg: var(--surface-3); --b-fg: var(--text); --b-line: var(--line-2); box-shadow: none; }
.ctl.start.locked svg { width: 17px; height: 17px; }

.public-bar .topbar-in { gap: 16px; }
.plans-head { max-width: 70ch; }
.price-note { display: inline-flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--busy-wash); color: #ffe4a8; font-size: 13.5px; font-weight: 600; width: fit-content; max-width: 100%; }
.price-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 12px; padding: 22px; border-radius: var(--r-xl); border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), rgba(17, 19, 44, 0.85)); box-shadow: var(--shadow); min-width: 0; }
.plan.current { border-color: rgba(182, 243, 106, 0.4); }
.plan-flag { position: absolute; top: 16px; right: 16px; padding: 3px 10px; border-radius: 999px; background: var(--ok-wash); color: var(--ok); font-size: 11.5px; font-weight: 750; }
.plan h2 { font-size: 20px; }
.plan-name { font: 700 22px var(--display); margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.plan-price b { font: 700 36px/1 var(--display); letter-spacing: -0.03em; }
.plan-price small { color: var(--text-3); font-weight: 650; font-size: 14px; }
.plan-ram { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--text-2); }
.plan-ram svg { flex: none; width: 20px; height: 20px; color: var(--ember-2); }
.plan-ram b { color: var(--text); }
.plan-feats { display: grid; gap: 8px; align-content: start; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.plan-feats li { display: flex; gap: 8px; }
.plan-feats svg { flex: none; width: 14px; height: 14px; margin-top: 4px; color: var(--ok); }
.plan-cta form { display: block; margin: 0; }
.plan-cta .button, .plan-cta button { width: 100%; }
.plan-faq { display: grid; gap: 14px; }
.plan-faq h2 { font-size: 22px; }
.plan-faq dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 0; }
.plan-faq dl > div { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.plan-faq dt { font-weight: 750; margin-bottom: 4px; }
.plan-faq dd { margin: 0; color: var(--text-2); font-size: 14px; }
.plan-faq a { color: var(--violet-2); font-weight: 700; }

.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.bill-grid .panel-body { display: grid; gap: 12px; }
.bill-grid .form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bill-grid form { margin: 0; }

.auth-card .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.auth-card .fine { margin: 0; color: var(--text-3); font-size: 12.5px; }
.auth-card .muted { color: var(--text-3); font-size: 14px; }
.plan-flag.off { background: var(--busy-wash); color: var(--busy); }
.sub-line { margin: 0; padding: 9px 12px; border-radius: var(--r); background: var(--surface-3); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.sub-line.warn { background: var(--busy-wash); color: #ffe4a8; }
.sub-line.bad { background: var(--bad-wash); color: #ffb3c0; }
.start-note { margin: 8px 0 0; color: var(--text-3); font-size: 13px; }
