/* ════════════════════════════════════════════════════════════════════
   TECHNIKBRETT — Design
   Baut auf dem Bento-Pastel-System des Zeit-Trackers auf (Inter, gleiche
   Tokens), ergaenzt um Board-Komponenten. Mobile zuerst: gemeldet wird
   mit dem Handy in der Hand vor der kaputten Lampe.

   Regeln: kein backdrop-filter, keine grossen Schatten auf scrollenden
   Flaechen, Bewegung nur ueber transform/opacity.
════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── TOKENS (LIGHT) ─────────────────────────────────────────── */
:root {
    --bg:           #fafaf8;
    --bg-elev:      #ffffff;
    --bg-sunk:      #f3f1ed;
    --ink:          #0a0a0a;
    --ink-2:        #1f1f1f;
    --muted:        #6b7280;
    --muted-2:      #9ca3af;
    --rule:         #ececec;
    --rule-strong:  #d4d4d4;

    --p-peach-bg:    #fff7ed;
    --p-peach-bg-2:  #fed7aa;
    --p-peach-fg:    #7c2d12;
    --p-peach-deep:  #9a3412;

    --p-yellow-bg:   #fde68a;
    --p-yellow-fg:   #78350f;

    --p-mint-bg:     #dcfce7;
    --p-mint-fg:     #14532d;

    --p-blue-bg:     #dbeafe;
    --p-blue-fg:     #1e3a8a;

    --p-pink-bg:     #fce7f3;
    --p-pink-fg:     #831843;

    --p-violet-bg:   #ede9fe;
    --p-violet-fg:   #4c1d95;

    --good:        #15803d;
    --good-soft:   #dcfce7;
    --warn:        #d97706;
    --warn-soft:   #fef3c7;
    --bad:         #b91c1c;
    --bad-soft:    #fee2e2;

    --brand-grad:  linear-gradient(135deg, #a7f3d0, #6ee7b7);
    --accent:      #0f766e;
    --accent-soft: #ccfbf1;

    --font-ui:   'Inter', -apple-system, system-ui, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', Menlo, Consolas, monospace;

    --ease:   cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 150ms;
    --t-base: 220ms;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px;

    --r-card: 14px;
    --r-btn:  10px;
    --r-pill: 999px;

    color-scheme: light;
}

/* ── TOKENS (DARK) ──────────────────────────────────────────── */
[data-theme="dark"] {
    --bg:           #0c0c10;
    --bg-elev:      #14141a;
    --bg-sunk:      #08080c;
    --ink:          #f3f4f6;
    --ink-2:        #d1d5db;
    --muted:        #9ca3af;
    --muted-2:      #6b7280;
    --rule:         #1f1f25;
    --rule-strong:  #2a2a30;

    --p-peach-bg:    #2a1408;
    --p-peach-bg-2:  #5a2e0e;
    --p-peach-fg:    #fed7aa;
    --p-peach-deep:  #fdba74;

    --p-yellow-bg:   #3a2e0e;
    --p-yellow-fg:   #fde68a;

    --p-mint-bg:     #0f3320;
    --p-mint-fg:     #86efac;

    --p-blue-bg:     #0f1f3a;
    --p-blue-fg:     #93c5fd;

    --p-pink-bg:     #3a0f23;
    --p-pink-fg:     #f9a8d4;

    --p-violet-bg:   #22113a;
    --p-violet-fg:   #c4b5fd;

    --good:        #4ade80;
    --good-soft:   #0f3320;
    --warn:        #fbbf24;
    --warn-soft:   #3a2e0e;
    --bad:         #f87171;
    --bad-soft:    #3a0e0e;

    --brand-grad:  linear-gradient(135deg, #065f46, #047857);
    --accent:      #5eead4;
    --accent-soft: #042f2e;

    color-scheme: dark;
}

/* ── BASIS ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
    /* Platz fuer die Schaltflaeche unten rechts + iPhone-Home-Leiste */
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

/* Die Anmeldeseite hat keine schwebende Schaltflaeche. Mit dem
   Freiraum waere sie 88px hoeher als der Bildschirm und wuerde
   ohne Grund scrollen. */
body.ist-anmeldung { padding-bottom: 0; }

::selection { background: var(--accent); color: #fff; }
[data-theme="dark"] ::selection { color: #0c0c10; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: var(--r-pill); border: 2px solid var(--bg); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

a { color: inherit; }

/* ── KOPFLEISTE ─────────────────────────────────────────────── */
.hw-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--rule);
    padding: 12px clamp(14px, 3vw, 28px);
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
}
.hw-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    min-width: 0;
}
.hw-brand-text { min-width: 0; }
.hw-brand-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-brand-sub {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-topbar-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Nutzer-Kreis */
.hw-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-sunk);
    color: var(--ink-2);
    display: grid;
    place-items: center;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid var(--rule);
    text-decoration: none;
    flex-shrink: 0;
}
.hw-avatar:hover { border-color: var(--rule-strong); }

/* ── SEITENRAHMEN ───────────────────────────────────────────── */
/* Das Board nutzt die volle Bildschirmbreite — die Zeilenlänge wird
   nicht über den Seitenrand begrenzt, sondern über die Kartenspalten.
   Formulare bleiben schmal: eine bildschirmbreite Eingabezeile
   liest und füllt niemand gern. */
.hw-page {
    max-width: none;
    margin: 0;
    padding: 18px clamp(14px, 1.8vw, 34px) 24px;
    width: 100%;
}
.hw-page-formular { max-width: 860px;  margin: 0 auto; }
.hw-page-detail   { max-width: 1700px; margin: 0 auto; }

/* ── ÜBERSICHTS-KOPF ────────────────────────────────────────── */
.hw-gruss {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 2px 0 12px;
}
.hw-gruss h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.022em;
}
.hw-gruss .ort { font-size: 12.5px; color: var(--muted); }

/* Kennzahl-Kacheln — sie sind zugleich der Statusfilter.
   Eine Zahl anzuzeigen und daneben nochmal einen Filterknopf
   für dieselbe Sache wäre doppelt. */
.hw-kacheln {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
@media (max-width: 560px) {
    .hw-kacheln { grid-template-columns: repeat(2, 1fr); }
}

.hw-kachel {
    display: block;
    border-radius: var(--r-card);
    padding: 13px 14px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.hw-kachel:hover { opacity: 0.9; }
.hw-kachel .lbl {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.75;
    display: block;
}
.hw-kachel .zahl {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    display: block;
    margin-top: 2px;
}
.hw-kachel .sub { font-size: 10px; opacity: 0.65; display: block; }

.hw-kachel.k-alle    { background: var(--bg-sunk);      color: var(--ink-2); }
.hw-kachel.k-offen   { background: var(--p-peach-bg-2); color: var(--p-peach-deep); }
.hw-kachel.k-arbeit  { background: var(--p-yellow-bg);  color: var(--p-yellow-fg); }
.hw-kachel.k-fertig  { background: var(--p-mint-bg);    color: var(--p-mint-fg); }

/* Ausgewählt: dunkler Rahmen statt noch einer Farbe */
.hw-kachel.is-on { border-color: var(--ink); }

/* Leere Kacheln treten zurück — null Offene ist keine Nachricht */
.hw-kachel.is-leer { opacity: 0.5; }
.hw-kachel.is-leer:hover { opacity: 0.75; }

/* ── WERKZEUGZEILE (Haus · Suche · Dringend) ────────────────── */
.hw-werkzeuge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.hw-werkzeuge select { flex: 0 0 auto; width: auto; min-width: 150px; font-size: 13px; padding: 9px 32px 9px 12px; }
.hw-werkzeuge input[type="search"] { flex: 1 1 240px; font-size: 16px; padding: 9px 12px; }
.hw-werkzeuge .hw-chip { flex: 0 0 auto; padding: 9px 13px; }

/* Auf dem Handy bekommt die Suche eine eigene Zeile — gequetscht
   bricht schon der Platzhaltertext ab. */
@media (max-width: 620px) {
    .hw-werkzeuge input[type="search"] { flex: 1 1 100%; order: 3; }
    .hw-werkzeuge select { flex: 1 1 auto; }
}

/* ── FILTERLEISTE ───────────────────────────────────────────── */
.hw-filter {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 10px;
    margin-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.hw-filter::-webkit-scrollbar { display: none; }
.hw-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--r-pill);
    border: 1px solid var(--rule);
    background: var(--bg-elev);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.hw-chip:hover { color: var(--ink); border-color: var(--rule-strong); }
.hw-chip.is-on {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg-elev);
}
.hw-chip .anz {
    font-size: 10.5px;
    font-weight: 700;
    opacity: 0.65;
    font-variant-numeric: tabular-nums;
}
.hw-filter-zeile2 { margin-top: -2px; }

/* ── MELDUNGSKARTE ──────────────────────────────────────────── */
/* Auf breiten Schirmen nebeneinander statt in die Breite gezogen —
   so füllt das Board die Fläche und die Zeilen bleiben lesbar. */
.hw-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
    gap: 8px;
    align-items: start;
}
@media (max-width: 700px) {
    .hw-liste { grid-template-columns: 1fr; }
}

.hw-karte {
    position: relative;
    display: block;
    background: var(--bg-elev);
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 14px 16px 12px 18px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.hw-karte:hover  { border-color: var(--rule-strong); }
.hw-karte:active { transform: scale(0.995); }

/* Nur Dringendes bekommt einen Farbstreifen. Bekäme ihn jede Karte,
   wäre das Board ein Farbkasten und nichts stäche mehr heraus —
   den Zustand sagt die Pille. */
.hw-karte.is-dringend::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--bad);
}

.hw-karte.st-erledigt { background: var(--bg-sunk); }
.hw-karte.st-erledigt .hw-karte-titel { color: var(--muted); }

.hw-karte-kopf {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.hw-karte-titel {
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -0.012em;
    line-height: 1.3;
    margin: 0 0 3px;
}
.hw-karte-ort {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.hw-karte-ort .trenner { opacity: 0.4; }
.hw-karte-text {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}
.hw-karte-fuss {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--rule);
    font-size: 11px;
    color: var(--muted-2);
    flex-wrap: wrap;
}
.hw-karte-fuss .mit-icon { display: inline-flex; align-items: center; gap: 4px; }

/* Miniaturbild rechts */
.hw-karte-inner { display: flex; gap: 12px; align-items: flex-start; }
.hw-karte-body  { flex: 1; min-width: 0; }
.hw-karte-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--rule);
    background: var(--bg-sunk);
}

/* ── PILLEN & PLAKETTEN ─────────────────────────────────────── */
.hw-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.hw-pill .punkt { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.hw-pill.st-offen     { background: var(--p-peach-bg-2); color: var(--p-peach-deep); }
.hw-pill.st-in_arbeit { background: var(--p-yellow-bg);  color: var(--p-yellow-fg); }
.hw-pill.st-erledigt  { background: var(--p-mint-bg);    color: var(--p-mint-fg); }

.hw-pill.dringend { background: var(--bad-soft); color: var(--bad); }
[data-theme="dark"] .hw-pill.dringend { color: #fca5a5; }

/* Das Haus steht ruhig daneben — es ordnet ein, es warnt nicht.
   Vier Pastelltöne nebeneinander hätten das Board unruhig gemacht. */
.hw-pill[class*="kita-"] {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--rule-strong);
    font-weight: 600;
}

.hw-pill-kat {
    background: var(--bg-sunk);
    color: var(--muted);
    border: 1px solid var(--rule);
}

/* ── SCHALTFLÄCHEN ──────────────────────────────────────────── */
.hw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--rule-strong);
    background: var(--bg-elev);
    color: var(--ink);
    border-radius: var(--r-btn);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.hw-btn:hover { background: var(--ink); color: var(--bg-elev); border-color: var(--ink); }
.hw-btn:active { transform: translateY(1px); }
.hw-btn[disabled] { opacity: 0.5; pointer-events: none; }

/* Primäraktion monochrom wie im Zeit-Tracker: Tinte auf Papier,
   nicht bunt. Farbe bleibt der Information vorbehalten. */
.hw-btn-primar {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg-elev);
}
.hw-btn-primar:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg-elev); }

.hw-btn-gut  { background: var(--good); border-color: var(--good); color: #fff; }
.hw-btn-gut:hover { background: #166534; border-color: #166534; color: #fff; }
.hw-btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.hw-btn-warn:hover { background: #b45309; border-color: #b45309; color: #fff; }
.hw-btn-still { border-color: transparent; background: transparent; color: var(--muted); }
.hw-btn-still:hover { background: var(--bg-sunk); color: var(--ink); border-color: transparent; }
.hw-btn-breit { width: 100%; }
.hw-btn-klein { padding: 7px 12px; font-size: 12px; }

/* Umschalter Hell/Dunkel */
.hw-theme {
    display: inline-flex;
    background: var(--bg-sunk);
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    padding: 3px;
}
.hw-theme button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--r-pill);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: color var(--t-fast) var(--ease);
}
.hw-theme button.is-on { background: var(--ink); color: var(--bg-elev); }

/* Schwebende Schaltfläche "Neue Meldung" */
.hw-fab {
    position: fixed;
    right: clamp(14px, 4vw, 28px);
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--bg-elev);
    border: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    transition: transform var(--t-fast) var(--ease);
}
[data-theme="dark"] .hw-fab { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5); }
.hw-fab:active { transform: scale(0.96); }

/* ── KARTE / FORMULARE ──────────────────────────────────────── */
.hw-card {
    background: var(--bg-elev);
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 18px;
    margin-bottom: 12px;
}
.hw-card-hd {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.hw-card-hd h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.hw-card-hd .meta { font-size: 11px; color: var(--muted); }

.hw-feld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
/* Nur die kleine Beschriftung bekommt Versalien — nicht die Foto-Fläche,
   die selbst ein <label> ist und sonst alles darin mit-versalisiert. */
.hw-feld > label:not(.hw-foto-feld) {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.hw-feld .hinweis { font-size: 11px; color: var(--muted-2); }

input[type="text"], input[type="password"], input[type="search"],
select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-btn);
    /* 16px verhindert, dass iOS beim Antippen hineinzoomt */
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-elev);
    color: var(--ink);
    outline: none;
    transition: border-color var(--t-fast) var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

.hw-feld-reihe {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .hw-feld-reihe { grid-template-columns: 1fr; gap: 0; }
}

/* Auswahl als antippbare Kacheln (Priorität, Kita) */
.hw-wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-wahl input { position: absolute; opacity: 0; pointer-events: none; }
.hw-wahl label {
    flex: 1 1 auto;
    min-width: 96px;
    text-align: center;
    padding: 11px 12px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-btn);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    background: var(--bg-elev);
    transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.hw-wahl label:hover { color: var(--ink); }
.hw-wahl input:checked + label {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg-elev);
}
.hw-wahl input:checked + label.warnung {
    border-color: var(--bad);
    background: var(--bad-soft);
    color: var(--bad);
}
.hw-wahl input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Foto-Auswahl */
.hw-foto-feld {
    border: 1.5px dashed var(--rule-strong);
    border-radius: var(--r-btn);
    padding: 18px;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    display: block;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.hw-foto-feld:hover { border-color: var(--ink); color: var(--ink); }
.hw-foto-feld input { display: none; }
.hw-foto-feld .gross { font-size: 13px; font-weight: 600; display: block; margin-top: 6px; color: var(--ink); }
.hw-foto-feld .klein { font-size: 11px; display: block; margin-top: 2px; }
.hw-foto-vorschau {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.hw-foto-vorschau img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid var(--rule);
}

/* ── DETAILANSICHT ──────────────────────────────────────────── */
/* Breit: links die Sache (Kopf, Text, Fotos, Status),
   rechts die Verständigung (Verlauf). Schmal: untereinander. */
.hw-detail-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 900px) {
    .hw-detail-grid { grid-template-columns: 1.3fr 1fr; align-items: start; }
    .hw-detail-grid > .spalte-neben { position: sticky; top: 74px; }
}

.hw-zurueck {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 12px;
}
.hw-zurueck:hover { color: var(--ink); }

.hw-detail-kopf {
    border: 1px solid var(--rule);
    border-radius: var(--r-card);
    padding: 18px;
    margin-bottom: 12px;
    background: var(--bg-elev);
}
.hw-detail-kopf.is-dringend { border-color: var(--bad); }
.hw-detail-kopf h1 {
    margin: 8px 0 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.25;
}
.hw-detail-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--rule);
}
.hw-detail-meta-item { display: flex; flex-direction: column; gap: 1px; }
.hw-detail-meta-item .lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted-2);
}
.hw-detail-meta-item .val { font-size: 12.5px; font-weight: 600; }

.hw-beschreibung {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Fotos */
.hw-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.hw-galerie a { display: block; }
.hw-galerie img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--rule);
    background: var(--bg-sunk);
}

/* Statuswechsel */
.hw-status-wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-status-wahl .hw-btn { flex: 1 1 auto; min-width: 120px; }

/* Verlauf */
.hw-verlauf { display: flex; flex-direction: column; gap: 2px; }
.hw-eintrag { display: flex; gap: 10px; padding: 9px 0; }
.hw-eintrag + .hw-eintrag { border-top: 1px solid var(--rule); }
.hw-eintrag-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-sunk);
    border: 1px solid var(--rule);
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-2);
    flex-shrink: 0;
}
.hw-eintrag-body { flex: 1; min-width: 0; }
.hw-eintrag-kopf {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.hw-eintrag-name { font-size: 12.5px; font-weight: 700; }
.hw-eintrag-zeit { font-size: 10.5px; color: var(--muted-2); }
.hw-eintrag-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.hw-eintrag.is-system { padding: 7px 0; }
.hw-eintrag.is-system .hw-eintrag-avatar {
    background: transparent;
    border-style: dashed;
    color: var(--muted-2);
}
.hw-eintrag.is-system .hw-eintrag-text { font-size: 12px; color: var(--muted); }

/* ── LEERE LISTE ────────────────────────────────────────────── */
.hw-leer {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
    background: var(--bg-elev);
    border: 1px dashed var(--rule-strong);
    border-radius: var(--r-card);
}
.hw-leer .icon { color: var(--muted-2); margin-bottom: 10px; }
.hw-leer .gross { font-size: 14.5px; font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.hw-leer .klein { font-size: 12.5px; }

/* ── MELDUNGEN AN DEN NUTZER ────────────────────────────────── */
.hw-flash {
    padding: 11px 15px;
    border-radius: var(--r-btn);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 9px;
    animation: hwFlashIn 0.3s var(--ease) both;
}
.hw-flash.is-good { background: var(--p-mint-bg);   color: var(--p-mint-fg); }
.hw-flash.is-bad  { background: var(--bad-soft);    color: var(--bad); }
.hw-flash.is-warn { background: var(--p-yellow-bg); color: var(--p-yellow-fg); }
@keyframes hwFlashIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── ANMELDESEITE ───────────────────────────────────────────── */
.hw-login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 20px;
}
.hw-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-elev);
    border: 1px solid var(--rule);
    border-radius: 18px;
    padding: 30px 26px 26px;
}
.hw-login-mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    background: var(--brand-grad);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    color: #064e3b;
}
[data-theme="dark"] .hw-login-mark { color: #a7f3d0; }
.hw-login-card h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
}
.hw-login-card .unter {
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    margin: 5px 0 22px;
}
.hw-login-fuss {
    margin-top: 18px;
    text-align: center;
    font-size: 11px;
    color: var(--muted-2);
}

/* ── ANMELDUNG ──────────────────────────────────────────────
   Bewusst schlicht: keine Texturen, keine Effekte, kein Zierrat.
   Links wofür man sich anmeldet, rechts das Formular. Sonst nichts. */
.hw-anmeldung {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.hw-anmeldung-links {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 8vh clamp(32px, 6vw, 96px);
    background: var(--bg-sunk);
    border-right: 1px solid var(--rule);
}
.hw-anmeldung-firma {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.hw-anmeldung-links h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.02;
}
.hw-anmeldung-links p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 40ch;
}
.hw-anmeldung-haeuser {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.hw-anmeldung-haeuser span {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-pill);
    padding: 5px 11px;
}

/* Kennzeichnung: kein Angebot fuer die Allgemeinheit, sondern
   ein internes Werkzeug. Steht dezent unter der Marke. */
.hw-anmeldung-kennz {
    margin: 22px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.hw-anmeldung-rechts {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh clamp(24px, 5vw, 72px);
    position: relative;
}
.hw-anmeldung-form { width: 100%; max-width: 340px; }
.hw-anmeldung-form h2 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.hw-anmeldung-form .unter {
    margin: 0 0 26px;
    font-size: 13px;
    color: var(--muted);
}
.hw-anmeldung-theme { position: absolute; top: 22px; right: 22px; }
.hw-anmeldung-fuss {
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted-2);
    text-align: center;
}

/* Passwortfeld mit Auge und Feststelltasten-Hinweis */
.hw-feld-pw { position: relative; }
.hw-feld-pw input { padding-right: 46px; }
.hw-auge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hw-auge:hover { color: var(--ink); background: var(--bg-sunk); }
.hw-caps {
    display: none;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--warn);
}
.hw-caps.is-an { display: block; }

@media (max-width: 820px) {
    .hw-anmeldung { grid-template-columns: 1fr; }
    .hw-anmeldung-links {
        border-right: 0;
        border-bottom: 1px solid var(--rule);
        padding: 40px clamp(20px, 6vw, 40px) 32px;
        gap: 12px;
        min-height: 0;
    }
    .hw-anmeldung-links h1 { font-size: 30px; }
    .hw-anmeldung-links p { font-size: 13.5px; }
    .hw-anmeldung-rechts { padding: 36px clamp(20px, 6vw, 40px) 60px; }
}

/* ── KLEINKRAM ──────────────────────────────────────────────── */
.hw-trenner { height: 1px; background: var(--rule); margin: 16px 0; border: 0; }
.hw-abschnitt-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    margin: 0 0 8px;
}
.hw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

svg.ico { display: block; flex-shrink: 0; }

/* Tabelle in der Nutzerverwaltung */
.hw-tabelle-zeile {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid var(--rule);
}
.hw-tabelle-zeile:first-of-type { border-top: 0; }
.hw-tabelle-zeile .nm { font-size: 13.5px; font-weight: 650; }
.hw-tabelle-zeile .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Loeschen. Rot, damit niemand es mit „Erledigt" verwechselt. */
.hw-btn-loeschen { background: var(--bad); border-color: var(--bad); color: #fff; }
.hw-btn-loeschen:hover { background: #991b1b; border-color: #991b1b; color: #fff; }

/* ── Lupe: Foto gross auf der Seite ─────────────────────────────────
   Nur opacity wird bewegt, damit es auch auf dem Handy fluessig bleibt.
   Kein backdrop-filter, der kostet auf iPhones spuerbar Bildrate. */
.hw-lupe {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s var(--ease);
}
.hw-lupe.is-auf { opacity: 1; pointer-events: auto; }

.hw-lupe img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    /* Der Klick auf das Bild selbst soll nicht schliessen */
    cursor: default;
}

.hw-lupe button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: background 0.14s var(--ease);
}
.hw-lupe button:hover { background: rgba(255, 255, 255, 0.28); }

.hw-lupe-zu {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    font-size: 22px;
}
.hw-lupe-vor, .hw-lupe-zurueck {
    top: 50%;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    font-size: 24px;
}
.hw-lupe-zurueck { left: 12px; }
.hw-lupe-vor     { right: 12px; }

.hw-lupe-zaehler {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12.5px;
    letter-spacing: 0.02em;
}

/* Auf schmalen Geraeten stehen die Pfeile sonst auf dem Bild */
@media (max-width: 560px) {
    .hw-lupe-vor, .hw-lupe-zurueck { top: auto; bottom: 14px; margin-top: 0; }
    .hw-lupe-zaehler { bottom: 28px; }
}

/* Kleiner Hinweistext, auch ausserhalb eines Formularfelds */
.hinweis { font-size: 11px; color: var(--muted-2); }

/* Benachrichtigungen im Profil */
.hw-push-stand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.55;
}
.hw-push-punkt {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--muted-2);
}
.hw-push-stand.is-an  .hw-push-punkt { background: var(--good); }
.hw-push-stand.is-aus .hw-push-punkt { background: var(--muted-2); }
.hw-push-stand.is-bad .hw-push-punkt { background: var(--bad); }
.hw-push-hinweis {
    display: block;
    font-size: 11.5px;
    color: var(--muted-2);
    line-height: 1.55;
    margin-top: 10px;
}
