/* Raleway als variable Schrift (Schnitte 100 bis 900), lokal gebündelt, Lizenz SIL OFL 1.1 */
@font-face {
    font-family: Raleway;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/Raleway-Variable.woff2") format("woff2");
}

:root {
    color-scheme: light;

    /* Corporate Identity RaDigSol */
    --wz-azure: #005077;
    --wz-azure-dark: #003d5c;
    --wz-fiber-green: #95c11f;
    --wz-cobalt: #00223e;

    /* Semantische Farben, getrennt vom Akzent */
    --wz-danger: #b3261e;
    --wz-danger-bg: #fbe9e7;
    --wz-warning: #b26a00;
    --wz-warning-bg: #fff4e0;
    /* „In Arbeit“ (#211): kräftiges Orange, bewusst abgesetzt vom Bernstein für „wartend/offline“. Nur für Flächen, nicht für Text. */
    --wz-in-progress: #e8590c;
    --wz-info-bg: #e6f0f5;

    --wz-text: #1b1b1b;
    --wz-muted: #5a5a5a;
    --wz-background: #f4f6f8;
    --wz-surface: #ffffff;
    --wz-border: #c9d1d8;
    --wz-link: #005077;
    --wz-heading: #00223e;
    --wz-touch: 48px;
    --wz-radius: 8px;
}

/* Dunkel: automatisch nach Gerät oder ausdrücklich gewählt. Kontrast bleibt hoch (Sonne, Handschuhe). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --wz-azure: #2a8fc0;
        --wz-azure-dark: #1f759f;
        --wz-danger: #ff8a80;
        --wz-danger-bg: #3a1c1a;
        --wz-warning: #ffb74d;
        --wz-warning-bg: #3a2a10;
        --wz-info-bg: #12303f;
        --wz-text: #e8edf2;
        --wz-muted: #a7b1bb;
        --wz-background: #0f1720;
        --wz-surface: #182230;
        --wz-border: #2e3d4d;
        --wz-link: #6fc3ec;
        --wz-heading: #e8edf2;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --wz-azure: #2a8fc0;
    --wz-azure-dark: #1f759f;
    --wz-danger: #ff8a80;
    --wz-danger-bg: #3a1c1a;
    --wz-warning: #ffb74d;
    --wz-warning-bg: #3a2a10;
    --wz-info-bg: #12303f;
    --wz-text: #e8edf2;
    --wz-muted: #a7b1bb;
    --wz-background: #0f1720;
    --wz-surface: #182230;
    --wz-border: #2e3d4d;
    --wz-link: #6fc3ec;
    --wz-heading: #e8edf2;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: Raleway, "Segoe UI", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.45;
    color: var(--wz-text);
    background: var(--wz-background);
}

h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--wz-heading); }
h1:focus { outline: none; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--wz-azure); }
p { margin: 0 0 1rem; }
a { color: var(--wz-link); }
.muted { color: var(--wz-muted); }

/* App-Rahmen */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    display: flex; align-items: center; gap: 1rem;
    min-height: 56px; padding: 0 1rem;
    background: var(--wz-cobalt); color: #fff;
}
.brand { color: #fff; font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.tenant-badge { display: flex; align-items: center; gap: 0.5rem; margin-right: auto; color: #cfe3ee; font-size: 0.95rem; min-width: 0; }
.tenant-badge img { height: 32px; width: auto; max-width: 120px; border-radius: 4px; background: #fff; padding: 2px; }
.tenant-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .tenant-badge span { display: none; } }
.hours { display: flex; flex-direction: column; gap: 0.4rem; }
.hours-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.hours-day { min-width: 9rem; }
.time { font: inherit; min-height: var(--wz-touch); padding: 0 0.6rem; border: 2px solid var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-surface); color: var(--wz-text); }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo-preview { max-height: 96px; max-width: 240px; background: #fff; padding: 4px; border-radius: var(--wz-radius); }
.user { font-weight: 600; }
.user-link { display: inline-flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; min-height: var(--wz-touch); }
/* Menü am eigenen Namen (WZ-215): Profil und weiteres Gerät anmelden. */
button.user-link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.user-menu { position: relative; }
.user-menu-backdrop { position: fixed; inset: 0; z-index: 20; }
.user-menu-list {
    position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 21; min-width: 15rem;
    display: flex; flex-direction: column; padding: 0.25rem;
    background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: var(--wz-radius);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
}
.user-menu-list a, .user-menu-list button { display: flex; align-items: center; min-height: var(--wz-touch); padding: 0 0.75rem; color: var(--wz-text); text-decoration: none; font-weight: 600; border-radius: calc(var(--wz-radius) - 2px); }
.user-menu-list a:hover, .user-menu-list a:focus-visible, .user-menu-list button:hover, .user-menu-list button:focus-visible { background: var(--wz-background); }
/* Abmelden steht abgesetzt unten, damit es nicht aus Versehen statt des Profils getroffen wird. */
.user-menu-logout { font: inherit; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; margin-top: 0.25rem; border-top: 1px solid var(--wz-border) !important; border-radius: 0 0 calc(var(--wz-radius) - 2px) calc(var(--wz-radius) - 2px) !important; }
/* Am Handy steht der Name mitten in der Kopfzeile; ein am Namen ausgerichtetes Menü ragte links aus dem Bild. */
@media (max-width: 600px) {
    .user-menu-list { position: fixed; top: calc(56px + 0.25rem); left: 0.5rem; right: 0.5rem; min-width: 0; }
}

/* QR-Code für ein weiteres Gerät und Scanner (WZ-215) */
.pairing { text-align: center; }
.pairing-qr svg { width: min(18rem, 100%); height: auto; background: #fff; padding: 0.75rem; border-radius: var(--wz-radius); }
.pairing-timer { margin-top: 0.75rem; }
.qr-scanner { display: flex; flex-direction: column; gap: 0.5rem; }
.qr-scanner-video { width: 100%; max-height: 60vh; border-radius: var(--wz-radius); background: #000; object-fit: cover; }
.avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; letter-spacing: 0.02em; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-name { font-size: 1.3rem; }
@media (max-width: 480px) { .user { display: none; } }
.page { flex: 1; width: 100%; max-width: 64rem; margin: 0 auto; padding: 1rem 1rem 5rem; }
/* Neue Version (WZ-1208): oben angeheftet, damit sie auch weiter unten auf der Seite nicht übersehen wird. */
.update-banner {
    position: sticky; top: 0; z-index: 15;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem;
    padding: 0.5rem 1rem; background: var(--wz-info-bg); color: var(--wz-text);
    border-bottom: 3px solid var(--wz-azure);
}
.update-banner-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* Auf der Anmeldung steht der Hinweis oben im Fluss; die Karte bleibt im restlichen Platz mittig und wird nicht verdeckt. */
.login-shell .update-banner { align-self: stretch; margin: -1rem -1rem auto; }
.login-shell .update-banner + .login-card { margin-bottom: auto; }
.app-footer { order: 99; text-align: center; font-size: 0.8rem; padding: 0.5rem 1rem 5rem; color: var(--wz-muted); }
.app-footer a { color: inherit; }
@media (min-width: 900px) { .app-footer { padding-bottom: 1rem; } }
code { font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }

/* Navigation: unten am Handy, oben am Desktop */
.app-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: space-around;
    background: var(--wz-surface); border-top: 1px solid var(--wz-border);
}
.nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 60px; min-width: var(--wz-touch); flex: 1; padding: 0.4rem;
    color: var(--wz-muted); font-weight: 600; font-size: 0.85rem; text-decoration: none;
}
.nav-link.active { color: var(--wz-azure); box-shadow: inset 0 3px 0 var(--wz-azure); }
.nav-icon { font-size: 1.4rem; }
/* Beschriftungen nie ineinanderlaufen lassen: lieber abgeschnitten als unlesbar. */
.nav-link > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link.nav-more { font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; }

/* „Mehr“ (#196): am Handy ein Feld über der Leiste mit einem Abschnitt je Untermenü, am Desktop je Untermenü eine aufklappende Liste. */
.nav-group { display: none; }
.nav-group.open {
    display: flex; flex-direction: column;
    position: absolute; bottom: 100%; left: 0; right: 0;
    max-height: calc(100vh - 60px - 56px); overflow-y: auto;
    background: var(--wz-surface); border-top: 1px solid var(--wz-border);
    box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35); padding: 0.25rem;
}
.nav-sub-title { display: block; padding: 0.5rem 0.75rem 0; color: var(--wz-muted); font-size: 0.8rem; font-weight: 700; }
.nav-sub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.nav-sub-toggle, .nav-backdrop { display: none; }

@media (min-width: 900px) {
    .app-nav { position: static; justify-content: flex-start; padding: 0 1rem; border-top: 0; border-bottom: 1px solid var(--wz-border); }
    .nav-link { flex: 0 0 auto; flex-direction: row; gap: 0.5rem; min-height: 52px; padding: 0 1rem; }
    .nav-link.active { box-shadow: inset 0 -3px 0 var(--wz-azure); }
    .nav-link.nav-more { display: none; }
    /* display: contents – die Untermenüs stehen unmittelbar in der Leiste. */
    .nav-group, .nav-group.open { display: contents; }
    .nav-sub { position: relative; display: flex; }
    .nav-sub-title { display: none; }
    .nav-sub-toggle { display: flex; font-family: inherit; background: none; border: 0; cursor: pointer; }
    .nav-sub-toggle::after { content: "▾"; font-size: 0.8em; }
    .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 20; }
    .nav-sub-list {
        display: none; position: absolute; top: 100%; left: 0; z-index: 21; min-width: 14rem;
        flex-direction: column; padding: 0.25rem;
        background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: var(--wz-radius);
        box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
    }
    .nav-sub.open .nav-sub-list { display: flex; }
    .nav-sub-list .nav-link { justify-content: flex-start; min-height: var(--wz-touch); padding: 0 0.75rem; border-radius: calc(var(--wz-radius) - 2px); }
    .nav-sub-list .nav-link:hover, .nav-sub-list .nav-link:focus-visible { background: var(--wz-background); }
    .nav-sub-list .nav-link.active { box-shadow: inset 3px 0 0 var(--wz-azure); }
    /* Bleibt einem Benutzer in einem Untermenü nur ein Weg, steht der ohne Umweg in der Leiste. */
    .nav-sub.single, .nav-sub.single .nav-sub-list { display: contents; }
    .nav-sub.single .nav-sub-toggle { display: none; }
    .nav-sub.single .nav-link { min-height: 52px; padding: 0 1rem; border-radius: 0; }
    .nav-sub.single .nav-link:hover, .nav-sub.single .nav-link:focus-visible { background: none; }
    .nav-sub.single .nav-link.active { box-shadow: inset 0 -3px 0 var(--wz-azure); }
    .page { padding-bottom: 2rem; }
}

/* Karten und Tabellen */
.card { background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: var(--wz-radius); padding: 1rem; margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: var(--wz-radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--wz-border); vertical-align: middle; }
.table th { font-weight: 600; color: var(--wz-azure); }
.table tr.inactive td { color: var(--wz-muted); }
.table .actions { white-space: nowrap; }

/* Formulare: große Ziele, hoher Kontrast */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form-narrow { max-width: 28rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; }
.field input, .field select {
    font: inherit; font-weight: 400; min-height: var(--wz-touch); padding: 0 0.75rem;
    border: 2px solid var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-surface); color: var(--wz-text);
}
.field input:focus, .field select:focus { outline: 3px solid var(--wz-fiber-green); outline-offset: 1px; border-color: var(--wz-azure); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--wz-touch); min-width: var(--wz-touch); padding: 0 1.25rem;
    font: inherit; font-weight: 600; border-radius: var(--wz-radius); border: 2px solid transparent;
    cursor: pointer; text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--wz-fiber-green); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--wz-azure); color: #fff; }
/* Unwiderrufliches (z. B. Gruppe löschen, #208): rot, damit es nicht mit dem Hauptweg verwechselt wird. */
.btn-danger { background: #b3261e; color: #fff; }
.theme-toggle { min-width: var(--wz-touch); padding: 0 0.6rem; font-size: 1.2rem; }
.login-theme { display: flex; justify-content: center; margin-top: 1rem; }
.login-theme .btn-ghost { color: var(--wz-muted); }
.btn-primary:hover { background: var(--wz-azure-dark); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.app-header .btn-ghost { color: #fff; }
.btn-block { width: 100%; }

.alert { padding: 0.75rem 1rem; border-radius: var(--wz-radius); margin: 0; font-weight: 600; }
.alert-error { background: var(--wz-danger-bg); color: var(--wz-danger); border-left: 4px solid var(--wz-danger); }
.alert-info { background: var(--wz-info-bg); color: var(--wz-text); border-left: 4px solid var(--wz-azure); }

/* Farben wählen */
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.swatch { width: var(--wz-touch); height: var(--wz-touch); border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.selected { border-color: var(--wz-cobalt); box-shadow: 0 0 0 3px #fff inset; }
/* Symbol einer Kategorie (#132): Auswahl statt Eingabe. */
.symbol-choice { min-width: var(--wz-touch); height: var(--wz-touch); padding: 0 0.5rem; font: inherit; font-size: 1.3rem; background: var(--wz-surface); color: var(--wz-text); border: 2px solid var(--wz-border); border-radius: var(--wz-radius); cursor: pointer; }
.symbol-choice:first-child, .symbol-choice.with-label { font-size: 0.9rem; font-weight: 600; }
.symbol-choice.selected { border-color: var(--wz-azure); box-shadow: 0 0 0 2px var(--wz-azure) inset; }
.swatch-input { font: inherit; min-height: var(--wz-touch); width: 8rem; padding: 0 0.75rem; border: 2px solid var(--wz-border); border-radius: var(--wz-radius); }
.color-dot { display: inline-block; width: 1.25rem; height: 1.25rem; border-radius: 50%; vertical-align: middle; }
.actions-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Auswahllisten */
.two-columns { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-columns { grid-template-columns: 1fr 1.4fr; align-items: start; } }
.pick-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; width: 100%; min-height: var(--wz-touch); padding: 0.6rem 0.9rem; font: inherit; text-align: left; background: var(--wz-surface); border: 2px solid var(--wz-border); border-radius: var(--wz-radius); cursor: pointer; }
.pick.selected { border-color: var(--wz-azure); background: var(--wz-info-bg); }
.pick.inactive strong { color: var(--wz-muted); text-decoration: line-through; }
.check-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }
.check { display: flex; align-items: center; gap: 0.75rem; min-height: var(--wz-touch); padding: 0 0.5rem; border-radius: var(--wz-radius); cursor: pointer; }
.check:hover { background: var(--wz-background); }
.check input { width: 1.5rem; height: 1.5rem; accent-color: var(--wz-azure); }
h3 { font-size: 1rem; margin: 0.75rem 0 0.5rem; color: var(--wz-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Arbeiten */
.work-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.work-card { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 1rem; background: var(--wz-surface); border: 1px solid var(--wz-border); border-left: 6px solid var(--wz-azure); border-radius: var(--wz-radius); }
.work-card.high { border-left-color: var(--wz-danger); }
.work-number { font-size: 0.85rem; color: var(--wz-muted); font-weight: 600; }
.choice { border: 0; padding: 0; margin: 0; }
/* WZ-217 Rechtematrix: am Desktop eine Tabelle (Recht links, je Rolle eine Spalte); am Handy steht das Recht
   über seinen drei Häkchen, die dann den Namen der Rolle tragen – kein waagrechtes Scrollen. */
.rights-matrix { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 6.5rem); column-gap: 0.25rem; margin-bottom: 0.5rem; }
.rights-head, .rights-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; }
.rights-head { font-weight: 600; text-align: center; padding: 0.5rem 0; border-bottom: 2px solid var(--wz-border); }
.rights-section { grid-column: 1 / -1; margin: 1rem 0 0.25rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wz-muted); }
.rights-row { border-bottom: 1px solid var(--wz-border); }
.rights-label { display: flex; flex-direction: column; padding: 0.5rem 0.5rem 0.5rem 0; }
.rights-label .muted { font-size: 0.85rem; }
.rights-cell { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: var(--wz-touch); min-width: var(--wz-touch); border-radius: var(--wz-radius); cursor: pointer; }
.rights-cell:hover { background: var(--wz-background); }
.rights-cell input { width: 1.5rem; height: 1.5rem; accent-color: var(--wz-azure); flex: none; }
.rights-cell span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
    .rights-matrix { display: block; }
    .rights-row { display: flex; flex-wrap: wrap; justify-content: space-between; }
    .rights-head { display: none; }
    .rights-label { flex: 0 0 100%; padding: 0.75rem 0 0; font-weight: 600; }
    .rights-label .muted { font-weight: 400; }
    .rights-cell { justify-content: flex-start; gap: 0.4rem; }
    .rights-cell span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 0.9rem; }
}
.choice legend { font-weight: 600; margin-bottom: 0.25rem; }
textarea { font: inherit; padding: 0.5rem 0.75rem; border: 2px solid var(--wz-border); border-radius: var(--wz-radius); }

.work-title { font-weight: 700; color: var(--wz-heading); text-decoration: none; }
.work-title:hover { text-decoration: underline; }
.select { font: inherit; min-height: var(--wz-touch); padding: 0 0.75rem; border: 2px solid var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-surface); }
/* Unteraufgaben (#192): Fortschritt der Hauptaufgabe und Stand je Unteraufgabe. */
.progress { height: 1rem; border-radius: 999px; background: var(--wz-border); overflow: hidden; margin-bottom: 0.4rem; }
.progress > span { display: block; height: 100%; background: var(--wz-fiber-green); transition: width 0.3s; }
.subtask-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.subtask { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.25rem 1rem; min-height: var(--wz-touch); padding: 0.25rem 0.75rem; border-left: 6px solid var(--wz-azure); background: var(--wz-background); border-radius: var(--wz-radius); }
.subtask.working { border-left-color: var(--wz-in-progress); }
.subtask.done { border-left-color: var(--wz-fiber-green); }
.subtask.dropped { border-left-color: var(--wz-border); opacity: 0.7; }
.subtask-of { font-weight: 600; color: var(--wz-muted); }
.badge-sub { background: var(--wz-info-bg); color: var(--wz-text); border: 1px solid var(--wz-border); }
/* Verlauf aus Kommentaren und Anhängen (#193): das Älteste oben, jeder Eintrag mit Zeit und Person. */
.timeline { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.timeline li { display: flex; flex-direction: column; gap: 0.2rem; padding-left: 0.75rem; border-left: 3px solid var(--wz-border); }
.timeline-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-photo { display: inline-flex; align-items: center; gap: 0.6rem; min-height: var(--wz-touch); }
.timeline-photo img { width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--wz-radius); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }

/* Fotos und große Handlungen */
.btn-big { min-height: 64px; font-size: 1.15rem; margin-bottom: 0.75rem; }
.photo-button { cursor: pointer; margin-bottom: 0.75rem; }
.photo-preview { display: block; max-width: 100%; max-height: 40vh; border-radius: var(--wz-radius); margin-bottom: 0.5rem; }
/* WZ-1209: Screenshot einer Rückmeldung im Betreiberbereich – ganz sichtbar, mit Rand gegen weiße Bildschirme. */
.feedback-screenshot { display: block; max-width: 100%; height: auto; border: 1px solid var(--wz-border); border-radius: var(--wz-radius); margin-bottom: 0.5rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--wz-radius); display: block; }
.photo-grid a { text-decoration: none; font-size: 0.8rem; }

/* Arbeitsliste und Kanban */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; }
.field-inline { flex: 1 1 14rem; }
/* Datumsfeld (WZ-1203): das native Feld zeigt die Schreibweise des Browsers, daneben steht sie österreichisch. */
.date-field { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.date-field .input { flex: 1 1 10rem; }
.date-field-readout { color: var(--wz-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.segmented { display: inline-flex; border: 2px solid var(--wz-azure); border-radius: var(--wz-radius); overflow: hidden; }
.segmented button { font: inherit; font-weight: 600; min-height: var(--wz-touch); padding: 0 1.25rem; border: 0; background: var(--wz-surface); color: var(--wz-azure); cursor: pointer; }
.segmented button.active { background: var(--wz-azure); color: #fff; }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; align-items: start; }
.kanban-column { background: var(--wz-background); border: 1px solid var(--wz-border); border-radius: var(--wz-radius); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 14rem; }
.kanban-column h2 { display: flex; justify-content: space-between; margin: 0 0 0.25rem; font-size: 1rem; }
.count { background: var(--wz-surface); border-radius: 999px; padding: 0 0.6rem; color: var(--wz-muted); }
a.work-card { text-decoration: none; color: inherit; }
/* Bearbeiter auf der Karte (#212): Bild oder Initialen mit Namen; in Arbeit hervorgehoben. */
.work-assignee { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; align-self: flex-start; max-width: 100%; font-size: 0.9rem; font-weight: 600; color: var(--wz-muted); }
.work-assignee > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-assignee.working { padding: 0.15rem 0.7rem 0.15rem 0.15rem; border-radius: 999px; background: var(--wz-info-bg); color: var(--wz-text); }
.work-card.overdue { border-left-color: var(--wz-danger); background: var(--wz-danger-bg); }
.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; margin-left: 0.4rem; vertical-align: middle; }
/* Prioritäten (#188): Dringend kräftig rot, Hoch rot umrandet, Niedrig zurückhaltend. */
.badge-urgent { background: var(--wz-danger); color: #fff; }
.badge-high { background: var(--wz-danger-bg); color: var(--wz-danger); border: 1px solid var(--wz-danger); }
.badge-low { background: var(--wz-background); color: var(--wz-muted); border: 1px solid var(--wz-border); }
.badge-overdue { background: var(--wz-danger-bg); color: var(--wz-danger); }
.badge-warning { background: var(--wz-warning-bg); color: var(--wz-warning); }
.alert-warning { background: var(--wz-warning-bg); color: var(--wz-warning); }
.badge-done { background: var(--wz-fiber-green); color: #00223e; }
.sync-state { text-decoration: none; display: inline-flex; align-items: center; }
.table tr.overdue td:first-child { box-shadow: inset 4px 0 0 var(--wz-danger); }
.table tr.high td:first-child { box-shadow: inset 4px 0 0 var(--wz-warning); }
.table-note { padding: 0.5rem 0.75rem; }

/* Mitarbeiteransicht: große Karten, hoher Kontrast, mit Handschuhen bedienbar */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.task { display: flex; flex-direction: column; gap: 0.3rem; min-height: 88px; padding: 0.9rem 1rem 0.9rem 1.1rem; background: var(--wz-surface); border: 2px solid var(--wz-border); border-left: 10px solid var(--task-color, var(--wz-azure)); border-radius: var(--wz-radius); color: var(--wz-text); text-decoration: none; }
.task:active { background: var(--wz-info-bg); }
.task.overdue { border-color: var(--wz-danger); border-left-color: var(--wz-danger); }
.task.high:not(.overdue) { border-color: var(--wz-warning); }
/* Streifen nach Stand (#211): blau offen, rot überfällig, orange in Arbeit, grün erledigt, bernstein wartend.
   Mit .task-list davor, damit der Streifen auch bei Priorität Hoch gilt (deren Rahmen bleibt bernstein). */
.task-list .task.stripe-open { border-left-color: var(--wz-azure); }
.task-list .task.stripe-in-progress { border-left-color: var(--wz-in-progress); }
.task-list .task.stripe-waiting { border-left-color: var(--wz-warning); }
.task-list .task.stripe-done { border-left-color: var(--wz-fiber-green); }
.task-list .task.stripe-overdue { border-left-color: var(--wz-danger); }
.task-section { display: flex; align-items: center; gap: 0.5rem; margin: 1.25rem 0 0.5rem; padding-top: 0.75rem; border-top: 2px solid var(--wz-border); font-size: 1rem; color: var(--wz-muted); }
.task-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.task-category .color-dot { width: 0.8rem; height: 0.8rem; margin-right: 0.4rem; }
.task-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.task-category { font-size: 0.85rem; font-weight: 700; color: var(--wz-azure); text-transform: uppercase; letter-spacing: 0.03em; }
.task-title { font-size: 1.25rem; font-weight: 700; line-height: 1.25; color: var(--wz-heading); }
.task-meta { font-size: 0.95rem; color: var(--wz-muted); }
.task .badge { margin: 0; font-size: 0.8rem; padding: 0.2rem 0.6rem; }
.empty { text-align: center; padding: 2rem 1rem; }
.stand { margin-top: 1.5rem; font-size: 0.85rem; }
.desktop-only { display: none; }
@media (min-width: 900px) { .desktop-only { display: inline-flex; } }

/* Kalender (WZ-413, #218): Woche als Tagesliste, Monat als Raster. Am Handy zeigt das Raster je Tag nur die
   Anzahl – der Tag ist die Schaltfläche zu seiner Woche –, am Desktop stehen die Arbeiten im Feld. */
.view-links { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.cal-nav .btn { min-width: var(--wz-touch); }
.cal-title { flex: 1 1 10rem; text-align: center; font-size: 1.1rem; color: var(--wz-heading); }
.cal-hint { margin: 0 0 0.75rem; }
.cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.cal-item { position: relative; display: flex; align-items: stretch; background: var(--wz-surface); border: 1px solid var(--wz-border); border-left: 8px solid var(--task-color, var(--wz-azure)); border-radius: var(--wz-radius); }
.cal-item.overdue { background: var(--wz-danger-bg); border-color: var(--wz-danger); border-left-color: var(--wz-danger); }
.cal-item > a { flex: 1; min-width: 0; min-height: var(--wz-touch); display: flex; flex-direction: column; justify-content: center; gap: 0.1rem; padding: 0.4rem 0.75rem; color: var(--wz-text); text-decoration: none; }
.cal-item-title { font-weight: 700; overflow-wrap: break-word; hyphens: auto; }
.cal-item-meta { font-size: 0.85rem; color: var(--wz-muted); overflow-wrap: anywhere; }
.cal-item .drag-handle { position: static; flex: none; align-self: center; }
.cal-week { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.cal-day { background: var(--wz-background); border: 1px solid var(--wz-border); border-radius: var(--wz-radius); padding: 0.6rem 0.75rem; }
.cal-day h2 { margin: 0 0 0.4rem; font-size: 1rem; }
.cal-day.today, .cal-cell.today { border-color: var(--wz-azure); box-shadow: inset 0 0 0 2px var(--wz-azure); }
.cal-empty { margin: 0; font-size: 0.9rem; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-weekday { text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--wz-muted); padding: 0.25rem 0; }
.cal-cell { min-width: 0; background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: 4px; display: flex; flex-direction: column; }
.cal-cell.outside { background: var(--wz-background); }
.cal-cell.outside .cal-date { color: var(--wz-muted); font-weight: 400; }
.cal-date { font: inherit; font-weight: 700; color: var(--wz-text); background: transparent; border: 0; cursor: pointer; width: 100%; min-height: var(--wz-touch); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; padding: 0.2rem; }
.cal-count { min-width: 1.5rem; padding: 0 0.35rem; border-radius: 999px; background: var(--wz-azure); color: #fff; font-size: 0.8rem; font-weight: 700; }
.cal-count.overdue { background: var(--wz-danger); }
.cal-chips { display: none; }
.cal-extra { margin-top: 1rem; }
.cal-wrap.dragging [data-drop] { outline: 2px dashed var(--wz-fiber-green); outline-offset: -2px; }
@media (min-width: 900px) {
    .cal-week { flex-direction: row; align-items: stretch; }
    .cal-day { flex: 1 1 0; min-width: 0; min-height: 12rem; padding: 0.5rem; transition: flex-grow 0.15s ease-out; }
    /* Mit der Maus: Die Spalte unter dem Zeiger wird breiter, damit die Titel lesbar sind – die Spalte, nicht die
       Karte, damit nichts unter dem Zeiger wegspringt. Nicht während des Ziehens. */
    @media (hover: hover) { .cal-wrap:not(.dragging) .cal-day:hover:has(.cal-item) { flex-grow: 3.5; } }
    @media (prefers-reduced-motion: reduce) { .cal-day { transition: none; } }
    .cal-cell { min-height: 7.5rem; }
    .cal-date { flex-direction: row; justify-content: flex-start; min-height: 2rem; padding: 0.2rem 0.5rem; }
    .cal-count { display: none; }
    .cal-chips { display: flex; padding: 0 0.25rem 0.25rem; gap: 0.2rem; }
    .cal-chips .cal-item { border-left-width: 5px; }
    .cal-chips .cal-item > a { min-height: 2rem; padding: 0.15rem 0.4rem; font-size: 0.85rem; }
    .cal-chips .cal-item-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cal-chips .cal-item-meta { display: none; }
    .cal-chips .drag-handle, .cal-week .drag-handle { width: 1.75rem; height: 2rem; font-size: 1rem; }
    .cal-week .cal-item > a { padding: 0.4rem 0.5rem; }
}
.map-fallback { margin-top: 0.75rem; }
.map-fallback .work-card { min-height: var(--wz-touch); }

/* Kanban: Ziehen und Ablegen */
.kanban-card { position: relative; }
.drag-handle { position: absolute; right: 0.4rem; top: 0.4rem; width: var(--wz-touch); height: var(--wz-touch); display: flex; align-items: center; justify-content: center; border-radius: var(--wz-radius); color: var(--wz-muted); cursor: grab; touch-action: none; user-select: none; font-size: 1.3rem; }
.drag-handle:active { cursor: grabbing; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 2000; pointer-events: none; opacity: 0.85; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.drag-source { opacity: 0.4; }
/* #227: Fenster für die Angaben zu einem Zug im Kanban – am Handy unten angedockt, sonst mittig. */
.dialog-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 34, 62, 0.55); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.dialog { width: 100%; max-width: 32rem; max-height: calc(100vh - 2rem); overflow-y: auto; margin: 0; box-shadow: 0 12px 32px rgba(0,0,0,0.35); display: flex; flex-direction: column; gap: 0.75rem; }
.dialog h2 { margin: 0; }
@media (max-width: 600px) { .dialog-backdrop { align-items: flex-end; padding: 0; } .dialog { max-width: none; border-radius: var(--wz-radius) var(--wz-radius) 0 0; } }
/* #130: Die gezogene Karte steht schräg und wackelt leicht; in der neuen Spalte schwingt sie kurz aus. */
.drag-ghost { rotate: 3deg; animation: wz-card-wobble 0.45s ease-in-out infinite alternate; }
.kanban-card.landed { animation: wz-card-land 0.6s ease-out; }
@keyframes wz-card-wobble { from { rotate: 2deg; } to { rotate: 5deg; } }
@keyframes wz-card-land {
    0% { rotate: 4deg; scale: 1.04; }
    30% { rotate: -3deg; scale: 1.02; }
    55% { rotate: 2deg; scale: 1; }
    80% { rotate: -1deg; }
    100% { rotate: 0deg; }
}
/* Wer Bewegung reduziert haben will, bekommt die Schrägstellung ohne Wackeln. */
@media (prefers-reduced-motion: reduce) { .drag-ghost, .kanban-card.landed { animation: none; } }
.kanban-wrap.dragging [data-drop] { outline: 2px dashed var(--wz-border); outline-offset: -2px; }
.kanban-wrap.dragging [data-drop].drop-allowed { outline-color: var(--wz-fiber-green); }
.kanban-wrap.dragging [data-drop].drop-blocked { outline-color: var(--wz-danger); opacity: 0.55; }
[data-drop].drop-over { background: var(--wz-info-bg) !important; }
.assign-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 0.75rem; margin-bottom: 1rem; border: 2px dashed var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-surface); opacity: 0.55; transition: opacity 0.15s; }
.kanban-wrap.dragging .assign-bar { opacity: 1; border-color: var(--wz-azure); }
.assign-bar strong { width: 100%; }
.assign-box { min-height: var(--wz-touch); min-width: 8rem; padding: 0 0.75rem; display: inline-flex; align-items: center; gap: 0.5rem; border: 2px solid var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-background); font-weight: 600; }

/* Compliance */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0; }
.facts dt { font-weight: 700; color: var(--wz-azure); }
.facts dd { margin: 0; }
@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 0.5rem; } }
.retention { width: 5.5rem; text-align: center; margin: 0 0.35rem; }
.segmented { margin-bottom: 1rem; }

/* Anmeldung */
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; background: var(--wz-cobalt); }
.login-card { width: 100%; max-width: 24rem; background: var(--wz-surface); border-radius: 12px; padding: 1.5rem; }
.login-title { text-align: center; color: var(--wz-azure); font-size: 2rem; margin: 0; }
.login-subtitle { text-align: center; color: var(--wz-muted); margin-bottom: 1.25rem; }

.loading { display: flex; align-items: center; justify-content: center; min-height: 100vh; color: var(--wz-azure); font-size: 1.25rem; }

#blazor-error-ui {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 1rem 3rem 1rem 1rem; background: var(--wz-warning-bg); color: var(--wz-text);
    border-top: 4px solid var(--wz-warning); font-weight: 600;
}
#blazor-error-ui .reload { color: inherit; }
#blazor-error-ui .dismiss { position: absolute; right: 1rem; top: 1rem; cursor: pointer; }

/* Warteschlange (WZ-604) */
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { padding: 0.75rem 0; border-bottom: 1px solid var(--wz-border); }
.queue li:last-child { border-bottom: 0; }
.queue li.rejected { border-left: 4px solid var(--wz-danger); padding-left: 0.75rem; }
.queue .alert { margin: 0.5rem 0; }

/* Hinweiskarte auf der Startseite (WZ-608) */
.notice-card { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; color: inherit; border-left: 4px solid var(--wz-warning); }
.field.check { flex-direction: row; align-items: center; gap: 0.5rem; }

/* Sperrbildschirm (WZ-203) */
.lock-screen { max-width: 28rem; margin: 2rem auto; padding: 1.5rem; background: var(--wz-surface); border: 1px solid var(--wz-border); border-radius: var(--wz-radius); display: flex; flex-direction: column; gap: 0.75rem; }
.lock-screen .form { gap: 0.75rem; }

.queue li.unread { border-left: 4px solid var(--wz-azure); padding-left: 0.75rem; }

/* Karte (E7) */
.map { width: 100%; height: 22rem; border-radius: var(--wz-radius); border: 1px solid var(--wz-border); }
.map.large { height: calc(100vh - 14rem); min-height: 20rem; }
/* Zeichen einer Arbeit mit Kategorie-Symbol (#131): Rand in der Farbe der Kategorie, abgeschlossene blasser. */
.map-sign { background: none; border: 0; }
.map-pin { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 3px solid #005077; background: #fff; font-size: 1.15rem; line-height: 1; box-shadow: 0 2px 6px rgb(0 0 0 / 0.4); }
.map-pin.closed { opacity: 0.55; }
/* Vorschau an der Arbeit (WZ-708): groß genug zum Erkennen der Straße, klein genug, um daran vorbeizublättern. */
.map.map-preview { height: 14rem; margin-top: 0.5rem; }
.geo-results { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.geo-results li button { width: 100%; text-align: left; }

/* Nachweis und Druck (WZ-1003/1004) */
.proof { max-width: 52rem; }
.proof .photo-grid img { max-height: 18rem; object-fit: contain; }
.proof table { width: 100%; border-collapse: collapse; }
.proof th, .proof td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--wz-border); vertical-align: top; }
@media print {
    .app-header, .app-nav, .app-footer, .no-print, .sync-state { display: none !important; }
    .page { padding: 0; }
    body { background: #fff; color: #000; }
    .card { border: 0; box-shadow: none; page-break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}

/* Betreiberbereich (WZ-105) */
.platform .app-header { margin-bottom: 1rem; }
.login-card-inline { max-width: 26rem; }
.detail-row > td { background: rgba(0, 80, 119, 0.06); }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.log-list li { border-bottom: 1px solid var(--wz-border); padding-bottom: 0.35rem; }

/* Kennzahlen im Betreiberbereich (WZ-107) */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.metric { display: grid; gap: 0.15rem; padding: 0.75rem; border: 1px solid var(--wz-border); border-radius: var(--wz-radius); background: var(--wz-background); }
.metric-value { font-size: 1.75rem; font-weight: 700; color: var(--wz-heading); line-height: 1.1; }
.metric-label { font-weight: 600; }
.metric-hint { font-size: 0.85rem; }

/* Einladung mit QR-Code (WZ-213) */
.invitation-card { max-width: 32rem; }
.invitation-card .qr { display: flex; justify-content: center; padding: 1rem 0; }
.invitation-card .qr svg { width: 100%; max-width: 16rem; height: auto; }
.invitation-card input { font-family: ui-monospace, monospace; font-size: 0.85rem; }

/* Einrichtung (WZ-906) */
.steps { margin: 0.5rem 0 0 1.2rem; display: grid; gap: 0.35rem; }

/* WZ-216: Einmalcodes groß und gut lesbar, zum Abschreiben und Ausdrucken. */
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem 1.5rem; padding-left: 1.5rem; font-size: 1.15rem; }
.recovery-codes code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.05em; }
