*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    /* Whatever the browser scrolls into view - a focused field, an anchor -
       stops below the shell's top bar, which stays at the top of the window
       (js/sidebar.js measures it). Without the shell there is no bar. */
    scroll-padding-top: var(--shell-top, 0px);
}

body {
    background: var(--surface-canvas);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    margin: 0;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    color: var(--text-strong);
    font-family: var(--font-display);
    font-weight: var(--type-heading-weight);
    letter-spacing: var(--tracking-snug);
    line-height: var(--leading-tight);
    margin: 0;
}

h1:focus {
    outline: none;
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

::selection {
    background: var(--amber-400);
    color: var(--navy-900);
}

/* ==== Shared UI primitives (used across pages) ============================ */

/* Between the top bar and a page's first content stands the content area's
   padding and nothing else: whatever a page opens with - a paragraph, a
   filter bar - brings no margin of its own above it. */
main.content > :first-child {
    margin-top: 0;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.page-head h1 {
    font-size: var(--text-xl);
}

.eyebrow {
    color: var(--amber-600);
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-eyebrow);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 16px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    display: inline-block;
    transition: background-color var(--duration-fast) var(--ease-standard);
}

.btn-primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btn-secondary {
    background: transparent;
    color: var(--text-strong);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 9px 16px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    cursor: pointer;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--surface-sunken);
    text-decoration: none;
}

.btn-secondary:disabled {
    background: transparent;
    cursor: default;
    opacity: 0.6;
}

/* The quiet button beside a primary one: "Abbrechen", "Schließen". */
.btn-ghost {
    background: none;
    border: 0;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 10px 14px;
}

.btn-ghost:hover {
    background: var(--surface-sunken);
}

.btn-ghost:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* The one button for what cannot be taken back - ending an engagement, taking
   a person off a project; always behind a question. Its red is dark enough
   for white words (danger-500 would give 3.9:1). */
.btn-danger {
    background: var(--danger-600);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 10px 16px;
}

.btn-danger:hover {
    background: var(--danger-text);
}

.btn-danger:disabled {
    cursor: default;
    opacity: 0.6;
}

.btn-small {
    font-size: var(--text-xs);
    padding: 6px 10px;
}

/* Stat tiles: a number in the display weight with its caption, tinted by tone;
   the start page and the readiness page share them. */
.start-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.start-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-strong);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 14rem;
    padding: var(--space-5) var(--space-6);
    text-decoration: none;
}

.start-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.start-card-number {
    color: var(--text-strong);
    font-size: var(--text-3xl);
    font-weight: var(--type-display-weight);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.start-card-number.ok { color: var(--success-text); }
.start-card-number.warning { color: var(--warning-text); }
.start-card-number.danger { color: var(--danger-text); }
.start-card-number.info { color: var(--navy-700); }

.start-card-caption {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.start-card .badge {
    align-self: flex-start;
    margin-top: var(--space-2);
}

/* A number that opens its detail: styled as the link it behaves like. */
.btn-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.readiness {
    margin-top: 4px;
}

/* The contact block of a project, opened beneath its row. Built for a phone
   in a hand on a site: entries wrap, and every call or mail action is a tap
   target of at least 44px in both directions. */
.row-detail td {
    background: var(--surface-sunken);
    padding: var(--space-3) var(--space-4);
}

.contacts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-8);
}

.contacts-group {
    min-width: 14rem;
    flex: 1 1 14rem;
}

.contacts-heading {
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 var(--space-2);
}

.contacts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) var(--space-3);
    padding: var(--space-1) 0;
}

.contact-who {
    display: flex;
    flex-direction: column;
    min-width: 10rem;
}

.contact-name {
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
}

.contact-company {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.contact-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    color: var(--text-strong);
    font-size: var(--text-sm);
    text-decoration: none;
    white-space: nowrap;
}

.contact-action:hover {
    background: var(--surface-sunken);
}

.contact-none {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

a.btn-primary,
a.btn-secondary {
    text-decoration: none;
}

/* The status pill, the design's signature: a soft fill in the tone's color
   and, for the three states plus "in review", the tone's glyph in a small
   solid circle before the text - check, exclamation, cross, ellipsis.
   Neutral badges carry no glyph; a badge that names a category rather than a
   state (badge-plain) drops it too. */
.badge {
    align-items: center;
    border-radius: var(--radius-pill);
    display: inline-flex;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    gap: 6px;
    letter-spacing: var(--tracking-snug);
    line-height: 1.25;
    padding: 3px 10px;
    white-space: nowrap;
}

.badge-pending,
.badge-accepted,
.badge-info,
.badge-danger {
    padding-left: 6px;
}

.badge-pending::before,
.badge-accepted::before,
.badge-info::before,
.badge-danger::before {
    align-items: center;
    border-radius: 50%;
    color: var(--white);
    display: inline-flex;
    flex: none;
    font-size: var(--text-2xs);
    font-weight: var(--fw-bold);
    height: 15px;
    justify-content: center;
    line-height: 1;
    width: 15px;
}

.badge-pending {
    background: var(--warning-100);
    color: var(--warning-text);
}

.badge-pending::before {
    background: var(--warning-500);
    content: "!";
}

.badge-accepted {
    background: var(--success-100);
    color: var(--success-text);
}

.badge-accepted::before {
    background: var(--success-500);
    content: "\2713";
}

.badge-info {
    background: var(--info-100);
    color: var(--info-text);
}

.badge-info::before {
    background: var(--info-500);
    content: "\22EF";
}

.badge-danger {
    background: var(--danger-100);
    color: var(--danger-text);
}

.badge-danger::before {
    background: var(--danger-500);
    content: "\2715";
}

.badge-neutral,
.badge-revoked {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-plain {
    padding-left: 10px;
}

.badge-plain::before {
    content: none;
}

/* "Neu" beside a project the firm's administration has not opened yet (NP,
   N1): a small amber pill in capitals, set off from the status badges. */
.new-marker {
    background: var(--amber-500);
    border-radius: var(--radius-pill);
    color: var(--navy-900);
    display: inline-block;
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .06em;
    line-height: 1.4;
    margin-left: var(--space-2);
    padding: 2px 8px;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

/* ==== Auswahlfelder =====================================================
   Every select the app draws, dialogs included: the design system's field
   with its own chevron. The browser's native control wears the operating
   system, which is the one look a design system may not borrow - so the
   native arrow goes and a drawn one takes its place. */
select {
    appearance: none;
    background-color: var(--surface-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7484' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: 1.3;
    padding: 7px 28px 7px 10px;
}

select:hover:not(:disabled) {
    border-color: var(--border-strong);
}

select:focus-visible {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--ring);
    outline: none;
}

select:disabled {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ==== Native controls the app does not draw itself ======================
   A textarea, a number field, a text, phone, e-mail, web address, password or
   date field, a checkbox, a radio, a file picker and a search box that carry no
   class of their own wear the design's dress instead of the browser's. Everything here
   is wrapped in :where(), so it weighs nothing: a dialog's field rule, a
   component's own class, any later rule wins over it. */
:root {
    accent-color: var(--navy-900);
}

/* A text, phone, e-mail, web address, password or date field without a class
   of its own; the marks an EditForm sets on its inputs (valid, invalid,
   modified) are no class of the field's. A field with a class - the date
   field, the catalog's position, the sign-in, the searches - is drawn by that
   class alone. Border, radius, padding and height are a dialog's field
   (INGO-301): the browser keeps its line height, and 9 px above and below
   make the field as tall as one in "Person hinzufügen". */
:where(input:is(:not([type]), [type="text"], [type="tel"], [type="email"], [type="url"], [type="password"], [type="date"]):is(:not([class]), [class=""], [class="valid"], [class="invalid"], [class="modified valid"], [class="modified invalid"])) {
    background-color: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    padding: 9px 10px;
}

:where(input:is(:not([type]), [type="text"], [type="tel"], [type="email"], [type="url"], [type="password"], [type="date"]):is(:not([class]), [class=""], [class="valid"], [class="invalid"], [class="modified valid"], [class="modified invalid"])):where(:hover:not(:disabled)) {
    border-color: var(--border-strong);
}

:where(input:is(:not([type]), [type="text"], [type="tel"], [type="email"], [type="url"], [type="password"], [type="date"]):is(:not([class]), [class=""], [class="valid"], [class="invalid"], [class="modified valid"], [class="modified invalid"])):where(:focus-visible) {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--ring);
    outline: none;
}

:where(input:is(:not([type]), [type="text"], [type="tel"], [type="email"], [type="url"], [type="password"], [type="date"]):is(:not([class]), [class=""], [class="valid"], [class="invalid"], [class="modified valid"], [class="modified invalid"])):where(:disabled) {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    cursor: not-allowed;
}

:where(textarea, input[type="number"]) {
    background-color: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: 1.3;
    padding: 7px 10px;
}

:where(textarea) {
    min-height: 4.5rem;
    resize: vertical;
}

:where(textarea, input[type="number"]):where(:hover:not(:disabled)) {
    border-color: var(--border-strong);
}

:where(textarea, input[type="number"]):where(:focus-visible) {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--ring);
    outline: none;
}

:where(textarea, input[type="number"]):where(:disabled) {
    background-color: var(--surface-sunken);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* The stepper arrows are the operating system's; the field is typed into. */
:where(input[type="number"]) {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

:where(input[type="checkbox"], input[type="radio"]):where(:focus-visible) {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* The file picker's button in the secondary button's dress; what it says
   ("Choose file") is the browser's language and stays so. */
:where(input[type="file"]) {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    max-width: 100%;
}

:where(input[type="file"])::file-selector-button {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    cursor: pointer;
    font: inherit;
    font-weight: var(--fw-medium);
    margin-right: var(--space-3);
    padding: 7px 14px;
}

:where(input[type="file"])::file-selector-button:hover {
    background: var(--surface-sunken);
}

:where(input[type="file"]:disabled)::file-selector-button {
    cursor: not-allowed;
    opacity: 0.6;
}

/* A search box is a field like the others: no system chrome of its own, and
   its clear button drawn like the select's chevron. */
:where(input[type="search"]) {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7484' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
    cursor: pointer;
    height: 18px;
    margin-left: var(--space-1);
    width: 18px;
}

/* A name and the badge that qualifies it, on one line with a gap between
   them - Razor eats the whitespace between an expression and the block
   after it, so the space has to be laid out, not typed. */
.cell-line {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* The card a list sits in, and the one thing that may move sideways. A
   list wider than its place scrolls here; the page behind it stays where
   it is. The edge belongs to this box rather than to the table, so the
   rounding travels with what scrolls. */
.table-scroll {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    overflow-x: auto;
}

/* A list in a card that runs it to its edges (the company profile's tabs):
   the card draws the edge, so the list draws none of its own. */
.panel-flush > .table-scroll {
    border: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: none;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: var(--fw-semibold);
    padding: 10px var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.table-scroll .data-table th {
    white-space: nowrap;
}

/* A header that sorts is a th that can be pressed. It keeps the padding the
   table (or the page's own rule) gives it, so it takes no more room than a
   plain header does: the arrow stands in the cell's right-hand padding, and
   an overlay makes the whole cell the thing to click and to focus. The arrow
   is faint until the header is hovered or focused, and full once the list
   stands in that order. */
.data-table th.sortable {
    position: relative;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: inherit;
    color: inherit;
    cursor: pointer;
}

.sort-button::after {
    content: "";
    position: absolute;
    inset: 0;
}

.sort-button:focus-visible {
    outline: none;
}

.sort-button:focus-visible::after {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

.sort-button:hover {
    color: var(--text-strong);
}

.sort-mark {
    position: absolute;
    top: 50%;
    right: 2px;
    display: inline-flex;
    transform: translateY(-50%);
    opacity: 0.4;
}

.sort-button:hover .sort-mark,
.sort-button:focus-visible .sort-mark {
    opacity: 0.9;
}

.data-table th[aria-sort] .sort-button {
    color: var(--text-strong);
}

.data-table th[aria-sort] .sort-mark {
    opacity: 1;
}

/* Where a list stands as cards there is no header to press, so the same
   choice is a field - and only there. */
.sort-picker {
    display: none;
    align-items: flex-end;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.sort-picker-field {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-2xs);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}

.sort-picker-field select {
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
}

@media (max-width: 40rem) {
    .sort-picker {
        display: flex;
    }
}

/* Said to a screen reader, never drawn. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* A white card on the canvas and a label/value list inside it. Pages set these
   classes themselves, so the base lives here; a component that draws them
   differently - the company profile's three columns of facts - keeps its
   variant beside its markup. */
.panel {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5) var(--space-6);
}

.panel .data-table {
    border: none;
    box-shadow: none;
}

.panel-title {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    margin: 0 0 14px;
}

.facts {
    display: grid;
    gap: var(--space-2) var(--space-5);
    grid-template-columns: max-content 1fr;
    margin: 0;
}

.facts dt {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.facts dd {
    color: var(--text-strong);
    font-size: var(--text-sm);
    margin: 0;
}

.facts dd .cell-sub {
    display: block;
}

@media (max-width: 40rem) {
    .panel {
        padding: var(--space-4);
    }

    .facts {
        gap: 4px;
        grid-template-columns: minmax(0, 1fr);
    }

    .facts dt:not(:first-child) {
        margin-top: 12px;
    }

    .facts dd {
        overflow-wrap: anywhere;
    }
}

/* The tuple of an evidence as DS31 draws it - the review mask (U5) and the view a due row opens (G12): the
   name to the left, the value strong to the right, a line between the rows. Shared, so the list's own rows
   (EvidenceFacts) and the rows a page adds to it read alike. */
.review-tuple {
    column-gap: 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 0;
    row-gap: 0;
}

.review-tuple > dt,
.review-tuple > dd {
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--text-sm);
    margin: 0;
    padding: 8px 0;
}

.review-tuple > dt {
    color: var(--text-muted);
    font-weight: var(--fw-regular);
    padding-right: 12px;
}

.review-tuple > dd {
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-weight: var(--fw-semibold);
    overflow-wrap: anywhere;
    text-align: right;
}

.review-tuple > dt:last-of-type,
.review-tuple > dd:last-of-type {
    border-bottom: 0;
}

.review-tuple > dd p {
    font-size: var(--text-xs);
    font-weight: var(--fw-regular);
    margin: 4px 0 0;
}

/* Under 640 px a list may stand as cards instead of a table: the same
   rows, with what matters in the first line rather than beyond the
   window's edge. The table and the cards are both rendered; the window
   decides which one shows, so nothing is measured in the circuit. A list
   without a card template has no .card-list and stays a table. */
.card-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 40rem) {
    .paged-list-cards > .table-scroll {
        display: none;
    }

    .paged-list-cards > .card-list {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }
}

/* One card, whatever element carries it: a link or a button where the row
   is the way in, a plain box where the actions sit inside. The whole card
   is the surface to tap, so it is never shorter than a finger. */
.list-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    box-sizing: border-box;
    display: block;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    width: 100%;
}

a.list-card,
button.list-card {
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

a.list-card:hover,
button.list-card:hover {
    background: var(--gray-50);
    border-color: var(--border-default);
}

/* Name and status share the first line; what qualifies them follows in
   smaller type. Spans, because a button may hold nothing else. */
.list-card-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: space-between;
}

.list-card-title {
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
}

.list-card-sub {
    color: var(--text-muted);
    display: block;
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

.list-card-meta {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--text-xs);
    gap: var(--space-1) var(--space-3);
    margin-top: var(--space-2);
}

.list-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.card-group {
    color: var(--text-muted);
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-eyebrow);
    padding: var(--space-2) var(--space-1) 0;
    text-transform: uppercase;
}

.card-list-empty {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

/* Search, whatever the page puts beside it, and the count. On a narrow
   screen they stand under one another rather than pushing the page out:
   the count keeps its own line, which is the only thing it needs. */
.search-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: 14px;
}

.search-input {
    flex: 0 1 220px;
    min-width: 12rem;
    padding: 8px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
}

.search-input:focus {
    outline: none;
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px var(--ring);
}

/* A longer placeholder ("Unternehmen oder Ort suchen") needs more room than the default field. */
.search-wide .search-input {
    flex-basis: 16.5rem;
}

@media (max-width: 640px) {
    .search-row .search-input {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }
}

.empty-note {
    color: var(--text-muted);
    max-width: 46rem;
}

.cell-strong {
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
}

.cell-sub {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.cell-mono {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.type-tag {
    background: var(--surface-sunken);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: var(--text-2xs);
    font-weight: var(--fw-medium);
    margin-left: var(--space-1);
    padding: 1px 8px;
    vertical-align: middle;
}

/* Modal - always centered in the viewport, never top-docked. A dialog is
   drawn where it is opened - in a table cell, in a row's menu - and would
   inherit that place's wrapping, alignment and type; it starts from the
   page's own text values instead, so it reads the same wherever it opens. */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 22, 31, 0.45);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    color: var(--text-body);
    cursor: auto;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-style: normal;
    font-weight: var(--fw-regular);
    letter-spacing: normal;
    line-height: var(--leading-normal);
    text-align: left;
    text-transform: none;
    white-space: normal;
}

/* A dialog comes in three widths: a question, a form, a form whose fields stand side by side. The numbers
   live here, so a dialog that sets its width from its own stylesheet names one of them; only a layout of
   its own - the review mask, the signature sheet - brings another. */
:root {
    --modal-narrow: 480px;
    --modal-form: 560px;
    --modal-wide: 720px;
}

.modal {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    max-width: var(--modal-form);
    padding: var(--space-6);
}

.modal-narrow {
    max-width: var(--modal-narrow);
}

.modal-wide {
    max-width: var(--modal-wide);
}

/* On a phone the dialog takes the window's width: a gutter of a few pixels,
   and nothing inside it wider than the window. */
@media (max-width: 40rem) {
    .overlay {
        padding: 12px 8px;
    }

    .modal {
        padding: var(--space-4);
    }

    .modal .table-scroll,
    .modal .data-table {
        max-width: 100%;
    }
}

/* A row that is the way into what it names says so under the pointer. The
   controls inside keep their own cursor and stop the click themselves. */
.row-link {
    cursor: pointer;
}

.row-link:hover {
    background: var(--gray-50);
}

/* An evidence row is a click target (E-227): its name is the keyboard's way
   to the view the row opens, and reads as the name, not as a link. */
.evidence-name {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: inherit;
    padding: 0;
    text-align: left;
}

.evidence-name:hover:not(:disabled) {
    text-decoration: underline;
}

.evidence-name:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* A box with a document beside its facts - the review mask, a change
   request with its proof - needs the room. */
.modal-review {
    max-width: 1200px;
}

/* The review mask (U5): the box does not scroll as a whole; its head stays,
   over a border, and the two columns scroll each by themselves
   (EvidenceReviewDialog.razor.css). Narrow windows stack the columns and the
   box scrolls again. Only the mask carries this class: the change request's
   box keeps the padding and the scrolling every dialog has. */
.modal-review-mask {
    display: flex;
    flex-direction: column;
    height: 90vh;
    overflow: hidden;
    padding: 0;
}

.modal-review-mask > .modal-head,
.modal-review-step > .modal-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--border-subtle);
    flex: none;
    gap: var(--space-4);
    margin: 0;
    padding: 18px 26px;
}

.modal-review-mask > .modal-head h2 {
    color: var(--text-strong);
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    margin: 0;
}

/* A dialog over the mask (U5 "Eingeschränkt freigeben"): the same head, its body padded by the dialog. */
.modal-review-step {
    padding: 0;
}

.modal-review-step > .modal-head {
    padding: 20px 26px;
}

.modal-review-step > .modal-head h2 {
    color: var(--text-strong);
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    margin: 0;
}

/* The reports dialog (U11-NEU): the kit's box - its head, a step band, a body that scrolls by itself and a foot
   that stays (ReportDialog.razor.css). */
.modal-report {
    display: flex;
    flex-direction: column;
    height: min(780px, 90vh);
    max-width: var(--modal-wide);
    overflow: hidden;
    padding: 0;
}

.modal-report > .modal-head {
    align-items: flex-start;
    flex: none;
    gap: 14px;
    margin: 0;
    padding: 20px 26px 16px;
}

.modal-report > .modal-head h2 {
    color: var(--text-strong);
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    margin: 0;
}

/* A title with something on its own line, such as the purpose label of a report template. */
.modal-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* The view a due row opens (G12 "Tupel"): a narrow box, its head over a line, the tuple's rows beneath and
   the row's functions under them - the head's close is the way out. */
.modal-tuple {
    max-width: var(--modal-narrow);
    padding: 0;
}

.modal-tuple > .modal-head {
    border-bottom: 1px solid var(--border-subtle);
    margin: 0;
    padding: 18px 22px;
}

.modal-tuple > .modal-head h2 {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.modal-tuple .evidence-view {
    padding: 18px 22px;
}

.modal-tuple .modal-actions {
    margin-top: 14px;
}

.modal-titles {
    min-width: 0;
}

.modal-head-aside {
    align-items: center;
    display: flex;
    flex: none;
    gap: 14px;
}

@media (max-width: 1200px) {
    .modal-review-mask {
        height: auto;
        overflow-y: auto;
    }
}

/* The dialog holds the focus while it is open, so Escape reaches it; the
   ring stays on the controls inside, not on the box. */
.modal:focus {
    outline: none;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.modal-head h2 {
    font-size: var(--text-md);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 3px 0 0;
}

/* A title with a line of text under it (ModalSubtitle): the close button stands at its top, clear of the line. */
.modal-head:has(> .modal-titles > .modal-subtitle) {
    align-items: flex-start;
}

.modal-titles:has(> .modal-subtitle) {
    flex: 1;
    padding-right: var(--space-3);
}

/* A dialog as the design system draws one (U15-NEU, U16): the head and the foot each on a rule across the
   whole box, the content between them. Opt in with CssClass="modal-ruled"; dialogs with a head and foot
   of their own (review mask, Person hinzufügen, project form) keep theirs. */
.modal.modal-ruled {
    padding: 0 22px;
}

.modal-ruled > .modal-head {
    border-bottom: 1px solid var(--border-subtle);
    margin: 0 -22px 18px;
    padding: 18px 22px;
}

.modal-ruled > .modal-head h2 {
    color: var(--text-strong);
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.modal-ruled > .modal-actions {
    border-top: 1px solid var(--border-subtle);
    margin: 18px -22px 0;
    padding: 14px 22px;
}

/* A ruled dialog without a foot still ends with room below its content. */
.modal-ruled > :last-child:not(.modal-actions) {
    margin-bottom: 22px;
}

/* A field of a dialog that is not one input - a row of choice chips - with its label above it. */
.modal-field {
    margin-bottom: var(--space-4);
}

.modal-field-label {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    margin-bottom: 7px;
}

/* What a field means, after its label in the label's line ("Gruppe – fasst … zusammen"). */
.modal-label-hint {
    color: var(--text-subtle);
    font-weight: var(--fw-regular);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-base);
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
}

.modal-intro {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-4);
}

.modal-section {
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    margin: var(--space-5) 0 var(--space-3);
}

.modal label,
.settings-section label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    margin-bottom: var(--space-4);
}

/* A radio is a choice laid out in a row beside its text, never a field: the
   :where() keeps these selectors as heavy as they were. */
.modal input:not([type="checkbox"]):where(:not([type="radio"])),
.modal select,
.modal textarea,
.settings-section input:where(:not([type="radio"])),
.settings-section textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: var(--space-1);
    padding: 9px 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    /* The colour only - the shorthand would drop the chevron the select
       draws for itself. */
    background-color: var(--surface-card);
}

.modal select {
    padding-right: 28px;
}

.modal textarea,
.settings-section textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.settings-section input:focus,
.settings-section textarea:focus {
    outline: none;
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px var(--ring);
}

/* A checkbox or radio has no field around it to ring: it takes the focus as
   an outline, and only when the keyboard put it there. */
.modal input:is([type="checkbox"], [type="radio"]):focus,
.settings-section input:is([type="checkbox"], [type="radio"]):focus {
    box-shadow: none;
}

.modal input:is([type="checkbox"], [type="radio"]):focus-visible,
.settings-section input:is([type="checkbox"], [type="radio"]):focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* A section of the settings page: the dialog's fields, side by side where
   the window allows. */
.settings-section {
    margin-bottom: var(--space-6);
}

.settings-fields {
    display: grid;
    gap: 0 var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* A count of days or the like needs no full row. */
.settings-section input[type="number"] {
    max-width: 220px;
}

.checkbox-label {
    align-items: center;
    display: flex;
    font-weight: var(--fw-regular);
    gap: var(--space-2);
}

.modal-error {
    color: var(--danger-text);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3);
}

/* An error line inside a row of controls: a line of its own, no margin. */
.modal-error-inline {
    flex-basis: 100%;
    margin: 0;
}

.modal-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3);
}

/* The same note standing on the canvas itself, over a page's cards, takes the canvas's darker grey. */
.content > .modal-note {
    color: var(--text-on-canvas-muted);
}

/* Why the document a form replaces was rejected, in a red box over the form (DS31 NF). */
.modal-refusal {
    background: var(--danger-100);
    border-radius: var(--radius-md);
    color: var(--text-strong);
    font-size: var(--text-sm);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
    padding: 10px 12px;
}

/* Where a date's rule comes from, beside the field it governs ("Gültig bis", INGO-409). */
.field-hint {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: normal;
}

/* A question that says what an action does, in blocks rather than one run of
   text (E-233): the lead sentence, the firms concerned in a grey box, what
   follows - lost (x) or kept (check) - and, where it cannot be undone, the
   warning in red above the buttons. */
.dialog-lead {
    color: var(--text-body);
    font-size: var(--text-sm);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
}

.dialog-heading {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--space-2);
}

.dialog-box {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
}

.dialog-box-list,
.dialog-effects {
    display: flex;
    flex-direction: column;
    font-size: var(--text-sm);
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.dialog-effects {
    margin-bottom: var(--space-4);
}

.dialog-effect {
    align-items: flex-start;
    display: flex;
    gap: var(--space-2);
    line-height: 1.5;
}

.dialog-effect .icon {
    flex: none;
    margin-top: 2px;
}

.dialog-effect-lost .icon {
    color: var(--danger-500);
}

.dialog-effect-kept .icon {
    color: var(--success-500);
}

.dialog-list {
    font-size: var(--text-sm);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
    padding-left: 20px;
}

.dialog-warning {
    align-items: center;
    color: var(--danger-text);
    display: flex;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
}

.dialog-warning .icon {
    flex: none;
}

/* A caution or an empty-state line inside a panel, in the warning tone. In
   the global sheet because it is used by more than one component: a scoped
   rule reaches only the elements of the component that owns it. */
.panel-note {
    color: var(--warning-text);
    font-size: var(--text-sm);
    margin: 0;
}

/* When a site starts or runs out, in the design's chip (G1) - words in the
   sans face (ABWEICHUNGEN 499: mono is for codes, not for sentences), the
   digits in their own widths: tabular figures of this face stand so far
   apart that a date read as single digits. Phones keep the tabular figures
   they had. In the global sheet because the project list and the start
   page's alarms both draw it. */
.countdown {
    border-radius: var(--radius-sm);
    display: inline-block;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    padding: 4px 8px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .countdown {
        font-variant-numeric: tabular-nums;
    }
}

.countdown-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

.countdown-warning {
    background: var(--warning-100);
    color: var(--warning-text);
}

.countdown-danger {
    background: var(--danger-100);
    color: var(--danger-text);
}

/* The two ways a dialog can offer: keep it yourself, or invite whoever it is
   about to keep it themselves. Shared, because every add dialog asks it. */
/* "Anlegen · Einladen" at the top of the add dialogs (DS27 G4, G8). */
.add-mode { margin-bottom: var(--space-2); }
.add-mode-note { margin: 0 0 var(--space-4); }

.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* Three ways in rather than two: the same cards, one column more, and on a
   narrow screen they stack like everything else. */
.choice-cards-three {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.choice-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    position: relative;
}

.choice-card h3 {
    font-size: var(--text-lg);
    font-weight: var(--fw-medium);
    margin: 0;
}

/* The way's sign in a quiet circle over its title (G4, G8). */
.choice-icon {
    align-items: center;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
    display: inline-flex;
    height: 56px;
    justify-content: center;
    width: 56px;
}

/* A way's one button spans the card. */
.choice-card > .btn-primary,
.choice-card > .btn-secondary,
.choice-card > button {
    width: 100%;
}

.choice-card p {
    color: var(--text-muted);
    flex: 1;
    font-size: var(--text-sm);
    margin: 0;
}

/* The recommended way: the same white card, marked by its amber edge and the dark badge on it. */
.choice-card-primary {
    border: 2px solid var(--amber-400);
}

.choice-badge {
    background: var(--navy-900);
    border-radius: var(--radius-pill);
    color: var(--amber-300);
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    left: var(--space-5);
    letter-spacing: 0.06em;
    padding: 4px 12px;
    position: absolute;
    text-transform: uppercase;
    top: -12px;
}

@media (max-width: 40rem) {
    .choice-cards {
        grid-template-columns: 1fr;
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.toast {
    background: var(--navy-900);
    border-radius: var(--radius-md);
    bottom: var(--space-6);
    box-shadow: var(--shadow-lg);
    color: var(--text-on-dark);
    font-size: var(--text-sm);
    left: 50%;
    padding: 10px 18px;
    position: fixed;
    transform: translateX(-50%);
    z-index: var(--z-modal);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-500);
}

.invalid {
    outline: 1px solid var(--danger-500);
}

.validation-message {
    color: var(--danger-text);
}

.blazor-error-boundary {
    background: var(--danger-600);
    border-radius: var(--radius-sm);
    color: var(--white);
    padding: 1rem;
}

    .blazor-error-boundary::after {
        content: "Ein Fehler ist aufgetreten."
    }

/* The trade of a firm, chosen in its row: the field of the design system at
   list size, and capped, so a long trade name cannot take the width the
   firm's own name needs. The firm's answer on own employees sits beside it alike. */
.trade-select, .own-employees-select {
    background-position: right 5px center;
    font-size: var(--text-xs);
    max-width: 9.5rem;
    padding: 4px 22px 4px 8px;
}

/* A set row's conditions on their own line under its name (V228): "nur Sitz Polen, nur entsandt". */
.catalog-conditions {
    display: block;
    font-size: var(--text-xs);
}

.pager {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* "Seite 1 von 28": the digits in their own widths, as in the chips; phones keep the tabular figures they had. */
.pager-position {
    color: var(--text-on-canvas-muted);
    font-size: var(--text-xs);
}

@media (max-width: 640px) {
    .pager-position {
        font-variant-numeric: tabular-nums;
    }
}

/* The pager under a list (E-261): "‹ Seite x von y ›" in the middle, the
   page size at the right. An arrow that has nowhere to go leaves its place
   empty, so the words do not move when it goes. */
.paged-pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.paged-pager .pager-nav {
    align-items: center;
    display: flex;
    gap: var(--space-3);
    grid-column: 2;
}

.paged-pager .pager-size {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
}

.pager-step,
.pager-step-gap {
    min-width: 32px;
}

/* A list that stands on one page at the size it started with has nothing to turn and nothing to resize: at the
   desk the pager, which then holds only "je Seite", is left out under it. A size the reader picked keeps it in
   view, and so does a second page. Phones keep the field they had. */
@media (min-width: 641px) {
    .paged-pager[data-single-page] {
        display: none;
    }
}

.pager-step {
    font-size: var(--text-sm);
    line-height: 1;
    padding-inline: 0;
}

.pager-step-gap {
    display: inline-block;
}

/* The list's filters, followed by its search. Page-level actions may have
   their own row above this one; controls inside the filter row wrap together. */
.hero-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.hero-row .segments {
    margin-bottom: 0;
}

/* A row's action in words - "Zu den Firmendetails", "Pausieren" - in the
   link colour, never a framed button inside a table row. */
.detail-link {
    background: none;
    border: none;
    color: var(--text-link);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}

.detail-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.detail-link:disabled {
    cursor: default;
    opacity: 0.6;
}

/* An entry of the account menu in the sidebar's foot. Global rather than
   scoped to the layout: entries that are NavLinks render their anchor in a
   child component, which the layout's scoped styles do not reach. */
.user-menu-item {
    border-radius: var(--radius-sm);
    color: var(--navy-200);
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--fw-medium);
    padding: 9px 12px;
    text-decoration: none;
    white-space: nowrap;
}

/* "Feedback abgeben" is a button among links and reads like them. */
button.user-menu-item {
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
    text-align: left;
    width: 100%;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
    background: rgb(255 255 255 / 6%);
    color: var(--text-on-dark);
    text-decoration: none;
}

/* The way into a row's details: an arrow at the row's end, no words. The
   whole row opens the same page; the arrow is its keyboard stop and names
   itself through its label. */
.row-arrow {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--text-subtle);
    display: inline-flex;
    justify-content: center;
    padding: 2px;
}

.row-link:hover .row-arrow,
.row-arrow:hover,
.row-arrow:focus-visible {
    color: var(--text-strong);
}

.hero-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-left: auto;
}

/* Beneath the hero: the search on the left, how many of how many on the right. */
.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: 14px;
}

.toolbar .search-row {
    flex: 1;
    margin-bottom: 0;
}

/* The filter row above a list: the pill group of segments on the left, any
   further filter on the right. */
.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

/* One pill group: the active segment is filled navy, the others sit quietly
   inside the same rounded container. */
.segments {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 4px;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

.filter-row .segments {
    margin-bottom: 0;
}

.segment {
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    color: var(--gray-600);
    cursor: pointer;
    flex: none;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 8px 16px;
    white-space: nowrap;
}

.segment:hover {
    color: var(--text-strong);
}

.segment-active,
.segment-active:hover {
    background: var(--navy-900);
    color: var(--white);
}

/* A count in a pill stands alone, never in a column: its digits take their own widths (ABWEICHUNGEN 540).
   Phones keep the tabular figures they had. */
.segment-count {
    margin-left: 2px;
}

@media (max-width: 640px) {
    .segment-count {
        font-variant-numeric: tabular-nums;
    }
}

.segment-filter {
    margin-left: auto;
}

/* A filter that switches on beside the segments and combines with them -
   "Einladung offen" in the contractor's firm list. */
.filter-chip {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    color: var(--gray-600);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    padding: 7px 15px;
    white-space: nowrap;
}

.filter-chip:hover {
    color: var(--text-strong);
}

.filter-chip-on,
.filter-chip-on:hover {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: var(--white);
}

/* Where a firm's invitation stands, in its row: registered, open since a day, or run out since one. */
.invitation-state {
    font-size: var(--text-xs);
    margin-right: var(--space-2);
}

.invitation-open {
    color: var(--warning-600);
    font-weight: var(--fw-semibold);
}

.invitation-expired {
    color: var(--danger-text);
    font-weight: var(--fw-semibold);
}

/* The principal's list has no invitation column: the state stands beneath the firm. */
.company-invitation-under {
    margin-top: var(--space-1);
}

/* A status dot before a name: the row's tone at a glance. */
.dot {
    border-radius: 50%;
    display: inline-block;
    flex: none;
    height: 7px;
    margin-right: 9px;
    vertical-align: middle;
    width: 7px;
}

.dot-ok { background: var(--success-500); }
.dot-warning { background: var(--warning-500); }
.dot-danger { background: var(--danger-500); }
.dot-neutral { background: var(--gray-300); }

/* A satisfied-over-required ratio: colored digits in mono, not a pill. */
.ratio {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ratio-ok { color: var(--success-text); }
.ratio-warning { color: var(--warning-text); }
.ratio-danger { color: var(--danger-text); }

/* A ratio with a tooltip behind it says so with a dotted line, as the design draws it. */
.ratio[title] {
    border-bottom: 1px dotted currentColor;
    cursor: help;
}

/* The empty state stays inside the table's card. */
.data-table .empty-row td {
    color: var(--text-muted);
    padding: 36px var(--space-4);
    text-align: center;
}

.data-table .empty-row .empty-note {
    margin: 0 auto;
}

/* A picker is one field (E-238): typing shows the hits beneath it, a click or
   Enter takes one. The hits float: wwwroot/js/picker.js places them fixed
   under the field, so they cover what follows instead of pushing it, and a
   dialog's scrolling box does not clip them. Inside a label they keep their
   own type, whatever the label's. */
.picker {
    min-width: 0;
    position: relative;
}

.picker-field {
    position: relative;
}

.picker input.picker-input {
    background-color: var(--surface-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7484' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-regular);
    letter-spacing: normal;
    padding: 8px 32px 8px 12px;
    text-overflow: ellipsis;
    text-transform: none;
    width: 100%;
}

/* With a choice that can go, the cross stands where the arrow stood. */
.picker input.picker-input[data-clearable] {
    background-image: none;
}

.picker input.picker-input:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px var(--ring);
    outline: none;
}

.picker input.picker-input::placeholder {
    color: var(--text-subtle);
}

/* Where the empty field is a choice of its own - "Alle Firmen", "Alle Projekte" over a list - it
   reads like the chosen option of the native selects beside it, not like a question. */
.picker input.picker-input[data-none-choice]::placeholder {
    color: var(--text-strong);
    opacity: 1;
}

.picker-clear {
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-xs);
    line-height: 1;
    padding: 6px;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.picker-clear:hover {
    background: var(--gray-100);
    color: var(--text-strong);
}

.picker-clear:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
}

.picker-panel {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: var(--fw-regular);
    letter-spacing: normal;
    max-height: 18rem;
    overflow-y: auto;
    padding: 4px 0;
    position: fixed;
    text-transform: none;
    z-index: calc(var(--z-modal) + 1);
}

.picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.picker-option {
    cursor: pointer;
    overflow-wrap: anywhere;
    padding: 8px 12px;
}

.picker-option:hover,
.picker-option.active {
    background: var(--gray-50);
}

.picker-option.chosen {
    font-weight: var(--fw-semibold);
}

.picker-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: 0;
    padding: 8px 12px;
}

.picker-more {
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
}

/* The calendar of a date field (date-field.js, E-271): "‹ [Monat ▾] [Jahr ▾] ›",
   the days Monday to Sunday, "Heute" beneath - the app's own in every
   browser. It stands fixed over what follows the field, as the picker's hits
   do; the script places it. Made by the script, it carries no scope of the
   field's own stylesheet, so it is drawn here, and held heavier than the
   rules a dialog or a form lays on its selects and buttons. */
.date-field-box .date-calendar {
    position: fixed;
    z-index: calc(var(--z-modal) + 1);
    box-sizing: border-box;
    width: 288px;
    padding: 10px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-strong);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--fw-regular);
    letter-spacing: normal;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    white-space: normal;
}

.date-calendar .date-calendar-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 84px 32px;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.date-calendar .date-calendar-head select {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 6px 24px 6px 8px;
    background-position: right 6px center;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
}

.date-calendar button.date-calendar-step,
.date-calendar button.date-calendar-day,
.date-calendar button.date-calendar-today {
    appearance: none;
    box-sizing: border-box;
    margin: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-strong);
    font: inherit;
    cursor: pointer;
}

.date-calendar button.date-calendar-step {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: var(--text-lg);
    line-height: 1;
}

.date-calendar button.date-calendar-step:hover:not(:disabled),
.date-calendar button.date-calendar-day:hover,
.date-calendar button.date-calendar-today:hover {
    background: var(--gray-100);
}

.date-calendar button.date-calendar-step:disabled {
    color: var(--text-subtle);
    cursor: default;
}

.date-calendar .date-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.date-calendar .date-calendar-weekdays {
    color: var(--text-muted);
    font-size: var(--text-2xs);
    font-weight: var(--fw-medium);
    text-align: center;
    padding-bottom: 4px;
}

.date-calendar button.date-calendar-day {
    display: block;
    width: 100%;
    height: 34px;
    padding: 0;
    text-align: center;
}

/* Today is ringed, the day in the field filled in the accent. */
.date-calendar button.date-calendar-day.today {
    box-shadow: inset 0 0 0 1px var(--border-strong);
    font-weight: var(--fw-semibold);
}

/* A day before the field's earliest is greyed and takes no press (E-315). */
.date-calendar button.date-calendar-day.before-min,
.date-calendar button.date-calendar-day.before-min:hover {
    background: transparent;
    color: var(--text-subtle);
    cursor: default;
}

.date-calendar button.date-calendar-today:disabled {
    color: var(--text-subtle);
    background: transparent;
    cursor: default;
}

.date-calendar button.date-calendar-day.chosen,
.date-calendar button.date-calendar-day.chosen:hover {
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: var(--fw-semibold);
}

.date-calendar button:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
}

.date-calendar .date-calendar-foot {
    display: flex;
    justify-content: flex-start;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

.date-calendar button.date-calendar-today {
    padding: 6px 10px;
    color: var(--text-link);
    font-weight: var(--fw-medium);
}

/* On a phone the lists keep the size that does not zoom the page when one opens. */
@media (max-width: 640px) {
    .date-field-box .date-calendar {
        width: min(320px, calc(100vw - 16px));
    }

    .date-calendar .date-calendar-head select {
        font-size: 16px;
        padding-right: 22px;
    }

    .date-calendar button.date-calendar-day {
        height: 40px;
    }
}

/* A picker that filters a list stands in the filter row like the search beside it. */
.filter-row .picker {
    flex: 0 1 260px;
    min-width: 12rem;
}

.pager-size {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-on-canvas-muted);
    font-size: var(--text-xs);
}

/* Which commit is running, in the corner where nobody looks until they need it. */
footer.version {
    margin-top: 2rem;
    padding: 0.5rem 1.5rem;
    font-size: var(--text-xs);
    color: var(--text-on-canvas-muted);
    text-align: right;
}

/* Rights overview: roles across, capabilities down, a dot where the role carries it. */
.role-matrix-role,
.role-matrix-cell {
    text-align: center;
}

.role-matrix td .cell-sub {
    display: block;
}

.role-matrix-granted {
    color: var(--accent);
    font-size: var(--text-md);
}

.role-matrix-absent {
    color: var(--text-muted);
}

/* The bell beside the search: the way to the inbox, with the unread count as a
   pill - the sidebar's counter in small (gold, navy mono digits), ringed in
   the bar's white so it stands clear of the glyph (E-164 (4)). */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    text-decoration: none;
}

.topbar-bell:hover {
    background: var(--gray-100);
    color: var(--text-strong);
    text-decoration: none;
}

.topbar-bell-count {
    position: absolute;
    top: 1px;
    right: 0;
    box-sizing: border-box;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 1.5px solid var(--surface-card);
    border-radius: var(--radius-pill);
    background: var(--amber-500);
    color: var(--navy-900);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    line-height: 13px;
    text-align: center;
    pointer-events: none;
}

/* At the desk the pill hangs on the bell's upper right corner and grows away
   from it: held at its left edge, a "99+" stands beside the glyph and no
   longer lies across it. */
@media (min-width: 641px) {
    .topbar-bell-count {
        left: 19px;
        right: auto;
        top: -2px;
    }
}

/* Where the bar has only its narrow gutter, the bell steps in from the window's
   edge by what its number hangs over, so the pill does not touch the edge. */
@media (min-width: 641px) and (max-width: 48rem) {
    .topbar-bell:has(.topbar-bell-count) {
        margin-right: 10px;
    }
}

/* The phone keeps its header as it was: the badge's digits at 10px - off the scale on purpose. */
@media (max-width: 640px) {
    .topbar-bell-count {
        font-size: 10px;
    }
}


/* The notification rules: a kind's lead times stand one under the other,
   each a short number beside its name; a rule that deviates from the
   operator's default says so under the kind. */
/* U19: lead times as chips holding their days. */
.rule-lead-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-lead-chip {
    align-items: center; background: var(--gray-100); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
    color: var(--text-muted); display: inline-flex; font-size: var(--text-xs); gap: 4px; padding: 2px 10px 2px 4px;
}
.rule-days {
    background: transparent; border: none; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--fw-semibold);
    color: var(--text-strong); text-align: right; width: 3.2rem;
}
.rule-days:focus { outline: 2px solid var(--ring); border-radius: var(--radius-sm); box-shadow: none; }
/* A yes/no that takes effect at once, drawn as the design's switch. */
input[type="checkbox"].toggle {
    appearance: none; background: var(--gray-300); border-radius: var(--radius-pill); cursor: pointer; height: 22px; margin: 0;
    position: relative; transition: background 0.15s; width: 40px;
}
input[type="checkbox"].toggle::after {
    background: var(--white); border-radius: 50%; box-shadow: var(--shadow-sm); content: ""; height: 18px; left: 2px;
    position: absolute; top: 2px; transition: transform 0.15s; width: 18px;
}
input[type="checkbox"].toggle:checked { background: var(--success-500); }
input[type="checkbox"].toggle:checked::after { transform: translateX(18px); }
input[type="checkbox"].toggle:disabled { cursor: default; opacity: 0.6; }
input[type="checkbox"].toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.rule-reset { white-space: nowrap; }


/* The site channel: the Bauleitung's shell and its screens.

   Built for a phone held at a gate - 390px wide, one column, nothing that
   needs a second hand. Every tappable thing is at least 44px high and no
   type falls under 11px; both are audit fixes the B kit carries (S-02,
   S-15) and both are cheaper to keep than to retrofit. Colours, spacing and
   type come from the tokens, never as literals. */

/* The screen is fixed and only its middle scrolls, the way the kit builds
   the phone: the bar that says where you are and the bar that takes you
   somewhere else both have to stay put. A tab bar you scroll to is not a
   tab bar. */
.site-shell {
    background: var(--navy-50);
    display: flex;
    flex-direction: column;
    height: 100dvh;
    margin: 0 auto;
    max-width: 30rem;
    overflow: hidden;
    position: relative;
}

/* The navy head (E-254, SPEC-B-NEU "Hülle"): the way back as a tile, the
   site as an amber line in capitals over the white title, and on the right
   the reader's initials, which open the menu. */
.site-topbar {
    align-items: center;
    background: var(--navy-900);
    color: var(--text-on-dark);
    display: flex;
    flex: none;
    gap: var(--space-3);
    min-height: 72px;
    padding: var(--space-3) var(--space-4);
    z-index: var(--z-sticky);
}

.site-back {
    align-items: center;
    background: var(--navy-700);
    border-radius: var(--radius-md);
    color: var(--text-on-dark);
    display: inline-flex;
    flex: none;
    height: 44px;
    justify-content: center;
    width: 44px;
    text-decoration: none;
}

.site-back:hover {
    background: var(--navy-600);
    color: var(--text-on-dark);
}

.site-topbar-heading {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-topbar-eyebrow {
    color: var(--amber-500);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .06em;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-topbar-title {
    color: var(--text-on-dark);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    margin: 0;
    overflow-wrap: anywhere;
}

/* B2/B3: the light head over the person's card - one line back, with the
   site after it, and the initials on the right as everywhere. */
.site-topbar-light {
    background: var(--navy-50);
    color: var(--text-strong);
    min-height: 0;
    padding: 4px var(--space-4) 6px;
}

.site-back-line {
    align-items: center;
    color: var(--navy-700);
    display: flex;
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    gap: var(--space-1);
    margin-left: calc(-1 * var(--space-1));
    min-height: 44px;
    min-width: 0;
    text-decoration: none;
}

.site-back-line .icon {
    flex: none;
}

.site-back-line-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-back-line-site {
    color: inherit;
    font-weight: inherit;
}

.site-back-line:hover {
    color: var(--navy-900);
    text-decoration: none;
}

/* The reader's initials: a 36px circle inside a 44px target. */
.site-me {
    align-items: center;
    border-radius: var(--radius-pill);
    display: flex;
    flex: none;
    height: 44px;
    justify-content: center;
    margin-left: auto;
    margin-right: calc(-1 * var(--space-1));
    text-decoration: none;
    width: 44px;
}

.site-me-initials,
.site-menu-initials {
    align-items: center;
    background: var(--amber-500);
    border-radius: var(--radius-pill);
    color: var(--navy-900);
    display: flex;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    height: 36px;
    justify-content: center;
    letter-spacing: .02em;
    width: 36px;
}

/* The initials are no text link: a hover - which a tap leaves behind on a phone - draws no underline under them. */
.site-me:hover {
    text-decoration: none;
}

.site-me:hover .site-me-initials {
    background: var(--amber-600);
}

.site-me:focus-visible {
    outline: 2px solid var(--amber-500);
    outline-offset: 2px;
}

.site-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4);
}

/* B1 keeps its search and filters still under the head and scrolls only
   the list beneath them (V176): the content area stands still for it. */
.site-content:has(> .site-b1) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.site-search {
    margin-bottom: var(--space-4);
}

.site-search-box {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    display: flex;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-3);
}

.site-search-box:focus-within {
    border-color: var(--border-focus);
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

.site-search-box > .icon {
    color: var(--text-subtle);
    flex: none;
}

.site-search-field {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    flex: 1;
    font: inherit;
    min-width: 0;
    outline: none;
    padding: 0;
}

.site-search-clear {
    align-items: center;
    background: none;
    border: 0;
    color: var(--text-subtle);
    cursor: pointer;
    display: flex;
    flex: none;
    height: 44px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    width: 32px;
}

.site-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-card {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-body);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    min-height: 44px;
    padding: var(--space-4);
}

.site-card:hover {
    border-color: var(--border-strong);
}

.site-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.site-card-name {
    color: var(--text-strong);
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
}

/* The site channel's status language: a sign carries the meaning and the
   colour only backs it up, so every state still reads in greyscale, in
   sunlight and for a red-green colour-blind reader. Four classes - in order
   (tick, the web app's green since E-254 (3)), runs out or due (timer, amber), missing or blocked
   (cross, red), cannot be judged (dash, grey). The values are darker than
   the shared status tokens: sign and text share one colour, and the light
   500 tones are too weak for a 2px stroke. The rest of the app keeps its
   tokens; this language is the site channel's. */
:root {
    --site-ok: var(--success-text);
    --site-ok-bg: var(--success-100);
    --site-soon: #98590f;
    --site-soon-bg: #fdf0dd;
    --site-bad: #9e2226;
    --site-bad-bg: #fce7e8;
    --site-np: #6b7280;
    --site-np-bg: #f7f8fa;
    --site-sign-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --site-sign-soon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2h4M12 14l3-3'/%3E%3Ccircle cx='12' cy='14' r='8'/%3E%3C/svg%3E");
    --site-sign-bad: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
    --site-sign-np: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

/* Every status line in the site channel is set in the mono face, uppercase
   and letterspaced - it is the one typographic signal that separates a
   verdict from prose. The tone class colours the line and its sign alike,
   so words and sign can never disagree. */
.site-card-line {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    gap: var(--space-2);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.site-card-line-ok {
    color: var(--site-ok);
}
.site-card-line-warning {
    color: var(--site-soon);
}
.site-card-line-danger {
    color: var(--site-bad);
}
.site-card-line-neutral {
    color: var(--site-np);
}

/* The sign in front of a status line, drawn in the line's colour. */
.site-sign {
    -webkit-mask: var(--site-sign) center / contain no-repeat;
    background: currentColor;
    flex: none;
    height: 13px;
    mask: var(--site-sign) center / contain no-repeat;
    width: 13px;
}

.site-sign-ok {
    --site-sign: var(--site-sign-ok);
}
.site-sign-warning {
    --site-sign: var(--site-sign-soon);
}
.site-sign-danger {
    --site-sign: var(--site-sign-bad);
}
.site-sign-neutral {
    --site-sign: var(--site-sign-np);
}

.site-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-12) var(--space-5);
    text-align: center;
}

.site-empty-icon {
    align-items: center;
    background: var(--gray-100);
    border-radius: var(--radius-pill);
    color: var(--text-subtle);
    display: flex;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.site-empty-title {
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
}

.site-empty-text {
    color: var(--text-muted);
    font-size: var(--text-sm);
    max-width: 16rem;
}

/* B0's way to the whole stock: a row of its own under the card, with the
   line that says what is behind it. */
.site-list-foot {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-strong);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
}

.site-list-foot:hover {
    border-color: var(--border-strong);
    text-decoration: none;
}

.site-list-foot > .icon {
    color: var(--text-subtle);
    flex: none;
}

.site-list-foot-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-list-foot-title {
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
}

.site-list-foot-sub {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* "Mein Profil" of a Bauleitung without its own person (V203): where the details are changed. */
.site-profile-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    line-height: 1.5;
    margin: 12px 4px 0;
}

/* The person's status card on top of "Meine Projekte" (V203): the band of the employee app's Start. */
.site-content > .status-band {
    margin-bottom: 12px;
}

.site-chip {
    align-items: center;
    flex: none;
    white-space: nowrap;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    color: var(--text-body);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: var(--text-sm);
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 var(--space-4);
    text-decoration: none;
}

.site-chip-active {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: var(--text-on-dark);
}

.site-chip-count {
    color: inherit;
    font-weight: var(--fw-semibold);
    opacity: 0.7;
}

/* The scanner's person search: a firm's name over one card with its people
   as rows, not a card each - a stack of separate cards loses which people
   belong together. The overview draws its firms as cards of their own
   (SiteFirmCard). */
.site-group {
    margin-bottom: var(--space-4);
}

.site-group-name {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    padding: var(--space-3) var(--space-1) var(--space-2);
}

.site-people {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    list-style: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.site-people > li + li {
    border-top: 1px solid var(--border-subtle);
}

.site-person {
    align-items: center;
    color: var(--text-body);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
}

.site-person:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.site-person-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.site-person-name {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
}

.verdict {
    align-items: flex-start;
    border-radius: var(--radius-lg);
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
}

.verdict > .icon {
    flex: none;
    margin-top: 2px;
}

.verdict-ok {
    background: var(--success-100);
    color: var(--success-text);
}

.verdict-warning {
    background: var(--warning-100);
    color: var(--warning-text);
}

.verdict-danger {
    background: var(--danger-100);
    color: var(--danger-text);
}

.verdict-line {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: var(--fw-bold);
    margin: 0;
}

.verdict-why {
    font-size: var(--text-sm);
    margin: var(--space-1) 0 0;
}

/* Centred, with the initials over the name: the kit puts the person in the
   middle of the screen because the reader is comparing them with somebody
   standing in front of them. */
.site-person-head {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-4);
    text-align: center;
}

/* A tint of its own: navy-100 is the page canvas since E-174, and the circle
   vanished into it, leaving the initials bare. */
.site-person-avatar {
    align-items: center;
    background: var(--info-100);
    border-radius: var(--radius-pill);
    color: var(--info-text);
    display: flex;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: var(--fw-bold);
    height: 56px;
    justify-content: center;
    margin-bottom: var(--space-2);
    width: 56px;
}

.site-person-head-name {
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    margin: 0;
}

.site-person-head-sub {
    color: var(--text-body);
    font-size: var(--text-sm);
    margin: 2px 0 0;
}

.site-section {
    margin-bottom: var(--space-5);
}

.site-section-title {
    color: var(--text-subtle);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    letter-spacing: .07em;
    margin: 0 0 var(--space-2);
    text-transform: uppercase;
}

.site-section-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: 0 0 var(--space-2);
}

/* A neutral card: the reason's line carries the verdict, the edge repeats
   nothing. */
.site-reason {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.site-evidence {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    list-style: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.site-evidence > li + li {
    border-top: 1px solid var(--border-subtle);
}

.site-evidence-row {
    align-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: var(--space-3);
    min-height: 44px;
    color: inherit;
    padding: var(--space-3) var(--space-4);
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.site-evidence-row:hover {
    background: var(--gray-50);
}

.site-evidence-main {
    flex: 1;
    min-width: 0;
}

.site-evidence-name {
    color: var(--text-strong);
    display: block;
    font-weight: var(--fw-semibold);
}

.site-evidence-valid {
    color: var(--text-subtle);
    display: block;
    font-family: var(--font-mono);
    font-size: 11.5px;
    margin-top: 1px;
}

.site-badge {
    align-items: center;
    border-radius: var(--radius-pill);
    display: inline-flex;
    flex: none;
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    gap: var(--space-2);
    padding: 3px 9px;
    white-space: nowrap;
}

.site-badge::before {
    -webkit-mask: var(--site-sign) center / contain no-repeat;
    background: currentColor;
    content: "";
    flex: none;
    height: 12px;
    mask: var(--site-sign) center / contain no-repeat;
    width: 12px;
}

.site-badge-ok {
    --site-sign: var(--site-sign-ok);
    background: var(--site-ok-bg);
    color: var(--site-ok);
}
.site-badge-warning {
    --site-sign: var(--site-sign-soon);
    background: var(--site-soon-bg);
    color: var(--site-soon);
}
.site-badge-danger {
    --site-sign: var(--site-sign-bad);
    background: var(--site-bad-bg);
    color: var(--site-bad);
}
.site-badge-neutral {
    --site-sign: var(--site-sign-np);
    background: var(--site-np-bg);
    color: var(--site-np);
}

.site-evidence-row > .icon {
    color: var(--text-subtle);
    flex: none;
}

/* The tuple behind a row: what is known about the evidence without opening
   the document. Two columns, the note under a rule. */
.site-tuple {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}

.site-tuple + .site-tuple {
    border-top: 1px solid var(--border-subtle);
}

.site-tuple-key {
    color: var(--text-muted);
}

.site-tuple-value {
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
    text-align: right;
}

.site-tuple-note {
    border-top: 1px solid var(--border-subtle);
    color: var(--text-subtle);
    font-size: var(--text-xs);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
}

/* The framework's error bar and the bare page a visitor can still reach.
   Global on purpose: the bar is one id that can exist once in the document,
   and both shells - the desk's and the site channel's - render it. In a
   scoped stylesheet only the shell it was written for would hide it, and
   the other would show it permanently, which is how it was found. */

#blazor-error-ui {
    color-scheme: light only;
    background: var(--warning-100);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    color: var(--text-strong);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.visitor {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.visitor > h1 {
    margin: var(--space-8) var(--space-8) var(--space-3);
}

.visitor > p {
    margin: 0 var(--space-8);
}


.verdict-neutral {
    background: var(--gray-100);
    color: var(--text-muted);
}

/* The verdict banner in the site channel speaks the channel's status
   language; the office pages keep the shared tones. */
/* "In order" as a full surface is the web app's green (E-254 (3), SPEC-B-STATUS
   Nachtrag 2): white on --success-600. */
.site-shell .verdict-ok {
    background: var(--success-600);
    color: var(--white);
}
.site-shell .verdict-warning {
    background: var(--site-soon-bg);
    color: var(--site-soon);
}
.site-shell .verdict-danger {
    background: var(--site-bad-bg);
    color: var(--site-bad);
}
.site-shell .verdict-neutral {
    background: var(--site-np-bg);
    color: var(--site-np);
}

/* The person takes what the content area has left, not a percentage of it:
   anything standing beside it shortens the list, never pushes the action under
   the foot (INGO-371). Where the action alone is taller than the screen allows,
   the page scrolls to it. */
.site-content:has(> .site-person-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.site-person-page {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}
.site-person-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-4);
}
.site-return {
    align-items: center;
    display: flex;
    font-size: var(--text-xs);
    justify-content: center;
    min-height: 44px;
    text-align: center;
}
.site-person-history {
    align-items: center;
    display: flex;
    font-size: var(--text-sm);
    justify-content: space-between;
    gap: var(--space-2);
    min-height: 44px;
    margin: var(--space-2) 0;
}
.site-photo-capture {
    margin: 0;
    width: 100%;
}
.site-photo-capture summary {
    color: var(--text-link);
    justify-content: center;
}
.site-photo-capture .site-field-form {
    margin-top: var(--space-3);
    text-align: left;
}
.site-photo-capture summary,
.site-evidence-disclosure > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: var(--text-sm);
    gap: var(--space-2);
    min-height: 44px;
}
.site-evidence-disclosure > summary {
    justify-content: space-between;
    color: var(--text-link);
}
.site-evidence-disclosure[open] > summary {
    margin-bottom: var(--space-3);
}
.site-reason {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.site-case-context {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0 0 var(--space-5);
    overflow: hidden;
}
.site-case-context > div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-3);
    font-size: var(--text-sm);
}
.site-case-context > div + div {
    border-top: 1px solid var(--border-subtle);
}
.site-case-context dt {
    color: var(--text-muted);
}
.site-case-context dd {
    color: var(--text-strong);
    font-weight: var(--fw-medium);
    margin: 0;
    overflow-wrap: anywhere;
    text-align: right;
}
.site-field-form {
    display: grid;
    gap: var(--space-3);
}
.site-field-form label {
    margin: 0;
    min-width: 0;
}
.site-field-form textarea {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    color: var(--text-body);
    display: block;
    font: inherit;
    font-size: var(--text-sm);
    min-height: 88px;
    padding: var(--space-3);
    resize: vertical;
    width: 100%;
}
.site-field-form select {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    color: var(--text-body);
    display: block;
    font: inherit;
    font-size: var(--text-sm);
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    width: 100%;
}
.site-field-form .btn-primary,
.site-field-form .btn-secondary {
    justify-content: center;
    min-height: 44px;
}
/* B4's choice: rows of one card, the chosen row light amber (SPEC-B-NEU B4). */
.site-case-options {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: grid;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
}
.site-case-option {
    box-sizing: border-box;
    align-items: center;
    background: var(--surface-card);
    color: var(--text-strong);
    cursor: pointer;
    display: flex;
    font-size: var(--text-base);
    gap: var(--space-3);
    min-height: 52px;
    padding: var(--space-3) var(--space-4);
}
.site-case-option + .site-case-option {
    border-top: 1px solid var(--border-subtle);
}
.site-case-option:has(input:checked) {
    background: color-mix(in srgb, var(--amber-500) 18%, var(--surface-card));
    font-weight: var(--fw-semibold);
}
.site-case-option input {
    accent-color: var(--navy-900);
    flex: none;
    height: 18px;
    margin: 0;
    width: 18px;
}
/* The photo as a dashed button; the field under its words shows what was chosen. */
.site-upload {
    background: var(--surface-card);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: grid;
    font-size: var(--text-sm);
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}
.site-upload > span {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.site-upload-label {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
    justify-content: center;
}
.site-upload input {
    color: var(--text-muted);
    font: inherit;
    max-width: 100%;
    min-height: 44px;
    width: 100%;
}
.site-upload input::file-selector-button {
    background: var(--gray-50);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-body);
    cursor: pointer;
    font: inherit;
    margin-right: var(--space-2);
    min-height: 44px;
    padding: var(--space-2);
}
.site-message {
    color: var(--text-muted);
    display: grid;
    font-size: var(--text-xs);
    gap: var(--space-2);
}
.site-form-hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: 0;
    text-align: center;
}
.site-submitted {
    align-items: flex-start;
    background: var(--success-100);
    border-radius: var(--radius-lg);
    color: var(--success-text);
    display: flex;
    font-size: var(--text-sm);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
}
.site-submitted p {
    margin: var(--space-1) 0 0;
}
.site-submitted .icon {
    flex: none;
}

/* Primary navigation stays on the four project screens. Person checks
   have their own fixed action and return link. */
.site-tabs {
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex: none;
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
}

.site-tab {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-height: 44px;
    padding: 6px 0 2px;
    text-decoration: none;
}

.site-tab:hover {
    color: var(--text-strong);
    text-decoration: none;
}

/* The glyph sits in a 48 x 30 capsule; the active tab fills it amber. */
.site-tab-icon {
    align-items: center;
    border-radius: var(--radius-pill);
    display: flex;
    height: 30px;
    justify-content: center;
    width: 48px;
}

.site-tab-active {
    color: var(--text-strong);
}

.site-tab-active .site-tab-icon {
    background: var(--amber-500);
    color: var(--navy-900);
}

.site-tab-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: var(--fw-medium);
}

.site-tab-active .site-tab-label {
    font-weight: var(--fw-semibold);
}

/* Pattern C (E-254 (1), SPEC-B-NEU): a section is its title over a card,
   the count beside the title as a capsule - navy, or the colour of the
   state it counts. SiteSection draws it. */
.site-block {
    margin-bottom: var(--space-5);
}

.site-block-head {
    align-items: center;
    color: var(--text-strong);
    display: flex;
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: var(--fw-semibold);
    gap: var(--space-2);
    line-height: 1.3;
    margin: 0 0 var(--space-2);
}

.site-block-suffix {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--fw-regular);
}

/* A section's counter, as the kit's shared capsule draws it on every site screen: sans, white on navy or on the
   status language's darker tones. */
.site-count {
    background: var(--navy-900);
    border-radius: var(--radius-pill);
    box-sizing: border-box;
    color: var(--white);
    font: var(--fw-semibold) 11.5px/20px var(--font-sans);
    height: 20px;
    min-width: 22px;
    padding: 0 7px;
    text-align: center;
}

.site-count-ok {
    background: var(--success-600);
}

.site-count-warning {
    background: var(--site-soon);
}

.site-count-danger {
    background: var(--site-bad);
}

.site-count-neutral {
    background: var(--site-np);
}

.site-block-card,
.site-rows {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.site-block-card {
    padding: var(--space-4);
}

/* A form that wraps sections spaces them like the page does. */
.site-field-form:has(> .site-block) {
    display: block;
}

.site-stack {
    display: grid;
    gap: var(--space-3);
}

.site-block-empty {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0;
}

.site-block .site-case-context {
    margin: 0;
}

/* Rows of one card: B0's sites. */
.site-rows {
    list-style: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.site-rows > li + li {
    border-top: 1px solid var(--border-subtle);
}

.site-row {
    align-items: center;
    color: var(--text-body);
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
}

.site-row:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.site-row > .icon {
    color: var(--text-subtle);
    flex: none;
}

.site-row-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.site-row-name {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
}

/* B0's search: a white card of its own on the work surface. */
.site-search-card {
    margin-bottom: var(--space-5);
}

.site-search-card .site-search-box {
    border-color: var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-height: 48px;
}

/* The foot bar (SiteFooterBar): the screen's main action at its foot, full
   width and yellow, a text button or a line under it. It is the last thing
   of the page and stays at the foot of the screen while the page scrolls
   above it: the page becomes a column, the bar is pushed to its end and
   sticks there - nothing scrolls under it unseen at the end of the page,
   and nothing it shows can be covered (INGO-371). Over the tab bar it keeps
   12px below the button, without one 26px for the home bar. */
.site-content:has(> .site-footbar) {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

.site-content:has(> .site-footbar) > * {
    flex-shrink: 0;
}

.site-footbar {
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    bottom: 0;
    display: flex;
    flex: none;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4) max(26px, env(safe-area-inset-bottom));
    position: sticky;
    z-index: 1;
}

.site-content > .site-footbar {
    margin: auto calc(-1 * var(--space-4)) 0;
}

.site-shell:has(> .site-tabs) .site-footbar {
    padding-bottom: var(--space-3);
}

.site-footbar-main,
.site-footbar .btn-primary {
    align-items: center;
    background: var(--amber-500);
    border: 0;
    border-radius: 14px;
    box-sizing: border-box;
    color: var(--navy-900);
    cursor: pointer;
    display: flex;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: var(--fw-semibold);
    justify-content: center;
    /* The kit's font shorthand: a link stands as high as a button (49px), not on the page's 1.5. */
    line-height: normal;
    min-height: 49px;
    padding: 15px 14px;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

.site-footbar-main:hover,
.site-footbar .btn-primary:hover {
    background: var(--amber-600);
    color: var(--navy-900);
    text-decoration: none;
}

.site-footbar-outlined .site-footbar-main,
.site-footbar-outlined .btn-primary {
    background: var(--surface-card);
    border: 1.5px solid var(--navy-200);
}

.site-footbar-outlined .site-footbar-main:hover,
.site-footbar-outlined .btn-primary:hover {
    background: var(--navy-50);
}

/* The text button under the main one, drawn as the kit's (b-abschnitt.css,
   .bc-textbtn: 28px under an 8px gap); its 44px target reaches 8px into the
   gap above and the padding below, so the foot keeps the kit's height. */
.site-footbar-secondary {
    align-items: center;
    color: var(--navy-700);
    display: flex;
    font-size: 13.5px;
    font-weight: var(--fw-semibold);
    justify-content: center;
    margin: -8px 0;
    min-height: 44px;
    text-align: center;
}

a.site-footbar-secondary:hover {
    color: var(--navy-900);
}

.site-footbar-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin: 0;
    text-align: center;
}

.site-footbar p {
    margin: 0;
}

/* A foot action that does nothing right now keeps its place: the main
   button dimmed, the text button greyed (b-abschnitt.css, .is-off). */
button.site-footbar-secondary {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: var(--font-sans);
    width: 100%;
}

.site-footbar-main.is-off,
.site-footbar-main.is-off:hover {
    background: var(--amber-500);
    cursor: default;
    opacity: .45;
}

.site-footbar-secondary.is-off {
    color: var(--text-subtle);
    cursor: default;
}

/* The sheet from below (E-254 (2), SPEC-B-NEU): over the whole screen, a
   grip on top, closed by "Schließen" and Escape only - the dimmed backdrop
   takes no tap (INGO-165). Opened by its address, so it is there on the
   first paint and needs no entrance. */
.site-sheet-overlay {
    align-items: flex-end;
    background: rgba(18, 22, 31, 0.45);
    display: flex;
    inset: 0;
    justify-content: center;
    position: fixed;
    z-index: var(--z-modal);
}

.site-sheet {
    background: var(--surface-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-xl);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-height: 90dvh;
    max-width: 30rem;
    overflow-y: auto;
    padding: var(--space-2) var(--space-4) max(26px, env(safe-area-inset-bottom));
    width: 100%;
}

.site-sheet:focus {
    outline: none;
}

.site-sheet-grip {
    align-self: center;
    background: var(--gray-300);
    border-radius: var(--radius-pill);
    flex: none;
    height: 5px;
    width: 40px;
}

/* E-329: the grip of a Bauleitung sheet is pulled down to close it. The bar
   stays as drawn; the area a thumb takes it by is larger, and a pull on it is
   never a scroll (site-sheet.js follows it). */
.site-shell .site-sheet-grip {
    cursor: grab;
    position: relative;
    touch-action: none;
}

.site-shell .site-sheet-grip::before {
    content: "";
    inset: -14px -48px;
    position: absolute;
}

.site-menu-who {
    align-items: center;
    display: flex;
    gap: var(--space-3);
}

.site-menu-initials {
    flex: none;
    font-size: var(--text-base);
    height: 48px;
    width: 48px;
}

.site-menu-who-text {
    min-width: 0;
}

.site-menu-name {
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: var(--fw-semibold);
    margin: 0;
    overflow-wrap: anywhere;
}

.site-menu-role {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 2px 0 0;
}

.site-menu-items {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.site-menu-form {
    border-top: 1px solid var(--border-subtle);
    margin: 0;
}

.site-menu-item {
    align-items: center;
    background: var(--surface-card);
    border: 0;
    box-sizing: border-box;
    color: var(--text-strong);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-3) var(--space-4);
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.site-menu-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}

/* Inside the card's rounded edge, which would clip a ring drawn outside. */
.site-menu-item:focus-visible,
.site-row:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

.site-menu-item-icon {
    align-items: center;
    background: var(--navy-50);
    border-radius: var(--radius-md);
    color: var(--navy-900);
    display: flex;
    flex: none;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.site-menu-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-menu-item-label {
    font-size: var(--text-base);
    font-weight: var(--fw-semibold);
}

.site-menu-item-sub {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.site-sheet-close {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    font-size: var(--text-base);
    justify-content: center;
    min-height: 48px;
    width: 100%;
}

/* The door into the site channel on the start page: the amber of the brand,
   because it is the one card that changes which product you are in. */
.start-card-site {
    background: var(--amber-500);
    border-color: var(--amber-500);
    color: var(--accent-contrast);
}

.start-card-site .start-card-caption,
.start-card-site .start-card-number {
    color: var(--accent-contrast);
}

/* The switch into the site channel, in the top bar beside the search.
   Amber, because it is the one link that changes which product you are in,
   and compact, because it shares the row with the search and the bell. */
.channel-switch {
    align-items: center;
    background: var(--amber-500);
    border-radius: var(--radius-md);
    color: var(--accent-contrast);
    display: inline-flex;
    flex: none;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-3);
    white-space: nowrap;
}

.channel-switch:hover {
    background: var(--amber-600);
    color: var(--accent-contrast);
}

/* Keep the action named on phones, with a full touch target. */
@media (max-width: 48rem) {
    .channel-switch {
        min-height: 44px;
        padding: 0 var(--space-3);
    }
}

/* The check, written down: the line that says when this person was last
   confirmed here, and the one button a thumb reaches - full width, the
   height the kit gives a primary action on a phone. The form posts and
   the address comes back with the line renewed, so there is no state to
   hold between the two. */

.site-verify-last {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3);
}

.site-verify-done {
    align-items: center;
    color: var(--success-text);
    display: flex;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}

.site-verify-form {
    margin: 0;
}

.site-verify-button {
    min-height: 48px;
    width: 100%;
}

.site-verify-error {
    color: var(--danger-text);
    font-size: var(--text-sm);
    margin: var(--space-2) 0 0;
}

/* The protocol (B6, E-254 (5), SPEC-B-NEU): "Zeitraum und Filter" folded
   into one line over the list, "Prüfungen" with its count, the lines in one
   card - who and for which firm on the left, when and by whom on the right -
   and the extract from the foot bar through a sheet. The kit's measures
   (B6-protokoll, b-abschnitt.css). The line links to the person: the
   protocol says what was seen, the person says what stands today. */
.site-log-filter {
    margin: 0 0 18px;
}

.site-log-fold > summary {
    cursor: pointer;
    display: block;
    list-style: none;
}

.site-log-fold > summary::-webkit-details-marker {
    display: none;
}

.site-log-fold > summary:focus-visible {
    border-radius: var(--radius-lg);
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.site-log-fold-title {
    align-items: center;
    display: flex;
    gap: var(--space-2);
    padding: 0 2px 8px;
}

.site-log-fold-label {
    color: var(--navy-900);
    font: 600 16px/1.25 var(--font-display);
}

.site-log-fold > summary:hover .site-log-fold-label {
    color: var(--navy-700);
}

.site-log-fold-chevron {
    color: var(--navy-500);
    display: inline-flex;
    flex: none;
    margin-left: auto;
    transform: rotate(-90deg);
    transition: transform .15s ease;
}

.site-log-fold[open] .site-log-fold-chevron {
    transform: none;
}

.site-log-summary,
.site-log-filter-card,
.site-log,
.site-log-empty {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    overflow: hidden;
}

.site-log-summary {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 13px 14px;
}

.site-log-fold > summary:hover .site-log-summary {
    background: var(--navy-50);
}

.site-log-fold[open] .site-log-summary {
    display: none;
}

.site-log-summary-period {
    color: var(--navy-900);
    flex: none;
    font: 500 13px var(--font-mono);
}

.site-log-summary-rest {
    color: var(--text-muted);
    font: 400 13px var(--font-sans);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A row of the open filter: the label on the left, a compact control on
   the right. The control is drawn 30px high as in the kit; the field
   inside reaches 7px past it above and below, so a finger still finds 44px
   (S-02) and the row, the field's label, focuses it. */
.site-log-filter-field {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 0;
    min-height: 52px;
    padding: 10px 14px;
    box-sizing: border-box;
}

.site-log-filter-field + .site-log-filter-field {
    border-top: 1px solid var(--border-subtle);
}

.site-log-filter-field > span:first-child {
    color: var(--text-muted);
    font: 400 13px var(--font-sans);
}

.site-log-control {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 1 auto;
    height: 30px;
    max-width: 210px;
    min-width: 0;
}

.site-log-control:hover {
    border-color: var(--border-strong);
}

.site-log-control:focus-within,
.site-log-filter .site-log-filter-field .date-field-wrap .date-field-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--ring);
}

.site-log-control select {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231c2330' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 6px center;
    border: 0;
    box-shadow: none;
    color: var(--text-strong);
    font: 600 12.5px var(--font-sans);
    height: 44px;
    margin: -8px 0;
    max-width: 208px;
    min-width: 0;
    padding: 0 26px 0 8px;
    text-align: right;
    text-align-last: right;
}

.site-log-control select:focus-visible {
    box-shadow: none;
}

.site-log-filter .site-log-filter-field .date-field-wrap {
    flex: none;
}

.site-log-filter .site-log-filter-field .date-field-wrap .date-field-box {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    height: 30px;
    width: 132px;
}

.site-log-filter .site-log-filter-field .date-field-wrap .date-field-box > .date-field {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    font: 600 12.5px var(--font-sans);
    height: 44px;
    margin: -8px 0;
    outline: none;
    padding: 0 28px 0 8px;
    text-align: right;
    width: 100%;
}

.site-log-filter .site-log-filter-field .date-field-wrap .date-field-open {
    bottom: -8px;
    color: var(--navy-900);
    right: 0;
    top: -8px;
    width: 28px;
}

.site-log-apply {
    justify-content: center;
    margin-top: var(--space-3);
    min-height: 44px;
    width: 100%;
}

.site-log-section .site-block-head {
    padding: 0 2px;
}

.site-log {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-log-entry + .site-log-entry {
    border-top: 1px solid var(--border-subtle);
}

.site-log-body {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 10px;
    padding: 11px 13px;
    text-decoration: none;
}

.site-log-body:hover {
    background: var(--navy-50);
    color: inherit;
    text-decoration: none;
}

.site-log-body:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

.site-log-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.site-log-name {
    color: var(--text-strong);
    font: 600 13.5px var(--font-sans);
    overflow-wrap: anywhere;
}

.site-log-firm,
.site-log-by {
    color: var(--text-muted);
    font: 400 12.5px var(--font-sans);
    margin-top: 1px;
    overflow-wrap: anywhere;
}

.site-log-side {
    align-items: flex-end;
    display: flex;
    flex: none;
    flex-direction: column;
    max-width: 45%;
    text-align: right;
}

.site-log-time {
    color: var(--navy-700);
    font: 500 12px var(--font-mono);
    white-space: nowrap;
}

.site-log-checker {
    color: var(--text-muted);
    font: 400 11.5px var(--font-sans);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.site-log-empty {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font: 400 13px/1.5 var(--font-sans);
    gap: 8px;
    padding: 34px 20px;
    text-align: center;
}

.site-log-more {
    display: block;
    margin-top: var(--space-3);
    text-align: center;
}

/* The sheet that produces the protocol: its title and what the extract
   holds, the two ways out as items, and the text button that closes it.
   The mail's busy line stands in for its button while the request runs
   (site-sheet.js), the result in its place once the mail is on its way. */
.site-sheet.site-export {
    border-radius: 22px 22px 0 0;
    gap: 0;
    padding: 10px 16px max(24px, env(safe-area-inset-bottom));
}

.site-export .site-sheet-grip {
    background: var(--navy-200);
    margin-bottom: 14px;
}

.site-export-title {
    color: var(--navy-900);
    font: 600 17px/1.3 var(--font-display);
    margin: 0 2px 4px;
}

.site-export-sub {
    color: var(--text-muted);
    font: 400 13px/1.45 var(--font-sans);
    margin: 0 2px 14px;
}

.site-export-form {
    margin: 0;
}

.site-export-item {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    color: var(--navy-900);
    cursor: pointer;
    display: flex;
    font: 600 15px var(--font-sans);
    gap: 12px;
    margin-bottom: 8px;
    min-height: 52px;
    padding: 14px 12px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.site-export-item:hover {
    background: var(--navy-50);
    color: var(--navy-900);
    text-decoration: none;
}

.site-export-item:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

.site-export-item:disabled {
    color: var(--text-muted);
    cursor: default;
}

.site-export-item:disabled:hover {
    background: var(--surface-card);
}

.site-export-item > .icon {
    color: var(--navy-700);
    flex: none;
}

.site-export-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-export-item-sub {
    color: var(--text-muted);
    font: 400 12.5px var(--font-sans);
    margin-top: 1px;
    overflow-wrap: anywhere;
}

.site-export-state {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 12px 4px 2px;
}

.site-export-busy {
    display: none;
}

.site-export-form[aria-busy="true"] .site-export-item,
.site-export:has(.site-export-form[aria-busy="true"]) [data-protocol-pdf] {
    display: none;
}

.site-export-form[aria-busy="true"] .site-export-busy {
    display: flex;
}

.site-export-state-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-export-state-title {
    color: var(--text-body);
    font: 600 13px var(--font-sans);
}

.site-export-state-sub {
    color: var(--text-muted);
    font: 400 11.5px var(--font-sans);
    margin-top: 1px;
    overflow-wrap: anywhere;
}

/* Sent: the channel's tick on its pale disc, as the kit's status disc draws it. */
.site-export-done {
    align-items: center;
    background: var(--site-ok-bg);
    border-radius: var(--radius-pill);
    color: var(--site-ok);
    display: inline-flex;
    flex: none;
    height: 20px;
    justify-content: center;
    width: 20px;
}

.site-export-done .site-sign {
    height: 12px;
    width: 12px;
}

.site-export-spinner {
    animation: site-export-spin .8s linear infinite;
    border: 3px solid var(--gray-200);
    border-radius: var(--radius-pill);
    border-top-color: var(--amber-500);
    box-sizing: border-box;
    flex: none;
    height: 20px;
    width: 20px;
}

@keyframes site-export-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-export-spinner {
        animation: none;
    }
}

.site-export-close {
    align-items: center;
    color: var(--navy-700);
    display: flex;
    font: 600 13.5px var(--font-sans);
    justify-content: center;
    min-height: 40px;
    text-decoration: none;
}

.site-export-close:hover {
    color: var(--navy-900);
    text-decoration: underline;
}

.verdict-gravity {
    font-size: var(--text-sm);
    font-weight: var(--fw-bold);
    margin: 2px 0 0;
}

.verdict-reason {
    font-weight: var(--fw-semibold);
}

/* The carrier tab on a person: a row's actions - print, and the reason
   before the one button that ends a pointer. */

.carrier-blocked {
    background: var(--warning-100);
    border-radius: var(--radius-md);
    color: var(--warning-text);
    font-size: var(--text-sm);
    margin-top: var(--space-3);
    padding: var(--space-3);
}

.carrier-blocked p {
    margin: 0 0 var(--space-2);
}

.carrier-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.carrier-reason {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    margin: 0 var(--space-1);
    padding: 4px 6px;
}

/* The sheet of carriers. On screen a plain page with one button; on paper
   a grid of cards, two per row, each with its code and the sentence under
   it, and never a page break through a card. */

.print-shell {
    margin: 0 auto;
    max-width: 210mm;
    padding: var(--space-6) var(--space-4);
}

.print-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    position: relative;
    z-index: 1;
}

.print-brand {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    margin: 0;
}

.print-brand span {
    color: var(--accent);
}

.print-meta {
    color: var(--text-muted);
    flex: 1;
    font-size: var(--text-sm);
    margin: 0;
}

/* A sheet with nothing to print (INGO-369): one card under the sheet's head
   - what happened, where a new carrier comes from, and the way back. */
.print-empty {
    max-width: 36rem;
    position: relative;
    z-index: 1;
}

.print-empty-title {
    color: var(--text-strong);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--space-2);
}

.print-empty-text {
    color: var(--text-body);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-2);
}

.print-empty-hint {
    color: var(--text-muted);
}

.print-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.print-cards {
    display: grid;
    gap: 8mm;
    grid-template-columns: repeat(2, 85.6mm);
    list-style: none;
    margin: 0;
    padding: 3mm;
    width: max-content;
}

.print-card {
    background: var(--white);
    color: var(--navy-900);
    border: .15mm solid #a1a1a1;
    border-radius: 0;
    box-sizing: border-box;
    break-inside: avoid;
    height: 54mm;
    width: 85.6mm;
    padding: 0;
    position: relative;
    z-index: 1;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    font-family: var(--font-display);
}
.print-card-head {
    background: var(--navy-900);
    color: var(--amber-500);
    height: 9mm;
    padding: 0 3mm;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.print-card-head span {
    font-size: 6.5pt;
    font-weight: var(--fw-bold);
    letter-spacing: .12em;
}
.print-card-head img { width: 19mm; height: auto; }
.print-card-content { display: flex; gap: 3mm; padding: 3mm; align-items: center; height: 44.7mm; box-sizing: border-box; }
.print-cut { position: absolute; width: 2mm; height: 2mm; border-color: #666; border-style: solid; border-width: 0; }
.print-cut-tl { top: -2mm; left: -2mm; border-right-width: .15mm; border-bottom-width: .15mm; }
.print-cut-tr { top: -2mm; right: -2mm; border-left-width: .15mm; border-bottom-width: .15mm; }
.print-cut-bl { bottom: -2mm; left: -2mm; border-right-width: .15mm; border-top-width: .15mm; }
.print-cut-br { bottom: -2mm; right: -2mm; border-left-width: .15mm; border-top-width: .15mm; }

/* Tenant and print date across the page, behind everything. Fixed, so each
   printed page repeats it; the QR code's own white field lies over it, so
   no code is ever crossed. */
.print-watermark {
    color: rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    inset: 0;
    justify-content: space-around;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}

.print-watermark p {
    display: flex;
    gap: 64px;
    justify-content: center;
    margin: 0;
    transform: rotate(-24deg);
}

.print-qr { background: var(--white); flex: none; width: 28mm; height: 28mm; }
.print-qr svg { display: block; height: 100%; width: 100%; }
.print-card-body { display: flex; flex-direction: column; gap: 1mm; min-width: 0; flex: 1; }
.print-card-body p { margin: 0; overflow-wrap: anywhere; line-height: 1.15; }
.print-card-name, .print-card-firm, .print-card-tenant { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.print-card-name { font-size: 10pt; font-weight: var(--fw-bold); }
.print-card-firm { font-size: 8pt; }
.print-card-tenant { font-size: 7pt; }
.print-card-dates { font-family: var(--font-mono); font-size: 6pt; margin-top: 1mm; }

/* The protocol on paper: the selection as a short list of facts, then one
   table, a heading row per day, and never a page break through a row. */

.protocol-sheet-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    margin: 0 0 var(--space-3);
}

.protocol-sheet-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    margin: 0 0 var(--space-5);
}

.protocol-sheet-facts dt {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.protocol-sheet-facts dd {
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.protocol-sheet-table {
    border-collapse: collapse;
    font-size: var(--text-sm);
    width: 100%;
}

.protocol-sheet-table th,
.protocol-sheet-table td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}

.protocol-sheet-table thead th {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
}

.protocol-sheet-table tr {
    break-inside: avoid;
}

.protocol-sheet-day th {
    background: var(--surface-sunken);
    font-weight: var(--fw-bold);
}

.protocol-sheet-empty,
.protocol-sheet-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: var(--space-4) 0 0;
}

/* Opened from the protocol on a phone, the sheet is read before it is
   printed: the table scrolls in its own box instead of widening the page.
   The box scrolls, not the table, so the table keeps its rows and columns
   for a screen reader. Paper keeps the whole table. */
@media screen and (max-width: 40rem) {
    .protocol-sheet-scroll {
        overflow-x: auto;
    }
}

.protocol-sheet-scroll:focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

@media print {
    .print-button,
    #blazor-error-ui {
        display: none !important;
    }

    .print-shell {
        max-width: none;
        padding: 0;
    }

    @page carriers { size: A4; margin: 10mm; }
    .print-cards { page: carriers; }
    body:has(.print-cards) { background: #fff; }
    .carrier-print-head { display: none; }
    .print-cards { grid-template-columns: repeat(2, 85.6mm); }

}

/* The scanner: the camera's picture where the browser has one, a line
   under it that says what is going on, and the field for a code typed by
   hand. The picture is square-ish and dark until the stream arrives, so
   the page does not jump when it does. */

.site-scan {
    align-items: center;
    background: var(--navy-800);
    border-radius: var(--radius-lg);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: var(--space-4);
    min-height: 280px;
    overflow: hidden;
    padding: var(--space-5);
    position: relative;
}

.site-scan-video {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.site-scan-video[hidden] {
    display: none;
}

.site-scan-guide {
    border: 2px solid var(--navy-400);
    border-radius: var(--radius-md);
    height: 144px;
    position: relative;
    width: 144px;
}

.site-scan-instruction,
.site-scan-status {
    background: var(--navy-800);
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
    font-size: var(--text-sm);
    margin: var(--space-2) 0 0;
    padding: var(--space-1) var(--space-2);
    position: relative;
    text-align: center;
}

.site-scan-status {
    color: var(--text-on-dark-muted);
}

.site-scan-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.site-scan-modes .site-chip {
    justify-content: center;
    padding: 0 var(--space-2);
}

.site-scan-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.site-scan-label {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.site-scan-hint {
    color: var(--text-subtle);
    font-size: var(--text-xs);
    margin: 0;
    text-align: center;
}

.site-verify-scanned {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: var(--text-sm);
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}

/* Field forms remain usable with a phone keyboard and without a circuit. */
.site-person-photo {
    object-fit: cover;
    border-radius: 12px;
    max-width: 100%;
}

/* DS31 B2/B3: the person at the gate as one card (SitePersonCard, "Baustellenausweis"). Navy, the kind
   in amber and the inGo mark on top; the portrait's frame beside name, position and firm, the masked
   birth date and how long the identity document holds; at its foot the verdict as a band in the full
   colour of its state - an own person's band stays navy, with the building in amber. */
.site-person-scroll {
    padding: 2px var(--space-4) var(--space-4);
}

.site-person-card {
    background: linear-gradient(135deg, rgba(32, 58, 82, 0.93), rgba(28, 35, 48, 0.97)), var(--navy-900);
    border-radius: 22px;
    box-shadow: 0 14px 30px rgba(18, 22, 31, 0.25);
    color: var(--white);
    overflow: hidden;
}

.site-person-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 13px 16px 0;
}

.site-person-card-kind {
    color: var(--amber-500);
    font: 600 10.5px/1 var(--font-sans);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-person-card-logo {
    display: block;
    height: auto;
    width: 56px;
}

.site-person-card-in {
    display: grid;
    gap: 14px;
    grid-template-columns: 84px minmax(0, 1fr);
    padding: 14px 16px 16px;
}

.site-person-card .site-person-card-photo {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    box-sizing: border-box;
    height: 104px;
    object-fit: cover;
    width: 84px;
}

.site-person-card-initials {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    display: flex;
    font: 600 24px var(--font-sans);
    justify-content: center;
}

.site-person-card-who {
    min-width: 0;
}

.site-person-card .site-person-card-name {
    color: var(--white);
    font: 600 21px/1.2 var(--font-sans);
    margin: 0;
    overflow-wrap: anywhere;
}

.site-person-card-sub {
    color: var(--navy-200);
    font: 400 13px/1.35 var(--font-sans);
    margin: 2px 0 0;
}

.site-person-card-facts {
    align-items: center;
    display: grid;
    font: 400 12px/1.35 var(--font-sans);
    gap: 3px 10px;
    grid-template-columns: auto 1fr;
    margin: 10px 0 0;
}

.site-person-card-facts dt {
    color: var(--navy-300);
}

.site-person-card-facts dd {
    color: var(--white);
    font: 500 12.5px/1.35 var(--font-mono);
    margin: 0;
}

/* The birth date stays masked until "zeigen" asks for it, a look that is recorded. */
.site-person-birth {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-person-birth-date {
    letter-spacing: 0.04em;
}

.site-person-birth-form {
    display: inline;
    margin: 0;
}

.site-person-birth-form[hidden] {
    display: none;
}

.site-person-birth-show {
    background: var(--amber-500);
    border: 0;
    border-radius: var(--radius-pill);
    color: var(--navy-900);
    cursor: pointer;
    font: 600 11px/1.45 var(--font-sans);
    padding: 1px 8px;
    position: relative;
}

/* A thumb's target around the small pill. */
.site-person-birth-show::after {
    content: "";
    inset: -13px -10px;
    position: absolute;
}

.site-person-birth-show:hover {
    background: var(--amber-600);
}

.site-person-band {
    align-items: center;
    color: var(--white);
    display: flex;
    gap: 12px;
    padding: 13px 16px;
}

.site-person-band-ok {
    background: var(--success-600);
}

.site-person-band-warning {
    background: var(--site-soon);
}

.site-person-band-danger {
    background: var(--site-bad);
}

.site-person-band-neutral {
    background: var(--site-np);
}

.site-person-band-own {
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-person-band .site-person-band-sign {
    color: var(--white);
    height: 24px;
    width: 24px;
}

.site-person-band-building {
    color: var(--amber-500);
    display: flex;
    flex: none;
}

.site-person-band-text {
    min-width: 0;
}

.site-person-band .site-person-band-title {
    color: var(--white);
    font: 600 18px/1.2 var(--font-sans);
    margin: 0;
}

.site-person-band .site-person-band-sub {
    color: var(--white);
    font: 400 12.5px/1.35 var(--font-sans);
    margin: 2px 0 0;
    opacity: 0.92;
}

.site-person-band .verdict-gravity {
    font-size: inherit;
    font-weight: var(--fw-semibold);
    margin: 0;
}

.site-person-band .site-verify-last {
    color: inherit;
    font-size: inherit;
    margin: 0;
}

/* The identity check beside the eye, and the hints under the card: a block elsewhere, the waiver. */
.site-person-hint {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    color: var(--navy-700);
    display: flex;
    gap: 10px;
    margin: 12px 0 0;
    padding: 12px 14px;
}

.site-person-hint + .site-person-hint {
    margin-top: 8px;
}

.site-person-hint > .icon {
    flex: none;
}

.site-person-hint-warning > .icon {
    color: var(--site-soon);
}

.site-person-hint-body {
    flex: 1;
    min-width: 0;
}

.site-person-hint-text {
    font: 400 13px/1.4 var(--font-sans);
    margin: 0;
}

.site-person-hint-text + .site-person-hint-text {
    margin-top: 6px;
}

.site-person-extra .site-photo-capture summary {
    color: var(--text-link);
    font: 600 13px var(--font-sans);
    justify-content: flex-start;
    list-style: none;
    min-height: 36px;
}

.site-person-extra .site-photo-capture summary::-webkit-details-marker {
    display: none;
}

/* Sections of the card's page (DS31 pattern C, b-abschnitt.css): a title row of 36px - 8px above and under
   the title - straight over its card, 10px to the next section, 6px under the card or the hint. The title
   row folds where the page lets it. */
.site-person-scroll > .site-person-card + .site-block,
.site-person-scroll > .site-person-hint + .site-block,
.site-person-scroll > .site-person-card + .site-block-collapsible,
.site-person-scroll > .site-person-hint + .site-block-collapsible {
    margin-top: 6px;
}

.site-person-scroll .site-block {
    margin-bottom: 10px;
}

/* The folding title row (SiteSection Collapsible, css/mobile.css) is 36px here, with a thumb's target of 44px
   around it. */
.site-person-scroll .site-block-summary {
    margin: 0;
    min-height: 36px;
    position: relative;
}

.site-person-scroll .site-block-summary::after {
    content: "";
    inset: -4px 0;
    position: absolute;
}

.site-person-scroll .site-block-head {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: var(--fw-semibold);
    line-height: 1.25;
    margin: 0;
    padding: 8px 2px;
}

/* One flat card of divided rows: activities, evidence, gaps, contacts. */
.site-person-rows {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: none;
    list-style: none;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.site-person-rows > li + li {
    border-top: 1px solid var(--border-subtle);
}

.site-person-row,
.site-person-rows .site-evidence-row {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 44px;
    padding: 13px 14px;
}

.site-person-rows .site-evidence-row:hover {
    background: var(--navy-50);
}

.site-person-row-main,
.site-person-rows .site-evidence-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.site-person-row-name,
.site-person-rows .site-evidence-name {
    color: var(--text-strong);
    font: 600 15px/1.3 var(--font-sans);
}

.site-person-row-sub,
.site-person-rows .site-evidence-valid {
    color: var(--text-muted);
    font: 400 12px/1.35 var(--font-sans);
    margin-top: 1px;
}

.site-person-rows .site-badge {
    font-size: 11px;
    gap: 5px;
    padding: 3px 9px 3px 7px;
}

.site-person-rows .site-badge::before {
    height: 13px;
    width: 13px;
}

/* B3: what keeps the person out, each with what can be done about it here. */
.site-gap {
    padding: 13px 14px;
}

.site-gap-name {
    color: var(--text-strong);
    font: 600 15px/1.3 var(--font-sans);
    margin: 0;
}

.site-gap-state {
    align-items: center;
    color: var(--site-bad);
    display: flex;
    font: 600 13px/1.35 var(--font-sans);
    gap: 5px;
    margin: 3px 0 0;
}

.site-gap-state .site-sign {
    height: 15px;
    width: 15px;
}

.site-gap-state-neutral {
    color: var(--site-np);
}

.site-gap-label {
    margin: 6px 0 0;
}

.site-gap-actions {
    display: flex;
    gap: 8px;
    margin: 11px 0 0;
}

.site-gap-action {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--navy-900);
    cursor: pointer;
    display: flex;
    flex: 1;
    font: 600 13px/1.25 var(--font-sans);
    gap: 6px;
    justify-content: center;
    min-height: 38px;
    padding: 10px 8px;
    position: relative;
    text-align: center;
    text-decoration: none;
}

/* The row's buttons are drawn as low as DS31 draws them; a thumb still finds 44px. */
.site-gap-action::after,
.site-gap-instant::after {
    content: "";
    inset: -3px 0;
    position: absolute;
}

.site-gap-action:hover {
    background: var(--navy-50);
    color: var(--navy-900);
    text-decoration: none;
}

.site-gap-action-main {
    background: var(--amber-500);
    border-color: var(--amber-500);
}

.site-gap-action-main:hover {
    background: var(--amber-600);
}

.site-gap-instant {
    align-items: center;
    background: var(--site-soon-bg);
    border: 1px dashed var(--site-soon);
    border-radius: 10px;
    box-sizing: border-box;
    color: #7a4709;
    display: flex;
    font: 600 13px/1.25 var(--font-sans);
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
    min-height: 38px;
    padding: 10px 8px;
    position: relative;
    text-decoration: none;
    width: 100%;
}

.site-gap-instant:hover {
    background: #fbe6c6;
    color: #7a4709;
    text-decoration: none;
}

/* "In Ordnung": everything that holds behind one fold, opened in place. */
.site-person-scroll .site-evidence-disclosure {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
}

.site-person-scroll .site-evidence-disclosure > summary {
    align-items: center;
    color: var(--navy-900);
    display: flex;
    font: 600 14px var(--font-sans);
    gap: 6px;
    list-style: none;
    margin: 0;
    min-height: 44px;
    padding: 13px 14px;
}

.site-person-scroll .site-evidence-disclosure > summary::-webkit-details-marker {
    display: none;
}

.site-evidence-disclosure-text {
    flex: 1;
}

.site-person-scroll .site-evidence-disclosure > summary > .icon {
    transition: transform 0.15s ease;
}

.site-person-scroll .site-evidence-disclosure[open] > summary > .icon {
    transform: rotate(90deg);
}

.site-person-scroll .site-evidence-disclosure > .site-person-rows {
    border-radius: 0;
    border-width: 1px 0 0;
}

/* "Wen Sie jetzt erreichen": one card, a row per contact with a button to call or write. */
.site-reach-row {
    align-items: center;
    display: flex;
    gap: 11px;
    padding: 12px 10px 12px 14px;
}

.site-reach-initials {
    align-items: center;
    background: var(--navy-100);
    border-radius: 50%;
    color: var(--navy-700);
    display: flex;
    flex: none;
    font: 600 12px var(--font-sans);
    height: 34px;
    justify-content: center;
    width: 34px;
}

.site-reach-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.site-reach-name {
    color: var(--text-strong);
    font: 600 14.5px/1.3 var(--font-sans);
}

.site-reach-role {
    color: var(--text-muted);
    font: 400 12.5px/1.35 var(--font-sans);
    margin-top: 1px;
}

.site-reach-call {
    align-items: center;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--navy-900);
    display: flex;
    flex: none;
    height: 38px;
    justify-content: center;
    position: relative;
    text-decoration: none;
    width: 38px;
}

.site-reach-call::after {
    content: "";
    inset: -3px;
    position: absolute;
}

.site-reach-call:hover {
    background: var(--navy-50);
    color: var(--navy-900);
    text-decoration: none;
}

/* What stands after the sections: when the person was last checked, a portrait to capture, the cases. */
.site-person-last {
    color: var(--text-muted);
    font: 400 12.5px/1.4 var(--font-sans);
    margin: 0 2px 6px;
}

.site-person-extra {
    margin: 0 2px;
}

.site-person-scroll .site-person-history {
    color: var(--navy-700);
    font: 600 13.5px var(--font-sans);
    margin: 0 2px;
}

.site-verify-notice {
    background: var(--success-100);
    border-radius: 14px;
    margin: 12px 0;
    padding: 12px 14px;
}

.site-verify-notice .site-verify-done {
    margin: 0;
}

.site-verify-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
}

.site-verify-links .btn-secondary {
    min-height: 40px;
}

/* What the foot says about the check next to its button: checked minutes ago, found by the carrier. */
.site-footbar .site-verify-recent {
    color: var(--text-muted);
    font: 400 12.5px/1.4 var(--font-sans);
    text-align: center;
}

.site-footbar .site-verify-scanned {
    font-size: 12.5px;
    justify-content: center;
    margin: 0;
}

/* The foot's text button when the check itself is the quieter action (B3). */
.site-footbar-text,
.site-footbar .site-footbar-text {
    background: transparent;
    border: 0;
    color: var(--navy-700);
    cursor: pointer;
    font: 600 13.5px var(--font-sans);
    min-height: 44px;
    padding: 6px;
    width: 100%;
}

.site-footbar-text:hover {
    color: var(--navy-900);
    text-decoration: underline;
}
.site-section form:not(.site-field-form) label {
    display: block;
    margin: 12px 0;
}
.site-section form:not(.site-field-form) textarea {
    display: block;
    width: 100%;
    min-height: 90px;
}
.site-section form select, .site-section form input {
    max-width: 100%;
}

/* The company chain scrolls inside the canvas; opening a branch never widens the shell. */
.hierarchy-filter { display: flex; align-items: end; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.hierarchy-filter label { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
/* The label stacks its field, so the list search's flex basis would become its height. */
.hierarchy-filter .search-input { flex: none; width: 17.5rem; max-width: 100%; }
.hierarchy-project { min-width: 0; margin-top: var(--space-6); }
.hierarchy-project-title { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.hierarchy-scroll { overflow: auto; max-width: 100%; padding: var(--space-1) var(--space-1) 30px; }
.hierarchy-scroll:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
/* G11: 2px connectors, 22px apart. A branch hangs below its chevron; the root has none and its first level stays open. */
.hierarchy-tree, .hierarchy-children { display: flex; justify-content: center; list-style: none; padding: 0; margin: 0; width: max-content; min-width: 100%; }
.hierarchy-children { padding-top: 50px; position: relative; }
.hierarchy-children::before { content: ''; position: absolute; top: 28px; left: calc(50% - 1px); height: 22px; border-left: 2px solid var(--border-strong); }
.hierarchy-root ~ .hierarchy-children { padding-top: 22px; }
.hierarchy-root ~ .hierarchy-children::before { top: 0; }
.hierarchy-branch { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 11px; }
.hierarchy-children > .hierarchy-branch { padding-top: 22px; }
.hierarchy-children > .hierarchy-branch::before { content: ''; position: absolute; left: 0; right: 0; top: 0; border-top: 2px solid var(--border-strong); }
.hierarchy-children > .hierarchy-branch:first-child::before { left: calc(50% - 1px); }
.hierarchy-children > .hierarchy-branch:last-child::before { right: calc(50% - 1px); }
.hierarchy-children > .hierarchy-branch::after { content: ''; position: absolute; height: 22px; top: 0; left: calc(50% - 1px); border-left: 2px solid var(--border-strong); }
.hierarchy-node { position: relative; width: 180px; display: flex; flex-direction: column; gap: 9px; padding: 11px 13px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-xs); }
.hierarchy-node:has(> .hierarchy-company[href]:hover) { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.hierarchy-node > .badge { align-self: flex-start; }
.hierarchy-node > .cell-sub { font-size: var(--text-2xs); }
.hierarchy-root { width: 200px; }
.hierarchy-company { display: flex; align-items: flex-start; gap: 9px; color: var(--text-strong); }
.hierarchy-company:hover { text-decoration: none; }
/* The whole card opens the profile, as in the design; the meter stays above it for its tooltip. */
.hierarchy-company[href]::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.hierarchy-name { font-size: var(--text-sm); font-weight: var(--fw-semibold); line-height: 1.3; overflow-wrap: anywhere; }
.hierarchy-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: var(--radius-sm); background: var(--navy-900); color: white; font-size: var(--text-xs); font-weight: var(--fw-semibold); }
.hierarchy-root .hierarchy-avatar { background: var(--accent); color: var(--accent-contrast); }
.hierarchy-meter { position: relative; z-index: 1; display: flex; align-self: flex-start; align-items: center; gap: 5px; cursor: help; }
.hierarchy-bar { display: flex; flex: 0 0 32px; height: 5px; overflow: hidden; border-radius: var(--radius-pill); background: var(--gray-100); }
.hierarchy-bar-ok { background: var(--success-500); }
.hierarchy-bar-open { flex: 1; background: var(--warning-500); }
.hierarchy-bar-danger { background: var(--danger-500); }
.hierarchy-percent { font-size: var(--text-2xs); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-muted); }
.hierarchy-highlight { border-color: var(--amber-500); outline: 2px solid var(--amber-500); outline-offset: -2px; background: color-mix(in srgb, var(--amber-500) 10%, var(--surface-card)); }
.hierarchy-toggle { position: absolute; top: calc(100% + 6px); left: 50%; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; transform: translateX(-50%); border: 1px solid var(--border-default); border-radius: 50%; background: var(--surface-card); color: var(--text-muted); cursor: pointer; }
.hierarchy-toggle:hover { border-color: var(--border-strong); color: var(--text-strong); }
.hierarchy-toggle:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.hierarchy-company:focus-visible { outline: none; }
.hierarchy-company:focus-visible::after { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* Profiles are pages; only document actions open modal dialogs. */
.profile-page { min-width: 0; }
.profile-content { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
.profile-content-with-panel, .person-profile-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.profile-side-panel { box-sizing: border-box; min-width: 0; width: 320px; padding: var(--space-5); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); overflow-wrap: anywhere; }
.profile-side-panel { position: sticky; top: calc(var(--shell-top, 0px) + var(--space-4)); max-height: calc(100dvh - var(--shell-top, 0px) - 100px); overflow-y: auto; }
.profile-side-panel h2 { font-size: var(--text-lg); margin: 0 0 var(--space-3); }
.profile-side-panel h3 { font-size: var(--text-sm); margin: var(--space-5) 0 var(--space-2); }
.profile-panel-close { float: right; margin: -8px -8px 8px 8px; }
.profile-card-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.profile-full-link { display: block; margin-top: var(--space-5); }
.request-evidence-choice { display: block; margin: var(--space-2) 0; }
@media (max-width: 1023px) {
    .profile-content-with-panel { grid-template-columns: minmax(0, 1fr); }
    .profile-side-panel { position: fixed; top: 80px; right: var(--space-4); bottom: var(--space-4); z-index: 30; box-shadow: var(--shadow-lg); max-height: none; }
    .person-profile-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 639px) {
    .profile-side-panel { left: 0; right: 0; width: 100%; bottom: 0; border-radius: 0; }
}

/* Company overview: one compact row; secondary columns disappear in narrow windows. */
.company-list .data-table td { padding: 12px 16px; height: 51px; box-sizing: border-box; white-space: nowrap; }
.company-list .data-table th { white-space: nowrap; }
/* A long firm name moves to a second line rather than push the list past its card. */
.company-list .data-table td:first-child { white-space: normal; }
.company-list .numeric { text-align: right; }
.company-name { display: flex; align-items: center; gap: 9px; }
.company-name .dot { flex: none; margin: 0; }
.company-list .company-action { text-align: right; font-size: var(--text-xs); }
.company-list .company-projects .ratio { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--fw-regular); color: var(--text-body); }
.company-contact-cell { display: inline-flex; align-items: center; gap: 8px; }
.company-call {
    align-items: center; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
    color: var(--gray-600); display: inline-flex; flex: none; height: 26px; justify-content: center; width: 26px;
}
.company-call:hover { background: var(--gray-50); color: var(--text-strong); }
.company-contact-name {
    color: var(--text-body); font-size: var(--text-sm); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle;
}
/* The row's menu and the arrow stand side by side; an open menu floats over the list. */
.company-actions { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 4px 14px; justify-content: flex-end; }
.company-under { font-size: var(--text-xs); margin-left: 16px; }
/* P2: the project's chain as a tree - each firm a step further in than the firm it works under, joined to it by an elbow, as in NP2. */
.company-name-nested { padding-left: calc((var(--indent, 1) - 1) * 24px); }
.company-elbow {
    border-bottom: 2px solid var(--border-strong); border-bottom-left-radius: var(--radius-xs); border-left: 2px solid var(--border-strong);
    flex: none; height: 14px; margin-top: -10px; width: 14px;
}
/* The header that opens a section or a firm's group in the firm and person lists: quiet, uppercase,
   the way the design separates one group from the next without a box. A section stands out a step more. */
.group-row td {
    background: var(--surface-sunken); color: var(--text-muted); font-size: var(--text-2xs); font-weight: var(--fw-semibold);
    letter-spacing: 0.07em; padding: var(--space-2) var(--space-4); text-transform: uppercase;
}
.section-row td {
    background: var(--surface-card); border-top: 1px solid var(--border-subtle); color: var(--text-strong); font-size: var(--text-xs);
    font-weight: var(--fw-semibold); padding: var(--space-3) var(--space-4) var(--space-2);
}
.group-count { color: var(--text-subtle); font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-left: var(--space-2); }
.group-under { font-weight: var(--fw-regular); letter-spacing: normal; text-transform: none; }
/* On the sunken header row the muted grey falls short of 4.5:1; at the desk the firm above reads in the darker one. */
@media (min-width: 641px) {
    .group-under { color: var(--text-on-canvas-muted); }
}
.card-section { color: var(--text-strong); display: block; margin-bottom: var(--space-1); }
/* A firm said once in a person list: a section of one firm names it in its own line, the firm's line beneath is left
   out, and a row under its firm's header does not repeat the firm beneath the name. Where no header stands above -
   the list in an order the reader chose - a row with a position names the firm beside it. Phones keep what they had. */
.section-firm, .person-sub-firm { display: none; }
@media (min-width: 641px) {
    .section-firm, .person-sub-firm { display: inline; }
    .data-table tr.group-row-repeat { display: none; }
    .data-table .person-sub-repeat { display: none; }
}
/* The evidence column stacks its count, the exemption and the extra lines, right-aligned like the count. */
.company-documents-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
/* The extra lines beneath the count wrap inside the column rather than widen the list; the count itself stays on one line. */
.company-documents-stack .cell-sub { text-align: right; white-space: normal; }
/* In a list row the extras are two short words side by side, each explained on hover, focus or tap. */
.company-evidence-extras { display: inline-flex; flex-wrap: wrap; gap: 0 var(--space-3); justify-content: flex-end; }
/* A word with its kinds behind it says so with the dotted line a ratio with a tooltip has. */
.company-documents-stack .company-evidence-extras .tooltip-trigger { border-bottom: 1px dotted currentColor; border-radius: 0; }
@media (max-width: 1100px) { .company-list .company-projects { display: none; } }
@media (max-width: 900px) { .company-list .company-contact { display: none; } }
@media (max-width: 640px) {
    .company-list .company-documents, .company-list .company-people { display: none; }
    .company-list .data-table { min-width: 0; width: 100%; }
    .company-list .data-table td, .company-list .data-table th { padding: 12px 10px; }
    .company-list .data-table td:first-child { overflow-wrap: anywhere; }
    .company-list .company-invitation { white-space: normal; }
    .company-list .company-action { width: 1%; }
}

/* The contractor portal shares the shell and the existing tenant workflows. */
.contractor-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.contractor-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); color: inherit; text-decoration: none; }
.contractor-card:hover { border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.contractor-card:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
.contractor-card h2 { font-size: var(--text-md); margin: 0; }
.contractor-card p { color: var(--text-muted); margin: 0; line-height: 1.6; }
.contractor-card > span:last-child { margin-top: auto; font-weight: var(--fw-semibold); padding-top: 8px; }
.contractor-status { margin-bottom: 24px; padding: var(--space-6); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.contractor-status h2 { font-size: var(--text-xl); margin: var(--space-2) 0; }

/* INGO-192: the firms beneath a contractor's own engagement, indented by level. */
.engagement-branch { list-style: none; margin: 0; padding: 0; }
.engagement-branch-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) 0 var(--space-2) calc(var(--level, 1) * var(--space-5)); border-bottom: 1px solid var(--border-subtle); }
.engagement-branch-row:last-child { border-bottom: none; }
.hierarchy-incoming { margin-top: var(--space-6); }
.hierarchy-incoming-engagement { margin-bottom: var(--space-5); }
.hierarchy-incoming-engagement h3 { font-size: var(--text-md); margin: 0 0 var(--space-2); }

/* NU entry points use the same cards and tokens as the N1 design. */
.contractor-card > .icon { color: var(--navy-700); }
.contractor-status p { line-height: 1.5; }
.contractor-status > .cell-sub:first-child { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: .08em; }
.contractor-own-projects { margin-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.contractor-own-projects > summary { cursor: pointer; padding: var(--space-5) 0; font-weight: var(--fw-semibold); }
.contractor-own-projects > summary:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

@media (max-width: 640px) {
    .contractor-cards { gap: var(--space-3); }
    .contractor-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 6px 12px; padding: var(--space-4); }
    .contractor-card > .icon { grid-column: 1; grid-row: 1 / span 3; margin-top: 2px; }
    .contractor-card h2, .contractor-card p, .contractor-card > span:last-child { grid-column: 2; }
    .contractor-card h2 { font-size: var(--text-base); line-height: 1.4; }
    .contractor-card p { font-size: var(--text-sm); line-height: 1.5; }
    .contractor-card > span:last-child { font-size: var(--text-xs); padding-top: 6px; }
    .contractor-status { padding: var(--space-5); margin-bottom: var(--space-5); }
    .contractor-status .btn-primary { width: 100%; box-sizing: border-box; justify-content: center; }
    .contractor-shell :is(.btn-primary, .btn-secondary, .modal-close, .tab, .profile-tab, .segment, .pager-size select) { min-height: 44px; box-sizing: border-box; }
    .contractor-shell .modal-close { min-width: 44px; flex: none; }
    .contractor-shell :is(.search-input, .segment-filter, .trade-select, .modal input:not([type=checkbox]), .modal select, .modal textarea) { font-size: 16px; min-height: 44px; min-width: 0; }
    .contractor-shell .modal { box-sizing: border-box; max-height: calc(100dvh - 24px); overflow-wrap: anywhere; }
    .contractor-shell .modal-head { align-items: flex-start; gap: var(--space-3); }
    .contractor-shell .modal-head h2 { line-height: 1.4; margin: 8px 0; }
    .contractor-shell .modal-actions { flex-wrap: wrap; }
    .contractor-shell .modal-actions > button { flex: 1 1 auto; justify-content: center; }
    .contractor-shell .list-card-actions { flex-wrap: wrap; }
    .contractor-shell .list-card-actions > button { flex: 1 1 auto; justify-content: center; }
    /* Keep one release component and one set of rows: on phones each order
       becomes a card, with its expanded detail immediately below it. */
}

@media (max-width: 640px) {
    .contractor-shell .table-mobile-cards { overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .contractor-shell .table-mobile-cards :is(table, tbody) { display: block; width: 100%; }
    .contractor-shell .table-mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .contractor-shell .table-mobile-cards tr { display: flex; flex-direction: column; gap: 10px; padding: var(--space-4); margin-bottom: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); }
    .contractor-shell .table-mobile-cards td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    .contractor-shell .table-mobile-cards td[data-label]::before { content: attr(data-label); display: block; font: var(--fw-medium) var(--text-2xs) / 1.5 var(--font-sans); color: var(--text-muted); margin-bottom: 2px; }
    .contractor-shell .table-mobile-cards .cell-action { text-align: left; }
    .contractor-shell .table-mobile-cards .cell-action button { width: 100%; justify-content: center; }
    .contractor-shell .table-mobile-cards .btn-link { text-align: left; min-height: 44px; }
}

.profile-more-toggle { display: none; }
.profile-secondary-actions { display: contents; }
.profile-more-toggle[aria-expanded=true] .icon { transform: rotate(180deg); }
@media (max-width: 640px) {
    .contractor-shell .profile-actions:has(.profile-secondary-actions button) .profile-more-toggle { display: flex; grid-column: 1 / -1; justify-content: center; gap: 8px; color: var(--text-muted); background: transparent; border-color: transparent; }
    .contractor-shell .profile-secondary-actions { display: none; }
    .contractor-shell .profile-secondary-actions.open { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
}

/* The second lock in front of the upload link and the status page (V102):
   the code and, where on file, the birth date, on both account-free doors. */
.access-challenge form + form { margin-top: var(--space-3); }
.access-challenge label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--space-4);
}
.access-challenge input:not([type="hidden"]) {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    margin-top: var(--space-1);
    padding: 9px 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background-color: var(--surface-card);
    font-family: var(--font-sans);
    /* 16px keeps a phone from zooming into the field - off the type scale on purpose. */
    font-size: 16px;
}
.access-challenge input[name="code"] { letter-spacing: 0.3em; }
.access-challenge input:focus { outline: none; border-color: var(--amber-500); }
.access-challenge-banner {
    background: var(--danger-100);
    color: var(--danger-text);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
}

/* The two wage administration pages - statutory rates and a person's wage
   classification - share one form layout. */
.wage-admin { display: grid; gap: 24px; max-width: 1120px; }
.wage-fields { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.wage-field { display: grid; gap: 8px; font-size: var(--text-base); font-weight: var(--fw-semibold); margin-bottom: 20px; }
.wage-field input, .wage-field select, .wage-field textarea { padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); font: inherit; background: white; color: inherit; }
.wage-field textarea { width: 100%; box-sizing: border-box; }
.wage-source { overflow-wrap: anywhere; max-width: 420px; }
@media(max-width: 680px) { .wage-fields { display: grid; } }


/* How long a piece has waited or has left, in the design's chip (U4, G12):
   quiet while there is time, amber when it gets close, red when it is late.
   Words in the sans face (ABWEICHUNGEN 499); the digits take their own widths, as in the
   pills' counts (ABWEICHUNGEN 540). Phones keep the tabular figures they had. */
.waiting {
    border-radius: var(--radius-sm);
    display: inline-block;
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    padding: 4px 8px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .waiting {
        font-variant-numeric: tabular-nums;
    }
}

.waiting-neutral {
    background: var(--gray-100);
    color: var(--gray-500);
}

.waiting-warning {
    background: var(--warning-100);
    color: var(--warning-text);
}

.waiting-danger {
    background: var(--danger-100);
    color: var(--danger-text);
}


/* "Firma" beside a holder that is a firm, not a person. */
.tag {
    background: var(--gray-100);
    border-radius: var(--radius-pill);
    color: var(--gray-600);
    font-size: var(--text-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.06em;
    margin-left: 8px;
    padding: 2px 8px;
    text-transform: uppercase;
}

.review-filters label.segment-filter { font-size: var(--text-sm); }
.expiry-filters .segment-filter { margin-left: 0; }
.company-engagement-state { margin: 4px 0 0 16px; }

/* A list page's first row (G1, G2, G5, G6 in DS26; ABWEICHUNGEN 207, 499): which side of the list
   is shown on the left - "Aktiv · Archiviert", a project's lifecycle -, the page's one action on the
   right, a refresh beside it. Every list page draws it the same way, with or without the switch. */
.list-action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.list-action-row .archive-toggle {
    margin-bottom: 0;
}

.list-action-row > .hero-actions {
    margin-left: auto;
}

/* Which side of a list is shown: "Aktiv · Archiviert (n)" above the firm and person lists (V168, V169,
   E-246 (2)), "Aktiv · Abgeschlossen (n) · Archiviert (n)" above the projects - underlined words, not
   segments, so they read as the side and the segments beneath as what narrows it. */
.archive-toggle {
    align-items: center;
    display: flex;
    font-size: var(--text-sm);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.archive-side {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-on-canvas-muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: inherit;
    padding: var(--space-1) 0;
}

.archive-side-on {
    border-bottom-color: currentColor;
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
}

.archive-dot {
    color: var(--text-subtle);
}

/* The segments and the chip "Einladung offen" beside them, wrapping together. Never wider
   than the row: a group longer than a phone scrolls inside its own pill instead of pushing
   the page sideways. */
.hero-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    max-width: 100%;
    min-width: 0;
}

/* ==== Page change =========================================================
   One page fading into the next, begun in Routes and held open by
   js/view-transition.js. Browsers without the API change pages as before. */
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: var(--duration-page);
    animation-timing-function: var(--ease-standard);
}

/* The sidebar is not part of the page: it stands in its own layer and shows
   the state it has after the change - the entry that is now current is lit at
   once, not dissolved into - while the page fades beside it. Every page in
   the circuit has the sidebar on both sides of a change, so there is always
   an old and a new image to choose between. */
::view-transition-old(sidebar) {
    display: none;
}

::view-transition-new(sidebar) {
    animation: none;
}

/* The back of an ID card on site appears with the kind (INGO-321, form-check.js). */
.site-upload[hidden],
.site-verify-error[hidden] {
    display: none;
}

/* The drawing area a person signs on (SignaturePad, js/signature-pad.js):
   a wide, dashed field the finger does not scroll, its buttons in one row.
   A handed-over pad (data-signed) is locked and says so by its border. */
.signature-pad {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.signature-pad-canvas {
    display: block;
    width: 100%;
    height: clamp(140px, 28vw, 280px);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    touch-action: none;
    box-sizing: border-box;
}

.signature-pad[data-signed="1"] .signature-pad-canvas {
    border-style: solid;
    border-color: var(--border-default);
}

/* A pad with a hint (SignaturePad Hint, the A kit's signing sheet): the line
   to sign on and the hint under it lie behind the drawing, so the canvas is
   clear and its area carries the ground. */
.signature-pad-area {
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    position: relative;
}

.signature-pad-area .signature-pad-canvas {
    background: transparent;
    position: relative;
    z-index: 1;
}

.signature-pad-line {
    border-bottom: 1.5px solid var(--navy-300);
    bottom: 40px;
    left: 24px;
    position: absolute;
    right: 24px;
}

.signature-pad-hint {
    bottom: 12px;
    color: var(--text-muted);
    font: var(--fw-regular) var(--text-sm)/1.3 var(--font-sans);
    left: 0;
    position: absolute;
    right: 0;
    text-align: center;
}

.signature-pad-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
}

.signature-pad-empty {
    color: var(--danger-text);
    font-weight: var(--fw-semibold);
    margin: 0;
}

/* The sheet the person signs a briefing on (V167): wide, the person on top,
   the sentence large enough to read in someone else's hand. Held upright,
   the device asks to be turned. */
.briefing-signature-sheet {
    max-width: 960px;
}

.briefing-signature-sheet [hidden] {
    display: none !important;
}

.briefing-signer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.briefing-signer .site-person-photo {
    width: 72px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.briefing-signer-name {
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    margin: 0;
}

.briefing-declaration {
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--text-strong);
    margin: 0 0 var(--space-1);
}

.briefing-declaration-meta {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3);
}

.briefing-rotate-hint {
    display: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

@media (orientation: portrait) and (max-width: 40rem) {
    .briefing-rotate-hint {
        display: block;
    }
}

.briefing-handback {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.briefing-unsigned-reasons {
    border: 0;
    padding: 0;
    margin: var(--space-3) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.briefing-unsigned-reason {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
}

/* The proof of the briefings confirmed for a person, on the person page. */
.briefing-proof-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.briefing-proof {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.briefing-proof:last-child {
    border-bottom: 0;
}

.briefing-proof-main {
    min-width: 0;
}

.briefing-proof-name {
    margin: 0;
}

.briefing-proof-main .cell-sub {
    margin: 2px 0 0;
}

.briefing-signature-frame {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    color: var(--text-strong);
}

.signature-image {
    display: block;
    width: 100%;
    height: auto;
}

/* ---- Site channel: discs and pills shared by B5 and B12 (V174, V178) ----
   The roster's sign in a disc and an activity as a pill (b-status.css), for
   pages beyond the roster row, whose own copy stays scoped to it. */
.site-disc {
    align-items: center;
    border-radius: var(--radius-pill);
    display: flex;
    flex: none;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.site-disc .site-sign {
    height: 17px;
    width: 17px;
}

.site-disc-ok { background: var(--site-ok-bg); color: var(--site-ok); }
.site-disc-warning { background: var(--site-soon-bg); color: var(--site-soon); }
.site-disc-danger { background: var(--site-bad-bg); color: var(--site-bad); }
.site-disc-neutral { background: var(--site-np-bg); color: var(--site-np); }

.site-disc-own {
    background: var(--navy-100);
    color: var(--navy-700);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: var(--fw-semibold);
}

.site-pill {
    align-items: center;
    border-radius: var(--radius-pill);
    display: inline-flex;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: var(--fw-semibold);
    gap: 5px;
    padding: 3px 9px 3px 7px;
    white-space: nowrap;
}

.site-pill .site-sign { height: 13px; width: 13px; }
.site-pill-ok { background: var(--site-ok-bg); color: var(--site-ok); }
.site-pill-warning { background: var(--site-soon-bg); color: var(--site-soon); }

/* ---- B5 "Prüfen" (V174, E-254 (6)): camera, tray, joint check-in ---- */

.site-b5-camera {
    background: radial-gradient(120% 90% at 50% 40%, #2b3749 0%, #1c2330 70%, #12161f 100%);
    border-radius: 20px;
    gap: 14px;
    margin-bottom: 0;
    min-height: 0;
    padding: 0;
    transition: height .2s ease;
}

.site-b5-camera-large { height: 330px; }
.site-b5-camera-small { height: 250px; }

.site-b5-frame {
    pointer-events: none;
    position: relative;
}

.site-b5-camera-large .site-b5-frame { height: 170px; width: 170px; }
.site-b5-camera-small .site-b5-frame { height: 110px; width: 110px; }

.site-b5-corner {
    color: var(--amber-500);
    height: 26px;
    position: absolute;
    width: 26px;
}

.site-b5-corner-tl { border-left: 4px solid currentColor; border-radius: 9px 0 0 0; border-top: 4px solid currentColor; left: 0; top: 0; }
.site-b5-corner-tr { border-radius: 0 9px 0 0; border-right: 4px solid currentColor; border-top: 4px solid currentColor; right: 0; top: 0; }
.site-b5-corner-bl { border-bottom: 4px solid currentColor; border-left: 4px solid currentColor; border-radius: 0 0 0 9px; bottom: 0; left: 0; }
.site-b5-corner-br { border-bottom: 4px solid currentColor; border-radius: 0 0 9px 0; border-right: 4px solid currentColor; bottom: 0; right: 0; }

.site-b5-camera-text {
    color: var(--white);
    font-size: 15px;
    font-weight: var(--fw-semibold);
    margin: 0;
    position: relative;
}

.site-b5-camera-status {
    background: transparent;
    font-size: 12px;
    margin: -8px 0 0;
}

.site-b5-search {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-sizing: border-box;
    color: var(--navy-900);
    display: flex;
    font-size: 14.5px;
    font-weight: var(--fw-semibold);
    gap: 8px;
    justify-content: center;
    margin: 10px 0 6px;
    padding: 13px;
    text-decoration: none;
    width: 100%;
}

.site-b5-search:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.site-b5-search .icon { color: var(--navy-700); }

.site-b5-code {
    margin: 0 0 var(--space-3);
}

.site-b5-code > summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12.5px;
    list-style: none;
    padding: 6px 0;
    text-align: center;
}

.site-b5-code > summary::-webkit-details-marker { display: none; }
.site-b5-code[open] > summary { margin-bottom: var(--space-2); }

.site-b5-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-b5-row {
    align-items: center;
    display: flex;
    gap: 11px;
    padding: 11px 8px 11px 12px;
}


.site-b5-row-link {
    align-items: center;
    color: inherit;
    display: flex;
    flex: 1;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
}

.site-b5-row-link:hover { color: inherit; text-decoration: none; }

.site-b5-row-main {
    flex: 1;
    min-width: 0;
}

.site-b5-row-name {
    color: var(--text-strong);
    display: block;
    font-size: 14.5px;
    font-weight: var(--fw-semibold);
}

.site-b5-row-state {
    display: block;
    font-size: 12.5px;
    font-weight: var(--fw-semibold);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-b5-row-state-ok { color: var(--site-ok); }
.site-b5-row-state-warning { color: var(--site-soon); }
.site-b5-row-state-danger { color: var(--site-bad); }
.site-b5-row-state-neutral { color: var(--site-np); }
.site-b5-row-state-muted { color: var(--text-muted); font-weight: var(--fw-regular); }

.site-b5-row-firm {
    color: var(--text-muted);
    font-weight: var(--fw-regular);
}

.site-b5-remove {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--text-subtle);
    cursor: pointer;
    display: flex;
    flex: none;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.site-b5-remove:hover { background: var(--navy-50); color: var(--text-strong); }

.site-b5-empty {
    color: var(--text-muted);
    font-size: 13.5px;
    padding: 22px 16px;
    text-align: center;
}

/* Under the check-in: who stays in the tray, grey (E-292 (2)). */
.site-b5-stays {
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.4;
    margin: 8px 0 0;
    text-align: center;
}

/* E-292 (5): the card over the tray for everyone it keeps - report, remind, and when it was done. */
.site-b5-bulk {
    border-color: #f3c6c8;
    margin-bottom: 10px;
    padding: 12px;
}

.site-b5-bulk-title {
    align-items: center;
    color: var(--site-bad);
    display: flex;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    gap: 8px;
    margin: 0 2px 10px;
}

.site-b5-bulk-actions {
    display: flex;
    gap: 8px;
}

.site-b5-bulk-action {
    align-items: center;
    background: var(--surface-card);
    border: 1.5px solid var(--navy-200);
    border-radius: 14px;
    box-sizing: border-box;
    color: var(--navy-900);
    display: flex;
    flex: 1 1 0;
    font-size: 13.5px;
    font-weight: var(--fw-semibold);
    gap: 6px;
    justify-content: center;
    line-height: normal;
    min-height: 44px;
    min-width: 0;
    padding: 11px 8px;
    text-align: center;
    text-decoration: none;
}

.site-b5-bulk-action:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.site-b5-bulk-action .icon { color: var(--navy-700); flex: none; }

/* V248, E-357: "Vor Ort bestätigen" over the tray - one line per thing open, at most three, then "+n weitere" -,
   the note after a confirmation with "Rückgängig" for ten seconds, and on sheet 2 the document in its languages. */
.site-b5-confirm {
    align-items: center;
    color: var(--navy-900);
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    text-decoration: none;
}

.site-b5-confirm:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.site-b5-confirm > .icon { color: var(--navy-700); flex: none; }

.site-b5-confirm-title {
    align-items: center;
    display: flex;
    flex: none;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    gap: 6px;
}

.site-b5-confirm-lines {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-b5-confirm-line {
    display: flex;
    font-size: 13.5px;
    gap: 6px;
    justify-content: space-between;
}

.site-b5-confirm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-b5-confirm-count, .site-b5-confirm-more { color: var(--navy-500); flex: none; font-size: 13px; }

.site-b5-confirmed {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 12px;
}

.site-b5-confirmed-text {
    align-items: center;
    display: flex;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    gap: 8px;
    margin: 0;
}

.site-b5-confirmed-undo {
    background: none;
    border: 0;
    color: var(--navy-900);
    cursor: pointer;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    padding: 4px 2px;
    text-decoration: underline;
}

.site-b5-confirm-documents {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 8px;
    margin: 0 2px 10px;
}

.site-b5-confirm-documents a { font-weight: var(--fw-semibold); }

/* E-331: when a person was reported or their firm reminded today, under the row's state - in the words and
   size the kit (B5) gives the stamp. */
.site-b5-row-stamp {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

/* The sheet: tap a person to lay them in the tray or take them out; a firm's head lays the firm (E-292 (1)). */
.site-b5-picks {
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    max-height: 380px;
    overflow-y: auto;
}

.site-b5-picks form { margin: 0; }

.site-b5-picks .site-rows {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.site-b5-group + .site-b5-group { border-top: 1px solid var(--border-subtle); }

.site-b5-group-head {
    align-items: center;
    background: var(--navy-50);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
    min-height: 40px;
    padding: 6px 12px 4px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.site-b5-group-name {
    color: var(--navy-900);
    flex: 1;
    font-size: 13.5px;
    font-weight: var(--fw-semibold);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-b5-group-count {
    color: var(--text-muted);
    flex: none;
    font-size: 12.5px;
}

.site-b5-group-all {
    background: transparent;
    border: 0;
    color: var(--navy-700);
    cursor: pointer;
    flex: none;
    font: inherit;
    font-size: 13px;
    font-weight: var(--fw-semibold);
    min-height: 32px;
    padding: 4px 2px 4px 8px;
}

.site-b5-group-all:hover { color: var(--navy-900); text-decoration: underline; }

/* Checked in today: greyed, without a box, and no tap. */
.site-b5-pick-today { cursor: default; opacity: .55; }
.site-b5-pick-today:hover { background: var(--surface-card); }
.site-b5-check.site-b5-check-none { border-color: transparent; }

/* B5's sheets as the kit draws them (.bc-sheet-t / .bc-sheet-s): a plain title, a grey line under it. */
.site-b5-sheet-title {
    color: var(--navy-900);
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    margin: 0 2px;
}

.site-b5-sheet-empty {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0;
    padding: 12px 2px;
    text-align: center;
}

/* The bulk sheets: who it is about, the note, the send. */
.site-b5-sheet-sub {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: -12px 2px 0;
}

.site-b5-list {
    box-shadow: none;
    max-height: 250px;
    overflow-y: auto;
}

.site-b5-list-row {
    align-items: center;
    display: flex;
    gap: 11px;
    padding: 10px 12px;
}

.site-b5-sheet-form {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.site-b5-note-label {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: var(--fw-semibold);
    margin: 0 2px 6px;
}

.site-b5-note {
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--text-strong);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
    min-height: 70px;
    padding: 10px 12px;
    resize: none;
    width: 100%;
}

.site-b5-sheet-cancel { margin: -8px 0 0; }

/* After the check-in: who lies on in the tray, with the way back to it. */
.site-b5-left {
    align-items: center;
    background: var(--site-bad-bg);
    border-radius: 14px;
    color: var(--site-bad);
    display: flex;
    font-size: 13px;
    gap: 8px;
    line-height: 1.4;
    margin: 10px 0 0;
    padding: 12px 14px;
}

.site-b5-left a {
    color: inherit;
    font-weight: var(--fw-semibold);
    margin-left: auto;
    text-decoration: underline;
    white-space: nowrap;
}

.site-b5-pick {
    align-items: center;
    background: var(--surface-card);
    border: 0;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 11px;
    padding: 11px 12px;
    text-align: left;
    width: 100%;
}

.site-b5-pick:hover { background: var(--navy-50); }

.site-b5-check {
    align-items: center;
    border: 2px solid var(--navy-200);
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--white);
    display: flex;
    flex: none;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.site-b5-check-on { background: var(--navy-900); border-color: var(--navy-900); }
/* The sheet's rows end in the bare sign of the verdict, as the kit draws them. */
.site-b5-pick-sign { display: flex; flex: none; padding: 0 4px; }
.site-b5-pick-sign .site-sign { height: 17px; width: 17px; }

.site-b5-sheet-done { margin-top: var(--space-1); }

/* The result after the check-in. */
.site-b5-done {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px 20px 6px;
    text-align: center;
}

.site-b5-done-disc {
    align-items: center;
    background: var(--site-ok-bg);
    border-radius: var(--radius-pill);
    color: var(--site-ok);
    display: flex;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.site-b5-done-disc .site-sign { height: 26px; width: 26px; }

.site-b5-done-title {
    color: var(--text-strong);
    font-size: 17px;
    font-weight: var(--fw-semibold);
    margin: 0;
}

.site-b5-done-text {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    max-width: 260px;
}

.site-b5-metrics {
    display: flex;
    gap: 8px;
}

.site-b5-metric {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
}

.site-b5-metric-num {
    color: var(--text-strong);
    font-size: 26px;
    font-weight: var(--fw-bold);
    line-height: 1;
}

.site-b5-metric-label {
    align-items: center;
    display: flex;
    font-size: 11.5px;
    font-weight: var(--fw-semibold);
    gap: 5px;
    margin-top: 6px;
}

.site-b5-metric-ok { color: var(--site-ok); }
.site-b5-metric-neutral { color: var(--site-np); }
.site-b5-metric-danger { color: var(--site-bad); }

.site-b5-staffing {
    align-items: center;
    border-radius: 14px;
    display: flex;
    font-size: 13px;
    gap: 9px;
    line-height: 1.4;
    margin-bottom: 6px;
    padding: 13px 14px;
    text-decoration: none;
}

.site-b5-staffing:hover { filter: brightness(.98); text-decoration: none; }
.site-b5-staffing-ok { background: var(--site-ok-bg); color: var(--site-ok); }
.site-b5-staffing-danger { background: var(--site-bad-bg); color: var(--site-bad); }
.site-b5-staffing-text { flex: 1; min-width: 0; }
.site-b5-staffing-text b { font-weight: var(--fw-bold); }

/* ---- B12 "Heute vor Ort" (V178, E-254 (7)) ---- */
.site-b12 {
    display: flex;
    flex-direction: column;
}

.site-b12-rules,
.site-b12-people {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-b12-rule {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 13px 14px;
}


.site-b12-rule-name {
    color: var(--text-strong);
    font-size: 14.5px;
    font-weight: var(--fw-semibold);
}

.site-b12-rule-state {
    align-items: center;
    display: flex;
    flex: none;
    font-size: 13.5px;
    font-weight: var(--fw-semibold);
    gap: 8px;
}

.site-b12-rule-state-ok { color: var(--site-ok); }
.site-b12-rule-state-danger { color: var(--site-bad); }
.site-b12-rule-state-neutral { color: var(--site-np); }

.site-b12-dots {
    display: flex;
    gap: 3px;
}

.site-b12-dot {
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    display: block;
    height: 8px;
    width: 8px;
}

.site-b12-dot-filled { background: currentColor; }

.site-b12-person {
    align-items: center;
    display: flex;
    gap: 11px;
    padding: 11px 10px 11px 12px;
}


.site-b12-person-main {
    flex: 1;
    min-width: 0;
}

.site-b12-person-name {
    align-items: center;
    color: var(--text-strong);
    display: flex;
    flex-wrap: wrap;
    font-size: 14.5px;
    font-weight: var(--fw-semibold);
    gap: 6px;
}

.site-b12-person-firm {
    color: var(--text-muted);
    display: block;
    font-size: 12.5px;
    margin-top: 1px;
}

.site-b12-out {
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-muted);
    display: flex;
    flex: none;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.site-b12-out:hover { background: var(--navy-50); color: var(--text-strong); }

.site-b12-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 30px 24px;
    text-align: center;
}

.site-b12-add {
    align-items: center;
    background: var(--surface-card);
    border: 1.5px dashed var(--navy-200);
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--navy-700);
    display: flex;
    font-size: 14px;
    font-weight: var(--fw-semibold);
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
    padding: 12px;
    text-decoration: none;
    width: 100%;
}

.site-b12-add:hover { border-color: var(--navy-500); color: var(--navy-900); text-decoration: none; }

/* The question in the middle (E-254 (2)): not a sheet from below. */
.site-b12-overlay {
    align-items: center;
    padding: 24px;
}

.site-b12-dialog {
    background: var(--surface-card);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 22rem;
    padding: 20px 18px 16px;
    width: 100%;
}

.site-b12-dialog form { margin: 0; }

.site-b12-dialog-title {
    color: var(--text-strong);
    font-size: 16px;
    font-weight: var(--fw-semibold);
    line-height: 1.35;
    margin: 0 0 8px;
}

.site-b12-dialog-confirm {
    background: var(--navy-900);
    border: 0;
    border-radius: var(--radius-md);
    color: var(--white);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: var(--fw-semibold);
    padding: 12px 14px;
    width: 100%;
}

.site-b12-dialog-cancel {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: var(--fw-semibold);
    padding: 10px;
    text-align: center;
    text-decoration: none;
}

/* The roles of an account as labels (E-267): one per role, first role first,
   wrapping where several do not fit - in the member list, the member dialog
   and the head of a person's profile alike. */
.role-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    vertical-align: middle;
}

.role-tag {
    background: var(--gray-100);
    border-radius: 12px;
    color: var(--gray-600);
    display: inline-block;
    font-size: var(--text-2xs);
    line-height: 1.4;
    padding: 3px 9px;
    white-space: nowrap;
}

/* V220 (E-310 (4)): where the principal provides a type itself, the firm's row names who does instead of an upload. */
.evidence-provided-hint {
    color: var(--text-subtle);
    font-size: var(--text-sm);
    line-height: 1.35;
    text-align: right;
}

/* "Nutzungsbedingungen" and "Impressum" (V236): in a frame's menu, or at the foot of a page without a menu. */
.legal-links {
    display: flex;
    flex-wrap: wrap;
    font-size: var(--text-sm);
    gap: var(--space-1) var(--space-4);
}

.legal-links-menu {
    padding: var(--space-2) var(--space-3);
}

.legal-links-foot {
    justify-content: center;
    padding: var(--space-4) var(--space-4) var(--space-8);
}

.legal-link {
    color: var(--text-muted);
    text-decoration: underline;
}

.legal-link:hover,
.legal-link:focus-visible {
    color: var(--text-strong);
}

/* The checkbox of the terms of use (V237, V238). */
.terms-accept {
    display: grid;
    gap: var(--space-1);
    margin: var(--space-4) 0 0;
}

.terms-accept-label {
    align-items: flex-start;
    display: flex;
    gap: var(--space-2);
}

.terms-accept-label input {
    flex: none;
    height: 20px;
    margin-top: 2px;
    width: 20px;
}

.terms-accept-label a {
    color: var(--text-link);
    text-decoration: underline;
}

.terms-accept-missing {
    color: var(--danger-600);
    font-size: var(--text-sm);
    margin: 0;
}

.terms-accept.is-missing .terms-accept-label input {
    outline: 2px solid var(--danger-600);
    outline-offset: 2px;
}

.terms-accept-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0;
}

/* "Nutzungsbedingungen akzeptieren" without an account (INGO-631): the box in one card, "Weiter" in the foot. */
.terms-link-card {
    padding: var(--space-4);
}

.terms-link-card .terms-accept {
    margin: 0;
}
