/* PaperFold prototype in the Signs system (root DESIGN.md, "Sign and Plate"): German road and site signage.
   Sign inks only, flat fields, drawn 2 px borders, every state written as a word. Barlow Condensed carries legends
   (signs, plates, tags, buttons, page titles); IBM Plex Sans carries everything that is read or typed; IBM Plex Mono
   is for identifiers. No shadows, no gradients, no tints. Inset box-shadows here are drawn rings and keylines. */

:root {
  /* sign inks: traffic blue RAL 5017, traffic yellow RAL 1023, traffic red RAL 3020, one green for a valid proof */
  --blue: #0E518D;
  --blue-deep: #0A3F6E;
  --yellow: #F2B705;
  --red: #C1121C;
  --green: #2E7D4F;
  --sign-white: #FFFFFF;
  --sign-black: #1E1E20;
  --post: #8A8E93;

  /* the scene: concrete ground, plates with drawn borders */
  --ground: #E4E5E1;
  --plate: #FBFBF8;
  --ink: #1E1E20;
  --ink-2: #45474A;
  --line: #1E1E20;
  --rule: #A9ABA6;
  --legend-red: #B0101A;
  --legend-green: #23663F;
  --focus: #0E518D;
  --scrim: color-mix(in srgb, #1E1E20 62%, transparent);

  /* a rendered document page stays paper-white in both themes */
  --page: #FFFFFF;
  --page-ink: #1E1E20;
  --page-muted: #45474A;
  --page-line: #A9ABA6;

  /* the camera view is night in both themes */
  --cam-bg: #15171A;
  --cam-surface: #23262A;
  --cam-ink: #EEEEE9;
  --cam-muted: #C2C4BF;
  --cam-line: #4A4E54;
  --cam-accent: #F2B705;
  --cam-paper: #FBFBF8;

  --legend: "Barlow Condensed", "Bahnschrift", "Arial Narrow", sans-serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --r-plate: 6px;
  --r-sign: 12px;
  --r-tag: 4px;

  --proto-h: 44px;
  --stick: var(--proto-h);
  --top-h: 64px;
  --rail-w: 96px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #15171A;
    --plate: #23262A;
    --ink: #EEEEE9;
    --ink-2: #C2C4BF;
    --line: #EEEEE9;
    --rule: #4A4E54;
    --legend-red: #FF6B6F;
    --legend-green: #6FCB93;
    --focus: #F2B705;
    --scrim: color-mix(in srgb, #15171A 78%, transparent);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #15171A;
  --plate: #23262A;
  --ink: #EEEEE9;
  --ink-2: #C2C4BF;
  --line: #EEEEE9;
  --rule: #4A4E54;
  --legend-red: #FF6B6F;
  --legend-green: #6FCB93;
  --focus: #F2B705;
  --scrim: color-mix(in srgb, #15171A 78%, transparent);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-2) var(--ground); scroll-padding-top: calc(var(--stick) + var(--top-h) + 16px); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.5 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--yellow); color: var(--sign-black); }
input, textarea, select { caret-color: var(--focus); }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { font-variant-numeric: tabular-nums; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); color: var(--ink); font: 500 0.8125rem/1.4 var(--mono); text-align: center; }
/* amounts and dates keep the surrounding face with tabular numerals; identifiers and hashes are set in the mono face */
.num { font-variant-numeric: tabular-nums; }
.id { font-family: var(--mono); font-size: 0.875em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; line-height: 1.5; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* the barrier hatch of a lapsed proof: red and white, as on a site barrier */
.hatch-bg { fill: var(--sign-white); }
.hatch-bar { fill: var(--red); }

/* scroll containers contain their visually hidden labels */
.table-wrap, .matrix-wrap, .pr-queue ol, .set-list, .cmd-results, .cmd-preview, .dlg-body, .drawer-body, .viewer, .cap-tray, .cap-body, .site-nav, .tl-strip, .gate-body { position: relative; }

/* pictograms: one stroke weight, drawn like sign symbols */
.g { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.g-16 { width: 16px; height: 16px; }
.g-40 { width: 40px; height: 40px; stroke-width: 1.5; }

/* the brand mark: a blue sign with a white keyline and a check */
.brand-mark { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: var(--r-plate); background: var(--blue); color: var(--sign-white); box-shadow: inset 0 0 0 3px var(--blue), inset 0 0 0 5px var(--sign-white); }
.brand-mark svg { width: 18px; height: 18px; }

.skip { position: fixed; z-index: 100; left: 12px; top: -80px; padding: 10px 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font: 700 1.1875rem/1.3 var(--legend); }
.skip:focus { top: 12px; }

/* running text keeps a readable measure wherever it sits */
.hint { max-width: 40em; color: var(--ink-2); font-size: 0.875rem; line-height: 1.45; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.q-title, .bu-part-type, .inst-title, .rc-slot, .tl-type, .mini-type, .fi-name, .po-label, .sh-slot-name, .reg-tab-label, .an-type, .drawer-head .doc-title, .pr-facts .doc-title, .cmd-opt-label, .task-text strong, .kv dt, .kv dd, .sugg-val, .fact-val, .pl-holder-name, .tm-mail, .po-fname, .flag-what, .share-label { hyphens: auto; overflow-wrap: anywhere; }
.kv dt, .tm-mail { overflow-wrap: break-word; }

/* ---------- prototype bar (not product UI) ---------- */
.proto { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 16px; height: var(--proto-h); padding: 0 16px; background: var(--ink); color: var(--plate); font-size: 0.875rem; }
.proto-name { flex: none; font: 700 1.0625rem/1 var(--legend); white-space: nowrap; }
.proto-field { display: flex; flex: 0 1 auto; align-items: center; gap: 8px; min-width: 0; }
.proto-select { height: 32px; min-width: 120px; max-width: 240px; padding: 0 8px; border: 2px solid var(--plate); border-radius: var(--r-plate); background: var(--ink); color: var(--plate); }
.proto-select:disabled { border-style: dotted; }
.proto-select option, .proto-select optgroup { padding: 8px 10px; background: var(--plate); color: var(--ink); }
.proto-btn { flex: none; height: 32px; padding: 0 12px; border: 2px solid var(--plate); border-radius: var(--r-plate); background: transparent; color: var(--plate); }
.proto-btn[aria-pressed="true"] { background: var(--plate); color: var(--ink); }
.proto-note { min-width: 0; margin-left: auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.proto :focus-visible { outline-color: var(--plate); outline-offset: 2px; }

/* ---------- app shell ---------- */
.rail { position: fixed; z-index: 45; left: 0; top: var(--proto-h); bottom: 0; width: var(--rail-w); display: flex; flex-direction: column; padding: 12px 8px; background: var(--plate); border-right: 2px solid var(--line); overflow-y: auto; }
.rail-mark { display: flex; justify-content: center; padding: 2px 0 14px; text-decoration: none; }
.rail-list { display: flex; flex: 1; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rail-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 7px; border-radius: var(--r-plate); color: var(--ink); font-size: 0.8125rem; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none; hyphens: manual; }
.rail-item .g { width: 34px; height: 34px; padding: 5px; border: 2px solid transparent; border-radius: var(--r-plate); }
.rail-item:hover { background: var(--ground); }
/* the current item: a blue marker and a bold label */
.rail-item[aria-current="page"] { font-weight: 700; }
.rail-item[aria-current="page"] .g { border-color: var(--line); background: var(--blue); color: var(--sign-white); }
.rail-item.is-off { color: var(--ink-2); }
.rail-count { position: absolute; top: 0; left: calc(50% + 10px); min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--plate); border-radius: var(--r-tag); background: var(--ink); color: var(--plate); font: 700 0.875rem/16px var(--legend); }
.rail-cap { margin: 6px 0; }
.rail-capture .g, .rail-capture[aria-current="page"] .g { width: 44px; height: 44px; padding: 9px; border-color: var(--line); background: var(--blue); color: var(--sign-white); }
.rail-capture:hover .g { background: var(--blue-deep); }
.rail-end { margin-top: auto; }
.rail-mob { display: none; }
body[data-ws="bau"] .rail-count { display: none; }
/* each workspace has its own route: the holder keeps packets current, the general contractor clears the chain */
body[data-ws="gs"] .rail-bau, body[data-ws="bau"] .rail-gs { display: none; }

.top { position: sticky; top: var(--stick); z-index: 40; display: flex; align-items: center; gap: 16px; height: var(--top-h); margin-left: var(--rail-w); padding: 0 24px; background: var(--plate); border-bottom: 2px solid var(--line); }
.ws { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -8px; padding: 0 8px; border: 0; border-radius: var(--r-plate); background: none; font-size: 1rem; font-weight: 600; anchor-name: --ws; }
.ws:hover { background: var(--ground); }
.cmd-trigger { display: flex; align-items: center; gap: 10px; width: min(420px, 40vw); height: 44px; padding: 0 8px 0 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink-2); text-align: left; }
.cmd-trigger:hover { background: var(--ground); color: var(--ink); }
.cmd-trigger-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; white-space: nowrap; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.875rem; font-weight: 500; anchor-name: --assist; }
.pill:hover { background: var(--ground); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-plate); background: none; color: var(--ink); }
.icon-btn:hover { background: var(--ground); }
.bell { anchor-name: --bell; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--r-tag); background: var(--ink); color: var(--plate); font: 700 0.8125rem/18px var(--legend); }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font-size: 0.875rem; font-weight: 600; anchor-name: --user; }
.avatar:hover { background: var(--ink); color: var(--plate); }

/* menus are plates with a drawn border */
.pop { position: fixed; inset: auto; margin: 0; width: 320px; max-width: calc(100vw - 24px); padding: 8px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); }
#pop-ws { position-anchor: --ws; top: anchor(bottom); left: anchor(left); margin-top: 6px; }
#pop-assist { position-anchor: --assist; top: anchor(bottom); right: anchor(right); margin-top: 6px; }
#pop-bell { position-anchor: --bell; top: anchor(bottom); right: anchor(right); margin-top: 6px; }
#pop-user { position-anchor: --user; top: anchor(bottom); right: anchor(right); margin-top: 6px; }
#pop-export { position-anchor: --export; top: anchor(bottom); right: anchor(right); margin-top: 6px; }
[popovertarget="pop-export"] { anchor-name: --export; }
@supports not (anchor-name: --a) {
  #pop-ws { top: calc(var(--proto-h) + var(--top-h) + 4px); left: calc(var(--rail-w) + 16px); }
  #pop-assist, #pop-bell, #pop-user { top: calc(var(--proto-h) + var(--top-h) + 4px); right: 16px; }
  #pop-export { top: calc(var(--proto-h) + var(--top-h) + 96px); right: 24px; }
}
.pop-title { padding: 6px 8px 4px; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.pop-text { padding: 4px 8px 8px; font-size: 0.9375rem; }
.pop-list { margin: 0; padding: 0; list-style: none; }
.pop-item { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 44px; justify-content: center; padding: 8px; border: 0; border-radius: var(--r-tag); background: none; color: var(--ink); font-size: 0.9375rem; text-align: left; text-decoration: none; }
.pop-item strong { font-weight: 600; }
.pop-item span { color: var(--ink-2); font-size: 0.875rem; }
.pop-item:hover { background: var(--ground); }

.main { min-height: calc(100vh - var(--proto-h) - var(--top-h)); margin-left: var(--rail-w); padding: 24px 24px 72px; outline: none; }
body[data-surface="app"] .main > .screen { max-width: 1200px; margin-inline: auto; }
/* the matrix of all companies and the payment run are the two wide tables */
body[data-surface="app"] .main > .scr-firmen, body[data-surface="app"] .main > .scr-zahlung { max-width: 1320px; }
body[data-surface="public"] .rail, body[data-surface="public"] .top,
body[data-surface="device"] .rail, body[data-surface="device"] .top { display: none; }
body[data-surface="public"] .main, body[data-surface="device"] .main { margin-left: 0; padding: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.page-title { min-width: 0; }
.page-title h1 { font: 600 1.75rem/1.1 var(--legend); }
.page-sub { max-width: 40em; margin-top: 6px; color: var(--ink-2); font-size: 0.9375rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.crumbs { margin-bottom: 6px; font-size: 0.9375rem; }
/* a document or packet name is read, so it is set in the reading face; as a page title it is a legend like any other */
.doc-title { font-weight: 600; }
.bottom-bar { display: none; }

/* ---------- controls ---------- */
/* buttons are plates: 2 px border, legend type, 48 px high */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 18px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font: 700 1.1875rem/1.3 var(--legend); text-decoration: none; white-space: nowrap; transition: background-color 160ms cubic-bezier(0.2, 0.7, 0.2, 1), color 160ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.btn .g { width: 18px; height: 18px; }
.btn-primary { background: var(--blue); color: var(--sign-white); }
.btn-primary:hover { background: var(--blue-deep); }
.btn-secondary:hover { background: var(--ink); color: var(--plate); }
.btn-quiet { padding: 6px; border-width: 0; background: transparent; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.btn-quiet:hover { text-decoration-thickness: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { border-color: var(--rule); background: var(--plate); color: var(--ink-2); cursor: not-allowed; }
.btn-quiet:disabled { background: transparent; text-decoration: none; }
.btn-sm { min-height: 44px; padding: 6px 12px; font-size: 1.0625rem; }
.btn-quiet.btn-sm { padding: 6px; }
.btn-block { width: 100%; }
.sr:focus-visible + .btn { outline: 3px solid var(--focus); outline-offset: 3px; }

.input, .select { min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); }
.select { padding-right: 8px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-offset: 1px; }
.input[aria-invalid="true"] { border-width: 3px; border-color: var(--red); }
.textarea { width: 100%; min-height: 180px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 0.9375rem; font-weight: 500; }
.field .input { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 500; }
.field-error { color: var(--legend-red); font-size: 0.875rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; font-size: 0.9375rem; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--blue); }
.radio-row { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 0.9375rem; cursor: pointer; }
.radio-row small { display: block; color: var(--ink-2); font-size: 0.875rem; }
.radio-inline { display: inline-flex; margin-right: 16px; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit input { width: 104px; min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-variant-numeric: tabular-nums; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* a toggle is a plate; the chosen one takes the blue of the current selection */
.chip-btn { min-height: 44px; padding: 6px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.9375rem; font-weight: 500; }
.chip-btn:hover { background: var(--ground); }
.chip-btn[aria-pressed="true"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }

/* ---------- surfaces ---------- */
/* a plate container holds a tool, a form or a table */
.panel { padding: 20px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.panel-title { font-size: 1.0625rem; font-weight: 600; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.panel-head a { font-size: 0.9375rem; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font-size: 0.9375rem; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 16px; padding: 12px 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.banner p { flex: 1 1 220px; max-width: 40em; }
.banner .btn { margin-left: auto; }
.banner-stop { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.banner-stop > .g { color: var(--legend-red); }
.empty { max-width: 640px; margin: 40px 0; }
.empty h2 { margin: 12px 0 8px; font: 600 1.5rem/1.1 var(--legend); }
.empty p { margin-bottom: 20px; color: var(--ink-2); }

/* ---------- states: a word first, an ink second, a pictogram third ---------- */
.tone-ok { --st: var(--green); --st-text: var(--legend-green); }
.tone-stop { --st: var(--red); --st-text: var(--legend-red); }
.tone-caution { --st: var(--yellow); --st-text: var(--ink); }
.tone-unknown { --st: var(--ink); --st-text: var(--ink-2); }
.tone-none { --st: var(--rule); --st-text: var(--ink-2); }

/* tag: the small form of a plate for tables and lists */
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 8px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); color: var(--ink); font: 700 1rem/1.15 var(--legend); white-space: nowrap; }
.tag .g { width: 16px; height: 16px; }
.tag.tone-ok { border-color: var(--legend-green); color: var(--legend-green); }
.tag.tone-caution { border-color: var(--sign-black); background: var(--yellow); color: var(--sign-black); }
.tag.tone-stop { border-color: var(--legend-red); color: var(--legend-red); }
.tag.tone-unknown { border-style: dashed; color: var(--ink-2); }
.tag.tone-none { border-color: var(--rule); color: var(--ink-2); }
.tag-sm { gap: 5px; font-size: 0.9375rem; }
.tag-black { border-color: var(--ink); background: var(--ink); color: var(--plate); }
.st-t-valid { color: var(--legend-green); font-weight: 600; }
/* how sure a suggestion is: said in words; only "unclear" is drawn as open */
.band-tag { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 8px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); color: var(--ink); font: 700 0.9375rem/1.15 var(--legend); }
.band-tag.band-unclear { border-style: dashed; }
.band-tag.band-done { border-color: var(--legend-green); color: var(--legend-green); }
.rule-badge { display: inline-block; margin: 0 6px 4px 0; padding: 5px 8px; border: 2px solid var(--rule); border-radius: var(--r-tag); font-size: 0.875rem; }

/* signs: one sign per decision. Work is a rectangle, payment is a disc, dashed is open */
.sign { position: relative; display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 152px; padding: 16px 14px; border-radius: var(--r-sign); font-family: var(--legend); text-align: center; }
.sign-kind { font-size: 1.0625rem; font-weight: 600; line-height: 1.15; }
.sign-legend { max-width: 100%; font-size: 1.75rem; font-weight: 700; line-height: 1; overflow-wrap: anywhere; hyphens: auto; }
.sign-picto { width: 40px; height: 40px; margin-bottom: 4px; }
.sign-work.is-ok { background: var(--blue); color: var(--sign-white); box-shadow: inset 0 0 0 6px var(--blue), inset 0 0 0 9px var(--sign-white); }
.sign-work.is-warn { background: var(--yellow); color: var(--sign-black); box-shadow: inset 0 0 0 6px var(--yellow), inset 0 0 0 9px var(--sign-black); }
.sign-work.is-stop { background: var(--sign-white); color: var(--sign-black); box-shadow: inset 0 0 0 8px var(--red); }
.sign-work.is-stop .sign-picto { color: var(--red); }
.sign-work.is-open { border: 3px dashed var(--sign-black); background: var(--sign-white); color: var(--sign-black); }
/* the payment sign: a blue disc for "in full", a white disc with a red ring for "at most 85 %" */
.sign-pay { padding: 0; gap: 0; }
.sign-ring { display: grid; grid-auto-flow: column; align-items: baseline; align-content: center; justify-content: center; width: 128px; height: 128px; border-radius: 50%; font: 700 3rem/1 var(--legend); }
.sign-ring small { margin-left: 2px; font-size: 1.5rem; }
/* the kind and the legend of a payment sign sit on one small plate */
.sign-cap { margin-top: 10px; padding: 5px 10px 6px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); text-align: center; }
.sign-pay .sign-legend { font-size: 1.375rem; }
.sign-pay.is-ok .sign-ring { background: var(--blue); color: var(--sign-white); box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 7px var(--sign-white); }
.sign-pay.is-cut .sign-ring { background: var(--sign-white); color: var(--sign-black); box-shadow: inset 0 0 0 14px var(--red); }
.sign-pay.is-open .sign-ring { border: 3px dashed var(--sign-black); background: var(--sign-white); color: var(--sign-black); }

/* the small sign for rows, tables and the chain */
.sgn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px 6px 10px; border-radius: var(--r-plate); font: 700 1.0625rem/1.05 var(--legend); text-align: left; }
.sgn .g { width: 18px; height: 18px; }
.sgn.is-ok { background: var(--blue); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 4px var(--sign-white); }
.sgn.is-warn { background: var(--yellow); color: var(--sign-black); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 4px var(--sign-black); }
.sgn.is-stop { background: var(--sign-white); color: var(--sign-black); box-shadow: inset 0 0 0 4px var(--red); }
.sgn.is-stop .g { color: var(--red); }
.sgn.is-open { border: 2px dashed var(--sign-black); background: var(--sign-white); color: var(--sign-black); }
.disc { display: inline-grid; flex: none; grid-auto-flow: column; align-items: baseline; align-content: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; font: 700 1.375rem/1 var(--legend); }
.disc small { margin-left: 1px; font-size: 0.8125rem; }
.disc.is-ok { background: var(--blue); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 4px var(--sign-white); }
.disc.is-cut { background: var(--sign-white); color: var(--sign-black); box-shadow: inset 0 0 0 7px var(--red); }
.disc.is-open { border: 2px dashed var(--sign-black); background: var(--sign-white); color: var(--sign-black); }
.disc-sm { width: 40px; height: 40px; font-size: 1rem; }
.disc-sm small { font-size: 0.625rem; }
.disc-sm.is-cut { box-shadow: inset 0 0 0 5px var(--red); }

/* Zusatzzeichen: one plate per proof, a sentence, never decoration */
.plates { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.plate { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; width: 100%; min-height: 48px; padding: 6px 10px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font: 600 1.0625rem/1.3 var(--legend); text-align: left; overflow-wrap: break-word; }
.plate-for { flex: none; padding: 4px 6px; border-radius: 3px; background: var(--ink); color: var(--plate); font-size: 0.875rem; font-weight: 600; line-height: 1; }
.plate-name { flex: 1 1 auto; }
.plate-state { flex: 0 1 auto; margin-left: auto; font-weight: 700; text-align: right; white-space: nowrap; }
.plate.is-ok .plate-state { color: var(--legend-green); }
.plate.is-warn { border-color: var(--sign-black); background: var(--yellow); color: var(--sign-black); }
.plate.is-warn .plate-for { background: var(--sign-black); color: var(--yellow); }
.plate.is-lapsed { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.plate.is-lapsed .plate-state { color: var(--legend-red); }
.plate.is-lapsed .plate-state::after { content: ""; display: inline-block; width: 28px; height: 14px; margin-left: 8px; border: 1px solid var(--red); background: var(--sign-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14'%3E%3Cpath d='M-4 14L10 0h6L2 14zM10 14L24 0h6L16 14zM24 14L38 0h6L30 14z' fill='%23C1121C'/%3E%3C/svg%3E"); vertical-align: -2px; }
.plate.is-open { border-style: dashed; }
.plate.is-open .plate-state { color: var(--ink-2); }
button.plate { cursor: pointer; }
button.plate:hover .plate-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }

/* a sign or plate that changes flips once on its horizontal axis */
@media (prefers-reduced-motion: no-preference) {
  .is-flip { animation: sign-flip 380ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .plate.is-flip, .tag.is-flip { animation-duration: 320ms; }
}
@keyframes sign-flip { 0% { transform: perspective(600px) rotateX(0); } 45% { transform: perspective(600px) rotateX(88deg); } 100% { transform: perspective(600px) rotateX(0); } }

/* the reference day: one control on every screen that answers "on which day?" */
.refday { display: grid; grid-template-columns: auto auto minmax(120px, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.refday > label { font: 700 1.125rem/1.15 var(--legend); }
.refday .input { width: 11.5rem; }
.refday output { min-width: 13.5rem; font: 700 1.125rem/1.15 var(--legend); font-variant-numeric: tabular-nums; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--ink); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 32px; margin-top: -13px; border: 2px solid var(--sign-black); border-radius: var(--r-tag); background: var(--yellow); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 28px; border: 2px solid var(--sign-black); border-radius: var(--r-tag); background: var(--yellow); }
input[type="range"]:focus-visible { outline-offset: 0; }

/* which release a planned screen belongs to */
.rel-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.875rem; color: var(--ink-2); }

/* Frist bar: time left, drawn as a gauge */
.fbar { display: block; width: 100%; height: 10px; border: 2px solid var(--line); border-radius: 2px; background: var(--plate); }
.fbar-track { fill: none; }
.fbar-fill { fill: var(--st); }
/* red is never a fill: a full or lapsed gauge is drawn in ink inside a red border */
.fbar.tone-stop { border-color: var(--red); }
.fbar.tone-stop .fbar-fill { fill: var(--ink); }
.fbar-hatch { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.fbar.tone-unknown { border-style: dashed; }
.fbar-today { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }

.rn-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.rn-check { align-items: flex-start; }
.rn-check strong { display: block; font-size: 1rem; font-weight: 600; }
.rn-check small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.875rem; }
.rn-item .slip { margin: 8px 0 0 32px; }

/* the confirmation plate and the routing slip */
.stamp { display: inline-flex; flex-direction: column; gap: 1px; padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font: 600 1.0625rem/1.3 var(--legend); }
.stamp-top { font-weight: 700; }
.stamp-by { color: var(--ink-2); font: 400 0.8125rem/1.4 var(--text); }
.stamp-sm { padding: 4px 10px; font-size: 1rem; }
.rstamp { display: inline-block; padding: 5px 8px; border: 2px solid var(--line); border-radius: var(--r-tag); color: var(--ink); font: 600 0.9375rem/1.3 var(--legend); white-space: nowrap; }
.slip { margin-top: 16px; padding: 12px 14px; border: 2px solid var(--rule); border-radius: var(--r-plate); background: var(--ground); }
.slip-title { margin-bottom: 6px; font-size: 0.875rem; font-weight: 600; }
.slip-list { margin: 0; padding: 0; list-style: none; counter-reset: slip; }
.slip-step { position: relative; display: grid; grid-template-columns: 24px 92px 1fr; gap: 8px; padding: 5px 0; font-size: 0.875rem; counter-increment: slip; }
.slip-step::before { content: counter(slip); display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); font: 700 0.875rem/1 var(--legend); }
.slip-step.is-done::before { background: var(--ink); color: var(--plate); }
.slip-date { color: var(--ink-2); }

/* key-value lists and tables */
/* one grid for the whole list, so every label column takes the width of its longest label */
.kv { display: grid; grid-template-columns: fit-content(46%) minmax(0, 1fr); }
.kv > div { display: contents; }
.kv dt, .kv dd { padding: 8px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.kv dt { padding-right: 16px; color: var(--ink-2); }
.kv dd { max-width: 40em; }
.kv > div:first-child > dt, .kv > div:first-child > dd { border-top: 0; }
.kv-tight dt, .kv-tight dd { padding-block: 6px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 10px 12px 10px 0; border-bottom: 2px solid var(--rule); text-align: left; vertical-align: top; }
.table thead th { border-bottom-color: var(--line); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.table tbody th { font-weight: 400; }
.table tbody tr:last-child > * { border-bottom: 0; }
.sum-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 0.9375rem; }
.sum-table th { padding: 6px 12px 6px 0; font-weight: 400; text-align: left; }
.sum-table td { padding: 6px 0; text-align: right; white-space: nowrap; }
.sum-total th, .sum-total td { padding-top: 10px; border-top: 2px solid var(--line); font-weight: 600; }

/* ---------- rendered document pages (always paper) ---------- */
.page { position: relative; display: flex; flex-direction: column; gap: 3px; max-width: 620px; margin: 0 auto; padding: 44px 48px 56px 64px; overflow: hidden; border: 2px solid var(--sign-black); background: var(--page); color: var(--page-ink); font: 400 0.8125rem/1.65 var(--text); }
/* sample documents carry a MUSTER tag, upright, in the corner */
.page::after { content: "MUSTER"; position: absolute; top: 0; right: 0; padding: 5px 10px 4px; border-radius: 0 0 0 var(--r-tag); background: var(--sign-black); color: var(--sign-white); font: 700 1rem/1 var(--legend); pointer-events: none; }
.page .ln { position: relative; display: block; margin: 0 -6px; padding: 1px 6px; border-radius: 3px; }
.page .ln::before { content: attr(data-no); position: absolute; left: -40px; width: 28px; color: var(--page-muted); font: 400 0.75rem/1.8 var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.page .ln-head { font-size: 0.9375rem; font-weight: 600; }
.page .ln-sub { margin-bottom: 14px; color: var(--page-muted); font-size: 0.75rem; }
.page .ln-title { margin: 12px -6px 6px; font-size: 1.0625rem; font-weight: 600; }
.page .ln-inject { color: var(--page-muted); text-decoration: line-through 2px var(--red); }
/* the line a statement rests on */
.page .ln.is-ev { box-shadow: inset 0 0 0 2px var(--blue); font-weight: 600; }
.crop { max-width: none; padding: 20px 18px 24px 46px; font-size: 0.75rem; }
.crop::after { padding: 4px 8px 3px; font-size: 0.875rem; }
.crop .ln::before { left: -34px; width: 24px; }
.crop-fig figcaption { margin-top: 8px; color: var(--ink-2); font-size: 0.8125rem; }
.page-inline { max-width: none; margin: 0 0 16px; padding: 24px 20px 28px 52px; }

/* ---------- toasts, dialogs, drawer ---------- */
.toasts { position: fixed; z-index: 70; left: 50%; bottom: 24px; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border: 2px solid var(--plate); border-radius: var(--r-plate); background: var(--ink); color: var(--plate); font-size: 0.9375rem; pointer-events: auto; }
.toast p { flex: 1; }
.toast-act { color: var(--plate); font-weight: 600; white-space: nowrap; }
.toast-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-tag); background: none; color: var(--plate); }
.toast :focus-visible { outline-color: var(--plate); outline-offset: 1px; }

/* overlays are plates with a drawn border over a dimmed ground */
.dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); }
.dialog::backdrop { background: var(--scrim); }
.dlg-small { width: min(560px, calc(100vw - 32px)); }
.dlg-inner { display: flex; flex-direction: column; max-height: calc(100vh - 52px); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 12px; }
.dlg-head h2 { font: 600 1.5rem/1.1 var(--legend); }
.dlg-sub { margin-top: 6px; color: var(--ink-2); font-size: 0.9375rem; }
.dlg-body { flex: 1; overflow: auto; padding: 8px 20px 20px; }
.dlg-body h3 { margin-bottom: 12px; font-size: 1.0625rem; font-weight: 600; }
.dlg-lead { margin-bottom: 12px; }
.dlg-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 2px solid var(--line); }
.dlg-status { flex: 1; color: var(--ink-2); font-size: 0.9375rem; text-align: right; }

/* steps are numbered because the order is the content */
.stepper { display: flex; margin: 0 20px 8px; padding: 0; border-bottom: 2px solid var(--rule); list-style: none; }
.stepper li { display: flex; flex: 1; align-items: center; gap: 8px; padding: 10px 0; color: var(--ink-2); font-size: 0.9375rem; }
.step-no { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); color: var(--ink); font: 700 1rem/1 var(--legend); }
.stepper li.is-current { color: var(--ink); font-weight: 600; }
.stepper li.is-current .step-no { background: var(--blue); color: var(--sign-white); }
.stepper li.is-done .step-no { background: var(--ink); color: var(--plate); }

.drawer { position: fixed; z-index: 50; top: calc(var(--stick) + var(--top-h)); right: 0; bottom: 0; display: flex; flex-direction: column; width: 420px; max-width: 100vw; border-left: 2px solid var(--line); background: var(--plate); outline: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 12px 12px 20px; border-bottom: 2px solid var(--line); }
.drawer-head .doc-title { font: 600 1.5rem/1.1 var(--legend); }
.drawer-holder { margin-bottom: 4px; color: var(--ink-2); font-size: 0.875rem; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px 24px; }
.drawer-body > * + * { margin-top: 14px; }
.ev-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-prof { color: var(--ink-2); font-size: 0.875rem; }
.ev-sentence { font-size: 1rem; }
body[data-surface="public"] .drawer, body[data-surface="device"] .drawer { top: 0; }

/* ---------- Übersicht ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 680px) minmax(0, 480px); gap: 24px; align-items: start; }
.home-side { display: grid; gap: 24px; }
.home-tasks .panel-title { margin-bottom: 4px; }
.task-list { margin: 8px -8px 0; padding: 0; list-style: none; }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; align-items: center; gap: 14px; padding: 14px 8px; border-top: 2px solid var(--rule); color: var(--ink); text-decoration: none; }
.task-list li:first-child .task { border-top: 0; }
.task:hover { background: var(--ground); }
.task-g { width: 24px; height: 24px; }
.task-text strong { display: block; font-size: 1.0625rem; font-weight: 600; }
.task-text span { display: block; color: var(--ink-2); font-size: 0.9375rem; }
.task-chev { color: var(--ink-2); }
.mini-wall { margin: 0; padding: 0; list-style: none; }
.mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "type date" "chip left" "bar bar"; gap: 4px 12px; padding: 10px 0; border-top: 2px solid var(--rule); }
.mini-row:first-child { border-top: 0; }
.mini-type { grid-area: type; font-size: 0.9375rem; font-weight: 600; }
.mini-row .tag { grid-area: chip; justify-self: start; }
.mini-date { grid-area: date; text-align: right; }
.mini-left { grid-area: left; color: var(--ink-2); text-align: right; }
.mini-row .fbar { grid-area: bar; margin-top: 2px; }
.events { margin: 0; padding: 0; list-style: none; }
.events li { display: grid; grid-template-columns: 136px 1fr; gap: 12px; padding: 8px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.events li:first-child { border-top: 0; }
.ev-time { color: var(--ink-2); }
.sample .muster-tag { display: inline-block; margin-bottom: 8px; padding: 4px 8px; border-radius: var(--r-tag); background: var(--ink); color: var(--plate); font: 700 1rem/1 var(--legend); }
.sample-sub { margin: 4px 0 12px; color: var(--ink-2); font-size: 0.9375rem; }
.sample .doc-title { font-size: 1.25rem; }
.sample-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; margin: 16px 0 0; padding-left: 44px; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -3px; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--line); border-radius: var(--r-tag); font: 700 1.125rem/1 var(--legend); }

/* ---------- Gültigkeitswand: every proof as a tag on one time axis ---------- */
.wand-head { align-items: center; }
.wand-actions { justify-content: flex-end; }
.seg { display: inline-flex; gap: 4px; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span { display: block; min-height: 48px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.9375rem; font-weight: 500; line-height: 20px; }
.seg-opt input:hover + span { background: var(--ground); }
.seg-opt input:checked + span { background: var(--blue); color: var(--sign-white); font-weight: 600; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink-2); }
.search:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.search input { width: 160px; border: 0; background: none; color: var(--ink); outline: none; }

.planner { border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.pl-head { position: sticky; top: calc(var(--stick) + var(--top-h)); z-index: 6; display: grid; grid-template-columns: 216px minmax(0, 1fr); border-bottom: 2px solid var(--line); border-radius: 4px 4px 0 0; background: var(--plate); }
.pl-head-holder { display: flex; align-items: flex-end; padding: 10px 16px; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.pl-head-axis { display: grid; grid-template-columns: 112px 112px minmax(0, 1fr) 112px; min-width: 0; }
.pl-col { display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-height: 58px; padding: 8px 10px 6px; border: 0; border-left: 2px solid var(--rule); background: none; color: var(--ink); font-size: 0.875rem; text-align: left; }
.pl-col:hover { background: var(--ground); }
.pl-col[aria-pressed="true"] { background: var(--blue); color: var(--sign-white); }
.pl-col:focus-visible { outline-offset: -3px; }
.pl-col-label { font-weight: 600; }
.pl-col-count { font: 700 1.25rem/1.1 var(--legend); }
.pl-col-over:not([aria-pressed="true"]) .pl-col-count { color: var(--legend-red); }
.pl-time { min-width: 0; overflow: hidden; border-left: 2px solid var(--rule); }
.pl-time-svg { display: block; margin-top: 8px; }
.pl-month { fill: var(--ink); font: 600 13px var(--text); }
.pl-month-sm { fill: var(--ink-2); font: 500 12px var(--text); }
.pl-year { fill: var(--ink-2); font: 500 12px var(--text); }
.pl-today-label { fill: var(--ink); font: 700 15px var(--legend); }
.pl-scale { fill: var(--ink-2); font: 400 12px var(--text); }
.pl-break { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.pl-lane { display: grid; grid-template-columns: 216px minmax(0, 1fr); border-top: 2px solid var(--rule); }
.pl-lane:first-of-type { border-top: 0; }
.pl-holder { padding: 10px 12px 10px 16px; }
.pl-holder-name { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.pl-holder-rel { color: var(--ink-2); font-size: 0.875rem; }
.pl-holder-sum { margin-top: 6px; color: var(--ink); font-size: 0.8125rem; line-height: 1.4; }
.pl-axis { min-width: 0; overflow: hidden; }
.pl-svg { display: block; }
/* unknown and overdue have their own columns; the cards in them say why */
.pl-open-bg, .pl-over-bg { fill: none; }
.pl-band, .pl-later-bg { fill: var(--ground); }
.pl-rule { stroke: var(--rule); stroke-width: 1; }
.pl-rule-year { stroke: var(--ink-2); stroke-dasharray: 2 3; }
.pl-col-rule { stroke: var(--rule); stroke-width: 2; }
.pl-zone { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 1 4; }
.pl-today { stroke: var(--ink); stroke-width: 2; }
.pl-strip { fill: var(--st); }
.tone-caution .pl-strip { stroke: var(--sign-black); stroke-width: 1; }
.pl-dots { stroke: var(--st); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0.01 5.5; }
.tone-caution .pl-dots { stroke: var(--ink); }
.pl-notch { fill: var(--plate); }
.pl-tick { fill: var(--ink); }
.pl-card { cursor: pointer; }
/* each card is a tag: green border for valid, yellow plate for "ends soon", red border for lapsed, dashed for open */
.pl-box { fill: var(--plate); stroke: var(--st-text); stroke-width: 2; }
.pl-card.tone-caution .pl-box { fill: var(--yellow); stroke: var(--sign-black); }
.pl-card.tone-unknown .pl-box { stroke: var(--ink); stroke-dasharray: 4 3; }
.pl-glyph, .pl-mark { color: var(--st-text); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pl-mark { color: var(--ink-2); }
/* text inside the drawing is sized in px like its geometry */
.pl-label, .pl-date { fill: var(--ink); font: 600 15px var(--legend); }
.pl-date { font-weight: 700; }
.pl-card.tone-ok .pl-date { fill: var(--legend-green); }
.pl-card.tone-stop .pl-date { fill: var(--legend-red); }
.pl-card.tone-caution .pl-label, .pl-card.tone-caution .pl-date { fill: var(--sign-black); }
.pl-card.tone-caution .pl-glyph, .pl-card.tone-caution .pl-mark { color: var(--sign-black); }
.pl-card:hover .pl-box { stroke-width: 3; }
.pl-card:focus { outline: none; }
.pl-card:focus-visible .pl-box { stroke: var(--focus); stroke-width: 4; stroke-dasharray: none; }
.pl-skel { fill: var(--ground); stroke: var(--rule); stroke-width: 2; }
.pl-none { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 24px 16px; color: var(--ink-2); }
.wand-keys { margin-top: 10px; }
.wand-foot { max-width: 40em; margin-top: 6px; color: var(--ink-2); font-size: 0.875rem; }
/* the strips are drawn from today outwards once; nothing fades in */
@media (prefers-reduced-motion: no-preference) {
  .pl-anim .pl-strip { transform-box: fill-box; transform-origin: 0 50%; animation: pf-grow 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@keyframes pf-grow { from { transform: scaleX(0.4); } to { transform: scaleX(1); } }

/* the vertical time list (below 1024 px) */
.tlist { display: none; }
.tl-bucket { margin-bottom: 16px; }
.tl-head { position: sticky; top: calc(var(--stick) + var(--top-h)); z-index: 3; display: flex; justify-content: space-between; padding: 8px 2px; background: var(--ground); font: 700 1.125rem/1.2 var(--legend); }
.tl-items { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "type type" "holder holder" "chip date"; align-items: center; gap: 4px 12px; width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); text-align: left; }
.tl-item:hover { background: var(--ground); }
.tl-type { grid-area: type; font-size: 1rem; font-weight: 600; }
.tl-item .tag { grid-area: chip; justify-self: start; }
.tl-holder { grid-area: holder; color: var(--ink-2); font-size: 0.875rem; }
.tl-date { grid-area: date; color: var(--ink); font-size: 0.875rem; font-variant-numeric: tabular-nums; text-align: right; }
.tl-skel { height: 64px; margin-bottom: 8px; border: 2px solid var(--rule); border-radius: var(--r-plate); background: var(--ground); }

/* ---------- Prüfen ---------- */
.pr-grid { display: grid; grid-template-columns: 264px minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pr-queue ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.q-item { display: grid; gap: 2px; width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); text-align: left; }
.q-item:hover { background: var(--ground); }
/* the document in work takes the blue of the current selection */
.q-item[aria-current="true"] { background: var(--blue); color: var(--sign-white); }
.q-item[aria-current="true"] .q-holder, .q-item[aria-current="true"] .q-time { color: var(--sign-white); }
.q-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.q-holder { color: var(--ink-2); font-size: 0.875rem; }
.q-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.q-time { color: var(--ink-2); font-size: 0.875rem; }
.pr-tabs { display: none; }
.pr-doc { min-width: 0; }
.viewer { max-height: calc(100vh - 250px); overflow: auto; padding: 24px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--ground); }
.page-strip { display: flex; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.thumb { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 60px; padding: 6px; border: 2px solid transparent; border-radius: var(--r-plate); background: none; color: var(--ink); font-size: 0.8125rem; }
.thumb:hover { border-color: var(--line); }
.thumb[aria-current="true"] { border-color: var(--line); background: var(--blue); color: var(--sign-white); font-weight: 600; }
.thumb-page { display: flex; flex-direction: column; gap: 4px; width: 44px; height: 60px; padding: 7px 6px; border: 2px solid var(--sign-black); background: var(--page); }
.thumb-flag { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--sign-black); border-radius: var(--r-tag); background: var(--sign-white); color: var(--sign-black); }
.thumb-inject { right: 20px; border-color: var(--red); color: var(--red); }
.tl { display: block; width: 100%; height: 3px; background: var(--page-line); }
.tl.tl-head { width: 58%; height: 6px; background: var(--page-ink); }
.tl.w40 { width: 40%; } .tl.w60 { width: 60%; } .tl.w80 { width: 80%; }
.pr-facts { padding: 20px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.pr-file { color: var(--ink-2); font-size: 0.875rem; word-break: break-word; }
.pr-facts .doc-title { margin-top: 4px; font-size: 1.25rem; line-height: 1.25; }
.pr-note { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 2px solid var(--red); border-radius: var(--r-plate); font-size: 0.875rem; }
.pr-note .g { margin-top: 2px; color: var(--legend-red); }
.facts { margin: 12px 0 0; padding: 0; list-style: none; }
.fact { padding: 12px 0; border-top: 2px solid var(--rule); }
.fact-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.fact-label { color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.fact-ref { min-height: 24px; padding: 2px 4px; border: 0; border-radius: var(--r-tag); background: none; color: var(--ink); font-size: 0.875rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.fact-ref:hover { text-decoration-thickness: 3px; }
.fact-note, .fact-rule { margin: 0 0 8px; color: var(--ink-2); font-size: 0.875rem; }
.fact-rule { margin: 6px 0 0; }
.fact-computed { display: flex; gap: 8px; font-size: 0.9375rem; }
.fact-computed .g { margin-top: 3px; }
.sugg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* a suggestion is a plate to press; an unclear one is drawn as open */
.sugg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 44px; max-width: 100%; padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font-size: 0.9375rem; font-weight: 600; text-align: left; }
.sugg.band-unclear { border-style: dashed; }
.sugg:hover { background: var(--ink); color: var(--plate); }
.sugg:hover .sugg-why { color: var(--plate); }
.sugg:hover .sugg-key { border-color: var(--plate); }
.sugg-val { flex: 1 1 auto; min-width: 0; }
.sugg-key { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: var(--r-tag); font-size: 0.8125rem; font-weight: 600; }
.sugg-why { flex-basis: 100%; color: var(--ink-2); font-size: 0.8125rem; font-weight: 400; }
.fact-done { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.9375rem; }
.fact-val { font-weight: 600; }
.fact-how { color: var(--ink-2); font-size: 0.8125rem; }
.fact-edit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fact-edit .input { flex: 1; min-width: 140px; }
.fact-edit .field-error { flex-basis: 100%; }
.fact-reason { display: grid; gap: 4px; margin-top: 8px; }
.pr-result { display: grid; gap: 12px; margin-top: 12px; padding-top: 16px; border-top: 2px solid var(--line); }
.pr-result .stamp { justify-self: start; }
.pr-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.9375rem; }
.pr-foot { margin-top: 16px; }
.pr-foot .hint { margin-top: 8px; }

/* ---------- Anfrage zu Mappe ---------- */
.an-grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 24px; align-items: start; }
.mail-head { display: grid; gap: 4px; margin: 12px 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--rule); font-size: 0.9375rem; }
.mail-head > div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.mail-head dt { color: var(--ink-2); }
.mail-body p { margin: 0 0 8px; font-size: 1rem; line-height: 1.6; }
/* each requested line is underlined in the ink of its result; "ends soon" is a yellow mark, open is dashed */
.mail-body .req { text-decoration: underline 3px transparent; text-underline-offset: 5px; }
.mail-body .u-ok { text-decoration-color: var(--green); }
.mail-body .u-caution { text-decoration-color: var(--yellow); text-decoration-thickness: 6px; }
.mail-body .u-stop { text-decoration-color: var(--red); }
.mail-body .u-unknown, .mail-body .u-unclear { text-decoration-color: var(--ink); text-decoration-style: dashed; }
.mail-body .u-none { color: var(--ink-2); text-decoration-color: var(--rule); text-decoration-style: dotted; }
.mail-body .u-inject { color: var(--ink-2); text-decoration: line-through 2px var(--red); }
.an-res-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.an-toggle { display: none; margin-left: auto; }
.an-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.an-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.an-no { padding-top: 1px; color: var(--ink-2); font: 700 1.125rem/1.3 var(--legend); }
.an-type { font-weight: 600; }
.an-rules { margin-top: 6px; }
.an-text { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 0.9375rem; }
.an-row.is-none .an-type, .an-row.is-none .an-text { color: var(--ink-2); }
.an-row.is-none { border-color: var(--rule); }
.an-row.is-inject { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.an-row.is-inject .an-type { text-decoration: line-through 2px var(--red); }
.an-act { display: flex; align-items: center; }
.an-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; border: 0; }
.pick-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 2px dashed var(--line); border-radius: var(--r-plate); font-size: 0.9375rem; cursor: pointer; }
.pick-opt:has(input:checked) { border-style: solid; font-weight: 600; }
.pick-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.an-open { margin-top: 12px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: var(--r-plate); font-size: 0.9375rem; }

/* ---------- Bündel aufteilen ---------- */
.bu-summary { max-width: 40em; margin: -8px 0 16px; font-size: 1rem; }
.bu-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.only-narrow { display: none; }
.bu-strip { display: flex; flex-wrap: wrap; row-gap: 38px; margin-top: 16px; padding: 26px 0 8px; user-select: none; }
.bu-strip.is-dragging { cursor: grabbing; }
.bu-page { position: relative; display: flex; flex: none; flex-direction: column; align-items: center; width: 88px; }
.bu-thumb { position: relative; display: flex; flex-direction: column; gap: 5px; width: 88px; height: 124px; padding: 10px 9px; overflow: hidden; border: 2px solid var(--sign-black); background: var(--page); }
.bu-thumb .tl-head { margin-bottom: 4px; }
.th-hp .tl-head { width: 76%; }
.th-hr .tl-head { width: 42%; }
.th-so .tl-head { width: 66%; }
.th-gw .tl-head { width: 50%; }
.th-mi .tl-head { width: 34%; }
.th-muster { position: absolute; right: 0; bottom: 0; padding: 2px 4px 1px; background: var(--sign-black); color: var(--sign-white); font: 700 0.6875rem/1 var(--legend); }
/* a separator sheet is not a document: it is drawn as an empty, crossed sheet */
.bu-page.is-sep .bu-thumb { border-color: var(--page-line); background: var(--ground); }
.bu-pno { margin-top: 6px; color: var(--ink-2); font-size: 0.8125rem; text-align: center; }
.bu-part-label { position: absolute; left: 0; top: -24px; max-width: 84px; overflow: hidden; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.bu-bracket { align-self: stretch; height: 4px; margin: 6px -12px 0; background: var(--ink-2); }
.bu-page.part-a .bu-bracket { background: var(--blue); }
.bu-page.is-sep .bu-bracket { background: transparent; }
.bu-part-label.span-2 { max-width: 196px; }
.bu-part-label.span-3 { max-width: 308px; }
.bu-part-label.span-4 { max-width: 420px; }
.gap { position: relative; flex: none; width: 24px; height: 124px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.gap-line { position: absolute; left: 11px; top: 10px; bottom: 10px; width: 2px; background: transparent; }
.gap:hover .gap-line { background: var(--rule); }
.gap.is-cut .gap-line { left: 10px; top: -8px; bottom: -8px; width: 4px; background: var(--ink); cursor: grab; }
/* a cut that still needs a look is drawn as open */
.gap.is-cut.sug-check .gap-line, .gap.is-maybe .gap-line { top: 6px; bottom: 6px; width: 0; border-left: 3px dashed var(--ink); background: none; }
.gap.is-drop .gap-line { left: 10px; width: 4px; background: var(--blue); }
.gap-handle { position: absolute; left: 0; top: 50px; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--line); border-radius: var(--r-tag); background: var(--plate); cursor: grab; }
.gap-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gap:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-radius: var(--r-tag); }
.bu-parts ol { display: grid; gap: 4px; margin: 12px 0; padding: 0; list-style: none; }
.bu-part { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 0; border-top: 2px solid var(--rule); }
.bu-part > :nth-child(3) { grid-column: 2; justify-self: start; }
.bu-part:first-child { border-top: 0; }
.bu-part-no { color: var(--ink-2); font: 700 1.0625rem/1.3 var(--legend); }
.bu-part-main { display: grid; min-width: 0; }
.bu-part-type { font-size: 0.9375rem; font-weight: 600; }
.bu-part-range { color: var(--ink-2); font-size: 0.875rem; }

/* ---------- Mappe ---------- */
.mp-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: -6px 0 20px; }
.mp-ticks { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* one small plate per place in the packet */
.mp-tick { width: 26px; height: 14px; border: 2px solid var(--sign-black); border-radius: 2px; background: var(--st); }
.mp-tick.tone-ok { border-color: var(--green); }
.mp-tick.tone-stop { border-color: var(--red); background: var(--sign-white); }
.mp-tick.tone-unknown, .mp-tick.is-open { border: 2px dashed var(--line); background: var(--plate); }
.mp-tick.is-empty { border-color: var(--rule); background: var(--plate); }
.mp-count { font-size: 1rem; }
.mp-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 280px; gap: 0 24px; align-items: start; }
/* the places of a packet: a list of plates, the chosen one in blue */
.reg-tabs { display: flex; flex-direction: column; gap: 6px; }
.reg-tab { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 48px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); text-align: left; }
.reg-tab .g { margin-top: 2px; color: var(--st-text); }
.reg-tab:hover { background: var(--ground); }
.reg-tab[aria-selected="true"] { background: var(--blue); color: var(--sign-white); }
.reg-tab[aria-selected="true"] .g, .reg-tab[aria-selected="true"] .reg-tab-state { color: var(--sign-white); }
.reg-tab-text { display: grid; }
.reg-tab-label { font-size: 0.9375rem; font-weight: 600; }
.reg-tab-state { color: var(--ink-2); font-size: 0.8125rem; }
.mp-panel { min-height: 460px; }
.mp-slot-head { display: grid; gap: 2px; margin-bottom: 4px; }
.inst { padding: 18px 0; border-top: 2px solid var(--rule); }
.mp-slot-head + .inst { border-top: 0; }
.inst-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.inst-title { font-size: 1.125rem; line-height: 1.3; }
.inst-sentence { margin: 6px 0 12px; font-size: 0.9375rem; }
.inst-bar { margin-bottom: 12px; }
.inst-bar .fbar { height: 12px; }
.inst-scale { display: flex; justify-content: space-between; margin-top: 2px; color: var(--ink-2); font-size: 0.8125rem; }
.inst-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.inst-foot .hint { display: inline-flex; align-items: center; gap: 4px; }
.mp-side .panel-title { margin: 14px 0 4px; }
.shares { margin: 0; padding: 0; list-style: none; }
.share { padding: 12px 0; border-top: 2px solid var(--rule); }
.share-kind { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 0.8125rem; }
.share-label { font-size: 0.9375rem; font-weight: 600; }
.share-meta { color: var(--ink-2); font-size: 0.875rem; }
.share .btn { margin-left: -6px; }
.share.is-off .share-label { color: var(--ink-2); }
.share-state { margin-top: 4px; color: var(--ink-2); font-size: 0.875rem; }

/* ---------- Freigeben dialog ---------- */
.sh-slots { display: grid; gap: 2px; margin: 0 0 12px; padding: 0; list-style: none; }
.sh-slot { padding: 8px 0; border-top: 2px solid var(--rule); }
.sh-slot-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sh-slot-name { font-weight: 600; }
.sh-slot-text small { flex-basis: 100%; color: var(--ink-2); font-size: 0.875rem; }
.flags { display: grid; gap: 12px; margin: 0 0 12px; padding: 0; list-style: none; }
/* a share-safety question is open until a person decides it */
.flag { padding: 14px 16px; border: 2px dashed var(--line); border-radius: var(--r-plate); }
.flag.is-decided { border-style: solid; border-color: var(--rule); }
.flag-head { display: flex; gap: 10px; }
.flag-head .g { margin-top: 2px; }
.flag.is-decided .flag-head .g { color: var(--ink-2); }
.flag-what { font-weight: 600; }
.flag-where { color: var(--ink-2); font-size: 0.875rem; }
.flag-line { margin: 10px 0; padding: 8px 12px; border: 2px solid var(--sign-black); background: var(--page); color: var(--page-ink); font: 400 0.8125rem var(--mono); }
.redact.is-redacted { background: var(--page-ink); color: var(--page-ink); }
.redact.is-omitted { color: var(--page-muted); text-decoration: line-through; }
.flag-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); font-size: 0.9375rem; cursor: pointer; }
.choice:hover { background: var(--ground); }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice input { margin: 0; }
.flag-reason { margin: 10px 0 0; }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.875rem; }
.sh-final { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; margin-top: 16px; }
.qr { margin: 0; }
.qr svg { display: block; width: 160px; height: 160px; border: 2px solid var(--sign-black); }
.qr-bg { fill: var(--page); }
.qr-m { fill: var(--page-ink); }
.qr figcaption { margin-top: 6px; color: var(--ink-2); font-size: 0.8125rem; }
.sh-next { display: grid; align-content: start; gap: 10px; }
.sh-next .btn { justify-self: start; }

/* ---------- public pages: recipient, portal, tools ---------- */
.pub { max-width: 1160px; margin: 0 auto; padding: 28px 24px 40px; }
.pub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 2px solid var(--line); }
.pub-holder { font-size: 1.0625rem; font-weight: 600; }
.lang { display: inline-flex; gap: 4px; }
.lang-btn { min-height: 44px; padding: 4px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.9375rem; font-weight: 500; }
.lang-btn:hover { background: var(--ground); }
.lang-btn[aria-pressed="true"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }
.rc-grid { display: grid; grid-template-columns: minmax(0, 760px) 340px; gap: 40px; align-items: start; }
.rc-title { font: 700 2.5rem/1.05 var(--legend); }
.rc-for { margin-top: 8px; color: var(--ink-2); }
.rc-status { margin: 18px 0 20px; font-size: 1.125rem; line-height: 1.45; }
.rc-slots { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--line); }
.rc-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 8px 20px; align-items: center; padding: 14px 0; border-bottom: 2px solid var(--rule); }
.rc-row-main { display: grid; gap: 2px; justify-items: start; }
.rc-slot { font-weight: 600; }
.rc-doc { color: var(--ink-2); font-size: 0.9375rem; }
.rc-row-main .tag { margin-top: 4px; }
.rc-row-when { display: grid; gap: 2px; }
.rc-date { font-size: 0.9375rem; }
.rc-left { color: var(--ink-2); font-size: 0.875rem; }
.rc-row-act { display: flex; gap: 2px; }
.rc-side { display: grid; gap: 20px; position: sticky; top: 24px; }
.rc-dl { display: grid; gap: 8px; }
.rc-dl .hint { margin-bottom: 6px; }
.rc-dl .btn-quiet { justify-self: start; }
.rc-gone { max-width: 640px; padding: 48px 0; }
.rc-gone h1 { margin-bottom: 12px; font: 700 2.25rem/1.05 var(--legend); }
.pub-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 18px; border-top: 2px solid var(--line); color: var(--ink-2); font-size: 0.9375rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }

.po-head { align-items: center; }
.po-requester { display: flex; align-items: center; gap: 12px; }
.po-logo { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: var(--r-plate); background: var(--ink); color: var(--plate); font: 700 1.25rem/1 var(--legend); }
.po-from { font-weight: 600; }
.po-contact, .po-user { color: var(--ink-2); font-size: 0.9375rem; }
.po-grid { display: grid; grid-template-columns: minmax(0, 640px) 320px; gap: 16px 40px; align-items: start; }
.po-main h1 { font: 700 2rem/1.08 var(--legend); }
.po-due { margin: 8px 0 16px; color: var(--ink-2); }
.po-progress { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.po-count { font-size: 1rem; }
.po-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.po-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
/* an upload that needs a second look is open until the submitter answers */
.po-item.has-hint { border-style: dashed; }
.po-item.is-done .po-glyph { color: var(--legend-green); }
.po-glyph { padding-top: 2px; color: var(--st-text, var(--ink)); }
.po-label { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.po-rule { color: var(--ink-2); font-size: 0.9375rem; }
.po-files { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.po-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.9375rem; }
.po-fname { font-weight: 600; word-break: break-word; }
.po-fmeta { color: var(--ink-2); font-size: 0.875rem; }
.po-signed { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.9375rem; }
.po-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.po-side { display: grid; gap: 16px; }
.po-side p { max-width: 40em; }
.po-side p + p { margin-top: 8px; }
.po-side .panel { font-size: 0.9375rem; }
.po-bar { position: sticky; bottom: 0; z-index: 5; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.po-bar-note { color: var(--ink-2); font-size: 0.9375rem; }
.po-receipt, .po-paused { max-width: 720px; }
.po-receipt h1, .po-paused h1 { margin-bottom: 8px; font: 700 2rem/1.08 var(--legend); }
.receipt { display: grid; gap: 0; margin: 20px 0; padding: 0; list-style: none; }
.receipt li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.po-offer { margin-top: 20px; }
.po-offer p { margin: 6px 0 12px; }

/* ---------- Nachunternehmer-Übersicht ---------- */
.fi-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.verdicts { display: flex; flex-wrap: wrap; gap: 8px; }
.v-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); color: var(--ink); font-size: 0.9375rem; font-weight: 500; }
.v-btn .g { color: var(--st-text); }
.v-btn:hover { background: var(--ground); }
.v-btn[aria-pressed="true"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }
.v-btn[aria-pressed="true"] .g { color: currentColor; }
.fi-selects { display: flex; flex-wrap: wrap; gap: 12px; }
.matrix-wrap { max-height: calc(100vh - 290px); padding: 0; overflow: auto; }
/* the table keeps a small inset from the drawn border of its plate */
.matrix { width: calc(100% - 8px); margin: 4px; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.matrix th, .matrix td { padding: 0; border-bottom: 2px solid var(--rule); text-align: left; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix thead th { position: sticky; top: 0; z-index: 2; min-width: 72px; padding: 10px 6px; border-bottom-color: var(--line); background: var(--plate); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; line-height: 1.3; vertical-align: bottom; hyphens: manual; }
.matrix thead th.fi-firm-h { left: 0; z-index: 3; padding-left: 16px; }
.matrix tbody th { position: sticky; left: 0; z-index: 1; min-width: 180px; max-width: 240px; padding: 10px 14px; border-right: 2px solid var(--rule); background: var(--plate); font-weight: 400; }
/* a state sign in the matrix may take two lines, so the whole matrix fits a 1280 px screen */
.matrix .sgn { white-space: normal; }
.fi-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; line-height: 1.3; }
.fi-meta { display: block; color: var(--ink-2); font-size: 0.875rem; }
.live-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 2px solid var(--line); border-radius: var(--r-tag); color: var(--ink); font: 700 0.875rem/1.2 var(--legend); }
/* each cell is a tag: quiet when the proof is valid, a yellow plate when it ends soon, red when it stops work, dashed when open */
.cell { display: flex; align-items: center; width: 100%; min-height: 54px; padding: 0 3px; border: 0; background: none; color: var(--ink); font-size: 0.875rem; text-align: left; white-space: nowrap; }
.cell-in { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 5px 2px 3px; border: 2px solid transparent; border-radius: var(--r-tag); }
.cell .g { color: var(--st-text); }
.cell:hover .cell-in { border-color: var(--line); }
.cell:focus-visible { outline-offset: -3px; }
.cell-word { font-size: 0.875rem; }
.cell.tone-ok .g { color: var(--legend-green); }
.cell.tone-caution .cell-in { border-color: var(--sign-black); background: var(--yellow); color: var(--sign-black); font-weight: 600; }
.cell.tone-caution .g { color: var(--sign-black); }
.cell.tone-stop .cell-in { border-color: var(--legend-red); color: var(--legend-red); font-weight: 600; }
.cell.tone-unknown .cell-in { border: 2px dashed var(--line); }
.cell.tone-none { color: var(--ink-2); }
.fi-v { padding: 0 12px !important; white-space: nowrap; }
.fi-v-h { padding-left: 12px !important; white-space: nowrap; }
.fi-none { padding: 20px 16px !important; color: var(--ink-2); }
.fi-list { display: none; margin: 0; padding: 0; list-style: none; }
.fi-legend { margin-top: 12px; }
.fi-card { margin-bottom: 8px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.fi-card summary { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; cursor: pointer; list-style: none; }
.fi-card summary::-webkit-details-marker { display: none; }
.fi-cells { margin: 0; padding: 0 14px 10px; list-style: none; }
.fi-cell-row > span:first-child { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.fi-cell-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; width: 100%; min-height: 48px; padding: 8px 0; border: 0; border-top: 2px solid var(--rule); background: none; color: var(--ink); font-size: 0.9375rem; text-align: left; }

/* ---------- Einstellungen ---------- */
.set-grid { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 32px; align-items: start; }
.set-list { position: sticky; top: calc(var(--stick) + var(--top-h) + 24px); display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.set-link { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r-plate); color: var(--ink); font-size: 0.9375rem; text-decoration: none; }
.set-link:hover { background: var(--plate); }
.set-link[aria-current="page"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }
.set-link.is-off { color: var(--ink-2); }
.set-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.set-main .page-head { margin-bottom: 4px; }
.set-main .panel-title { margin-bottom: 10px; }
.tm-name { display: block; font-weight: 600; }
.tm-mail, .tm-role { display: block; font-size: 0.875rem; }
.tm-mail { color: var(--ink-2); }
.tm-role { font-size: 0.9375rem; }
.inv-list { margin: 0; padding: 0; list-style: none; }
.inv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bill-wide { grid-column: 1 / -1; }
.plan-name { font: 700 1.75rem/1.1 var(--legend); }
.plan-price { margin: 2px 0 12px; }
.meters { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 0.9375rem; }
.meter .fbar { grid-column: 1 / -1; }
.meter-val { font-variant-numeric: tabular-nums; text-align: right; }
.meter-note { grid-column: 1 / -1; color: var(--legend-red); font-size: 0.875rem; font-weight: 600; }
.bill-cancel p { max-width: 40em; margin: 8px 0 12px; font-size: 0.9375rem; }
.plan-pick { display: grid; gap: 8px; }
.plan-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); cursor: pointer; }
.plan-opt:hover { background: var(--ground); }
.plan-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--line); }
.plan-opt:has(input:checked) strong { font-weight: 700; }
.plan-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.plan-opt input { margin: 0; }
.plan-opt small { display: block; color: var(--ink-2); font-size: 0.875rem; }
.proration { margin-top: 4px; }
.keys { display: grid; gap: 0; }
.keys > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.keys > div:first-child { border-top: 0; }

/* ---------- Befehlszeile ---------- */
.dlg-cmd { width: min(900px, calc(100vw - 32px)); margin-top: 12vh; }
.cmd { display: flex; flex-direction: column; max-height: 76vh; }
.cmd-input { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-bottom: 2px solid var(--line); }
.cmd-input:focus-within { box-shadow: inset 0 0 0 3px var(--focus); }
.cmd-input .g { color: var(--ink-2); }
.cmd-input input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--ink); font-size: 1.0625rem; outline: none; }
.cmd-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 340px; overflow: hidden; }
.cmd-results { overflow: auto; padding: 8px; }
.cmd-group { padding: 10px 10px 4px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.cmd-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: var(--r-tag); font-size: 1rem; cursor: pointer; }
.cmd-opt .g { color: var(--ink-2); }
.cmd-opt[aria-selected="true"] { background: var(--blue); color: var(--sign-white); }
.cmd-opt[aria-selected="true"] .g, .cmd-opt[aria-selected="true"] .cmd-kind { color: var(--sign-white); }
.cmd-opt-label { flex: 1; min-width: 0; }
.cmd-kind { color: var(--ink-2); font-size: 0.8125rem; white-space: nowrap; }
.cmd-empty { padding: 16px 10px; color: var(--ink-2); }
.cmd-preview { display: grid; align-content: start; gap: 10px; padding: 16px; overflow: auto; border-left: 2px solid var(--line); background: var(--ground); font-size: 0.9375rem; }
.cmd-preview .btn { justify-self: start; }
.cmd-preview .slip { margin-top: 0; background: var(--plate); }
.cmd-preview .notice { margin: 0; }
.cmd-p-title { font: 600 1.375rem/1.15 var(--legend); }
.cmd-p-kind { color: var(--ink-2); font-size: 0.8125rem; }
.cmd-foot { padding: 10px 18px; border-top: 2px solid var(--line); color: var(--ink-2); font-size: 0.875rem; }

/* ---------- Erfassen am Telefon ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 400px) 390px; align-items: center; justify-content: center; gap: 64px; min-height: calc(100vh - var(--proto-h)); padding: 32px 24px; }
.stage-notes h1 { margin: 6px 0 10px; font: 700 2rem/1.08 var(--legend); }
.stage-notes > p { color: var(--ink-2); }
.notes { display: grid; gap: 8px; margin: 16px 0 0; padding-left: 18px; }
.device { width: 390px; height: 820px; padding: 10px; border-radius: 44px; background: var(--sign-black); }
.device-screen { position: relative; height: 100%; overflow: hidden; border-radius: 34px; }
.cap-step { display: flex; flex-direction: column; height: 100%; }
.cap-cam { background: var(--cam-bg); color: var(--cam-ink); }
.cap-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 64px; padding: 26px 16px 8px; font-size: 0.9375rem; }
.cap-top > :last-child { justify-self: end; }
.cap-title { font: 700 1.25rem/1.1 var(--legend); text-align: center; }
.cap-link { justify-self: start; min-height: 44px; padding: 0 4px; border: 0; background: none; color: inherit; font-size: 0.9375rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; display: inline-flex; align-items: center; }
.cap-cam .cap-link { color: var(--cam-ink); }
.cap-cam :focus-visible { outline-color: var(--cam-accent); }
.cap-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; }
.cap-view { position: relative; flex: 1; display: grid; place-items: center; margin: 0 12px; overflow: hidden; border: 2px solid var(--cam-line); border-radius: var(--r-sign); background: var(--cam-surface); }
.cap-view.is-flash::after { content: ""; position: absolute; inset: 0; background: var(--cam-ink); opacity: 0; animation: pf-flash 0.18s ease-out both; }
@keyframes pf-flash { from { opacity: 0.85; } to { opacity: 0; } }
.cap-doc { width: 86%; height: auto; }
.cap-desk-shadow { fill: none; }
.cap-paper { fill: var(--cam-paper); }
.cap-lines line { stroke: var(--page-line); stroke-width: 5; stroke-linecap: round; }
.cap-lines line:first-child { stroke: var(--page-ink); stroke-width: 9; }
.cap-muster { fill: var(--page-line); font: 700 40px var(--legend); text-anchor: middle; }
.cap-edge { fill: none; stroke: var(--cam-accent); stroke-width: 2; }
.cap-corner { fill: none; stroke: var(--cam-accent); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.cap-status { position: absolute; left: 50%; bottom: 14px; width: max-content; max-width: calc(100% - 24px); padding: 6px 12px; border: 2px solid var(--cam-ink); border-radius: var(--r-plate); background: var(--cam-bg); color: var(--cam-ink); font-size: 0.875rem; text-align: center; transform: translateX(-50%); }
.cap-tray { display: flex; gap: 6px; min-height: 58px; margin: 10px 12px 0; padding: 0; overflow-x: auto; list-style: none; }
.cap-thumb { display: grid; flex: none; place-items: end center; width: 36px; height: 50px; padding-bottom: 3px; border-radius: 2px; background: var(--cam-paper); color: var(--page-ink); font-size: 0.75rem; }
.cap-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 18px 28px; }
.cap-file { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; justify-self: start; min-width: 48px; min-height: 48px; padding-top: 4px; font-size: 0.8125rem; cursor: pointer; }
.cap-file:has(input:focus-visible) { outline: 3px solid var(--cam-accent); outline-offset: 2px; border-radius: var(--r-plate); }
/* the shutter keeps the round shape every camera has */
.shutter { width: 72px; height: 72px; border: 4px solid var(--cam-ink); border-radius: 50%; background: var(--cam-ink); box-shadow: inset 0 0 0 4px var(--cam-bg); }
.shutter:active { transform: scale(0.96); }
.shutter:focus-visible { outline-color: var(--cam-accent); outline-offset: 4px; }
.cap-done { justify-self: end; min-height: 48px; padding: 4px 16px; border: 2px solid var(--cam-ink); border-radius: var(--r-plate); background: var(--blue); color: var(--sign-white); font: 700 1.1875rem/1.3 var(--legend); }
.cap-done:disabled { border-color: var(--cam-line); background: var(--cam-surface); color: var(--cam-muted); }
.cap-review, .cap-sent { background: var(--ground); color: var(--ink); }
.cap-top-light { border-bottom: 2px solid var(--line); background: var(--plate); }
.cap-body { flex: 1; overflow: auto; padding: 16px; }
.cap-pages { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.cap-page { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 8px 10px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.cap-page-img { display: flex; flex-direction: column; gap: 4px; width: 44px; height: 60px; padding: 7px 6px; border: 2px solid var(--sign-black); background: var(--page); }
.cap-holder { margin: 0 0 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.cap-holder legend { padding: 0 4px; font-weight: 600; }
.cap-foot { display: grid; gap: 8px; padding: 12px 16px 28px; border-top: 2px solid var(--line); background: var(--plate); }
.cap-msg { margin-bottom: 16px; font-size: 1.0625rem; font-weight: 600; }
.pipeline { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pipe-step { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 2px solid transparent; border-radius: var(--r-plate); color: var(--ink-2); font-size: 0.9375rem; }
.pipe-step.is-done { color: var(--ink); }
.pipe-step.is-done .g { color: var(--legend-green); }
.pipe-step.is-now { border-color: var(--line); background: var(--plate); color: var(--ink); font-weight: 600; }
/* waiting for a signal is an open state */
.pipe-step.is-wait { border: 2px dashed var(--line); background: var(--plate); color: var(--ink); }

/* ---------- Werkzeug ---------- */
.site { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; }
.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 0; border-bottom: 2px solid var(--line); }
.site-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 700 1.375rem/1 var(--legend); text-decoration: none; }
.site-nav { flex: 1; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: var(--r-plate); color: var(--ink); font-size: 0.9375rem; text-decoration: none; }
.site-nav a:hover { background: var(--plate); }
.site-nav a[aria-current="page"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }
.tool-head { max-width: 720px; margin: 40px 0 28px; }
.tool-head h1 { font: 700 2.5rem/1.05 var(--legend); }
.tool-head p { margin-top: 12px; color: var(--ink-2); font-size: 1.125rem; line-height: 1.5; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; }
/* an empty drop zone is open: dashed until a file is in it */
.drop { display: grid; justify-items: center; gap: 12px; padding: 44px 24px; border: 2px dashed var(--line); border-radius: var(--r-plate); background: var(--plate); text-align: center; }
.drop.is-over { border: 3px solid var(--blue); }
.drop-title { font: 600 1.5rem/1.1 var(--legend); }
.drop-actions { justify-content: center; }
.drop .hint { max-width: 44ch; }
.tl-file { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); }
.tl-file-text { flex: 1; min-width: 0; }
.tl-name { font-weight: 600; word-break: break-word; }
.tl-strip { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.tl-th { display: grid; justify-items: center; }
.tl-th .bu-thumb { width: 72px; height: 100px; padding: 8px 7px; }
.tl-more { align-self: center; color: var(--ink-2); font-size: 0.9375rem; }
.tl-form .field:first-child { margin-top: 0; }
.prediction { margin: 8px 0 14px; padding: 10px 12px; border: 2px solid var(--rule); border-radius: var(--r-plate); background: var(--plate); font-size: 1rem; }
.prediction.is-over { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.tl-result { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line); }
.tool-local { display: flex; align-items: flex-start; gap: 10px; max-width: 760px; margin: 28px 0 8px; font-size: 1rem; }
.tool-local .g { margin-top: 2px; }
.tool-pro { color: var(--ink-2); font-size: 0.9375rem; }
.site-foot { margin-top: 40px; padding-top: 16px; border-top: 2px solid var(--line); font-size: 0.9375rem; }

/* ---------- Stichtag and Fristen-Klippe on the wall ---------- */
.wand-ref .input { width: 11.5rem; }
.pl-hist { fill: var(--ink-2); }
.pl-hist.is-peak { fill: var(--yellow); stroke: var(--sign-black); stroke-width: 1; }
.pl-hist-n { fill: var(--ink); font: 700 13px var(--legend); }
/* the busiest month is a matter of "ends soon": a yellow plate */
.wand-cliff { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; padding: 12px 16px; border: 2px solid var(--sign-black); border-radius: var(--r-plate); background: var(--yellow); color: var(--sign-black); font-size: 0.9375rem; }
.wand-cliff p { flex: 1 1 240px; max-width: 40em; }
.wand-cliff .btn { margin-left: auto; }
.wand-cliff .btn { border-color: var(--sign-black); }
.wand-cliff :focus-visible { outline-color: var(--sign-black); }
.cliff-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.cliff-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 10px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.cliff-item:first-child { border-top: 0; }
.cliff-item strong { font-weight: 600; }
.cliff-item small { color: var(--ink-2); font-size: 0.875rem; }

/* ---------- Merkmale je Typ in Prüfen ---------- */
.pr-checks { margin-top: 4px; padding-top: 14px; border-top: 2px solid var(--rule); }
.pr-checks-title { margin-bottom: 8px; font-size: 0.9375rem; font-weight: 600; }
.checks { display: grid; margin: 0 0 8px; padding: 0; list-style: none; }
.check-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.875rem; }
.check-row .g { color: var(--st-text); }
.check-none { color: var(--ink-2); font-size: 0.8125rem; }
.pr-foot .btn-quiet { margin: 4px 0 0 -6px; }

/* ---------- neue Fassung freigeben ---------- */
.rl-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.rl-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-top: 2px solid var(--rule); }
.rl-item:first-child { border-top: 0; }
.rl-item > .g { margin-top: 2px; }
.rl-kind { color: var(--ink-2); font-size: 0.8125rem; }
.rl-to { font-weight: 600; }
.rl-what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.9375rem; }
.dlg-release .kv { margin-bottom: 16px; }

/* ---------- Einsatz-Check: covered, gap, gap ahead, open over the whole deployment ---------- */
.es-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.es-count { flex-basis: 100%; }
.es-panel { padding: 8px 20px 12px; }
.es-row { display: grid; grid-template-columns: 250px minmax(0, 1fr) 240px; gap: 8px 20px; align-items: center; }
.es-head { padding: 8px 0 6px; border-bottom: 2px solid var(--line); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.es-list { margin: 0; padding: 0; list-style: none; }
.es-item { padding: 14px 0; border-top: 2px solid var(--rule); }
.es-item:first-child { border-top: 0; }
.es-track { min-width: 0; overflow: hidden; }
.es-svg { display: block; }
.es-seg.es-ok { fill: var(--green); }
.es-seg.es-fore { fill: var(--yellow); stroke: var(--sign-black); stroke-width: 1; }
/* a gap carries the barrier hatch */
.es-seg.es-stop { fill: url(#hatch); stroke: var(--red); stroke-width: 2; }
.es-seg.es-open { fill: var(--plate); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; }
.es-today { stroke: var(--ink); stroke-width: 2; }
.es-tick { stroke: var(--rule); stroke-width: 2; }
.es-month { fill: var(--ink-2); font: 500 13px var(--text); }
.es-now { fill: var(--ink); font-weight: 600; }
.es-v { justify-self: start; white-space: normal; }
.es-under { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin-top: 4px; padding-left: 270px; }
.es-causes { max-width: 40em; color: var(--ink-2); font-size: 0.875rem; }
.es-detail { display: grid; gap: 8px; margin: 10px 0 0; padding: 12px 0 0; border-top: 2px solid var(--rule); list-style: none; }
.es-row-sub { font-size: 0.875rem; }
.es-req { color: var(--ink-2); }
.es-sub-state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.es-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 4px; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.875rem; }
.es-legend li { display: inline-flex; align-items: center; gap: 8px; }
.es-key { width: 28px; height: 12px; overflow: visible; }

/* ---------- Nachweise anfordern ---------- */
.af-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 380px); gap: 16px; align-items: start; }
.af-firms { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.af-firm { border-top: 2px solid var(--rule); }
.af-firm:first-child { border-top: 0; }
.af-firm .check { align-items: flex-start; padding: 10px 0; }
.af-firm strong { display: block; font-weight: 600; }
.af-firm small { display: block; color: var(--ink-2); font-size: 0.875rem; }
.af-preview { padding: 16px; border: 2px solid var(--rule); border-radius: var(--r-plate); background: var(--ground); }
.af-pv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.af-pv-title { font: 600 1.375rem/1.15 var(--legend); }
.af-pv-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.af-pv-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.9375rem; }
.af-pv-item > .g { color: var(--st-text); }
.af-pv-item .po-label { font-size: 1rem; }
.af-msg { min-height: 110px; }

/* ---------- Umzug ---------- */
.um-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.um-wide { grid-column: 1 / -1; }
.um-file { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 12px; }
.um-file > .g { margin-top: 2px; }
.um-file strong { display: block; font-weight: 600; word-break: break-word; }
.um-file .hint { display: block; }
.um-open { display: block; margin-top: 4px; color: var(--ink); font-size: 0.875rem; font-weight: 600; }
.um-grid .select { max-width: 100%; }

/* ---------- Nachweis-Pass and Prüfhilfe ---------- */
.ps-lead { max-width: 40em; margin: 6px 0 14px; font-size: 0.9375rem; }
.ps-note { max-width: 64ch; margin-top: 16px; }
.ps-form .field { margin-bottom: 12px; }
.ps-row { grid-template-columns: minmax(0, 1fr) 220px; }
.ph-off { color: var(--ink-2); }
.ph-same .fbar { width: 96px; margin-top: 4px; }
.ph-table th, .ph-table td { padding-right: 8px; vertical-align: top; }

/* ---------- was ist neu ---------- */
.pill-count { min-width: 22px; padding: 0 6px; border-radius: var(--r-tag); background: var(--ink); color: var(--plate); font: 700 0.875rem/22px var(--legend); text-align: center; }
.new-dot { position: absolute; top: 2px; left: calc(50% + 12px); width: 10px; height: 10px; border: 2px solid var(--plate); border-radius: 2px; background: var(--ink); }
.rail-count ~ .new-dot { display: none; }
.new-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 7px; border: 2px solid var(--ink); border-radius: var(--r-tag); background: var(--ink); color: var(--plate); font: 700 0.9375rem/1.1 var(--legend); white-space: nowrap; }
.new-chip.is-rebuilt, .new-chip.is-improved, .new-chip.is-kept, .new-chip.is-fp { background: var(--plate); color: var(--ink); }
.new-chip.is-kept, .new-chip.is-fp { border-color: var(--rule); }
.new-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 0.875rem; text-align: left; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.new-link:hover { text-decoration-thickness: 3px; }
.new-filter { margin-bottom: 12px; }
.new-group + .new-group { margin-top: 20px; }
.new-group h3 { margin: 0 0 8px; color: var(--ink-2); font-size: 0.9375rem; font-weight: 600; }
.new-items { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.new-item { padding: 12px 0; border-top: 2px solid var(--rule); }
.new-item:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.new-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.new-item p { margin: 6px 0 0; font-size: 0.9375rem; line-height: 1.5; }
.new-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--ink-2); font-size: 0.875rem; }
.new-meta a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- the clearance screens: board, payment release, chain, site gate ---------- */
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 12px; }
.cl-bar .refday { flex: 1 1 560px; }
.cl-count { max-width: 40em; margin-bottom: 12px; color: var(--ink); font-size: 0.9375rem; }
/* the tally: how many companies carry each sign on the chosen day */
.cl-tally { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.cl-tally-label { font-size: 0.9375rem; font-weight: 600; }
.cl-tally-label:not(:first-child) { margin-left: 12px; }
.cl-tally-item { display: inline-flex; align-items: center; gap: 6px; }
.cl-tally-n { min-width: 1ch; font: 700 1.375rem/1 var(--legend); font-variant-numeric: tabular-nums; }
.cl-note { margin-top: 12px; }
.cl-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cl-asks { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.cl-asks li { display: grid; gap: 2px; padding: 8px 0; border-top: 2px solid var(--rule); font-size: 0.9375rem; }
.cl-asks li:first-child { border-top: 0; }
.cl-asks strong { font-weight: 600; }
.fg-also { margin-top: 4px; color: var(--ink-2); font-size: 0.875rem; line-height: 1.4; }

/* the row form of the two signs: the work sign with its pictogram beside the legend, the payment disc beside its plate */
.sign-row { grid-template-columns: auto minmax(0, 1fr); align-content: center; justify-items: start; gap: 0 10px; min-height: 84px; padding: 10px 14px; text-align: left; }
.sign-row .sign-picto { grid-row: 1 / 3; align-self: center; width: 30px; height: 30px; margin: 0; }
.sign-row .sign-kind { align-self: end; font-size: 0.9375rem; }
.sign-row .sign-legend { align-self: start; font-size: 1.375rem; line-height: 1.05; }
.sign-work.sign-row.is-ok { box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 6px var(--sign-white); }
.sign-work.sign-row.is-warn { box-shadow: inset 0 0 0 4px var(--yellow), inset 0 0 0 6px var(--sign-black); }
.sign-work.sign-row.is-stop { box-shadow: inset 0 0 0 6px var(--red); }
.sign-pay.sign-row { align-items: center; padding: 0; }
.sign-pay.sign-row .sign-ring { width: 76px; height: 76px; font-size: 1.875rem; }
.sign-pay.sign-row .sign-ring small { font-size: 1rem; }
.sign-pay.sign-row.is-ok .sign-ring { box-shadow: inset 0 0 0 3px var(--blue), inset 0 0 0 5px var(--sign-white); }
.sign-pay.sign-row.is-cut .sign-ring { box-shadow: inset 0 0 0 9px var(--red); }
.sign-pay.sign-row .sign-cap { margin-top: 0; text-align: left; }
.sign-pay.sign-row .sign-legend { font-size: 1.25rem; }

/* Freigabe-Tafel */
.fg-panel { padding: 4px 20px 8px; }
.fg-list { margin: 0; padding: 0; list-style: none; }
.fg-row { display: grid; grid-template-columns: minmax(148px, 1fr) 168px minmax(216px, 1.3fr) 188px minmax(216px, 1.15fr) 80px; grid-template-areas: "firm ws wp ps pp more" "all all all all all all"; align-items: center; gap: 0 16px; padding: 14px 0; border-top: 2px solid var(--rule); }
.fg-list > .fg-row:first-child { border-top: 0; }
.fg-head { grid-template-areas: none; padding: 10px 0 8px; border-top: 0; border-bottom: 2px solid var(--line); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.fg-firm { grid-area: firm; min-width: 0; }
.fg-ws { grid-area: ws; }
.fg-wp { grid-area: wp; min-width: 0; }
.fg-ps { grid-area: ps; }
.fg-pp { grid-area: pp; min-width: 0; }
.fg-more { grid-area: more; justify-self: end; gap: 4px; min-width: 44px; white-space: nowrap; }
.fg-more > span { white-space: nowrap; }
.fg-all { grid-area: all; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
@media (min-width: 1280px) {
  .fg-more-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Zahlungsfreigabe */
.zf-panel { padding: 4px 20px 8px; }
.zf-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.zf-table th, .zf-table td { padding: 12px 14px 12px 0; border-bottom: 2px solid var(--rule); font-weight: 400; text-align: left; vertical-align: middle; }
.zf-table th:last-child, .zf-table td:last-child { padding-right: 0; }
.zf-table thead th { padding-block: 10px 8px; border-bottom-color: var(--line); color: var(--ink-2); font-size: 0.875rem; font-weight: 600; line-height: 1.3; vertical-align: bottom; }
.zf-table tbody tr:last-child > * { border-bottom-color: var(--line); }
.zf-table tfoot th, .zf-table tfoot td { border-bottom: 0; font-weight: 600; }
.zf-table .zf-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zf-table td.zf-num { font-size: 1rem; }
.zf-table td.zf-pay { font-weight: 600; }
/* the withholding of a payment is the one yellow field */
.zf-due { display: inline-grid; justify-items: end; padding: 6px 10px; border: 2px solid var(--sign-black); border-radius: var(--r-plate); background: var(--yellow); color: var(--sign-black); font-weight: 600; }
.zf-until { font-size: 0.8125rem; font-weight: 500; }
.zf-sign { width: 188px; }
.zf-signbox { display: grid; grid-template-columns: auto minmax(min-content, 1fr); align-items: center; gap: 10px; }
.zf-legend { font: 700 1.125rem/1.1 var(--legend); }
.zf-inv .fi-name, .zf-inv .fi-meta, .zf-inv .id { display: block; }
.zf-cert { width: 216px; }
.zf-act { width: 1%; white-space: nowrap; }
.zf-act .btn { display: flex; }
.zf-act .sgn { margin-bottom: 2px; }
.zf-by { display: block; color: var(--ink-2); font-size: 0.8125rem; font-weight: 400; white-space: normal; }
tfoot .zf-act { color: var(--ink-2); font-size: 0.875rem; font-weight: 400; white-space: normal; }

/* Kette: a tree drawn with posts and rails, standing on the ground like a row of signs */
.kt-board { padding: 4px 0 0; }
.kt-root { display: grid; gap: 2px; width: fit-content; max-width: 100%; padding: 10px 14px; border-radius: var(--r-plate); background: var(--ink); color: var(--plate); }
.kt-root strong { font: 700 1.375rem/1.1 var(--legend); }
.kt-root span { font-size: 0.875rem; }
.kt-kids { margin: 0 0 0 18px; padding: 0; list-style: none; }
.kt-node { position: relative; padding: 14px 0 0 28px; }
.kt-node::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.kt-node:last-child::before { bottom: auto; height: 33px; }
.kt-node::after { content: ""; position: absolute; left: 0; top: 31px; width: 22px; border-top: 2px solid var(--line); }
.kt-card { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(250px, 1fr); align-items: start; gap: 6px 16px; }
.kt-sgn { justify-self: start; }
.kt-who, .kt-why { min-width: 0; }
.kt-node > .kt-kids { margin-top: 2px; }

/* Baustellentor: a phone at the gate */
.gate { display: flex; flex-direction: column; background: var(--ground); color: var(--ink); }
.gate-bar { padding: 30px 16px 10px; background: var(--blue); color: var(--sign-white); font: 700 1.1875rem/1.3 var(--legend); }
.gate-status { padding: 8px 16px; border-bottom: 2px solid var(--line); background: var(--plate); font-size: 0.875rem; line-height: 1.4; }
/* without a signal the state is open: checked against the last copy, records wait */
.gate-status.is-off { margin: 10px 16px 0; padding: 8px 10px; border: 2px dashed var(--line); border-radius: var(--r-plate); font-weight: 600; }
.gate-body { display: grid; flex: 1; align-content: start; gap: 12px; padding: 14px 16px 20px; overflow: auto; }
.gate-who { display: grid; gap: 2px; }
.gate-name { font: 700 1.875rem/1.05 var(--legend); outline: none; }
.gate-firm { font-size: 1.0625rem; font-weight: 600; }
.gate-card-no { color: var(--ink-2); font-size: 0.875rem; }
.gate-sign { min-height: 164px; }
.gate-sign .sign-picto { width: 48px; height: 48px; }
.gate-sign .sign-legend { font-size: 2.25rem; }
.plate-note { flex-basis: 100%; color: inherit; font: 400 0.875rem/1.4 var(--text); }
.plate.is-na .plate-state { color: var(--ink-2); }
.gate-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.gate-actions .btn { white-space: normal; text-align: center; }
.gate-actions .btn-primary { grid-column: 1 / -1; }
.gate-foot { color: var(--ink-2); font-size: 0.8125rem; line-height: 1.45; }
.gate-scan { display: grid; justify-items: center; gap: 10px; padding: 20px 12px; border: 2px solid var(--cam-line); border-radius: var(--r-sign); background: var(--cam-bg); color: var(--cam-ink); }
.gate-qr { width: 150px; height: 150px; }
.gate-corner { fill: none; stroke: var(--cam-accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.gate-card { fill: var(--cam-paper); }
.gate-card-line { fill: none; stroke: var(--page-line); stroke-width: 4; stroke-linecap: round; }
.gate-scan-text { font: 700 1.1875rem/1.3 var(--legend); text-align: center; }
.gate-h { font-size: 1rem; font-weight: 600; }
.gate-log { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gate-log li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; font-size: 0.875rem; }
.gate-done { display: flex; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-size: 0.9375rem; font-weight: 600; }
.gate-done .g { margin-top: 2px; }
.gate-cards { margin-top: 20px; }
.gate-cards-title { margin-bottom: 8px; font-size: 0.9375rem; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .pr-grid { grid-template-columns: 220px minmax(0, 1fr) 340px; }
  .mp-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .mp-side { grid-column: 1 / -1; margin-top: 16px; }
  .shares { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
  .an-grid { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
  .rc-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .af-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .af-grid > .panel:last-child { grid-column: 1 / -1; }
  .es-row { grid-template-columns: 210px minmax(0, 1fr) 220px; }
  .es-under { padding-left: 230px; }
  /* the board: the company on its own line, then each sign with its plate */
  .fg-head { display: none; }
  .fg-row { grid-template-columns: 196px minmax(0, 1fr); grid-template-areas: "firm firm" "ws wp" "ps pp" "more more" "all all"; gap: 10px 16px; }
  .fg-more { justify-self: start; }
  .fg-all { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .kt-card { grid-template-columns: 190px minmax(0, 1fr); }
  .kt-why { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .proto-note, .proto-name { display: none; }
  .proto { gap: 12px; }
  .proto-field { flex: 1 1 auto; min-width: 0; }
  .proto-select { min-width: 0; width: 100%; }
  .cmd-trigger { width: 44px; justify-content: center; padding: 0; }
  .cmd-trigger-text, .cmd-trigger kbd { display: none; }
  .top { gap: 8px; padding: 0 16px; }
  .ws { max-width: 300px; }
  .ws-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .pill-new span:not(.pill-count):not(.sr) { display: none; }
  .planner, .wand-keys { display: none; }
  .tlist { display: block; }
  .wand-actions .wand-renew { display: none; }
  .bottom-bar { position: sticky; bottom: 0; z-index: 30; display: block; margin: 16px -24px -72px; padding: 12px 24px 16px; border-top: 2px solid var(--line); background: var(--ground); }
  .home-grid, .an-grid, .bu-grid, .tool-grid, .po-grid, .rc-grid, .bill-grid { grid-template-columns: minmax(0, 1fr); }
  .rc-side { position: static; }
  .pr-grid { grid-template-columns: minmax(0, 1fr); }
  .pr-queue ol { display: flex; overflow-x: auto; padding: 4px 8px 8px; }
  .pr-queue li { flex: 0 0 272px; }
  .pr-tabs { display: flex; gap: 4px; }
  .pr-tabs button { flex: 1; min-height: 48px; border: 2px solid var(--line); border-radius: var(--r-plate); background: var(--plate); font-weight: 500; }
  .pr-tabs button[aria-selected="true"] { background: var(--blue); color: var(--sign-white); font-weight: 600; }
  .pr-grid[data-tab="facts"] .pr-doc, .pr-grid[data-tab="doc"] .pr-facts { display: none; }
  .viewer { max-height: none; padding: 12px; }
  .page { padding: 28px 20px 36px 44px; }
  .page .ln::before { left: -32px; width: 22px; }
  .an-source { display: none; }
  .an-source.is-open { display: block; }
  .an-toggle { display: inline-flex; }
  .mp-grid { grid-template-columns: minmax(0, 1fr); }
  .reg-tabs { margin: 0 0 12px; }
  .mp-panel { min-height: 0; }
  .matrix-wrap, .fi-legend { display: none; }
  .fi-list { display: block; }
  .set-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .set-list { position: static; display: flex; overflow-x: auto; padding: 4px 8px 8px; }
  .set-link { white-space: nowrap; }
  .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; }
  .stage-notes { max-width: 560px; }
  .tool-head h1 { font-size: 2.25rem; }
  .af-grid, .um-grid { grid-template-columns: minmax(0, 1fr); }
  .es-head { display: none; }
  .es-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .es-under { padding-left: 0; }
  .ps-row { grid-template-columns: minmax(0, 1fr); }
  .refday { grid-template-columns: auto minmax(0, 1fr); }
  .refday .input { width: 100%; }
  .refday input[type="range"] { grid-column: 1 / -1; }
  .refday output { grid-column: 1; min-width: 0; text-align: left; }
  /* the payment run: each invoice becomes a block with its amounts as labelled lines */
  .zf-table thead { display: none; }
  .zf-table, .zf-table tbody, .zf-table tfoot { display: block; }
  .zf-table tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 0; border-bottom: 2px solid var(--rule); }
  .zf-table tfoot tr { border-bottom: 0; }
  .zf-table tbody tr:last-child { border-bottom-color: var(--line); }
  .zf-table th, .zf-table td { display: block; width: auto; padding: 0; border: 0; white-space: normal; }
  .zf-table td.zf-num { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: right; }
  .zf-table td.zf-num::before { content: attr(data-label); font-size: 0.9375rem; font-weight: 400; text-align: left; white-space: normal; }
  .zf-table tfoot .zf-sign, .zf-table tfoot .zf-cert { display: none; }
  .zf-act .btn { width: 100%; }
}
@media (max-width: 720px) {
  :root { --rail-w: 0px; --stick: 0px; --top-h: 60px; }
  .btn { white-space: normal; text-align: center; }
  .only-wide { display: none; }
  .only-narrow { display: inline; }
  .proto { position: relative; flex-wrap: wrap; gap: 8px 12px; height: auto; padding: 8px 12px; }
  .proto-name, .proto-note { display: none; }
  .proto-field { flex: 1 1 150px; }
  .proto-field label { font-size: 0.8125rem; }
  .proto-select { flex: 1; min-width: 0; max-width: none; }
  /* on phones the rail is a bottom bar */
  .rail { top: auto; right: 0; bottom: 0; flex-direction: row; width: auto; height: 72px; padding: 4px 4px 6px; overflow: visible; border-top: 2px solid var(--line); border-right: 0; }
  .rail-mark { display: none; }
  .rail-list { flex-direction: row; justify-content: space-around; gap: 0; }
  .rail-list > li { flex: 1; min-width: 0; }
  .rail-more, .rail-end { display: none; }
  .rail-mob { display: block; }
  .rail-item { padding: 3px 1px; }
  .rail-cap { margin: -16px 0 0; }
  .rail-capture .g, .rail-capture[aria-current="page"] .g { width: 52px; height: 52px; padding: 12px; }
  /* the phone header: workspace (on two lines if needed), search, assistance mode, notifications, account */
  .top { gap: 4px; padding: 0 8px; }
  .ws-wrap { flex: 1 1 0; min-width: 0; }
  .ws { max-width: 100%; margin-left: 0; padding: 0 4px; font-size: 0.875rem; line-height: 1.2; text-align: left; }
  .ws-name { overflow: visible; white-space: normal; text-overflow: clip; }
  .top-end { gap: 4px; margin-left: 0; }
  .pill { width: 44px; justify-content: center; padding: 0; }
  .pill-new { display: none; }
  #assist-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .main { padding: 16px 16px 108px; }
  .page-title h1 { font-size: 1.5rem; }
  .page-head { align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .wand-actions .seg { width: 100%; }
  .seg-opt { flex: 1; }
  .seg-opt span { padding: 12px 4px; text-align: center; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .bottom-bar { bottom: 72px; margin: 16px -16px 0; padding: 10px 16px; }
  .scr-mappe .page-actions .btn-primary { display: none; }
  .events li { grid-template-columns: 1fr; gap: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { padding-bottom: 0; }
  .kv dd, .kv > div:first-child > dd { padding-top: 2px; border-top: 0; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-width: 2px 0 0; border-radius: var(--r-plate) var(--r-plate) 0 0; }
  .dlg-inner { max-height: 92dvh; }
  .dlg-share, .dlg-cmd { height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .dlg-share .dlg-inner, .dlg-cmd .cmd { height: 100%; max-height: 100dvh; }
  .stepper li span:last-child { font-size: 0.875rem; }
  .dlg-foot { flex-wrap: wrap; }
  .dlg-status { flex-basis: 100%; order: -1; text-align: left; }
  .dlg-foot .btn { flex: 1; }
  .cmd-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; flex: 1; min-height: 0; }
  .cmd-preview { max-height: 42vh; border-top: 2px solid var(--line); border-left: 0; }
  .drawer { top: auto; left: 0; width: auto; max-height: 86dvh; border-top: 2px solid var(--line); border-left: 0; }
  .sh-final { grid-template-columns: minmax(0, 1fr); }
  .linkbox { flex-wrap: wrap; }
  .an-row { grid-template-columns: 24px minmax(0, 1fr); }
  .an-act { grid-column: 2; }
  .bu-strip { flex-direction: column; flex-wrap: nowrap; row-gap: 0; padding-top: 0; }
  .bu-page { flex-direction: row; align-items: center; gap: 12px; width: 100%; padding: 6px 0; }
  .bu-thumb { width: 44px; height: 62px; padding: 6px 5px; gap: 3px; }
  .th-muster { display: none; }
  .bu-pno { margin: 0; font-size: 0.9375rem; text-align: left; }
  .bu-part-label { position: static; order: 3; margin-left: auto; max-width: 45%; }
  .bu-bracket { display: none; }
  .gap { width: 100%; height: 48px; border-radius: var(--r-plate); }
  .gap-line { inset: 23px 0 auto 0 !important; width: auto !important; height: 2px !important; background: transparent; }
  .gap.is-cut .gap-line { height: 4px !important; background: var(--ink); }
  .gap.is-cut.sug-check .gap-line, .gap.is-maybe .gap-line { height: 0 !important; border-left: 0; border-top: 3px dashed var(--ink); background: none; }
  .gap-handle { display: none; }
  .gap-text { position: relative; width: auto; height: auto; clip-path: none; display: inline-block; padding: 0 10px; background: var(--plate); color: var(--ink); font-size: 0.9375rem; font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
  .panel { padding: 16px; }
  .rc-title { font-size: 2rem; }
  .rc-status { font-size: 1.0625rem; }
  .rc-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rc-dl { position: sticky; bottom: 0; z-index: 5; grid-template-columns: 1fr 1fr; padding: 12px; border-radius: var(--r-plate) var(--r-plate) 0 0; }
  .rc-dl .hint { display: none; }
  .rc-dl .btn { font-size: 1.0625rem; }
  .rc-dl .btn-quiet { display: none; }
  .rc-side { display: flex; flex-direction: column-reverse; }
  .pub { padding: 16px 16px 24px; }
  .po-bar { bottom: 0; margin: 0 -16px; border-width: 2px 0 0; border-radius: 0; }
  .po-bar .btn { flex: 1; }
  .po-main h1 { font-size: 1.75rem; }
  .tool-head { margin: 24px 0 16px; }
  .tool-head h1 { font-size: 2rem; }
  .tool-head p { font-size: 1rem; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav a { white-space: nowrap; }
  .wand-ref { width: 100%; }
  .wand-ref .input { flex: 1; width: auto; }
  .es-panel { padding: 4px 16px 8px; }
  .es-bar .field-inline { flex: 1 1 100%; }
  .es-bar .input, .es-bar .select { flex: 1; min-width: 0; }
  .scr-freigabe .page-actions .btn-secondary { display: none; }
  .cl-bar .field-inline { flex: 1 1 100%; }
  .cl-bar .select { flex: 1; min-width: 0; }
  .fg-panel, .zf-panel { padding: 0 16px 4px; }
  /* on a phone the two signs stand side by side, their plates beneath */
  .fg-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "firm firm" "ws ps" "wp wp" "pp pp" "more more" "all all"; gap: 10px 12px; }
  .fg-all { grid-template-columns: minmax(0, 1fr); }
  .sign-row { grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; gap: 2px; min-height: 140px; padding: 12px; text-align: center; }
  .sign-row .sign-picto { grid-row: auto; margin-bottom: 2px; }
  .sign-row .sign-kind, .sign-row .sign-legend { align-self: auto; }
  .sign-pay.sign-row .sign-cap { margin-top: 8px; text-align: center; }
  .kt-kids { margin-left: 2px; }
  .kt-node { padding-left: 18px; }
  .kt-node::after { width: 12px; }
  .kt-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .gate-bar { padding-top: 12px; }
  .stage { display: block; padding: 0; }
  .stage-notes { display: none; }
  .device { width: 100%; height: calc(100dvh - 90px); min-height: 560px; padding: 0; border-radius: 0; background: none; }
  .is-embed .device { height: 100dvh; }
  .device-screen { border-radius: 0; }
  .cap-top { padding-top: 12px; }
}
@media (max-width: 419px) {
  .sign { min-height: 136px; padding: 12px; }
  .sign-ring { width: 104px; height: 104px; font-size: 2.5rem; }
}

/* ---------- motion, forced colours, print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .pl-box { stroke: CanvasText; }
  .pl-strip, .pl-tick { fill: CanvasText; }
  .pl-card:focus-visible .pl-box { stroke: Highlight; }
  .tag, .band-tag, .sugg, .cell-in, .sgn, .disc, .sign, .sign-ring, .plate { border: 2px solid CanvasText; }
  .gap.is-cut .gap-line { background: CanvasText; }
  .es-seg.es-ok, .es-seg.es-fore, .pl-hist { fill: CanvasText; }
  .es-seg.es-stop, .es-seg.es-open { stroke: CanvasText; }
  .seg-opt input:checked + span, .v-btn[aria-pressed="true"], .lang-btn[aria-pressed="true"], .chip-btn[aria-pressed="true"], .q-item[aria-current="true"], .reg-tab[aria-selected="true"], .set-link[aria-current="page"], .cmd-opt[aria-selected="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .new-chip, .pill-count, .new-dot, .rail-count, .badge { forced-color-adjust: none; border: 1px solid CanvasText; }
}
@page wall { size: A3 landscape; margin: 10mm; }
@media print {
  /* paper is white in both themes: every theme token takes its light value; plates and borders stay, signs keep their inks */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --ground: #FFFFFF; --plate: #FFFFFF; --ink: #1E1E20; --ink-2: #45474A; --line: #1E1E20; --rule: #A9ABA6;
    --legend-red: #B0101A; --legend-green: #23663F; --focus: #0E518D;
    color-scheme: light;
  }
  .proto, .rail, .top, .bottom-bar, .toasts, .drawer, .skip, .page-actions, .wand-keys, .wand-cliff, .banner, .lang, .rc-row-act, .rc-dl, .foot-links, .pr-queue, .pr-tabs, .cmd-trigger, .es-bar, .es-under .btn, .ps-form, .pill-new, .new-dot, .new-link, .cl-bar, .fg-more, .rel-note, .zf-act .btn { display: none !important; }
  body { background: #FFFFFF; color: #1E1E20; }
  .main { margin: 0; padding: 0; }
  #wand .planner { display: block !important; page: wall; border: 0; }
  #wand .tlist { display: none !important; }
  .pl-head { position: static; }
  .rc-grid { grid-template-columns: minmax(0, 1fr); }
  .sign, .sgn, .disc, .sign-ring, .plate, .tag, .cell-in { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* embed mode (landing page demo): no prototype bar */
.is-embed .proto { display: none !important; }
.is-embed { --proto-h: 0px; }
