/* SityLink — clean operator dashboard.
   White sidebar with grouped navigation, soft blue-grey canvas, blue primary,
   colored icon tiles on stat cards. Light and dark themes via tokens. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf2;
  --line-2: #d4dbe8;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --side: #ffffff;
  --side-ink: #334155;
  --side-muted: #94a3b8;
  --side-hover: #f1f5fb;
  --ok: #15803d;   --ok-bg: #e7f7ed;
  --warn: #a16207; --warn-bg: #fdf4dc;
  --err: #c0262d;  --err-bg: #fdecec;
  --info: #1d4ed8; --info-bg: #e8effd;
  --sim: #6b21a8;  --sim-bg: #f3e8fd;
  --violet: #7c3aed; --violet-bg: #f1eafe;
  --cyan: #0891b2;   --cyan-bg: #e0f6fa;
  --green: #16a34a;  --green-bg: #e5f7ec;
  --amber: #d97706;  --amber-bg: #fdf1df;
  --bar-revenue: #3b82f6;
  --bar-usage: #06b6d4;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .05);
  --focus: 0 0 0 3px rgba(37, 99, 235, .35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 256px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111a2e; --surface-2: #0f1729; --ink: #e6ebf5; --ink-2: #c4cddc; --muted: #8a97ad;
    --line: #1e2a44; --line-2: #2b3a5c; --primary: #4f8cff; --primary-hover: #6ea1ff; --primary-soft: #182a4f;
    --side: #0f1729; --side-ink: #c4cddc; --side-muted: #64748b; --side-hover: #16213a;
    --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #33270b; --err: #f87171; --err-bg: #3a1618;
    --info: #93b4ff; --info-bg: #172647; --sim: #d8b4fe; --sim-bg: #2b1a40;
    --violet: #a78bfa; --violet-bg: #251c45; --cyan: #22d3ee; --cyan-bg: #0e2e36; --green: #4ade80; --green-bg: #12301f; --amber: #fbbf24; --amber-bg: #33270b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111a2e; --surface-2: #0f1729; --ink: #e6ebf5; --ink-2: #c4cddc; --muted: #8a97ad;
  --line: #1e2a44; --line-2: #2b3a5c; --primary: #4f8cff; --primary-hover: #6ea1ff; --primary-soft: #182a4f;
  --side: #0f1729; --side-ink: #c4cddc; --side-muted: #64748b; --side-hover: #16213a;
  --ok: #4ade80; --ok-bg: #12301f; --warn: #fbbf24; --warn-bg: #33270b; --err: #f87171; --err-bg: #3a1618;
  --info: #93b4ff; --info-bg: #172647; --sim: #d8b4fe; --sim-bg: #2b1a40;
  --violet: #a78bfa; --violet-bg: #251c45; --cyan: #22d3ee; --cyan-bg: #0e2e36; --green: #4ade80; --green-bg: #12301f; --amber: #fbbf24; --amber-bg: #33270b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 1rem; }
code { font: .85em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; overflow-wrap: anywhere; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- Shell ---------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 12px; z-index: 30; }
.brand a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px 8px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; flex: none; }
.brand-mark .brand-icon { stroke: #fff; width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; font-weight: 800; font-size: 1.12rem; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.brand-icon { width: 26px; height: 26px; stroke: var(--primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-group { margin-bottom: 10px; }
.nav-label { margin: 10px 12px 4px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--side-muted); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a, .nav-btn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: .93rem; }
.nav a:hover, .nav-btn:hover { background: var(--side-hover); color: var(--ink); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active .icon { stroke: var(--primary); }
.nav-btn { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.org { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org-badge { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; }
.org-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; text-transform: capitalize; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--primary); border-color: var(--line-2); }
.menu-btn { display: none; }
.theme-btn .icon-sun { display: none; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }
:root[data-theme="dark"] .theme-btn .icon-moon { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none; }
.avatar:hover { color: #fff; filter: brightness(1.08); }
.scrim { display: none; }
.main { padding: 24px clamp(16px, 2.4vw, 40px) 64px; width: 100%; outline: none; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 20px; }
.page-head-row { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.subtitle { color: var(--muted); margin: 4px 0 0; max-width: 75ch; }
.back { display: inline-block; margin-bottom: 6px; font-size: .9rem; text-decoration: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter { display: flex; gap: 8px; align-items: center; }
.filter label { white-space: nowrap; }
.filter select { min-width: 180px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title-pad { padding: 16px 20px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-card { max-width: 780px; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 25%, var(--line)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-2.gap { gap: 18px; }
.grid-2.gap > .card { margin-bottom: 0; }
.grid-2.gap { margin-bottom: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-main .form-card { max-width: none; }
/* Settings (pages with section tabs) use the full width. */
.tabs ~ .form-card, .tabs ~ * .form-card { max-width: none; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--primary); color: var(--ink); }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-l { font-weight: 600; color: var(--muted); font-size: .88rem; }
.stat-n { font-size: 1.75rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.stat-s { color: var(--muted); font-size: .8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.stat-ico .icon { width: 21px; height: 21px; }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-cyan { background: var(--cyan-bg); color: var(--cyan); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.trend { font-weight: 700; font-size: .76rem; border-radius: 999px; padding: 1px 7px; }
.trend.up { color: var(--ok); background: var(--ok-bg); }
.trend.down { color: var(--err); background: var(--err-bg); }
.trend.flat { color: var(--muted); background: var(--surface-2); }
.setup h2 { margin-bottom: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-grid; place-items: center; font-size: .75rem; color: #fff; flex: none; }
.checklist li.done .tick { background: var(--primary); border-color: var(--primary); }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart-revenue .bar { fill: var(--bar-revenue); }
.chart-usage .bar { fill: var(--bar-usage); }
.chart .bar:hover { opacity: .8; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list.compact li { padding: 6px 0; justify-content: flex-start; }
.list-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dot-status { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot-status.ok { background: var(--green); }
.dot-status.error { background: var(--err); }
.dot-status.stale { background: var(--amber); }
.plain { padding-left: 1.2rem; }
.plain li { margin-bottom: 6px; }
.kv { margin: 0; display: grid; gap: 8px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.kv-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); column-gap: 24px; }
.iface { list-style: none; padding: 0; columns: 2; margin: 8px 0 0; }
.iface li { margin-bottom: 4px; }
.stack { display: inline-flex; flex-direction: column; }
.steps-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 16px 40px; margin: 0 0 18px; box-shadow: var(--shadow); }
.steps-list li { margin: 4px 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { margin-left: 6px; }
.details { white-space: pre-wrap; word-break: break-all; display: inline-block; max-width: 420px; }
.code { font: 600 .92rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-decoration: none; }
.code-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.code-grid li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

/* ---------- Toolbar, tabs, search ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; width: fit-content; flex-wrap: wrap; }
.toolbar .tabs { margin-bottom: 0; }
.tab { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tab .count { font-size: .74rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.tab.active .count { background: var(--surface); color: var(--primary); }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search input[type=search] { min-width: 220px; }
.search select { width: auto; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 9px 16px; font: 600 .9rem/1.2 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(.92); color: #fff; }
.btn-block { width: 100%; padding: 12px; }
.btn:disabled, fieldset:disabled .btn { opacity: .55; cursor: not-allowed; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }

/* ---------- Forms ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
fieldset fieldset { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; font-size: 1rem; }
fieldset fieldset legend { float: left; width: 100%; padding-top: 4px; }
fieldset fieldset legend + * { clear: both; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.req { color: var(--err); }
.opt { font-weight: 400; color: var(--muted); font-size: .82rem; }
input:not([type=checkbox]):not([type=color]):not([type=radio]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px;
}
textarea { resize: vertical; }
textarea.script { font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); white-space: pre; overflow-wrap: normal; overflow-x: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--surface-2); color: var(--muted); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err); }
.hint { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.error { margin: 5px 0 0; color: var(--err); font-size: .86rem; font-weight: 500; }
.field-check .check, label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.field-check input, label.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.inline-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.2fr auto; gap: 0 12px; align-items: end; }
.field-btn { align-self: end; }
.color-row { display: flex; gap: 8px; }
.color-row input[type=color] { width: 48px; height: 42px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); flex: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.choice { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.choice:hover { border-color: var(--primary); color: var(--ink); }
.choice-featured { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%); }
.choice span:last-child { color: var(--muted); font-size: .9rem; }
.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 8px 0 14px; }
.disclosure summary { cursor: pointer; font-weight: 600; }
.disclosure[open] summary { margin-bottom: 12px; }

/* ---------- Badges & notices ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; border: 1px solid transparent; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-error { background: var(--err-bg); color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.badge-sim { background: var(--sim-bg); color: var(--sim); border-style: dashed; border-color: color-mix(in srgb, var(--sim) 40%, transparent); }
.flash { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.support-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.support-bar form { margin: 0; }
.flash-error { background: var(--err-bg); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 25%, transparent); }
.notice { border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; font-size: .92rem; }
.notice ul { margin: 6px 0 0; padding-left: 1.2rem; }
.notice-warn { background: var(--warn-bg); color: var(--warn); }
.notice-error { background: var(--err-bg); color: var(--err); }
.notice-info { background: var(--info-bg); color: var(--info); }
.notice-sim { background: var(--sim-bg); color: var(--sim); border: 1px dashed color-mix(in srgb, var(--sim) 40%, transparent); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 44px 20px; }
.empty h2 { font-size: 1.1rem; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; }
.fp { font-size: .78rem; word-break: break-all; }
.tls { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.ticket { text-align: center; border: 2px dashed var(--primary); }
.big-code { font: 800 2.2rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; margin: 6px 0; color: var(--primary); }

/* ---------- Packages ---------- */
.pkg header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pkg h2 { margin: 0; font-size: 1.05rem; }
.pkg h2 a { color: var(--ink); text-decoration: none; }
.price { font-weight: 800; color: var(--primary); margin: 0; font-size: 1.15rem; white-space: nowrap; }

/* ---------- Portal studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.studio-preview { position: sticky; top: 76px; }
.phone { border: 10px solid #1d2433; border-radius: 30px; overflow: hidden; background: #f3f6f5; max-width: 380px; margin: 0 auto 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.phone iframe { display: block; width: 100%; height: 600px; border: 0; background: #f3f6f5; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 30%); padding: 14px 0 4px; }
.pipeline { list-style: none; display: flex; gap: 0; padding: 0; margin: 0 0 18px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; font-size: .9rem; padding: 4px 18px 4px 0; position: relative; }
.step + .step::before { content: ""; width: 22px; height: 2px; background: var(--line-2); margin-right: 4px; }
.step .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.step-done { color: var(--ink-2); }
.step-done .dot { background: var(--primary); border-color: var(--primary); }
.step-current { color: var(--ink); font-weight: 700; }
.step-current .dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.step-failed { color: var(--err); font-weight: 700; }
.step-failed .dot { background: var(--err); border-color: var(--err); }
.events { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.ev { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ev-step { font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.ev-warn .ev-msg { color: var(--warn); }
.ev-error .ev-msg { color: var(--err); font-weight: 500; }
.ev time { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; }
.auth-split { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
.auth-hero { background: linear-gradient(150deg, #1e40af, #2563eb 55%, #0ea5e9); color: #fff; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.auth-hero h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; margin: 28px 0 12px; letter-spacing: -.02em; }
.auth-hero p { opacity: .9; max-width: 44ch; font-size: 1.02rem; }
.auth-hero .auth-brand { color: #fff; }
.auth-hero .brand-icon { stroke: #fff; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.auth-points .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: rgba(255,255,255,.16); }
.auth-wrap { max-width: 520px; width: 100%; margin: 0 auto; padding: 48px 20px; align-self: center; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.auth-brand-sm { display: none; margin-bottom: 18px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); max-width: 440px; }
.auth-card-wide { max-width: 560px; }
.auth-card fieldset { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.auth-switch { margin: 16px 0 0; color: var(--muted); }
.auth-foot { color: var(--muted); font-size: .85rem; margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .studio, .grid-main { grid-template-columns: 1fr; }
  .studio-preview { position: static; }
  .inline-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 25; }
  .menu-btn { display: inline-grid; }
  .chip { display: none; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-brand-sm { display: flex; }
}
@media (max-width: 720px) {
  .main { padding: 18px 16px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.gap > .card { margin-bottom: 0; }
  .inline-grid { grid-template-columns: 1fr; }
  .search input[type=search] { min-width: 0; flex: 1; }
  .filter select { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 4px 16px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; }
  .row-actions { justify-content: flex-end !important; }
  .ev { grid-template-columns: 1fr; gap: 2px; }
  .phone iframe { height: 520px; }
  .stat-n { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Add-router wizard (NettPortal-style modal) ---------- */
.wz-backdrop { min-height: calc(100vh - 140px); display: grid; place-items: start center; padding: 8px 0 40px; }
.wz { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(15, 23, 42, .18); padding: 22px 22px 18px; }
.wz-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.wz-head h1 { font-size: 1.3rem; margin: 0; }
.wz-head p { margin: 2px 0 0; font-size: .88rem; }
.wz-head .icon-btn { text-decoration: none; flex: none; }
.wz-steps { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px 18px; margin: 0; }
.wz-steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .85rem; color: var(--muted); }
.wz-steps li span:last-child { display: flex; flex-direction: column; }
.wz-steps small { font-size: .72rem; }
.wz-steps .wz-line { flex: 1; height: 2px; background: var(--line-2); margin: 0 10px 34px; }
.wz-steps .wz-line.done { background: var(--green); }
.wz-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; border: 2px solid var(--line-2); background: var(--surface); color: var(--muted); }
.wz-steps li.current { color: var(--ink); }
.wz-steps li.current .wz-dot { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.wz-steps li.done .wz-dot { background: var(--green); border-color: var(--green); color: #fff; }
.wz-form .lbl { font-weight: 600; font-size: .88rem; margin-bottom: 6px; float: none; padding: 0; }
.wz-form fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface-2); }
.tile input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.tile:not(.tile-check) input { position: absolute; opacity: 0; }
.tile:not(.tile-check) span { width: 100%; text-align: center; }
.tile span { display: flex; flex-direction: column; gap: 2px; }
.tile small { color: var(--muted); font-size: .76rem; }
.tile small.net { opacity: .8; }
.tile:has(input:checked) { border-color: var(--green); background: var(--green-bg); }
.tile:has(input:checked) strong { color: var(--green); }
.tile:has(input:focus-visible) { box-shadow: var(--focus); }
.tile-wide { margin-top: 10px; }
.segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px 6px; border: 1.5px solid var(--line-2); border-radius: 10px; font-weight: 600; font-size: .82rem; background: var(--surface-2); }
.seg input:checked + span { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.wz-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.wz-foot form { display: contents; }
.wz-foot .btn { width: 100%; padding: 12px; }
.wz-foot .btn-primary { background: var(--green); }
.wz-foot .btn-primary:hover { filter: brightness(.95); background: var(--green); }
.wz-foot .is-waiting { background: var(--line-2); color: var(--muted); pointer-events: none; }
.wz-router { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.wz-other { text-align: center; margin: 14px 0 0; }
.wz-panel { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.wz-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.wz-panel h2 { margin: 0; font-size: 1rem; color: var(--green); }
.wz-panel p { margin: 2px 0 0; }
.cmd { border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.cmd-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cmd-text { border: 0 !important; border-radius: 0 !important; font: .8rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace !important; background: var(--surface) !important; resize: none; word-break: break-all; min-height: 120px; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.cmd-head .btn-primary { background: var(--green); }
.wz-status { margin: 0; }
@media (max-width: 640px) {
  .tiles, .segs { grid-template-columns: 1fr 1fr; }
  .wz { padding: 16px 14px; border-radius: 14px; }
}
/* ---------- Setup feature checklist ---------- */
.feature-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface-2); }
.feature-list li span:last-child { display: flex; flex-direction: column; min-width: 0; }
.feature-list small { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.feature-list .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; flex: none; background: var(--line); color: var(--muted); }
.feature-list li.on .tick { background: var(--green); color: #fff; }
.notice-ok-soft { background: var(--ok-bg); color: var(--ok); }

/* ---------- Captive portal editor ---------- */
.studio { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.studio .studio-preview { position: sticky; top: 76px; }
.studio .phone { max-width: 400px; }
.studio .phone iframe { height: 680px; }
.ed-panel { padding: 16px; }
.editor .ed-radio { position: absolute; opacity: 0; pointer-events: none; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.ed-tabs label { padding: 6px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.ed-tabs label:hover { background: var(--surface-2); color: var(--ink); }
#ed-template:checked ~ .ed-tabs label[for=ed-template],#ed-text:checked ~ .ed-tabs label[for=ed-text],#ed-background:checked ~ .ed-tabs label[for=ed-background],#ed-fonts:checked ~ .ed-tabs label[for=ed-fonts],#ed-colors:checked ~ .ed-tabs label[for=ed-colors],#ed-button:checked ~ .ed-tabs label[for=ed-button],#ed-settings:checked ~ .ed-tabs label[for=ed-settings] { background: var(--green-bg); color: var(--green); }
.ed-pane { display: none; }
#ed-template:checked ~ .ed-body [data-pane=template],#ed-text:checked ~ .ed-body [data-pane=text],#ed-background:checked ~ .ed-body [data-pane=background],#ed-fonts:checked ~ .ed-body [data-pane=fonts],#ed-colors:checked ~ .ed-body [data-pane=colors],#ed-button:checked ~ .ed-body [data-pane=button],#ed-settings:checked ~ .ed-body [data-pane=settings] { display: block; }
.ed-h { font-weight: 700; margin: 4px 0 8px; }
.ed-body .tiles { margin-bottom: 12px; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.tiles-4 { grid-template-columns: repeat(2, 1fr); }
.ed-body input[type=range] { width: 100%; accent-color: var(--primary); }
.ed-status { margin: 8px 0 0; }
.input-sm { width: 120px !important; min-height: 32px !important; padding: 4px 8px !important; font-size: .8rem !important; display: inline-block; }
@media (max-width: 1080px) { .studio { grid-template-columns: minmax(0, 1fr); } .studio .studio-preview { position: static; } .studio .phone iframe { height: 560px; } }
@media (max-width: 600px) {
  .studio { gap: 12px; }
  .studio .phone { border-width: 6px; border-radius: 22px; max-width: 320px; }
  .studio .phone iframe { height: 500px; }
  .studio-preview .card-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .studio-preview .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .ed-panel { padding: 12px; }
  .ed-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ed-tabs label { white-space: nowrap; flex: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions > .btn, .page-head .actions > form { flex: 1 1 auto; }
}
/* ---------- Tabbed panels (gateways, payment methods) ---------- */
.tabset .tab-radio { position: absolute; opacity: 0; pointer-events: none; }
.gw-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.gw-tabs label { padding: 9px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.gw-tabs label:hover { color: var(--ink); }
#gt-paystack:checked ~ .gw-tabs label[for=gt-paystack], #gt-hubtel:checked ~ .gw-tabs label[for=gt-hubtel], #gt-wpp:checked ~ .gw-tabs label[for=gt-wpp],
#pt-wpp:checked ~ .gw-tabs label[for=pt-wpp], #pt-paystack:checked ~ .gw-tabs label[for=pt-paystack], #pt-hubtel:checked ~ .gw-tabs label[for=pt-hubtel] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
#gt-paystack:checked ~ [data-tab=paystack], #gt-hubtel:checked ~ [data-tab=hubtel], #gt-wpp:checked ~ [data-tab=wpp],
#pt-wpp:checked ~ [data-tab=wpp], #pt-paystack:checked ~ [data-tab=paystack], #pt-hubtel:checked ~ [data-tab=hubtel] { display: block; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font: .85rem ui-monospace, Menlo, monospace !important; }
/* ---- Add-router pop-up (MikroTik / Ruijie) ---- */
.modal { display: none; position: fixed; inset: 0; z-index: 60; place-items: center; padding: 16px; }
.modal:target { display: grid; }
.v-buyer { white-space: nowrap; }
.v-phone { margin-left: 4px; font-variant-numeric: tabular-nums; }
.modal-scrim { position: absolute; inset: 0; background: rgba(8, 14, 30, .55); }
.modal-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.3); width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.vendor-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.vendor-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.vendor-card:hover, .vendor-card:focus-visible { border-color: var(--primary); transform: translateY(-2px); color: var(--ink); }
.vendor-card strong { font-size: 1.15rem; }
.vendor-card > span:not(.vendor-logo):not(.badge) { color: var(--muted); font-size: .9rem; }
.vendor-logo { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; color: #fff; }
.vendor-mikrotik { background: linear-gradient(135deg, #293a52, #4d6a8f); }
.vendor-ruijie { background: linear-gradient(135deg, #c8102e, #f05a28); }
.vendor-more { margin: 14px 0 0; }

/* ---- Guided steps (Ruijie flow) ---- */
.steps { list-style: none; counter-reset: st; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; align-items: start; }
.steps li::before { content: counter(st); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.steps li.now::before { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.steps li.done::before { content: "✓"; background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.steps li span { color: var(--muted); font-size: .9rem; }

/* ---- Super-admin site ---- */
.admin-site .sidebar { border-right-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.admin-site .brand-mark { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.chip-admin { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); text-transform: none; }
.auth-wrap-solo { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
pre.raw { margin: 0; max-height: 360px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
/* ---- Captive portal live connection banner ---- */
.live-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: var(--surface); }
.live-live { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.live-updating { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.live-offline, .live-stuck { background: var(--err-bg); border-color: color-mix(in srgb, var(--err) 35%, transparent); }
.live-updating .badge::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; animation: live-pulse 1s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-updating .badge::before { animation: none; } }
/* Portal studio: Buy / Login tab order (swapped by portal-studio.js) */
.tab-order { margin: 4px 0 14px; }
.to-track { display: flex; align-items: stretch; gap: 10px; }
.to-chip { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: grab; transition: transform .38s cubic-bezier(.2, .8, .2, 1), border-color .2s, box-shadow .2s, background .2s; }
.to-chip span { display: grid; line-height: 1.25; }
.to-chip small { color: var(--muted); font-size: .78rem; }
.to-chip .icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--surface-2); stroke: var(--muted); flex: none; }
.to-chip.is-first { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.to-chip.is-first .icon { background: var(--primary); stroke: var(--primary-ink); }
.to-chip.is-first small::before { content: "Opens first · "; font-weight: 600; color: var(--primary); }
.to-chip:active { cursor: grabbing; }
.to-chip.dragging { opacity: .45; }
.to-chip.drop-target { border-style: dashed; border-color: var(--primary); }
.to-swap { flex: none; align-self: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--primary); font-size: 1.15rem; cursor: pointer; }
.to-swap:hover { background: var(--primary-soft); }
.to-swap.spin { animation: to-spin .38s ease; }
@keyframes to-spin { from { transform: rotate(-180deg); } to { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .to-chip { transition: none; } .to-swap.spin { animation: none; } }
@media (max-width: 420px) { .to-chip small { display: none; } }

/* Free access */
.fa-list { display: grid; gap: 14px; }
.fa-card { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.fa-card h2 { margin: 0; font-size: 1.1rem; }
.fa-card p { margin: 6px 0 0; }
.fa-main { flex: 1 1 320px; min-width: 0; }
.fa-on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: linear-gradient(0deg, var(--ok-bg), var(--surface) 70%); }
.tab .count { display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); font-size: .78rem; text-align: center; }
.row-muted td { opacity: .6; }

/* Remote access */
.ra-apps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ra-list { display: grid; gap: 14px; }
.ra-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ra-head h2 { margin: 0; font-size: 1.1rem; }
.ra-head p { margin: 4px 0 0; }
.ra-ip { font-size: .95rem; font-weight: 700; }
.ra-configs { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.ra-config { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.ra-config-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ra-config-actions .icon { width: 16px; height: 16px; }
.ra-copy { display: grid; gap: 8px; }
.ra-copy textarea { width: 100%; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; }
.ra-new { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ra-new input { flex: 1 1 220px; }

/* SityLink Wallet: money received */
.received { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px 28px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%); }
.received-main { display: grid; gap: 4px; }
.received-total { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.received-periods { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.received-periods > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 120px; }
.received-periods dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.received-periods dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; }
.received-periods dd.small { font-weight: 500; font-size: .8rem; }

/* SMS credits */
.credit-bundles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.credit-bundle button { width: 100%; display: grid; gap: 2px; justify-items: center; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.credit-bundle button:hover, .credit-bundle button:focus-visible { border-color: var(--primary); transform: translateY(-1px); }
.credit-n { font-size: 1.4rem; font-weight: 800; }
.credit-price { font-weight: 700; color: var(--primary); }
.credit-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.credit-custom .field { flex: 1 1 200px; margin: 0; }
.credit-plus { color: var(--ok, #16a34a); }
.credit-minus { color: var(--muted); }
.sms-cost { margin: -4px 0 10px; }
.sms-chip { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sms-chip .icon { width: 15px; height: 15px; color: var(--primary); }
.sms-chip:hover { border-color: var(--primary); color: var(--ink); }
.sms-chip-low { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.sms-chip-low .icon { color: var(--warn); }

/* Bulk SMS */
.sms-tabs { margin-bottom: 16px; }
.sms-filter { display: grid; gap: 14px; margin-bottom: 18px; }
.sms-filter .tabs { margin-bottom: 0; flex-wrap: wrap; }
.sms-filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sms-filter-form .field { margin: 0; flex: 1 1 160px; }
.sms-filter-form .field:first-child { flex: 2 1 240px; }
.sms-filter-form .field-check { flex: 0 0 auto; padding-bottom: 10px; }
.sms-filter-form .field-check label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.sms-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sms-bar p { margin: 0; }
.sms-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sms-actions .icon { width: 16px; height: 16px; }
.sms-compose { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.sms-to { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); margin-bottom: 16px; }
.sms-count { margin: -6px 0 10px; font-weight: 600; color: var(--muted); }
.sms-phone { border: 10px solid #1f2937; border-radius: 34px; background: #1f2937; position: sticky; top: 18px; }
.sms-phone-screen { background: var(--surface-2); border-radius: 24px; min-height: 420px; padding: 18px 14px; }
.sms-phone-from { text-align: center; font-weight: 700; font-size: .85rem; margin: 0 0 16px; color: var(--muted); }
.sms-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 10px 12px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; max-width: 92%; }
.sms-message { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
@media (max-width: 860px) {
  .sms-compose { grid-template-columns: 1fr; }
  .sms-phone { position: static; max-width: 300px; margin: 0 auto; }
  .sms-phone-screen { min-height: 200px; }
}

/* Theme colours (Settings > Appearance): html[data-accent] overrides the primary colour in light and dark. */
html[data-accent="indigo"] { --primary: #4f46e5; --primary-hover: #4338ca; --primary-soft: #ecebfd; --focus: 0 0 0 3px rgba(79, 70, 229, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="indigo"]:not([data-theme="light"]) { --primary: #818cf8; --primary-hover: #a5b4fc; --primary-soft: #23224d; } }
html[data-accent="indigo"][data-theme="dark"] { --primary: #818cf8; --primary-hover: #a5b4fc; --primary-soft: #23224d; }
html[data-accent="violet"] { --primary: #7c3aed; --primary-hover: #6d28d9; --primary-soft: #f1eafe; --focus: 0 0 0 3px rgba(124, 58, 237, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="violet"]:not([data-theme="light"]) { --primary: #a78bfa; --primary-hover: #c4b5fd; --primary-soft: #2a1f4d; } }
html[data-accent="violet"][data-theme="dark"] { --primary: #a78bfa; --primary-hover: #c4b5fd; --primary-soft: #2a1f4d; }
html[data-accent="rose"] { --primary: #e11d48; --primary-hover: #be123c; --primary-soft: #fde8ee; --focus: 0 0 0 3px rgba(225, 29, 72, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="rose"]:not([data-theme="light"]) { --primary: #fb7185; --primary-hover: #fda4af; --primary-soft: #40161f; } }
html[data-accent="rose"][data-theme="dark"] { --primary: #fb7185; --primary-hover: #fda4af; --primary-soft: #40161f; }
html[data-accent="orange"] { --primary: #ea580c; --primary-hover: #c2410c; --primary-soft: #fdeee4; --focus: 0 0 0 3px rgba(234, 88, 12, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="orange"]:not([data-theme="light"]) { --primary: #fb923c; --primary-hover: #fdba74; --primary-soft: #3d2312; } }
html[data-accent="orange"][data-theme="dark"] { --primary: #fb923c; --primary-hover: #fdba74; --primary-soft: #3d2312; }
html[data-accent="emerald"] { --primary: #059669; --primary-hover: #047857; --primary-soft: #e3f6ef; --focus: 0 0 0 3px rgba(5, 150, 105, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="emerald"]:not([data-theme="light"]) { --primary: #34d399; --primary-hover: #6ee7b7; --primary-soft: #0f3a2c; } }
html[data-accent="emerald"][data-theme="dark"] { --primary: #34d399; --primary-hover: #6ee7b7; --primary-soft: #0f3a2c; }
html[data-accent="teal"] { --primary: #0d9488; --primary-hover: #0f766e; --primary-soft: #e0f5f3; --focus: 0 0 0 3px rgba(13, 148, 136, .35); }
@media (prefers-color-scheme: dark) { html[data-accent="teal"]:not([data-theme="light"]) { --primary: #2dd4bf; --primary-hover: #5eead4; --primary-soft: #0f3633; } }
html[data-accent="teal"][data-theme="dark"] { --primary: #2dd4bf; --primary-hover: #5eead4; --primary-soft: #0f3633; }

/* Profile menu (sidebar foot) and pictures */
.avatar.has-img, .org-badge.has-img { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar img, .org-badge img, .brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-link { text-decoration: none; border-radius: 50%; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; flex: none; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; flex: none; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.8rem; flex: none; }
.brand-logo { background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.brand-initials { color: #fff; font-weight: 800; font-size: .9rem; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.profile { position: relative; }
.profile > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.profile > summary::-webkit-details-marker { display: none; }
.profile > summary:hover, .profile[open] > summary { background: var(--side-hover); }
.profile-who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.profile-who strong, .profile-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-who strong { font-size: .9rem; color: var(--ink); }
.profile-who small { color: var(--muted); font-size: .76rem; }
.profile-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.profile:not([open]) .profile-chev { transform: rotate(180deg); }
.profile-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; z-index: 30; animation: pop-in .14s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.profile-card { display: flex; gap: 12px; align-items: center; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.profile-card > div { display: grid; min-width: 0; }
.profile-card span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: .92rem; }
.profile-pop a:hover { background: var(--side-hover); color: var(--ink); }
.profile-pop .icon { width: 18px; height: 18px; }

/* Picture upload and theme picker */
.pic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.pic-actions { display: grid; gap: 8px; justify-items: start; }
.pic-actions .file-btn { position: relative; overflow: hidden; }
.pic-actions .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pic-logo { width: 96px; height: 96px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 1.6rem; color: var(--muted); }
.pic-logo img { width: 100%; height: 100%; object-fit: contain; }
[data-upload-status] { min-height: 1.2em; }
.accent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.accent-opt { position: relative; }
.accent-opt input { position: absolute; opacity: 0; }
.accent-opt label { display: grid; gap: 8px; padding: 12px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); font-weight: 600; transition: border-color .15s, transform .15s; }
.accent-opt label:hover { transform: translateY(-1px); }
.accent-opt input:checked + label { border-color: var(--sw); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw) 25%, transparent); }
.accent-opt input:focus-visible + label { outline: 2px solid var(--sw); outline-offset: 2px; }
.accent-swatch { height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--sw), color-mix(in srgb, var(--sw) 55%, #fff)); }
.sw-blue { --sw: #2563eb; } .sw-indigo { --sw: #4f46e5; } .sw-violet { --sw: #7c3aed; } .sw-rose { --sw: #e11d48; }
.sw-orange { --sw: #ea580c; } .sw-emerald { --sw: #059669; } .sw-teal { --sw: #0d9488; }

/* Staff and admin permissions */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 12px 0; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; }
.perm-group legend { font-weight: 700; padding: 0 6px; font-size: .85rem; }
label.check.perm { font-weight: 500; font-size: .9rem; }
.router-pick { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; display: grid; gap: 10px; }
.router-pick legend { font-weight: 700; padding: 0 6px; font-size: .85rem; }
.router-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; padding-left: 28px; }
.router-pick .hint, .router-pick .error { margin: 0; }
.perm-default, .perm-default-key { display: inline-block; font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--primary-soft, rgba(37,99,235,.12)); color: var(--primary); vertical-align: middle; }

/* Transactions tracker */
.poll-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.poll-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #16a34a); box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: poll-pulse 2s infinite; }
.poll-dot.off { background: var(--muted); animation: none; }
@keyframes poll-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
@media (prefers-reduced-motion: reduce) { .poll-dot { animation: none; } }
.kind-chip { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
/* SityLink logo and router maker logos */
.sity-mark { flex: none; border-radius: 26%; display: block; }
.wordmark { font-weight: 800; letter-spacing: -.01em; color: #0f2a5c; }
.wordmark span { color: #2563eb; }
.brand-text .wordmark { font-size: 1.15rem; }
.auth-brand .wordmark { font-size: 1.45rem; }
.lp-logo .wordmark { font-size: 1.3rem; }
.auth-hero .wordmark { color: #fff; }
.auth-hero .wordmark span { color: #93c5fd; }
.powered { display: inline-flex; align-items: center; gap: 4px; }
.powered img { border-radius: 3px; }
.vlogo { display: inline-block; flex: none; background: #fff; border-radius: 6px; border: 1px solid var(--line); object-fit: contain; vertical-align: middle; }
.vlogo-sm { width: 20px; height: 20px; border-radius: 5px; }
.vlogo-md { width: 28px; height: 28px; }
.vlogo-lg { width: 52px; height: 52px; border-radius: 12px; padding: 2px; }
.vendor { display: inline-flex; align-items: center; gap: 7px; }
.cloud-tag { display: inline-flex; font-size: .78rem; font-weight: 600; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.with-logo { display: inline-flex; align-items: center; gap: 8px; }
.lp-eyebrow .vlogo + .vlogo { margin-left: -4px; }
.lp-eyebrow .vlogo:last-of-type { margin-right: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wordmark { color: #fff; } :root:not([data-theme="light"]) .wordmark span { color: #7cc0ff; } }
:root[data-theme="dark"] .wordmark { color: #fff; }
:root[data-theme="dark"] .wordmark span { color: #7cc0ff; }.auth-hero .sity-mark { box-shadow: 0 0 0 2px rgba(255,255,255,.9); }

/* Router picker: logo then name on one line, whole card is the link */
.modal-card { width: min(860px, 100%); }
.vendor-pick { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.vendor-card, .vendor-card:hover, .vendor-card:focus-visible, .vendor-card * { text-decoration: none !important; }
.vendor-card { cursor: pointer; gap: 12px; padding: 22px 24px; min-height: 150px; justify-content: flex-start; }
.vendor-card-head { display: flex; align-items: center; gap: 14px; }
.vendor-card-head strong { font-size: 1.2rem; letter-spacing: -.01em; }
.vendor-card .vendor-card-text { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.vendor-card .vlogo-lg { width: 48px; height: 48px; }
.ra-webfig { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }

/* ---------- Load balancing ---------- */
:root { --l1: #2563eb; --l2: #10b981; --l3: #f59e0b; --l4: #8b5cf6; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; font-weight: 800; margin-right: 8px; vertical-align: 2px; }

/* Status diagram: lines → router → customers */
.lb-hero { overflow: hidden; }
.lb-hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lb-hero-head h2 { margin: 0; }
.lb-flow { display: grid; grid-template-columns: minmax(200px, 1.4fr) 70px auto 50px auto; align-items: center; gap: 6px; }
.lb-lines { display: grid; gap: 10px; }
.lb-line { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); border-left: 5px solid var(--line-2); }
.lb-line strong { display: block; font-size: .95rem; }
.lb-line small { color: var(--muted); font-size: .78rem; }
.lb-line-1 { border-left-color: var(--l1); } .lb-line-2 { border-left-color: var(--l2); } .lb-line-3 { border-left-color: var(--l3); } .lb-line-4 { border-left-color: var(--l4); }
.lb-cloud { font-size: 1.5rem; line-height: 1; opacity: .85; }
.lb-state { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.lb-ok .lb-state { color: #15803d; background: #e7f7ed; border-color: #b7e4c7; }
.lb-down .lb-state { color: #b91c1c; background: #fdecec; border-color: #f5c2c2; }
.lb-down { opacity: .85; }
.lb-wires { display: grid; gap: 14px; }
.lb-wires span { height: 3px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 14px); }
.lb-on .lb-wires span { background: repeating-linear-gradient(90deg, var(--primary) 0 8px, transparent 8px 14px); background-size: 28px 3px; animation: lb-flow 1s linear infinite; }
@keyframes lb-flow { from { background-position: 0 0; } to { background-position: 28px 0; } }
.lb-router, .lb-users { display: grid; justify-items: center; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; font-size: .9rem; }
.lb-on .lb-router { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); border-color: var(--primary); }
.lb-users-icon { font-size: 1.6rem; line-height: 1; }
@media (max-width: 760px) {
  .lb-flow { grid-template-columns: 1fr; justify-items: stretch; }
  .lb-wires { grid-auto-flow: column; justify-content: center; } .lb-wires span { width: 3px; height: 22px; background: var(--line-2); }
  .lb-router, .lb-users { justify-self: center; min-width: 160px; }
}
@media (prefers-reduced-motion: reduce) { .lb-on .lb-wires span { animation: none; } }

/* Port picker: each port looks like a network jack with its link light */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 14px 0; }
.port { display: grid; gap: 6px; justify-items: center; text-align: center; }
.port-face { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); transition: transform .12s, border-color .12s, box-shadow .12s; }
.port-face:hover { transform: translateY(-2px); border-color: var(--line-2); }
.port-face:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: 2px; }
.port-jack { position: relative; width: 46px; height: 36px; border-radius: 6px; background: #1f2937; box-shadow: inset 0 -10px 0 #111827; }
.port-jack::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 0; height: 9px; background: #374151; border-radius: 2px 2px 0 0; }
.port-led { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #4b5563; }
.port-up .port-led { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.port-name { font-weight: 800; font-size: .95rem; }
.port-tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.port-role { line-height: 1.25; min-height: 2.5em; }
.port-warn { color: #b45309; line-height: 1.3; }
.port-lan .port-face { border-style: dashed; }
.port-line-1 .port-face { border-color: var(--l1); box-shadow: 0 6px 18px color-mix(in srgb, var(--l1) 25%, transparent); } .port-line-1 .port-tag { background: var(--l1); border-color: var(--l1); color: #fff; }
.port-line-2 .port-face { border-color: var(--l2); box-shadow: 0 6px 18px color-mix(in srgb, var(--l2) 25%, transparent); } .port-line-2 .port-tag { background: var(--l2); border-color: var(--l2); color: #fff; }
.port-line-3 .port-face { border-color: var(--l3); box-shadow: 0 6px 18px color-mix(in srgb, var(--l3) 25%, transparent); } .port-line-3 .port-tag { background: var(--l3); border-color: var(--l3); color: #fff; }
.port-line-4 .port-face { border-color: var(--l4); box-shadow: 0 6px 18px color-mix(in srgb, var(--l4) 25%, transparent); } .port-line-4 .port-tag { background: var(--l4); border-color: var(--l4); color: #fff; }
.port-select { width: 100%; font-size: .8rem; }
.lb-form.js .port-select { display: none; }

/* Fine-tune rows */
.lb-tune summary { cursor: pointer; font-weight: 600; margin-top: 4px; }
.tune-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 10px 12px; margin-top: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tune-name { display: inline-flex; align-items: center; gap: 8px; min-width: 90px; }
.line-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.tune-line-1 .line-dot { background: var(--l1); } .tune-line-2 .line-dot { background: var(--l2); } .tune-line-3 .line-dot { background: var(--l3); } .tune-line-4 .line-dot { background: var(--l4); }
.tune-field { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; }
.tune-field input[type=range] { width: 120px; accent-color: var(--primary); }
.tune-field input:not([type]) , .tune-field input[name^="gateway_"] { width: 150px; }

/* Mode cards */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.mode-card { position: relative; display: grid; gap: 6px; padding: 16px 16px 16px 58px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card small { color: var(--muted); line-height: 1.4; }
.mode-icon { position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 1.1rem; }
.mode-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 20%, transparent); }
.mode-card:has(input:checked) .mode-icon { background: var(--primary); color: #fff; border-color: var(--primary); }
.mode-card:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 50%, transparent); }
.lb-sticky { margin-top: 4px; }

.lb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 6px 0 14px; }
.btn-lg { padding: 13px 26px; font-size: 1rem; border-radius: 14px; }
.btn.is-busy { opacity: .7; cursor: progress; }
.lb-off { margin: -4px 0 18px; }
.lb-manual summary { cursor: pointer; font-weight: 600; }
#lb-script, #lb-remove { width: 100%; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
/* ---------- Routers: glowing status, white names, row menu ---------- */
.glow { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: #9ca3af; }
.glow-on { background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6), 0 0 10px #22c55e; animation: glow-on 2s infinite; }
.glow-off { background: #ef4444; box-shadow: 0 0 10px #ef4444; animation: glow-off 1.6s infinite; }
.glow-wait { background: #9ca3af; }
@keyframes glow-on { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55), 0 0 10px #22c55e; } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0), 0 0 10px #22c55e; } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0), 0 0 10px #22c55e; } }
@keyframes glow-off { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .glow-on, .glow-off { animation: none; } }
.rt-cell { display: flex; align-items: center; gap: 12px; text-decoration: none !important; color: var(--ink); }
.rt-cell:hover .rt-name { color: var(--primary); }
.rt-logo { position: relative; flex: none; display: inline-flex; }
.rt-text { display: grid; gap: 2px; min-width: 0; }
.rt-name { color: var(--ink); font-size: .98rem; transition: color .12s; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; font-size: 1.25rem; line-height: 1; width: 34px; height: 34px; display: grid; place-items: center; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.25); display: grid; }
.row-menu-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.row-menu-pop a:hover { background: var(--surface-2); }

/* ---------- Router page ---------- */
.rt-hero { padding: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)) 0%, var(--surface) 60%); }
.rt-hero-top { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.rt-hero-logo { position: relative; flex: none; }
.rt-hero-logo .vlogo-lg { width: 64px; height: 64px; border-radius: 16px; }
.glow-lg { width: 18px; height: 18px; right: -5px; bottom: -5px; border-width: 3px; }
.rt-hero-id { flex: 1; min-width: 200px; }
.rt-hero-name { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; color: var(--ink); }
.rt-hero-sub { margin: 4px 0 2px; }
.rt-status { font-weight: 700; color: var(--muted); }
.rt-status.st-on { color: #22c55e; } .rt-status.st-off { color: #ef4444; }
.rt-rename > summary { list-style: none; } .rt-rename > summary::-webkit-details-marker { display: none; }
.rt-rename[open] > summary { margin-bottom: 8px; }
.rt-rename-form { display: grid; gap: 8px; min-width: 260px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rt-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 18px 0 14px; }
.rt-chip { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.rt-chip-l { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.rt-chip-v { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.rt-chip-hot { border-color: color-mix(in srgb, #22c55e 45%, var(--line)); } .rt-chip-hot .rt-chip-v { color: #22c55e; }
.rt-chip-money { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); } .rt-chip-money .rt-chip-v { color: var(--primary); }
.rt-meter { display: inline-block; width: 60px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rt-meter-fill { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); border-radius: 999px; }
.w-0 { width: 0%; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.rt-actions .icon { width: 16px; height: 16px; }
.rt-tx-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.rt-tx-totals div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.rt-tx-totals strong { font-size: 1.05rem; }
.rt-tx-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rt-tx-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.rt-tx-amt { font-weight: 800; min-width: 80px; }
.rt-tx-what { display: grid; min-width: 0; }
.rt-tx-what strong { font-size: .9rem; }
.rt-tx-meta { display: grid; justify-items: end; gap: 3px; }
@media (max-width: 560px) { .rt-tx-list li { grid-template-columns: 1fr auto; } .rt-tx-amt { grid-column: 1 / -1; } }
.rt-cell { min-width: 240px; }
.rt-name { white-space: nowrap; }
.rt-text .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

/* ---------- Password eye, confirm-email and reset pages ---------- */
.pw-field { position: relative; }
.pw-field input { padding-right: 46px; width: 100%; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--primary); }
.pw-eye .icon { width: 18px; height: 18px; }
.pw-eye .pw-hide, .pw-eye[aria-pressed="true"] .pw-show { display: none; }
.pw-eye[aria-pressed="true"] .pw-hide { display: block; }
.auth-forgot { margin: -4px 0 12px; text-align: right; font-size: .88rem; }
/* Two-step sign-in (admin site) */
.totp-key { margin: 4px 0 8px; }
.totp-key code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.12)); font-size: 1.05rem; letter-spacing: .06em; text-align: center; word-break: break-all; user-select: all; }
.backup-codes { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.backup-codes code { display: block; padding: 8px; border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.12)); text-align: center; font-size: 1rem; letter-spacing: .05em; }
.two-step-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.auth-card form.auth-switch { text-align: center; }
.auth-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; font-size: 1.6rem; background: color-mix(in srgb, var(--primary) 14%, transparent); margin-bottom: 12px; }
.code-input { width: 100%; text-align: center; font: 800 1.9rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5em; padding: 14px 10px 14px calc(10px + .5em); margin: 6px 0 14px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); color: var(--ink); }
.code-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.auth-inline { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 12px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
/* ---------- Sign-in / sign-up side panel (v2) ---------- */
.auth-split { grid-template-columns: minmax(380px, 1.15fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; justify-content: center; background: radial-gradient(120% 90% at 0% 0%, #1d4ed8 0%, #1e3a8a 45%, #0b1b46 100%); padding: 44px clamp(24px, 4.5vw, 60px); }
.auth-hero-in { position: relative; z-index: 1; max-width: 620px; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.auth-glow-1 { width: 380px; height: 380px; right: -120px; top: -80px; background: #38bdf8; }
.auth-glow-2 { width: 320px; height: 320px; left: -100px; bottom: -120px; background: #f97316; opacity: .35; }
.auth-hero h2 { font-size: clamp(1.7rem, 2.8vw, 2.5rem); margin: 22px 0 10px; }
.auth-hero > .auth-hero-in > p { opacity: .88; max-width: 48ch; }
.auth-live { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 22px; }
.auth-live-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(2,6,23,.25); }
.auth-live-card strong { display: block; font-size: .9rem; }
.auth-live-card small { display: block; font-size: .74rem; opacity: .8; }
.auth-live-pay .icon { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: #22c55e; stroke: #fff; }
.auth-live-pay { transform: translateY(8px); }
.glow-dot { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; animation: glow-on 2s infinite; flex: none; }
.auth-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.auth-tiles li { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); transition: background .15s, transform .15s; }
.auth-tiles li:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.auth-tiles .icon { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: rgba(255,255,255,.16); stroke: #fff; }
.auth-tiles strong { display: block; font-size: .9rem; }
.auth-tiles small { display: block; font-size: .78rem; opacity: .78; line-height: 1.35; margin-top: 2px; }
.auth-works { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; font-size: .8rem; }
.auth-works > span:first-child { opacity: .7; margin-right: 2px; }
.auth-works b { font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.auth-works .vlogo { width: 22px; height: 22px; border: 0; }
.auth-works-sep { width: 1px; height: 18px; background: rgba(255,255,255,.25); margin: 0 4px; }
.auth-lead { margin: -6px 0 16px; }
@media (max-width: 1100px) { .auth-tiles { grid-template-columns: 1fr; } .auth-tiles li:nth-child(n+7) { display: none; } }
/* Phones: a compact panel above the form instead of none at all. */
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: flex; padding: 26px 20px 22px; }
  .auth-hero .auth-brand, .auth-live, .auth-works { display: none; }
  .auth-hero h2 { margin: 0 0 6px; font-size: 1.35rem; }
  .auth-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
  .auth-tiles li { padding: 9px; } .auth-tiles small { display: none; } .auth-tiles li:nth-child(n+5) { display: none; }
  .auth-tiles .icon { width: 28px; height: 28px; padding: 6px; }
}
@media (prefers-reduced-motion: reduce) { .glow-dot { animation: none; } }
/* ---------- Live dot on the router page ---------- */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: 2px; vertical-align: middle; animation: glow-off 1.8s infinite; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---------- Captive portals: one card per router ---------- */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.pt-card { display: grid; grid-template-columns: 116px 1fr; gap: 16px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.04); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pt-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line); }
.pt-card.pt-live::before { background: linear-gradient(90deg, #22c55e, #10b981); }
.pt-card.pt-offline::before, .pt-card.pt-stuck::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.pt-card.pt-updating::before, .pt-card.pt-not-linked::before { background: linear-gradient(90deg, #f59e0b, #eab308); }
.pt-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.12); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.pt-preview { display: block; align-self: start; border-radius: 18px; }
.pt-preview:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.pt-phone { display: block; width: 116px; height: auto; filter: drop-shadow(0 8px 16px rgba(15,23,42,.25)); transition: transform .2s; }
.pt-card:hover .pt-phone { transform: rotate(-2deg) scale(1.03); }
.pt-body { display: grid; align-content: start; gap: 8px; min-width: 0; }
.pt-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-head .rt-name { text-decoration: none; font-weight: 700; }
.pt-head .rt-name:hover { color: var(--primary); }
.pt-status { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-text { margin: 0; line-height: 1.45; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pt-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.pt-actions .icon { width: 16px; height: 16px; }
@media (max-width: 420px) { .pt-grid { grid-template-columns: 1fr; } .pt-card { grid-template-columns: 88px 1fr; gap: 12px; } .pt-phone { width: 88px; } }

/* ---------- Shimmer placeholders while the next page loads ---------- */
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-2) 30%, color-mix(in srgb, var(--ink) 14%, var(--surface-2)) 50%, var(--surface-2) 70%, var(--surface-2) 100%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; border: 1px solid var(--line); }
.is-navigating .main > :not(.page-skeleton):not(.flash) { display: none !important; }
.page-skeleton { display: grid; gap: 16px; }
.skel-title { height: 30px; width: min(320px, 70%); border-radius: 10px; }
.skel-sub { height: 14px; width: min(520px, 90%); border-radius: 8px; margin-top: -6px; }
.skel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skel-tile { height: 92px; }
.skel-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.skel-card { height: 220px; }
.skel-tall { height: 340px; }
.is-navigating body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: nav-bar 1s linear infinite; }
@keyframes nav-bar { 0% { background-position: -50% 0; } 100% { background-position: 150% 0; } }
@media (max-width: 720px) { .skel-row { grid-template-columns: 1fr 1fr; } .skel-row .skel-tile:last-child { display: none; } .skel-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .skel, .is-navigating body::before { animation: none; } }

/* ---------- Load balancing: automatic set-up and free access ---------- */
.lb-auto { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.lb-auto h2 { margin: 0 0 4px; }
.lb-auto p { margin: 0; max-width: 640px; }
.fa-inline { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.fa-inline h2 { margin: 0 0 4px; }
.fa-inline p { margin: 4px 0 0; }
.fa-inline.fa-on { border-color: color-mix(in srgb, #22c55e 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, #22c55e 10%, var(--surface)), var(--surface) 70%); }
.lb-manual-pick { margin: 0 0 16px; }
.lb-manual-pick > summary { cursor: pointer; font-weight: 700; padding: 12px 4px; color: var(--primary); }

.tab-logo { display: inline-flex; align-items: center; gap: 6px; }
.tab-logo .vlogo { width: 18px; height: 18px; }

/* ---------- Profile menu on the photo at the top right ---------- */
.topbar-profile .profile > summary { padding: 0; border-radius: 50%; }
.topbar-profile .profile > summary:hover, .topbar-profile .profile[open] > summary { background: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.topbar-profile .profile-pop { left: auto; right: 0; bottom: auto; top: calc(100% + 10px); width: 280px; z-index: 80; }
.profile-upload { padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.profile-upload-btn { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--ink); }
.profile-upload-btn:hover { background: var(--surface-2); }
.profile-upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-upload-btn .icon { width: 18px; height: 18px; }
.profile-upload p { margin: 2px 10px 0; line-height: 1.4; }

/* ---------- Installable app: button, phone bar, how-to, offline screen ---------- */
.install-btn { display: inline-flex; align-items: center; gap: 6px; }
.install-btn[hidden] { display: none !important; }
.install-btn .icon { width: 16px; height: 16px; }
@media (max-width: 720px) { .sity-btn span { display: none; } .sity-btn { padding: 6px 8px; } }
.brand .install-side { margin: -8px 8px 14px; width: calc(100% - 16px); justify-content: center; }
.brand .install-side[hidden] { display: none; }
.auth-install { text-align: center; margin: 14px 0 0; }
.install-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--line)); box-shadow: 0 18px 40px rgba(0,0,0,.28); animation: pop-in .25s ease-out; }
@media (min-width: 720px) { .install-bar { left: auto; right: 24px; bottom: 24px; width: 420px; } }
.install-bar img { border-radius: 10px; flex: none; }
.install-bar span { display: grid; flex: 1; min-width: 0; }
.install-bar small { color: var(--muted); font-size: .8rem; }
.install-help { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 23, .6); backdrop-filter: blur(3px); }
.install-help-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.35); text-align: center; animation: pop-in .2s ease-out; }
.install-help-card img { border-radius: 14px; }
.install-help-card h2 { margin: 12px 0 4px; }
.install-steps { text-align: left; margin: 16px 0 18px; padding-left: 22px; display: grid; gap: 10px; line-height: 1.45; }
.ih-key { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; }
.offline-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg, #0b1220); }
.offline-card { max-width: 380px; text-align: center; background: var(--surface, #111a2e); border: 1px solid var(--line, #1f2a44); border-radius: 22px; padding: 28px; color: var(--ink, #e5e7eb); }
.offline-card img { border-radius: 16px; }

/* ---------- Pricing page and Plan & billing ---------- */
.pr-hero h1 { max-width: 820px; }
.pr-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; max-width: 900px; margin: 0 auto; }
.pr-plan { position: relative; display: grid; gap: 12px; align-content: start; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.pr-plan h2 { margin: 6px 0 0; }
.pr-plan ul { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 8px; }
.pr-plan li { display: flex; gap: 8px; align-items: flex-start; }
.pr-plan li .icon { width: 18px; height: 18px; color: #22c55e; flex: none; margin-top: 2px; }
.pr-plan-main { border: 2px solid var(--primary); background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface) 65%); }
.pr-price { display: grid; gap: 2px; margin: 0; }
.pr-price strong { font-size: 2.6rem; line-height: 1; letter-spacing: -.03em; }
.pr-price span { color: var(--muted); }
.pr-table { max-width: 720px; margin: 0 auto; }
.pr-faqs { max-width: 760px; }
.pr-faq { border-bottom: 1px solid var(--line); padding: 14px 4px; }
.pr-faq summary { cursor: pointer; font-weight: 700; }
.pr-faq p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.signup-free { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #22c55e 12%, transparent); border: 1px solid color-mix(in srgb, #22c55e 35%, transparent); font-size: .92rem; }
.plan-notice { margin-bottom: 16px; }
.plan-big { font-size: 1.15rem; margin: 4px 0 10px; }
.plan-meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0 0 12px; }
.plan-meter span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #10b981); }
.plan-free { border-color: color-mix(in srgb, #22c55e 40%, var(--line)); }

.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-hot { border-color: color-mix(in srgb, #f59e0b 50%, var(--line)); }
.stat-hot .stat-n { color: #f59e0b; }

/* Vouchers: date filter and clean button */
.v-filter { flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.v-date { display: inline-flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); }
.v-date input { min-width: 140px; }
.v-clean { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
/* Admin: set a member's password */
.member-row { flex-wrap: wrap; }
.member-row .set-pw { flex-basis: 100%; }
.set-pw summary { list-style: none; cursor: pointer; display: inline-flex; }
.set-pw summary::-webkit-details-marker { display: none; }
.set-pw form { margin-top: 8px; }
/* Super admin → Server & capacity */
.pbar { display: block; width: 100%; height: 12px; border-radius: 999px; overflow: hidden; }
.pbar-track { fill: var(--line); }
.pbar-fill { fill: var(--ok); transition: width .6s ease; }
.pbar-plan .pbar-fill { fill: var(--warn); }
.pbar-now .pbar-fill { fill: var(--err); }
.sh-hero .pbar { height: 18px; margin-top: 14px; }
.sh-hero { border-left: 5px solid var(--ok); }
.sh-hero.sh-plan { border-left-color: var(--warn); }
.sh-hero.sh-now { border-left-color: var(--err); }
.sh-hero-top { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: flex-start; }
.sh-hero h2 { font-size: 1.6rem; margin: 2px 0 4px; }
.sh-pct { color: var(--muted); font-weight: 600; }
.sh-inst { margin: 0; min-width: 220px; }
.sh-scale { display: flex; justify-content: space-between; margin: 6px 0 0; }
.sh-next { margin-top: 16px; }
.sh-next p { margin: 8px 0 0; }
.sh-reasons { margin: 8px 0 0; padding-left: 20px; }
.sh-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 28px; }
.sh-row-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.sh-row-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.sh-row p { margin: 6px 0 0; }
.sh-line { width: 100%; height: 120px; display: block; }
.sh-area { fill: color-mix(in srgb, var(--primary) 14%, transparent); }
.sh-stroke { fill: none; stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sh-limit { stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sh-limit-60 { stroke: var(--warn); }
.sh-limit-80 { stroke: var(--err); }
.sh-chart-foot { display: flex; justify-content: space-between; margin: 6px 0 0; }
.sh-empty { margin: 8px 0; }
.sh-current td { background: var(--primary-soft); }
.sh-runway { font-size: 1.05rem; }
.sh-runway-low strong { color: var(--err); }@media (max-width: 560px) { .sh-wide { display: none; } }

/* Sales → Reports */
.rp-filters h2 { margin-bottom: 2px; }
.rp-filters .muted.small { margin: 0 0 12px; }
.rp-search input { width: 100%; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.rp-grid select, .rp-grid input { width: 100%; }
.rp-chart-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.rp-chart-head .tabs { margin-bottom: 0; }
.rp-chart-sum { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.rp-chart .rp-hit { fill: transparent; }
.rp-chart g:hover .rp-hit { fill: color-mix(in srgb, var(--primary) 8%, transparent); }
.rp-caps { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 28px; }
.rp-method { display: flex; flex-direction: column; gap: 6px; }
.rp-method-top { display: flex; justify-content: space-between; gap: 8px; }
.rp-meter { display: block; width: 100%; height: 6px; border-radius: 999px; overflow: hidden; }
.rp-meter-track { fill: var(--line); }
.rp-meter-fill { fill: var(--primary); }
.rp-routers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rp-router { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.rp-router:hover { border-color: var(--primary); }
.rp-router-n { font-size: 1.4rem; font-weight: 700; }
.rp-router-ico { position: absolute; top: 12px; right: 12px; color: var(--primary); opacity: .7; }
.rp-ok { color: var(--ok); }
.rp-cust { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; min-width: 200px; }
.rp-cust code { font-size: .8rem; word-break: break-all; }
.rp-num { font-size: .82rem; }
.rp-fee { color: var(--warn); }
.rp-table td { vertical-align: top; }
/* Custom branding (Plan & billing, portal studio) */
.brand-buy{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.brand-buy .field{margin:0;min-width:220px}
.brand-up{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}.brand-up p{margin:0}

/* Confirm pop-up (app.js askConfirm) */
.cfm { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(15, 23, 42, .28); }
.cfm::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cfm[open] { animation: cfm-in .16s ease-out; }
@keyframes cfm-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.cfm-box { margin: 0; padding: 24px 22px 18px; text-align: center; }
.cfm-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font: 800 24px/1 inherit; margin-bottom: 10px; }
.cfm-danger .cfm-icon { background: var(--err-bg); color: var(--err); }
.cfm h2 { margin: 0 0 6px; font-size: 19px; }
.cfm p { margin: 0 0 18px; color: var(--ink-2); line-height: 1.5; }
.cfm-actions { display: flex; gap: 10px; }
.cfm-actions .btn { flex: 1; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .cfm[open] { animation: none; } }
/* Router connected pop-up (router-wizard.js) */
.rt-ok { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--ink); width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(21, 128, 61, .35); overflow: hidden; }
.rt-ok::backdrop { background: rgba(5, 46, 22, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.rt-ok[open] { animation: rt-ok-in .35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes rt-ok-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.rt-ok-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 24px 20px; border-top: 8px solid var(--green); background: linear-gradient(180deg, var(--green-bg), var(--surface) 55%); }
.rt-ok-ring { width: 96px; height: 96px; border-radius: 50%; background: var(--green); display: grid; place-items: center; box-shadow: 0 0 0 10px var(--green-bg), 0 12px 30px rgba(22, 163, 74, .45); margin-bottom: 10px; }
.rt-ok-ring svg { width: 62px; height: 62px; fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.rt-ok-ring circle { stroke: rgba(255, 255, 255, .35); stroke-width: 2.5; }
.rt-ok-ring path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: rt-ok-tick .5s .25s ease-out forwards; }
@keyframes rt-ok-tick { to { stroke-dashoffset: 0; } }
.rt-ok h2 { margin: 0; font-size: 1.6rem; color: var(--green); }
.rt-ok-name { margin: 0; font-size: 1.02rem; color: var(--ink-2); }
.rt-ok-live { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 6px 14px; border-radius: 999px; background: var(--green-bg); color: var(--green); font-weight: 800; }
.rt-ok-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: rt-ok-pulse 1.6s infinite; }
@keyframes rt-ok-pulse { 70% { box-shadow: 0 0 0 10px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.rt-ok-go { width: 100%; justify-content: center; margin-top: 12px; background: var(--green); border-color: var(--green); }
.rt-ok-go:hover { background: var(--green); filter: brightness(.95); }
@media (prefers-reduced-motion: reduce) { .rt-ok[open], .rt-ok-ring path, .rt-ok-dot { animation: none; stroke-dashoffset: 0; } }
/* Voucher "Send" by SMS */
.v-send { margin-left: 8px; padding: 2px 8px; font-size: .78rem; vertical-align: middle; }
.code-grid .v-send { margin-left: 4px; }
.send-dlg { width: min(460px, calc(100vw - 32px)); }
.send-box { margin: 0; padding: 22px; text-align: left; }
.send-box h2 { margin: 0 0 14px; font-size: 1.1rem; }
.send-box textarea { width: 100%; }
.send-box .cfm-actions { justify-content: flex-end; }

/* Ask Sity: the help assistant */
.sity-dlg { width: min(460px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); display: none; flex-direction: column; overflow: hidden; }
.sity-dlg[open] { display: flex; }
.sity-dlg::backdrop { background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); }
.sity-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sity-head h2 { font-size: 1.05rem; margin: 0; display: flex; gap: 8px; align-items: center; }
.sity-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sity-page .sity-log { max-height: 60vh; padding: 0 0 16px; }
.sity-msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: .95rem; }
.sity-user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.sity-assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.sity-wait { color: var(--muted); font-style: italic; }
.sity-error { color: var(--err); }
.sity-dlg .sity-form { display: flex; gap: 8px; padding: 12px 16px 4px; border-top: 1px solid var(--line); }
.sity-dlg .sity-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; }
.sity-note { padding: 0 16px 10px; margin: 0; }
@media (max-width: 600px) { .sity-dlg { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; } }

/* ---------- Bulk delete on lists ---------- */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bulk-bar .check { margin: 0; }
.col-pick { width: 36px; text-align: center; }
.col-pick input { width: 18px; height: 18px; accent-color: var(--primary); }
.v-sales { margin-bottom: 16px; }
.row-menu-pop .menu-danger { color: var(--err); }
.row-menu-pop .menu-danger:hover { background: color-mix(in srgb, var(--err) 12%, transparent); }

/* ---------- Routers list fits its card (no sideways scroll, ⋯ menu never cut off) ---------- */
.rt-table .rt-cell { min-width: 0; }
.rt-table .rt-text .muted { max-width: 220px; }
@media (min-width: 721px) {
  .rt-wrap, .card.flush:has(> .rt-wrap) { overflow: visible; }
  .rt-table td, .rt-table th { padding-left: 12px; padding-right: 12px; }
}
@media (min-width: 721px) and (max-width: 1360px) {
  .rt-table th:nth-child(5), .rt-table td:nth-child(5), .rt-table th:nth-child(6), .rt-table td:nth-child(6) { display: none; }
}
@media (min-width: 721px) and (max-width: 1120px) {
  .rt-table th:nth-child(4), .rt-table td:nth-child(4) { display: none; }
  .rt-table .rt-text .muted { max-width: 160px; }
}

/* Home: the router a sale came from, above the amount */
.sale-router { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--primary); }
.sale-router .icon { width: 13px; height: 13px; }
.row-title .vlogo { margin-right: 6px; vertical-align: middle; }

/* Free access: choose no cap or a daily cap per device */
.fa-on-form { display: grid; gap: 8px; justify-items: start; }
.fa-on-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.fa-cap { display: inline-flex; align-items: center; gap: 6px; margin-left: 26px; font-size: .9rem; }
.fa-cap input { width: 96px; }
.lock-notice p { margin: 4px 0; }

/* ---------- Sales summary: motion and colour ---------- */
@keyframes rp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rp-pop { 0% { opacity: 0; transform: translateY(10px) scale(.96); } 70% { opacity: 1; transform: translateY(-2px) scale(1.01); } 100% { opacity: 1; transform: none; } }
@keyframes rp-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rp-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rp-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rp-float { 50% { transform: translateY(-3px); } }
.rp-anim > * { animation: rp-rise .5s cubic-bezier(.2, .7, .3, 1) both; }
.rp-anim > :nth-child(2) { animation-delay: .06s; }
.rp-anim > :nth-child(3) { animation-delay: .12s; }
.rp-anim > :nth-child(4) { animation-delay: .2s; }
.rp-anim > :nth-child(5) { animation-delay: .26s; }
.rp-anim > :nth-child(n+6) { animation-delay: .32s; }
.rp-anim > .rp-stats { animation: none; }

.rp-stats .stat { position: relative; overflow: hidden; animation: rp-pop .6s cubic-bezier(.2, .7, .3, 1) both; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.rp-stats .stat:nth-child(2) { animation-delay: .08s; }
.rp-stats .stat:nth-child(3) { animation-delay: .16s; }
.rp-stats .stat:nth-child(4) { animation-delay: .24s; }
.rp-stats .stat:nth-child(5) { animation-delay: .32s; }
.rp-stats .stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 30%, transparent)); transform-origin: left; animation: rp-sweep .9s .3s cubic-bezier(.2, .7, .3, 1) both; }
.rp-stats .stat:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 22%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface) 65%); }
.rp-stats .stat-ico { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.rp-stats .stat:hover .stat-ico { transform: rotate(-8deg) scale(1.12); }
.rp-stats .stat:hover .stat-n { color: var(--primary); }

.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: rp-grow-y .7s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(.25s + var(--i, 0) * 22ms); transition: fill .15s ease; }
.rp-chart g:hover .bar { fill: var(--primary); }
.rp-meter-fill { transform-box: fill-box; transform-origin: left; animation: rp-grow-x 1s .35s cubic-bezier(.2, .7, .3, 1) both; }
.rp-method { padding: 10px 12px; margin: -10px -12px; border-radius: 12px; transition: background .2s ease; }
.rp-method:hover { background: var(--primary-soft); }
.rp-router { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; animation: rp-pop .5s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(.3s + var(--i, 0) * 60ms); }
.rp-router:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 20%, transparent); background: linear-gradient(150deg, var(--primary-soft), var(--surface-2) 70%); color: var(--ink); }
.rp-router:hover .rp-router-n { color: var(--primary); }
.rp-router-ico { transition: transform .4s ease, opacity .2s ease; }
.rp-router:hover .rp-router-ico { transform: scale(1.2) rotate(12deg); opacity: 1; }
.rp-table tbody tr { transition: background .15s ease; }
.rp-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }

/* PDF report card */
.rp-pdf { display: flex; gap: 16px; align-items: flex-start; border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); background: linear-gradient(135deg, var(--primary-soft), var(--surface) 55%); }
.rp-pdf-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); animation: rp-float 3s ease-in-out infinite; }
.rp-pdf-ico .icon { width: 22px; height: 22px; stroke: currentColor; }
.rp-pdf-body { flex: 1; min-width: 0; }
.rp-pdf h2 { margin: 0 0 2px; }
.rp-pdf .muted.small { margin: 0 0 10px; }
.rp-pdf-form { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; }
.rp-pdf-form .field { min-width: 170px; }
.rp-pdf-dates { display: flex; flex-wrap: wrap; gap: 0 14px; }
.rp-pdf-dates[hidden] { display: none; }
.rp-pdf-form .btn { margin-bottom: 14px; }
@media (max-width: 560px) { .rp-pdf { flex-direction: column; } .rp-pdf-form .field, .rp-pdf-dates, .rp-pdf-form .btn { width: 100%; } .rp-pdf-dates .field { flex: 1; } }

/* ---------- Packages and profiles: colourful hover and entry ---------- */
@keyframes pkg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.cards-pop .pkg { position: relative; overflow: hidden; animation: pkg-in .5s cubic-bezier(.2, .7, .3, 1) both; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease; }
.cards-pop .pkg:nth-child(2) { animation-delay: .06s; }
.cards-pop .pkg:nth-child(3) { animation-delay: .12s; }
.cards-pop .pkg:nth-child(4) { animation-delay: .18s; }
.cards-pop .pkg:nth-child(5) { animation-delay: .24s; }
.cards-pop .pkg:nth-child(6) { animation-delay: .3s; }
.cards-pop .pkg:nth-child(n+7) { animation-delay: .36s; }
.cards-pop .pkg::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 35%, #fff)); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .3, 1); }
.cards-pop .pkg::after { content: ""; position: absolute; width: 160px; height: 160px; right: -60px; top: -60px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%); opacity: 0; transform: scale(.6); transition: opacity .3s ease, transform .4s ease; pointer-events: none; }
.cards-pop .pkg:hover, .cards-pop .pkg:focus-within { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 24%, transparent); background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 8%, var(--surface)), var(--surface) 60%); }
.cards-pop .pkg:hover::before, .cards-pop .pkg:focus-within::before { transform: scaleX(1); }
.cards-pop .pkg:hover::after, .cards-pop .pkg:focus-within::after { opacity: 1; transform: scale(1); }
.cards-pop .pkg h2 a { transition: color .2s ease; }
.cards-pop .pkg:hover h2 a { color: var(--primary); }
.cards-pop .pkg .price { display: inline-block; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.cards-pop .pkg:hover .price { transform: scale(1.1); }
.cards-pop .pkg .kv > div { border-radius: 8px; padding: 4px 6px 6px; margin: 0 -6px; transition: background .15s ease; }
.cards-pop .pkg .kv > div:hover { background: var(--primary-soft); }
.cards-pop .pkg .kv > div:hover dt { color: var(--primary); }
.cards-pop .pkg > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .rp-anim > *, .rp-stats .stat, .rp-stats .stat::before, .rp-chart .bar, .rp-meter-fill, .rp-router, .rp-pdf-ico, .cards-pop .pkg { animation: none !important; }
  .rp-stats .stat:hover, .rp-router:hover, .cards-pop .pkg:hover, .cards-pop .pkg:focus-within { transform: none; }
}

/* ---------- Every page: charts draw themselves, live numbers flash when they change ---------- */
@keyframes chart-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes num-bump { 0% { transform: translateY(-6px); opacity: .3; } 100% { transform: none; opacity: 1; } }
.chart .chart-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: chart-draw 1.4s .2s cubic-bezier(.3, .6, .3, 1) both; }
.chart:hover .bar { transition: fill .15s ease, opacity .15s ease; }
.chart g:hover .bar, .chart .bar:hover { fill: var(--primary); opacity: 1; }
.is-counting { font-variant-numeric: tabular-nums; }
.is-bump { display: inline-block; animation: num-bump .4s ease both; }
.stat { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 16%, transparent); }
@media (prefers-reduced-motion: reduce) { .chart .bar, .chart .chart-draw, .is-bump { animation: none !important; } .stat:hover { transform: none; } }

/* Add router: "Moving from Nettportal" only applies to existing routers. */
.wz form:has(input[name="mode"][value="new"]:checked) .wz-moving { display: none; }
.wz-moving { margin-bottom: 14px; border-style: dashed; }
/* Router page: moving from another billing system */
.move-card { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); background: linear-gradient(135deg, var(--primary-soft), var(--surface) 60%); }
.move-steps { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.move-steps li { display: flex; gap: 10px; align-items: flex-start; }
.move-steps .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--line); color: var(--muted); }
.move-steps li.done .tick { background: var(--primary); color: var(--primary-ink); }
.move-codes { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.move-codes li { font: 600 .8rem ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.wz-move-steps { margin-top: 6px; line-height: 1.7; }
.wz-move-steps b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: .7rem; margin-right: 2px; }

/* Bottom tab bar on phones and tablets (the sidebar is a slide-out menu there) */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(calc(100% - 20px), 560px); padding: 8px; border-radius: 28px; background: color-mix(in srgb, var(--surface) 97%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(15, 23, 42, .16); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px 4px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; border-radius: 18px; min-width: 0; -webkit-tap-highlight-color: transparent; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar .icon { width: 44px; height: 30px; padding: 4px 11px; border-radius: 16px; stroke: currentColor; transition: background .18s ease, transform .18s ease; }
  .tabbar a.active { color: var(--primary); font-weight: 600; }
  .tabbar a.active .icon { background: var(--primary-soft); stroke: var(--primary); }
  .tabbar a:active .icon { transform: scale(.92); }
  .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .install-bar { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .nav-toggle:checked ~ .shell .tabbar { display: none; }
}
@media (max-width: 380px) { .tabbar a { font-size: 11px; } .tabbar .icon { width: 38px; padding: 4px 8px; } }
@media print { .tabbar { display: none !important; } }
.stamp { white-space: nowrap; }

/* ---------- Active users: one card per router ---------- */
.router-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.router-cards .stat-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; padding-right: 8px; }
.router-cards .stat-sel { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.router-cards .stat-down .stat-n { color: var(--err); }
@media (max-width: 600px) { .router-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .router-cards .stat { padding: 14px; } .router-cards .stat-n { font-size: 1.45rem; } }

/* ---------- Adverts ---------- */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ad-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; margin: 0; }
.ad-media { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--surface-2); }
.ad-noimg { display: grid; place-items: center; color: var(--muted); }
.ad-noimg .icon { width: 34px; height: 34px; }
.ad-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.ad-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ad-top h2 { font-size: 1.05rem; margin: 0; }
.ad-text { margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ad-card .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ad-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin: 8px 0; background: var(--surface-2); }
.ad-preview[hidden] { display: none; }

/* Buyer hostels (Payment settings) */
.area-head { margin: 18px 0 8px; font-size: .95rem; }
.area-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.area-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; }

/* ---------- Routers: live hero and animated router cards ---------- */
@keyframes rl-aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes rl-ripple { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes rl-in { from { opacity: 0; transform: perspective(800px) rotateX(14deg) translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rl-bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes rl-ring { from { stroke-dasharray: 0 100; } }
@keyframes rl-strip { from { background-position: 0 0; } to { background-position: 200% 0; } }
.rl-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main ring" "pills ring"; gap: 14px 24px; align-items: center; margin-bottom: 18px; padding: 22px 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, #0b1f4d, #1d4ed8 35%, #0891b2 65%, #7c3aed); background-size: 260% 260%; animation: rl-aurora 14s ease-in-out infinite; box-shadow: 0 18px 40px rgba(29, 78, 216, .28); }
.rl-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% -20%, rgba(255,255,255,.22), transparent 45%), radial-gradient(circle at 0% 120%, rgba(255,255,255,.14), transparent 40%); pointer-events: none; }
.rl-hero-main { grid-area: main; display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.rl-radar { position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); }
.rl-radar .icon { width: 26px; height: 26px; color: #fff; }
.rl-radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); animation: rl-ripple 2.6s ease-out infinite; }
.rl-radar i:nth-child(2) { animation-delay: .85s; }
.rl-radar i:nth-child(3) { animation-delay: 1.7s; }
.rl-hero-n { display: block; font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; animation: num-bump .6s ease both; }
.rl-hero-l { display: block; margin-top: 4px; opacity: .88; font-weight: 600; }
.rl-hero-pills { grid-area: pills; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.rl-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); font-size: .9rem; }
.rl-pill .glow { position: static; border-color: transparent; width: 10px; height: 10px; }
.rl-pill strong { font-size: 1.05rem; }
.rl-pill-off:has(.glow-off) { background: rgba(239, 68, 68, .3); border-color: rgba(254, 202, 202, .6); }
.rl-hero-ring { grid-area: ring; position: relative; width: 112px; height: 112px; z-index: 1; }
.rl-hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rl-ring-track { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 3.2; }
.rl-ring-fill { fill: none; stroke: #4ade80; stroke-width: 3.2; stroke-linecap: round; animation: rl-ring 1.4s .2s cubic-bezier(.2, .7, .3, 1) both; filter: drop-shadow(0 0 4px rgba(74, 222, 128, .8)); }
.rl-hero-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.rl-hero-ring small { display: block; font-size: .72rem; font-weight: 600; opacity: .8; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }

.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.rl-card { position: relative; display: grid; gap: 14px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rl-in .55s cubic-bezier(.2, .7, .3, 1) both; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.rl-card:has(.row-menu[open]) { z-index: 5; }
.rl-card::before { content: ""; position: absolute; inset: 0 16px auto; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 20%, transparent), var(--tone)); background-size: 200% 100%; animation: rl-strip 3s linear infinite; }
.rl-card.is-on { --tone: #22c55e; }
.rl-card.is-off { --tone: #ef4444; border-color: color-mix(in srgb, #ef4444 45%, var(--line)); background: linear-gradient(170deg, color-mix(in srgb, #ef4444 7%, var(--surface)), var(--surface) 55%); }
.rl-card.is-wait { --tone: #94a3b8; }
.rl-card.is-wait::before { animation: none; }
.rl-card:hover { transform: translateY(-5px); border-color: var(--tone); box-shadow: 0 18px 36px color-mix(in srgb, var(--tone) 22%, transparent); }
.rl-card:nth-child(2) { animation-delay: .05s; } .rl-card:nth-child(3) { animation-delay: .1s; } .rl-card:nth-child(4) { animation-delay: .15s; }
.rl-card:nth-child(5) { animation-delay: .2s; } .rl-card:nth-child(6) { animation-delay: .25s; } .rl-card:nth-child(n+7) { animation-delay: .3s; }
.rl-card > * { min-width: 0; }
.rl-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; }
.rl-id { min-width: 0; }
.rl-id .rt-text { min-width: 0; overflow: hidden; }
.rl-id .rt-name, .rl-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-sub { font-size: .8rem; color: var(--muted); }
.rl-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rl-state { justify-self: end; max-width: 150px; }
.rl-state .badge { white-space: normal; text-align: center; line-height: 1.2; }
.rl-users { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.rl-users-l { color: var(--muted); font-size: .85rem; font-weight: 600; padding-bottom: 2px; }
.rl-split { margin: -8px 0 0; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-connect { justify-self: start; }
.rl-users-n { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.rl-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.rl-bars i { width: 5px; border-radius: 2px; background: var(--line-2); transform-origin: bottom; }
.rl-bars i:nth-child(1) { height: 30%; } .rl-bars i:nth-child(2) { height: 55%; } .rl-bars i:nth-child(3) { height: 78%; } .rl-bars i:nth-child(4) { height: 100%; }
.rl-bars.is-on i { background: linear-gradient(#4ade80, #16a34a); animation: rl-bar 1.2s ease-in-out infinite; }
.rl-bars.is-on i:nth-child(2) { animation-delay: .15s; } .rl-bars.is-on i:nth-child(3) { animation-delay: .3s; } .rl-bars.is-on i:nth-child(4) { animation-delay: .45s; }
.rl-bars.is-off i:nth-child(1) { background: #f87171; }
.rl-cpu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.rl-cpu strong { color: var(--ink); }
.rl-meter { width: 100%; height: 6px; display: block; }
.rl-meter-track { fill: var(--surface-2); }
.rl-meter-fill { fill: #22c55e; transform-box: fill-box; transform-origin: left; animation: rp-grow-x 1s .3s cubic-bezier(.2, .7, .3, 1) both; }
.rl-meter.warm .rl-meter-fill { fill: #f59e0b; }
.rl-meter.hot .rl-meter-fill { fill: #ef4444; }
.rl-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.rl-facts div { min-width: 0; }
.rl-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.rl-facts dd { margin: 2px 0 0; font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .rl-hero { grid-template-columns: 1fr; grid-template-areas: "main" "ring" "pills"; justify-items: start; padding: 18px; }
  .rl-hero-ring { width: 92px; height: 92px; }
  .rl-hero-n { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rl-hero, .rl-radar i, .rl-card, .rl-card::before, .rl-bars i, .rl-ring-fill, .rl-meter-fill { animation: none !important; }
}

/* ---------- Free access: summary, then one tidy card per router ---------- */
.fa-stats .stat-n { color: var(--ink); }
.fa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.fa-card2 { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop-in .4s ease both; }
.fa-card2.is-free { border-color: color-mix(in srgb, #22c55e 50%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, #22c55e 9%, var(--surface)), var(--surface) 60%); }
.fa-head { display: flex; align-items: center; gap: 12px; }
.fa-logo { flex: none; display: inline-flex; }
.fa-title { flex: 1; min-width: 0; }
.fa-title h2 { margin: 0; font-size: 1.05rem; }
.fa-title p { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fa-chips li { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.fa-state { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fa-state .small { color: var(--muted); }
.fa-foot { padding-top: 12px; border-top: 1px dashed var(--line); }
.fa-setup > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fa-setup > summary::-webkit-details-marker { display: none; }
.fa-setup > summary .icon { width: 16px; height: 16px; }
.fa-setup[open] > summary { display: none; }
.fa-form { display: grid; gap: 14px; animation: pop-in .25s ease both; }
.fa-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fa-mode { position: relative; display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fa-mode input { position: absolute; opacity: 0; pointer-events: none; }
.fa-mode small { color: var(--muted); line-height: 1.35; font-size: .8rem; }
.fa-mode-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.fa-mode-ico .icon { width: 16px; height: 16px; }
.fa-mode:has(input:checked) { border-color: var(--primary); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 18%, transparent); }
.fa-mode:has(input:checked) .fa-mode-ico { background: var(--primary); border-color: var(--primary); color: #fff; }
.fa-mode:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.fa-limits { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.fa-form:has(input[value=open]:checked) .fa-limits { display: none; }
.fa-field { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 10px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.fa-unit { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); overflow: hidden; }
.fa-unit input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 8px 10px; background: transparent; }
.fa-unit em { font-style: normal; padding: 0 10px; color: var(--muted); font-size: .78rem; border-left: 1px solid var(--line); }
.fa-hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 520px) { .fa-modes { grid-template-columns: 1fr; } .fa-grid { grid-template-columns: 1fr; } .fa-field { grid-template-columns: 1fr 120px; } }

/* ---------- Remote access: narrower page, compact steps and cards ---------- */
.ra-page { max-width: 880px; display: grid; gap: 16px; }
.ra-how { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface) 60%); }
.ra-how-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ra-how-head h2 { margin: 0; font-size: 1.05rem; }
.ra-how-head p { margin: 2px 0 0; }
.ra-shield { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), #7c3aed); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.ra-shield .icon { width: 20px; height: 20px; }
.ra-steps2 { list-style: none; counter-reset: ra; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ra-steps2 li { counter-increment: ra; position: relative; display: grid; align-content: start; gap: 4px; padding: 12px 12px 12px 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; }
.ra-steps2 li::before { content: counter(ra); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--primary-ink, #fff); background: var(--primary); }
.ra-steps2 li span { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.ra-apps-pick summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: .8rem; margin-top: 2px; }
.ra-apps-pick .ra-apps { margin-top: 8px; }
.ra-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.ra-card { padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-left: 4px solid var(--line-2); transition: transform .2s ease, box-shadow .2s ease; }
.ra-card.is-on { border-left-color: #22c55e; }
.ra-card.is-off { border-left-color: #ef4444; }
.ra-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .1); }
.ra-card .ra-head { flex-wrap: nowrap; }
.ra-logo { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--primary); }
.ra-logo .icon { width: 18px; height: 18px; }
.ra-head-text { flex: 1; min-width: 0; }
.ra-card .ra-new { margin-top: 12px; }
.ra-card .ra-new input { flex: 1 1 160px; }
.ra-card .ra-config-actions .btn { padding: 5px 10px; }
@media (max-width: 760px) { .ra-steps2 { grid-template-columns: 1fr 1fr; } .ra-list { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .ra-steps2 { grid-template-columns: 1fr; } }

/* Sity AI mark */
.sity-mark { flex: none; object-fit: contain; vertical-align: middle; }
.sity-mark-sm { width: 20px; height: 20px; }
.sity-mark-lg { width: 28px; height: 28px; }
.sity-btn { display: inline-flex; align-items: center; gap: 6px; }
.sity-btn:hover .sity-mark { animation: rp-float 1s ease-in-out infinite; }
.sity-hero { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sity-hero .sity-mark { width: 44px; height: 44px; }
.sity-hero div { display: grid; }

/* ---------- Remote access: one tidy row per router ---------- */
.ra2 { max-width: 960px; display: grid; gap: 14px; }
.ra2-steps { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ra2-steps li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; min-width: 0; }
.ra2-steps li + li { border-left: 1px dashed var(--line); border-radius: 0 12px 12px 0; }
.ra2-steps strong { display: block; font-size: .88rem; }
.ra2-steps small { display: block; color: var(--muted); font-size: .78rem; }
.ra2-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), #7c3aed); }
.ra2-apps summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: .78rem; list-style: none; }
.ra2-apps summary::-webkit-details-marker { display: none; }
.ra2-apps-list { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: .78rem; }
.ra2-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ra2-bar input { flex: 1 1 260px; max-width: 380px; }
.ra2-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ra2-row { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.ra2-row[open] { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 10px 26px rgba(15, 23, 42, .08); }
.ra2-row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) 130px 80px 150px auto; align-items: center; gap: 12px; padding: 12px 14px; }
.ra2-row > summary::-webkit-details-marker { display: none; }
.ra2-row > summary:hover { background: var(--surface-2); }
.ra2-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.ra2-row.is-on .ra2-dot { background: #22c55e; box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 20%, transparent); }
.ra2-row.is-off .ra2-dot { background: #ef4444; box-shadow: 0 0 0 4px color-mix(in srgb, #ef4444 18%, transparent); }
.ra2-name { min-width: 0; display: grid; }
.ra2-name strong, .ra2-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra2-ip code { font-size: .82rem; }
.ra2-count { font-size: .78rem; color: var(--muted); font-weight: 600; text-align: right; }
.ra2-state { justify-self: end; }
.ra2-chev .icon { width: 16px; height: 16px; color: var(--muted); transform: rotate(180deg); transition: transform .2s ease; }
.ra2-row[open] .ra2-chev .icon { transform: none; }
.ra2-body { padding: 4px 16px 16px 36px; display: grid; gap: 12px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-2), var(--surface) 70px); }
.ra2-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; }
.ra2-tools .icon { width: 15px; height: 15px; }
.ra2-body .ra-configs { margin: 0; }
.ra2-body .ra-new { margin: 0; }
.ra2-body .ra-new input { flex: 1 1 200px; max-width: 360px; }
@media (max-width: 760px) {
  .ra2-steps { grid-template-columns: 1fr 1fr; }
  .ra2-steps li:nth-child(3) { border-left: 0; }
  .ra2-row > summary { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .ra2-ip, .ra2-count { display: none; }
  .ra2-body { padding-left: 16px; }
}

/* ---------- Router page: section tabs and RouterOS update ---------- */
.rd-tabs { margin: 16px 0 14px; overflow-x: auto; flex-wrap: nowrap; }
.rd-tabs .tab { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.rd-tabs .tab .icon { width: 16px; height: 16px; }
.rd-one { display: grid; gap: 16px; }
.rd-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rd-two > div { display: grid; gap: 16px; min-width: 0; }
.rd-one > .card, .rd-two .card { margin: 0; }
@media (max-width: 900px) { .rd-two { grid-template-columns: 1fr; } }
.os-versions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 10px; }
.os-versions div { display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 130px; }
.os-versions strong { font-size: 1.35rem; letter-spacing: -.01em; }
.os-arrow { font-size: 1.4rem; color: var(--muted); }
.os-card .copy-row input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.os-card .notice p { margin: 0 0 8px; }
.os-mini-v { margin: 0 0 10px; }
.os-mini-v strong { font-size: 1.3rem; }
.move-card .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Account chooser: one email on several businesses */
.acct-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.acct-list form { margin: 0; }
.acct-pick { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.acct-pick:hover, .acct-pick:focus-visible { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.acct-pick.is-current { border-color: var(--primary); }
.acct-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--primary-soft); color: var(--primary); overflow: hidden; }
.acct-logo img { width: 100%; height: 100%; object-fit: cover; }
.acct-text { display: grid; min-width: 0; }
.acct-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-go { font-size: 22px; color: var(--muted); }

/* Vouchers: upload and download a code used */
.updown { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.updown span { white-space: nowrap; }

/* Package form: the routers that sell it */
.pkg-routers { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; }
.pkg-routers.has-error { border-color: var(--red, #dc2626); }
.pkg-routers legend { font-weight: 600; padding: 0 6px; }
.pkg-router-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; margin: 10px 0 4px; }
.pkg-router { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; min-width: 0; }
.pkg-router span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-router:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--text, inherit); }

/* Manager's commission */
.comm-month { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.comm-month select { min-width: 180px; }
.comm-hostel { padding: 0; }
.comm-sum { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.comm-sum::-webkit-details-marker { display: none; }
.comm-name, .comm-fig { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comm-name strong { overflow-wrap: anywhere; }
.comm-body { padding: 0 18px 16px; border-top: 1px solid var(--line); }
.comm-body .table-wrap { margin: 12px 0; max-height: 320px; overflow: auto; }
.comm-pct { border: 0; padding: 0; margin: 8px 0 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.comm-pct legend { font-weight: 600; margin-bottom: 8px; }
.comm-pct-opt { position: relative; }
.comm-pct-opt input { position: absolute; opacity: 0; inset: 0; }
.comm-pct-opt span { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.comm-pct-opt small { font-weight: 500; font-size: .78rem; color: var(--muted); }
.comm-pct-opt input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.comm-pct-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.comm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.comm-pay { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 720px) {
  .comm-sum { grid-template-columns: 1fr 1fr; }
  .comm-name { grid-column: 1 / -1; }
  .comm-grid { grid-template-columns: 1fr; }
}
