/* Client area (app.nebus.fr): page layouts only. Loaded after /static/base.css (shared design layer,
   design/base.css): colours, radii, shadows and type come from its tokens, never hard-coded here.
   Rules: design/DESIGN.md. After any change: bump ASSET_V in app/src/views.js and run ops/ui-check.sh. */

/* ---------------------------------------------------------------- Page frame */
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-soft); }
.main { flex: 1 0 auto; padding: 40px 0 80px; }
.container-wide { max-width: var(--container); } /* aligned with the top bar and the footer */
.main .container > * + * { margin-top: 20px; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
form.inline { display: inline; }
.err { color: var(--err); }
.mono { font-family: var(--mono); font-size: 0.8125rem; }
.hint { margin: 8px 0 0; }

/* ---------------------------------------------------------------- Top bar */
.topbar-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-sub { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.topbar-app .topbar-inner { gap: 28px; }
.topbar-app .topnav { flex: 1; min-width: 0; }
.topnav a { white-space: nowrap; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { border-color: var(--line-strong); color: var(--ink); }
.user-menu[open] > summary { border-color: var(--accent-line); box-shadow: var(--ring); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700; flex: none; }
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 50; }
.menu-head { display: grid; gap: 2px; padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }
.menu-head strong { font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.menu-panel form { margin: 0; }
.menu-panel a, .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2); font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer; }
.menu-panel a:hover, .menu-item:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.menu-panel .icon { width: 16px; height: 16px; color: var(--muted); }

@media (max-width: 860px) {
  .topbar-app .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 12px; }
  .topbar-app .topbar-brand { height: 44px; }
  .topbar-app .topnav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .topbar-app .topnav::-webkit-scrollbar { display: none; }
  .topbar-app .topnav a { padding: 8px 10px; font-size: 0.875rem; }
}

/* ---------------------------------------------------------------- Page heads and cards */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.page-title { min-width: 0; }
.page-title h1 { margin: 0; font-size: clamp(1.625rem, 1.35rem + 0.9vw, 2rem); letter-spacing: -0.03em; }
.page-title p { margin: 6px 0 0; color: var(--muted); max-width: 680px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.title-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.title-row .badge { letter-spacing: 0; }
.title-host { overflow-wrap: anywhere; }
.back-link { display: flex; align-items: center; gap: 6px; width: fit-content; margin-bottom: -8px; color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.btn .icon { width: 18px; height: 18px; }

.card-h { margin: 0 0 18px; font-size: 1.0625rem; letter-spacing: -0.01em; }
.card-h3 + .kv { margin-top: 10px; }
.card-h3 { margin: 24px 0 4px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 1.0625rem; letter-spacing: -0.01em; }
.card-head .card-sub { margin: 4px 0 0; }
.card-note { margin: 16px 0 0; color: var(--muted); font-size: 0.875rem; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { margin: 0; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-flush .table-wrap { border: 0; border-radius: 0; }
.card-flush th:first-child, .card-flush td:first-child { padding-left: 24px; }
.card-flush th:last-child, .card-flush td:last-child { padding-right: 24px; }
.card-foot { margin: 0; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 0.8125rem; }
.card-empty { margin: 0; padding: 20px 24px; color: var(--muted); font-size: 0.9375rem; }
.card-alert { padding: 16px 24px 0; }
.card-alert .alert { margin: 0; }
.card-alert + .table-wrap { margin-top: 16px; border-top: 1px solid var(--line); }

/* Tables */
th.num, td.num { text-align: right; }
td { color: var(--ink-2); }
.dl-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.table-compact { font-size: 0.875rem; }
.table-compact th, .table-compact td { padding: 9px 12px; }
.table-compact td { vertical-align: middle; }
tbody tr:hover td { background: var(--bg-soft); }
/* Invoices on small screens: one block per invoice instead of a wide table. */
@media (max-width: 640px) {
  .inv-table thead { display: none; }
  .inv-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .inv-table tbody tr:last-child { border-bottom: 0; }
  .inv-table td, .card-flush .inv-table td:first-child, .card-flush .inv-table td:last-child { padding: 0; border: 0; background: none; text-align: left; }
  .inv-table .inv-item { grid-column: 1 / -1; grid-row: 2; }
  .inv-table .inv-amount { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; color: var(--ink); }
  .inv-table .inv-date { grid-column: 1; grid-row: 3; color: var(--muted); font-size: 0.875rem; }
  .inv-table .inv-status { grid-column: 2; grid-row: 3; justify-self: end; }
  .inv-table .inv-pdf { grid-column: 1 / -1; grid-row: 4; }
  .inv-table .inv-pdf .muted { display: none; }
}

/* Empty states and message pages */
.empty-state { padding: 48px 24px 56px; text-align: center; }
.empty-illus { width: 220px; margin: 0 auto 28px; }
.empty-state h2 { margin-bottom: 8px; font-size: 1.25rem; }
.empty-state p { max-width: 460px; margin: 0 auto 24px; color: var(--muted); }
.empty-state > p:last-child { margin-bottom: 0; }
.message-card { max-width: 600px; margin: 16px auto 0; padding: 48px 32px; text-align: center; }
.message-illus { width: 240px; margin: 0 auto 28px; }
.message-card h1 { margin-bottom: 10px; font-size: 1.625rem; letter-spacing: -0.03em; }
.message-text { color: var(--muted); }
.message-card .alert { text-align: left; }
.message-card .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- Sign in, sign up, password */
.page-auth { padding: 56px 0 88px; }
.auth { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: center; gap: 72px; max-width: 1040px; margin: 0 auto; }
.auth-card { padding: 32px; box-shadow: var(--shadow-sm); }
.auth-card h1 { margin-bottom: 6px; font-size: 1.625rem; letter-spacing: -0.03em; }
.auth-lead { margin: 0 0 24px; color: var(--muted); }
.auth-card .form { margin-top: 4px; }
.auth-alt { margin: 20px 0 0; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.auth-alt a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.auth-aside .illus { max-width: 400px; max-height: 360px; margin: 0 auto 32px; }
.auth-aside > p { max-width: 380px; margin: 0 auto; color: var(--muted); font-size: 1.0625rem; text-align: center; }
.auth-aside h2 { max-width: 420px; margin: 0 auto 14px; font-size: 1.125rem; letter-spacing: -0.01em; }
.checklist { max-width: 420px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.checklist .icon { margin-top: 3px; color: var(--accent); }
.field-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.field-head a { font-size: 0.875rem; font-weight: 500; }
@media (max-width: 900px) {
  .page-auth { padding: 32px 0 64px; }
  .auth { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .auth-aside { display: none; }
}
@media (max-width: 480px) { .auth-card { padding: 24px 20px; } }

/* ---------------------------------------------------------------- Dashboard */
.svc-row { display: grid; grid-template-columns: 40px minmax(0, 1.5fr) minmax(0, 1fr) 150px 18px; align-items: center; gap: 4px 20px; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--ink-2); transition: background-color 0.15s; }
.svc-row:first-child { border-top: 0; }
.svc-row:hover { background: var(--bg-soft); text-decoration: none; }
.svc-row:hover .svc-go { color: var(--ink); }
.svc-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); }
.svc-main { display: grid; gap: 2px; min-width: 0; }
.svc-host { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.svc-meta { color: var(--muted); font-size: 0.875rem; }
.svc-specs { color: var(--ink-2); font-size: 0.875rem; }
.svc-status { justify-self: end; }
.svc-go { color: var(--faint); }
@media (max-width: 760px) {
  .svc-row { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 16px; gap: 4px 14px; }
  .svc-icon { grid-row: 1 / span 2; align-self: start; }
  .svc-main { grid-column: 2 / -1; grid-row: 1; }
  .svc-specs { grid-column: 2; grid-row: 2; }
  .svc-status { grid-column: 3; grid-row: 2; align-self: center; }
  .svc-go { display: none; }
}

/* ---------------------------------------------------------------- Order */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; }
.order-steps { display: grid; gap: 20px; }
.order-summary { position: sticky; top: calc(var(--topbar-h) + 20px); }
@media (max-width: 1020px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-summary { position: static; }
}
fieldset.step { min-width: 0; margin: 0; }
.step-title { float: left; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 18px; padding: 0; color: var(--ink); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.step-body { clear: both; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700; flex: none; }

/* Visually hidden radios: positioned inside their label and 1px wide (a 100%-wide absolute input
   would stretch the page horizontally, see CLAUDE.md). */
.plan, .seg, .choice { position: relative; display: block; cursor: pointer; font-weight: 400; }
.plan input, .seg input, .choice input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); transition: border-color 0.15s, box-shadow 0.15s; }
.plan:hover .plan-body { border-color: var(--faint); }
.plan input:checked + .plan-body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan input:focus-visible + .plan-body { box-shadow: var(--ring); }
.plan-top { display: flex; align-items: center; gap: 8px; }
.plan-name { color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.plan-tag { padding: 2px 7px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: 0.75rem; font-weight: 600; }
.plan-radio { display: grid; place-items: center; width: 20px; height: 20px; margin-left: auto; border: 1.5px solid var(--line-strong); border-radius: 50%; color: transparent; flex: none; }
.plan-radio .icon { width: 12px; height: 12px; stroke-width: 3; }
.plan input:checked + .plan-body .plan-radio { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.plan-price { margin-top: 6px; color: var(--ink); font-size: 1.625rem; font-weight: 700; letter-spacing: -0.03em; }
.plan-price small { display: inline; margin-left: 2px; color: var(--muted); font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }
.plan-feats { display: grid; gap: 4px; margin: 8px 0 14px; color: var(--ink-2); font-size: 0.875rem; }
.plan-feats > span { display: flex; align-items: center; gap: 8px; }
.icon-xs { width: 14px; height: 14px; color: var(--accent); stroke-width: 2.5; }
.plan-tagline { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }
.plan.disabled { cursor: not-allowed; }
.plan.disabled .plan-body { background: var(--bg-soft); opacity: 0.65; }

.slug-input { display: flex; align-items: stretch; max-width: 560px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow-xs); overflow: hidden; }
.slug-input:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.slug-input span { display: flex; align-items: center; padding: 0 12px; background: var(--bg-soft); color: var(--muted); font-family: var(--mono); font-size: 0.875rem; white-space: nowrap; }
.slug-input span:first-child { border-right: 1px solid var(--line); }
.slug-input span:last-child { border-left: 1px solid var(--line); }
.slug-input input[name="slug"], .slug-input input[name="slug"]:hover, .slug-input input[name="slug"]:focus { flex: 1; min-width: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; font-family: var(--mono); font-size: 0.9375rem; }
@media (max-width: 480px) { .slug-input span:first-child { display: none; } }

.option-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); color: var(--ink-2); font-weight: 400; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.option-card:hover { border-color: var(--faint); }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option-card input { margin-top: 3px; flex: none; }
.option-body { display: block; min-width: 0; }
.option-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px; }
.option-price { color: var(--accent-ink); font-size: 0.9375rem; font-weight: 600; }
.option-desc { display: block; color: var(--muted); font-size: 0.875rem; }
.option-card.disabled { opacity: 0.6; cursor: not-allowed; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--bg-sunken); }
.seg span { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 0.9375rem; font-weight: 500; white-space: nowrap; }
.seg:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-xs); }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.seg em, .choice em { padding: 1px 6px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-size: 0.75rem; font-weight: 600; font-style: normal; }
@media (max-width: 480px) { .segmented { display: flex; } .seg { flex: 1 1 auto; } .seg span { justify-content: center; width: 100%; padding: 0 10px; } }

.fields { display: grid; gap: 16px; }
.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr); }
@media (max-width: 640px) { .fields-2, .fields-3 { grid-template-columns: minmax(0, 1fr); } }
label small.opt { display: inline; margin: 0; }

.summary-card { padding: 22px; box-shadow: var(--shadow-sm); }
.summary-card h2 { margin: 0 0 14px; font-size: 1.0625rem; letter-spacing: -0.01em; }
.summary-lines { display: grid; gap: 10px; margin: 0 0 16px; font-size: 0.9375rem; }
.summary-lines div { display: flex; justify-content: space-between; gap: 12px; }
.summary-lines div[hidden] { display: none; }
.summary-lines dt { color: var(--muted); }
.summary-lines dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.summary-total { display: grid; gap: 2px; margin-bottom: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-total span { color: var(--muted); font-size: 0.875rem; }
.summary-total strong { font-size: 1.5rem; letter-spacing: -0.03em; }
.summary-note { margin: 14px 0 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }

/* ---------------------------------------------------------------- Panel page */
.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: minmax(0, 1fr); } }
.kv { display: grid; margin: 0; }
.kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { padding-top: 0; border-top: 0; }
.kv dt { color: var(--muted); font-size: 0.875rem; }
.kv dd { min-width: 0; margin: 0; color: var(--ink); font-size: 0.9375rem; overflow-wrap: anywhere; }
.secret-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.specs li { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); min-width: 0; }
.specs span { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.specs b { color: var(--ink); font-size: 1.125rem; letter-spacing: -0.02em; }
@media (max-width: 520px) {
  .kv > div { grid-template-columns: minmax(0, 1fr); }
  .specs { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
  .specs li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border: 0; border-radius: 0; background: none; }
  .specs li + li { border-top: 1px solid var(--line); }
  .specs span { font-size: 0.875rem; }
  .specs b { font-size: 1rem; }
}

.install-state { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 36px; padding: 28px 32px; }
.install-illus { width: 200px; }
.install-state h2 { margin-bottom: 8px; font-size: 1.25rem; }
.install-state p { max-width: 560px; color: var(--muted); }
.progress-bar { position: relative; max-width: 420px; height: 6px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.progress-bar span { position: absolute; top: 0; bottom: 0; left: 0; width: 35%; border-radius: inherit; background: var(--accent); animation: indeterminate 1.6s ease-in-out infinite; }
@keyframes indeterminate { from { left: -35%; } to { left: 100%; } }
@media (max-width: 640px) { .install-state { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 20px; } .install-illus { width: 160px; } }
.badge-info::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.choice-body { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); transition: border-color 0.15s, box-shadow 0.15s; }
.choice:hover .choice-body { border-color: var(--faint); }
.choice input:checked + .choice-body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + .choice-body { box-shadow: var(--ring); }
.choice-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.choice-price { color: var(--ink-2); font-size: 0.9375rem; }
.choice-spec { color: var(--muted); font-size: 0.8125rem; }
.choice input:disabled + .choice-body { opacity: 0.55; cursor: not-allowed; }
.renew-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.renew-actions .hint { margin: 0; }
@media (max-width: 640px) {
  .choice-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .choice-body { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
}

/* ---------------------------------------------------------------- Account */
.account-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.stack-lg { display: grid; gap: 20px; }
@media (max-width: 900px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
.form .card-h { margin-bottom: 4px; }

/* ---------------------------------------------------------------- Account: two-factor authentication, personal data */
.code-input { font-family: var(--mono); letter-spacing: 0.08em; }
.steps-list { display: grid; gap: 18px; margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps-list li::marker { color: var(--accent); font-weight: 700; }
.qr { width: 184px; margin: 14px 0 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.totp-key { overflow-wrap: anywhere; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.recovery-codes code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 0.9375rem; text-align: center; }
.codes-card { max-width: 560px; }
.codes-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.disclosure { margin-top: 6px; }
.disclosure summary { color: var(--muted); font-size: 0.875rem; cursor: pointer; }
.disclosure[open] summary { margin-bottom: 14px; }
.danger-zone.danger-stack { flex-direction: column; align-items: stretch; }
/* Long labels (e.g. Russian) wrap instead of overflowing on phones. */
.btn-wrap { height: auto; min-height: 42px; padding-top: 10px; padding-bottom: 10px; line-height: 1.3; white-space: normal; text-align: center; }
@media (max-width: 420px) { .recovery-codes { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Administration */
/* Tabs (one page per area), with a counter of things to look at. */
.admin-tabs { display: flex; gap: 2px; margin: -8px 0 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.9375rem; font-weight: 500; white-space: nowrap; }
.admin-tabs a:hover { color: var(--ink); text-decoration: none; }
.admin-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.75rem; font-weight: 700; line-height: 20px; text-align: center; }
.main .container > .admin-tabs + * { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 20px; }
.stat span { color: var(--muted); font-size: 0.875rem; }
.stat b { display: block; margin-top: 2px; color: var(--ink); font-size: 1.75rem; letter-spacing: -0.03em; }
.stat small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8125rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.node-card .card-head h2 { font-size: 1.0625rem; }
.node-more { margin-top: 16px; }
.node-more summary { color: var(--accent-ink); font-size: 0.875rem; cursor: pointer; }
.node-more .kv { margin-top: 12px; }

/* Filters and search above a list, pager below. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--bg-sunken); }
.filter-tabs a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 0.875rem; font-weight: 500; }
.filter-tabs a:hover { color: var(--ink); text-decoration: none; }
.filter-tabs a[aria-current="true"] { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-xs); }
.filter-tabs a span { color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.admin-search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 420px; }
.admin-search input[type="search"] { min-width: 0; height: 36px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Overview: things that need a human. */
.alert-list { margin: 0; padding: 0; list-style: none; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.alert-item:first-child { border-top: 0; }
.alert-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.alert-item-err .alert-dot { background: var(--err); }
.alert-text { flex: 1; min-width: 0; color: var(--ink-2); }
.all-good { display: flex; align-items: center; gap: 8px; color: var(--ok); }

/* Panel page: explained actions, destructive one apart. */
.action-list { display: grid; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.action-row:first-child { padding-top: 0; border-top: 0; }
.action-row strong { color: var(--ink); font-size: 0.9375rem; }
.action-row p, .danger-zone p { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
.action-row form { flex: none; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form input[type="number"] { width: 76px; height: 36px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--err-line); border-radius: var(--radius); background: var(--err-soft); }
.danger-zone strong { color: var(--err); font-size: 0.9375rem; }
.danger-zone form { flex: none; }
.card-actions { margin-top: 18px; }
.plain-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 0.9375rem; }
.plain-list li + li { margin-top: 8px; }
.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; }

.choice-group { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-weight: 600; }
.inv-credit .inv-amount { color: var(--muted); }
.meter + .meter { margin-top: 14px; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--ink-2); font-size: 0.8125rem; }
.meter-track { height: 8px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.meter-high .meter-fill { background: var(--warn); }
.log summary { color: var(--accent-ink); font-size: 0.8125rem; cursor: pointer; }
.log pre { max-width: 640px; max-height: 320px; margin: 8px 0 0; font-size: 0.75rem; white-space: pre-wrap; }

@media (max-width: 1100px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .admin-grid, .stats:not(.stats-4) { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .stats-4 { grid-template-columns: minmax(0, 1fr); }
  .action-row, .danger-zone { flex-direction: column; align-items: flex-start; }
  .alert-item { flex-wrap: wrap; padding: 12px 16px; }
  .admin-search { max-width: none; }
}

/* ---------------------------------------------------------------- Small screens */
@media (max-width: 480px) {
  .main { padding: 28px 0 56px; }
  .main .card:not(.card-flush) { padding: 20px 16px; }
  .card-flush > .card-head, .card-foot, .card-empty { padding-left: 16px; padding-right: 16px; }
  .card-flush th:first-child, .card-flush td:first-child { padding-left: 16px; }
  .card-flush th:last-child, .card-flush td:last-child { padding-right: 16px; }
}

/* ---------------------------------------------------------------- Support tickets */
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1; vertical-align: 1px; }
.ticket-thread { display: grid; gap: 14px; margin-bottom: 20px; }
.ticket-msg { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.ticket-msg-staff { border-left: 4px solid var(--accent); background: var(--bg-soft); }
.ticket-msg header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; color: var(--ink); font-size: 0.875rem; }
.ticket-msg time { color: var(--muted); }
.ticket-body { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.ticket-form textarea { width: 100%; resize: vertical; }
.ticket-form label { position: relative; }
.ticket-admin { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .ticket-admin { grid-template-columns: minmax(0, 1fr); } }
.svc-help { display: flex; align-items: center; gap: 8px; margin: 4px 0 24px; color: var(--muted); font-size: 0.9375rem; }
