/* Orbit: dark, minimal, neutral. Black/gray palette, no colour areas; the only colours are the status colours (online, degraded, offline).
   Bootstrap 5.3 underneath, restyled through the tokens below. Strict CSP: no style attributes, so everything is a class.
   Light theme: [data-bs-theme="light"] (set by js/theme.js, default follows the system, dark otherwise). Start page orbit: css/orbit.css (generated). */

/* ---------- Tokens ---------- */
:root, [data-bs-theme="dark"] {
    --bg: #0b0c0e;
    --surface: #15161a;
    --raise: #1b1d21;
    --line: #25272c;
    --line-strong: #353840;
    --text: #ececee;
    --text-rgb: 236, 236, 238;
    --muted: #8a9099;
    --faint: #5c6169;
    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --ok-bg: rgba(74, 222, 128, .12);
    --warn-bg: rgba(251, 191, 36, .12);
    --bad-bg: rgba(248, 113, 113, .12);
    --gray-bg: rgba(138, 144, 153, .14);
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
}
[data-bs-theme="light"] {
    --bg: #f1f2f4;
    --surface: #ffffff;
    --raise: #f4f5f7;
    --line: #dfe1e5;
    --line-strong: #c4c8cf;
    --text: #15171a;
    --text-rgb: 21, 23, 26;
    --muted: #626973;
    --faint: #9aa0a8;
    --ok: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    --ok-bg: rgba(21, 128, 61, .1);
    --warn-bg: rgba(180, 83, 9, .1);
    --bad-bg: rgba(185, 28, 28, .09);
    --gray-bg: rgba(98, 105, 115, .12);
    --focus: #1d4ed8;
    --shadow: 0 1px 2px rgba(20, 24, 30, .06);
    color-scheme: light;
}
/* Bootstrap variables follow the tokens (declared on the same element, so var() resolves for both themes). */
:root, [data-bs-theme="dark"], [data-bs-theme="light"] {
    --bs-body-bg: var(--bg);
    --bs-body-bg-rgb: var(--bg);
    --bs-body-color: var(--text);
    --bs-body-color-rgb: var(--text-rgb);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-color: var(--faint);
    --bs-secondary-bg: var(--raise);
    --bs-tertiary-bg: var(--raise);
    --bs-border-color: var(--line);
    --bs-border-color-translucent: var(--line);
    --bs-link-color: var(--text);
    --bs-link-color-rgb: var(--text-rgb);
    --bs-link-hover-color: var(--text);
    --bs-link-hover-color-rgb: var(--text-rgb);
    --bs-code-color: var(--text);
    --bs-heading-color: var(--text);
    --bs-body-font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .94rem;
    --bs-body-line-height: 1.45;
    --bs-border-radius: 12px;
    --bs-border-radius-sm: 9px;
    --bs-border-radius-lg: 14px;
    --bs-focus-ring-color: transparent;
}
[data-bs-theme="dark"] {
    --bs-success-rgb: 74, 222, 128; --bs-warning-rgb: 251, 191, 36; --bs-danger-rgb: 248, 113, 113;
    --bs-success-text-emphasis: #4ade80; --bs-warning-text-emphasis: #fbbf24; --bs-danger-text-emphasis: #f87171;
}
[data-bs-theme="light"] {
    --bs-success-rgb: 21, 128, 61; --bs-warning-rgb: 180, 83, 9; --bs-danger-rgb: 185, 28, 28;
    --bs-success-text-emphasis: #15803d; --bs-warning-text-emphasis: #b45309; --bs-danger-text-emphasis: #b91c1c;
}

/* ---------- Base ---------- */
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; }
a { text-underline-offset: .2em; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.text-secondary, .text-muted { color: var(--muted) !important; }
hr { border-color: var(--line); opacity: 1; }
code { color: var(--text); background: var(--raise); padding: .08rem .35rem; border-radius: 6px; font-size: .85em; }
pre code { background: none; padding: 0; }
pre { color: var(--text); }
code.user-select-all, .recovery-codes code { color: var(--text); }
.recovery-codes { font-size: 1.1rem; letter-spacing: .05em; }
.bg-body-tertiary { background: var(--raise) !important; }
.border { border-color: var(--line) !important; }
.visually-hidden-focusable:not(:focus) { position: absolute; }

/* ---------- Page frame: slim top bar, one column ---------- */
.frame { max-width: 40rem; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.frame:has(.screen-wide) { max-width: 68rem; }
.frame:has(.screen-orbit) { max-width: 44rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3rem; padding-top: max(.9rem, env(safe-area-inset-top, 0px)); }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: 1rem; color: var(--text); text-decoration: none; }
.brand svg { width: 1.25rem; height: 1.25rem; }
.back { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; color: var(--muted); font-weight: 600; text-decoration: none; }
.back:hover { color: var(--text); }
.back::before { content: ""; width: .5rem; height: .5rem; border-left: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg); margin-right: .15rem; }
.page { padding-block: .5rem 4rem; }
.screen { padding-bottom: 1rem; }
.screen-plain { padding: 0; }
.who .btn { --bs-btn-padding-y: .2rem; }

/* user menu */
.user-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .4rem; border: 0; background: none; color: var(--muted); font-size: .88rem; font-weight: 600; border-radius: 9px; }
.user-toggle:hover, .user-toggle[aria-expanded="true"] { color: var(--text); background: var(--surface); }
.user-toggle::after { content: ""; width: .38rem; height: .38rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-color: var(--text); --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-bg: var(--raise); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-bg: var(--raise); --bs-dropdown-link-active-color: var(--text);
    --bs-dropdown-divider-bg: var(--line); --bs-dropdown-border-radius: 14px; --bs-dropdown-padding-y: .4rem; --bs-dropdown-item-padding-x: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.dropdown-menu form { margin: 0; }
.dropdown-item { border-radius: 8px; margin-inline: .3rem; width: auto; }

/* ---------- Titles and headings ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .35rem 0 1rem; }
.page-header-title { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.page-title { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.page-back { font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.page-back:hover { color: var(--text); }
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.o-lead { margin: 0 0 1rem; color: var(--muted); }
.o-heading { margin: 1.5rem 0 .45rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.o-heading:first-child { margin-top: .25rem; }
.empty-state { text-align: center; color: var(--muted); padding: 2.2rem .5rem; background: var(--surface); border-radius: 14px; }

/* ---------- Flat lists: group = rounded dark surface of rows ---------- */
.o-list { background: var(--surface); border-radius: 14px; overflow: hidden; margin: 0; padding: 0; list-style: none; }
.o-list > * + * { border-top: 1px solid var(--line); }
.o-row { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem .95rem; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; font: inherit; }
a.o-row:hover { background: var(--raise); color: var(--text); }
.o-row.is-static { cursor: default; }
.o-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.o-n { font-weight: 600; overflow-wrap: anywhere; }
.o-s { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.o-m { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.o-chev { display: flex; align-items: center; color: var(--faint); }
.o-chev::after { content: ""; width: .45rem; height: .45rem; border-right: 1.7px solid currentColor; border-top: 1.7px solid currentColor; transform: rotate(45deg); margin-right: .2rem; }
.o-mono { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 9px; background: var(--raise); color: var(--text); font-weight: 700; font-size: .75rem; letter-spacing: 0; }
.o-list .o-mono { background: var(--raise); }
.o-body { padding: .85rem .95rem; }
.o-body > :last-child { margin-bottom: 0; }

/* ---------- Pills and dots (the only colours) ---------- */
.o-state, .o-pill { --s: var(--muted); --sb: var(--gray-bg); display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1.4; color: var(--s); background: var(--sb); white-space: nowrap; }
.o-state-online, .o-pill-ok { --s: var(--ok); --sb: var(--ok-bg); }
.o-state-degraded, .o-state-maintenance, .o-pill-warn { --s: var(--warn); --sb: var(--warn-bg); }
.o-state-offline, .o-pill-bad { --s: var(--bad); --sb: var(--bad-bg); }
.o-state-paused, .o-state-unconfigured, .o-pill-gray { --s: var(--muted); --sb: var(--gray-bg); }
.o-pill-sm { font-size: .72rem; padding: .08rem .5rem; }
.o-dot { --s: var(--muted); display: inline-block; flex: none; width: .6rem; height: .6rem; border-radius: 50%; background: var(--s); }
.o-dot-online { --s: var(--ok); } .o-dot-degraded, .o-dot-maintenance { --s: var(--warn); } .o-dot-offline { --s: var(--bad); }
.o-dot-paused, .o-dot-unconfigured { --s: var(--faint); }

/* Bootstrap badges follow the same rule: semantic ones tinted, everything else neutral */
.badge { --bs-badge-font-weight: 700; --bs-badge-border-radius: 999px; --bs-badge-padding-x: .6rem; --bs-badge-padding-y: .22rem; font-size: .74rem; }
.badge.text-bg-success { background-color: var(--ok-bg) !important; color: var(--ok) !important; }
.badge.text-bg-warning { background-color: var(--warn-bg) !important; color: var(--warn) !important; }
.badge.text-bg-danger { background-color: var(--bad-bg) !important; color: var(--bad) !important; }
.badge.text-bg-secondary, .badge.text-bg-light, .badge.text-bg-info, .badge.text-bg-primary, .badge.text-bg-dark { background-color: var(--gray-bg) !important; color: var(--muted) !important; border: 0 !important; }

/* ---------- Buttons ---------- */
.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 600; --bs-btn-padding-x: .95rem; --bs-btn-padding-y: .45rem; --bs-btn-font-size: .9rem;
    --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--raise); --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--raise); --bs-btn-active-border-color: var(--line-strong);
    --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--line-strong);
    --bs-btn-focus-shadow-rgb: 0, 0, 0; }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
.btn-sm { --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .82rem; --bs-btn-border-radius: 9px; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1rem; --bs-btn-border-radius: 12px; }
/* The primary button is the inversion: light on dark, dark on light. */
.btn-primary { --bs-btn-color: var(--bg); --bs-btn-bg: var(--text); --bs-btn-border-color: var(--text);
    --bs-btn-hover-color: var(--bg); --bs-btn-hover-bg: color-mix(in srgb, var(--text) 85%, var(--bg)); --bs-btn-hover-border-color: color-mix(in srgb, var(--text) 85%, var(--bg));
    --bs-btn-active-color: var(--bg); --bs-btn-active-bg: color-mix(in srgb, var(--text) 75%, var(--bg)); --bs-btn-active-border-color: color-mix(in srgb, var(--text) 75%, var(--bg));
    --bs-btn-disabled-color: var(--bg); --bs-btn-disabled-bg: var(--text); --bs-btn-disabled-border-color: var(--text); }
.btn-outline-primary, .btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--line-strong); --bs-btn-bg: transparent;
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--surface); --bs-btn-hover-border-color: var(--faint);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--surface); --bs-btn-active-border-color: var(--faint);
    --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line); }
.btn-outline-danger { --bs-btn-color: var(--bad); --bs-btn-border-color: var(--line); --bs-btn-bg: transparent;
    --bs-btn-hover-color: var(--bad); --bs-btn-hover-bg: var(--bad-bg); --bs-btn-hover-border-color: var(--bad);
    --bs-btn-active-color: var(--bad); --bs-btn-active-bg: var(--bad-bg); --bs-btn-active-border-color: var(--bad); }
.btn-danger { --bs-btn-color: #fff; --bs-btn-bg: #b91c1c; --bs-btn-border-color: #b91c1c; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #991b1b; --bs-btn-hover-border-color: #991b1b; --bs-btn-active-bg: #7f1d1d; --bs-btn-active-border-color: #7f1d1d; }
.btn-close { filter: none; opacity: .6; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Forms ---------- */
.form-label { margin-bottom: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.form-control, .form-select { background-color: var(--raise); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); padding: .6rem .85rem; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus { background-color: var(--raise); color: var(--text); border-color: var(--faint); box-shadow: none; outline: 2px solid var(--focus); outline-offset: 1px; }
.form-control:disabled, .form-control[readonly] { background-color: var(--surface); color: var(--muted); }
.form-control-lg { font-size: 1rem; padding: .75rem .95rem; border-radius: 12px; }
.form-control-sm, .form-select-sm { border-radius: 9px; padding: .3rem .6rem; }
.form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238a9099' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad); background-image: none; padding-right: .85rem; }
.invalid-feedback { color: var(--bad); font-size: .8rem; }
.form-text { color: var(--muted); font-size: .8rem; }
.form-check-input { background-color: var(--raise); border-color: var(--faint); }
.form-check-input:checked { background-color: var(--text); border-color: var(--text); }
.form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230b0c0e' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-check-input:focus { box-shadow: none; outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--faint); }
.input-group-text { background: var(--surface); border-color: var(--line); color: var(--muted); }
.o-field { margin-bottom: 1rem; }
.o-panel { background: var(--surface); border-radius: 14px; padding: 1rem .95rem; }
.o-panel > :last-child { margin-bottom: 0; }
.pin-input { letter-spacing: 0.5em; text-align: center; }

/* ---------- Alerts ---------- */
.alert { --bs-alert-border-radius: 12px; --bs-alert-padding-y: .65rem; --bs-alert-padding-x: .95rem; --bs-alert-color: var(--text); --bs-alert-bg: var(--surface); --bs-alert-border-color: var(--line); --bs-alert-link-color: var(--text); font-size: .9rem; }
.alert-warning { --bs-alert-bg: var(--warn-bg); --bs-alert-border-color: var(--warn); }
.alert-danger { --bs-alert-bg: var(--bad-bg); --bs-alert-border-color: var(--bad); }
.alert-success { --bs-alert-bg: var(--ok-bg); --bs-alert-border-color: var(--ok); }
.alert-info { --bs-alert-bg: var(--raise); --bs-alert-border-color: var(--line); }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; right: 12px; bottom: calc(20px + env(safe-area-inset-bottom)); left: 12px; z-index: 1100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { --bs-toast-bg: var(--surface); --bs-toast-border-color: var(--line); --bs-toast-border-radius: 12px; --bs-toast-color: var(--text); --bs-toast-max-width: 24rem; pointer-events: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border: 1px solid var(--line); background-color: var(--surface) !important; color: var(--text) !important; }
.toast, .toast.border-0 { border: 1px solid var(--line) !important; }
.toast.text-bg-success { border-left: 3px solid var(--ok) !important; }
.toast.text-bg-danger { border-left: 3px solid var(--bad) !important; }
.toast .btn-close { filter: none; opacity: .6; }
[data-bs-theme="dark"] .toast .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Tables, list groups, cards: the same dark surfaces ---------- */
.table-responsive { background: var(--surface); border-radius: 14px; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); --bs-table-striped-bg: var(--raise); --bs-table-hover-bg: var(--raise); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table > thead > tr > th { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line); white-space: nowrap; }
.table > tbody > tr:last-child > * { border-bottom-width: 0; }
.table .form-select-sm { min-width: 8.5rem; }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--line); --bs-list-group-border-radius: 14px;
    --bs-list-group-action-hover-bg: var(--raise); --bs-list-group-action-hover-color: var(--text); --bs-list-group-action-active-bg: var(--raise); --bs-list-group-action-active-color: var(--text);
    --bs-list-group-active-bg: var(--raise); --bs-list-group-active-color: var(--text); --bs-list-group-active-border-color: var(--line); --bs-list-group-item-padding-y: .75rem; --bs-list-group-item-padding-x: .95rem; overflow: hidden; }
.list-group-item { border-left: 0; border-right: 0; }
.list-group-item:first-child { border-top: 0; } .list-group-item:last-child { border-bottom: 0; }
.list-group-item-action { text-decoration: none; }
.list-group-flush { background: none; }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: transparent; --bs-card-border-radius: 14px; --bs-card-cap-bg: var(--raise); --bs-card-color: var(--text); --bs-card-inner-border-radius: 14px; }
.card-header { border-bottom-color: var(--line); }
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-color: var(--text); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--raise); --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--line); --bs-pagination-active-bg: var(--text); --bs-pagination-active-color: var(--bg); --bs-pagination-active-border-color: var(--text); --bs-pagination-focus-bg: var(--raise); --bs-pagination-focus-color: var(--text); --bs-pagination-focus-box-shadow: none; }
.nav-link { color: var(--muted); } .nav-link:hover { color: var(--text); }

/* Segmented switch (theme) */
.o-seg { display: inline-flex; background: var(--raise); border-radius: 10px; padding: 2px; }
.o-seg button { padding: .3rem .8rem; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.o-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
[data-bs-theme="light"] .o-seg button[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--line); }

/* Details rows (account security, modules) */
details > summary { cursor: pointer; }
.o-details > summary { padding: .7rem .95rem; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.o-details > summary::-webkit-details-marker { display: none; }
.o-details > summary::after { content: ""; width: .42rem; height: .42rem; border-right: 1.7px solid var(--faint); border-bottom: 1.7px solid var(--faint); transform: rotate(45deg); transition: transform .12s; }
.o-details[open] > summary::after { transform: rotate(-135deg); }
.o-details > :not(summary) { margin-inline: .95rem; }
.o-details > form, .o-details > div:last-child { margin-bottom: .9rem; }

/* ---------- Status page ---------- */
.o-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .8rem; margin-bottom: .4rem; }
.o-summary .o-grow { flex: 1; min-width: 8rem; font-size: .85rem; color: var(--muted); }
.o-appcards { background: var(--surface); border-radius: 14px; overflow: hidden; display: block; }
.o-appcard { background: none; border: 0; }
.o-appcard + .o-appcard { border-top: 1px solid var(--line); }
.o-appcard > summary { display: flex; align-items: center; gap: .75rem; padding: .75rem .95rem; cursor: pointer; list-style: none; }
.o-appcard > summary:hover { background: var(--raise); }
.o-appcard > summary::-webkit-details-marker { display: none; }
.o-appcard > summary::after { content: ""; flex: none; width: .45rem; height: .45rem; border-right: 1.7px solid var(--faint); border-top: 1.7px solid var(--faint); transform: rotate(45deg); margin-right: .2rem; transition: transform .12s; }
.o-appcard[open] > summary::after { transform: rotate(135deg); }
.o-appcard[open] > summary { background: var(--raise); }
.o-appcard > :not(summary) { margin-left: .95rem; margin-right: .95rem; }
.o-appcard > dl { margin-top: .8rem; }
.o-appcard > p { margin-bottom: .8rem; }
.o-appcard-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.o-appcard.is-updated .o-appcard-name::after { content: ""; display: inline-block; width: .4rem; height: .4rem; margin-left: .45rem; border-radius: 50%; background: var(--text); vertical-align: middle; }
.o-facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin-bottom: 0; font-size: .88rem; }
.o-facts dt { color: var(--muted); font-weight: 500; } .o-facts dd { margin: 0; overflow-wrap: anywhere; }
.o-facts code { padding: .05rem .4rem; }
.o-timeline { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--surface); border-radius: 14px; overflow: hidden; }
.o-timeline > li + li { border-top: 1px solid var(--line); }
.o-event { --s: var(--faint); display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .8rem; padding: .7rem .95rem .7rem 1.9rem; position: relative; }
.o-event::before { content: ""; position: absolute; left: .95rem; top: 1.05rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--s); }
.o-event-time { color: var(--muted); font-size: .82rem; min-width: 8.5rem; font-variant-numeric: tabular-nums; } .o-event-app { font-weight: 600; }
.o-event-online, .o-event-resumed { --s: var(--ok); } .o-event-offline { --s: var(--bad); } .o-event-degraded { --s: var(--warn); }
.o-event-version_changed, .o-event-commit_changed, .o-event-help_updated { --s: var(--text); }
.o-event-paused, .o-event-maintenance, .o-event-settings_changed, .o-event-logs_cleared { --s: var(--faint); }
.o-event-type { color: var(--muted); }

/* ---------- Login and other single-purpose pages ---------- */
.center-screen { display: flex; flex-direction: column; gap: .8rem; max-width: 24rem; margin: 0 auto; padding: 3.5rem 0 1rem; }
.center-screen h1 { margin: .2rem 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.center-screen > p { margin: 0; text-align: center; }
.logo-mark { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; margin: 0 auto; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.logo-mark svg { width: 1.7rem; height: 1.7rem; }
.setup-steps { margin: .5rem 0 1rem; color: var(--muted); font-size: .85rem; }
.setup-steps .is-current { color: var(--text); font-weight: 700; }

/* ---------- Help ---------- */
.help-body > :last-child { margin-bottom: 0; }
.help-body pre { background: var(--raise); border-radius: 10px; padding: .75rem; overflow: auto; }
.help-body table { width: 100%; margin-bottom: 1rem; } .help-body th, .help-body td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.help-entry { background: var(--surface); border-radius: 14px; padding: 1rem .95rem; margin-bottom: .8rem; scroll-margin-top: 1rem; }
.help-entry h2, .help-entry h3 { font-size: 1.05rem; font-weight: 700; }

/* ---------- Module shell (apps): top bar with the app, menu as a row of pills ---------- */
.module-name { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--text); text-decoration: none; min-width: 0; }
.module-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .6rem; }
.module-nav a { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; }
.module-nav a:hover { color: var(--text); }
.module-nav a.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* Table of contents (help, UI elements) */
.help-toc { display: flex; flex-direction: column; gap: .1rem; font-size: .88rem; max-height: 11rem; overflow-y: auto; }
.help-toc a { padding: .3rem .6rem; border-radius: 8px; color: var(--muted); text-decoration: none; }
.help-toc a:hover { background: var(--surface); color: var(--text); }
@media (min-width: 992px) { .help-toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); } }

/* Quick links under the orbit */
.o-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; margin: .6rem 0 0; font-size: .92rem; font-weight: 600; }
.o-quick a { color: var(--muted); text-decoration: none; padding: .35rem .2rem; }
.o-quick a:hover { color: var(--text); }

/* ---------- Orbit (start page): status in the core, apps as moons on a ring. Positions: css/orbit.css (generated). ---------- */
.orbit { --moon: clamp(2.4rem, 12cqw, 3.4rem); position: relative; width: 100%; max-width: 34rem; aspect-ratio: 1; margin: .5rem auto 0; container-type: inline-size;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--raise) 70%, var(--bg)), transparent 70%); }
.orbit-n0 { max-width: 15rem; }
.orbit-dense { --moon: clamp(1.9rem, 9cqw, 2.9rem); max-width: 38rem; }
.orbit-tiny { --moon: clamp(1.7rem, 7.5cqw, 2.5rem); }
.orbit-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px dashed var(--line); border-radius: 50%; pointer-events: none; }
.orbit-ring-out { width: 76%; height: 76%; }
.orbit-ring-in { width: 50%; height: 50%; }
.orbit-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 26%; aspect-ratio: 1; border-radius: 50%; background: var(--text); color: var(--bg); text-decoration: none; line-height: 1.1; text-align: center; z-index: 1; }
.orbit-core:hover { color: var(--bg); background: color-mix(in srgb, var(--text) 88%, var(--bg)); }
.orbit-core svg { width: 1.1rem; height: 1.1rem; margin-bottom: .1rem; }
.orbit-core b { font-size: clamp(.9rem, 5cqw, 1.3rem); font-weight: 800; letter-spacing: -.01em; }
.orbit-core span { font-size: clamp(.5rem, 2.2cqw, .65rem); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.orbit-core .o-dot { position: absolute; top: 12%; right: 12%; width: .6rem; height: .6rem; border: 2px solid var(--text); box-sizing: content-box; }
.orbit-sats { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.sat { position: absolute; width: var(--moon); height: var(--moon); transform: translate(-50%, -50%); }
.sat > a { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
    color: var(--text); font-weight: 700; font-size: clamp(.7rem, 3.2cqw, .85rem); text-decoration: none; }
.sat .o-dot { position: absolute; right: -1px; top: -1px; width: .65rem; height: .65rem; border: 2px solid var(--bg); box-sizing: content-box; }
.sat .l { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .3rem; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: clamp(.64rem, 2.6cqw, .74rem); font-weight: 600; color: var(--muted); }
.orbit-dense .sat .l { max-width: 5.5rem; }
.orbit-dense .sat .o-dot { width: .45rem; height: .45rem; border-width: 1.5px; right: -3px; top: -3px; }
.sat > a:hover, .sat > a:focus-visible { background: var(--text); color: var(--bg); }
.sat > a:hover .l, .sat > a:focus-visible .l { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
    .sat > a, .orbit-core { transition: background-color .15s ease, color .15s ease; }
}
/* Very many moons on a narrow screen: names only on hover/focus (and for screen readers), the moons stay readable. */
@container (max-width: 33rem) {
    .orbit-crowd .sat .l { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .orbit-crowd .sat > a:hover .l, .orbit-crowd .sat > a:focus-visible .l { top: auto; bottom: 100%; left: 50%; width: auto; height: auto; margin: 0 0 .3rem; padding: .15rem .45rem; clip-path: none; overflow: visible;
        background: var(--text); color: var(--bg); border-radius: 6px; z-index: 2; }
}

/* ---------- Dev tools, UI elements ---------- */
.branch-log, .branch-help { background: var(--raise); white-space: pre-wrap; word-break: break-word; border-radius: 10px; }
.branch-log { max-height: 26rem; overflow-y: auto; }
.ui-toc { position: sticky; top: 1rem; }
.ui-section { scroll-margin-top: 1rem; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.ui-section:last-child { border-bottom: 0; }
.ui-example { padding: 1rem; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--bg); }
.ui-code { margin-bottom: 1rem; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--surface); font-size: .8125rem; }
.ui-code > summary { padding: .25rem .75rem; color: var(--muted); }
.ui-code pre { max-height: 24rem; padding: .75rem; overflow: auto; border-top: 1px solid var(--line); }
.ui-swatch { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); height: 100%; }
.ui-swatch-color { height: 3rem; border-bottom: 1px solid var(--line); }
.sw-bg { background: var(--bg); } .sw-surface { background: var(--surface); } .sw-raise { background: var(--raise); } .sw-line { background: var(--line); }
.sw-text { background: var(--text); } .sw-muted { background: var(--muted); } .sw-ok { background: var(--ok); } .sw-warn { background: var(--warn); } .sw-bad { background: var(--bad); }

@media (max-width: 575.98px) {
    .page-title { font-size: 1.5rem; }
    .o-event-time { min-width: 100%; }
}
