/* ThreadSafe web interface. One file, no build step. The palette is the one of docs/DESIGN-theLoom.md (charcoal panels, one brass accent);
   dark is its own theme, light is derived from it. The scheme is automatic (the system's) unless the switch in the menu sets it: the
   script writes the cookie, the server puts data-theme="light" or "dark" on the html element. Every colour is a token; every text colour
   is at least 4.5:1 on the surfaces it is used on (docs/DESIGN.md has the table). The restore wizard (src/Web/Html.php) uses the same tokens. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  /* light: the panel in daylight */
  --ink: #eef0f2;            /* page */
  --panel: #ffffff;          /* menu, boxes, tables */
  --panel-2: #f6f7f8;        /* cards and messages */
  --recess: #e5e8eb;         /* inset: form fields, code */
  --border: #cdd3d9;         /* separates, carries no information */
  --border-strong: #7f8a95;  /* boundary of a control (3:1) */
  --text: #14191f;
  --text-soft: #434e58;
  --text-faint: #56616b;
  --brass: #8a5a08;          /* links and the accent as text */
  --brass-bright: #6b4506;   /* hover */
  --brass-fill: #e0a13d;     /* primary button */
  --brass-fill-hover: #f0b75a;
  --brass-edge: #a8740f;     /* its edge, where the fill is too pale against the surface */
  --on-brass: #14191f;
  --ok: #1a7339;
  --warning: #8f4a00;
  --error: #b3382c;
  --danger-fill: #b3382c;
  --on-danger: #ffffff;
  --radius: 8px;
  --radius-small: 6px;
  --side-width: 14.5rem;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

/* dark: by the system's choice unless the switch says light ... */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #14191f;
    --panel: #1b232c;
    --panel-2: #212a33;
    --recess: #0f1318;
    --border: #303b47;
    --border-strong: #6a7784;
    --text: #e9ebe8;
    --text-soft: #9aa2a8;
    --text-faint: #838b92;
    --brass: #e0a13d;
    --brass-bright: #f0b75a;
    --brass-fill: #e0a13d;
    --brass-fill-hover: #f0b75a;
    --brass-edge: #e0a13d;
    --on-brass: #14191f;
    --ok: #5cb87a;
    --warning: #e6c84f;
    --error: #e87065;
    --danger-fill: #e87065;
    --on-danger: #14191f;
  }
}
/* ... or by the switch */
:root[data-theme="dark"] {
  color-scheme: dark;
    --ink: #14191f;
    --panel: #1b232c;
    --panel-2: #212a33;
    --recess: #0f1318;
    --border: #303b47;
    --border-strong: #6a7784;
    --text: #e9ebe8;
    --text-soft: #9aa2a8;
    --text-faint: #838b92;
    --brass: #e0a13d;
    --brass-bright: #f0b75a;
    --brass-fill: #e0a13d;
    --brass-fill-hover: #f0b75a;
    --brass-edge: #e0a13d;
    --on-brass: #14191f;
    --ok: #5cb87a;
    --warning: #e6c84f;
    --error: #e87065;
    --danger-fill: #e87065;
    --on-danger: #14191f;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

a { color: var(--brass); text-underline-offset: 0.18em; }
a:hover { color: var(--brass-bright); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.js-only { display: none !important; }
html.js .js-only { display: flex !important; }
.icon { flex: none; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* the page: the menu on the left, the content beside it */
.app { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); min-height: 100vh; }
:root[data-nav="collapsed"] { --side-width: 3.75rem; }
.content { display: flex; flex-direction: column; min-width: 0; }
.content main { flex: 1; width: 100%; }

.side {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100vh;
  padding: 0.75rem 0.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
/* the mark: the logo (src/Web/Logo.php, docs/DESIGN.md "The logo") and the name */
.mark { display: flex; align-items: center; gap: 0.65rem; min-width: 0; color: var(--text); text-decoration: none; }
.mark:hover { color: var(--text); }
.mark > .logo { flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-small); }
.mark .side-label { font: 600 0.85rem/1.4 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.side-menu { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.side nav { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.side-foot { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.side nav a, .side-link, .side-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.65rem;
  color: var(--text-soft);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--radius-small);
  cursor: pointer;
}
.side nav a:hover, .side-link:hover, .side-toggle:hover { color: var(--text); background: var(--panel-2); }
.side nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--brass); }
.side-toggle .icon { transition: transform 0.15s; }
:root[data-nav="collapsed"] .side-toggle .icon { transform: rotate(180deg); }
form.logout { margin: 0; }

/* the way past the menu for the keyboard; and the target of it */
.skip { position: absolute; top: -4rem; left: 0.5rem; z-index: 10; padding: 0.5rem 0.9rem; color: var(--on-brass); font: 600 0.78rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; background: var(--brass-fill); border: 1px solid var(--brass-edge); border-radius: var(--radius-small); }
.skip:focus { top: 0.5rem; color: var(--on-brass); }
main:focus { outline: none; }

/* the switch: automatic, light, dark */
.theme { gap: 0.25rem; padding: 0.2rem; background: var(--recess); border: 1px solid var(--border-strong); border-radius: var(--radius-small); }
.theme button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  color: var(--text-soft);
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.theme button:hover { color: var(--text); background: none; }
.theme button[aria-pressed="true"] { color: var(--on-brass); background: var(--brass-fill); border-color: var(--brass-edge); }
.theme .side-label { display: none; }

/* folded: only the icons; the names stay for assistive technology */
:root[data-nav="collapsed"] .side-label,
:root[data-nav="collapsed"] .side-head .mark .side-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root[data-nav="collapsed"] .side-head { flex-direction: column; }
:root[data-nav="collapsed"] .side nav a, :root[data-nav="collapsed"] .side-link, :root[data-nav="collapsed"] .side-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
:root[data-nav="collapsed"] .theme { flex-direction: column; }

/* before the login there is no menu: a bar with the mark and the switch */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--border); }
.bar .theme { flex: none; }
.bar .theme button { padding: 0.3rem 0.5rem; }
main { max-width: 64rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
main.narrow { max-width: 28rem; }
h1, h2, h3 { color: var(--text); line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.375rem; font-weight: 600; margin: 1rem 0; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }

footer { width: 100%; max-width: 64rem; margin: 0 auto; padding: 1rem; color: var(--text-faint); font: 0.72rem/1.5 var(--mono); letter-spacing: 0.04em; }

.field { margin: 0.9rem 0; }
.field label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.field.check label { font-weight: 400; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--recess);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
}
input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus { border-color: var(--brass); }
input[type="checkbox"] { accent-color: var(--brass-fill); }
::placeholder { color: var(--text-faint); opacity: 1; }

button, .button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  color: var(--on-brass);
  font: 600 0.78rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--brass-fill);
  border: 1px solid var(--brass-edge);
  border-radius: var(--radius-small);
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { color: var(--on-brass); background: var(--brass-fill-hover); }
button.link { padding: 0.2rem 0; color: var(--brass); font: inherit; letter-spacing: 0; text-transform: none; background: none; border: 0; text-decoration: underline; text-underline-offset: 0.18em; }
button.link:hover { color: var(--brass-bright); background: none; }

.flash { margin: 0.8rem 0; padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); background: var(--panel-2); }
/* the status colour as a faint tint (12 %) over the surface, and as the edge; the text stays in the text colour */
.flash.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--panel-2)); }
.flash.warning { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--panel-2)); }
.flash.error { border-left-color: var(--error); background: color-mix(in srgb, var(--error) 12%, var(--panel-2)); }

/* a failure that needs an explanation: one card - what happened, what was reported (set apart), the cause, and the way on that opens on request */
.failure { margin: 1rem 0; overflow: hidden; border: 1px solid var(--border); border-left: 4px solid var(--error); border-radius: var(--radius); background: color-mix(in srgb, var(--error) 8%, var(--panel-2)); }
.failure-head { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem 0.6rem; }
.failure-head .sym { flex: none; width: 1.6rem; height: 1.6rem; margin-top: 0.1rem; color: var(--error); }
.failure-head h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.failure-head p { margin: 0; }
.failure-reason { margin: 0.3rem 1rem 0; padding: 0.55rem 0.75rem; background: var(--recess); border: 1px solid var(--border); border-radius: var(--radius-small); }
.failure-label { display: block; margin-bottom: 0.2rem; color: var(--text-faint); font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.failure-reason code { padding: 0; background: none; border: 0; word-break: break-word; }
.failure-cause { margin: 0.7rem 1rem 0.8rem; font-weight: 500; }
.failure-help { border-top: 1px solid var(--border); background: var(--panel-2); }
.failure-help > summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; cursor: pointer; list-style: none; font-weight: 600; }
.failure-help > summary::-webkit-details-marker { display: none; }
.failure-help > summary::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--text-soft); border-bottom: 2px solid var(--text-soft); transform: rotate(-45deg); transition: transform 0.15s; }
.failure-help[open] > summary::before { transform: rotate(45deg); }
.failure-help ol { margin: 0; padding: 0 1rem 0.8rem 2.5rem; }
.failure-help li { margin: 0.45rem 0; }
.failure-help code { word-break: normal; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .failure-help > summary::before { transition: none; } }

.hint { color: var(--text-soft); font-size: 0.9rem; }
/* the figures of the dashboard: a strip of cells, label above and value below; the 1px gap shows the background as the lines between them */
.stats { display: flex; flex-wrap: wrap; gap: 1px; margin: 1.5rem 0 2rem; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); }
.stat { flex: 1 1 10rem; margin: 0; padding: 0.85rem 1.25rem; background: var(--panel); }
.stat dt { color: var(--text-faint); font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.stat dd { margin: 0.15rem 0 0; color: var(--text); font: 600 1.75rem/1.25 var(--sans); }
.stat.warning dd { color: var(--warning); }
.stat.problem dd { color: var(--error); }
code, pre { background: var(--recess); border: 1px solid var(--border); border-radius: 4px; font-family: var(--mono); font-size: 0.88em; }
code { padding: 0.05rem 0.3rem; word-break: break-all; }
pre { padding: 0.6rem 0.8rem; overflow-x: auto; }
pre code { padding: 0; background: none; border: 0; }

.scroll { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { color: var(--text-faint); font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

dialog { max-width: 30rem; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }

@media (max-width: 40rem) {
  /* a narrow screen keeps the menu as a rail of icons */
  :root { --side-width: 3.75rem; }
  html.js .side-toggle.js-only { display: none !important; }
  .side-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .side-head { flex-direction: column; }
  .side nav a, .side-link { justify-content: center; padding-left: 0; padding-right: 0; }
  .theme { flex-direction: column; }
  .bar { padding: 0.5rem 0.75rem; }
  main { padding: 0.75rem 1rem 2rem; }
}

/* forms and the profile pages */
textarea { font-family: var(--mono); font-size: 0.9rem; }
.field .hint { margin: 0.25rem 0 0; }
form.wide { max-width: 40rem; }
form.inline { display: inline; }
form.inline button { margin: 0; }
button.secondary, .button.secondary { color: var(--text); background: var(--panel-2); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { color: var(--text); background: var(--panel-2); border-color: var(--brass); }
button.danger, .button.danger { color: var(--on-danger); background: var(--danger-fill); border-color: var(--danger-fill); }
button.danger:hover, .button.danger:hover { color: var(--on-danger); background: var(--danger-fill); filter: brightness(1.1); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.box { margin: 1rem 0; padding: 0.6rem 1rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.checks { padding-left: 1.2rem; }
.checks li { margin: 0.2rem 0; }
.checks li.failure strong { color: var(--error); }
.checks li.warning strong { color: var(--warning); }
.checks li.ok strong { color: var(--ok); }
table.facts th { width: 11rem; }

/* backup runs */
progress { width: 100%; height: 1.25rem; accent-color: var(--brass-fill); }
ul.plain { margin: 0; padding-left: 1.1rem; }
.box h2 { margin-top: 0; }
.inline-check { display: inline-block; margin-left: 0.75rem; font-weight: 400; }
/* dashboard cards and the system page */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 2rem 0 0; }
.filter-label { margin-right: 0.25rem; color: var(--text-faint); font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.filter a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2rem; padding: 0.25rem 0.7rem; color: var(--text-soft); font: 500 0.75rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-small); }
.filter a:hover { color: var(--text); border-color: var(--brass); }
.filter a[aria-current="true"] { color: var(--on-brass); background: var(--brass-fill); border-color: var(--brass-edge); }
.filter .count { font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1.25rem; margin: 1.5rem 0 2.5rem; }
.card { padding: 0.8rem 1rem; background: var(--panel-2); border: 1px solid var(--border); border-left-width: 5px; border-radius: var(--radius); }
.card.ok { border-left-color: var(--ok); }
.card.warning { border-left-color: var(--warning); }
.card.problem { border-left-color: var(--error); }
/* the empty tile after the cards: a new profile; the whole surface is the link, the edge is grey because there is no status */
.card.new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 8rem; color: var(--text-soft); font: 600 0.78rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; border-left-color: var(--border-strong); }
.card.new .icon { width: 1.75rem; height: 1.75rem; }
.card.new:hover { color: var(--text); background: var(--panel); border-left-color: var(--brass); }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.card h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.card-title { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.card-title h2 { overflow-wrap: anywhere; }
/* a button that is only an icon: it has a tooltip and an accessible name, no label */
.icon-button { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; color: var(--text); border: 1px solid transparent; border-radius: var(--radius-small); }
.icon-button .icon { width: 1.5rem; height: 1.5rem; stroke-width: 1.75; }
.icon-button:hover { color: var(--brass); background: var(--panel); border-color: var(--border-strong); }
.card p { margin: 0.35rem 0; }
/* room: between the type and the facts, and between the facts and the buttons */
.card header + .hint { margin: 0.1rem 0 1rem; }
.card .actions { margin-top: 1.25rem; }
/* the sections of a page, one at a time: links with a line under them; the one that is shown has a brass line */
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.5rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.tabs a { margin-bottom: -1px; padding: 0.6rem 1.1rem; color: var(--text-soft); font: 500 0.78rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); border-bottom-color: var(--border-strong); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brass); }
/* the form of a profile: a card for each theme; the ones that are not needed at once are folded and say in their line what they are set to */
.form-section { margin: 0 0 1rem; padding: 0.25rem 1.25rem 0.5rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.form-section h2 { margin: 0.9rem 0 0.25rem; font-size: 1.05rem; }
.form-section h3 { margin: 1.25rem 0 0; font-size: 0.95rem; }
details.form-section { padding-top: 0; padding-bottom: 0; }
details.form-section > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding: 0.9rem 0; list-style: none; cursor: pointer; }
details.form-section > summary::-webkit-details-marker { display: none; }
details.form-section > summary::before { content: ""; flex: none; align-self: center; width: 0.5rem; height: 0.5rem; margin-right: 0.1rem; border-right: 2px solid var(--text-soft); border-bottom: 2px solid var(--text-soft); transform: rotate(-45deg); transition: transform 0.15s; }
details.form-section[open] > summary::before { transform: rotate(45deg); }
details.form-section > summary h2 { margin: 0; }
.summary-value { color: var(--text-soft); font-size: 0.9rem; }
.form-section-body { padding-bottom: 0.5rem; }
/* the buttons stay in view at the lower edge of the window while the form is long */
.form-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1.5rem -1rem 0; padding: 0.75rem 1rem; background: var(--panel); border-top: 1px solid var(--border-strong); }
.form-bar .inline-check { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { details.form-section > summary::before { transition: none; } }
/* the head of the page of a profile: type and state, the paths, what needs a look; a small action beside the title */
.page-title { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.profile-summary { margin: 0.5rem 0 1.5rem; }
.profile-summary .badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.profile-summary .facts { margin-top: 0; }
.profile-summary ul.warnings { margin-bottom: 0.25rem; }
.facts.roomy { margin-bottom: 1.5rem; }
.facts.roomy .fact { grid-template-columns: 9rem minmax(0, 1fr); }
.start-options { margin: 0 0 1rem; }
.start-options summary { cursor: pointer; }
/* the title of a page with its main action at the right */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.page-actions { margin: 1rem 0; }
/* the profiles: a card for each, one under the other; the facts in a grid, the paths over the whole width */
.profile-list { display: grid; gap: 1rem; margin: 1.5rem 0; }
.card.profile { border-left-color: var(--border-strong); }
.card.profile.problem { border-left-color: var(--error); }
.card.profile header { align-items: center; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.75rem 1.5rem; margin: 0.85rem 0 0.25rem; }
.fact { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: baseline; gap: 0.5rem; min-width: 0; margin: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact dt { color: var(--text-soft); font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.fact dd { min-width: 0; margin: 0; }
/* an option: the icon takes the place of the label, and the value stands next to it */
.fact.option { grid-template-columns: 1.35rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.fact.option dt { display: inline-flex; color: var(--text); }
.fact.option .icon { width: 1.35rem; height: 1.35rem; }
.fact code.path { white-space: normal; word-break: normal; overflow-wrap: break-word; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.badge {
  padding: 0.1rem 0.5rem;
  font: 600 0.68rem/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-soft);
  background: color-mix(in srgb, currentColor 12%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 4px;
}
.badge.ok { color: var(--ok); }
.badge.warning { color: var(--warning); }
.badge.problem { color: var(--error); }
ul.warnings { margin: 0.4rem 0; padding-left: 1.1rem; font-size: 0.92rem; }
ul.warnings li.problem strong { color: var(--error); }
ul.warnings li.warning strong { color: var(--warning); }
.result.ok { color: var(--ok); }
.result.bad { color: var(--error); font-weight: 700; }
.result.warn { color: var(--warning); }
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin: 0.6rem 0; }
/* keys and passphrases */
.print-only { display: none; }
pre.secret { white-space: pre-wrap; word-break: break-all; font-size: 0.95rem; user-select: all; }
details.passphrase { margin: 0.75rem 0; }
details.passphrase summary { cursor: pointer; }
.keypair { border-left: 5px solid var(--warning); }
@media print {
  .bar, .side, nav, form, .actions, .hint, .flash, h1 { display: none !important; }
  .app { display: block; }
  .print-only { display: block; }
  body, main, .box, pre, code { background: #fff !important; color: #000 !important; border: 0; }
  pre.secret { font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
