/* RadHub Admin design system.
   Tokens come from RadPerf (web/static/app.css) so the two apps read as one family.
   Every colour, space and size below refers to a token. Light and dark differ only
   in tokens; appearance.js sets data-theme on <html> before anything renders.
   Colour is kept for state: green fine, amber a warning, red critical, indigo advice,
   and each state also has a shape, so colour is never the only cue. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --hover: #f6f6f8;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #75757f;
  --border: #e6e6ea;
  --border-strong: #d4d4da;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --on-accent: #ffffff;
  --ink: #18181b;
  --on-ink: #ffffff;
  --ok: #15803d; --ok-solid: #16a34a; --ok-soft: #dcfce7; --ok-line: #b7e4c7;
  --warn: #b45309; --warn-solid: #d97706; --warn-soft: #fff4e5; --warn-line: #f8d4a8;
  --danger: #c81e1e; --danger-solid: #dc2626; --danger-soft: #fef1f1; --danger-line: #f8c4c4;
  --info: #4f46e5; --advice-soft: #f1f1fe;
  --neutral: #71717a;
  --meter: #e9e9ee;
  --shadow: 0 1px 2px rgb(16 16 24 / 0.04);
  --shadow-float: 0 10px 32px rgb(16 16 24 / 0.14), 0 1px 3px rgb(16 16 24 / 0.08);
  --icon-filter: none;
  --tint-1: linear-gradient(135deg, #eef0ff 0%, var(--surface) 62%);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius-sm: 6px; --radius: 9px; --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-lg: 16px; --fs-xl: 22px;
  --control-height: 36px;
  --form: 640px;
  --measure: 75ch;
  --gutter: clamp(16px, 2.4vw, 40px);

  /* Names older stylesheets still use. */
  --muted: var(--text-2);
  --blue: var(--accent);
  --line: var(--border);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0e; --surface: #141418; --surface-2: #1c1c21; --hover: #1a1a1f;
  --text: #f4f4f5; --text-2: #b4b4bc; --text-3: #8a8a94; --border: #26262c; --border-strong: #36363e;
  --accent: #8b86ff; --accent-hover: #a29eff; --accent-soft: #1e1d3a; --on-accent: #0b0b0e;
  --ink: #f4f4f5; --on-ink: #0b0b0e;
  --ok: #4ade80; --ok-solid: #22c55e; --ok-soft: #10291a; --ok-line: #1f5133;
  --warn: #fbbf24; --warn-solid: #f59e0b; --warn-soft: #2a1f0c; --warn-line: #5a4215;
  --danger: #f87171; --danger-solid: #ef4444; --danger-soft: #2c1213; --danger-line: #5e2224;
  --info: #a5a1ff; --advice-soft: #1c1b33; --neutral: #a1a1aa; --meter: #2a2a31;
  --shadow: none; --shadow-float: 0 10px 32px rgb(0 0 0 / 0.5), 0 0 0 1px #2a2a31;
  --icon-filter: brightness(0) invert(0.86);
  --tint-1: linear-gradient(135deg, #1e1c3f 0%, var(--surface) 62%);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: var(--fs) / 1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
h1 { font-size: var(--fs-xl); line-height: 1.25; letter-spacing: -0.015em; font-weight: 650; }
h2 { font-size: var(--fs-lg); line-height: 1.35; letter-spacing: -0.01em; font-weight: 620; }
h3 { font-size: var(--fs); line-height: 1.4; font-weight: 620; }
h4 { font-size: var(--fs); font-weight: 600; }
p + p { margin-top: var(--s2); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden], .hidden { display: none !important; }
.muted { color: var(--text-2); }
.quiet { color: var(--text-3); }
.small, small { font-size: var(--fs-sm); }
img { max-width: 100%; }
/* Bundled line icons are dark artwork; dark mode lightens them. Brand logos keep their colours. */
img[src^="/assets/icons/"]:not([src*="brand-"]) { filter: var(--icon-filter); }
.modal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── App shell: a top bar, as in RadPerf ────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner, .content { width: 100%; margin: 0 auto; padding-inline: var(--gutter); }
.topbar-inner { min-height: 56px; display: flex; align-items: center; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; font-size: 15px; white-space: nowrap; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand small { font-weight: 500; color: var(--text-3); font-size: var(--fs-sm); }
.logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #0ea5e9, #4f46e5); color: #fff; flex: none; }
.logo svg { width: 15px; height: 15px; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.nav-item img { width: 16px; height: 16px; opacity: 0.75; }
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.active, .nav-item[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-item.active img { opacity: 1; }
.topbar-end { display: flex; align-items: center; gap: var(--s3); margin-left: auto; }

.account-button { display: inline-flex; align-items: center; gap: var(--s2); padding: 3px 8px 3px 3px; border: 0; border-radius: 999px; background: none; color: var(--text); font-weight: 500; }
.account-button:hover { background: var(--surface-2); }
.account-button > img { width: 14px; height: 14px; opacity: 0.6; transform: rotate(90deg); }
.account-name { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.account-name strong { font-size: var(--fs-sm); font-weight: 600; }
.account-name small { font-size: var(--fs-xs); color: var(--text-3); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: var(--fs-sm); }
.account-panel { position: fixed; inset: 60px var(--gutter) auto auto; width: min(300px, calc(100vw - 24px)); max-height: 80dvh; overflow: auto; margin: 0; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.account-panel::backdrop { background: transparent; }
.account-heading { display: grid; gap: 2px; padding: var(--s2) 10px var(--s3); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.account-heading strong { font-weight: 620; overflow-wrap: anywhere; }
.account-heading small { color: var(--text-3); overflow-wrap: anywhere; }
.account-heading .tag { justify-self: start; margin-top: var(--s1); }
.account-panel > button, .account-panel > a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); text-align: left; }
.account-panel > button:hover, .account-panel > a:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.account-panel img { width: 16px; height: 16px; opacity: 0.7; }
.account-panel #logout { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; padding-top: 10px; }
.account-panel #account-error:empty { display: none; }
.appearance-control { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 7px 10px; font-size: var(--fs-sm); color: var(--text-2); }
.appearance-control select { height: 30px; padding: 0 28px 0 10px; }
.account-version { margin: 6px 10px 4px; padding-top: var(--s2); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-3); }

.content { display: flex; flex-direction: column; min-height: calc(100dvh - 57px); padding-top: var(--s5); }
#view { flex: 1 0 auto; min-width: 0; padding-bottom: var(--s7); }
.topline { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); color: var(--text-3); font-size: var(--fs-sm); }
.topline > span { display: none; }
.topline > nav { min-width: 0; }
.crumb { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-3); }
.crumb li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumb li > span[aria-hidden] { display: flex; opacity: 0.6; }
.crumb img { width: 12px; height: 12px; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--text); }
.crumb [aria-current] { color: var(--text-2); overflow-wrap: anywhere; }
.workspace-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); padding: var(--s4) 0 max(var(--s5), env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); }
.workspace-footer > span, .workspace-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.workspace-footer strong { color: var(--text-2); font-weight: 600; }
.workspace-footer a { color: var(--text-3); }
.workspace-footer a:hover { color: var(--text); }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 0; padding-top: var(--s2); }
  .nav { order: 3; flex-basis: 100%; padding-bottom: var(--s2); }
  .account-name, .account-button > img { display: none; }
  .account-button { padding: 3px; }
  .account-panel { inset: 56px 12px auto auto; }
}

/* ── Page head ──────────────────────────────────────────────────────────── */
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin: var(--s2) 0 var(--s5); }
.page-title > div { min-width: 0; }
.page-title h1 { overflow-wrap: anywhere; }
.page-title p { margin-top: var(--s1); color: var(--text-2); max-width: var(--measure); overflow-wrap: anywhere; }
.page-title > :not(div) { flex: none; }
.section-caption { margin: 0 0 var(--s4); color: var(--text-3); font-size: var(--fs-sm); }
.loading { padding: var(--s7) var(--s4); text-align: center; color: var(--text-3); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--s5); margin-bottom: var(--s5); min-width: 0; }
.panel > h2 { margin-bottom: var(--s2); }
.panel > p { color: var(--text-2); max-width: var(--measure); }
.panel > p + p { margin-top: var(--s2); }
.empty { padding: var(--s7) var(--s5); text-align: center; }
.empty > img { width: 32px; opacity: 0.5; margin-bottom: var(--s3); }
.empty p { max-width: 420px; margin: var(--s2) auto var(--s4); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-two > * { min-width: 0; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.role-card h3 { text-transform: capitalize; }
.role-card p { margin-top: var(--s1); color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 760px) { .grid-two, .role-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--control-height); padding: 0 14px; border: 1px solid var(--ink); border-radius: 8px; background: var(--ink); color: var(--on-ink); font-weight: 550; white-space: nowrap; text-decoration: none; }
.button:hover { opacity: 0.88; color: var(--on-ink); text-decoration: none; }
.button img { width: 15px; height: 15px; filter: brightness(0) invert(1); }
:root[data-theme="dark"] .button img { filter: brightness(0); }
.button.small { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.button.secondary:hover { color: var(--text); background: var(--hover); opacity: 1; }
.button.secondary img { filter: var(--icon-filter); }
.button.danger { color: var(--danger); background: var(--surface); border-color: var(--danger-line); }
.button.danger:hover { color: #fff; background: var(--danger-solid); border-color: var(--danger-solid); opacity: 1; }
.link-button { padding: 2px 0; border: 0; background: none; color: var(--accent); font-weight: 500; }
.link-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.link-button img { width: 14px; height: 14px; vertical-align: -2px; }
.close-button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text-2); }
.close-button:hover { background: var(--hover); }
.close-button img { width: 16px; height: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }

/* ── Tags and badges ────────────────────────────────────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 550; white-space: nowrap; }
/* Job states: a shape with the colour. Circle done, triangle failed, square running, dash quiet. */
.tag:is(.succeeded,.failed,.interrupted,.running,.queued,.cancelled)::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag:is(.owner,.admin,.viewer) { text-transform: capitalize; }
.tag.succeeded, .tag.owner { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag.failed, .tag.interrupted { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.tag:is(.failed,.interrupted)::before { width: 8px; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tag.running, .tag.admin { color: var(--info); background: var(--accent-soft); border-color: transparent; }
.tag.running::before { border-radius: 1.5px; }
.tag.queued { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tag.queued::before { border-radius: 1.5px; }
.tag.cancelled::before { height: 2px; border-radius: 1px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--neutral); }
.badge-ok::before { background: var(--ok-solid); box-shadow: none; }
.badge-warn { color: var(--warn); }
.badge-warn::before { width: 9px; height: 8px; border-radius: 0; background: currentColor; box-shadow: none; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.badge-danger { color: var(--danger); }
.badge-danger::before { width: 7px; height: 7px; border-radius: 1px; background: currentColor; box-shadow: none; transform: rotate(45deg); }
.badge-info { color: var(--info); }
.badge-info::before { width: 7px; height: 7px; border-radius: 1.5px; background: currentColor; box-shadow: none; }
.badge-quiet { color: var(--text-3); }
.badge-quiet::before { width: 8px; height: 2px; border-radius: 1px; background: currentColor; box-shadow: none; }

/* ── Notices ────────────────────────────────────────────────────────────── */
.notice { margin: var(--s4) 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--advice-soft); color: var(--text); line-height: 1.55; }
.notice > strong { display: block; font-weight: 620; }
.notice p { margin-top: var(--s1); color: var(--text-2); }
.notice.error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.error-text { color: var(--danger); font-size: var(--fs-sm); font-weight: 500; }
.success-text { color: var(--ok); }
.blockers { color: var(--warn); }
[role="alert"]:empty, [role="status"]:empty { display: none; }
.outcome { display: flex; gap: var(--s3); margin-bottom: var(--s5); padding: var(--s4); border: 1px solid var(--ok-line); border-radius: var(--radius-lg); background: var(--ok-soft); }
.outcome h3 { font-size: var(--fs-lg); margin-bottom: 2px; }
.outcome p { color: var(--text-2); }
.outcome-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface); }
.outcome-icon img { width: 16px; height: 16px; }
.outcome-warning { background: var(--warn-soft); border-color: var(--warn-line); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); min-width: 0; }
.field label, .list-field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field small { color: var(--text-3); font-size: var(--fs-sm); }
:is(.field, .list-field, .pagination-actions, .appearance-control, .page-size-label) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select),
.field textarea {
  width: 100%; min-width: 0; max-width: 100%; height: var(--control-height); padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text);
}
.field textarea { height: auto; min-height: 92px; padding: 9px 11px; font-family: var(--mono); font-size: var(--fs-sm); }
:is(.field, .list-field, .pagination-actions, .appearance-control, .page-size-label) select {
  appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat;
}
:is(input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.field.checkbox { flex-direction: row; align-items: center; gap: var(--s2); }
.field.checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.field.checkbox label { font-weight: 500; }
.field input[type="file"] { padding: 0; line-height: calc(var(--control-height) - 2px); }
.field input[type="file"]::file-selector-button { font: inherit; margin-right: 10px; height: 100%; padding: 0 12px; border: 0; border-right: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 620; margin-bottom: var(--s3); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; padding: 0; }
.panel.table-scroll { padding: 0; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table td strong { display: block; font-weight: 600; }
.data-table small { display: block; color: var(--text-3); }
.row-subtitle { display: block; margin-top: 2px; }
@media (max-width: 560px) {
  .data-table, .data-table tbody, .data-table tr { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .data-table tr:last-child { border: 0; }
  .data-table td { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); padding: 6px 0; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); margin-right: auto; color: var(--text-3); font-size: var(--fs-xs); text-align: left; }
  .data-table td:first-child { display: block; text-align: left; }
  .data-table td:first-child::before { display: none; }
}

/* ── Lists: filters and pagination ──────────────────────────────────────── */
.list-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.list-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.list-filters .search-field { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.search-field label { grid-column: 1 / -1; }
.advanced-filters { grid-column: 1 / -1; grid-row: 2; }
.advanced-filters summary { width: max-content; cursor: pointer; color: var(--accent); font-size: var(--fs-sm); font-weight: 500; }
.advanced-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); padding-top: var(--s3); }
.filter-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: var(--s2); }
.list-filters .filter-actions { grid-column: -2 / -1; grid-row: 2; pointer-events: none; }
.list-filters .filter-actions button { pointer-events: auto; height: auto; padding: 2px 0; border: 0; background: none; color: var(--text-3); font-size: var(--fs-sm); }
.list-filters .filter-actions button:hover { color: var(--text); }
.list-filters:has([name="access"]) .filter-actions, .list-filters:not(:has(.advanced-filters)):not(:has([name="access"])) .filter-actions { grid-row: auto; }
.list-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.pagination-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); --control-height: 32px; }
.pagination-actions form { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pagination-actions input { width: 64px !important; }
.page-size-label { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; --control-height: 32px; }
.page-size-label select { width: auto !important; min-width: 76px; }
.new-activity { width: 100%; margin: 0 0 var(--s3); text-align: left; }
#list-results[aria-busy="true"], #server-history-results[aria-busy="true"] { opacity: 0.6; transition: opacity 0.15s; }
@media (max-width: 860px) {
  .list-filters, .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-filters { grid-row: 3; }
  .list-filters .filter-actions { grid-row: 3; grid-column: 2; }
}

/* ── Server list ────────────────────────────────────────────────────────── */
.server-name-link { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); padding: 2px 0; }
.server-name-link:hover { color: var(--accent); }
.server-name-link img { width: 14px; height: 14px; opacity: 0.5; }
.server-name-link + small { display: block; margin-top: 2px; }
.data-table .server-name-link strong { margin: 0; }
.server-actions-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-2); }
.server-actions-button:hover, .server-actions-button[aria-expanded="true"] { background: var(--hover); border-color: var(--border-strong); }
.server-row-menu { position: fixed; inset: auto; margin: 0; width: 250px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); text-align: left; }
.server-row-menu > p { padding: 6px 10px; color: var(--text-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.server-row-menu nav { display: flex; flex-direction: column; }
.server-row-menu a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text); }
.server-row-menu a:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.server-row-menu svg { flex-shrink: 0; color: var(--text-3); }
.server-row-menu .server-remove-link { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; color: var(--danger); }
@media (min-width: 561px) {
  .data-table:has(.server-actions-button) :is(th, td):last-child { width: 1%; text-align: right; white-space: nowrap; }
  .data-table:has(.server-actions-button) :is(th, td):first-child { width: 40%; }
}

/* ── Results ────────────────────────────────────────────────────────────── */
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); color: var(--text-3); font-size: var(--fs-sm); }
.result { margin: 0; padding: var(--s4); overflow: auto; max-height: 480px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font: var(--fs-sm) / 1.6 var(--mono); color: var(--text); }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.result-list { margin: 0; padding-left: var(--s5); }
.result-list > li + li { margin-top: var(--s1); }
.technical { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--border); }
.technical summary, details > summary { cursor: pointer; }
.technical summary { color: var(--text-3); font-size: var(--fs-sm); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin: var(--s4) 0; }
.metric { padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.metric span { display: block; margin-bottom: 2px; color: var(--text-3); font-size: var(--fs-xs); }
.metric strong { font-size: 20px; font-weight: 620; letter-spacing: -0.01em; }
.fact-list { margin: 0 0 var(--s4); }
.fact-list > div { display: grid; grid-template-columns: minmax(130px, 34%) minmax(0, 1fr); gap: var(--s4); padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
.fact-list > div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--text-3); }
.fact-list dd { overflow-wrap: anywhere; }
.fact-list .fact-list > div { display: block; border: 0; padding: 2px 0; }
.login-preview { white-space: pre; overflow-x: auto; max-height: none; }
.operation-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.operation-list > button { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); width: 100%; padding: var(--s3) var(--s4); border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; }
.operation-list > button:last-child { border-bottom: 0; }
.operation-list > button:hover { background: var(--hover); }
.operation-list strong { display: block; font-weight: 600; }
.operation-list small { display: block; margin-top: 2px; color: var(--text-2); }
.operation-list img { width: 16px; height: 16px; opacity: 0.6; }
@media (max-width: 640px) { .fact-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ── Drawer ─────────────────────────────────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; z-index: 10; display: flex; justify-content: flex-end; background: rgb(10 10 16 / 0.28); backdrop-filter: blur(2px); }
.drawer { display: flex; flex-direction: column; width: min(640px, 100%); height: 100%; overflow: hidden; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-float); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-shrink: 0; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.drawer-header h2 { font-size: var(--fs-lg); }
.drawer-body { flex: 1; overflow: auto; padding: var(--s5); }
.drawer-body > h3 { margin: var(--s5) 0 var(--s2); }
.drawer .form-actions { padding-top: var(--s4); border-top: 1px solid var(--border); }
.drawer .panel { padding: var(--s4); }
.drawer .result { max-height: 300px; }

/* ── Sign-in, activation and information pages ──────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: start center; padding: var(--s7) var(--s4); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .wordmark { display: flex; justify-content: center; align-items: center; gap: 9px; margin-bottom: var(--s5); color: var(--text); font-size: var(--fs-lg); font-weight: 650; }
.auth-box .wordmark:hover { text-decoration: none; }
.auth-box h1 { text-align: center; }
.auth-box > p { margin: var(--s1) 0 var(--s5); text-align: center; color: var(--text-2); }
.auth-box form { padding: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-box .button { width: 100%; margin-top: var(--s2); }
.auth-foot { display: block; margin-top: var(--s4); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
a.auth-foot:hover { color: var(--text); }
.wordmark { font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.help-wrap { width: min(1100px, calc(100% - 2 * var(--gutter))); margin: 0 auto; }
.help-header { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--border); }
.help-header nav { display: flex; flex-wrap: wrap; gap: var(--s4); }
.help-header nav a { color: var(--text-2); }
.help-page { max-width: 720px; min-height: 65vh; padding: var(--s7) 0; }
.help-page h1 { margin-bottom: var(--s3); }
.help-page p { color: var(--text-2); line-height: 1.7; }
.help-back { display: inline-flex; margin: var(--s3) var(--s5) var(--s3) 0; }
.help-list { color: var(--text-2); line-height: 1.9; }
#ssh-public { font-family: var(--mono); overflow-wrap: anywhere; }

/* ── Helpers ────────────────────────────────────────────────────────────── */
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; }
.i-sm { width: 14px; height: 14px; vertical-align: -2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── Platform page ──────────────────────────────────────────────────────── */
.platform-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 var(--s5); border-bottom: 1px solid var(--border); }
.platform-nav a { padding: 9px 10px; margin-bottom: -1px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; }
.platform-nav a:hover { color: var(--text); text-decoration: none; }
.platform-nav a[aria-current] { color: var(--text); border-color: var(--text); }
.platform-updated { margin-left: auto; }
.section { margin-bottom: var(--s6); scroll-margin-top: 72px; }
.section > .section-head { margin-bottom: var(--s3); }
.card-row { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--s4) var(--s5); min-width: 0; }
.card.lvl-warn { border-color: var(--warn-line); }
.card.lvl-crit { border-color: var(--danger-line); }
.card-title { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 550; }
.kpi-v { margin: 6px 0 var(--s2); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.kpi-v.crit { color: var(--danger); }
.kpi-v.warn { color: var(--warn); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: var(--s3); padding: 5px 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.lines li > :first-child { color: var(--text-2); }
.lines li > :last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.card-note { margin-top: var(--s2); color: var(--text-3); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.alert.crit { border-color: var(--danger-line); background: var(--danger-soft); }
.alert.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.alert.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.alert p { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.alert b { display: block; font-weight: 600; color: var(--text); }
@media (max-width: 560px) { .alert { grid-template-columns: auto minmax(0, 1fr); } .alert > :last-child { grid-column: 2; justify-self: start; } .platform-updated { display: none; } }
.bars { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); padding: 4px 0; font-size: var(--fs-sm); }
.bars .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--meter); overflow: hidden; }
.bars .bar span { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 3px; }
.split { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.kv { width: 100%; border-collapse: collapse; margin-top: var(--s2); }
.kv th, .kv td { padding: 8px 0; border-top: 1px solid var(--border); text-align: left; vertical-align: top; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.kv th { color: var(--text-2); font-weight: 500; width: 45%; padding-right: var(--s4); }
.kv tr:first-child :is(th, td) { border-top: 0; }
.kv .badge + .badge { margin-left: var(--s2); }
.cmd { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s2); padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cmd code { overflow-x: auto; white-space: nowrap; font-size: var(--fs-sm); }
.usage { height: 5px; margin-top: 5px; border-radius: 3px; overflow: hidden; background: var(--meter); }
.usage span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--neutral); }
.spaced { margin-top: var(--s3); }

/* ── Choice cards (radio options with an explanation) ───────────────────── */
.choices { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.choices legend { font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s2); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice:hover { background: var(--hover); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice b { display: block; font-weight: 600; }
.choice span span { display: block; color: var(--text-2); font-size: var(--fs-sm); }
.tag + .tag { margin-left: 6px; }
.monitoring-tag { color: var(--text-2); border-style: dashed; }
.expected-list { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.expected-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: baseline; padding: var(--s2) 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.expected-list li:first-child { border-top: 0; }
.expected-list a { color: var(--text); font-weight: 550; }
.expected-list .quiet { overflow-wrap: anywhere; }

.footer-version { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s4); }
.footer-version strong { font-weight: 500; color: var(--text-2); }

/* ── Server identity colours: RadPerf's host colours; the dark set is stepped down so
   both pass the palette validator (lightness, chroma, colour-blind separation, contrast). */
:root { --id-0: #7c5cff; --id-1: #0ea5e9; --id-2: #10b981; --id-3: #f59e0b; --id-4: #ec4899; --id-5: #84cc16; --id-6: #a855f7; --id-7: #14b8a6;
        --bar-ok: #a1a1aa; --bar-failed: var(--danger-solid); }
:root[data-theme="dark"] { --id-0: #8b6cff; --id-1: #1693d0; --id-2: #0f9f74; --id-3: #c98500; --id-4: #e8508f; --id-5: #6f9c1a; --id-6: #a35ee6; --id-7: #0f9a8c; --bar-ok: #52525b; }
.id-0 { --c: var(--id-0); } .id-1 { --c: var(--id-1); } .id-2 { --c: var(--id-2); } .id-3 { --c: var(--id-3); }
.id-4 { --c: var(--id-4); } .id-5 { --c: var(--id-5); } .id-6 { --c: var(--id-6); } .id-7 { --c: var(--id-7); }
.id-bg-0 { background: var(--id-0); } .id-bg-1 { background: var(--id-1); } .id-bg-2 { background: var(--id-2); } .id-bg-3 { background: var(--id-3); }
.id-bg-4 { background: var(--id-4); } .id-bg-5 { background: var(--id-5); } .id-bg-6 { background: var(--id-6); } .id-bg-7 { background: var(--id-7); }
.id-stroke-0 { stroke: var(--id-0); } .id-stroke-1 { stroke: var(--id-1); } .id-stroke-2 { stroke: var(--id-2); } .id-stroke-3 { stroke: var(--id-3); }
.id-stroke-4 { stroke: var(--id-4); } .id-stroke-5 { stroke: var(--id-5); } .id-stroke-6 { stroke: var(--id-6); } .id-stroke-7 { stroke: var(--id-7); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2.5px; flex: none; }
.bar-ok-bg { background: var(--bar-ok); } .bar-failed-bg { background: var(--bar-failed); }

/* ── Fleet view on the Servers page ─────────────────────────────────────── */
.fleet { margin-bottom: var(--s5); }
.fleet .panel { margin-bottom: 0; padding: var(--s4) var(--s5); }
.fleet-hero { display: grid; gap: var(--s3); grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr) minmax(240px, 1fr); margin-bottom: var(--s5); }
@media (max-width: 1100px) { .fleet-hero { grid-template-columns: 1fr 1fr; } .fleet-hero > :nth-child(2) { grid-column: 1 / -1; order: 3; } }
@media (max-width: 700px) { .fleet-hero { grid-template-columns: 1fr; } }
.tint-id-0 { background: linear-gradient(135deg, color-mix(in srgb, var(--id-0) 9%, var(--surface)) 0%, var(--surface) 60%); }
.tint-id-1 { background: linear-gradient(135deg, color-mix(in srgb, var(--id-1) 8%, var(--surface)) 0%, var(--surface) 60%); }
.tint-id-3 { background: linear-gradient(135deg, color-mix(in srgb, var(--id-3) 9%, var(--surface)) 0%, var(--surface) 60%); }
.fleet .card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.fleet .card-title .quiet { font-weight: 400; }
.ring-wrap { display: flex; align-items: center; gap: var(--s4); }
.fleet-ring { width: 112px; height: 112px; flex: none; }
.fleet-ring .ring { fill: none; stroke-width: 12; stroke-linecap: round; outline: none; }
.fleet-ring .ring:hover, .fleet-ring .ring:focus-visible { stroke-width: 14; }
.fleet-ring .ring-failing { stroke-linecap: butt; stroke-dasharray: 4 3; }
.fleet-ring .ring-quiet { opacity: 0.35; }
.ring-value { fill: var(--text); font: 650 22px var(--font); }
.ring-sub { fill: var(--text-3); font: 500 10px var(--font); }
.headline b { display: block; font-size: var(--fs-lg); }
.headline b.crit { color: var(--danger); }
.headline b.ok { color: var(--ok); }
.headline p { margin-top: 2px; color: var(--text-2); font-size: var(--fs-sm); }
.legend { display: flex; flex-wrap: wrap; gap: 6px var(--s4); margin-top: var(--s4); color: var(--text-2); font-size: var(--fs-sm); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.big-row { display: flex; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); color: var(--text-2); font-size: var(--fs-sm); }
.big { color: var(--text); font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.fleet-chart { display: block; width: 100%; height: auto; overflow: visible; }
.fleet-chart .axis { fill: var(--text-3); font: 11px var(--font); }
.fleet-chart .gridline { stroke: var(--border); stroke-width: 1; }
.fleet-chart .hit { fill: transparent; }
.fleet-chart .bar-ok { fill: var(--bar-ok); }
.fleet-chart .bar-failed { fill: var(--bar-failed); }
.fleet-chart .bar-group { outline: none; }
.fleet-chart .bar-group:hover .mark, .fleet-chart .bar-group:focus-visible .mark { filter: brightness(1.12); }
.chart-tip { position: absolute; z-index: 30; pointer-events: none; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-float); color: var(--text); font-size: var(--fs-xs); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px var(--s3); font-size: var(--fs-sm); }
.hbars .v { color: var(--text-2); }
.hbars .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--meter); overflow: hidden; }
.hbars .fill { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--accent); }
.fleet-cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin-top: var(--s3); }
.srv { border-top: 3px solid var(--c); }
.srv-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.srv-name { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 620; min-width: 0; overflow-wrap: anywhere; }
.srv-name:hover { color: var(--text); }
.srv-sub { margin: 2px 0 var(--s3); color: var(--text-3); font-size: var(--fs-sm); }
.meter-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: 4px 0; font-size: var(--fs-sm); }
.meter-row > span:first-child { color: var(--text-3); font-size: var(--fs-xs); letter-spacing: 0.04em; text-transform: uppercase; }
.meter-row .meter { height: 6px; border-radius: 3px; background: var(--meter); overflow: hidden; }
.meter-row .meter i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--c); }
.meter-row .meter i.soft { background: color-mix(in srgb, var(--c) 45%, var(--meter)); }
.srv-quiet .meter-row .meter i { background: var(--neutral); }
.srv-foot { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); }
.list-heading { margin-bottom: var(--s3); }

/* ── Toast and quick actions ────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: var(--s4); max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-float); font-size: var(--fs-sm); }
.toast button { border: 0; background: transparent; color: var(--on-ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.quick-actions { display: inline-flex; flex-wrap: wrap; gap: var(--s2); }
.alert .alert-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); }
.srv-quick { margin: var(--s2) 0 var(--s1); }

/* ── Your settings ──────────────────────────────────────────────────────── */
.settings { display: grid; gap: var(--s6); grid-template-columns: 190px minmax(0, 1fr); align-items: start; }
.settings-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.settings-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.settings-nav a[aria-current] { background: var(--surface-2); color: var(--text); }
@media (max-width: 820px) { .settings { grid-template-columns: 1fr; gap: var(--s4); } .settings-nav { position: static; flex-direction: row; overflow-x: auto; } }
.settings-body { display: grid; gap: var(--s5); max-width: 760px; min-width: 0; }
.settings-body .panel { margin: 0; scroll-margin-top: 72px; }
.settings-body .hint { margin: 2px 0 var(--s3); color: var(--text-3); font-size: var(--fs-sm); }
.settings-body .grid-two .form-actions { grid-column: 1 / -1; margin-top: 0; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.setting b { display: block; font-weight: 600; }
.setting p { color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 560px) { .setting { grid-template-columns: 1fr; } }
.seg { display: inline-grid; grid-auto-flow: column; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius); }
.seg button { padding: 5px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 560px) { .themes { grid-template-columns: 1fr; } }
.theme { padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-align: left; }
.theme[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme .pv { display: grid; grid-template-columns: 26% 1fr; gap: 4px; height: 64px; padding: 8px; }
.theme .pv i { display: block; border-radius: 4px; }
.pv-light { background: #f7f7f8; } .pv-light i:first-child { background: #fff; border: 1px solid #e6e6ea; } .pv-light i:last-child { background: linear-gradient(#fff 0 40%, #eef0ff 40% 100%); border: 1px solid #e6e6ea; }
.pv-dark { background: #0b0b0e; } .pv-dark i:first-child { background: #141418; border: 1px solid #26262c; } .pv-dark i:last-child { background: linear-gradient(#141418 0 40%, #1e1d3a 40% 100%); border: 1px solid #26262c; }
.pv-system { background: linear-gradient(90deg, #f7f7f8 50%, #0b0b0e 50%); } .pv-system i:first-child { background: #fff; border: 1px solid #e6e6ea; } .pv-system i:last-child { background: #141418; border: 1px solid #26262c; }
.theme-name { display: block; padding: 6px 10px; border-top: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 550; color: var(--text); }
.devices { list-style: none; margin: 0; padding: 0; }
.devices li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.devices li:first-child { border-top: 0; }
.device-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); }
.devices p { color: var(--text-3); font-size: var(--fs-sm); }

/* ── Density and motion, from your settings ─────────────────────────────── */
:root[data-density="compact"] { --control-height: 32px; }
:root[data-density="compact"] .panel { padding: var(--s4); margin-bottom: var(--s4); }
:root[data-density="compact"] .data-table td { padding: 7px 12px; }
:root[data-density="compact"] .data-table th { padding: 7px 12px; }
:root[data-density="compact"] .content { padding-top: var(--s4); }
:root[data-density="compact"] .page-title { margin-bottom: var(--s4); }
:root[data-density="compact"] :is(.checks li, .action-row, .setting) { padding-top: var(--s2); padding-bottom: var(--s2); }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

/* ── Server cards (4:5) with generated artwork ──────────────────────────── */
.scards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); margin-top: var(--s3); }
.scard { position: relative; aspect-ratio: 4 / 5; display: flex; flex-direction: column; min-height: 300px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.scard:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.scard .art { position: relative; display: block; flex: 0 0 38%; overflow: hidden; color: #fff; background:
  radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c) 80%, white) 0%, transparent 55%),
  radial-gradient(90% 80% at 100% 10%, color-mix(in srgb, var(--c) 55%, #7dd3fc) 0%, transparent 60%),
  radial-gradient(120% 100% at 60% 120%, color-mix(in srgb, var(--c) 70%, black) 0%, transparent 60%), var(--c); }
.scard .art:hover { text-decoration: none; }
:root[data-theme="dark"] .scard .art { filter: saturate(.9) brightness(.82); }
.art-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.2; opacity: .28; }
.art-initial { position: absolute; right: -4px; bottom: -26px; font: 800 116px/1 var(--font); color: rgb(255 255 255 / .16); letter-spacing: -.06em; user-select: none; }
.art-os { position: absolute; left: 14px; top: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgb(255 255 255 / .22); backdrop-filter: blur(6px); }
.art-os svg { width: 20px; height: 20px; }
.art-chip { position: absolute; right: 12px; top: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .92); color: #18181b; font-size: 12px; font-weight: 600; }
:root[data-theme="dark"] .art-chip { background: rgb(20 20 24 / .88); color: #f4f4f5; }
.art-chip i { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.art-chip.chip-danger i { width: 7px; height: 7px; border-radius: 1px; background: #dc2626; transform: rotate(45deg); }
.art-chip.chip-quiet i { width: 8px; height: 2px; border-radius: 1px; background: #71717a; }
.scard-quiet .art { filter: grayscale(.55) brightness(.96); }
:root[data-theme="dark"] .scard-quiet .art { filter: grayscale(.55) brightness(.75); }
.scard-failing { border-color: var(--danger-line); }
.scard-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 12px 16px 14px; }
.scard-name { color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }
.scard-name:hover { color: var(--text); }
.scard-sub { margin-top: -4px; color: var(--text-3); font-size: var(--fs-sm); }
.scard .meters { display: grid; gap: 4px; margin-top: 2px; }
.scard .meter-row { padding: 0; }
.scard-quiet .meter-row .meter i { background: var(--neutral); }
.scard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; }
.scard .srv-quick { margin: 2px 0 0; }

/* ── Tailscale ──────────────────────────────────────────────────────────── */
.ts-mark { width: 14px; height: 14px; flex: none; }
.ts-badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; padding: 3px 9px 3px 6px; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 550; white-space: nowrap; text-overflow: ellipsis; }
.ts-badge.on { color: var(--text); border-color: color-mix(in srgb, var(--ok-solid) 35%, var(--border)); }
.ts-badge.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.ts-badge.off { color: var(--text-3); border-style: dashed; background: transparent; }
.ts-badge .mono { font-weight: 500; }
.fleet-tabs { margin-bottom: var(--s4); }
#tailscale-devices .section-head { margin-bottom: var(--s3); }
#tailscale-connection h2 { display: inline-flex; align-items: center; gap: 8px; }
#tailscale-connection .ts-mark { width: 18px; height: 18px; }
.ts-setup { margin-top: var(--s3); }
.ts-setup summary { color: var(--accent); font-weight: 500; }
.steps-list { margin: var(--s2) 0 var(--s3); padding-left: 20px; color: var(--text-2); font-size: var(--fs-sm); }
.steps-list li + li { margin-top: 4px; }

/* ── Card notice badges ─────────────────────────────────────────────────── */
.scard-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: start; }
.scard-title { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.notices { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 128px; padding-top: 2px; }
.notice-badge { --a: #64748b; --b: #334155; position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(140deg, var(--a), var(--b)); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .12), inset 0 0 0 1px rgb(255 255 255 / .22);
  transition: transform .12s, box-shadow .12s; }
.notice-badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice-badge:hover, .notice-badge:focus-visible { transform: translateY(-1px) scale(1.06); box-shadow: 0 4px 12px rgb(0 0 0 / .18); text-decoration: none; color: #fff; }
.notice-badge.lvl-crit::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #ef4444; }
.nb-tailscale-key.lvl-warn { --a: #fbbf24; --b: #d97706; }
.nb-tailscale-key.lvl-crit { --a: #f87171; --b: #dc2626; }
.nb-os-update { --a: #60a5fa; --b: #2563eb; }
.nb-docker { --a: #22d3ee; --b: #0891b2; }
.nb-disk.lvl-warn { --a: #fb923c; --b: #ea580c; }
.nb-disk.lvl-crit { --a: #f87171; --b: #dc2626; }
.nb-memory { --a: #f472b6; --b: #db2777; }
.nb-monitoring { --a: #a5b4fc; --b: #6366f1; }
.nb-tailscale-update { --a: #7dd3fc; --b: #0284c7; }
.notice-more { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 650; }
:root[data-theme="dark"] .notice-badge { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
