/* Arcadia. Light and dark themes: <html data-theme="light|dark|system"> (system follows the OS). */
:root {
    --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f2f8; --text: #11142a; --muted: #5d6479; --border: #e2e5ee; --border-strong: #cfd4e1;
    --accent: #6a4cf5; --accent-hover: #5a3ce6; --accent-text: #ffffff; --accent-soft: #efebff; --accent-soft-text: #4b2fd1;
    --ok: #12804a; --ok-bg: #e6f6ed; --warn: #9b5800; --warn-bg: #fff2dd; --err: #c0321f; --err-bg: #fdebe8; --info: #1f62d0; --info-bg: #e8f0ff;
    --code-bg: #eef0f6; --shadow: 0 1px 2px rgba(16, 20, 42, .05), 0 1px 3px rgba(16, 20, 42, .06); --shadow-lg: 0 10px 30px rgba(16, 20, 42, .10);
    --focus: 0 0 0 3px rgba(106, 76, 245, .35); --radius: 12px; --radius-sm: 8px; --sidebar: 248px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b0d14; --surface: #131622; --surface-2: #1a1e2c; --text: #e8eaf3; --muted: #99a0b6; --border: #252a3a; --border-strong: #343a4e;
        --accent: #8a72ff; --accent-hover: #9d89ff; --accent-text: #0d0b1d; --accent-soft: #241e44; --accent-soft-text: #c3b6ff;
        --ok: #52d690; --ok-bg: #0f2a1b; --warn: #f4b862; --warn-bg: #2f230e; --err: #ff8f80; --err-bg: #361612; --info: #86b0ff; --info-bg: #142242;
        --code-bg: #1d2232; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
        --focus: 0 0 0 3px rgba(138, 114, 255, .45);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0b0d14; --surface: #131622; --surface-2: #1a1e2c; --text: #e8eaf3; --muted: #99a0b6; --border: #252a3a; --border-strong: #343a4e;
    --accent: #8a72ff; --accent-hover: #9d89ff; --accent-text: #0d0b1d; --accent-soft: #241e44; --accent-soft-text: #c3b6ff;
    --ok: #52d690; --ok-bg: #0f2a1b; --warn: #f4b862; --warn-bg: #2f230e; --err: #ff8f80; --err-bg: #361612; --info: #86b0ff; --info-bg: #142242;
    --code-bg: #1d2232; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --focus: 0 0 0 3px rgba(138, 114, 255, .45);
    color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 14.5px/1.55 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 1rem; font-weight: 700; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; margin: 1.75rem 0 .75rem; font-weight: 650; }
.panel > h2:first-child, .panel > form > h2:first-child { margin-top: 0; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
p { margin: .5rem 0; }
code, .mono { font-family: "Cascadia Code", ui-monospace, "SF Mono", Consolas, monospace; font-size: .88em; }
code { background: var(--code-bg); padding: .12em .4em; border-radius: 5px; }
code.wrap { white-space: pre-wrap; word-break: break-word; }
.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- App shell: sidebar + content ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .75rem;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: .25rem .5rem 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.brand-lg { font-size: 1.5rem; gap: .75rem; }
.nav-open, .nav-toggle { display: none; }
.sidenav { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-height: 0; overflow-y: auto; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlink {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 550; text-decoration: none;
}
.navlink:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.navlink.active { background: var(--accent-soft); color: var(--accent-soft-text); }
.navlink.as-button { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.navlink.as-button:hover { background: var(--surface-2); }
.navfoot { display: flex; flex-direction: column; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.usercard { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); }
.usercard:hover, .usercard.active { background: var(--surface-2); text-decoration: none; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: linear-gradient(135deg, #6a4cf5, #f97316); color: #fff; font-weight: 700; font-size: .8rem;
}
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: .78rem; }

.content { padding: 2rem clamp(16px, 3vw, 2.5rem) 4rem; width: 100%; min-width: 0; }

/* Theme switch (segmented control) */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; }
.theme-switch button { display: grid; place-items: center; width: 34px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.theme-switch .ico { width: 16px; height: 16px; }
.navfoot .theme-switch { margin: 0 .5rem; }

/* Sign-in / setup pages */
.auth { min-height: 100vh; background:
    radial-gradient(1200px 600px at 10% -10%, rgba(106, 76, 245, .12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(249, 115, 22, .10), transparent 60%), var(--bg); }
.auth-main { max-width: 680px; margin: 0 auto; padding: 3.5rem 16px 2rem; display: flex; flex-direction: column; align-items: center; }
.auth-main > .brand { margin-bottom: 1.75rem; }
.auth-main > .panel, .auth-main > form, .auth-main > div:not(.auth-foot):not(.alert) { width: 100%; }
.auth .panel.narrow { margin-top: 0; box-shadow: var(--shadow-lg); padding: 1.75rem 2rem; }
.auth-foot { margin-top: 1.5rem; }

/* Mobile: the sidebar becomes a top bar with a menu button (checkbox toggle, no script needed) */
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: sticky; z-index: 20; height: auto; padding: .6rem 16px; border-right: 0; border-bottom: 1px solid var(--border); }
    .sidebar-head { padding: 0; }
    .nav-toggle { display: grid; }
    .sidenav { display: none; flex: none; max-height: calc(100vh - 64px); padding-top: .75rem; }
    .nav-open:checked ~ .sidenav { display: flex; }
    .navfoot { margin-top: .75rem; }
    .content { padding-top: 1.25rem; }
}

/* ---------- Page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.lead { color: var(--muted); margin: .35rem 0 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 .35rem; }
.crumbs a { color: var(--muted); }

.panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.narrow { max-width: 460px; margin: 2rem auto; }
.narrow.wide { max-width: 640px; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); margin-bottom: 1.25rem; }
.grid > .panel { margin-bottom: 0; }
.stat { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; margin-top: .25rem; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .ico { position: absolute; right: 1.1rem; top: 1.1rem; width: 22px; height: 22px; color: var(--accent); opacity: .8; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row > input[type=text], .row > input[type=search] { flex: 1 1 220px; width: auto; }
.spread { justify-content: space-between; }
.hint { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Section with its own side panel (Settings, My account) */
.section { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
.subnav { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: 2px; }
.subnav-title { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 .75rem .6rem; }
.subnav-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; }
.subnav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.subnav-link.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); padding: calc(.5rem - 1px) calc(.75rem - 1px); }
.subnav-link.active .ico { color: var(--accent); }
.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1.25rem; }
.section-body .narrow { margin: 0; max-width: 640px; }
@media (max-width: 1000px) {
    .section { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .subnav { position: static; flex-direction: row; flex-wrap: wrap; gap: .35rem; }
    .subnav-title { display: none; }
    .subnav-link { padding: .4rem .7rem; }
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td a { font-weight: 550; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin: 1rem 0 .35rem; font-size: .9rem; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 450; margin: .4rem 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
input[type=file] { padding: .45rem; }
textarea { min-height: 8rem; font-family: "Cascadia Code", ui-monospace, Consolas, monospace; font-size: .88rem; }
.field-error, .validation-summary-errors { color: var(--err); font-size: .88rem; }
.validation-summary-errors ul { margin: .25rem 0; padding-left: 1.2rem; }
.validation-summary-valid { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
form.inline { display: inline; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem 1rem; margin: 1rem 0 0; }
legend { font-weight: 650; padding: 0 .35rem; }

/* Choice cards (radio buttons shown as cards) */
.choices { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: .35rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; margin: 0; padding: .9rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 450; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: var(--focus); }
.choice input { margin-top: .2rem; }
.choice b { display: block; font-weight: 650; }
.choice small { color: var(--muted); }

/* ---------- Buttons ---------- */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .95rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 550; line-height: 1.35; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger, .btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
button.danger:hover, .btn.danger:hover { background: var(--err-bg); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
button.small, .btn.small { padding: .3rem .65rem; font-size: .85rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
td .row { flex-wrap: nowrap; }
td button, td .btn { padding: .3rem .65rem; font-size: .85rem; }

/* ---------- Feedback ---------- */
.alert { display: block; padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert a { color: inherit; text-decoration: underline; }
.secret {
    font-family: "Cascadia Code", ui-monospace, Consolas, monospace; font-size: 1.02rem; word-break: break-all;
    background: var(--code-bg); padding: .7rem .9rem; border-radius: var(--radius-sm); user-select: all; border: 1px dashed var(--border-strong);
}

.badge {
    display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 999px;
    font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: 1px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.active, .badge.online, .badge.enabled, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.suspended, .badge.offline, .badge.disabled, .badge.warn, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.deleted, .badge.revoked, .badge.err, .badge.error { background: var(--err-bg); color: var(--err); }
.badge.info, .badge.public { background: var(--info-bg); color: var(--info); }
.badge.private { background: var(--accent-soft); color: var(--accent-soft-text); }

.qr { background: #fff; padding: 8px; border-radius: 8px; width: 216px; height: 216px; }
.pager { display: flex; gap: .5rem; margin-top: 1rem; }

details.advanced { margin-top: 1.25rem; }
details.advanced > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before { content: "›"; display: inline-block; font-size: 1.2rem; line-height: 1; transition: transform .15s; color: var(--muted); }
details.advanced[open] > summary::before { transform: rotate(90deg); }
details.panel.advanced { margin-top: 0; }
details.advanced[open] > summary { margin-bottom: .75rem; }

pre.script { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.25rem 2.6rem; }
.steps > li::before {
    content: counter(step); position: absolute; left: 0; top: -.1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%;
    display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700; font-size: .85rem;
}
.steps > li > b:first-child { display: block; margin-bottom: .2rem; }

/* ---------- Fixes and refinements ---------- */
.sidebar .nav-toggle { display: none; }
@media (max-width: 900px) { .sidebar .nav-toggle { display: grid; } }
.navlink.as-button { justify-content: flex-start; }
.panel input[type=text], .panel input[type=email], .panel input[type=password], .panel input[type=number], .panel input[type=url],
.panel input[type=search], .panel input[type=datetime-local], .panel input[type=file], .panel select { max-width: 640px; }
.panel .row > input, .panel .row > select { max-width: none; }
.panel.row label.check { margin: 0; }
.panel.row label.check input[type=number] { width: 7.5rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.inline-form > label, .inline-form > div { margin: 0; }
.inline-form label > span { display: block; margin-bottom: .35rem; }
.inline-form input[type=number] { width: 8rem; }
.stat-label { color: var(--muted); font-weight: 550; font-size: .88rem; }
.stat-sub { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 1.25rem; }
.card-grid > .panel { margin: 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ico { width: 32px; height: 32px; color: var(--accent); margin-bottom: .5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=text], .toolbar input[type=search] { flex: 1 1 260px; max-width: 420px; }
.toolbar label.check { margin: 0; }
a.stat-card { color: var(--text); transition: border-color .15s, transform .15s; }
a.stat-card:hover { text-decoration: none; border-color: var(--accent); }
.stat .muted { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; }

.facts-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 40%), 1fr)); gap: 1rem 1.5rem; }
.facts-cols > div { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.facts-cols dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.add-row > input { flex: 1 1 220px; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
td.empty { padding: 2rem 1rem; }
.field-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.field-grid input, .field-grid select { max-width: none !important; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 0; margin-top: -.25rem;
    background: linear-gradient(to top, var(--bg) 65%, transparent); }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .1rem 1rem; margin-top: .6rem; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 260px; overflow-y: auto; background: var(--surface-2); }
.panel h3:first-child { margin-top: 0; }
.indent { margin-left: 1.6rem; }
.indent label { margin-top: .4rem; }
input.w-small { max-width: 8rem !important; }
textarea.short { min-height: 4.5rem; }

.section-head { margin: 1.75rem 0 .75rem; }
.section-head h2 { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: var(--surface-2); }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.timeline { width: 100%; height: 140px; display: block; }
.timeline rect { fill: var(--accent); opacity: .85; }
.timeline rect:hover { opacity: 1; fill: var(--accent-hover); }
.timeline line { stroke: var(--border-strong); stroke-width: 1; }
.wide-cards { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.wide-cards h2 { margin-top: .5rem; }
.wide-cards .table-wrap { margin-bottom: 0; }
.blockpage { text-align: center; padding-top: 2.25rem !important; }
.blockpage-icon { width: 48px; height: 48px; color: var(--err); margin-bottom: .5rem; }
.blockpage-domain { font-size: 1.15rem; font-weight: 600; background: var(--code-bg); border-radius: var(--radius-sm); padding: .5rem .75rem; display: inline-block; word-break: break-all; }
.blockpage-message { white-space: pre-line; margin: 1rem 0; }
.blockpage-foot { margin-top: 1.5rem; }
.icon-btn.spinning .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .icon-btn.spinning .ico { animation: none; } }
/* One-time secrets and commands: wrap long lines inside the box instead of running off the page. */
pre.secret { margin: 0; white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; max-width: 100%; line-height: 1.6; }
.one-time .actions { margin-top: .75rem; }
.one-time .alert { margin-bottom: .9rem; }
/* A command with its Copy button beside it. */
.cmd { display: flex; align-items: stretch; gap: .5rem; margin: .5rem 0 .35rem; }
.cmd pre { flex: 1 1 auto; min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd button { align-self: center; }
.steps > li > .hint { display: block; margin: .15rem 0 0; }
.inline-actions { display: inline-flex; margin-left: .35rem; vertical-align: middle; }

/* ---------- Responsive tables ----------
   site.js labels every cell with its column name and, when a table doesn't fit its box, switches it to cards
   (one card per row, "label: value" lines): no sideways scrolling at any width. Without script: scrolls. */
td .row { flex-wrap: wrap; }
td.actions-cell { text-align: right; white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; }
.table-wrap.stacked { overflow: visible; border: 0; background: transparent; box-shadow: none; }
.table-wrap.stacked table, .table-wrap.stacked tbody, .table-wrap.stacked tr, .table-wrap.stacked td { display: block; width: 100%; }
.table-wrap.stacked thead { display: none; }
.table-wrap.stacked tr {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: .6rem 1rem; margin-bottom: .75rem;
}
.table-wrap.stacked tbody tr:hover td { background: transparent; }
.table-wrap.stacked td {
    position: relative; border: 0; padding: .45rem 0 .45rem calc(min(34%, 9.5rem) + .9rem); overflow-wrap: anywhere; min-height: 1.9rem;
}
.table-wrap.stacked td + td { border-top: 1px dashed var(--border); }
.table-wrap.stacked td::before {
    content: attr(data-label); position: absolute; left: 0; top: .55rem; width: min(34%, 9.5rem);
    font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.table-wrap.stacked td[data-label=""] { padding-left: 0; }
.table-wrap.stacked td[data-label=""]::before { display: none; }
.table-wrap.stacked td:first-child { font-size: 1.02rem; }
.table-wrap.stacked td.actions-cell { text-align: left; white-space: normal; }
.table-wrap.stacked td.empty { display: block; }
/* Small dropdown menu (details/summary: works without script). */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: "▾"; font-size: .75em; margin-left: .3rem; color: var(--muted); }
.menu-list {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 11rem; display: flex; flex-direction: column; gap: 2px;
    padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.menu-list form { display: block; margin: 0; }
.menu-list button { width: 100%; justify-content: flex-start; border: 0; background: none; padding: .45rem .6rem; font-size: .9rem; }
.menu-list button:hover { background: var(--surface-2); }
.table-wrap.stacked .menu-list { left: 0; right: auto; }
.table-wrap:has(details.menu[open]) { overflow: visible; }

/* Results of a check (Settings, Email: DNS records). */
.check-results { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.check-results .badge { margin-right: .35rem; }

/* License: endpoints in use. */
progress.usage { appearance: none; width: 100%; height: .6rem; margin-top: 1rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
progress.usage::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.usage::-webkit-progress-value { background: var(--ok); border-radius: 999px; }
progress.usage::-moz-progress-bar { background: var(--ok); border-radius: 999px; }
progress.usage.high::-webkit-progress-value { background: var(--warn); }
progress.usage.high::-moz-progress-bar { background: var(--warn); }
progress.usage.full::-webkit-progress-value { background: var(--err); }
progress.usage.full::-moz-progress-bar { background: var(--err); }

/* License banner at the top of every page (super admins). */
.license-banner { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }

/* License portal additions. */
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.small-text { font-size: .78rem; }
