/* ═══════════════════════════════════════════════════════════════════════════
   MatrixLine Cloud — design layer
   Loaded after skin.css on the panel and sign-in pages. Adds depth to the
   black skin (aurora glow, raised cards, gradient edges), the OS logo
   tiles, and the light theme's component rules (html[data-theme="light"],
   set from the top-bar toggle and remembered in the ml_theme cookie). The
   values for both themes live in tokens.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Shared depth ───────────────────────────────────────────────────────── */
/* --card-bg, --card-shadow, --glow-a/-b and --tile are in tokens.css. */

/* An aurora behind the page, fixed so it stays put while the page scrolls. */
html[data-skin="black"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, var(--glow-a), transparent 60%),
    radial-gradient(760px 480px at 10% 0%, var(--glow-b), transparent 60%),
    radial-gradient(700px 600px at 60% 110%, rgba(244, 114, 182, .08), transparent 60%);
}

/* Cards and panels: a raised surface with a light top edge. */
[data-skin="black"] .card, .ad-stat, .ad-panel {
  background: var(--card-bg); border-color: var(--line); box-shadow: var(--card-shadow);
}
[data-skin="black"] .card { border-radius: 22px; }
[data-skin="black"] .card-header { border-radius: 22px 22px 0 0; font-size: 15.5px; }
[data-skin="black"] .card-header .mx-step { margin-right: 4px; }

/* Page title: larger, with a gradient rule under it. */
.ad-title h1 { font-size: 30px; letter-spacing: -.025em; }
.ad-title h1::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 10px; border-radius: 3px;
  background: var(--grad);
}

/* Primary buttons: the accent gradient with a glow. */
[data-skin="black"] .btn-primary {
  background: linear-gradient(120deg, var(--a), color-mix(in srgb, var(--a) 55%, var(--b))); border: 0; color: #fff;
  box-shadow: 0 10px 28px -12px var(--a);
}
[data-skin="black"] .btn-primary:hover { color: #fff; filter: brightness(1.08); }

/* Steps on the order page. */
.mx-step { width: 26px; height: 26px; flex-basis: 26px; font-size: .78rem; background: var(--chip) !important; color: var(--on-a) !important; box-shadow: 0 6px 16px -6px var(--a); }

/* Stat tiles: a tinted icon tile and a bigger number. */
.ad-stat { overflow: hidden; }
.ad-stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--a) 18%, transparent), transparent 70%); pointer-events: none;
}

/* Notifications sit under the top bar instead of on top of the account menu. */
.mx-toasts { top: 84px; right: 24px; }
@media (max-width: 620px) { .mx-toasts { top: 70px; } }

/* ─── Choice cards (location, OS) ────────────────────────────────────────── */
.mx-pick {
  border-radius: 16px; padding: 14px 16px; border-width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
  transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s;
}
.mx-pick:hover { border-color: var(--line-hi); }
/* Tiles lift under a mouse only; on touch screens the last tapped one would stay raised. */
@media (hover: hover) and (pointer: fine) { .mx-pick:hover { transform: translateY(-2px); } }
.mx-pick.selected, .mx-pick:has(input:checked) {
  border-color: transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--a) 16%, transparent), color-mix(in srgb, var(--b) 5%, transparent)) padding-box,
    linear-gradient(#0b0b12, #0b0b12) padding-box,
    var(--grad) border-box;
  border: 1px solid transparent; box-shadow: 0 14px 34px -18px var(--a);
}
.mx-pick.selected .title, .mx-pick:has(input:checked) .title { color: var(--ink); }
.mx-pick:has(input:checked)::after {
  content: ""; position: absolute; right: -7px; top: -7px; width: 20px; height: 20px; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg, #000);
  background: var(--grad) center / 12px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"), var(--grad);
  background-size: 12px, cover;
}
.mx-pick .title { font-size: .95rem; }

/* ─── OS logos ───────────────────────────────────────────────────────────── */
.os-logo {
  display: inline-grid; place-items: center; flex: none; background: var(--tile); border-radius: 10px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .06); vertical-align: middle;
}
.os-logo img { display: block; width: 62%; height: 62%; object-fit: contain; }
.os-logo-sm { width: 22px; height: 22px; border-radius: 6px; margin-right: 6px; }
.os-logo-md { width: 38px; height: 38px; }
.os-logo-lg { width: 46px; height: 46px; border-radius: 12px; }

/* A row of OS logos on a product card. */
.mx-cat-logos { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1rem; }
.mx-cat-logos .os-logo { width: 30px; height: 30px; border-radius: 8px; }

/* ─── Product cards on the deploy page ───────────────────────────────────── */
.mx-cat { border-radius: 24px; padding: 1.6rem; background: var(--card-bg); box-shadow: var(--card-shadow); overflow: hidden; isolation: isolate; }
.mx-cat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; z-index: -1; pointer-events: none;
  background: radial-gradient(420px 160px at 20% 0%, var(--accent-soft, color-mix(in srgb, var(--a) 18%, transparent)), transparent 70%);
}
@media (hover: hover) and (pointer: fine) { .mx-cat:hover { transform: translateY(-4px); } }
.mx-cat-icon { width: 54px; height: 54px; border-radius: 16px; font-size: 1.5rem; }
.mx-cat h3 { font-size: 1.25rem; }
.mx-cat .from b { font-size: 1.35rem; }

/* ─── Light theme ────────────────────────────────────────────────────────── */
/* The light values are in tokens.css; these are the rules that differ. */
html[data-skin="black"][data-theme="light"] {
  background: #f4f6fb radial-gradient(rgba(15, 23, 42, .07) 1px, transparent 1px) 0 0 / 28px 28px;
}
[data-theme="light"] body { color: var(--ink); }
[data-theme="light"] a:hover, [data-theme="light"] .ad-nav:hover, [data-theme="light"] .ad-nav.on,
[data-theme="light"] .ad-hit.active, [data-theme="light"] .ad-hit:hover,
[data-theme="light"] .nav-tabs .nav-link:hover, [data-theme="light"] .nav-tabs .nav-link.active,
[data-theme="light"] .page-link:hover, [data-theme="light"] .dropdown-item:hover, [data-theme="light"] .dropdown-item:focus { color: var(--ink); }
[data-theme="light"] .btn:hover { color: var(--ink); border-color: var(--line-hi); }
[data-theme="light"] .btn-primary, [data-theme="light"] .btn-primary:hover { color: #fff; }
[data-theme="light"] .btn-danger:hover, [data-theme="light"] .btn-danger:focus-visible { border-color: var(--red); }

[data-theme="light"] .ad-rail { background: rgba(255, 255, 255, .86); box-shadow: 0 20px 50px -30px rgba(15, 23, 42, .35); }
[data-theme="light"] .ad-nav:hover, [data-theme="light"] .ad-node:hover, [data-theme="light"] .ad-list a:hover,
[data-theme="light"] .ad-tl li:hover, [data-theme="light"] .dropdown-item:hover, [data-theme="light"] .page-link:hover { background: rgba(15, 23, 42, .05); }
[data-theme="light"] .ad-nav.on { background: linear-gradient(90deg, color-mix(in srgb, var(--a) 16%, transparent), transparent); }

[data-theme="light"] code, [data-theme="light"] kbd.mx-key, [data-theme="light"] .ad-search-box kbd,
[data-theme="light"] .mx-secret, [data-theme="light"] .input-group-text { background: rgba(15, 23, 42, .06); color: #334155; }
[data-theme="light"] .form-control, [data-theme="light"] .form-select { background-color: #fff; }
[data-theme="light"] .form-control:focus, [data-theme="light"] .form-select:focus { background-color: #fff; }
[data-theme="light"] .form-control:hover, [data-theme="light"] .form-select:hover, [data-theme="light"] .card:hover,
[data-theme="light"] .ad-stat:hover, [data-theme="light"] .ad-panel:hover, [data-theme="light"] .ad-switch:hover { border-color: var(--line-hi); }
[data-theme="light"] .form-check-input { background-color: #fff; border-color: rgba(15, 23, 42, .3); }
[data-theme="light"] .card-footer { background: var(--surface-2); }
[data-theme="light"] .progress, [data-theme="light"] .ad-meter i, [data-theme="light"] .ad-switch-knob { background: rgba(15, 23, 42, .1); }
[data-theme="light"] .ad-ring .t { stroke: rgba(15, 23, 42, .1); }
[data-theme="light"] .ad-tl li::before, [data-theme="light"] .mx-timeline li::before { background: #fff; }
[data-theme="light"] .mx-timeline li { border-left-color: rgba(15, 23, 42, .12); }
[data-theme="light"] .ad-switch { background: #fff; }
[data-theme="light"] .ad-switch.on { color: #15803d; }
[data-theme="light"] .ad-radar svg { color: var(--ink); }
[data-theme="light"] .mx-pick { background: #fff; }
[data-theme="light"] .mx-pick.selected, [data-theme="light"] .mx-pick:has(input:checked) {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--a) 7%, #fff), #fff) padding-box,
    linear-gradient(#fff, #fff) padding-box,
    var(--grad) border-box;
}
[data-theme="light"] .os-logo { box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .25), inset 0 0 0 1px rgba(15, 23, 42, .08); }
[data-theme="light"] .mx-toast { background: #fff; }
[data-theme="light"] .modal-backdrop { --bs-backdrop-bg: #0f172a; --bs-backdrop-opacity: .45; }
[data-theme="light"] .ad-scrim { background: rgba(15, 23, 42, .35); }
[data-theme="light"] .table { --bs-table-color: var(--ink); --bs-table-bg: transparent; }

/* ─── Theme toggle ───────────────────────────────────────────────────────── */
/* Shows the theme you can switch to: the sun in dark mode, the moon in light. */
.ad-theme { width: 44px; padding: 0 !important; }
.ad-theme .ad-theme-sun { display: inline-flex; }
.ad-theme .ad-theme-moon { display: none; }
[data-theme="light"] .ad-theme .ad-theme-sun { display: none; }
[data-theme="light"] .ad-theme .ad-theme-moon { display: inline-flex; }
@media (max-width: 620px) {
  .ad-title h1 { font-size: 23px; }
  .ad-title h1::after { margin-top: 7px; width: 34px; }
  .ad-theme { width: 34px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Client dashboard: first-run checklist, needs-attention stack, server rows
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Client dashboard (D1) ───────────────────────────────────────────────────
   client/dashboard.php. First run: the welcome card (progress bar and steps),
   popular plans and location chips. Returning: the needs-attention stack, the
   servers table (labelled cards on phones via .table-stack), renewals against
   the wallet and recent invoices. Classes use dx-. Colours come from tokens,
   so both themes follow; motion only plays under body.ad-enter or on a fine
   pointer, and skin.css's reduced-motion rule stills the rest. */

/* ─── Shared ─────────────────────────────────────────────────────────────── */
.dx-tag { color: var(--text-mute); font: 500 var(--fs-xs)/1.3 var(--sans); letter-spacing: 0; }
.dx-head-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.card-header .badge-plain { font-variant-numeric: tabular-nums; }

/* partials/empty.php inside a side card: a smaller radar. */
.dx-compact .ad-empty { gap: 8px; padding: 4px 0; }
.dx-compact .ad-radar { width: 84px; height: 84px; }
.dx-compact .ad-radar svg { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.dx-compact .ad-empty p { font-size: var(--fs-sm); }

/* .ad-list rows inside a card, with the amount and its pill on the right. */
.dx-list { padding: 8px 10px; }
.dx-list a { min-height: 52px; }
.dx-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.ad-list .dx-amt b { font-variant-numeric: tabular-nums; }

/* ─── Needs attention ────────────────────────────────────────────────────── */
/* --k tints the card edge and header icon after the most urgent item. */
.card.dx-attn { --k: var(--k-amber); margin-bottom: 16px; }
.card.dx-attn.is-danger { --k: var(--k-red); }
.card.dx-attn.is-info { --k: var(--k-cyan); }
[data-skin="black"] .card.dx-attn { border-color: color-mix(in srgb, var(--k) 40%, var(--line)); }
[data-skin="black"] .card.dx-attn:hover { border-color: color-mix(in srgb, var(--k) 60%, var(--line)); }
[data-skin="black"] .dx-attn .card-header > svg:first-child { color: var(--k); }

.dx-attn-list { list-style: none; margin: 0; padding: 6px 8px; display: grid; gap: 2px; }
.dx-attn-item {
  --t: var(--k-amber);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 16px;
}
.dx-attn-item + .dx-attn-item { box-shadow: 0 -1px 0 var(--line-soft); }
.dx-attn-item.is-danger { --t: var(--k-red); }
.dx-attn-item.is-info { --t: var(--k-cyan); }
.dx-attn-icon {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center;
  color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 35%, transparent);
}
.dx-attn-icon svg { width: 18px; height: 18px; }
.ad-enter .dx-attn-item.is-danger .dx-attn-icon { animation: dx-throb 2.4s ease-in-out 2; }
.dx-attn-body { min-width: 0; }
.dx-attn-title { margin: 0; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.dx-attn-meta { margin: 3px 0 0; color: var(--text-mute); font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.dx-attn-item > .btn { min-height: 40px; }
.dx-attn-more { margin: 0; padding: 2px 22px 14px; color: var(--text-mute); font-size: var(--fs-sm); }
@keyframes dx-throb { 50% { box-shadow: inset 0 0 0 1px var(--t), 0 0 22px -4px var(--t); } }

/* ─── First run ──────────────────────────────────────────────────────────── */
.dx-first { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) {
  .dx-first:not(.is-solo) { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
}
.dx-side { display: grid; gap: 16px; min-width: 0; }

/* The welcome card: a gradient edge and a soft glow from the top corner. */
[data-skin="black"] .card.dx-welcome,
[data-skin="black"] .card.dx-welcome:hover {
  isolation: isolate; border-color: transparent;
  background:
    radial-gradient(560px 240px at 100% 0%, color-mix(in srgb, var(--a) 18%, transparent), transparent 70%) padding-box,
    radial-gradient(420px 220px at 0% 100%, color-mix(in srgb, var(--b) 9%, transparent), transparent 70%) padding-box,
    linear-gradient(var(--solid), var(--solid)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--a) 70%, transparent), color-mix(in srgb, var(--b) 45%, transparent) 45%, var(--line-2) 80%) border-box;
}
[data-skin="black"] .dx-welcome .card-body { padding: 26px 28px 8px; }
.dx-eyebrow { margin: 0 0 10px; color: var(--link); }
.dx-welcome-title {
  margin: 0; max-width: 34ch; text-wrap: balance;
  font: 700 var(--fs-2xl)/1.25 var(--display); letter-spacing: -.02em; color: var(--ink);
}
.dx-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not ((background-clip: text) or (-webkit-background-clip: text)) { .dx-grad { color: var(--link); } }

.dx-progress { display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; }
.dx-progress-track { flex: 1; min-width: 0; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.dx-progress-track > i {
  display: block; width: var(--p); height: 100%; border-radius: inherit; transform-origin: left;
  background: var(--grad); box-shadow: 0 0 14px -2px var(--a);
}
.ad-enter .dx-progress-track > i { animation: ad-grow 1.2s .5s var(--ease) backwards; }
.dx-progress-text { flex: none; color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Steps: a numbered mark (a tick once done) on a rail that fills as they complete. */
.dx-steps { list-style: none; margin: 4px 0 0; padding: 0; }
.dx-step {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start; gap: 16px; padding: 14px 0;
}
.dx-step:not(:last-child)::before {
  content: ""; position: absolute; left: 17px; top: 54px; bottom: -10px; width: 2px; border-radius: 2px;
  background: var(--line-2);
}
.dx-step.is-done:not(:last-child)::before { background: linear-gradient(var(--a), var(--b)); }
.dx-step-mark {
  position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font: 700 var(--fs-md) var(--display); color: var(--text-mute);
  background: var(--solid); border: 2px solid var(--line-2);
}
.dx-step-mark svg { width: 18px; height: 18px; stroke-width: 2.6; }
.dx-step.is-done .dx-step-mark { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px var(--a); }
.dx-step.is-next .dx-step-mark {
  border-color: var(--a); color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 18%, transparent);
  animation: dx-beacon 2.6s var(--ease) 3;
}
/* A server being built: the mark carries a turning ring. */
.dx-step.is-building .dx-step-mark::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--b); border-right-color: var(--b);
  animation: mx-spin 1.1s linear infinite;
}
.dx-step-body { min-width: 0; padding-top: 6px; }
.dx-step-title { margin: 0; font: 600 var(--fs-lg)/1.35 var(--display); letter-spacing: -.01em; color: var(--ink); overflow-wrap: anywhere; }
.dx-step.is-done .dx-step-title { color: var(--text-mute); }
.dx-step-text { margin: 4px 0 0; color: var(--text-mute); font-size: var(--fs-sm); line-height: 1.5; overflow-wrap: anywhere; }
.dx-step-text .badge { margin-left: 4px; vertical-align: 1px; }
.dx-step-act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 1px; }
@keyframes dx-beacon { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--a) 6%, transparent); } }

[data-skin="black"] .dx-welcome .card-footer { background: transparent; border-top-color: var(--line-soft); padding: 14px 28px; }
.dx-welcome-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--text-mute); font-size: var(--fs-sm); }
.dx-welcome-foot svg { color: var(--b); }

/* Popular plans: whole-tile links into the configurator. */
.dx-plans { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.dx-plan {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 64px; padding: 12px; border-radius: 16px; border: 1px solid transparent;
  color: var(--ink); text-decoration: none;
  transition: background var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}
.dx-plan:hover, .dx-plan:focus-visible { background: var(--row-hover); border-color: var(--line-2); color: var(--ink); }
.dx-plan-body { display: grid; gap: 1px; min-width: 0; }
.dx-plan-cat { color: var(--text-mute); font-size: var(--fs-xs); font-weight: 600; }
.dx-plan-name { font-family: var(--display); font-weight: 700; overflow-wrap: anywhere; }
.dx-plan-specs { color: var(--text-mute); font-size: var(--fs-xs); }
.dx-plan-buy { display: grid; justify-items: end; gap: 4px; text-align: right; }
.dx-plan-price { font: 700 var(--fs-lg)/1.1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dx-plan-price small { margin-left: 1px; color: var(--text-mute); font: 500 var(--fs-xs) var(--sans); }
.dx-plan-go { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-size: var(--fs-xs); font-weight: 700; }
.dx-plan-go svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.dx-plan-noos { color: var(--ink); background: var(--surface-3); }
.dx-plan-noos svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) {
  .dx-plan:hover { transform: translateY(-2px); }
  .dx-plan:hover .dx-plan-go svg { transform: translateX(3px); }
}

/* Location chips: flag, name, and capacity as a dot and a word. */
.dx-zones { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dx-zone {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
}
.dx-zone-flag { font-size: var(--fs-lg); line-height: 1; }
.dx-zone-state {
  display: inline-flex; align-items: center; gap: 6px; padding-left: 9px; border-left: 1px solid var(--line);
  color: var(--text-mute); font-size: var(--fs-xs); font-weight: 600;
}
.dx-zone-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot-ok); box-shadow: 0 0 0 3px var(--dot-ok-ring); }
.dx-zone.is-limited .dx-zone-state::before { background: var(--dot-warn); box-shadow: 0 0 0 3px var(--dot-warn-ring); }
.dx-zone.is-sold_out .dx-zone-state::before { background: var(--dot-off); box-shadow: 0 0 0 3px var(--dot-off-ring); }
.dx-zone.is-sold_out .dx-zone-name { color: var(--text-mute); }

/* ─── Your servers ───────────────────────────────────────────────────────── */
/* The hostname link stretches over its row, so the whole row opens the server. */
.dx-row { position: relative; }
.dx-srv { display: block; min-width: 0; }
.dx-srv-link {
  display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.dx-srv-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.dx-srv-link:focus-visible { outline: none; }
.dx-srv-link:focus-visible::after { outline: 2px solid var(--b); outline-offset: -3px; }
.dx-srv-sub { display: block; margin-top: 2px; color: var(--text-mute); font-size: var(--fs-xs); white-space: nowrap; }
.dx-specs, .dx-when { color: var(--text-dim); font-size: var(--fs-sm); }
.dx-when { font-variant-numeric: tabular-nums; }
.dx-when.is-lapsed { color: var(--k-red); }
.dx-lapsed { font-size: var(--fs-xs); font-weight: 700; }
.dx-go { width: 1%; text-align: right; color: var(--text-faint); }
.dx-go svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease), color var(--dur); }
.dx-row:hover .dx-go svg { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .dx-row:hover .dx-go svg { transform: translateX(3px); } }

@media (min-width: 761px) {
  .dx-table .dx-stack-only { display: none !important; }
  .dx-table .dx-specs { min-width: 170px; white-space: normal; }
}
@media (max-width: 760px) {
  .dx-table .dx-table-only, .dx-table .dx-srv-sub { display: none !important; }
  .dx-table > tbody > tr > td[data-primary] { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .dx-table .dx-srv { flex: 1 1 auto; }
  .dx-srv-link { max-width: 100%; }
  .dx-table td[data-primary] .mx-power { font-size: var(--fs-sm); }
}

/* ─── Renewing soon ──────────────────────────────────────────────────────── */
.dx-cover { margin: 0 10px 10px; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.dx-cover-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--ink); font-weight: 600; line-height: 1.4; }
.dx-cover-line svg { width: 18px; height: 18px; margin-top: 1px; color: var(--k-green); }
.dx-cover.is-short .dx-cover-line svg { color: var(--k-amber); }
.dx-meter { height: 6px; margin: 10px 0; border-radius: 99px; background: var(--track); overflow: hidden; }
.dx-meter > i { display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--grad); transform-origin: left; }
.dx-cover.is-covered .dx-meter > i { background: var(--dot-ok); }
.ad-enter .dx-meter > i { animation: ad-grow 1.2s .5s var(--ease) backwards; }
.dx-cover-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  color: var(--text-mute); font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
.dx-cover-foot .btn { min-height: 40px; }
/* A renewal the wallet walk does not reach (the summary's "N of M"). */
.dx-uncovered { color: var(--k-amber); font: 600 var(--fs-xs)/1.2 var(--sans); white-space: nowrap; }

/* ─── Phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .dx-attn-list { padding: 4px; }
  .dx-attn-item { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px 12px; padding: 12px 10px; }
  .dx-attn-icon { width: 32px; height: 32px; border-radius: 10px; }
  .dx-attn-icon svg { width: 16px; height: 16px; }
  .dx-attn-item > .btn { grid-column: 1 / -1; width: 100%; }
  .dx-attn-more { padding: 2px 14px 12px; }

  [data-skin="black"] .dx-welcome .card-body { padding: 18px 16px 6px; }
  [data-skin="black"] .dx-welcome .card-footer { padding: 12px 16px; }
  .dx-welcome-title { font-size: var(--fs-xl); }
  .dx-progress { gap: 10px; margin-top: 14px; }
  .dx-step { grid-template-columns: 32px minmax(0, 1fr); gap: 10px 12px; }
  .dx-step-mark { width: 32px; height: 32px; font-size: var(--fs-sm); }
  .dx-step-mark svg { width: 16px; height: 16px; }
  .dx-step:not(:last-child)::before { left: 15px; top: 50px; }
  .dx-step-body { padding-top: 4px; }
  .dx-step-act { grid-column: 2; justify-content: flex-start; }
  .dx-step-act .btn { flex: 1 1 auto; min-height: 40px; }

  .dx-plans { padding: 6px; }
  .dx-plan { gap: 10px; padding: 10px; }

  .dx-list { padding: 6px; }
  .dx-cover { margin: 0 6px 6px; }
  .dx-cover-foot .btn { width: 100%; }
}

/* ─── Light theme ────────────────────────────────────────────────────────── */
[data-theme="light"] .dx-zone { background: #fff; }
[data-theme="light"] .dx-step.is-done .dx-step-mark { box-shadow: 0 6px 14px -8px var(--a); }

/* ═══════════════════════════════════════════════════════════════════════════
   Server page and list: hero, controls, live bars, performance charts, console
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Servers (V-server) ───────────────────────────────────────────────────────
   client/vms/index.php (the list), client/vms/show.php (the server page as a
   cloud console) and client/vms/console.php. Behaviour lives in js/vm.js.
   Classes use vm-. Colours come from tokens, so both themes follow; hover
   lifts only on a fine pointer, and skin.css's reduced-motion rule stills
   the shimmer, the pings and the chart reveal. */

/* ─── Shared ─────────────────────────────────────────────────────────────── */
.vm-card-title { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; min-width: 0; }

/* A quiet icon button (copy, rename, reveal). 40px targets on touch screens. */
.vm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text-mute); font: 600 var(--fs-sm)/1 var(--sans);
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.vm-icon-btn.is-sm { width: 30px; height: 30px; border-radius: 9px; }
.vm-icon-btn.has-text { width: auto; padding: 0 10px; }
.vm-icon-btn svg, .vm-icon-btn .bi { width: 16px; height: 16px; font-size: 15px; }
.vm-icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.vm-icon-btn:focus-visible { outline: 2px solid var(--b); outline-offset: 1px; }
.vm-icon-btn[aria-pressed="true"] { color: var(--ink); background: var(--surface-3); }
@media (pointer: coarse) {
  .vm-icon-btn, .vm-icon-btn.is-sm { min-width: 40px; min-height: 40px; }
}

/* Notes inside cards: info by default, a calm amber when something is down. */
.vm-note {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5;
}
.vm-note[hidden] { display: none; }
.vm-note > svg { width: 18px; height: 18px; margin-top: 1px; color: var(--link); }
.vm-note > span, .vm-note > div { flex: 1 1 200px; min-width: 0; }
.vm-note > .btn { flex: none; min-height: 36px; margin-left: auto; }
.vm-note.is-warn { background: var(--al-warning-bg); border-color: var(--al-warning-line); }
.vm-note.is-warn > svg { color: var(--al-warning-fg); }
.vm-note code { overflow-wrap: anywhere; }

/* A state chip with a dot: connecting, connected, lost… (console). */
.vm-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim);
  font: 600 var(--fs-xs)/1.4 var(--sans); white-space: nowrap;
}
.vm-chip > i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot-off); }
.vm-chip.is-ok   { color: var(--b-success-fg); background: var(--b-success-bg); border-color: color-mix(in srgb, var(--dot-ok) 35%, transparent); }
.vm-chip.is-ok > i { background: var(--dot-ok); box-shadow: 0 0 0 3px var(--dot-ok-ring); }
.vm-chip.is-warn { color: var(--b-warning-fg); background: var(--b-warning-bg); border-color: var(--a-line); }
.vm-chip.is-warn > i { background: var(--dot-warn); }
.vm-chip.is-bad  { color: var(--b-danger-fg); background: var(--b-danger-bg); border-color: var(--r-line); }
.vm-chip.is-bad > i { background: var(--dot-bad); }
/* Connecting: a turning ring. Not .is-busy, which app.css gives every element a spinner of its own. */
.vm-chip.is-connecting { color: var(--b-info-fg); background: var(--b-info-bg); border-color: var(--c-line); }
.vm-chip.is-connecting > i {
  width: 10px; height: 10px; background: transparent;
  border: 2px solid currentColor; border-right-color: transparent; animation: mx-spin .8s linear infinite;
}

/* The back button in the top bar: on phones just the arrow (the name stays for screen readers). */
@media (max-width: 575.98px) {
  .vm-back { width: 40px; padding: 0 !important; }
  .vm-back > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* Phones: cards on these pages give their content more of the narrow screen. */
@media (max-width: 620px) {
  [data-skin="black"] .vm-page .card-body { padding: 16px; }
  [data-skin="black"] .vm-page .card-header { padding: 14px 16px; }
}

/* ═══ Server page ═══════════════════════════════════════════════════════════ */

/* Banners (suspended, failed, deleted) */
.vm-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.vm-banner > .bi { font-size: 1.2rem; flex: none; }
.vm-banner > .flex-grow-1 { flex: 1 1 240px; min-width: 0; }
.vm-banner > .btn { flex: none; min-height: 40px; }

/* ─── Hero ─── */
[data-skin="black"] .card.vm-hero {
  margin-bottom: 16px; padding: 22px 22px 20px;
  background:
    radial-gradient(560px 220px at 100% 0%, color-mix(in srgb, var(--a) 13%, transparent), transparent 70%),
    radial-gradient(420px 200px at 0% 100%, color-mix(in srgb, var(--b) 6%, transparent), transparent 70%),
    var(--panel);
}
[data-skin="black"][data-theme="light"] .card.vm-hero {
  background:
    radial-gradient(560px 220px at 100% 0%, color-mix(in srgb, var(--a) 7%, transparent), transparent 70%),
    var(--panel);
}
[data-skin="black"] .card.vm-hero.is-suspended { border-color: var(--a-line); }
[data-skin="black"] .card.vm-hero.is-failed { border-color: var(--r-line); }
.vm-hero.is-terminated .os-logo { filter: grayscale(1); opacity: .7; }

.vm-hero-top {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px 16px;
}
.vm-hero-top .os-logo { margin: 2px 0 0; }
.vm-hero-id { min-width: 0; }
.vm-hero-name {
  margin: 0; font: 700 var(--fs-2xl)/1.2 var(--display); letter-spacing: -.02em; color: var(--ink);
  overflow-wrap: anywhere;
}
.vm-hero-label { display: flex; align-items: center; gap: 4px; min-height: 34px; margin-top: 2px; }
.vm-hero-label[hidden] { display: none; }
.vm-hero-label-text { color: var(--text-dim); font-size: var(--fs-md); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.vm-hero-label .vm-icon-btn.has-text { margin-left: -10px; color: var(--link); }

.vm-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; max-width: 460px; }
.vm-rename[hidden] { display: none; }
.vm-rename .form-control { flex: 1 1 200px; min-width: 0; }
.vm-rename .btn { min-height: 36px; }
.vm-rename-help { flex: 1 1 100%; margin: 0; }

.vm-hero-state { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 2px; }
.vm-uptime { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The power pill: the word and its dot in a capsule tinted by the state. */
.vm-pill { display: inline-flex; outline: none; }
.vm-pill .mx-power {
  padding: 6px 13px 6px 11px; border-radius: 999px; font-size: var(--fs-sm);
  border: 1px solid var(--line-2); background: var(--surface-2);
}
.vm-pill .mx-power.is-running {
  background: color-mix(in srgb, var(--dot-ok) 11%, transparent); border-color: color-mix(in srgb, var(--dot-ok) 38%, transparent);
}
.vm-pill .mx-power.is-unknown {
  background: color-mix(in srgb, var(--dot-warn) 10%, transparent); border-color: color-mix(in srgb, var(--dot-warn) 36%, transparent);
}
.vm-pill .mx-power.is-running > i { position: relative; }
.vm-pill .mx-power.is-running > i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--dot-ok);
  animation: mx-ping 2.4s cubic-bezier(0, 0, .2, 1) 3;
}
/* Waiting for a power action to land: a turning ring instead of the dot. */
.mx-power.is-pending { color: var(--cyan); }
.mx-power.is-pending > i {
  width: 10px; height: 10px; background: transparent; box-shadow: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: mx-spin .8s linear infinite;
}
.vm-pill .mx-power.is-pending {
  background: color-mix(in srgb, var(--dot-info) 10%, transparent); border-color: color-mix(in srgb, var(--dot-info) 36%, transparent);
}
.vm-pill-status .badge { font-size: var(--fs-sm); padding: 6px 12px; }

/* Location · IP · OS · plan */
.vm-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  list-style: none; margin: 16px 0 0; padding: 0; color: var(--text-dim); font-size: var(--fs-md);
}
.vm-hero-meta li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.vm-hero-ip .t-mono { color: var(--ink); font-size: var(--fs-md); }
.vm-hero-ip .vm-icon-btn { margin-left: -2px; }

/* Spec chips */
.vm-specs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.vm-specs li {
  display: inline-flex; align-items: baseline; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim);
  font: 600 var(--fs-sm)/1.4 var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.vm-specs .vm-specs-price { color: var(--ink); background: var(--g-soft); border-color: var(--g-line); }
.vm-specs-price span { color: var(--text-mute); font-weight: 500; margin-left: 1px; }

/* ─── Controls ─── */
.vm-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line);
}
.vm-seg {
  display: inline-flex; align-items: stretch; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--panel);
}
.vm-seg > form { display: flex; flex: 1 1 auto; margin: 0; }
.vm-seg > form[hidden] { display: none; }
[data-skin="black"] .vm-seg .vm-seg-btn {
  flex: 1 1 auto; min-height: 42px; padding: 0 16px; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--ink);
}
.vm-seg > form:not([hidden]) ~ form:not([hidden]) .vm-seg-btn { box-shadow: inset 1px 0 0 var(--line-2) !important; }
[data-skin="black"] .vm-seg .vm-seg-btn:hover { background: var(--surface-3); }
[data-skin="black"] .vm-seg .vm-seg-btn:active { transform: none; }
[data-skin="black"] .vm-seg .vm-seg-btn:focus-visible { outline-offset: -3px; border-radius: 999px; }
.vm-seg [data-power-form="start"] svg { color: var(--dot-ok); }
.vm-seg [data-power-form="shutdown"] svg { color: var(--amber); }
.vm-seg [data-power-form="reboot"] svg { color: var(--cyan); }
.vm-seg .vm-seg-btn:disabled svg { color: inherit; }

/* Console: the accent border with a 10% accent fill. */
[data-skin="black"] .vm-console-btn {
  border-color: color-mix(in srgb, var(--a) 55%, transparent);
  background: color-mix(in srgb, var(--a) 12%, transparent); color: var(--ink);
}
[data-skin="black"] .vm-console-btn:hover { background: color-mix(in srgb, var(--a) 20%, transparent); border-color: var(--a); }
[data-skin="black"] .vm-console-btn svg { color: var(--a); }

[data-skin="black"] .vm-more-btn { border-color: var(--line-2); }
.vm-more .dropdown-menu { min-width: 260px; }
.vm-more .dropdown-menu form { margin: 0; }
.vm-more .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 40px; white-space: normal; }
.vm-more li[hidden] { display: none; }
[data-skin="black"] .vm-more .dropdown-item.text-danger { color: var(--b-danger-fg) !important; }
[data-skin="black"] .vm-more .dropdown-item.text-danger svg { color: currentColor; }
[data-skin="black"] .vm-more .dropdown-item.text-danger:hover,
[data-skin="black"] .vm-more .dropdown-item.text-danger:focus { background: var(--r-soft); }

.vm-lock { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 260px; margin: 0; color: var(--text-dim); font-size: var(--fs-md); line-height: 1.5; }
.vm-lock > svg { width: 18px; height: 18px; margin-top: 2px; color: var(--text-mute); }
.vm-controls > .btn { min-height: 40px; }

/* Phones: the name row and the state stack; power fills a row, then Console and More share one. */
@media (max-width: 575.98px) {
  [data-skin="black"] .card.vm-hero { padding: 18px 16px 16px; }
  .vm-hero-top { grid-template-columns: auto minmax(0, 1fr); }
  .vm-hero-state { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .vm-hero-name { font-size: var(--fs-xl); }
  .vm-hero-meta { font-size: var(--fs-sm); gap: 4px 14px; }
  .vm-specs li { padding: 4px 10px; font-size: var(--fs-xs); }
  .vm-controls { gap: 8px; }
  .vm-seg { flex: 1 1 100%; }
  .vm-console-btn, .vm-more { flex: 1 1 0; }
  .vm-more .vm-more-btn { width: 100%; }
  [data-skin="black"] .vm-seg .vm-seg-btn { padding: 0 10px; font-size: var(--fs-sm); gap: 6px; }
}
@media (max-width: 400px) {
  .vm-seg .vm-seg-btn svg { display: none; }
}

/* ─── Layout ─── */
.vm-main > .card + .card { margin-top: 16px; }
.vm-rail .card + .card { margin-top: 16px; }
@media (min-width: 768px) and (max-width: 991.98px) {
  .vm-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .vm-rail .card + .card { margin-top: 0; }
}
.vm-page .card-header { flex-wrap: wrap; }

/* ─── Live usage ─── */
.vm-live-state {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-mute); font: 600 var(--fs-xs)/1.3 var(--sans); white-space: nowrap;
}
.vm-live-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot-off); }
.vm-live-state.is-ok { color: var(--b-success-fg); }
.vm-live-state.is-ok::before { background: var(--dot-ok); box-shadow: 0 0 0 3px var(--dot-ok-ring); }
.vm-live-state.is-warn { color: var(--b-warning-fg); }
.vm-live-state.is-warn::before { background: var(--dot-warn); }

.vm-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
/* Live figures unavailable: fade only the live CPU and memory bars and mute their old readings.
   Labels, allocations and the bandwidth figure (from the database, never stale) keep full contrast. */
.vm-meters.is-stale .vm-meter.is-live .progress { opacity: .45; }
.vm-meters.is-stale .vm-meter.is-live .vm-meter-head b { color: var(--text-mute); }
.vm-meter { min-width: 0; }
.vm-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.vm-meter-head .t-label { color: var(--text-mute); }
.vm-meter-head b { color: var(--ink); font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-meter .progress { height: 8px; border-radius: 99px; }
.vm-meter .progress-bar { border-radius: 99px; transition: width var(--dur-slow) var(--ease); }
.vm-meter-foot { margin: 7px 0 0; }
.vm-meters + .vm-note { margin-top: 16px; }
.vm-meters.is-loading .progress {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: vm-shimmer 1.4s ease infinite;
}
.vm-meters.is-loading .progress-bar { opacity: 0; }
@media (max-width: 767.98px) {
  .vm-meters { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* ─── Performance ─── */
.vm-range {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.vm-range-btn {
  position: relative;
  min-width: 46px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-mute); font: 600 var(--fs-sm)/1 var(--sans); font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.vm-range-btn:hover { color: var(--ink); }
.vm-range-btn:focus-visible { outline: 2px solid var(--b); outline-offset: 1px; }
.vm-range-btn[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), 0 2px 8px -4px rgba(0, 0, 0, .4); }
[data-theme="light"] .vm-range-btn[aria-pressed="true"] { background: #fff; box-shadow: inset 0 0 0 1px var(--line-2), 0 2px 6px -3px rgba(15, 23, 42, .2); }
@media (pointer: coarse) { .vm-range-btn { min-height: 40px; } }
@media (max-width: 575.98px) {
  .vm-perf .vm-range { flex: 1 1 100%; margin-left: 0 !important; }
  .vm-perf .vm-range-btn { flex: 1 1 0; min-width: 0; }
}

.vm-perf .vm-note + .vm-charts { margin-top: 16px; }
.vm-charts { display: grid; gap: 20px; --gutter: 64px; }
.vm-charts[hidden] { display: none; }
.vm-chart { margin: 0; min-width: 0; }
.vm-chart-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; }
.vm-chart-head .t-label { color: var(--text-mute); }
.vm-chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-mute); }
.vm-chart-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 3px; margin-left: 4px; }
.vm-chart-legend i:first-child { margin-left: 0; }
.vm-chart-legend i.is-in { background: var(--b); }
.vm-chart-legend i.is-out { background: var(--a); }
.vm-chart-read { margin-left: auto; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 1.4em; }

.vm-plot {
  position: relative; height: 120px; margin-left: var(--gutter); border-radius: 10px;
  touch-action: pan-y; cursor: crosshair; -webkit-tap-highlight-color: transparent;
}
.vm-plot:focus-visible { outline: 2px solid var(--b); outline-offset: 4px; }
.vm-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.vm-gridlines line { stroke: var(--line); stroke-width: 1; }
.vm-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vm-line.is-in { stroke: var(--b); }
.vm-line.is-out { stroke: var(--a); stroke-width: 1.75; }
.vm-stop-a { stop-color: var(--a); }
.vm-stop-b { stop-color: var(--b); }
.vm-fill-top { stop-color: var(--a); stop-opacity: .32; }
.vm-fill-bottom { stop-color: var(--a); stop-opacity: 0; }
.vm-fill-top-b { stop-color: var(--b); stop-opacity: .24; }
.vm-fill-bottom-b { stop-color: var(--b); stop-opacity: 0; }
[data-theme="light"] .vm-fill-top { stop-opacity: .2; }
[data-theme="light"] .vm-fill-top-b { stop-opacity: .16; }
/* A new range draws in from the left, once. */
.vm-svg.is-fresh { animation: vm-reveal .9s var(--ease) both; }

/* Y labels in the gutter, the time axis under the last chart. */
.vm-y { position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); width: calc(var(--gutter) - 10px); pointer-events: none; }
.vm-y span {
  position: absolute; right: 0; transform: translateY(-50%);
  color: var(--text-mute); font: 500 var(--fs-xs)/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.vm-x { display: flex; justify-content: space-between; gap: 12px; margin: -10px 0 0 var(--gutter); font-variant-numeric: tabular-nums; }

/* Crosshair: one line and a dot per series, in step across the charts. */
.vm-cross { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; }
.vm-cross b { position: absolute; top: 0; bottom: 0; left: -.5px; width: 1px; background: var(--line-hi); }
.vm-cross-dot {
  position: absolute; left: -5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--a); box-shadow: 0 0 0 2px var(--solid), 0 0 10px -1px currentColor;
}
.vm-cross-dot.is-a { background: color-mix(in srgb, var(--a) 50%, var(--b)); }
.vm-cross-dot.is-in { background: var(--b); }
.vm-cross-dot.is-out { background: var(--a); }

/* Loading: shimmer blocks the height of the charts. */
.vm-charts.is-loading .vm-plot {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: vm-shimmer 1.4s ease infinite;
}
.vm-charts.is-loading .vm-plot > *, .vm-charts.is-loading .vm-x, .vm-charts.is-loading .vm-chart-read { visibility: hidden; }

@media (max-width: 575.98px) {
  .vm-charts { --gutter: 54px; gap: 18px; }
  .vm-plot { height: 104px; }
}

/* ─── Bandwidth by month ─── */
.vm-months { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vm-months li {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "name bar total" ". split split";
  align-items: center; gap: 4px 14px;
}
.vm-months-name { grid-area: name; color: var(--text-dim); font-size: var(--fs-sm); font-weight: 600; }
.vm-months-bar { grid-area: bar; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.vm-months-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--a), var(--b)); }
.vm-months-total { grid-area: total; color: var(--ink); font-size: var(--fs-sm); text-align: right; white-space: nowrap; }
.vm-months-split { grid-area: split; display: flex; gap: 14px; }

/* ─── Activity ─── */
.vm-activity .mx-timeline li { padding-bottom: 1.05rem; }
.vm-activity-note { margin-top: 2px; line-height: 1.45; }

/* ─── Right rail ─── */
.vm-kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 0 0 16px; font-size: var(--fs-md); }
.vm-kv dt { color: var(--text-mute); font-weight: 500; }
.vm-kv dd { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0; min-width: 0; color: var(--text); }
.vm-kv dd > .t-mono { overflow-wrap: anywhere; min-width: 0; }
.vm-secret { letter-spacing: .06em; overflow-wrap: anywhere; min-width: 0; }

.vm-cmd {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 6px 6px 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
}
.vm-cmd code {
  flex: 1 1 auto; min-width: 0; padding: 0; background: none; border: 0;
  color: var(--ink); font: 500 var(--fs-sm)/1.5 var(--mono); overflow-wrap: anywhere;
}
[data-theme="light"] .vm-cmd code { background: none; color: var(--ink); }

.vm-pass-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.vm-pass-form .input-group > .form-control { min-width: 0; }
.vm-pass-form .input-group > .btn { min-height: 44px; }

.vm-ips { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.vm-ips li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.vm-ips li > .t-mono:first-child { color: var(--ink); font-size: var(--fs-md); }

.vm-renew { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.vm-renew .form-check { min-height: 28px; display: flex; align-items: center; gap: 10px; padding-left: 0; }
.vm-renew .form-check-input { float: none; margin: 0; flex: none; width: 2.4em; height: 1.3em; cursor: pointer; }
.vm-renew .form-check-label { cursor: pointer; font-weight: 500; }

.vm-os-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; }
.vm-os-row .os-logo-sm { width: 30px; height: 30px; border-radius: 8px; margin: 0; }

/* ═══ Server list ═══════════════════════════════════════════════════════════ */
.vm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.vm-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.vm-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 15px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text-dim); font: 600 var(--fs-sm)/1 var(--sans); white-space: nowrap;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.vm-filter:hover { border-color: var(--line-hi); color: var(--ink); }
.vm-filter:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }
.vm-filter.is-on { background: var(--g-soft); border-color: var(--g-line); color: var(--ink); }
.vm-filter-n {
  min-width: 24px; padding: 4px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-dim);
  font: 700 var(--fs-xs)/1 var(--sans); font-variant-numeric: tabular-nums; text-align: center;
}
.vm-filter.is-on .vm-filter-n { background: var(--g-mid); color: var(--ink); }

.vm-search { position: relative; flex: 0 1 320px; min-width: 0; }
.vm-search > svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--text-mute); pointer-events: none; }
.vm-search .form-control { min-height: 42px; padding-left: 40px; padding-right: 40px; border-radius: 999px; }
.vm-search .form-control::-webkit-search-cancel-button { cursor: pointer; }
.vm-search .mx-key { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.vm-search:focus-within .mx-key { opacity: 0; }
@media (pointer: coarse) { .vm-search .mx-key { display: none; } .vm-search .form-control { padding-right: 16px; } }
@media (max-width: 760px) { .vm-search { flex: 1 1 100%; } }

.vm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
[data-skin="black"] .card.vm-card { display: flex; flex-direction: column; min-width: 0; }
.vm-card[hidden] { display: none !important; }
.vm-card-body { flex: 1 1 auto; padding: 18px 18px 14px; min-width: 0; }
.vm-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.vm-card-head .os-logo-sm { width: 36px; height: 36px; border-radius: 10px; margin: 0; }
.vm-card-id { min-width: 0; }
.vm-card-name { margin: 0; font: 600 var(--fs-lg)/1.3 var(--display); letter-spacing: -.01em; overflow: hidden; white-space: normal; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
/* A hostname has no words to wrap at: break it anywhere, like an address, so it fits in two lines. */
.vm-card-name.is-host { word-break: break-all; }
.vm-card-name a { color: var(--ink); text-decoration: none; }
/* The whole card opens the server; buttons inside stay on top of the link. */
.vm-card-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.vm-card-name a:focus-visible { outline: none; }
.vm-card-name a:focus-visible::after { outline: 2px solid var(--b); outline-offset: 2px; border-radius: 24px; }
.vm-card-host { margin: 2px 0 0; color: var(--text-mute); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-card-state { align-self: start; padding-top: 2px; }
.vm-card-state .mx-power { font-size: var(--fs-sm); }

.vm-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; list-style: none; margin: 14px 0 0; padding: 0; color: var(--text-dim); font-size: var(--fs-sm); }
.vm-card-meta li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.vm-card-ip .t-mono { color: var(--ink); }
.vm-card-ip .vm-icon-btn, .vm-card-foot { position: relative; z-index: 2; }
.vm-card-specs { margin: 8px 0 0; color: var(--text-mute); font-size: var(--fs-sm); }
.vm-card-bill {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--text-dim); font-size: var(--fs-sm);
}
.vm-card-bill a { position: relative; z-index: 2; color: var(--link); }
.vm-card-due {
  display: inline-flex; padding: 2px 8px; border-radius: 99px; font: 700 var(--fs-xs)/1.4 var(--sans);
  background: var(--b-warning-bg); color: var(--b-warning-fg);
}
.vm-card-due.is-bad { background: var(--b-danger-bg); color: var(--b-danger-fg); }
.vm-card-foot { display: flex; gap: 8px; padding: 0 18px 18px; }
.vm-card-foot .btn { min-height: 40px; }
.vm-card-console { width: 40px; padding: 0 !important; flex: none; }

[data-skin="black"] .card.vm-card { transition: border-color var(--dur), transform var(--dur) var(--ease), opacity var(--dur); }
@media (hover: hover) and (pointer: fine) {
  [data-skin="black"] .card.vm-card:hover { transform: translateY(-3px); border-color: var(--line-hi); }
}
[data-skin="black"] .card.vm-card.is-ended { opacity: .62; }
[data-skin="black"] .card.vm-card.is-ended:hover { opacity: .9; }
.vm-card.is-ended .os-logo { filter: grayscale(1); }

.vm-none {
  display: grid; justify-items: center; gap: 14px; padding: 40px 16px; margin-top: 4px; text-align: center;
  border: 1px solid var(--line); border-radius: 22px; color: var(--text-dim);
}
.vm-none[hidden] { display: none; }
.vm-none p { margin: 0; max-width: 44ch; }
.vm-none .btn { min-height: 40px; }
.vm-list-empty { min-height: 380px; }

/* ═══ Console ═══════════════════════════════════════════════════════════════ */
.vm-console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.vm-console-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.vm-console-tools .btn { min-height: 38px; }
.vm-console-tools .btn[data-console-reconnect].is-ready { border-color: var(--a); color: var(--ink); box-shadow: 0 0 0 3px var(--g-soft); }
.vm-console-full .bi-fullscreen-exit { display: none; }
.vm-console.is-full .vm-console-full .bi-arrows-fullscreen { display: none; }
.vm-console.is-full .vm-console-full .bi-fullscreen-exit { display: inline-block; }

.vm-console-body { padding: 8px; }
/* The frame fills the screen below its top edge (vm.js sets --console-top);
   dvh follows the phone's toolbars, vh is the fallback. */
.vm-console .vm-console-frame {
  height: calc(100vh - var(--console-top, 220px) - 64px);
  height: calc(100dvh - var(--console-top, 220px) - 64px);
  min-height: 260px; overflow: hidden; border-radius: 14px; background: #000;
}
.vm-console-foot { padding: 4px 18px 16px; line-height: 1.5; }
.vm-console-off-lead { margin: 0 0 16px; color: var(--text); font-size: var(--fs-lg); line-height: 1.5; max-width: 60ch; }
.vm-console.is-off .vm-cmd { max-width: 460px; margin-bottom: 6px; }

/* Full screen: the Fullscreen API, or (iPhone) the card maximised with CSS. */
html.vm-console-open, html.vm-console-open body { overflow: hidden; }
[data-skin="black"] .vm-console.is-max,
[data-skin="black"] .vm-console:fullscreen {
  position: fixed; inset: 0; z-index: 1080; margin: 0; border: 0; border-radius: 0;
  display: flex; flex-direction: column; background: var(--bg);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.vm-console.is-full .card-header { border-radius: 0; }
.vm-console.is-full .vm-console-body { flex: 1 1 auto; min-height: 0; display: flex; padding: 0; }
.vm-console.is-full .vm-console-frame { flex: 1 1 auto; height: auto; min-height: 0; border-radius: 0; }
.vm-console.is-full .vm-console-foot { display: none; }
.vm-console:fullscreen::backdrop { background: #000; }

@media (max-width: 575.98px) {
  .vm-console-tools { flex: 1 1 100%; margin-left: 0; }
  .vm-console-tools .btn { flex: 1 1 auto; min-height: 40px; }
  .vm-console-foot { padding: 4px 14px 14px; }
}

/* ─── Touch targets ─── */
/* Phones and touch screens: every button on these pages is at least 40px tall,
   including the small ones (rename Save/Cancel, Try again, Choose a system…,
   Back to …) that btn-sm sets to 34px. The back arrow becomes a 40px square. */
@media (pointer: coarse), (max-width: 575.98px) {
  .vm-rename .btn,
  .vm-note > .btn,
  .vm-rail .btn,
  .vm-controls > .btn,
  .vm-console.is-off .btn,
  .vm-console-tools .btn,
  .ad-actions .vm-back { min-height: 40px; }
  /* The auto-renew label fills a 40px row beside the switch, so the whole row toggles. */
  .vm-renew .form-check { min-height: 40px; }
  .vm-renew .form-check-label { align-self: stretch; display: flex; align-items: center; }
}

/* ─── Motion ─── */
@keyframes vm-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes vm-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .vm-svg.is-fresh { animation: none; }
  .vm-meters.is-loading .progress, .vm-charts.is-loading .vm-plot { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Rebuild: queued/reinstalling/ready stepper and the rebuild form
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Queued rebuild (F3) ─────────────────────────────────────────────────────
   Progress banner on the server page (client/vms/show.php) and the rebuild form
   (client/vms/rebuild.php). Tokens only, so both themes follow. */

/* Banner: title row, then a three-step stepper Queued → Reinstalling → Ready. */
.mx-rebuild { display: block; }
.mx-rebuild-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.mx-rebuild-title { font-size: var(--fs-md, 14px); font-weight: 700; color: inherit; }
.mx-rebuild-time { color: inherit; font-variant-numeric: tabular-nums; }
.mx-rebuild-refresh { margin-left: auto; min-height: 40px; display: inline-flex; align-items: center; }

.mx-steps { list-style: none; margin: .75rem 0; padding: 0; display: flex; gap: .5rem; }
.mx-steps li {
  display: flex; align-items: center; gap: .5rem; flex: 1 1 0; min-width: 0;
  font-size: var(--fs-sm, 13px); color: inherit;
}
.mx-steps li:last-child { flex: 0 0 auto; }
/* Connector between steps; filled once the step before it is done. */
.mx-steps li:not(:last-child)::after {
  content: ""; flex: 1 1 auto; min-width: 1rem; height: 2px; border-radius: 2px;
  background: var(--line-2, currentColor);
}
.mx-steps li.is-done::after { background: var(--a); }
.mx-steps li.is-active .mx-step-text { font-weight: 700; }

.mx-step-dot {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: var(--fs-xs, 12px); font-weight: 700; line-height: 1;
  border: 2px solid var(--line-2, currentColor); color: inherit; background: transparent;
}
.mx-steps .is-done .mx-step-dot { background: var(--a); border-color: var(--a); color: var(--on-a, #fff); }
.mx-steps .is-active .mx-step-dot {
  border-color: var(--a); color: var(--a);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 22%, transparent);
}
.mx-step-text { min-width: 0; overflow-wrap: anywhere; }

/* Phones: stack the steps; the connectors become noise. */
@media (max-width: 575.98px) {
  .mx-steps { flex-direction: column; gap: .4rem; }
  .mx-steps li, .mx-steps li:last-child { flex: none; }
  .mx-steps li:not(:last-child)::after { display: none; }
}

/* Rebuild form: the hidden radio inside each OS card still needs a visible focus. */
.mx-rebuild-form .mx-pick:has(input:focus-visible) { outline: 2px solid var(--a); outline-offset: 2px; }
.mx-rebuild-form .mx-pick .badge { font-weight: 600; }
.mx-rebuild-form [data-rebuild-submit]:disabled { cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════════
   Ordering: plan cards, configurator, mobile checkout bar, order tracker, gateway hand-off
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Ordering (O-order) ──────────────────────────────────────────────────────
   client/orders/index.php (deploy page), category.php + plan_card.php (plan
   cards), configure.php (location, OS, details, summary, the phone checkout
   bar), track.php (the live tracker), list.php (orders) and
   client/billing/checkout.php (the gateway hand-off). Colours come from
   tokens so both themes follow; light-only tweaks sit under
   [data-theme="light"]. Motion: hover lifts only on a fine pointer, and
   every animation stops under prefers-reduced-motion. */

/* ─── Shared ─────────────────────────────────────────────────────────────── */
/* Keyboard focus on a choice tile (the radio inside is visually hidden). */
.mx-pick:has(input:focus-visible) { outline: 2px solid var(--b); outline-offset: 2px; }

/* Capacity as a word with a dot: Available / Limited / Sold out. */
.mx-avail {
  --k: var(--dot-ok);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: 600 var(--fs-xs)/1.2 var(--sans); color: var(--text-dim); white-space: nowrap;
}
.mx-avail > i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 22%, transparent); flex: none; }
.mx-avail.is-limited { --k: var(--dot-warn); }
.mx-avail.is-sold_out { --k: var(--dot-bad); color: var(--text-mute); }
.mx-avail .t-mute { font-weight: 500; }

/* ─── Deploy page: product cards and locations ───────────────────────────── */
.mx-cat .foot { gap: 12px; }
.mx-cat-go {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: 600 var(--fs-sm)/1 var(--sans); color: var(--accent, var(--link));
}
.mx-cat-go svg { transition: transform var(--dur) var(--ease); }
@media (hover: hover) and (pointer: fine) { .mx-cat:hover .mx-cat-go svg { transform: translateX(3px); } }
.mx-cat:focus-visible { outline: 2px solid var(--b); outline-offset: 3px; }
.mx-cat-logos > span { display: inline-flex; }

.mx-locs .card-body { padding-bottom: 14px; }
.mx-locs-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px;
}
.mx-locs-list li {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.mx-locs-flag { font-size: 22px; line-height: 1; flex: none; }
.mx-locs-name { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.mx-locs-name b { font: 600 var(--fs-md)/1.3 var(--sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-locs-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Category page: the range header ────────────────────────────────────── */
.mx-range { overflow: hidden; isolation: isolate; }
.mx-range::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 180px; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 180px at 12% 0%, var(--accent-soft, color-mix(in srgb, var(--a) 16%, transparent)), transparent 70%);
}
.mx-range-body { flex: 1 1 320px; min-width: 0; }
.mx-range-title { font: 700 var(--fs-2xl)/1.2 var(--display); letter-spacing: -.02em; margin: 2px 0 2px; color: var(--ink); }
.mx-range-tagline { font: 600 var(--fs-sm)/1.4 var(--sans); color: var(--accent, var(--link)); margin: 0 0 8px; }
.mx-range-desc { max-width: 68ch; }
.mx-range-points { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mx-range-points li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-dim); }
.mx-range-points svg { color: var(--accent, var(--dot-ok)); }
.mx-range-back { margin-left: auto; }

/* ─── Plan cards ─────────────────────────────────────────────────────────── */
.mx-plan { transition: border-color var(--dur-slow), transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow); }
.mx-plan .card-body { gap: 12px; }
.mx-plan-name { font: 700 var(--fs-lg)/1.3 var(--display); letter-spacing: -.01em; margin: 0; color: var(--ink); padding-right: 96px; }
.mx-plan:not(.is-featured) .mx-plan-name { padding-right: 0; }
.mx-plan-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; margin-top: 2px; }
.mx-plan .price { font-family: var(--display); font-size: 30px; }
.mx-plan .price small { margin-left: 2px; font-family: var(--sans); }
.mx-plan-stock {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font: 700 var(--fs-xs)/1.2 var(--sans); color: var(--b-warning-fg); background: var(--b-warning-bg);
}
.mx-plan-setup { margin: -6px 0 0; }
.mx-plan-specs { list-style: none; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.mx-plan-specs li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--text-dim); }
.mx-plan-specs li b { color: var(--text); font-weight: 600; }
.mx-plan-specs svg { width: 18px; height: 18px; color: var(--accent, var(--b)); opacity: .9; }
.mx-plan-os { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.mx-plan-os-logos { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mx-plan-os-logos > span { display: inline-flex; }
.mx-plan-os-logos .os-logo-sm { width: 26px; height: 26px; border-radius: 7px; margin: 0; }
.mx-plan-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.mx-plan-cta svg { transition: transform var(--dur) var(--ease); }

/* The featured plan: a gradient edge and a gradient flag. */
[data-skin="black"] .card.mx-plan.is-featured {
  border-color: transparent;
  background: var(--card-bg) padding-box, linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box;
  box-shadow: 0 24px 60px -34px var(--a);
}
.mx-plan.is-featured .mx-plan-flag { background: var(--chip); color: var(--on-a); right: 18px; border-radius: 0 0 10px 10px; padding: 5px 10px; font-size: var(--fs-xs); letter-spacing: .02em; }
@media (hover: hover) and (pointer: fine) {
  [data-skin="black"] .card.mx-plan:hover { transform: translateY(-3px); }
  .mx-plan:hover .mx-plan-cta svg { transform: translateX(3px); }
}
[data-theme="light"] .card.mx-plan.is-featured {
  background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box;
  box-shadow: 0 22px 50px -30px color-mix(in srgb, var(--a) 55%, transparent);
}

/* ─── Configure ──────────────────────────────────────────────────────────── */
.mx-order .card-header { display: flex; align-items: center; gap: 8px; }
.mx-step-note { font: 500 var(--fs-sm)/1.3 var(--sans); color: var(--text-mute); letter-spacing: 0; }
.mx-step-alert { font-size: var(--fs-md); margin-bottom: 14px; }
.mx-step-alert:focus { outline: 2px solid var(--b); outline-offset: 2px; }

/* Location and OS tiles. */
.mx-zone-row, .mx-os-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mx-zone-flag { font-size: 26px; line-height: 1; flex: none; }
.mx-zone-text, .mx-os-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
/* Long OS names ("Windows Server 2022", "Debian 12 Bookworm") wrap to a second line rather than lose
   their version. A location is one or two words, which a mid-word break would mangle, so it keeps its
   ellipsis (the tile's title attribute has the full name). */
.mx-zone-text .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-os-text .title {
  white-space: normal; overflow-wrap: anywhere; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.mx-zone-text .meta, .mx-os-text .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-pick .mx-avail { align-self: center; }
.mx-pick.is-sold { cursor: not-allowed; opacity: .55; }
.mx-pick.is-sold:hover { border-color: var(--line); transform: none; }
.mx-os-row .os-logo { margin: 0; }
#osList, #ipList { transition: opacity var(--dur) var(--ease); }
#osList.is-loading, #ipList.is-loading { opacity: .5; pointer-events: none; }

/* How many: a stepper with real touch targets and no browser spinners. */
.mx-qty { flex-wrap: nowrap; max-width: 220px; }
.mx-qty .btn { min-width: 44px; min-height: 44px; font-size: var(--fs-xl); line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.mx-qty .form-control { min-height: 44px; font: 600 var(--fs-lg) var(--sans); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.mx-qty .form-control::-webkit-outer-spin-button,
.mx-qty .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#hostnames .form-control { min-height: 44px; }

/* Advanced: host node and IP, folded away by default. */
.mx-adv { border: 1px dashed var(--line-2); border-radius: 16px; background: transparent; }
.mx-adv[open] { border-style: solid; border-color: var(--line); background: var(--surface); }
.mx-adv > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 48px; padding: 10px 16px 10px 40px;
  cursor: pointer; list-style: none; position: relative; border-radius: 16px;
  font: 600 var(--fs-md)/1.3 var(--sans); color: var(--text);
}
.mx-adv > summary::-webkit-details-marker { display: none; }
.mx-adv > summary::before {
  content: ""; position: absolute; left: 17px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--text-mute); border-bottom: 2px solid var(--text-mute);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.mx-adv[open] > summary::before { transform: rotate(45deg); margin-top: -7px; }
.mx-adv > summary:hover { color: var(--ink); }
.mx-adv > summary:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }
.mx-adv-hint { font-weight: 500; }
.mx-adv-body { padding: 4px 16px 16px; }

.mx-ip-filter { width: 260px; max-width: 100%; }
.mx-ip-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px;
  max-height: 420px; overflow: auto; overscroll-behavior: contain;
  padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.mx-ip-list.is-invalid { border-color: var(--invalid); }
.mx-ip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; min-height: 40px; padding: 6px 10px; margin: 0;
  border-radius: 10px; cursor: pointer; transition: background var(--dur-fast);
}
.mx-ip .form-check-input { margin: 0; flex: none; }
.mx-ip .mono { font-size: var(--fs-sm); color: var(--text); }
.mx-ip .t-mute { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mx-ip:hover { background: var(--row-hover); }
.mx-ip:has(input:checked) { background: var(--row-selected); }
.mx-ip:has(input:disabled) { cursor: default; opacity: .55; }
.mx-ip:has(input:focus-visible) { outline: 2px solid var(--b); outline-offset: -2px; }
/* Admin "Create servers": free IPs grouped by pool */
.cs-ips { max-height: 320px; overflow: auto; overscroll-behavior: contain; padding: 6px 8px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cs-ips-pool { position: sticky; top: -6px; z-index: 1; margin: 6px -8px 4px; padding: 4px 8px; font-size: var(--fs-xs, .74rem); font-weight: 600; color: var(--text-mute); background: var(--surface); font-family: var(--font-mono, ui-monospace, monospace); }
.cs-ips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 2px 6px; }
.cs-ip { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; margin: 0; border-radius: 8px; cursor: pointer; font-size: .82rem; }
.cs-ip small { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: .7rem; }
.cs-ip .form-check-input { margin: 0; flex: none; }
.cs-ip:hover { background: var(--row-hover); }
.cs-ip:has(input:checked) { background: var(--row-selected); }
.cs-ip:has(input:disabled) { cursor: default; opacity: .55; }
.cs-ips-empty { margin: 0; padding: 8px 4px; font-size: .82rem; color: var(--text-mute); }
.mx-ip-empty { grid-column: 1 / -1; margin: 0; padding: 10px 6px; font-size: var(--fs-sm); color: var(--text-mute); }

/* Summary. Sticky beside the steps on wide screens. */
@media (min-width: 992px) { .mx-sum.mx-sticky { position: sticky; } }
.mx-sum-plan { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.mx-sum-plan b { font: 700 var(--fs-lg)/1.3 var(--display); color: var(--ink); }
.mx-sum-picks { display: grid; gap: 6px; margin: 0 0 14px; }
.mx-sum-picks > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--fs-md); }
.mx-sum-picks dt { font-weight: 500; color: var(--text-mute); flex: none; }
.mx-sum-picks dd { margin: 0; color: var(--text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.mx-sum-lines { display: grid; gap: 6px; margin-top: 4px; }
.mx-sum-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.mx-sum-line > span:last-child { color: var(--text); white-space: nowrap; }
.mx-sum-line.is-discount, .mx-sum-line.is-discount > span:last-child { color: var(--b-success-fg); }
.mx-sum-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--line);
  font: 600 var(--fs-md) var(--sans); color: var(--text);
}
.mx-sum-total b { font: 700 var(--fs-2xl)/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }

.mx-wallet { padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mx-wallet:has(input:checked) { border-color: color-mix(in srgb, var(--dot-ok) 45%, var(--line)); background: color-mix(in srgb, var(--dot-ok) 7%, transparent); }
.mx-wallet .form-check { display: flex; align-items: flex-start; gap: 10px; padding-left: 0; min-height: 28px; }
.mx-wallet .form-check-input { float: none; margin: 2px 0 0; flex: none; width: 2.4em; height: 1.3em; cursor: pointer; }
.mx-wallet .form-check-label { font-size: var(--fs-md); line-height: 1.4; cursor: pointer; }
.mx-wallet.is-short .form-check-input, .mx-wallet.is-short .form-check-label { cursor: not-allowed; }
.mx-wallet.is-short .form-check-label { color: var(--text-mute); }
.mx-wallet-hint { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--text-mute); }
.mx-wallet-hint a { font-weight: 600; }
.mx-sum-cta { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }

/* Phones and tablets: a bar with the total and the button, out of the way
   while the summary's own button is on screen (order.js sets .is-away). */
.mx-checkout-bar { display: none; }
@media (max-width: 991.98px) {
  .mx-order { padding-bottom: 88px; }
  .mx-checkout-bar {
    position: fixed; z-index: 1020;
    left: calc(var(--rail) + 58px); right: 28px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 10px 10px 18px; border: 1px solid var(--bulk-line); border-radius: 20px;
    background: var(--bulk-bg); color: var(--bulk-fg); box-shadow: var(--sh-float);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    transition: transform var(--dur) var(--ease), opacity var(--dur);
  }
  .mx-checkout-bar.is-away { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; visibility: hidden; transition: transform var(--dur) var(--ease), opacity var(--dur), visibility 0s var(--dur); }
  .mx-checkout-sum { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .mx-checkout-sum b { font: 700 var(--fs-xl)/1.2 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .mx-checkout-bar .btn { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 700; padding-inline: 18px; }
}
@media (max-width: 620px) {
  .mx-checkout-bar { left: calc(var(--rail) + 12px); right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding-left: 14px; }
  .mx-checkout-bar .btn { padding-inline: 14px; }
  .mx-ip-filter { width: 100%; }
  .mx-qty { max-width: none; }
}
[data-skin="black"] .mx-checkout-bar { box-shadow: 0 24px 60px -20px color-mix(in srgb, var(--a) 55%, transparent); }
[data-theme="light"] .mx-checkout-bar { box-shadow: var(--sh-float); }

/* ─── Tracker ────────────────────────────────────────────────────────────── */
.mx-trk { --k: var(--b); }
/* Light: the AA cyan, so the active step number reads on its tint. The states below still win. */
[data-theme="light"] .mx-trk { --k: var(--k-cyan); }
.mx-trk.is-unpaid { --k: var(--k-amber); }
.mx-trk.is-ready { --k: var(--dot-ok); }
.mx-trk.is-failed { --k: var(--dot-bad); }
.mx-trk.is-cancelled { --k: var(--text-mute); }
/* Built, but not running now: suspended or needing help (amber), deleted (grey). */
.mx-trk.is-held { --k: var(--k-amber); }
.mx-trk.is-gone { --k: var(--text-mute); }
[data-skin="black"] .card.mx-trk { border-color: color-mix(in srgb, var(--k) 32%, var(--line)); }
.mx-trk-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; }
.mx-trk-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  color: var(--k); background: color-mix(in srgb, var(--k) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 35%, transparent);
}
.mx-trk-icon svg { width: 26px; height: 26px; }
.mx-trk.is-building .mx-trk-icon { color: #fff; background: var(--grad); box-shadow: 0 12px 30px -12px var(--a); }
.mx-trk-intro { flex: 1 1 260px; min-width: 0; }
.mx-trk-lead { font: 700 var(--fs-xl)/1.35 var(--display); letter-spacing: -.01em; color: var(--ink); margin: 2px 0 4px; overflow-wrap: anywhere; }
.mx-trk-cta { display: flex; gap: 8px; margin-left: auto; align-self: center; }
.mx-trk-cta .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }

/* Placed → Paid → Building → Ready. Across on wide screens, down on phones. */
.mx-trk-steps { --dot: 34px; list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mx-trk-steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 4px; }
.mx-trk-steps li + li::before {
  content: ""; position: absolute; top: calc(var(--dot) / 2 - 1px); right: calc(50% + var(--dot) / 2 + 6px); left: calc(-50% + var(--dot) / 2 + 6px);
  height: 2px; border-radius: 2px; background: var(--track);
}
.mx-trk-steps li.is-done + li::before { background: var(--grad); }
.mx-trk-dot {
  width: var(--dot); height: var(--dot); border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  font: 700 var(--fs-sm)/1 var(--sans); color: var(--text-mute); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.mx-trk-dot svg { width: 16px; height: 16px; }
.mx-trk-steps .is-done .mx-trk-dot { color: #fff; background: var(--grad); box-shadow: none; }
.mx-trk-steps .is-active .mx-trk-dot { color: var(--k); background: color-mix(in srgb, var(--k) 14%, transparent); box-shadow: inset 0 0 0 2px var(--k); }
/* Light: the active number on its own tint stays AA (4.8:1 with the darker cyan above). */
[data-theme="light"] .mx-trk-steps .is-active .mx-trk-dot { background: color-mix(in srgb, var(--k) 8%, transparent); }
.mx-trk-steps .is-active .mx-trk-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--k); opacity: 0;
  animation: mx-trk-ping 1.8s var(--ease) infinite;
}
.mx-trk-steps .is-failed .mx-trk-dot { color: #fff; background: var(--dot-bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot-bad) 22%, transparent); }
.mx-trk-steps .is-cancelled .mx-trk-dot { color: var(--text-mute); background: var(--surface-3); }
.mx-trk-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mx-trk-txt b { font: 600 var(--fs-md)/1.3 var(--sans); color: var(--text-mute); }
.mx-trk-steps .is-done .mx-trk-txt b, .mx-trk-steps .is-active .mx-trk-txt b { color: var(--text); }
.mx-trk-steps .is-failed .mx-trk-txt b { color: var(--b-danger-fg); }
.mx-trk-txt small { font-size: var(--fs-xs); color: var(--text-mute); font-variant-numeric: tabular-nums; }
@keyframes mx-trk-ping { 0% { transform: scale(.85); opacity: .7; } 80%, 100% { transform: scale(1.35); opacity: 0; } }

@media (max-width: 575.98px) {
  .mx-trk-head { gap: 12px 14px; }
  .mx-trk-icon { width: 42px; height: 42px; border-radius: 13px; }
  .mx-trk-icon svg { width: 22px; height: 22px; }
  .mx-trk-intro { flex: 1 1 0; }
  .mx-trk-lead { font-size: var(--fs-lg); }
  .mx-trk-steps { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 18px; }
  .mx-trk-steps li { flex-direction: row; align-items: center; text-align: left; gap: 12px; padding: 0; }
  .mx-trk-steps li + li::before { top: calc(-14px + 2px); bottom: auto; left: calc(var(--dot) / 2 - 1px); right: auto; width: 2px; height: 10px; }
  .mx-trk-cta { margin-left: 0; width: 100%; }
  .mx-trk-cta .btn { flex: 1 1 auto; justify-content: center; }
}

/* An indeterminate bar while the build runs. */
.mx-trk-bar { position: relative; height: 4px; margin-top: 20px; border-radius: 4px; background: var(--track); overflow: hidden; }
.mx-trk-bar > i { position: absolute; top: 0; bottom: 0; left: 0; width: 38%; border-radius: inherit; background: var(--grad); animation: mx-trk-slide 1.6s var(--ease) infinite; }
@keyframes mx-trk-slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.mx-trk-note { max-width: 72ch; }
.mx-trk-fail { display: flex; align-items: flex-start; gap: 10px; }
.mx-trk-fail > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* Just turned ready: a one-off pop on the tick (order.js skips it for reduced motion). */
.mx-trk.is-celebrate .mx-trk-icon { animation: mx-trk-pop .7s var(--ease) both; }
.mx-trk.is-celebrate .mx-trk-icon svg { stroke-dasharray: 60; animation: mx-trk-draw .8s .15s var(--ease) both; }
@keyframes mx-trk-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: none; } }
@keyframes mx-trk-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }

/* Server rows. */
.mx-trk-host { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.mx-trk-host .os-logo { margin: 0; }
.mx-trk-host .mono { font-weight: 600; overflow-wrap: anywhere; }
.mx-trk-ip { display: inline-flex; align-items: center; gap: 8px; }
.mx-trk-ip .mono { font-size: var(--fs-md); color: var(--text); }
.mx-trk-copy { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; flex: none; }
.mx-trk-table td[data-actions] .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 760px) {
  .mx-trk-copy { width: 40px; height: 40px; }
}

/* ─── Orders list ────────────────────────────────────────────────────────── */
.mx-pay-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mx-pay-banner > svg { width: 22px; height: 22px; flex: none; }
.mx-pay-banner > div { min-width: 200px; }
.mx-pay-banner .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; flex: none; font-weight: 700; }
@media (max-width: 620px) {
  .mx-pay-banner { align-items: flex-start; }
  .mx-pay-banner > div { min-width: 0; flex: 1 1 calc(100% - 40px); }
  .mx-pay-banner .btn { width: 100%; justify-content: center; }
}
.mx-orders-num { font-weight: 600; text-decoration: none; }
.mx-orders-num:hover { text-decoration: underline; }
.mx-orders-os { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.mx-orders td[data-actions] .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mx-orders-more-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: #fff; background: var(--grad); box-shadow: 0 10px 26px -12px var(--a);
}
.mx-orders-more-icon svg { width: 22px; height: 22px; }
.mx-orders-more .btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
@media (max-width: 620px) { .mx-orders-more .btn { width: 100%; justify-content: center; } }

/* ─── Checkout hand-off ──────────────────────────────────────────────────── */
.mx-paying-icon {
  width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--b-warning-fg); background: var(--b-warning-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-amber) 35%, transparent);
}
.mx-paying-icon[hidden] { display: none; }
.mx-paying-icon svg { width: 26px; height: 26px; }
.mx-paying .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mx-trk-steps .is-active .mx-trk-dot::after, .mx-trk.is-celebrate .mx-trk-icon, .mx-trk.is-celebrate .mx-trk-icon svg { animation: none; }
  .mx-trk-bar > i { animation: none; width: 100%; opacity: .5; }
  .mx-checkout-bar, .mx-checkout-bar.is-away, .mx-plan, .mx-cat-go svg, .mx-plan-cta svg, #osList, #ipList { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Billing, wallet, API keys, activity and support tickets
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Billing, tickets, API access and activity (D2) ─────────────────────────
   client/billing/{invoices,invoice,transactions,wallet}.php, client/tickets/
   {index,show,create}.php, client/api/index.php and client/activity/index.php.
   Lists use .table-stack (labelled cards at 760px and below); these rules add
   the pay-first invoice, the wallet's segmented amounts, ticket threads as a
   conversation and the API key banner. Colours come from tokens, so both
   themes follow; motion stills under prefers-reduced-motion. */

/* ─── Shared ─────────────────────────────────────────────────────────────── */
.card-header .mx-bill-filter { width: 220px; }
@media (max-width: 760px) {
  .card-header .mx-bill-filter { flex: 1 1 100%; width: auto; margin-left: 0 !important; }
}
.mx-bill-num { font-weight: 600; font-size: var(--fs-sm); }

/* A row that needs the reader: a 3px bar on its leading edge and a faint tint.
   Overdue invoices are red, tickets waiting on the client are the info tone. */
.mx-bill-table > tbody > tr.is-overdue > td { background: color-mix(in srgb, var(--red) 5%, transparent); }
.mx-bill-table > tbody > tr.is-overdue > td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.mx-tk-table > tbody > tr.is-yours > td { background: var(--al-info-bg); }
.mx-tk-table > tbody > tr.is-yours > td:first-child { box-shadow: inset 3px 0 0 var(--dot-info); }
@media (max-width: 760px) {
  .mx-bill-table > tbody > tr.is-overdue > td,
  .mx-tk-table > tbody > tr.is-yours > td { background: transparent; }
  .mx-bill-table > tbody > tr.is-overdue > td:first-child,
  .mx-tk-table > tbody > tr.is-yours > td:first-child { box-shadow: none; }
  .mx-bill-table > tbody > tr.is-overdue { background: color-mix(in srgb, var(--red) 5%, transparent); box-shadow: inset 3px 0 0 var(--red); }
  .mx-tk-table > tbody > tr.is-yours { background: var(--al-info-bg); box-shadow: inset 3px 0 0 var(--dot-info); }
}

/* Activity tabs and other phone lists: the row's title leads its card. */
@media (max-width: 760px) {
  .mx-act-table > tbody > tr > td[data-primary] { order: -1; }
}

.mx-led-desc { font-weight: 500; }
.mx-tk-link { font-weight: 600; color: var(--text); text-decoration: none; }
.mx-tk-link:hover, .mx-tk-link:focus-visible { color: var(--link); text-decoration: underline; }

/* ─── Invoice list rail ──────────────────────────────────────────────────── */
.mx-bill-amount {
  font: 750 var(--fs-display)/1.1 var(--display); letter-spacing: -.035em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
/* Unfinished wallet top-ups: told apart from the amount due. */
.mx-bill-topnote .card-body { display: flex; align-items: flex-start; gap: 10px; color: var(--text-dim); }
.mx-bill-topnote .card-body > svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--k-purple); }

/* ─── One invoice ────────────────────────────────────────────────────────── */
.mx-inv-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px 18px; margin: 0;
}
.mx-inv-meta dt { margin-bottom: 4px; }
.mx-inv-meta dd { margin: 0; font-weight: 600; color: var(--text); }

.table.mx-inv-items > tfoot > tr > * { border-top: 0; padding-top: 6px; padding-bottom: 6px; }
.table.mx-inv-items > tfoot > tr:first-child > * { border-top: 1px solid var(--line); padding-top: 14px; }
.table.mx-inv-items > tfoot > tr:last-child > * { padding-bottom: 14px; }
.table.mx-inv-items > tfoot > tr.mx-inv-total > * {
  border-top: 1px solid var(--line); padding-top: 12px;
  font-weight: 700; font-size: var(--fs-lg); color: var(--ink);
}
@media (max-width: 760px) {
  /* Totals stay "label … amount" on one line rather than stacking. */
  .table.mx-inv-items > tfoot > tr {
    grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
    padding: 4px 16px; border-bottom: 0;
  }
  .table.mx-inv-items > tfoot > tr > th { text-align: left !important; }
  .table.mx-inv-items > tfoot > tr:first-child { border-top: 1px solid var(--line); padding-top: 14px; }
  .table.mx-inv-items > tfoot > tr:last-child { padding-bottom: 14px; }
  .table.mx-inv-items > tfoot > tr > * { border-top: 0 !important; padding: 0 !important; }
  .table.mx-inv-items > tfoot > tr.mx-inv-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
}

/* The pay card: amount due first, then the ways to pay. */
.mx-pay .card-body { padding: 22px; }
.mx-pay-amount {
  font: 750 34px/1.1 var(--display); letter-spacing: -.035em;
  color: var(--ink); font-variant-numeric: tabular-nums; margin: 2px 0 4px;
}
[data-skin="black"] .card.mx-pay.is-overdue { border-color: var(--r-line); }
.mx-pay-note {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5;
}
.mx-pay-note > svg { width: 16px; height: 16px; margin-top: 2px; color: var(--text-mute); }
.mx-pay-note.is-warn { border-color: var(--al-danger-line); background: var(--al-danger-bg); color: var(--al-danger-fg); }
.mx-pay-note.is-warn > svg { color: currentColor; }

.mx-pay-actions { display: grid; gap: 10px; margin-top: 18px; }
.mx-pay-actions form { margin: 0; }
/* Long labels ("Pay ₹12,345.00 with Razorpay") wrap instead of overflowing. */
.mx-pay-actions .btn { white-space: normal; line-height: 1.25; min-height: 46px; padding-top: 8px; padding-bottom: 8px; text-align: center; }
.mx-pay-or {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 -2px;
  color: var(--text-mute); font-size: var(--fs-xs); font-weight: 600;
}
.mx-pay-or::before, .mx-pay-or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }

.mx-pay .card-footer a { display: inline-flex; align-items: center; gap: 6px; }
.mx-pay-mark {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--b-success-bg); color: var(--b-success-fg);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--dot-ok) 10%, transparent);
}
.mx-pay-mark > svg { width: 26px; height: 26px; }
.mx-pay-mark.is-off { background: var(--b-neutral-bg); color: var(--b-neutral-fg); box-shadow: none; }

/* Phones and tablets: a bar at the bottom of the screen while the pay card is
   out of view. Sticky at the end of the content, like the bulk-action bar, so
   it never sits over the side rail. billing.js hides it while #pay shows. */
.mx-paybar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--solid); color: var(--text); box-shadow: var(--sh-float);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
.mx-paybar.is-hidden { transform: translateY(16px); opacity: 0; pointer-events: none; }
.mx-paybar-text { min-width: 0; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-paybar-text b { font-size: var(--fs-lg); color: var(--ink); }
.mx-paybar .btn { min-height: 40px; padding: 0 22px; flex: none; }
.mx-pay:focus { outline: none; }
.mx-pay:focus-visible { outline: 2px solid var(--b); outline-offset: 3px; }
#pay { scroll-margin-top: 16px; }

/* ─── Wallet ─────────────────────────────────────────────────────────────── */
.mx-bill-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mx-bill-alert > svg { width: 20px; height: 20px; flex: none; }
.mx-bill-alert .btn { flex: none; }
/* The message sits beside its icon; only a narrow screen pushes it underneath. */
.mx-bill-alert > .flex-grow-1 { flex: 1 1 260px; min-width: 0; }

.mx-topup-amount { font-size: var(--fs-xl); font-weight: 700; }
#topup { scroll-margin-top: 16px; }

/* Preset amounts: one segmented control that wraps into even rows on phones. */
.btn-group.mx-seg {
  display: flex; flex-wrap: wrap; gap: 3px; width: 100%;
  padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.btn-group.mx-seg > .btn {
  flex: 1 1 auto; min-width: 0; min-height: 40px; margin: 0 !important; padding: 0 10px;
  border: 0; border-radius: 11px !important; background: transparent; color: var(--text-dim);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; box-shadow: none;
}
.btn-group.mx-seg > .btn.is-wide { flex-basis: 110px; }
.btn-group.mx-seg > .btn:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.btn-group.mx-seg > .btn[aria-pressed="true"] {
  background: var(--g-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--g-line);
}
.btn-group.mx-seg > .btn:focus-visible { outline: 2px solid var(--b); outline-offset: 1px; z-index: 1; }

/* ─── Tickets: the thread ────────────────────────────────────────────────── */
.mx-tk-head { align-items: flex-start; gap: 12px; }
.mx-tk-subject {
  margin: 0 0 4px; font: 600 var(--fs-xl)/1.3 var(--display); letter-spacing: -.01em;
  color: var(--ink); overflow-wrap: anywhere;
}
.mx-tk-head > .badge { flex: none; margin-top: 3px; }

.mx-thread { display: flex; flex-direction: column; gap: 16px; }
.mx-day {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 -4px;
  color: var(--text-mute); font-size: var(--fs-xs); font-weight: 600;
}
.mx-day::before, .mx-day::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }
.mx-day > span { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }

.mx-msg {
  display: flex; align-items: flex-end; gap: 10px; max-width: min(84%, 680px);
  scroll-margin-top: 90px; scroll-margin-bottom: 120px;
}
.mx-msg.is-staff { margin-right: auto; }
.mx-msg.is-me { margin-left: auto; flex-direction: row-reverse; }

.mx-msg-ava {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 700 var(--fs-xs)/1 var(--display); letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--line);
}
.mx-msg.is-staff .mx-msg-ava {
  border: 0; color: var(--on-a);
  background: linear-gradient(var(--veil), var(--veil)), linear-gradient(135deg, var(--a), var(--b));
}

.mx-msg-body {
  min-width: 0; padding: 10px 14px 12px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2);
}
/* The corner nearest the speaker is tucked in. */
.mx-msg.is-staff .mx-msg-body { border-bottom-left-radius: 6px; }
.mx-msg.is-me .mx-msg-body {
  border-bottom-right-radius: 6px;
  background: var(--pick-selected); border-color: var(--line-2);
  border-color: color-mix(in srgb, var(--a) 28%, transparent);
}
.mx-msg-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 4px;
  color: var(--text-mute); font-size: var(--fs-xs);
}
.mx-msg-meta b { color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.mx-msg.is-me .mx-msg-meta { justify-content: flex-end; }
.mx-msg-tag { font-size: var(--fs-xs); padding: 2px 8px; }
.mx-msg-text {
  color: var(--text); font-size: var(--fs-md); line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.mx-msg-text a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.mx-msg-text .t-mono { font-size: .92em; }

/* The message the page was opened at (#reply-123 after sending) glows once. */
.mx-msg:target .mx-msg-body { animation: mx-msg-flash 1.8s var(--ease) 1; }
@keyframes mx-msg-flash {
  0%, 35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--b) 45%, transparent); }
  100%    { box-shadow: 0 0 0 3px transparent; }
}

@media (max-width: 575.98px) {
  .mx-msg { max-width: 94%; gap: 8px; }
  .mx-msg-ava { width: 28px; height: 28px; }
  .mx-msg-body { padding: 9px 12px 11px; }
}

/* Whose turn it is, above the reply box. */
.card-footer.mx-tk-foot { padding: 18px 22px 22px; }
.mx-turn {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.mx-turn > svg { width: 20px; height: 20px; color: var(--text-mute); }
.mx-turn > div { flex: 1 1 220px; min-width: 0; }
.mx-turn b { display: block; color: var(--ink); font-weight: 600; }
.mx-turn span { color: var(--text-mute); font-size: var(--fs-sm); }
.mx-turn.is-yours { border-color: var(--al-info-line); background: var(--al-info-bg); }
.mx-turn.is-yours > svg, .mx-turn.is-yours b { color: var(--al-info-fg); }
.mx-turn.is-closed { margin-bottom: 0; }
.mx-turn.is-closed > svg { color: var(--b-success-fg); }
.mx-turn .btn { flex: none; }

.mx-reply { scroll-margin-top: 90px; }
.mx-reply textarea { resize: vertical; min-height: 110px; }
.mx-reply-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.mx-reply-bar kbd {
  padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--surface-2); color: var(--text-dim); font: 600 var(--fs-xs)/1.4 var(--sans);
}
@media (max-width: 575.98px) {
  .card-footer.mx-tk-foot { padding: 14px 16px 18px; }
  .mx-reply-bar .btn { width: 100%; }
}

/* ─── API access ─────────────────────────────────────────────────────────── */
[data-skin="black"] .card.mx-newkey { border-color: var(--al-success-line); box-shadow: 0 0 0 3px var(--b-success-bg), var(--card-shadow); scroll-margin-top: 16px; }
.mx-newkey .card-header > svg:first-child { color: var(--al-success-fg); }
.mx-newkey .form-control { font-size: var(--fs-sm); }

.mx-api-first { max-width: 460px; margin: 8px auto 0; padding-top: 20px; border-top: 1px solid var(--line); }
.mx-api-first h2 { font-family: var(--display); color: var(--ink); }

/* "Your browser is at …  [Copy]": a full 40px target, beside the IP or under it. */
.mx-api-yourip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 8px; }
.mx-api-yourip > span { min-width: 0; overflow-wrap: anywhere; }
.mx-api-copyip.btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; }
.mx-api-copyip.btn svg { width: 15px; height: 15px; }

.mx-api-req { font-size: var(--fs-sm); }
.mx-api-req > b { color: var(--link); font-weight: 700; margin-right: 2px; }
.table > tbody > tr.mx-api-wl > td { padding: 16px 22px; background: var(--surface-2); text-align: left; white-space: normal; }
@media (max-width: 760px) {
  .table-stack > tbody > tr.mx-api-wl { padding: 14px 16px; background: var(--surface-2); }
  .table-stack > tbody > tr.mx-api-wl > td { background: transparent; text-align: left; }
}

.mx-code {
  margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--text-dim);
  font: 500 var(--fs-xs)/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ─── Activity ───────────────────────────────────────────────────────────── */
/* The three tabs scroll sideways inside their own strip on a narrow phone. */
.mx-act-tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mx-act-tabs::-webkit-scrollbar { display: none; }
.mx-act-tabs .nav-tabs { min-width: max-content; }
.mx-act-tabs .nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.mx-act-tabs .nav-link svg { width: 16px; height: 16px; }

/* ─── Motion ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mx-paybar { transition: none; }
  .mx-msg:target .mx-msg-body { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--b) 45%, transparent); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Sign-in pages: two-column layout, value panel, theme toggle, light network background
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Sign-in pages (layouts/auth.php, auth/*) ────────────────────────────────
   The card with the form; from 992px a glass panel beside it that sells the
   service (lockup, categories, locations, OS logos, the lowest price). Below
   992px a small lockup above the card and a one-line strip under it. The
   error pages share the layout and get the single centred card. Tokens only,
   so both themes follow; light-only tweaks are at the end. */

/* Layout: one column on phones, card + panel side by side from 992px. */
.ad-auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 440px);
  justify-content: center; justify-items: stretch; align-content: center; align-items: center; column-gap: 48px;
  padding: 20px 16px 12px; /* the body already pads for a notch */
}
.ad-auth-card { width: 100%; max-width: none; min-width: 0; }

/* The lockup above the card: compact on phones so the form starts high. */
.ad-auth-brand {
  display: flex; justify-content: center; width: max-content; margin: 0 auto 14px;
  border-radius: 14px; gap: 0;
}
.ad-auth-brand img { width: 120px; }
.ad-auth-brand:focus-visible, .ad-auth-show-brand:focus-visible { outline: 2px solid var(--b); outline-offset: 4px; }

/* The card. A denser glass than the panel cards so the moving network never
   competes with the form. */
[data-skin="black"] .ad-auth-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)), rgba(8, 8, 12, .62);
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
}
.ad-auth-panel > .card-body { padding: 28px; }
.ad-auth-again .ad-auth-panel { animation: none; }

.ad-auth-h {
  margin: 0 0 4px; color: var(--ink);
  font: 700 var(--fs-2xl)/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance;
}
.ad-auth-sub { margin: 0 0 22px; color: var(--mut); font-size: var(--fs-md); line-height: 1.55; text-wrap: pretty; }
.ad-auth-who { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }

/* Phones: the card starts at the top (no centring gap above it), and 16px
   fields so iOS doesn't zoom in on focus. */
@media (max-width: 575.98px) {
  .ad-auth { align-content: start; }
  .ad-auth .form-control { font-size: var(--fs-lg); }
}

/* ─── The plan (or API access) being signed in for ───────────────────────── */
.ad-auth-intent {
  display: flex; align-items: center; gap: 12px; margin: -4px 0 22px; padding: 10px 6px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--a) 34%, var(--line)); border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--a) 13%, transparent), color-mix(in srgb, var(--b) 6%, transparent));
}
.ad-auth-intent .os-logo { width: 38px; height: 38px; }
.ad-auth-intent-ico {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px var(--a);
}
.ad-auth-intent-ico svg { width: 20px; height: 20px; }
.ad-auth-intent-txt { flex: 1; min-width: 0; }
.ad-auth-intent-txt p { margin: 0; color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.45; }
.ad-auth-intent-txt b { color: var(--ink); font-weight: 700; }
.ad-auth-intent-price { color: var(--ink); font-weight: 600; white-space: nowrap; }
.ad-auth-intent-txt small { display: block; margin-top: 1px; color: var(--mut); font-size: var(--fs-xs); line-height: 1.4; }
.ad-auth-intent-change {
  display: inline-flex; align-items: center; flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px;
  color: var(--link); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ad-auth-intent-change:hover { background: var(--surface-2); color: var(--ink); }

/* ─── The one error slot above the sign-in form ──────────────────────────── */
.ad-auth-alert {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px;
  font-size: var(--fs-sm); line-height: 1.5;
}
.ad-auth-alert > svg { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.ad-auth-alert p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ad-auth-again .ad-auth-alert { animation: ad-auth-shake .42s var(--ease) both; }
@keyframes ad-auth-shake {
  20% { translate: -5px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; }
}

/* ─── Fields ─────────────────────────────────────────────────────────────── */
.ad-auth-labelrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: .35rem; }
.ad-auth-labelrow .form-label { margin: 0; }
.ad-auth-forgot {
  margin: -.35rem -.5rem; padding: .35rem .5rem; border-radius: 8px;
  color: var(--link); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
}
.ad-auth-forgot:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.ad-upper { text-transform: uppercase; }
.ad-auth .invalid-feedback a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Password with a show/hide button inside the field (app.js flips it). */
.ad-pw { position: relative; }
.ad-pw > .form-control, .ad-pw > .form-control.is-invalid { padding-right: 52px; background-image: none; }
.ad-pw > input::-ms-reveal, .ad-pw > input::-ms-clear { display: none; }
.ad-pw-btn {
  position: absolute; top: 2px; right: 2px; bottom: 2px; width: 44px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--mut); cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.ad-pw-btn svg { width: 20px; height: 20px; }
.ad-pw-btn:hover { background: var(--surface-2); color: var(--ink); }
.ad-pw-btn:focus-visible { outline: 2px solid var(--b); outline-offset: -2px; }
.ad-pw-btn[aria-pressed="true"] { color: var(--b); }

/* "8+ characters" and "Passwords match": a ring that fills with a tick. */
.ad-pw-hints { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.ad-pw-hint {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--mut); font-size: var(--fs-xs); font-weight: 600; transition: color var(--dur) var(--ease);
}
.ad-pw-hint i {
  display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line-hi); color: transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ad-pw-hint svg { width: 10px; height: 10px; stroke-width: 3.2; }
.ad-pw-hint.is-met { color: var(--k-green); }
.ad-pw-hint.is-met i { background: var(--k-green); border-color: var(--k-green); color: var(--solid); }

.ad-caps { margin: 6px 0 0; color: var(--k-amber); font-size: var(--fs-xs); font-weight: 600; }
.ad-caps:empty { margin: 0; }

/* Optional billing details on sign-up: one tap away, open when filled. */
.ad-auth-more { margin: 4px 0 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ad-auth-more > summary {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px;
  border-radius: 15px; list-style: none; cursor: pointer; user-select: none;
}
.ad-auth-more > summary::-webkit-details-marker { display: none; }
.ad-auth-more > summary:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }
.ad-auth-more-ico {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--b);
}
.ad-auth-more-ico svg { width: 18px; height: 18px; }
.ad-auth-more-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.ad-auth-more-txt b { color: var(--ink); font-size: var(--fs-md); font-weight: 600; }
.ad-auth-more-txt small { color: var(--mut); font-size: var(--fs-xs); }
.ad-auth-more-chev { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--mut); transition: transform var(--dur) var(--ease), color var(--dur-fast); }
.ad-auth-more-chev svg { width: 18px; height: 18px; }
.ad-auth-more > summary:hover .ad-auth-more-chev { color: var(--ink); }
.ad-auth-more[open] .ad-auth-more-chev { transform: rotate(45deg); }
.ad-auth-more-body { padding: 14px 14px 16px; border-top: 1px solid var(--line); }
.ad-auth-more[open] .ad-auth-more-body { animation: ad-auth-open var(--dur) var(--ease); }
@keyframes ad-auth-open { from { opacity: 0; translate: 0 -4px; } }

/* Submit: the arrow nudges forward under a mouse. */
.ad-auth-go svg { transition: transform var(--dur) var(--ease); }
@media (hover: hover) and (pointer: fine) { .ad-auth-go:hover svg { transform: translateX(3px); } }

.ad-auth-alt { margin: 20px 0 0; color: var(--mut); font-size: var(--fs-sm); text-align: center; }
.ad-auth-alt a { padding: 10px 2px; color: var(--link); font-weight: 600; text-decoration: none; }
.ad-auth-alt a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ─── "Check your email" and "This link has expired" ─────────────────────── */
.ad-auth-done { text-align: center; }
.ad-auth-done-ico {
  display: inline-grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--b) 36%, transparent);
  background: color-mix(in srgb, var(--b) 13%, transparent); color: var(--b);
}
.ad-auth-done-ico svg { width: 26px; height: 26px; }
.ad-auth-done-ico.is-warn {
  border-color: color-mix(in srgb, var(--k-amber) 38%, transparent);
  background: color-mix(in srgb, var(--k-amber) 13%, transparent); color: var(--k-amber);
}
.ad-auth-done .ad-auth-sub { margin-bottom: 10px; }
.ad-auth-note { margin: 0; color: var(--mut); font-size: var(--fs-sm); line-height: 1.55; text-wrap: pretty; }
.ad-auth-actions { display: grid; gap: 10px; margin-top: 22px; }
.ad-auth-actions form { margin: 0; }
.ad-auth-actions .btn:disabled { opacity: .6; }

/* ─── Under the card on phones: flags, the lowest price, pricing link ────── */
.ad-auth-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 8px;
  margin: 10px 0 0; color: var(--mut); font-size: var(--fs-sm); text-align: center;
}
.ad-auth-strip b { color: var(--ink); font-weight: 700; }
.ad-auth-strip a {
  display: inline-flex; align-items: center; min-height: 40px;
  color: var(--link); font-weight: 600; text-decoration: none;
}
.ad-auth-strip a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ad-auth-flags { font-size: var(--fs-lg); line-height: 1; letter-spacing: 2px; }
.ad-auth-dot { color: var(--text-faint); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.ad-auth-foot {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 10px;
  margin: 14px 0 0; color: var(--mut); font-size: var(--fs-xs); text-align: center;
}
.ad-auth-foot nav { display: flex; flex-wrap: wrap; justify-content: center; }
.ad-auth-foot nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px;
  color: var(--mut); text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.ad-auth-foot nav a:hover { color: var(--ink); }

/* ─── Theme toggle in the corner ─────────────────────────────────────────── */
/* Scrolls away on phones so it never sits over a field; fixed from 992px. */
.ad-auth-theme.ad-theme {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 20;
  width: 44px; height: 44px; min-height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(10, 10, 14, .55); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ad-auth-theme.ad-theme:hover { border-color: var(--line-hi); color: var(--ink); }
.ad-auth-theme.ad-theme:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }

/* ─── The value panel (992px and up, sign-in and sign-up only) ───────────── */
.ad-auth-show {
  position: relative; display: none; flex-direction: column; gap: 22px; min-width: 0;
  padding: 34px 34px 28px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015) 60%), rgba(8, 8, 12, .35);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 40px 100px -50px rgba(0, 0, 0, .9);
  animation: ad-auth-show-in .8s var(--ease) .08s backwards;
}
.ad-auth-show::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px 260px at 100% 0%, color-mix(in srgb, var(--a) 22%, transparent), transparent 70%),
    radial-gradient(360px 240px at 0% 100%, color-mix(in srgb, var(--b) 12%, transparent), transparent 70%);
}
.ad-auth-again .ad-auth-show { animation: none; }
@keyframes ad-auth-show-in { from { opacity: 0; translate: 14px 0; } }

.ad-auth-show-brand { align-self: flex-start; display: inline-flex; border-radius: 14px; }
.ad-auth-show-brand img {
  width: 180px; height: auto;
  filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--a) 35%, transparent));
}
.ad-auth-show-h {
  margin: -4px 0 0; color: var(--ink);
  font: 700 var(--fs-display)/1.15 var(--display); letter-spacing: -.03em; text-wrap: balance;
}
.ad-auth-grad {
  color: var(--a);
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .ad-auth-grad { background: none; -webkit-text-fill-color: currentColor; }
}

.ad-auth-cats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px;
  margin: 0; padding: 0; list-style: none;
}
.ad-auth-cats li {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.ad-auth-cats div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ad-auth-cats b { color: var(--ink); font-size: var(--fs-md); font-weight: 700; }
.ad-auth-cats span { color: var(--mut); font-size: var(--fs-xs); }

.ad-auth-fact h3 { margin: 0 0 10px; color: var(--mut); }
.ad-auth-zones, .ad-auth-os { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ad-auth-zones li {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
}
.ad-auth-flag { font-size: var(--fs-lg); line-height: 1; }
.ad-auth-zones li.is-out { border-style: dashed; color: var(--mut); }
.ad-auth-zones li.is-out .ad-auth-flag { filter: grayscale(1); opacity: .6; }
.ad-auth-zones small {
  margin-left: 2px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--mut); font-size: var(--fs-xs); font-weight: 600;
}
.ad-auth-os .os-logo { width: 40px; height: 40px; border-radius: 11px; transition: translate var(--dur) var(--ease); }
@media (hover: hover) and (pointer: fine) { .ad-auth-os li:hover .os-logo { translate: 0 -2px; } }

.ad-auth-show-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-top: 2px; padding-top: 20px; border-top: 1px solid var(--line);
}
.ad-auth-show-foot p { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 0; color: var(--text-dim); font-size: var(--fs-sm); }
.ad-auth-show-foot b { color: var(--ink); font-weight: 700; }
.ad-auth-show-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.ad-auth-show-link svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.ad-auth-show-link:hover { border-color: var(--line-hi); background: var(--surface-3); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .ad-auth-show-link:hover svg { transform: translateX(3px); } }

/* ─── Breakpoints ────────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .ad-auth-panel > .card-body { padding: 22px 18px; }
  .ad-auth-intent { gap: 10px; padding-left: 10px; }
}
@media (min-width: 992px) {
  .ad-auth { padding: 40px 32px; }
  .ad-auth-brand { margin-bottom: 20px; }
  .ad-auth-brand img { width: 168px; }
  .ad-auth-theme.ad-theme { position: fixed; top: 20px; right: 20px; }
  .ad-auth-foot { margin-top: 24px; }

  .ad-auth.has-show { grid-template-columns: minmax(360px, 440px) minmax(0, 520px); }
  .ad-auth.has-show .ad-auth-brand, .ad-auth.has-show .ad-auth-strip { display: none; }
  .ad-auth-show { display: flex; }
}
/* Below about 1160px the two columns reach the right edge, under the fixed
   theme toggle (20px in, 44px wide). Keep a 76px gutter on that side so the
   panel never slides under it, even scrolled, and take 16px from the gap so
   the panel keeps its width. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .ad-auth.has-show { padding-right: 76px; column-gap: 32px; }
}
@media (min-width: 992px) and (max-width: 1139.98px) {
  .ad-auth-show { padding: 28px 26px 24px; }
}

/* ─── Light theme ────────────────────────────────────────────────────────── */
[data-theme="light"] .ad-auth-panel {
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 30px 80px -40px color-mix(in srgb, var(--a) 32%, rgba(15, 23, 42, .4));
}
[data-theme="light"] .ad-auth-show {
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 30px 80px -44px rgba(15, 23, 42, .3);
}
[data-theme="light"] .ad-auth-show::before {
  background:
    radial-gradient(420px 260px at 100% 0%, color-mix(in srgb, var(--a) 11%, transparent), transparent 70%),
    radial-gradient(360px 240px at 0% 100%, color-mix(in srgb, var(--b) 8%, transparent), transparent 70%);
}
[data-theme="light"] .ad-auth-brand img,
[data-theme="light"] .ad-auth-show-brand img { filter: drop-shadow(0 8px 22px rgba(124, 58, 237, .16)); }
[data-theme="light"] .ad-auth-theme.ad-theme { background: rgba(255, 255, 255, .82); box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .3); }
[data-theme="light"] .ad-auth-intent { background: linear-gradient(120deg, color-mix(in srgb, var(--a) 8%, #fff), color-mix(in srgb, var(--b) 5%, #fff)); }
[data-theme="light"] .ad-auth-more { background: var(--surface-2); }
[data-theme="light"] .ad-auth-more-ico { background: #fff; }
[data-theme="light"] .ad-auth-zones small { background: var(--surface-3); color: var(--text-dim); }

/* The network behind the card, calmer on white: faint cloud fills, lighter
   wires and halos, and a softer glow (skin.js sets --gi inline per size). */
[data-theme="light"] .ad-net { --net-halo-a: .16; --net-halo-b: .14; }
[data-theme="light"] .ad-net-glow { opacity: calc(var(--gi, 1) * .6); }
[data-theme="light"] .ad-net-shape { fill: rgba(15, 23, 42, .03); }
[data-theme="light"] .ad-net-wire { stroke-opacity: .3; }
[data-theme="light"] .ad-net .data-path { stroke-opacity: .22; }
[data-theme="light"] .ad-net .data-path.flow { stroke-opacity: .7; }
[data-theme="light"] .ad-net .data-particle { stroke-opacity: .22; }
[data-theme="light"] .ad-net .bit { fill: var(--a); }

/* Browsers without color-mix(): fixed tints for the default palette. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .ad-auth-intent { border-color: rgba(139, 92, 246, .34); background: rgba(139, 92, 246, .1); }
  .ad-auth-done-ico { border-color: rgba(34, 211, 238, .36); background: rgba(34, 211, 238, .13); }
  .ad-auth-done-ico.is-warn { border-color: rgba(251, 191, 36, .38); background: rgba(251, 191, 36, .13); }
  .ad-auth-show::before { background: radial-gradient(420px 260px at 100% 0%, rgba(139, 92, 246, .2), transparent 70%); }
  .ad-auth-show-brand img { filter: drop-shadow(0 10px 30px rgba(139, 92, 246, .35)); }
  [data-theme="light"] .ad-auth-intent { background: rgba(124, 58, 237, .06); }
  [data-theme="light"] .ad-auth-panel { box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 30px 80px -40px rgba(124, 58, 237, .3); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Error pages
   ═══════════════════════════════════════════════════════════════════════════ */
/* ─── Error pages (errors/error.php) ──────────────────────────────────────────
   The status code as a gradient mark, a sentence-case headline, one line of
   help, the requested path on a 404, the log reference on a 500, and up to
   three ways on. Drawn inside the auth layout's card; tokens only, so both
   themes follow. */

.ad-err { text-align: center; padding: 4px 0 2px; }

/* The code: big Sora numerals in the accent gradient, with a soft glow. */
.ad-err-code {
  display: inline-block; margin: 0 0 10px; padding: 0 .04em;
  font: 700 64px/1 var(--display); letter-spacing: -.045em; font-variant-numeric: tabular-nums;
  color: var(--a);
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 26px color-mix(in srgb, var(--a) 40%, transparent));
  user-select: none;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .ad-err-code { background: none; -webkit-text-fill-color: currentColor; }
}

.ad-err-title {
  margin: 0 0 8px; color: var(--ink);
  font: 700 var(--fs-2xl)/1.25 var(--display); letter-spacing: -.02em; text-wrap: balance;
}
.ad-err-text {
  max-width: 34ch; margin: 0 auto 20px; color: var(--mut);
  font-size: var(--fs-md); line-height: 1.6; text-wrap: pretty;
}
/* Positioned, so wherever the reference chip's stretched tap area (below)
   still reaches the support link, the link paints and takes the tap: it
   comes later in the tree. */
.ad-err-text a { position: relative; color: var(--link); text-underline-offset: 3px; overflow-wrap: anywhere; }

/* On a 500, "Email support… if it keeps happening." starts its own line, a
   little under the chip, so the chip keeps a 40px tap area and the address
   isn't split from "Email". */
.ad-err-next { display: block; margin-top: 8px; }

/* The log reference on a 500: a mono chip that copies itself. The ::after
   stretches the tap area to 40px without moving the line. */
.ad-err-ref {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  margin: 0 1px; padding: 1px 8px; vertical-align: baseline;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2);
  color: var(--ink); font: 500 var(--fs-sm)/1.5 var(--mono); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.ad-err-ref::after { content: ""; position: absolute; inset: -9px -4px; }
.ad-err-ref svg { width: 14px; height: 14px; color: var(--mut); }
.ad-err-ref:hover { border-color: var(--line-hi); background: var(--surface-3); }
.ad-err-ref:focus-visible { outline: 2px solid var(--b); outline-offset: 2px; }

/* The address that missed, on a 404. Long paths end in an ellipsis. */
.ad-err-path { display: flex; justify-content: center; margin: -6px 0 20px; }
.ad-err-path span {
  min-width: 0; max-width: 100%; padding: 5px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px dashed var(--line-2); border-radius: 999px; background: var(--surface-2);
  color: var(--text-dim); font-size: var(--fs-sm); line-height: 1.5;
}

/* Ways on: the first is full width; the rest share a row when they fit and
   stack when they don't (a 360px phone stacks all three). */
.ad-err-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ad-err-actions .btn { flex: 1 1 140px; }
.ad-err-actions .btn:first-child { flex-basis: 100%; }

.ad-err-hint { margin: 16px 0 0; color: var(--mut); font-size: var(--fs-sm); line-height: 1.6; }
.ad-err-hint kbd.mx-key { font-size: var(--fs-xs); }

@media (max-width: 480px) {
  .ad-err-code { font-size: 48px; margin-bottom: 8px; }
  .ad-err-title { font-size: var(--fs-xl); }
}

/* Light: a gentler glow on white. */
[data-theme="light"] .ad-err-code { filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--a) 22%, transparent)); }
[data-theme="light"] .ad-err-ref,
[data-theme="light"] .ad-err-path span { background: var(--surface-3); }

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .ad-err-code { filter: drop-shadow(0 10px 26px rgba(139, 92, 246, .4)); }
  [data-theme="light"] .ad-err-code { filter: drop-shadow(0 8px 20px rgba(124, 58, 237, .22)); }
}

/* ─── Touch targets: 40px on phones and touch screens ─────────────────────── */
/* Loads after skin.css, so these win at equal specificity. Small buttons, page
   links, the toast close, the sign-in "Forgot password?" link, breadcrumbs and
   the admin bulk-select boxes all get a 40px hit area without changing the
   layout on a mouse-driven desktop. */
@media (pointer: coarse), (max-width: 575.98px) {
  [data-skin="black"] .btn-sm { min-height: 40px; }
  .pagination .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  /* A 40px hit area that does not make the toast taller. */
  .mx-toast .x { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; margin: -10px -12px -10px -4px; border-radius: 10px; }
  .ad-auth-forgot { display: inline-flex; align-items: center; min-height: 40px; margin: -.6rem -.5rem; }
  .mx-crumb a { display: inline-flex; align-items: center; min-height: 40px; }
  .mx-check-hit { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; margin: -8px; cursor: pointer; }
}

/* Admin IP pool: the Single IP / Range switch shows only the chosen mode's fields
   (both stay visible where :has() is unsupported). */
.mx-ip-add:has(#ipModeSingle:checked) .mx-ip-range,
.mx-ip-add:has(#ipModeRange:checked) .mx-ip-single { display: none; }

/* ─── Emailed sign-in codes, staff sign-in, "sign in as client" ───────────── */
/* The 6-digit code box (sign-in pages and the profile's two-step card). */
.ad-otp {
  font-family: var(--mono); font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: .4em; text-align: center; padding-left: calc(.75rem + .4em);
}
.ad-otp::placeholder { color: var(--text-faint); opacity: .55; }
.ad-auth-code { margin-bottom: 4px; }
.ad-auth-code-note { margin-top: 14px; text-align: center; }
/* "Staff sign-in →" under the client sign-in form: small and quiet. */
.ad-auth-staff { margin: 6px 0 0; text-align: center; font-size: var(--fs-sm); }
.ad-auth-staff a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 6px;
  color: var(--mut); font-weight: 600; text-decoration: none;
}
.ad-auth-staff a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Admin client page: how the account signs in. */
.mx-signin { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--fs-md); }
.mx-signin dt { color: var(--mut); font-weight: 500; }
.mx-signin dd { margin: 0; overflow-wrap: anywhere; }

/* The bar along the bottom while an admin is signed in as a client. */
.mx-imp {
  position: fixed; z-index: 1040;
  left: calc(var(--rail) + 44px); right: 24px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px; max-width: 920px; margin: 0 auto;
  padding: 8px 8px 8px 12px; border: 1px solid var(--a-line); border-radius: 14px;
  background: var(--solid); color: var(--ink); font-size: var(--fs-sm);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .55);
}
.mx-imp::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--a-soft); pointer-events: none; }
.mx-imp > * { position: relative; }
.mx-imp-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--amber); }
.mx-imp-ico svg { width: 18px; height: 18px; }
.mx-imp-txt { flex: 1; min-width: 0; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.mx-imp-mail { color: var(--mut); }
.mx-imp form { flex: none; margin: 0; }
[data-skin="black"] .mx-imp-back { min-height: 36px; border: 1px solid var(--a-line); background: transparent; color: var(--ink); font-weight: 600; }
[data-skin="black"] .mx-imp-back:hover, [data-skin="black"] .mx-imp-back:focus-visible { background: var(--a-soft); color: var(--ink); }
body.is-impersonating .ad-main { padding-bottom: 100px; }
@media (max-width: 620px) {
  .mx-imp { left: calc(var(--rail) + 12px); right: 10px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; padding-left: 8px; }
  [data-skin="black"] .mx-imp-back { min-height: 40px; }
}
/* Phones and tablets: the order page's checkout bar rides above this bar, not under it
   (this bar is at most ~80px tall when the name and email wrap on a narrow phone; the
   page's own 88px plus .ad-main's 100px still clear both). */
@media (max-width: 991.98px) {
  body.is-impersonating .mx-checkout-bar { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
