/* Zonarr Automator — interface styles.
   Direction: achromatic ledger. The chrome holds no colour; ink on a cool grey ground, white panels,
   status shown by small marks (ok / warn / crit) and one data hue. Quiet 1px borders, no shadows at rest.
   Fonts are bundled (SIL OFL): Instrument Sans, JetBrains Mono (identifiers only). */

@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #f2f4f7;          /* ground: a cool blue-grey, one step off white */
  --surface: #ffffff;
  --sunk: #e8ebf0;           /* hover / active fill */
  --ink: #101114;
  --ink-2: #44474f;
  --ink-3: #6b6f78;
  --rule: #e3e6eb;           /* 1px dividers inside panels */
  --rule-strong: #cfd3da;    /* control borders */
  --mark: #101114;           /* the single accent is ink */
  --mark-ink: #ffffff;
  --data: #1d5fbf;           /* the one data hue */
  --ok: #2e7d32;
  --warn: #92400e;
  --crit: #c4242a;
  --focus: #1d5fbf;
  --radius: 8px;
  --radius-sm: 6px;
  --gap: 12px;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper:#101114; --surface:#17181c; --sunk:#202228; --ink:#ececee; --ink-2:#b4b6bd; --ink-3:#868993; --rule:#25272d; --rule-strong:#383b43; --mark:#ececee; --mark-ink:#101114; --data:#6c9bf0; --ok:#52b886; --warn:#e0953a; --crit:#ef6b60; --focus:#6c9bf0; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper:#101114; --surface:#17181c; --sunk:#202228; --ink:#ececee; --ink-2:#b4b6bd; --ink-3:#868993; --rule:#25272d; --rule-strong:#383b43; --mark:#ececee; --mark-ink:#101114; --data:#6c9bf0; --ok:#52b886; --warn:#e0953a; --crit:#ef6b60; --focus:#6c9bf0; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--data) 28%, transparent); color: inherit; }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 0 14px; background: var(--paper); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 18px; }
.brand-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); }
.brand-mark svg { width: 28px; height: 28px; }
.auth-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px; border-radius: 10px; background: var(--paper); color: var(--ink); }
.auth-mark svg { width: 48px; height: 48px; }
.brand b { display: block; font: 600 15px/1.1 var(--sans); }
.brand span { display: block; margin-top: 2px; font: 400 12px/1.2 var(--sans); color: var(--ink-3); }
.rail-menu { display: flex; flex-direction: column; flex: 1; }
.menu-btn { display: none; margin-left: auto; height: 32px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 500 13px/1 var(--sans); cursor: pointer; }
.nav { display: flex; flex-direction: column; flex: 1; padding: 0 8px; }
.nav h4 { margin: 14px 12px 4px; font: 400 12px/1.2 var(--sans); color: var(--ink-3); }
.nav h4.util { margin-top: auto; padding-top: 14px; }
.nav a { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 2px; min-height: 28px; padding: 0 10px; text-decoration: none; color: var(--ink-2); border-radius: var(--radius-sm); }
.nav a i { display: grid; place-items: center; color: var(--ink-3); }
.nav a i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a span { justify-self: start; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; background: var(--sunk); }
.nav a[aria-current="page"] i { color: var(--ink); }
.rail-foot { margin-top: 0; padding: 12px 20px 0; font-size: 12.5px; color: var(--ink-3); display: grid; gap: 10px; }
.rail-foot .who { color: var(--ink); font-weight: 500; }
.rail-foot .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.envtag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font: 500 12px/1.4 var(--sans); text-decoration: none; }
.envtag.dev { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
/* full-width flat amber bar on every page when ZONARR_ENVIRONMENT is not production (dev images set development) */
.envbar { padding: 6px 16px; text-align: center; font: 600 13px/1.4 var(--sans); color: #1a1300; background: #f5b301; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { color: var(--ink); text-decoration-color: var(--ink); }

main { padding: 36px clamp(24px, 4vw, 56px) 96px; max-width: 1180px; width: 100%; }
/* small quiet label (overview section names, sign-in art); never a breadcrumb that repeats the nav group (#435) */
.eyebrow { font: 400 13px/1.3 var(--sans); color: var(--ink-3); }
/* #435: a breadcrumb is a way back, so every item is a link to a parent page */
.crumbs { font: 400 13px/1.3 var(--sans); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
/* #435: how-it-works text folded under the one-line subtitle */
.page-help { margin-top: 6px; font-size: 13px; color: var(--ink-2); max-width: 72ch; }
.page-help > summary { color: var(--ink-3); width: max-content; }
.page-help > summary:hover { color: var(--ink); }
.page-help > div { margin-top: 6px; display: grid; gap: 6px; }
.page-head { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head h1 { font: 500 24px/1.2 var(--sans); letter-spacing: -.01em; margin-top: 6px; }
.lede { margin-top: 6px; max-width: 100ch; color: var(--ink-2); font-size: 14px; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font: 500 13.5px/1 var(--sans); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 82%, var(--paper)); }
.btn.quiet { color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); }
.btn.danger { border-color: var(--crit); color: var(--crit); background: transparent; }
.btn.danger:hover { background: var(--crit); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

input[type=text], input[type=password], input[type=url], select, textarea { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: 400 14px/1.4 var(--sans); transition: border-color .12s, box-shadow .12s; }
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; }
input[type=file] { color: var(--ink-2); font: 400 13.5px/1.4 var(--sans); max-width: 100%; }
input[type=file]::file-selector-button { height: 36px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: 500 13.5px/1 var(--sans); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--sunk); }
.transfer-example { margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.transfer-example pre { margin: 6px 0 0; padding: 10px 14px; background: var(--sunk); border-radius: var(--radius-sm); color: var(--ink-2); overflow-x: auto; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--crit); }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236b6f78' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E"); background-position: calc(100% - 10px) 50%; background-size: 12px 12px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 92px; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { appearance: none; flex: none; width: 36px; height: 20px; margin: 0; border: 1px solid var(--rule-strong); border-radius: 999px; position: relative; background: var(--sunk); cursor: pointer; transition: background .12s, border-color .12s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: transform .14s, background .12s; }
.switch input:checked { background: var(--ink); border-color: var(--ink); }
.switch input:checked::after { transform: translateX(16px); background: var(--paper); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* settings rows */
.section { margin-top: 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 4px 24px 8px; }
.section:first-of-type { margin-top: 0; }
.section > h3 { font: 500 16px/1.3 var(--sans); color: var(--ink); display: flex; align-items: center; gap: 10px; padding: 18px 0 4px; }
.row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 8px 32px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row label.lab, .row .lab { font-weight: 500; display: block; }
.row .req { color: var(--crit); margin-left: 3px; }
.row .help { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.control { max-width: 460px; }
.control .with-unit { position: relative; }
.control .with-unit input { padding-right: 52px; }
.control .with-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 400 12px/1 var(--sans); color: var(--ink-3); pointer-events: none; }
.err { margin-top: 6px; color: var(--crit); font-size: 13px; font-weight: 500; }
.stored { display: flex; gap: 12px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.stored b { font: 500 12px/1 var(--sans); color: var(--ok); }
.actions-inline { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.savebar { position: sticky; bottom: 0; margin: 28px -12px 0; padding: 14px 12px; background: var(--paper); border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: center; z-index: 5; }
.savebar .note { color: var(--ink-3); font-size: 13px; margin-left: auto; }
.savebar .note.dirty { color: var(--ink); font-weight: 500; }
.savebar .note.dirty::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 8px; }
.btn.primary[disabled] { opacity: 1; background: var(--sunk); border-color: var(--rule-strong); color: var(--ink-2); }
.form-index { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 16px; padding: 10px 0; background: var(--paper); border-bottom: 1px solid var(--rule); font-size: 13px; }
.form-index a { color: var(--ink-2); text-decoration: none; }
.form-index a:hover, .form-index a:focus-visible { color: var(--ink); text-decoration: underline; }
form .section[id] { scroll-margin-top: 56px; }
.control .hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

/* Global settings pages: the form beside what is in use now (#305) */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: start; }
.settings-layout.solo { grid-template-columns: minmax(0, 1fr); }
.settings-now { position: sticky; top: 24px; font-size: 13px; padding-top: 8px; }
.settings-now h2 { font: 500 14px/1.3 var(--sans); margin-bottom: 4px; }
.settings-now h3 { font: 500 13px/1.3 var(--sans); color: var(--ink-2); margin: 16px 0 0; }
.settings-now dl div { padding: 7px 0; }
.settings-now dt { color: var(--ink-3); }
.settings-now dd { color: var(--ink); margin: 2px 0 0; overflow-wrap: anywhere; }
.managed { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.managed b { font-weight: 500; color: var(--ink-2); }
.managed b.ok { color: var(--ok); }
@media (max-width: 1100px) { .settings-layout { grid-template-columns: minmax(0, 1fr); } .settings-now { display: none; } }

/* ---------------------------------------------------------------- data */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 400 12.5px/1.2 var(--sans); color: var(--ink-3); padding: 0 12px 10px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
td.mono, td .mono { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 50%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .name { font-weight: 500; text-decoration: none; white-space: nowrap; }
td .sub { white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.picks td { padding: 7px 0; } .picks td .sub { white-space: normal; }  /* Discord pick-lists (_macros.picker) */
/* per-item threshold overrides (_macros.thresholds): narrow number inputs, the reading's outcome on the right */
.thresholds td { padding: 8px 12px 8px 0; vertical-align: middle; } .thresholds th { padding-left: 0; }
.thresholds .with-unit { width: 92px; } .thresholds td:last-child { white-space: nowrap; }
.control:has(> .thresholds) { max-width: 560px; }
@media (max-width: 600px) { .thresholds td { padding-right: 6px; } .thresholds .with-unit { width: 72px; } .thresholds .with-unit input { padding-right: 30px; } }
td .name:hover { text-decoration: underline; }
td .sub { color: var(--ink-3); font-size: 12.5px; }
/* instances (#288): one table, a heading row per type, a 20px logo per row and one action menu; widths on the header cells, not <col> */
table.instances { table-layout: fixed; }
table.instances .c-name { width: 34%; } table.instances .c-int { width: 112px; } table.instances .c-state { width: 112px; } table.instances .c-act { width: 56px; text-align: right; }
table.instances td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.instances td { vertical-align: middle; }
table.instances .namecell { min-width: 0; } table.instances .namecell > div { min-width: 0; }
table.instances .name, table.instances .sub { overflow: hidden; text-overflow: ellipsis; display: block; }
table.instances .namecell .svc { width: 20px; height: 20px; margin: 0; border: 0; background: none; color: var(--ink-3); }
table.instances .namecell .svc img { inset: 0; width: 100%; height: 100%; background: none; }
table.instances .type-row th { padding-top: 24px; font: 500 14px/1.3 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0; }
table.instances .type-row .count { margin-left: 8px; font-weight: 400; color: var(--ink-3); }
table.instances tbody:first-of-type .type-row th { padding-top: 12px; }
.rowmenu { position: relative; display: inline-block; }
.rowmenu > summary::before, .rowmenu[open] > summary::before { content: none; }
.rowmenu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 140px; display: flex; flex-direction: column; padding: 4px; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); text-align: left; }
.rowmenu-list a, .rowmenu-list button { display: block; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--ink); font: 400 13.5px/1.2 var(--sans); text-align: left; text-decoration: none; cursor: pointer; border-radius: var(--radius-sm); }
.rowmenu-list a:hover, .rowmenu-list button:hover { background: var(--sunk); }
.rowmenu-list .danger-text { color: var(--crit); }
/* portainer: every environment's container table shares one column grid so State and Image start at the same x */
table.containers { table-layout: fixed; }
table.containers .c-name { width: 34%; } table.containers .c-state { width: 24%; }
table.containers td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { table.containers { table-layout: auto; } table.containers col { width: auto; } table.containers td.clip { white-space: normal; } }
@media (max-width: 900px) { table.instances { table-layout: auto; } table.instances .c-name { width: auto; } }
.group-title { display: flex; align-items: center; gap: 12px; margin: 32px 0 12px; }
.group-title h2 { font: 500 16px/1.3 var(--sans); }
.group-title .count { font: 400 13px/1 var(--sans); color: var(--ink-3); }
.tabbar { display: flex; gap: 20px; margin: 28px 0 18px; border-bottom: 1px solid var(--rule); overflow-x: auto; overscroll-behavior-x: contain; }
.tabbar .tab { flex: none; white-space: nowrap; }
.tab { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3); font: 500 14px/1 var(--sans); cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }
.tab .count { font: 400 12.5px/1 var(--sans); color: var(--ink-3); }
.pager { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.pager .sub { margin-right: auto; color: var(--ink-3); font-size: 12.5px; }
.glyph { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 4px; background: var(--sunk); color: var(--ink-2); font: 600 11px/1 var(--sans); margin-right: 10px; vertical-align: 1px; }
.empty { padding: 48px 16px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); text-align: center; color: var(--ink-2); }
.empty h2 { font: 500 18px/1.3 var(--sans); margin-bottom: 6px; color: var(--ink); }

.state { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1 var(--sans); }
.state::before { content: ""; width: 8px; height: 8px; background: currentColor; flex: none; }
.state.on { color: var(--ok); }
.state.on::before { border-radius: 50%; }
.state.off { color: var(--ink-3); }
.state.off::before { background: transparent; border: 1.5px solid currentColor; border-radius: 50%; }
.state.warn { color: var(--warn); }
.state.warn::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.state.crit { color: var(--crit); }
.state.crit::before { border-radius: 1px; }

.inline-form { display: inline; }
.rowactions { display: flex; gap: 8px; justify-content: flex-end; }

/* type chooser */
.chooser { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.chooser a { display: grid; grid-template-columns: 64px 180px 1fr 16px; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background .12s; }
.chooser a:last-child { border-bottom: 0; }
.chooser a:hover { background: var(--sunk); }
.chooser .g { font: 600 12px/1 var(--sans); }
.chooser .t { font: 500 16px/1.2 var(--sans); }
.chooser .d { color: var(--ink-2); }
.chooser .arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chooser .arrow { color: var(--ink-3); }
.chooser a:hover .arrow { color: var(--ink); }

/* overview */
.checks { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.checks li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.checks li:last-child { border-bottom: 0; }
.checks .box { width: 16px; height: 16px; border: 1.5px solid var(--rule-strong); border-radius: 50%; display: grid; place-items: center; font: 700 10px/1 var(--sans); }
.checks li.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.checks li.done .box::after { content: ""; width: 4px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.checks li.done span.t { color: var(--ink-3); }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.inventory { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.inventory a { padding: 16px 16px 14px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; display: grid; gap: 6px; align-content: start; }
.inventory a:nth-child(3n) { border-right: 0; }
.inventory a:hover { background: var(--sunk); }
.inventory .n { font: 400 30px/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.inventory .l { font-size: 13px; color: var(--ink-2); }
.inventory a.zero .n, .status-pending .inventory .n { color: var(--ink-3); }
/* a counter whose good value is 0 (stuck, failed, offline…): non-zero, the number takes the status colour and mark (#436) */
.inventory a.problem .n { color: var(--warn); }
.inventory a.problem.crit .n { color: var(--crit); }
.inventory a.problem .n::before { content: ""; display: inline-block; width: .4em; height: .36em; margin-right: .22em; vertical-align: .14em; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.inventory a.problem.crit .n::before { clip-path: none; height: .4em; border-radius: 50%; }
.ledger { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.ledger li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.ledger li:last-child { border-bottom: 0; }
.ledger time { font: 400 12.5px/1.6 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* overview: problems first, age in its own column, inventory columns by width, one-line ledger */
.checks.live li { grid-template-columns: 28px minmax(0, 1fr) auto auto; }
.checks .age { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.checks .problem { color: var(--crit); font-weight: 600; }
.inventory.fit { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.inventory.fit a { border: 0; box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule); min-width: 0; }
.inventory.fit .l > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger.clip li > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); display: grid; gap: 4px; }
.engine b { font: 600 13px/1.2 var(--sans); }

/* System page (#493): status at the panel's edge, a secret shown on request, endpoint list */
.section > h3 .state { margin-left: auto; }
.sys .intro { max-width: 76ch; padding: 2px 0 14px; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.sys .row > * { min-width: 0; }
.sys .row p + p { margin-top: 6px; }
.secret { display: flex; max-width: 560px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.secret code { flex: 1; min-width: 0; display: flex; align-items: center; height: 34px; padding: 0 10px; white-space: nowrap; overflow-x: auto; font-size: 13px; }
.secret .secret-value { flex: 1; min-width: 0; display: flex; }
.secret .secret-value[hidden], .secret .secret-mask[hidden] { display: none; }
.secret .secret-mask { color: var(--ink-3); overflow: hidden; }
.secret code { scrollbar-width: none; }
.secret .btn { height: auto; border: 0; border-left: 1px solid var(--rule-strong); border-radius: 0; min-width: 64px; justify-content: center; }
.vault-dash { color: var(--ink-3); }
.vault-head > div:first-child { flex: 1 1 360px; min-width: 0; }
table.instances.vault-list .c-act { width: 190px; }
.vault-act { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.vault-act form { display: inline; }
.otp { display: grid; gap: 10px; max-width: 560px; }
.otp .secret code { height: 52px; font: 600 26px/1 var(--sans); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.otp-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.otp-bar { flex: 1; height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.otp-bar i { display: block; height: 100%; width: 100%; background: var(--data); transition: width 1s linear; }
.otp.stale .secret code { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .otp-bar i { transition: none; } }
.secret-fallback { margin-top: 8px; } .secret-fallback code { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.endpoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.endpoints li { display: grid; gap: 2px; min-width: 0; }
.endpoints code { overflow-wrap: anywhere; }
.endpoints span { font-size: 13px; color: var(--ink-3); }

/* key/value */
dl.kv { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 16px; }
dl.kv > div { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
dl.kv > div:last-child { border-bottom: 0; }
dl.kv dt { color: var(--ink-3); font: 400 13px/1.7 var(--sans); }
dl.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* flashes / probes */
.flashes { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { padding: 11px 14px; border: 1px solid var(--rule); border-left: 3px solid var(--ok); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500; }
.flash.err { border-left-color: var(--crit); }
.probe { margin-top: 2px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); font-size: 13px; }
.probe strong { display: inline-flex; align-items: center; gap: 8px; }
.probe small { display: block; color: var(--ink-3); margin-top: 2px; }
.htmx-request .probe-slot { opacity: .5; }

/* dialog: the one thing that floats */
dialog { border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); padding: 24px 24px 20px; max-width: 440px; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(16,17,20,.18); }
dialog::backdrop { background: rgba(16,17,20,.45); }
dialog h3 { font: 500 18px/1.3 var(--sans); margin-bottom: 8px; }
dialog p { color: var(--ink-2); }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 520px); }
.auth-art { padding: 56px clamp(28px, 6vw, 84px); display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: var(--paper); }
.auth-art .eyebrow { color: color-mix(in srgb, var(--paper) 62%, transparent); }
.auth-art h1 { font: 600 clamp(34px, 4.2vw, 52px)/1.05 var(--sans); letter-spacing: -.02em; }
.auth-art h1 em { font-style: normal; }
.auth-art p { max-width: 36ch; color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 16px; }
.auth-form { padding: 56px clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; background: var(--paper); }
.auth-form h2 { font: 500 24px/1.2 var(--sans); margin: 8px 0 8px; }
.auth-form .fld { margin-top: 18px; }
.enroll-code { font: 600 32px/1.2 var(--mono); letter-spacing: .08em; margin: 8px 0 16px; user-select: all; }
.auth-form .fld label { display: block; font-weight: 500; margin-bottom: 6px; }
.auth-form .btn { margin-top: 24px; width: 100%; justify-content: center; height: 42px; }
.auth-form .fine { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); }

.err-page { padding: 12vh 0; }
.err-page h1 { font: 600 clamp(56px, 10vw, 96px)/.95 var(--sans); letter-spacing: -.02em; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
  .brand { padding-bottom: 0; }
  .menu-btn { display: inline-block; }
  .rail-menu { display: none; padding-top: 12px; }
  .rail.open .rail-menu { display: flex; }
  .rail-foot { margin-top: 12px; }
  main { padding-top: 24px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .chooser a { grid-template-columns: 44px 1fr; } .chooser .d, .chooser .arrow { display: none; }
  .auth { grid-template-columns: 1fr; } .auth-art { min-height: 34vh; }
  dl.kv > div { grid-template-columns: 1fr; gap: 2px; }
  th.hide-sm, td.hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- discord wizard */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.steps > li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px 12px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.steps .num { font: 400 28px/1 var(--sans); color: var(--ink-3); }
.steps > li.done .num { color: var(--ok); }
.steps > li[aria-current="step"] { border-color: var(--ink-3); }
.steps > li[aria-current="step"] .num { color: var(--ink); }
/* locked steps stay full contrast (no opacity) and say what unlocks them (#306) */
.steps > li.locked { border-style: dashed; background: transparent; }
.steps p.why-locked { margin-top: 10px; color: var(--ink); font-weight: 500; }
@media (max-width: 1100px) { .wizard .settings-now { display: block; position: static; } }
.steps h2 { font: 500 16px/1.3 var(--sans); margin-bottom: 8px; }
.steps p { max-width: 64ch; color: var(--ink-2); }
.how { margin: 12px 0 18px; padding-left: 20px; max-width: 64ch; color: var(--ink-2); display: grid; gap: 6px; }
/* bot status (#495): line choices on the left, a Discord-style preview of the rotation on the right */
.wizard-main { display: grid; gap: 28px; min-width: 0; }
.bot-status { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.bs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 22px 24px 18px; border-bottom: 1px solid var(--rule); }
.bs-head h2 { font: 500 16px/1.3 var(--sans); margin-bottom: 6px; }
.bs-head p { max-width: 60ch; color: var(--ink-2); }
.bs-head .switch { flex: none; margin-top: 2px; }
.bs-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.bs-choices { padding: 20px 24px 8px; min-width: 0; }
.bs-options { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 32px; align-items: start; }
.bs-options label[for] { display: block; font-weight: 500; margin-bottom: 6px; }
.bs-options .switch { margin-top: 30px; }
.bot-status .hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.bot-status h3 { font: 500 13px/1.3 var(--sans); color: var(--ink-2); margin: 24px 0 4px; }
.bs-group { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.bs-service { font-weight: 500; padding-top: 1px; }
.bs-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 24px; }
.bs-line { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.bs-line input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.bs-line small { display: block; font-size: 12.5px; color: var(--ink-3); }
.bs-line input:checked + span small { color: var(--ink-2); }
.bs-preview { background: var(--sunk); padding: 20px; border-left: 1px solid var(--rule); border-bottom-right-radius: var(--radius); }
.bs-member { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface); border-radius: var(--radius-sm); }
.bs-member > div { min-width: 0; }
.bs-member p { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 500; text-transform: uppercase; }
.bs-app { font: 500 10.5px/1 var(--sans); padding: 2px 5px; border-radius: 3px; background: var(--data); color: #fff; vertical-align: 1px; }
.bs-rotation { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.bs-rotation li[aria-current="true"] { color: var(--ink); font-weight: 500; }
.bs-rotation .empty { list-style: none; margin-left: -20px; color: var(--ink-3); }
.bs-foot { padding: 16px 24px; border-top: 1px solid var(--rule); }
@media (max-width: 760px) {
  .bs-body, .bs-options, .bs-group { grid-template-columns: minmax(0, 1fr); }
  .bs-options .switch { margin-top: 0; }
  .bs-preview { border-left: 0; border-top: 1px solid var(--rule); border-radius: 0; }
  .bs-head { flex-direction: column; gap: 12px; }
}
.how b { color: var(--ink); }
.plan { list-style: none; margin: 0; padding: 0; }
.plan li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.plan .tag { font: 500 12.5px/1.7 var(--sans); color: var(--ink-3); }
.plan li.ok .tag { color: var(--ok); }
.plan li.bad .tag { color: var(--crit); }
.plan .what { font-weight: 500; }
.plan .why { grid-column: 2; color: var(--ink-3); font-size: 13px; }
.plan li.bad .why { color: var(--crit); }
table.matrix { max-width: 640px; margin-top: 14px; }
table.matrix td { padding: 9px 12px 9px 0; font-size: 13px; }
select + input[type=text] { font-size: 13px; }

/* ---------------------------------------------------------------- monitoring views */
.eplist { list-style: none; margin: 8px 0 4px 14px; padding: 0 0 0 12px; border-left: 1px solid var(--rule-strong); display: grid; gap: 3px; font-size: 13px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; display: inline-block; width: 16px; color: var(--ink-3); }
details[open] > summary::before { content: "–"; }
.checks .state { width: 14px; }
@media (max-width: 900px) { .inventory[style*="repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; } }

/* "needs configuration" marker: nav items, section titles, page banners */
/* drawn triangle; the glyph text stays in the markup for screen readers and tests but is not painted */
.warn-icon { display: inline-block; width: 14px; height: 13px; vertical-align: -1px; background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); font-size: 0; color: transparent; cursor: help; }
/* #434: a setup problem on the page that fixes it is one quiet line, not a box; the full list is the overview's Readiness */
.setup-note { display: flex; gap: 8px; align-items: baseline; margin: 0 0 20px; font-size: 14px; color: var(--ink); }
.setup-note span.warn-icon { margin: 0; vertical-align: 0; transform: translateY(2px); }
.setup-note a { color: var(--ink); font-weight: 500; }
table.watching td .sub { white-space: normal; }
table.watching .state { white-space: nowrap; }
@media (max-width: 600px) { table.watching td.nowrap, table.rules td.nowrap { white-space: normal; } }
.state.snoozed { color: var(--ink-3); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 10px 0 0; }
.facts dt { color: var(--ink-3); font: 400 13px/1.7 var(--sans); }
.facts dd { margin: 0; }
.decide { margin-top: 28px; display: grid; gap: 18px; max-width: 720px; }
.decide .consequence { border-left: 3px solid var(--crit); padding: 8px 14px; background: var(--surface); border-radius: 4px; }
.decide .consequence.soft { border-left-color: var(--ok); }

/* ---------------------------------------------------------------- wiki (setup guides) */
.wiki { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; align-items: start; }
.wiki-index { position: sticky; top: 24px; }
.wiki-index h4 { margin: 0 0 8px; font: 500 13px/1.2 var(--sans); color: var(--ink-3); }
.wiki-index ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 2px; }
.wiki-index a { display: block; padding: 5px 10px; text-decoration: none; color: var(--ink-2); border-radius: var(--radius-sm); }
.wiki-index a:hover { color: var(--ink); background: var(--sunk); }
.wiki-index a[aria-current="page"] { color: var(--ink); background: var(--sunk); font-weight: 500; }
.wiki-body { max-width: 760px; }
.wiki-body h1 { font: 500 24px/1.2 var(--sans); letter-spacing: -.01em; margin: 0 0 18px; }
.wiki-body h2 { font: 500 18px/1.25 var(--sans); margin: 30px 0 10px; }
.wiki-body h3 { font: 600 15px/1.3 var(--sans); margin: 22px 0 6px; }
.wiki-body pre { background: var(--sunk); border-radius: var(--radius-sm); padding: 10px 14px; overflow-x: auto; }
.wiki-body pre code { font-size: 12.5px; }
.wiki-body blockquote { margin: 14px 0; padding: 8px 14px; border: 1px solid var(--rule); background: var(--sunk); border-radius: 4px; }
.wiki-body blockquote p { margin: 4px 0; }
.wiki-body table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13.5px; }
.wiki-body th, .wiki-body td { text-align: left; vertical-align: top; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); }
.wiki-body th { font: 400 12.5px/1.4 var(--sans); color: var(--ink-3); }
@media (max-width: 900px) { .wiki { grid-template-columns: minmax(0, 1fr); gap: 18px; } .wiki-index { position: static; } }

/* ---------------------------------------------------------------- service icons
   Letters are always rendered; the image sits on top and removes itself when it cannot load (see app.js).
   The tile takes the theme's surface, so dark mode has no white squares (#442). */
.svc { position: relative; flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--rule); border-radius: var(--radius-sm); vertical-align: middle; overflow: hidden; }
.svc i { font: 600 11px/1 var(--sans); font-style: normal; }
.svc img { position: absolute; inset: 15%; width: 70%; height: 70%; object-fit: contain; background: var(--surface); }
/* With script, the letters stay until the image has really loaded: a slow, lazy or broken image never shows an empty tile. */
@media (scripting: enabled) {
  .svc img:not(.is-loaded) { visibility: hidden; }
  .svc:has(img.is-loaded) > i { visibility: hidden; }
}
.svc-sm { width: 22px; height: 22px; margin-right: 8px; border-radius: 5px; }
.svc-sm i { font-size: 9px; }
.svc-lg { width: 44px; height: 44px; }
.svc-lg i { font-size: 13px; }
.chooser a .svc { transition: border-color .15s; }
.chooser a:hover .svc { border-color: var(--ink-3); }
.group-title .svc { margin-right: 4px; }
.namecell { display: flex; gap: 12px; align-items: center; }
.with-icon { display: flex; align-items: center; gap: 16px; }
.inventory .l { display: flex; align-items: center; }
.checks li .t > .svc { float: left; margin: 2px 12px 0 0; }

/* icon picker */
.iconpick { margin-top: 10px; }
.iconpick-now { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13px; }
.iconpick-off { color: var(--warn); font-size: 13px; margin-top: 8px; }
.iconpick-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.iconpick-grid button { all: unset; box-sizing: border-box; width: 100%; display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border: 1px solid var(--rule); border-radius: var(--radius-sm); cursor: pointer; font: 400 12px/1.2 var(--sans); color: var(--ink-2); text-align: center; word-break: break-word; }
.iconpick-grid button:hover, .iconpick-grid button:focus-visible { background: var(--sunk); color: var(--ink); }
.iconpick-grid button[aria-pressed="true"] { border-color: var(--ink); background: var(--sunk); color: var(--ink); }
.iconpick-grid .svc { margin: 0; }

/* second factor: QR code, manual key, recovery codes */
.qr-box { display: inline-block; padding: .5rem; background: #fff; border: 1px solid var(--rule, #ccc); border-radius: var(--radius-sm); }
.qr-box .qr { width: 11rem; height: 11rem; display: block; }
.secret-key { font-size: 15px; user-select: all; }
.secret-key span { display: inline-block; margin-right: .6em; }
.codes { list-style: none; padding: 0; columns: 2; max-width: 22rem; font-size: 1.05rem; line-height: 1.9; user-select: all; }

/* users page + account callouts */
.callout { padding: 12px 14px; margin: 0 0 22px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--sunk); max-width: 78ch; }
.callout.warn { border-color: var(--warn); }
.enroll-link { width: 100%; margin-top: 8px; }
dl.enroll-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 10px; font-size: 13px; }
dl.enroll-facts dt { color: var(--ink-3); }
dl.enroll-facts dd { margin: 0; word-break: break-word; }
.pw-rules { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; color: var(--ink-3); }
.pw-rules li { display: flex; gap: 8px; }
.pw-rules li::before { content: "•"; width: 1em; flex: none; text-align: center; }
.pw-rules li[data-state=ok] { color: var(--ok); }
.pw-rules li[data-state=ok]::before { content: ""; width: 8px; height: 8px; margin: 6px 2px 0; border-radius: 50%; background: currentColor; }
.pw-rules li[data-state=no] { color: var(--warn); }
.pw-rules li[data-state=no]::before { content: ""; width: 8px; height: 8px; margin: 6px 2px 0; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
/* users: one row per person with a trailing Manage button; its panel is the next row, shown by CSS
   while the button's <details> is open, so the panel spans the whole table and still works without script */
table.users { table-layout: auto; margin-bottom: 40px; }
table.users > tbody > tr > td { vertical-align: top; }
table.users > tbody > tr > td > .sub { margin-top: 4px; white-space: normal; }
table.users th { white-space: normal; }
table.users select[name=role] { width: 128px; }
table.users .c-act { width: 1%; text-align: right; padding-right: 0; }
table.users > tbody.user > tr.manage { display: none; }
table.users > tbody.user:has(details[open]) > tr.manage { display: table-row; }
table.users > tbody.user:has(details[open]) > tr > td { background: var(--sunk); border-bottom: 0; }
table.users > tbody.user:has(details[open]) > tr:first-child > td:first-child { border-top-left-radius: var(--radius); }
table.users > tbody.user:has(details[open]) > tr:first-child > td:last-child { border-top-right-radius: var(--radius); }
table.users > tbody.user:has(details[open]) > tr.manage > td { border-radius: 0 0 var(--radius) var(--radius); }
table.users > tbody.user:has(details[open]) > tr:first-child > td { padding-top: 16px; }
table.users > tbody.user:has(details[open]) > tr:first-child > td:first-child { padding-left: 16px; }
table.users > tbody.user:has(details[open]) > tr:first-child > td:last-child { padding-right: 16px; }
table.users > tbody.user > tr:hover > td { background: none; }
table.users > tbody.user:has(details[open]) > tr:hover > td { background: var(--sunk); }
table.users > tbody.user > tr:first-child > td { border-bottom: 1px solid var(--rule); }
table.users > tbody.user:last-of-type > tr:first-child > td { border-bottom: 0; }
table.users > tbody.user:has(details[open]) { border-bottom: 12px solid transparent; }
table.users > tbody > tr.manage > td { padding: 4px 16px 16px; }
table.users .manage-toggle > summary::before { content: none; }
table.users .manage-toggle[open] > summary { background: var(--surface); color: var(--ink); border-color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.manage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 2fr); gap: 16px; }
/* Discord holds the member list, so it takes the wide column over two rows; Sessions fills the row under Password and 2FA */
.manage-grid .discord { grid-column: 3; grid-row: 1 / span 2; }
.manage-grid .discord + section { grid-column: 1 / span 2; }
.users-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 16px; }
.users-bar p { margin: 0; font-size: 13px; color: var(--ink-2); }
.manage-grid .linked { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border-radius: var(--radius-sm); background: var(--sunk); font-size: 13px; }
.manage-grid .linked strong { font-weight: 500; }
.member-pick { display: flex; flex-direction: column; gap: 8px; }
.member-pick input[type=text] { height: 32px; padding-block: 4px; font-size: 13px; }
.member-pick table.picks td { padding: 0; border: 0; }
.member-pick table.picks tr:hover td { background: none; }
.member-pick label { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; }
.member-pick label:hover { background: var(--sunk); }
.member-pick label:has(:checked) { background: var(--sunk); font-weight: 500; }
.member-pick label input { transform: translateY(1px); accent-color: var(--ink); }
.member-pick .pager { margin-top: 0; gap: 8px; }
.member-pick > .btn { align-self: flex-start; }
.manage-grid section { padding: 16px; border-radius: var(--radius-sm); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.manage-grid h3 { margin: 0; font: 500 14px/1.3 var(--sans); color: var(--ink); }
.manage-grid .help { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.manage-grid .note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.manage-grid .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.manage-grid .actions:empty { display: none; }
.manage-grid .inline-form .btn { white-space: normal; height: auto; min-height: 28px; text-align: left; padding-block: 5px; }
.joined { display: flex; }
.joined input, .joined select { min-width: 0; height: 32px; padding-block: 4px; border-top-right-radius: 0; border-bottom-right-radius: 0; font-size: 13px; }
.joined .btn { height: 32px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.manage-account { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 16px; padding: 0 2px; }
.manage-account p { margin: 0; font-size: 13px; color: var(--ink-2); }
.manage-account strong { color: var(--ink); font-weight: 500; }
@media (max-width: 1200px) { .manage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .manage-grid .discord { grid-column: 1 / -1; grid-row: auto; } .manage-grid .discord + section { grid-column: 1 / -1; } }
@media (max-width: 640px) { .manage-grid { grid-template-columns: minmax(0, 1fr); } }
/* phone: each person is a small card (name and Manage on top, a labelled line per fact, the role below), the panel under it */
@media (max-width: 760px) {
  table.users, table.users > tbody, table.users > tbody > tr, table.users > tbody > tr > td { display: block; }
  table.users thead { display: none; }
  table.users > tbody.user > tr:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  table.users > tbody.user:last-of-type > tr:first-child { border-bottom: 0; }
  table.users > tbody.user > tr:first-child > td, table.users > tbody.user:has(details[open]) > tr:first-child > td { padding: 0; border: 0; background: none; border-radius: 0; }
  table.users > tbody.user:has(details[open]) > tr:first-child { padding: 14px 12px; border-bottom: 0; background: var(--sunk); border-radius: var(--radius) var(--radius) 0 0; }
  table.users .c-user { grid-column: 1; grid-row: 1; align-self: center; }
  table.users .c-act { grid-column: 2; grid-row: 1; width: auto; }
  table.users td[data-label] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
  table.users td[data-label]::before { content: attr(data-label); width: 88px; flex: none; color: var(--ink-3); }
  table.users td[data-label] .sub { margin: 0; flex-basis: 100%; padding-left: 98px; }
  table.users td.hide-sm { display: flex; text-align: left; }
  table.users td.hide-sm .sub { flex-basis: auto; padding-left: 0; }
  table.users .c-role { align-items: center; }
  table.users > tbody.user:has(details[open]) > tr.manage { display: block; }
  table.users > tbody > tr.manage > td { padding: 0 12px 12px; }
}

/* "Add ..." forms inside the console: stacked fields with room to breathe */
.stack-form { max-width: 560px; margin-top: 14px; }
.stack-form .fld { margin-bottom: 20px; }
.stack-form .fld label { display: block; font-weight: 500; margin-bottom: 6px; }
.stack-form .help { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.stack-form .btn { margin-top: 4px; }
select option:disabled { color: var(--ink-3); }

/* audit log */
/* #438 the filter is a plain toolbar row of one control height (labels for screen readers), not a card */
.audit-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.audit-filter label { flex: 1 1 140px; max-width: 240px; }
.audit-filter input { height: 36px; font-size: 13.5px; }
main:has(> .audit-wrap, > .audit-filter) { max-width: 1680px; } /* the audit log is the widest table: let it use the screen */
.audit-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; }
table.audit { table-layout: fixed; min-width: 860px; } /* fixed columns: a long target can no longer squeeze Detail to one letter per line */
table.audit th { padding: 14px 16px 10px; border-bottom-color: var(--rule-strong); } /* #438 no header band: the strongest rule sits under the header */
table.audit td { padding: 10px 16px; vertical-align: top; font-size: 13.5px; }
table.audit tbody tr:last-child td { border-bottom: 0; }
table.audit tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
table.audit td > span, table.audit td > small { display: block; }
table.audit small { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
table.audit .when { width: 172px; white-space: nowrap; color: var(--ink-2); } /* #308 one ISO line, right-aligned */
table.audit .who { width: 150px; }
table.audit .who span, table.audit .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.audit .who span { font-weight: 500; }
table.audit th.c-act { width: 196px; }
table.audit .tgt { width: 28%; color: var(--ink-2); font-size: 12.5px; word-break: break-all; } /* hashes: break anywhere, not at the first hyphen */
table.audit .det { color: var(--ink-2); overflow-wrap: break-word; }
table.audit td > .act { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; } /* #308 readable name, key in the tooltip */
/* #438 phone: each entry is a two-line row, time + action on line 1, who · IP · target in grey on line 2, a detail
   that differs from the target under it; no field is dropped and nothing scrolls sideways */
@media (max-width: 640px) {
  .audit-wrap { overflow-x: visible; }
  table.audit, table.audit tbody { display: block; min-width: 0; }
  table.audit thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.audit tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  table.audit tbody tr:last-child { border-bottom: 0; }
  table.audit tbody tr:hover td { background: none; }
  table.audit td, table.audit td.when, table.audit td.who, table.audit td.tgt { display: block; width: auto; min-width: 0; padding: 0; border: 0; text-align: left; }
  table.audit td.when { order: 0; flex: none; margin-right: 12px; color: var(--ink); }
  table.audit td:nth-child(3) { order: 0; flex: 1 1 0; }
  table.audit td > .act { white-space: normal; }
  table.audit td > .act::before { flex: none; }
  .audit-filter label { max-width: none; }
  table.audit tbody tr::after { content: ""; flex-basis: 100%; order: 1; }
  table.audit td.who, table.audit td.tgt, table.audit td.det { order: 2; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
  table.audit td.who span, table.audit td.who small { display: inline; margin: 0; font: inherit; color: inherit; }
  table.audit td.who small::before, table.audit td.tgt::before { content: "\00a0·\00a0"; font-family: var(--sans); }
  table.audit td.tgt { word-break: normal; overflow-wrap: anywhere; }
  table.audit td.det { flex-basis: 100%; }
  table.audit td:empty { display: none; }
}
.act::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.act[data-tone=warn]::before { background: var(--warn); } .act[data-tone=ok]::before { background: var(--ok); }
.act[data-tone=crit]::before { background: var(--crit); } .act[data-tone=data]::before { background: var(--data); }

/* alert types (#303, #441): one view per module (the index switches with the URL hash, no reload), a data line, one-line rows */
.at-index { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 12px; border-bottom: 1px solid var(--rule); }
.at-index a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.at-index a:hover, .at-index a:focus-visible { color: var(--ink); background: var(--sunk); }
.at-index a[aria-current="true"], .at-index a[aria-current="page"] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.at-types .section { display: none; margin-top: 0; scroll-margin-top: 16px; }
/* without JavaScript the URL hash picks the view (the first one by default); with it, .at-on does and the page does not jump */
.at-types:not(.at-js) .section:target, .at-types:not(.at-js):not(:has(.section:target)) .section:first-of-type, .at-types.at-js .section.at-on { display: block; }
.at-unset { margin: 4px 0 10px; color: var(--ink-2); font-size: 13px; }
.at-unset .state { margin-right: 6px; }
.at-types td.sub a { color: var(--ink-3); }
@media (min-width: 701px) {
  /* one line per kind: the name, then its explanation cut to the room left (the full text is its tooltip) */
  .at-types table { table-layout: fixed; }
  .at-types td, .at-types th { padding-top: 4px; padding-bottom: 4px; }
  .at-types .section > h3 { padding: 12px 0 0; }
  .at-head { align-items: baseline; }
  .at-head small { color: var(--ink-3); font: 400 13px/1 var(--sans); }
  .at-unset { margin: 2px 0 6px; }
  .at-name { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
  .at-name b { flex: none; font-weight: 500; }
  .at-name .badge { flex: none; white-space: nowrap; }
  .at-name .at-help { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 700px) {
  .at-name { display: block; }
  .at-types .section { padding: 4px 16px 8px; }
  .at-types thead { display: none; }
  .at-types tr { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .at-types tbody tr:last-child { border-bottom: 0; }
  .at-types td { display: block; padding: 0; border: 0; width: auto !important; }
  .at-types td:first-child { grid-column: 1 / -1; }
  .at-types td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--ink-3); font-size: 12px; }
}

/* open alerts (issue #301): fixed columns on wide screens, two-line rows below 1200px; the page never scrolls sideways */
table.alerts { table-layout: fixed; }
table.alerts .c-src { width: 22%; } table.alerts .c-state { width: 150px; } table.alerts .c-since { width: 88px; } table.alerts .c-act { width: 184px; }
table.alerts td { vertical-align: top; }
table.alerts .t { display: flex; align-items: baseline; gap: 10px; overflow-wrap: anywhere; }
table.alerts .t .state { flex: none; transform: translateY(-1px); }
table.alerts .c-alert > .sub { margin: 3px 0 0 18px; white-space: normal; }
table.alerts .c-src > *, table.alerts .c-state > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.alerts .c-src > .sub, table.alerts .c-state > .sub { margin-top: 3px; }
table.alerts .lbl { font-weight: 500; font-size: 13px; } table.alerts .lbl.crit { color: var(--crit); } table.alerts .lbl.warn { color: var(--warn); }
table.alerts .c-since { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.alerts .close-form { display: flex; gap: 6px; }
table.alerts .close-form select { width: auto; height: 28px; padding: 2px 26px 2px 8px; font-size: 12.5px; }
table.alerts-recent .sub { white-space: normal; }
.alerts-refresh { color: var(--ink-3); }
@media (max-width: 1200px) {
  table.alerts, table.alerts tbody, table.alerts td { display: block; }
  table.alerts { contain: inline-size; } /* long names never widen the page; they are clipped inside their cell */
  table.alerts thead, table.alerts colgroup { display: none; }
  table.alerts tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  table.alerts td { padding: 0; border: 0; min-width: 0; }
  table.alerts .c-alert { flex: 1 0 100%; }
  table.alerts .c-src, table.alerts .c-state { display: flex; gap: 6px; align-items: baseline; font-size: 13px; margin-left: 18px; }
  table.alerts .c-state { margin-left: 0; }
  table.alerts .c-src > .sub, table.alerts .c-state > .sub { margin-top: 0; }
  table.alerts .c-src { flex: 1 1 auto; } table.alerts .c-state { flex: 0 1 auto; }
  table.alerts .c-src > a, table.alerts .c-state > .lbl { flex: none; max-width: 20ch; }
  table.alerts .c-since { font-size: 13px; }
  table.alerts .c-act { margin-left: auto; }
}

/* #313 — login title in the app range, system values in the text face */
.auth-art { justify-content: center; }
.auth-art h1 { font-size: clamp(32px, 3vw, 40px); line-height: 1.02; margin: 0 0 20px; }
.auth-intro { max-width: 30rem; }
.auth-art { gap: 48px; }
.auth-watch { margin: 0; max-width: 30rem; display: grid; gap: 14px; font-size: 14px; }
.auth-watch > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.auth-watch dt { color: color-mix(in srgb, var(--paper) 62%, transparent); }
.auth-watch dd { margin: 0; }
dl.kv.sysinfo dd { font-family: var(--sans); font-size: 14px; line-height: 1.6; word-break: normal; }
dl.kv.sysinfo dd code { font-size: 13px; }

/* ---------------------------------------------------------------- #282 status page frame (/instances/<slug>/status) */
.status-frame .mono { font-family: inherit; font-size: inherit; }
.status-frame dl.kv dd { font: 400 14px/1.7 var(--sans); font-variant-numeric: tabular-nums; word-break: normal; overflow-wrap: anywhere; }
.status-frame .inventory { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 1px; background: var(--rule); margin-bottom: 12px; }
.status-frame .inventory a { border: 0; background: var(--surface); min-width: 0; }
.status-frame .inventory a:hover { background: var(--sunk); }
.status-frame .inventory .n, .status-frame .inventory .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-frame .inventory .l { display: block; }
.status-frame .inventory .u { font-size: 16px; letter-spacing: 0; color: var(--ink-3); }
/* one mark shape: a dot; a warning keeps its triangle */
.status-frame .state::before { border-radius: 50%; }
.status-frame .state.warn::before { border-radius: 0; }
/* red marks the failing fact, not the whole sentence */
.status-frame .plan li .why { color: var(--ink-3); }
.status-frame .plan .tag .state { font-size: 12.5px; line-height: 1.7; white-space: nowrap; }
@media (max-width: 900px) {
  .status-frame .inventory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-frame .inventory a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* phone tables: the fields hidden-on-small move to a grey second line instead of being dropped */
  .status-frame thead tr, .status-frame tbody tr { display: flex; flex-wrap: wrap; }
  .status-frame tbody tr { border-bottom: 1px solid var(--rule); }
  .status-frame tbody tr:last-child { border-bottom: 0; }
  .status-frame th, .status-frame td { flex: 1 1 0; min-width: 0; }
  .status-frame th:first-child, .status-frame td:first-child { flex-grow: 2; }
  .status-frame td { border-bottom: 0; overflow-wrap: anywhere; }
  .status-frame colgroup { display: none; }
  .status-frame th.hide-sm { display: none; }
  .status-frame tbody tr:has(> td.hide-sm)::after { content: ""; flex-basis: 100%; order: 1; }
  .status-frame tbody tr:has(> td.hide-sm) > td:not(.hide-sm) { padding-bottom: 4px; }
  .status-frame td.hide-sm { display: block; order: 2; flex: 0 1 auto; padding: 0 6px 13px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 13px; color: var(--ink-3); }
  .status-frame td.hide-sm .sub, .status-frame td.hide-sm div { display: inline; white-space: normal; }
  .status-frame td.hide-sm[data-label]::before { content: attr(data-label) "\00a0"; }
  .status-frame td.hide-sm ~ td.hide-sm::before { content: "·\00a0"; }
  .status-frame td.hide-sm ~ td.hide-sm[data-label]::before { content: "·\00a0" attr(data-label) "\00a0"; }
}

/* #284 monospace only for IDs, keys, hashes, paths, commands and code: ordinary values (detail panels,
   audit times and actions) use the text face; body already sets tabular-nums so figures still line up */
dl.kv dd { font-family: var(--sans); font-size: 14px; word-break: normal; overflow-wrap: anywhere; }

/* #283 warning icon: one outline triangle (warn_icon in _macros.html) instead of the ⚠ emoji and the filled clip-path mark */
span.warn-icon { width: 14px; height: 14px; flex: none; vertical-align: -2px; margin-left: 6px; background: none; clip-path: none; color: var(--warn); }
span.warn-icon svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* #286 page titles: the service icon beside the title only where there is width for it */
@media (max-width: 700px) { .page-head h1.with-icon > .svc { display: none; } }

/* sideways overflow (issue #285): grid children may shrink below their content, long words wrap, and a table
   too wide for a phone scrolls inside its own frame (first column stays); the page itself never scrolls sideways */
main, .wiki > * { min-width: 0; }
main :is(h1, h2, h3, h4, p, li, dd) { overflow-wrap: break-word; }
.ledger li > span { overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.table-scroll > table { min-width: 680px; }
.table-scroll :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); }
@media (max-width: 640px) { th { white-space: normal; } main td { overflow-wrap: anywhere; } .wiki-body table { display: block; overflow-x: auto; } }
/* Deluge seed rules (#312): one block per tracker instead of a wide table; fields stack on a phone */
.seed-rule { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 14px 16px; min-width: 0; margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--rule); }
.seed-rule > div > label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.seed-rule .hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.seed-rule .sr-table { grid-column: 1 / 4; } .seed-rule textarea { min-height: 0; }
.seed-rule .sr-del { align-self: start; margin-top: 30px; }
@media (max-width: 900px) { .seed-rule { grid-template-columns: repeat(3, minmax(0, 1fr)); } .seed-rule .sr-host { grid-column: 1 / -1; } .seed-rule .sr-table { grid-column: 1 / 3; } }
@media (max-width: 700px) {
  .seed-rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seed-rule :is(.sr-host, .sr-mode, .sr-table) { grid-column: 1 / -1; }
  .seed-rule .sr-del { margin-top: 0; }
}

/* Maintenance windows (#418): preset switcher, day chips, example starters. The schedule rows show for the chosen
   preset only (CSS :has, so it works without script); the summary under them is filled by app.js. */
input[type=time], input[type=datetime-local] { background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); padding: 8px 10px; font: 400 14px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.mw-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--sunk); border-radius: var(--radius); }
.mw-seg label, .mw-days label { position: relative; cursor: pointer; }
.mw-seg input, .mw-days input, .mw-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mw-seg span { display: block; height: 32px; padding: 0 14px; border-radius: var(--radius-sm); font: 500 13.5px/32px var(--sans); color: var(--ink-2); transition: background .12s, color .12s; }
.mw-seg label:hover span { color: var(--ink); }
.mw-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule-strong); }
.mw-seg input:focus-visible + span, .mw-days input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.mw-days { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-days span { display: block; min-width: 48px; height: 36px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); font: 500 13.5px/34px var(--sans); text-align: center; color: var(--ink-2); background: var(--surface); transition: background .12s, color .12s, border-color .12s; }
.mw-days label:hover span { border-color: var(--ink-3); color: var(--ink); }
.mw-days input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mw-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.mw-choice label { display: grid; gap: 4px; padding: 12px 14px 12px 40px; border: 1px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer; position: relative; }
.mw-choice label::before { content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; border: 1px solid var(--rule-strong); border-radius: 50%; background: var(--surface); }
.mw-choice label:has(:checked) { border-color: var(--ink); }
.mw-choice label:has(:checked)::before { border: 4px solid var(--ink); }
.mw-choice label:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mw-choice b { font: 500 14px/1.3 var(--sans); }
.mw-choice span { font-size: 13px; color: var(--ink-3); }
.mw-when .row.mw-on { display: none; }
.mw-when:has(input[name=schedule][value=daily]:checked) .mw-on.daily,
.mw-when:has(input[name=schedule][value=weekly]:checked) .mw-on.weekly,
.mw-when:has(input[name=schedule][value=monthly]:checked) .mw-on.monthly,
.mw-when:has(input[name=schedule][value=once]:checked) .mw-on.once,
.mw-when:has(input[name=schedule][value=cron]:checked) .mw-on.cron { display: grid; }
.mw-when #f-dom { width: 96px; }
.mw-when #f-dur, .mw-when #f-at { width: 160px; }
.mw-when #f-cron { font-family: var(--mono); font-size: 13px; }
.mw-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mw-summary [data-summary] { font: 500 15px/1.4 var(--sans); color: var(--ink); }
.mw-summary [data-summary]:empty { display: none; }
.mw-summary code, .mw-list code, .mw-when .hint code { font: 400 12.5px/1.4 var(--mono); color: var(--ink-2); }
.mw-list td.mw-next { font-variant-numeric: tabular-nums; }
.mw-list .mw-sched-sm { display: none; }
@media (max-width: 640px) { .mw-list .mw-sched { display: none; } .mw-list .mw-sched-sm { display: inline; } .mw-list td .sub { white-space: normal; } }
.mw-summary [data-cron-preview] { font-family: var(--mono); font-size: 12.5px; }
.mw-starters { margin-top: 40px; }
.mw-starters h2 { font: 500 16px/1.3 var(--sans); margin-bottom: 6px; }
.mw-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
nav.mw-examples { margin: 0 0 24px; }
nav.mw-examples > .lab { grid-column: 1 / -1; font-weight: 500; }
.mw-example { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .12s, background .12s; }
.mw-example:hover { border-color: var(--ink-3); }
.mw-example:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mw-example b { font: 500 14px/1.3 var(--sans); }
.mw-example span { font-size: 13px; color: var(--ink-3); }

/* Overview (#433): the status strip leads; inventory is a quiet table; the two columns end level. */
.ov-status { margin-bottom: 32px; }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ov-head h2 { font: 500 15px/1.3 var(--sans); }
.ov-head .sub, .ov-note { font-size: 12.5px; color: var(--ink-3); }
.ov-head a { font-size: 13px; }
.ov-note { margin: 0 0 8px; }
.ov-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.ov-cell { display: grid; gap: 4px; padding: 16px 20px 14px; color: var(--ink); text-decoration: none; }
.ov-cell + .ov-cell { border-left: 1px solid var(--rule); }
.ov-cell:hover { background: var(--sunk); }
.ov-cell:focus-visible { outline-offset: -2px; }
.ov-label { font: 500 13px/1.3 var(--sans); color: var(--ink-2); }
.ov-n { font: 400 36px/1.05 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ov-unit { font-size: 12.5px; color: var(--ink-3); }
.ov-cell.zero .ov-n { color: var(--ink-3); }
.ov-cell.crit .ov-n, .ov-cell.unreachable .ov-n { color: var(--crit); }
.ov-cell.warn .ov-n { color: var(--warn); }
.ov-cols { align-items: stretch; }
.ov-col { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.ov-inv td { padding: 7px 12px 7px 0; font-size: 13.5px; }
.ov-inv th.num, .ov-inv td.num { text-align: right; padding-right: 0; width: 88px; font-variant-numeric: tabular-nums; }
.ov-inv td.zero { color: var(--ink-3); }
.ov-inv a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.ov-inv a:hover span { text-decoration: underline; }
/* Recent changes takes only the height the left column leaves: whole rows, never a cut one. */
.ov-recent { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.ov-recent .ledger { flex: 1 1 0; min-height: 84px; display: grid; grid-template-rows: repeat(auto-fill, 41px); grid-auto-rows: 0; align-content: start; overflow: hidden; }
.ov-recent .ledger li { padding: 0 16px; border: 0; min-height: 0; overflow: hidden; align-items: center; }
.ov-recent .ledger li + li { box-shadow: inset 0 1px 0 var(--rule); } /* taste-skill-ignore: a row rule, drawn as a shadow so hidden 0-height rows show nothing */
@media (max-width: 900px) {
  .ov-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-cell:nth-child(odd) { border-left: 0; }
  .ov-cell:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .ov-recent, .ov-recent .ledger { flex: none; min-height: 0; }
  .ov-recent .ledger { grid-template-rows: none; grid-auto-rows: 41px; }
}

/* infrastructure map (#544): the canvas, its side panel, the forms under it */
.map-wrap { display: grid; gap: 14px; }
.map-unplaced { columns: 3 220px; column-gap: 24px; margin: 8px 0 0; padding-left: 18px; }
.map-unplaced li { break-inside: avoid; padding: 1px 0; }
main:has(> .map-wrap) { max-width: 1680px; } /* same width as the audit log */
.map-canvas { height: clamp(420px, 78vh, 860px); border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); touch-action: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 10px; }
.map-panel { padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface); overflow-wrap: anywhere; }
.map-panel h3 { margin: 0 0 4px; }
.map-notes { margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13.5px; }
.map-notes > :first-child { margin-top: 0; }
.map-form { display: grid; gap: 10px; margin-top: 12px; }
.map-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.map-form label:has(input[type=checkbox]) { display: flex; gap: 8px; align-items: center; }
.map-form .btn { justify-self: start; }
.map-inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 8px 8px 0; }
.map-list td { vertical-align: top; }
@media (min-width: 701px) { .section > .map-form { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; } .section > .map-form .wide, .section > .map-form .btn { grid-column: 1 / -1; } }
.map-glyph { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.map-list .namecell { display: flex; gap: 10px; align-items: center; }
.map-list .namecell .svc { width: 20px; height: 20px; margin: 0; border: 0; background: none; }
.map-list .namecell .svc img { position: absolute; inset: 0; width: 100%; height: 100%; background: none; }

/* spacing helpers (#627): replace inline style="margin/padding" in templates */
.empty.empty-inline { padding: 24px 0; }
.mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-14 { margin-bottom: 14px; } .mb-24 { margin-bottom: 24px; }
