/*
 * Guest pages: sign-in, two-step verification (and the All-admin set-up), registration, error
 * pages, rate-deck approval and the public website (landing + pricing). Loaded after tokens.css,
 * fonts.css (and ui.css for the shared x-ui components) by resources/views/auth/layout.blade.php
 * and resources/views/errors/minimal.blade.php.
 *
 * The portal's language at a reading size: flat surfaces and 1px hairlines (no shadows), soft
 * radii, weight-600 headings with tight tracking, sentence-case labels, Geist Mono for every
 * figure, status as a dot plus a word, and the brand accent kept for primary actions, the
 * current item and focus. Light by default; a saved dark theme (localStorage, set in a portal)
 * re-points the same tokens. Values come from tokens.css only (DesignTokensTest).
 *
 *   g-*  shared guest pieces (type, forms, buttons, alerts, the sign-in split, slim pages,
 *        registration)
 *   m-*  public website (navigation, hero, sections, plans, FAQ, footer)
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.guest {
    margin: 0; min-height: 100vh; background: var(--ground); color: var(--text);
    font-family: var(--font-sans); font-size: var(--g-fs-body); line-height: 1.5;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* Links inside text are underlined (not colour alone); components below drop it. */
:where(.guest) a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:where(.guest) a:hover { color: var(--accent-hover); }
.guest :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(.guest) h1, :where(.guest) h2, :where(.guest) h3 { font-family: var(--font-display); font-weight: 600; color: var(--text-strong); }
.g-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;
}
.g-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.guest [hidden] { display: none !important; }
.g-skip { position: absolute; left: 8px; top: -60px; z-index: 30; padding: 8px 12px; border-radius: var(--radius-ctl);
    background: var(--surface); color: var(--text-strong); border: 1px solid var(--line); font-weight: 500; }
.g-skip:focus { top: 8px; }

/* ---------- Brand, micro-labels, status ---------- */
.g-brand { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-strong); text-decoration: none; font-family: var(--font-display); }
:where(.guest) a.g-brand, :where(.guest) a.g-brand:hover { color: var(--text-strong); text-decoration: none; }
.g-brand-on-ink, :where(.guest) a.g-brand-on-ink, :where(.guest) a.g-brand-on-ink:hover { color: var(--on-ink); }

/* Uppercase micro-label: eyebrows, column heads, group labels. */
.g-eyebrow { margin: 0; font-size: var(--fs-label); font-weight: 500; line-height: 1.4; letter-spacing: var(--ls-eyebrow);
    text-transform: var(--label-transform); color: var(--text-muted); }
/* Context tag: which portal / step this is (accent dot + micro-label). */
.g-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; min-height: 24px; padding: 0 9px;
    border: 1px solid var(--line); border-radius: var(--radius-tag); background: var(--surface);
    font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform);
    color: var(--text-2); white-space: nowrap; }
.g-chip::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--accent); }

/* Status: a dot in the status colour plus the word. */
.g-status { --g-dot: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); white-space: nowrap; }
.g-status::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--g-dot); }
.g-status-ok { --g-dot: var(--ok); }
.g-status-warn { --g-dot: var(--warn); }
.g-status-bad { --g-dot: var(--bad); }
.g-status-live { --g-dot: var(--live); }
/* Status badge: dot + word on the soft tint, hairline in the same hue. */
.g-badge { align-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px;
    border: 1px solid var(--neutral-line); border-radius: var(--radius-tag); background: var(--neutral-bg); color: var(--neutral);
    font-size: 11.5px; font-weight: 500; }
.g-badge::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; }
.g-badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.g-badge-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }

.g-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 2px;
    font-size: 12.5px; font-weight: 500; }
:where(.guest) a.g-back { color: var(--text-2); text-decoration: none; }
:where(.guest) a.g-back:hover { color: var(--text-strong); }
.g-icon { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Type ---------- */
.g-h1 { margin: 0; font-size: var(--g-fs-h1); line-height: 1.25; letter-spacing: -.02em; }
.g-h1-lg { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; }
.g-lead { margin: 0; font-size: var(--g-fs-lead); line-height: 1.55; color: var(--text-2); }
.g-lead-lg { font-size: 15px; line-height: 1.6; }
.g-muted { color: var(--text-muted); }
.g-small { font-size: 12px; }
.g-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); text-align: center; }
.g-stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ---------- Alerts: soft tint, 2px bar in the status colour, text in the body colour ---------- */
.g-alert, .guest .ui-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 0;
    border: 0; border-left: 2px solid var(--info); border-radius: var(--radius-card);
    background: var(--info-bg); color: var(--text); font-size: 13px; line-height: 1.5; }
.g-alert > svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; color: var(--text-muted); }
.g-alert p, .guest .ui-alert p { margin: 0; }
.g-alert ul, .guest .ui-alert ul { margin: 4px 0 0; padding-left: 18px; }
.guest .ui-alert > div > p:first-child { font-weight: 500; color: var(--text-strong); }
.g-alert-bad, .guest .ui-alert-bad { border-left-color: var(--bad); background: var(--bad-bg); color: var(--text); }
.g-alert-ok, .guest .ui-alert-ok { border-left-color: var(--ok); background: var(--ok-bg); color: var(--text); }
.g-alert-warn, .guest .ui-alert-warn { border-left-color: var(--warn); background: var(--warn-bg); color: var(--text); }
.g-alert-neutral { border-left-color: var(--input-line); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }

/* ---------- Forms ---------- */
.g-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.guest .ui-field > label { margin: 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.g-optional, .guest .ui-optional { margin-left: 4px; font-weight: 400; color: var(--text-muted); }
.guest .ui-field { gap: 6px; }
.g-input, .g-select, .g-textarea {
    width: 100%; height: var(--g-ctl-h); padding: 0 11px; margin: 0;
    border: 1px solid var(--input-line); border-radius: var(--radius-ctl); background: var(--surface);
    color: var(--text-strong); font: inherit; font-size: var(--g-fs-field);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.g-input:hover, .g-select:hover, .g-textarea:hover { border-color: color-mix(in srgb, var(--input-line) 55%, var(--text-muted)); }
.g-input:focus, .g-select:focus, .g-textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.g-input::placeholder, .g-textarea::placeholder { color: var(--text-muted); opacity: 1; }
.g-input.g-mono { font-family: var(--font-mono); font-size: 13px; }
.g-select { padding-right: 28px; cursor: pointer; }
.g-textarea { height: auto; min-height: 88px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.g-input[aria-invalid="true"], .g-select[aria-invalid="true"], .g-textarea[aria-invalid="true"],
.guest .ui-field.has-error .g-input, .guest .ui-field.has-error .g-select, .guest .ui-field.has-error .g-textarea { border-color: var(--bad); }
.g-help, .guest .ui-help { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.g-error, .guest .ui-error { margin: 0; font-size: 12px; line-height: 1.5; color: var(--bad); }
.guest .ui-help a { font-weight: 500; }
.guest .ui-password > .g-input { padding-right: 44px; }
.guest .ui-password-toggle { width: 40px; border-radius: 0 var(--radius-ctl) var(--radius-ctl) 0; color: var(--text-muted); }
.guest .ui-password-toggle:hover { color: var(--text-strong); }
.guest .ui-password-toggle svg { width: 17px; height: 17px; }
.g-check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; color: var(--text); cursor: pointer; }
.g-check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.g-check-top { align-items: flex-start; }
.g-check-top input { margin-top: 2px; }
.g-form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: -4px; }
.g-link-strong { display: inline-flex; align-items: center; min-height: 32px; font-size: 12.5px; font-weight: 500; }
:where(.guest) a.g-link-strong { text-decoration: none; }
:where(.guest) a.g-link-strong:hover { text-decoration: underline; }
.g-otp { height: var(--g-otp-h); padding: 0 11px 0 calc(11px + .45em); font-family: var(--font-mono); font-size: 24px;
    letter-spacing: .45em; text-align: center; color: var(--text-strong); }
.g-otp-recovery { height: var(--g-otp-h); font-family: var(--font-mono); font-size: 18px; letter-spacing: .1em; text-align: center;
    color: var(--text-strong); text-transform: var(--label-transform); }
.g-otp::placeholder, .g-otp-recovery::placeholder { color: var(--text-muted); opacity: .5; }

/* ---------- Buttons ---------- */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px;
    border: 1px solid transparent; border-radius: var(--radius-ctl); margin: 0;
    font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
:where(.guest) a.g-btn, :where(.guest) a.g-btn:hover { text-decoration: none; }
.g-btn:active { transform: translateY(1px); }
.g-btn-sm { min-height: var(--g-ctl-h-sm); padding: 0 12px; }
.g-btn-lg { min-height: var(--g-ctl-h); padding: 0 16px; }
.g-btn-xl { min-height: var(--g-ctl-h-touch); padding: 0 20px; font-size: 13.5px; }
.g-btn-block { width: 100%; }
.g-btn-primary, :where(.guest) a.g-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.g-btn-primary:hover, :where(.guest) a.g-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.g-btn-secondary, :where(.guest) a.g-btn-secondary { background: var(--surface); border-color: var(--input-line); color: var(--text-strong); }
.g-btn-secondary:hover, :where(.guest) a.g-btn-secondary:hover { background: var(--surface-2); color: var(--text-strong); }
.g-btn-ghost, :where(.guest) a.g-btn-ghost { background: transparent; color: var(--accent-text); }
.g-btn-ghost:hover, :where(.guest) a.g-btn-ghost:hover { background: var(--accent-soft); color: var(--accent-text); }
.g-btn[aria-disabled="true"], .g-btn:disabled { background: var(--surface-2); border-color: var(--line); color: var(--text-muted); cursor: not-allowed; transform: none; }
.g-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Sign-in screens: ink brand panel + form column ----------
   Sign-in, two-step verification and the All-admin set-up (auth/partials/auth-aside). */
.g-auth { display: grid; grid-template-columns: minmax(0, 1fr) var(--g-auth-col); min-height: 100vh; }
.g-auth-brand { min-width: 0; display: flex; flex-direction: column; gap: 32px; padding: 32px 44px 40px;
    background: var(--ink); color: var(--on-ink-muted); border-right: 1px solid var(--ink-line); }
.g-auth-brand .g-brand { align-self: flex-start; }
.g-auth-brand-body { margin-top: auto; display: flex; flex-direction: column; gap: 28px; max-width: 620px; }
.g-auth-eyebrow { margin: 0 0 10px; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow);
    text-transform: var(--label-transform); color: var(--on-ink-label); }
.g-auth-name { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1.15;
    letter-spacing: -.025em; color: var(--on-ink); overflow-wrap: anywhere; }
.g-auth-host { margin: 6px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--on-ink-label); overflow-wrap: anywhere; }
.g-auth-tagline { margin: 0; max-width: 34ch; font-size: 17px; line-height: 1.45; letter-spacing: -.01em; color: var(--on-ink-muted); }
.g-auth-facts { margin: 0; padding-top: 20px; border-top: 1px solid var(--ink-line); display: flex; flex-wrap: wrap; gap: 16px 40px; }
.g-auth-facts dt { font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform); color: var(--on-ink-label); }
.g-auth-facts dd { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--on-ink); }

.g-auth-main { min-width: 0; display: flex; flex-direction: column; padding: 16px 36px; background: var(--ground); }
.g-auth-top { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; }
.g-auth-body { flex: 1 1 auto; width: 100%; max-width: 372px; margin: 0 auto; padding: 32px 0;
    display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.g-auth-body .g-h1 { margin-top: 4px; }
.g-switch { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px;
    font-size: 13px; color: var(--text-2); }
.g-switch a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; }
.g-portals { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: 0 16px; font-size: 12.5px; color: var(--text-muted); }
.g-portals a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; }
:where(.guest) .g-portals a { color: var(--text-2); text-decoration: none; }
:where(.guest) .g-portals a:hover { color: var(--text-strong); text-decoration: underline; }
.g-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px;
    min-height: 40px; font-size: 12px; color: var(--text-muted); }
:where(.guest) .g-footer a { color: var(--text-muted); }
:where(.guest) .g-footer a:hover { color: var(--text-strong); }
.g-divider { display: flex; align-items: center; gap: 12px; margin: 0; }
.g-divider::before, .g-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.g-divider-title { margin: 0; font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow);
    text-transform: var(--label-transform); color: var(--text-muted); white-space: nowrap; }

/* All-admin set-up: QR code with the manual key under it; recovery codes. */
.g-setup-key { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px;
    border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.g-setup-key .ui-qr { justify-content: center; }
.g-setup-key .ui-qr img { width: 176px; height: 176px; border-color: var(--row-line); }
.g-setup-key-text { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-width: 0; text-align: center; }
.g-setup-key-text p { margin: 0; }
.g-setup-key-text .ui-secret-key { align-self: stretch; margin: 0; padding: 8px 10px; border-radius: var(--radius-ctl);
    font-size: 12.5px; color: var(--text-strong); }
.guest .ui-codes { gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--line);
    border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.guest .ui-codes > li { background: var(--surface); padding: 9px 12px; justify-content: center; }
.guest .ui-codes .ui-code { padding: 0; border: 0; background: transparent; font-size: 13.5px; font-weight: 500;
    letter-spacing: .04em; color: var(--text-strong); }

/* ---------- Slim pages: header bar, centred panel (errors, approval, registration) ---------- */
.g-shell { min-height: 100vh; display: flex; flex-direction: column; }
.g-bar { min-height: var(--g-bar-h); padding: 8px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    background: var(--surface); border-bottom: 1px solid var(--line); }
.g-bar-text { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px;
    font-size: 12.5px; color: var(--text-2); }
.g-stage { flex: 1 1 auto; padding: 48px 16px 64px; display: flex; align-items: flex-start; justify-content: center; }
.g-narrow { width: 100%; max-width: var(--g-narrow); display: flex; flex-direction: column; gap: 12px; }
.g-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
    box-shadow: var(--shadow-card); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.g-card-head { display: flex; flex-direction: column; gap: 8px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.g-footer-wide { padding: 8px 24px; border-top: 1px solid var(--line); background: var(--surface); }

/* Error pages */
.g-error-code { display: inline-flex; align-items: center; gap: 8px; }
.g-error-code::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--warn); }
.g-error-code.is-server::before { background: var(--bad); }

/* Key-value rows inside a panel (x-ui.kv, the success summary). */
.guest .ui-kv { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); }
.guest .ui-kv > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 9px 12px; border-top: 1px solid var(--line); }
.guest .ui-kv > div:first-child { border-top: 0; }
.guest .ui-kv dt { font-size: 12px; color: var(--text-muted); }
.guest .ui-kv dd { font-size: 13px; font-weight: 500; text-align: right; }
.guest .ui-badge { align-self: flex-start; }

/* ---------- Registration ---------- */
.g-wide { flex: 1 1 auto; width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 24px 72px;
    display: flex; flex-direction: column; gap: 24px; }
.g-intro { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.g-columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.g-form-card { flex: 2 1 640px; min-width: 0; margin: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-card); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 24px; }
.g-form-card > .g-sep { margin: 0 -24px; }
.g-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.g-legend { display: flex; align-items: baseline; gap: 10px; padding: 0; margin: 0 0 14px; font-family: var(--font-display);
    font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--text-strong); }
.g-legend-num { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--accent-text); }
.g-legend-tight { margin-bottom: 6px; }
.g-subhead { margin: 6px 0 0; padding: 0; font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 500;
    letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform); color: var(--text-muted); }
.g-row { display: flex; flex-wrap: wrap; gap: 14px; }
.g-col { flex: 1 1 200px; min-width: 0; }
.g-col-2 { flex: 2 1 280px; min-width: 0; }
.g-col-narrow { flex: 1 1 200px; min-width: 0; max-width: 420px; }
.g-sep { border: 0; border-top: 1px solid var(--line); margin: 0; }
.g-more { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); }
.g-more > summary { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--text-strong); list-style: none; }
.g-more > summary::-webkit-details-marker { display: none; }
.g-more > summary::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin: 0 2px; border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.g-more[open] > summary::before { transform: rotate(45deg); }
.g-more > summary:hover { color: var(--text-strong); background: var(--surface-2); }
.g-more-body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); background: var(--surface); }
.g-more-body > .g-help:first-child { margin-top: 10px; }
.g-checks { display: flex; flex-wrap: wrap; gap: 0 22px; }
.g-submit-row { border-top: 1px solid var(--line); margin: 0 -24px -24px; padding: 18px 24px 24px; background: var(--surface-2);
    display: flex; flex-direction: column; gap: 14px; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.g-submit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.g-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.g-side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px;
    display: flex; flex-direction: column; gap: 14px; }
.g-side-card h2 { margin: 0; font-family: var(--font-sans); font-size: 13.5px; font-weight: 500; color: var(--text-strong); }
.g-side-card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.g-side-card-note { background: var(--surface-2); border-left: 2px solid var(--accent); }
.g-side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.g-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.g-steps li { display: flex; gap: 12px; }
.g-step-num { flex: 0 0 auto; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: var(--radius-tag);
    background: var(--surface-2); color: var(--text-strong); font-family: var(--font-mono); font-size: 11px;
    display: inline-flex; align-items: center; justify-content: center; }
.g-step-title { display: block; font-size: 13px; font-weight: 500; color: var(--text-strong); }
.g-step-text { display: block; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

/* Application received */
.g-success { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
    box-shadow: var(--shadow-card); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.g-success h1 { margin: 0; font-size: var(--g-fs-h1); line-height: 1.25; letter-spacing: -.02em; }
.g-success .g-badge { align-self: flex-start; }
.g-success-text { margin: 0; font-size: var(--g-fs-lead); line-height: 1.55; color: var(--text-2); }
.g-dl { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); }
.g-dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 9px 12px; border-top: 1px solid var(--line); }
.g-dl > div:first-child { border-top: 0; }
.g-dl dt { font-size: 12px; color: var(--text-muted); }
.g-dl dd { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-strong); overflow-wrap: anywhere; text-align: right; }
.g-dl dd.g-mono { font-size: 12.5px; }

/* ---------- Public website ---------- */
.m-wrap { width: 100%; max-width: calc(var(--g-wrap) + 48px); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.m-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.m-nav-row { min-height: var(--g-nav-h); display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.m-nav { display: flex; align-items: stretch; gap: 22px; margin-left: auto; align-self: stretch; }
.m-nav a { display: inline-flex; align-items: center; font-size: 13px; }
:where(.guest) .m-nav a { color: var(--text-2); text-decoration: none; }
:where(.guest) .m-nav a:hover { color: var(--text-strong); }
:where(.guest) .m-nav a[aria-current="page"] { color: var(--text-strong); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); }
.m-nav-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.m-hero { padding: 48px 0 40px; }
.m-hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.m-eyebrow, .m-kicker { margin: 0; font-size: var(--fs-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.guest .m-h1 { margin: 0; max-width: 17ch; font-size: var(--g-fs-display); line-height: 1.04; letter-spacing: var(--g-ls-display); font-weight: 600; }
.guest .m-h1-pricing { max-width: 20ch; }
.m-lead { margin: 0; max-width: 60ch; font-size: 15.5px; line-height: 1.62; color: var(--text-2); }
.m-cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* Facts at a glance: cells joined by hairlines. */
.m-facts { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; max-width: 900px; display: flex; flex-wrap: wrap; gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.m-facts li { flex: 1 1 auto; min-width: 0; padding: 11px 14px; background: var(--surface); font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }

/* Product window (sample data) */
.m-shot { margin: 32px 0 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); overflow: hidden; }
.m-shot-bar { min-height: 34px; padding: 0 12px; display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.m-shot-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--input-line); }
.m-shot-title { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.m-shot-bar .g-status { margin-left: auto; font-size: 11.5px; }
.m-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.m-kpi { min-width: 0; padding: 13px 14px; background: var(--surface); }
.m-kpi-label { display: block; margin-bottom: 5px; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform); color: var(--text-muted); }
.m-kpi-value { display: block; font-family: var(--font-mono); font-size: 20px; letter-spacing: var(--ls-metric); color: var(--text-strong); }
.m-shot-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.m-shot-pane { min-width: 0; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.m-shot-pane + .m-shot-pane { border-left: 1px solid var(--line); }
.m-pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.m-pane-title { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--text-strong); }
.m-pane-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.m-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.m-table th { padding: 7px 8px; text-align: left; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform);
    color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.m-table td { padding: 8px; border-bottom: 1px solid var(--row-line); color: var(--text); white-space: nowrap; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table .is-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.m-table .is-right { text-align: right; }
.m-bars { height: 104px; display: flex; align-items: flex-end; gap: 3px; }
.m-bars span { flex: 1 1 0; min-width: 0; background: var(--line); border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.m-bars span.is-now { background: var(--accent); }
.m-bars-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.m-shot-foot { padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--text-muted); }

/* Sections */
.m-section { padding: 44px 0; border-top: 1px solid var(--line); scroll-margin-top: var(--g-nav-h); }
.m-section-head { display: flex; flex-direction: column; gap: 8px; max-width: 720px; margin-bottom: 20px; }
.m-section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
.m-section-head-row .m-section-head { margin-bottom: 0; }
.guest .m-h2 { margin: 0; max-width: 24ch; font-size: var(--g-fs-h2); line-height: 1.12; letter-spacing: var(--g-ls-display); }
.m-section-lead { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.m-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.m-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.m-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.m-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.m-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px;
    display: flex; flex-direction: column; gap: 8px; }
.m-card-label { font-family: var(--font-mono); font-size: 11px; color: var(--accent-text); }
.m-card-host { margin: 0; font-size: 11.5px; color: var(--accent-text); overflow-wrap: anywhere; } /* a portal's address on the landing page */
.m-card svg { width: 18px; height: 18px; color: var(--text-muted); margin-bottom: 4px; }
.guest .m-card h3 { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.01em; }
.m-card p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.m-card .g-btn { align-self: flex-start; margin-top: auto; }
.m-card .m-list { margin: 6px 0 14px; }
/* Ticked list: a small check tile, no glyphs. */
.m-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.m-list li { position: relative; padding-left: 25px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.m-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 15px; height: 15px; border-radius: var(--radius-tag); background: var(--ok-bg); }
.m-list li::after { content: ""; position: absolute; left: 5.5px; top: 4.5px; width: 4px; height: 8px; border: solid var(--ok);
    border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* Closing call to action */
.m-cta-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.m-cta-copy { display: flex; flex-direction: column; gap: 12px; }
.m-cta-contact { margin: 0; font-size: 13px; color: var(--text-2); }
.m-cta-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px;
    display: flex; flex-direction: column; gap: 8px; }

/* Footer */
.m-footer { padding: 36px 0 24px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--text-muted); }
.m-footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px; margin-bottom: 32px; }
.m-footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.m-footer-brand p { margin: 0; max-width: 32ch; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.m-footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.m-footer-col h2 { margin: 0 0 6px; font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow);
    text-transform: var(--label-transform); color: var(--text-muted); }
.m-footer-col a, .m-footer-col span { font-size: 12.5px; overflow-wrap: anywhere; }
:where(.guest) .m-footer-col a { color: var(--text-2); text-decoration: none; }
:where(.guest) .m-footer-col a:hover { color: var(--text-strong); text-decoration: underline; }
:where(.guest) .m-footer-col a[aria-current="page"] { color: var(--text-strong); font-weight: 500; }
.m-footer-bottom { padding-top: 18px; border-top: 1px solid var(--row-line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }

/* Pricing */
.m-plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.m-plan { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 22px;
    display: flex; flex-direction: column; gap: 16px; }
/* Line the cards' rows up (head, text, price, button) where subgrid is supported. */
@supports (grid-template-rows: subgrid) {
    .m-plans { row-gap: 0; }
    .m-plan { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 16px; margin-bottom: 16px; }
    .m-plans + .m-note { margin-top: 0; }
}
.m-plan.is-custom { background: var(--surface-2); }
.m-plan-head { display: flex; flex-direction: column; gap: 8px; }
.m-plan-tier { margin: 0; font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-eyebrow); text-transform: var(--label-transform); color: var(--text-muted); }
.guest .m-plan h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-family: var(--font-sans); font-weight: 400; }
.m-plan-size { font-family: var(--font-mono); font-size: var(--g-fs-figure); line-height: 1.05; letter-spacing: var(--g-ls-display); color: var(--text-strong); }
.m-plan-unit { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.m-plan-sessions { margin: 0; font-size: 13px; color: var(--text-2); }
.m-plan-sessions .g-mono { color: var(--text-strong); }
.m-plan-desc { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); }
.m-plan-price { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.m-plan-price p { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 12.5px; color: var(--text-muted); }
.m-plan-amount { font-family: var(--font-mono); font-size: 22px; letter-spacing: var(--ls-metric); color: var(--text-strong); }
.m-plan-rates { color: var(--text-2); }
.m-plan-rates .g-mono { color: var(--text-strong); }
.m-plan .g-btn { margin-top: auto; width: 100%; }
.m-note { margin-top: 16px; }
.m-includes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.m-includes li { min-width: 0; padding: 18px 18px 18px 43px; background: var(--surface); position: relative; }
.m-includes li::before { content: ""; position: absolute; left: 18px; top: 20px; width: 15px; height: 15px; border-radius: var(--radius-tag); background: var(--ok-bg); }
.m-includes li::after { content: ""; position: absolute; left: 23.5px; top: 22.5px; width: 4px; height: 8px; border: solid var(--ok);
    border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.guest .m-includes h3 { margin: 0 0 4px; font-family: var(--font-sans); font-size: 13.5px; }
.m-includes p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
/* ---- landing page: capability band, product tour, comparison, API sample ---- */
.m-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.m-stats li { min-width: 0; padding: 16px 20px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.m-stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: var(--g-ls-display); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.m-stat-label { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.m-section-tight { padding-top: 0; border-top: 0; }
.m-tour { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.m-tour-item { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.m-tour .m-shot { margin: 0; flex: 1 1 auto; }
.m-tour-item figcaption h3 { margin: 0 0 4px; font-size: 15px; }
.m-tour-item figcaption p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.m-route { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.m-route li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--row-line); font-size: 12.5px; }
.m-route li:last-child { border-bottom: 0; }
.m-route-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--radius-pill);
    background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.m-route-name { color: var(--text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-route-rate { font-family: var(--font-mono); color: var(--text-2); }
.m-balance { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--row-line); }
.m-balance-label { font-size: 11.5px; color: var(--text-muted); }
.m-balance-value { font-family: var(--font-mono); font-size: 22px; color: var(--text-strong); }
.m-compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.m-compare { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
.m-compare th, .m-compare td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--row-line); vertical-align: top; }
.m-compare thead th { font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.m-compare thead th.is-us { color: var(--accent-text); }
.m-compare tbody th { font-weight: 500; color: var(--text-strong); width: 34%; }
.m-compare tbody tr:last-child th, .m-compare tbody tr:last-child td { border-bottom: 0; }
.m-compare td.is-us { color: var(--text-strong); font-weight: 500; }
.m-compare td { color: var(--text-2); }
.m-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px 48px; align-items: start; }
.m-code { margin: 0; padding: 18px 20px; border-radius: var(--radius-card); background: var(--code-bg); color: var(--on-ink);
    font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.m-code .m-code-dim { color: var(--on-ink-label); }
.m-code-caption { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }
.m-includes.m-includes-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* six items: two full rows */
@media (max-width: 991.98px) {
    .m-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m-tour, .m-split { grid-template-columns: minmax(0, 1fr); }
    .m-includes.m-includes-3 { grid-template-columns: minmax(0, 1fr); }
}
.m-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px 48px; align-items: start; }
.m-faq-intro { display: flex; flex-direction: column; gap: 12px; }
.m-faq-list { border-top: 1px solid var(--line); }
.m-faq-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.guest .m-faq-item h3 { margin: 0; font-size: 15px; line-height: 1.4; letter-spacing: -.01em; }
.m-faq-item p { margin: 0; max-width: 68ch; font-size: 13.5px; line-height: 1.65; color: var(--text-2); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
    .g-auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .g-auth-brand { flex-direction: row; align-items: center; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--ink-line); }
    .g-auth-brand-body { display: none; }
    .g-auth-main { padding: 8px 16px 12px; }
    .g-auth-body { padding: 16px 0 32px; justify-content: flex-start; }
    .g-auth-top:empty { display: none; }
    .m-faq, .m-cta-inner { grid-template-columns: minmax(0, 1fr); }
    .m-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    body.guest { font-size: 14px; }
    .g-bar { padding: 8px 16px; }
    .g-stage { padding: 24px 16px 40px; }
    .g-card, .g-success { padding: 22px 18px; }
    .g-wide { padding: 20px 16px 48px; }
    .g-form-card { padding: 20px 16px; }
    .g-form-card > .g-sep { margin: 0 -16px; }
    .g-submit-row { margin: 0 -16px -20px; padding: 16px; }
    .g-h1-lg { font-size: 23px; }
    .g-footer-wide { padding: 8px 16px; }
    .m-wrap { padding-left: 16px; padding-right: 16px; }
    .m-nav-row { gap: 0 12px; padding-top: 8px; }
    .m-nav { order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 0 16px; gap: 20px; overflow-x: auto; border-top: 1px solid var(--row-line); min-height: 44px; }
    .m-nav a { white-space: nowrap; }
    .m-nav-actions { margin-left: auto; }
    .m-hero { padding: 28px 0 28px; }
    .guest .m-h1 { font-size: var(--g-fs-display-sm); line-height: 1.08; }
    .m-lead { font-size: 15px; }
    .guest .m-h2 { font-size: 24px; }
    .m-section { padding: 32px 0; }
    .m-section-head, .m-section-head-row { margin-bottom: 16px; }
    .m-shot { margin-top: 24px; }
    .m-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m-shot-body { grid-template-columns: minmax(0, 1fr); }
    .m-shot-pane + .m-shot-pane { border-left: 0; border-top: 1px solid var(--line); }
    .m-table-scroll { overflow-x: auto; }
    .m-table .m-hide-sm { display: none; }
    .m-top { position: static; }
    .m-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
/* Touch screens: every control at least 44px tall. */
@media (max-width: 720px), (pointer: coarse) {
    .g-input, .g-select { height: var(--g-ctl-h-touch); }
    .g-btn, .g-btn-sm, .g-btn-lg { min-height: var(--g-ctl-h-touch); }
    .g-check, .g-back, .g-link-strong, .g-switch a, .g-portals a { min-height: var(--g-ctl-h-touch); }
    .g-more > summary { min-height: var(--g-ctl-h-touch); }
    .guest .ui-password-toggle { width: var(--g-ctl-h-touch); }
    .m-nav a { min-height: var(--g-ctl-h-touch); }
    .m-footer-col a { display: inline-flex; align-items: center; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .guest *, .guest *::before, .guest *::after { transition: none !important; scroll-behavior: auto !important; }
    .g-btn:active { transform: none; }
}
