/* VPS4U2(TM) - site, portal and staff console styles. No external fonts or CDNs (CSP default-src 'self').
   Copyright (c) 2026 Spark Fire Technologies. All rights reserved. Proprietary and confidential. */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --surface-3: #e7ecf5;
  --border: #dde3ee;
  --border-strong: #c6cfdf;
  --text: #0e1626;
  --text-2: #34405a;
  --muted: #5d6882;
  --brand: #3d5afe;
  --brand-hover: #2f49e0;
  --brand-soft: #e8ecff;
  --brand-ink: #ffffff;
  --accent: #0f9d8f;
  --accent-soft: #dcf5f1;
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #a35a00; --warn-soft: #fff1d6;
  --danger: #c62828; --danger-soft: #fde2e2;
  --info: #1d5fd1; --info-soft: #e0ebff;
  --neutral: #4b5568; --neutral-soft: #e9edf3;
  --focus: #3d5afe;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 248px;
  --hero-a: #e9edff;
  --hero-b: #dff6f2;
  --code-bg: #0f172a;
  --code-text: #d7e0f2;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --bg-elev: #0f1626; --surface: #111a2c; --surface-2: #162036; --surface-3: #1c2842;
    --border: #233150; --border-strong: #31426a;
    --text: #e7ecf7; --text-2: #c3cce0; --muted: #93a0bd;
    --brand: #7088ff; --brand-hover: #889cff; --brand-soft: #1b2552; --brand-ink: #0a0f1c;
    --accent: #2dd4bf; --accent-soft: #0d3a37;
    --ok: #4ade80; --ok-soft: #0f2e1d; --warn: #fbbf24; --warn-soft: #3a2a08; --danger: #f87171; --danger-soft: #3d1414;
    --info: #7aa7ff; --info-soft: #13254a; --neutral: #aab4c8; --neutral-soft: #1f2a40;
    --focus: #8fa2ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    --hero-a: #141d3d; --hero-b: #0c2a2a; --code-bg: #060a14; --code-text: #d7e0f2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --bg-elev: #0f1626; --surface: #111a2c; --surface-2: #162036; --surface-3: #1c2842;
  --border: #233150; --border-strong: #31426a;
  --text: #e7ecf7; --text-2: #c3cce0; --muted: #93a0bd;
  --brand: #7088ff; --brand-hover: #889cff; --brand-soft: #1b2552; --brand-ink: #0a0f1c;
  --accent: #2dd4bf; --accent-soft: #0d3a37;
  --ok: #4ade80; --ok-soft: #0f2e1d; --warn: #fbbf24; --warn-soft: #3a2a08; --danger: #f87171; --danger-soft: #3d1414;
  --info: #7aa7ff; --info-soft: #13254a; --neutral: #aab4c8; --neutral-soft: #1f2a40;
  --focus: #8fa2ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  --hero-a: #141d3d; --hero-b: #0c2a2a; --code-bg: #060a14; --code-text: #d7e0f2;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); overflow-x: hidden; }
body.modal-open { overflow: hidden; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
code, pre, kbd { font-family: var(--mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; 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: -9999px; top: 8px; z-index: 1000; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.mt-1 { margin-top: .75rem; } .mt-2 { margin-top: 1.5rem; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }
.container-fluid { padding: 12px 16px 0; }
@media (min-width: 720px) { .container-fluid { padding: 16px 28px 0; } }
.noscript { max-width: 520px; margin: 15vh auto; padding: 24px; text-align: center; }

/* ---------------------------------------------------------------- icons, buttons */
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; border-radius: 50%; animation: spin .8s linear infinite; visibility: visible; }
.btn-primary.is-busy::after { border-color: #fff transparent #fff transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- badges, pills, notices */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); margin-left: .5rem; text-transform: uppercase; letter-spacing: .04em; }
.pill-staff { background: var(--warn-soft); color: var(--warn); }
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: .93rem; }
.notice > .icon { margin-top: 2px; }
.notice-title { display: block; margin-bottom: 2px; }
.notice-body { color: var(--text-2); }
.notice-body ul { margin: .35rem 0 0; }
.notice-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--info); }
.notice-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.notice-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.notice strong { color: inherit; }
.code-inline { font-family: var(--mono); font-size: .85em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.input-mono, .mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field label { font-weight: 600; font-size: .9rem; color: var(--text-2); }
.req { color: var(--danger); }
.hint { margin: 0; font-size: .82rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--border-strong); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .6rem; }
.field-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); }
.field-check label { font-weight: 500; color: var(--text); }
.field-check .hint { grid-column: 2; }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.inline-form .field { flex: 1 1 160px; }

/* ---------------------------------------------------------------- cards, tables, kv */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 1rem; margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card-body { padding: 16px; }
@media (min-width: 720px) { .card-head { padding: 16px 20px; } .card-body { padding: 20px; } }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text); display: block; }
.cell-sub { font-size: .82rem; color: var(--muted); display: block; word-break: break-all; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .6rem; padding: 6px 4px; background: var(--surface); }
  .table td { border: 0; padding: 6px 10px; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table td::before { content: attr(data-label); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; text-align: left; flex: none; }
  .table td.actions { justify-content: flex-end; }
  .table td.actions::before { content: none; }
  .table .num { text-align: right; }
}
.kv { margin: 0; display: grid; gap: 0; }
.kv-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .75rem; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; word-break: break-word; min-width: 0; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-title { font-weight: 700; color: var(--text-2); margin-bottom: .3rem; }
.loading { display: flex; align-items: center; gap: .6rem; padding: 24px 4px; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------------------------------------------------------------- stat tiles + meters */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; margin: .25rem 0 0; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .85rem; color: var(--muted); margin: 0; }
.meter + .meter { margin-top: .9rem; }
.meter-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; margin-bottom: .35rem; flex-wrap: wrap; }
.meter-bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--ok); width: 0; transition: width .4s; }
.meter-warn .meter-fill { background: var(--warn); }
.meter-danger .meter-fill { background: var(--danger); }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .5s; }

/* provisioning stepper */
.stepper { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .stepper { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .25rem; } .step { flex-direction: column; text-align: center; } }
.step { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); }
.step-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); font-weight: 700; font-size: .75rem; flex: none; }
.step-dot .icon { width: 14px; height: 14px; }
.step-done { color: var(--text-2); }
.step-done .step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-current { color: var(--text); font-weight: 700; }
.step-current .step-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); animation: pulse 1.6s ease-in-out infinite; }

/* tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; margin-bottom: 1rem; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel:focus-visible { outline-offset: 4px; }

/* ---------------------------------------------------------------- toasts + modal */
.toasts { position: fixed; z-index: 2000; right: 16px; bottom: 16px; left: 16px; display: grid; gap: .5rem; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .5rem; max-width: 420px; width: 100%; padding: 12px 12px 12px 14px; border-radius: 10px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg); animation: toastIn .2s ease-out; }
.toast-error { border-left-color: var(--danger); }
.toast-ok { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-msg { flex: 1; font-size: .92rem; }
.toast-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(5, 10, 20, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: toastIn .18s ease-out; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-head .icon-btn { width: 34px; height: 34px; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; padding: 14px 18px; border-top: 1px solid var(--border); }
.secret-box { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.secret { flex: 1 1 200px; font-family: var(--mono); font-size: .88rem; word-break: break-all; }

/* ---------------------------------------------------------------- public shell */
.pub-header { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.pub-header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo-dark { display: block; }
}
@media (max-width: 420px) { .brand-logo { height: 22px; } }
.pub-nav { display: none; }
.pub-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.nav-cta { display: none; gap: .5rem; }
.menu-btn { display: inline-grid; }
.pub-header.nav-open .pub-nav { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; box-shadow: var(--shadow); }
.pub-header.nav-open .pub-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
@media (min-width: 560px) { .nav-cta { display: flex; } }
@media (min-width: 960px) {
  .menu-btn { display: none; }
  .pub-nav { display: flex; gap: 1.4rem; margin-left: 1.5rem; }
  .pub-nav a { color: var(--text-2); font-weight: 600; font-size: .93rem; }
  .pub-nav a:hover, .pub-nav a[aria-current="page"] { color: var(--brand); text-decoration: none; }
  .pub-header.nav-open .pub-nav { position: static; flex-direction: row; padding: 0; box-shadow: none; border: 0; background: none; }
  .pub-header.nav-open .pub-nav a { padding: 0; border: 0; }
}
.pub-main { min-height: 60vh; }
.pub-main:focus, .app-main:focus, .auth-main:focus { outline: none; }
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); margin-top: 4rem; padding: 40px 0 20px; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }
.footer-brand p { max-width: 34ch; margin-top: .75rem; }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer a { color: var(--text-2); font-size: .93rem; }
.footer-legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }

/* hero + marketing */
.hero { position: relative; overflow: hidden; padding: 56px 0 48px; background: radial-gradient(1000px 420px at 10% -10%, var(--hero-a), transparent 70%), radial-gradient(800px 380px at 100% 0%, var(--hero-b), transparent 70%); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 960px) { .hero { padding: 88px 0 72px; } .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.07; margin-bottom: 1rem; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .45rem; color: var(--text-2); font-size: .95rem; }
.hero-points li { display: flex; gap: .5rem; align-items: center; }
.hero-points .icon { color: var(--ok); }
.terminal { background: var(--code-bg); color: var(--code-text); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; font-family: var(--mono); font-size: .82rem; min-width: 0; }
.terminal-bar { display: flex; gap: 6px; padding: 10px 12px; background: rgba(255, 255, 255, .04); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3b4560; }
.terminal pre { margin: 0; padding: 14px 16px 18px; overflow-x: auto; line-height: 1.6; white-space: pre; }
.t-dim { color: #7f8bab; } .t-ok { color: #4ade80; } .t-acc { color: #7dd3fc; } .t-warn { color: #fbbf24; }
.section { padding: 56px 0 8px; }
.section-head { max-width: 680px; margin-bottom: 1.75rem; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); letter-spacing: -0.02em; }
.section-head p { color: var(--text-2); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.feature h3 { font-size: 1.02rem; margin: .7rem 0 .4rem; }
.feature p { color: var(--text-2); font-size: .94rem; margin: 0; }
.feature-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.split { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 2.5rem; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; }
.checklist .icon { color: var(--accent); margin-top: 3px; }
.diagram { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-family: var(--mono); font-size: .82rem; overflow-x: auto; }
.diagram-row { display: flex; justify-content: space-between; gap: 1rem; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.diagram-row:last-child { border-bottom: 0; }
.diagram-row span:first-child { color: var(--muted); }
.status-card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 20px; box-shadow: var(--shadow); }
.status-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 22%, transparent); flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 22%, transparent); }
.status-dot.unknown { background: var(--neutral); box-shadow: none; }
.cta-band { margin-top: 56px; padding: 32px 20px; border-radius: 18px; background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--accent) 80%, var(--brand))); color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .88); }
.cta-band .form { max-width: 520px; }
.cta-band input { background: rgba(255, 255, 255, .96); color: #0e1626; border-color: transparent; }
.cta-band .btn-primary { background: #0e1626; color: #fff; }
.cta-band .hint, .cta-band label { color: rgba(255, 255, 255, .9); }
@media (min-width: 720px) { .cta-band { padding: 44px; } }
.waitlist-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.waitlist-form input { flex: 1 1 220px; }

/* pricing */
.plans { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plan { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: relative; }
.plan.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.plan-tag { position: absolute; top: -11px; left: 20px; background: var(--brand); color: var(--brand-ink); font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.plan h3 { font-size: 1.15rem; margin: 0; }
.plan-price { margin: .9rem 0 1rem; min-height: 3.2rem; }
.plan-price strong { font-size: 2rem; letter-spacing: -0.02em; }
.plan-price .pending { display: inline-block; font-weight: 700; color: var(--accent); font-size: 1rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .5rem; font-size: .93rem; color: var(--text-2); }
.plan li { display: flex; gap: .5rem; align-items: flex-start; }
.plan li .icon { color: var(--accent); width: 16px; height: 16px; margin-top: 3px; }
.plan .btn { margin-top: auto; }
.plan.selectable { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.plan.selectable[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }

/* legal */
.legal { max-width: 820px; padding-top: 40px; }
.legal h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--text-2); }
.legal li + li { margin-top: .35rem; }
.legal-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 1.5rem 0; }
.legal-toc ol { margin: .3rem 0 0; }
.narrow { max-width: 680px; padding-top: 40px; }

/* ---------------------------------------------------------------- auth shell */
.shell-auth { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 400px at 0% 0%, var(--hero-a), transparent 70%), radial-gradient(700px 400px at 100% 100%, var(--hero-b), transparent 70%), var(--bg); }
.auth-top { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.auth-main { flex: 1; display: grid; place-items: start center; padding: 16px 16px 40px; }
@media (min-width: 720px) { .auth-main { padding-top: 6vh; } }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
@media (min-width: 480px) { .auth-card { padding: 32px; } }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.25rem; }
.auth-alt { text-align: center; margin-top: 1.25rem; font-size: .92rem; color: var(--muted); }
.auth-foot { text-align: center; font-size: .82rem; color: var(--muted); padding: 16px; }
.auth-foot nav { display: flex; gap: 1rem; justify-content: center; margin-bottom: .4rem; }
.auth-foot a { color: var(--muted); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pw-meter > div { height: 100%; width: 0; transition: width .2s, background .2s; }

/* ---------------------------------------------------------------- app + staff shell */
.shell-app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 300; top: 0; bottom: 0; left: 0; width: var(--side-w); background: var(--bg-elev); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform .2s ease; }
.side-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.scrim { display: none; }
.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 250; background: rgba(5, 10, 20, .45); }
.side-top { display: flex; align-items: center; min-height: 64px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side-group + .side-group { margin-top: .75rem; }
.side-label { margin: .5rem 10px .25rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .92rem; }
.side-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.side-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.side-foot { font-size: .72rem; color: var(--muted); padding: 12px 16px; margin: 0; border-top: 1px solid var(--border); line-height: 1.4; }
.app-col { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 200; display: flex; align-items: center; gap: .6rem; min-height: 60px; padding: 0 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-left { min-width: 0; flex: 1; display: flex; align-items: center; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.topbar-title { font-weight: 700; white-space: nowrap; }
.org-switch { display: flex; align-items: center; gap: .4rem; min-width: 0; max-width: 100%; color: var(--muted); }
.org-select { min-height: 36px; padding: 4px 28px 4px 10px; max-width: 220px; font-size: .9rem; font-weight: 600; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: .5rem; background: none; border: 1px solid transparent; border-radius: 999px; padding: 3px 10px 3px 3px; font: inherit; color: var(--text); cursor: pointer; }
.user-btn:hover { background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 800; font-size: .9rem; }
.user-name { display: none; font-weight: 600; font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 720px) { .user-name { display: inline; } }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 400; }
.menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.app-main { padding: 18px 16px 48px; max-width: 1280px; }
@media (min-width: 720px) { .app-main { padding: 24px 28px 56px; } .topbar { padding: 0 20px; } }
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .app-col { margin-left: var(--side-w); }
  .shell-app .menu-btn { display: none; }
  .side-open .scrim { display: none; }
}
.shell-staff .sidebar { border-right-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.shell-staff .topbar { border-bottom-color: color-mix(in srgb, var(--warn) 30%, var(--border)); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.55rem; margin: 0; }
.page-title:focus { outline: none; }
.page-sub { margin: .3rem 0 0; color: var(--muted); max-width: 70ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
.async + .async, .async + .card, .card + .async { margin-top: 1rem; }
.banner-slot:empty { display: none; }

/* instance detail */
.inst-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.inst-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.console { background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 14px; font-family: var(--mono); font-size: .8rem; line-height: 1.5; max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline .when { font-size: .8rem; color: var(--muted); }
.addr { font-family: var(--mono); font-size: .88rem; word-break: break-all; }

/* wizard */
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.25rem; counter-reset: ws; }
.wizard-steps li { counter-increment: ws; display: flex; align-items: center; gap: .4rem; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 600; }
.wizard-steps li::before { content: counter(ws); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: .75rem; }
.wizard-steps li[aria-current="step"] { background: var(--brand-soft); color: var(--brand); }
.wizard-steps li[aria-current="step"]::before { background: var(--brand); color: var(--brand-ink); }
.wizard-steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.choice-list { display: grid; gap: .6rem; }
.choice { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.choice-title { font-weight: 700; display: block; }
.choice-sub { font-size: .85rem; color: var(--muted); display: block; word-break: break-all; }
.wizard-nav { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* QR */
.qr { width: 200px; height: 200px; display: block; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.mfa-setup { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 640px) { .mfa-setup { grid-template-columns: auto 1fr; } }

/* checklist (launch gate) */
.gate { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.gate li { display: flex; gap: .75rem; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.gate-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; font-weight: 800; }
.gate-pass .gate-mark { background: var(--ok-soft); color: var(--ok); }
.gate-fail .gate-mark { background: var(--danger-soft); color: var(--danger); }
.gate-warn .gate-mark { background: var(--warn-soft); color: var(--warn); }
.gate-unknown .gate-mark { background: var(--neutral-soft); color: var(--neutral); }
.gate-title { font-weight: 700; display: block; }
.gate-detail { font-size: .86rem; color: var(--muted); display: block; }

.ticket-thread { display: grid; gap: .75rem; }
.msg { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.msg-staff { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: var(--brand-soft); }
.msg-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { flex: 0 1 220px; }

/* ---------------------------------------------------------------- additions */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
legend.h2 { font-size: 1.2rem; font-weight: 700; padding: 0; margin-bottom: .75rem; color: var(--text); }
.plan h2 { font-size: 1.15rem; margin: 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .card-title::after { content: " +"; color: var(--muted); }
details.card[open] > summary .card-title::after { content: " −"; }
a.stat.quick { display: flex; flex-direction: column; align-items: flex-start; color: inherit; transition: border-color .15s, transform .15s; }
a.stat.quick:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.eyebrow + h1 { margin-top: 0; }
.grid > .card, .grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-top: 0; }
[tabindex="-1"]:focus { outline: none; }
