/* Mobile-first, responsive */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d9dee7;
    --danger: #dc2626;
    --ok-bg: #dcfce7; --ok-text: #166534;
    --err-bg: #fee2e2; --err-text: #991b1b;
    --info-bg: #dbeafe; --info-text: #1e40af;
    --radius: 12px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a; --card: #1e293b; --text: #e5e7eb; --muted: #94a3b8; --border: #334155;
        --ok-bg: #14532d; --ok-text: #bbf7d0;
        --err-bg: #7f1d1d; --err-text: #fecaca;
        --info-bg: #1e3a8a; --info-text: #bfdbfe;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
main.container { padding-top: 1.25rem; padding-bottom: 2rem; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1rem; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.25; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { color: var(--muted); font-weight: 400; font-size: .85em; }

/* Kopfzeile + Navigation (ohne JavaScript) */
.site-header { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 56px; }
.brand { color: #fff; font-weight: 700; font-size: 1.1rem; line-height: 1.2; text-decoration: none;
         display: flex; align-items: center; gap: .6rem; flex: 1 1 auto; min-width: 0; padding: .4rem 0; }
.brand img { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; background: #fff; }
.hero-logo { display: block; width: min(260px, 72%); height: auto; margin: 0 auto 1.25rem;
             background: #fff; border-radius: 12px; padding: .5rem; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: flex; flex-direction: column; gap: 5px; padding: 12px; cursor: pointer; }
.burger span { width: 24px; height: 3px; background: #fff; border-radius: 2px; }
.nav { display: none; width: 100%; flex-direction: column; padding-bottom: .5rem; }
.nav a { color: #fff; text-decoration: none; padding: .85rem .5rem; border-top: 1px solid rgba(255,255,255,.2); font-weight: 500; }
.nav a.active { text-decoration: underline; text-underline-offset: 4px; }
.nav-toggle:checked ~ .nav { display: flex; }
.nav-toggle:focus-visible ~ .burger { outline: 2px solid #fff; border-radius: 6px; }

/* Karten & Raster */
.card, .form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; }
.grid .card { margin-bottom: 0; }
.hero { text-align: center; padding: 1.5rem 0 1.75rem; }
.hero h1 { font-size: 1.9rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 36rem; margin: 0 auto 1.25rem; }
.form-card { max-width: 440px; margin-left: auto; margin-right: auto; }
.form-card.wide { max-width: 640px; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }

/* Formulare – 16px Schrift verhindert Zoomen auf iOS */
label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;
    padding: .8rem .9rem;
    min-height: 48px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 3px solid rgba(37,99,235,.35); border-color: var(--primary); }
.two-col { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }

/* Buttons (mind. 48px hoch für Touch) */
.btn {
    display: inline-block;
    min-height: 48px;
    padding: .8rem 1.4rem;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: transparent; color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-block { display: block; width: 100%; margin-top: 1.25rem; }
.btn-row { display: flex; flex-direction: column; gap: .75rem; align-items: stretch; max-width: 320px; margin: 0 auto; }

/* Meldungen */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); }
.alert-error   { background: var(--err-bg); color: var(--err-text); }
.alert-info    { background: var(--info-bg); color: var(--info-text); }

/* Datenliste */
.data { margin: 0 0 1rem; }
.data dt { font-size: .85rem; color: var(--muted); margin-top: .6rem; }
.data dd { margin: 0; font-weight: 500; word-break: break-word; }

.site-footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom)); }

/* ---------- Projekte ---------- */
:root { color-scheme: light dark; }
input[type=date], input[type=datetime-local] {
    width: 100%;
    font: inherit;
    font-size: 16px;
    padding: .8rem .9rem;
    min-height: 48px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
input[readonly], textarea[readonly], input:disabled { opacity: .75; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.btn-small { min-height: 40px; padding: .4rem .9rem; font-size: .95rem; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge-open { background: var(--info-bg); color: var(--info-text); }
.badge-done { background: var(--ok-bg); color: var(--ok-text); }

.filter { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1rem; margin-bottom: 1rem; }
.filter summary { cursor: pointer; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.filter form { padding-bottom: 1rem; }
.filter label { margin-top: .6rem; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.filter-grid .full { grid-column: 1 / -1; }
.filter-actions { display: flex; gap: .75rem; margin-top: 1rem; }
.filter-actions .btn { flex: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.info { margin-top: 1.25rem; padding-top: .5rem; border-top: 1px solid var(--border); }

/* Liste: auf dem Handy als Karten */
.list { width: 100%; border-collapse: collapse; }
.list thead { display: none; }
.list, .list tbody, .list tr, .list td { display: block; width: 100%; }
.list tr { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .75rem; padding: .5rem .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.list td { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; text-align: right; }
.list td::before { content: attr(data-label); color: var(--muted); font-weight: 400; text-align: left; flex: 0 0 auto; }
.list td.actions { justify-content: flex-end; padding-top: .6rem; }
.list td.actions::before { content: none; }
.list a { font-weight: 600; }
.list th a { color: inherit; text-decoration: none; }

@media (min-width: 700px) {
    .filter-grid { grid-template-columns: repeat(4, 1fr); }
    .filter-grid .full { grid-column: auto; }
    .filter-actions .btn { flex: 0 0 auto; min-width: 140px; }
    .table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .list { display: table; }
    .list thead { display: table-header-group; background: var(--bg); }
    .list tbody { display: table-row-group; }
    .list tr { display: table-row; background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; padding: 0; box-shadow: none; }
    .list tbody tr:last-child { border-bottom: 0; }
    .list th, .list td { display: table-cell; text-align: left; padding: .75rem; width: auto; }
    .list td::before { content: none; }
    .list td.actions { text-align: right; }
}

/* ---------- Tätigkeiten, Auswertung, Mengen ---------- */
.nomargin { margin: 0; }
.small { font-size: .9rem; }
.two-col.keep { grid-template-columns: 2fr 1fr; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.btn-stack { display: flex; flex-direction: column; gap: .6rem; margin-top: .5rem; }
.btn-stack .btn-block { margin-top: 0; }
.list tr.editing { outline: 2px solid var(--primary); outline-offset: -2px; }

.stats-section { max-width: 640px; margin: 0 auto 1rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; line-height: 1.35; word-break: break-word; }
.stat .unit { font-size: .9rem; font-weight: 500; color: var(--muted); }
.stat-big .value { font-size: 1.9rem; }

/* Feste Spaltenbreiten: "Einträge" und "Menge" stehen in allen Tabellen exakt untereinander */
.stat-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.stat-table th:nth-child(2), .stat-table td:nth-child(2) { width: 6.3rem; }
.stat-table th:nth-child(3), .stat-table td:nth-child(3) { width: 4.4rem; }
.stat-table .sub { display: block; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.stat-table th, .stat-table td { padding: .6rem .4rem; border-bottom: 1px solid var(--border); text-align: left; }
.stat-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stat-table tbody tr:last-child td { border-bottom: 0; }
.stat-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (min-width: 700px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-grid.two { grid-template-columns: repeat(2, 1fr); }
    .list th.num, .list td.num { text-align: right; }
}

/* ---------- Löschen & Protokoll ---------- */
.badge-del { background: var(--err-bg); color: var(--err-text); }
.delete-form { margin-top: .75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.delete-form .btn-block { margin-top: 0; }
.list .details { text-align: left; line-height: 1.5; }

/* Tablet und größer */
@media (min-width: 700px) {
    h1 { font-size: 2rem; }
    .burger { display: none; }
    .nav { display: flex; flex-direction: row; width: auto; padding: 0; gap: .25rem; }
    .nav a { border-top: 0; padding: .5rem .75rem; border-radius: 8px; }
    .nav a:hover { background: rgba(255,255,255,.15); }
    .grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .two-col { grid-template-columns: 1fr 1fr; }
    .btn-row { flex-direction: row; justify-content: center; max-width: none; }
    .btn-block { width: auto; display: inline-block; }
    .hero { padding: 3rem 0; }
    .hero h1 { font-size: 2.6rem; }
}

/* ---------- Erweiterungen: Kopfzeile mit Benutzer, Checkbox, Fotos, Bilder, Standort ---------- */
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-user { font-size: .75rem; font-weight: 400; opacity: .9; line-height: 1.3; }

.check { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .25rem; font-weight: 500; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin: 0; flex: 0 0 auto; }

.foto-row { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: .5rem; }
.foto-feld { flex: 1 1 auto; min-width: 0; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); background: var(--bg); }
.avatar-leer { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--muted); }

input[type=file] { width: 100%; padding: .5rem; border: 1px dashed var(--border); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }

.geo { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.geo input { flex: 1 1 12rem; min-width: 0; }
.geo .btn { flex: 0 0 auto; white-space: nowrap; }
.geo-status { margin: .25rem 0 0; min-height: 1.2em; }
.small { font-size: .85rem; }
.nomargin { margin: 0; }

.num-input { text-align: right; }

.thumb-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.thumb-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.thumbs { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.thumbs li { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.thumbs .cap { font-size: .75rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }

.mini { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); vertical-align: middle; }
.mini.big { width: 120px; height: 120px; }
.bildzelle { line-height: 1.4; }
.bildkommentar { display: block; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

.list th.num, .list td.num { text-align: right; }
.btn-stack + h2 { margin-top: 1.5rem; }

/* ---------- Menü mit Untermenüs (Projekte / Datenbank / Auswertungen) ---------- */
/* Handy: im aufgeklappten Menü stehen die Gruppen untereinander */
.nav-group { display: block; }
.nav-top { display: block; color: #fff; padding: .85rem .5rem .3rem; border-top: 1px solid rgba(255,255,255,.2);
           font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; opacity: .85; }
.nav-top.active { opacity: 1; }
.submenu { display: block; }
.nav .submenu a, .nav .submenu .disabled { display: block; border-top: 0; padding: .6rem .5rem .6rem 1.25rem; }
.nav .submenu .disabled { color: #fff; opacity: .45; cursor: not-allowed; }
@media (min-width: 700px) {
    .brand { flex: 0 0 auto; margin-right: 1.25rem; }
    .nav { flex: 1 1 auto; align-items: center; }
    .nav-group { position: relative; }
    .nav-top { padding: .5rem .75rem; border-top: 0; border-radius: 8px; font-size: 1rem; font-weight: 500;
               letter-spacing: 0; text-transform: none; opacity: 1; cursor: pointer; }
    .nav-top::after { content: ""; display: inline-block; margin-left: .45rem; vertical-align: .15em;
                      border: .3em solid transparent; border-top-color: currentColor; border-bottom-width: 0; }
    .nav-top.active { text-decoration: underline; text-underline-offset: 4px; }
    .nav-group:hover .nav-top, .nav-group:focus-within .nav-top { background: rgba(255,255,255,.15); }
    .submenu { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; padding: .35rem; z-index: 20;
               background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.2); }
    .nav-group:hover .submenu, .nav-group:focus-within .submenu { display: block; }
    .nav .submenu a, .nav .submenu .disabled { padding: .65rem .85rem; border-radius: 8px; }
    .nav .submenu a { color: var(--text); }
    .nav .submenu a:hover { background: var(--bg); }
    .nav .submenu a.active { color: var(--primary); font-weight: 700; text-decoration: none; }
    .nav .submenu .disabled { color: var(--muted); opacity: .6; }
    .nav-right { margin-left: auto; }
    .nav-right .submenu { left: auto; right: 0; min-width: 200px; }
}

/* Kopfzeile am PC: breiter als der Inhalt, Menü rechtsbündig */
@media (min-width: 700px) {
    .nav { justify-content: flex-start; gap: .1rem; }
    .nav-right { margin-left: auto; }
    .nav-right .nav-top { background: rgba(255,255,255,.14); }
    .nav-right .nav-top:hover { background: rgba(255,255,255,.25); }
}

/* ---------- HighScore ---------- */
.hs-einheit { margin: 1.5rem 0 .75rem; }
.hs-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; }
.hs-card { margin-bottom: 0; }
.hs-card h3 { font-size: 1rem; margin: 0 0 .5rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.score { width: 100%; border-collapse: collapse; }
.score th, .score td { padding: .5rem .35rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.score tbody tr:last-child td { border-bottom: 0; }
.score th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.score .rang { width: 2rem; text-align: center; color: var(--muted); font-weight: 700; }
.score .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.score .zeitraum { display: block; font-size: .8rem; color: var(--muted); }
.score tbody tr:first-child .rang { color: #b45309; }
.score tr.ich td { background: var(--info-bg); }
@media (min-width: 700px) { .hs-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Tätigkeitsdauer ---------- */
.dauer { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem .9rem; margin: 1rem 0; background: var(--bg); }
.dauer legend, .dauer-titel { font-weight: 700; margin: 0 0 .75rem; font-size: 1.05rem; }
.dz { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; align-items: end; margin-bottom: .9rem; }
.dz > .lbl { grid-column: 1 / -1; font-weight: 600; margin: 0 0 -.25rem; }
.dz .bt { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.6fr; gap: .5rem; }
.dz > .btn { grid-column: 1 / -1; }
.form-card.breit { max-width: 760px; }
.dz select { width: 100%; min-height: 48px; padding: .6rem .5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
.dz input { text-align: right; font-variant-numeric: tabular-nums; }
.dz .sub { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.dz.diff { grid-template-columns: 1fr 1fr 1fr; }
.dz.diff .unit { display: flex; align-items: center; gap: .4rem; }
.dz.diff .unit span { color: var(--muted); font-size: .9rem; }
.dz.diff .unit input { min-width: 0; }
.dauer-fehler { color: var(--err-text); background: var(--err-bg); border-radius: 8px; padding: .5rem .75rem; margin: 0 0 .75rem; display: none; }
.dauer-aktionen { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: 1.25rem; }
.dauer-aktionen .btn { margin: 0; }
.rework-weg { border-top: 1px dashed var(--border); padding-top: .9rem; }
.lauf { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--info-bg); color: var(--info-text);
        border-radius: 10px; padding: .6rem .9rem; margin: -.3rem 0 .9rem; }
.lauf[hidden] { display: none; }
.lauf strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.lauf.stopp { background: var(--ok-bg); color: var(--ok-text); }
.vorschau-hinweis { font-size: .85rem; }
@media (min-width: 700px) {
    .dz { grid-template-columns: 5rem 1fr 1fr 15rem; }
    .dz .bt { grid-column: auto; grid-template-columns: 4.5rem 1fr; }
    .dz > .lbl { grid-column: auto; margin: 0; padding-bottom: .7rem; }
    .dz > .btn { grid-column: auto; }
    .dz.diff { grid-template-columns: 5rem 1fr 1fr 1fr 15rem; }
    .dz.diff input { padding-left: .4rem; padding-right: .4rem; }
    .dz .sub { min-height: 1.2rem; }
    .dauer-aktionen { grid-template-columns: 1fr; max-width: 15rem; margin-left: auto; }
    .dz.head { margin-bottom: .2rem; }
}
.dz.head .sub { margin: 0; text-align: left; }

/* ---------- Datum/Uhrzeit mit Kalender- bzw. Uhr-Knopf ---------- */
.pf { position: relative; display: block; }
.pf input[data-pick] { padding-left: .6rem; padding-right: 2.5rem; font-size: .95rem; }
.pf-btn { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: 2.4rem; height: 2.4rem; border: 0; border-radius: 8px;
          background: transparent; color: var(--primary); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pf-btn:hover, .pf-btn:focus-visible { background: rgba(37,99,235,.12); }
.pf-nat { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ===== BDE: Polter und Stämme ===== */
.reiter { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.reiter a { display: inline-flex; align-items: baseline; gap: .35rem; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: .5rem .95rem; font-weight: 600; text-decoration: none; min-height: 42px; align-items: center; }
.reiter a small { font-weight: 400; opacity: .85; }
.reiter a.aktiv { background: var(--primary); border-color: var(--primary); color: #fff; }
.reiter a.neu { border-style: dashed; color: var(--primary); }
.erstellt-zeile { margin: 0 0 .5rem; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .95rem; }
fieldset.polter-felder { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.polter-felder:disabled { opacity: .75; }
.bde-form select, .stamm-grid select { width: 100%; min-height: 48px; padding: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
.check-zeile { display: flex; align-items: center; gap: .6rem; min-height: 48px; margin: 0; font-weight: 600; cursor: pointer; }
.check-zeile input { width: 1.4rem; height: 1.4rem; margin: 0; flex: 0 0 auto; }

.s-kopf { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.s-kopf h2 { margin: 0; }
.fm-kopf { background: var(--info-bg); color: var(--info-text); border-radius: 10px; padding: .3rem .8rem; font-size: 1.6rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.fm-pc { display: none; }
.fm-box { background: var(--info-bg); color: var(--info-text); border-radius: 10px; padding: .55rem .9rem; display: flex; justify-content: flex-end; align-items: baseline; min-height: 48px; }
.fm-box strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stamm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: end; }
.stamm-grid .zeile, .stamm-grid .zwei-chk { grid-column: 1 / -1; }
.stamm-grid input.r { text-align: right; }
.stamm-grid .z label { text-align: right; display: block; }
.stamm-grid label { margin-top: 0; }
.stamm-grid [hidden] { display: none; }
.stamm-grid.ohne-gute > .art-z { grid-column: 1 / -1; }
.zwei-chk { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.zwei-chk .gps-chk { grid-column: 1 / -1; }
.knoepfe { display: flex; gap: .75rem; flex-wrap: wrap; }
.knoepfe .btn { flex: 1 1 10rem; margin: 0; }
.thumbs-k { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.thumbs-k img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.gps-hinweis { margin: 0; min-height: 1.2em; }

.bde-scroll { max-height: 26rem; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.bde-scroll.hoch { max-height: none; }
.bde-tab { width: 100%; border-collapse: collapse; }
.bde-tab th, .bde-tab td { padding: .5rem .45rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.bde-tab th { color: var(--muted); font-size: .85rem; background: var(--bg); position: sticky; top: 0; }
.bde-tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bde-tab tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
.bde-tab tr.neu td { background: var(--ok-bg); }
.bde-tab .sub { display: block; font-size: .78rem; color: var(--muted); line-height: 1.25; }
.bde-tab .sub a { font-weight: 400; }
.bde-tab .mini { display: inline-block; width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); margin: .15rem .15rem 0 0; vertical-align: top; }
.kaefer { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 0 .4rem; font-size: .75rem; font-weight: 700; margin-left: .3rem; }
@media (prefers-color-scheme: dark) { .kaefer { background: #78350f; color: #fde68a; } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--danger); font-size: 1.2rem; cursor: pointer; min-width: 36px; min-height: 36px; border-radius: 8px; text-decoration: none; padding: 0; font-family: inherit; }
.icon-btn.bearb { color: var(--primary); }
.aktion-spalte { white-space: nowrap; text-align: right; }
.aktion-spalte form { display: inline; }

.summen { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0; }
.summen .stat { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; }
.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .65rem; font-size: .9rem; }
.export-leiste { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.export-leiste .btn { flex: 1 1 11rem; margin: 0; text-align: center; }

.klassen { width: 100%; border-collapse: collapse; }
.klassen th { text-align: left; font-size: .85rem; color: var(--muted); padding: .25rem; }
.klassen td { padding: .2rem; }
.klassen input { text-align: right; min-height: 44px; }
.bde-filter { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-bottom: .75rem; }
.bde-filter select, .bde-filter input { width: 100%; min-height: 48px; }
.bde-liste-tab { width: 100%; border-collapse: collapse; }
.bde-liste-tab th, .bde-liste-tab td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.bde-liste-tab th { color: var(--muted); font-size: .85rem; background: var(--bg); }
.bde-liste-tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bde-liste-tab .sub { display: block; font-size: .78rem; color: var(--muted); }
.bde-liste-tab tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }

@media (max-width: 520px) {
    .bde-tab { font-size: .82rem; }
    .bde-tab th, .bde-tab td { padding: .45rem .25rem; }
    .icon-btn { min-width: 46px; min-height: 46px; font-size: 1.6rem; }
    .aktion-spalte { width: 46px; }
    .aktion-spalte .icon-btn { display: flex; margin: 0 auto; }
    .bde-liste-tab { font-size: .85rem; }
    .bde-liste-tab th, .bde-liste-tab td { padding: .45rem .3rem; }
    .bde-liste-tab .nur-pc { display: none; }
}
@media (min-width: 700px) {
    .fm-kopf { display: none; }
    .fm-pc { display: block; }
    .stamm-grid { grid-template-columns: 1fr 1fr 1fr 2fr 1fr; gap: 1rem; }
    .stamm-grid.ohne-gute { grid-template-columns: 1fr 1fr 3fr 1fr; }
    .stamm-grid.ohne-gute > .art-z { grid-column: auto; }
    .stamm-grid input, .stamm-grid select { min-height: 56px; font-size: 1.1rem; }
    .stamm-grid .fm-box { min-height: 56px; }
    .stamm-grid .zwei-chk { grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 2.5rem; }
    .stamm-grid .zwei-chk .gps-chk { grid-column: auto; }
    .btn-gross { min-height: 60px; font-size: 1.15rem; padding: .9rem 1.5rem; flex: 1 1 14rem; }
    .summen { grid-template-columns: repeat(4, 1fr); }
    .export-leiste { gap: 1.25rem; margin-top: 1.5rem; }
    .export-leiste .btn { min-height: 72px; font-size: 1.2rem; padding: 1rem 1.25rem; flex: 1 1 9.5rem; display: flex; align-items: center; justify-content: center; }
    .bde-filter { grid-template-columns: 2fr 1fr auto; align-items: end; }
}

.form-card.wide.breit.weit { max-width: 100%; }
.bde-filter select { width: 100%; min-height: 48px; padding: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }

/* Menü: Zwischenüberschrift (Holzerfassung), Kopfzeile kompakter, Hamburger immer rechts */
.nav-sub { display: block; padding: .5rem .5rem .1rem 1.25rem; font-size: .8rem; font-weight: 700; opacity: .8; }
.form-card select { width: 100%; min-height: 48px; padding: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
.header-inner { flex-wrap: wrap; }
.brand { font-size: 1rem; flex: 1 1 0; min-width: 0; }
.brand-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; }
.burger { flex: 0 0 auto; margin-left: auto; }
@media (min-width: 700px) {
    .brand { flex: 0 0 auto; }
    .nav-sub { position: static; padding: .4rem .75rem .1rem; color: var(--muted); opacity: 1; }
}

/* Stamm erfassen: kompakte Polter-Auswahl, Checkboxen in einer Zeile, Meldung unten */
.polter-zeile { margin: .4rem auto .5rem !important; padding: .45rem .75rem !important; display: flex; align-items: center; gap: .75rem; }
.polter-zeile label { margin: 0 !important; flex: 0 0 auto; }
.polter-zeile select { min-height: 40px !important; padding: .3rem .6rem !important; flex: 1 1 auto; width: auto !important; }
.stamm-grid .zwei-chk { display: flex !important; flex-wrap: nowrap; justify-content: space-between; gap: .4rem !important; }
.stamm-grid .zwei-chk .check-zeile { font-size: .88rem; gap: .35rem; margin: 0; white-space: nowrap; flex: 0 1 auto; }
.stamm-grid .zwei-chk input[type=checkbox] { width: 1.05rem; height: 1.05rem; margin: 0; }
@media (min-width: 700px) { .stamm-grid .zwei-chk { justify-content: flex-start; gap: 2rem !important; } .stamm-grid .zwei-chk .check-zeile { font-size: 1rem; } }
.toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50;
         background: #14532d; color: #fff; border-radius: 14px; padding: 1rem 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,.35);
         min-width: 240px; max-width: 92vw; opacity: 0; pointer-events: none; transition: opacity .15s; }
.toast.an { opacity: 1; }
.toast h3 { margin: 0 0 .4rem; font-size: 1.05rem; color: #fff; }
.toast dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .9rem; margin: 0; }
.toast dt { opacity: .8; }
.toast dd { margin: 0; text-align: right; font-weight: 600; }
.polter-zeile { box-sizing: border-box; max-width: 100%; }
.polter-zeile select { min-width: 0; box-sizing: border-box; max-width: 100%; flex: 1 1 0; text-overflow: ellipsis; }

/* Handy: geöffnetes Menü ist scrollbar, damit auch der letzte Punkt (Benutzer: Profil, Abmelden) erreichbar ist */
@media (max-width: 699px) {
    .nav-toggle:checked ~ .nav { max-height: calc(100vh - 72px - env(safe-area-inset-top)); max-height: calc(100dvh - 72px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}

/* Polter verwalten: auf dem Handy Bearbeiten-Symbol statt Knopf */
.btn-pc { display: none; }
.icon-handy { display: inline-flex; }
@media (min-width: 700px) { .btn-pc { display: inline-block; } .icon-handy { display: none; } }

/* Polter-Farbe (gelb, blau, rot) */
.farbwahl { display: flex; gap: .5rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.farbe-opt { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border: 2px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; margin: 0 !important; background: var(--card); color: var(--text); }
.farbe-opt input { margin: 0; }
.farbe-opt.f-gelb { background: #fde68a; border-color: #f59e0b; color: #422006; }
.farbe-opt.f-blau { background: #bfdbfe; border-color: #3b82f6; color: #172554; }
.farbe-opt.f-rot  { background: #fecaca; border-color: #ef4444; color: #450a0a; }
.farbe-opt:has(input:checked) { box-shadow: 0 0 0 3px rgba(37,99,235,.45); }
.polter-zeile.farbig.f-gelb { background: #fde68a; border-color: #f59e0b; color: #422006; }
.polter-zeile.farbig.f-blau { background: #bfdbfe; border-color: #3b82f6; color: #172554; }
.polter-zeile.farbig.f-rot  { background: #fecaca; border-color: #ef4444; color: #450a0a; }
.polter-zeile.farbig label { color: inherit; }
.farbig-rand.f-gelb { border-top: 8px solid #f59e0b; }
.farbig-rand.f-blau { border-top: 8px solid #3b82f6; }
.farbig-rand.f-rot  { border-top: 8px solid #ef4444; }

/* Profil: Einstellungen (Kategorie Stamm erfassen), Karten linksbündig */
.profil-seite .form-card { margin-left: 0; margin-right: auto; max-width: 720px; width: 100%; }
.pfad-leiste { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.pfad-leiste a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: var(--card); font-weight: 600; }
.kat .unter { margin: 1rem 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.einst-zeile { padding: .75rem 0; border-top: 1px solid var(--border); }
.kat .unter + .einst-zeile { border-top: 0; }
.einst-zeile .check { margin: 0; }
.einst-zeile .muted { margin: .25rem 0 0 1.8rem; }
.einst-unter { margin: .4rem 0 0 1.8rem; }
.einst-unter .check { margin: .35rem 0; }
.unterkat summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: .6rem .75rem; background: var(--bg, #f3f4f6); border-radius: 10px; border: 1px solid var(--border); margin: .25rem 0 .5rem; list-style: none; }
.unterkat summary::-webkit-details-marker { display: none; }
.unterkat summary::before { content: "▾ "; }
.unterkat:not([open]) summary::before { content: "▸ "; }
.profil-seite .stats-section { margin-left: 0; margin-right: auto; max-width: 720px; }

/* Güte | Länge | Ø in einer Zeile, rechtsbündig */
.stamm-grid { grid-template-columns: .75fr 1fr 1fr; gap: .6rem; align-items: start; }
.stamm-grid .art-z { grid-column: 1 / -1; }
.stamm-grid.ohne-gute { grid-template-columns: 1fr 1fr; }
.stamm-grid .g-z label, .stamm-grid .z label { text-align: right; display: block; margin-bottom: .25rem; white-space: nowrap; }
.stamm-grid .g-z select, .stamm-grid .z input { height: 3.6rem; min-height: 3.6rem; font-size: 1.5rem; font-weight: 600; box-sizing: border-box; width: 100%; text-align: right; text-align-last: right; padding-left: .4rem; padding-right: .5rem; }
.stamm-grid .art-z select { height: 3rem; }
@media (min-width: 700px) {
    .stamm-grid { grid-template-columns: 1fr 1fr 1fr 2.2fr 1fr; gap: 1rem; }
    .stamm-grid .art-z { grid-column: auto; }
    .stamm-grid.ohne-gute { grid-template-columns: 1fr 1fr 3fr 1fr; }
}

/* Stämme-Liste: sortierbar, Güte-Spalte (PC), Karten (Handy) */
.gute { display: inline-block; min-width: 1.6rem; text-align: center; font-weight: 700; background: #eef2ff; color: #1d4ed8; border-radius: 6px; padding: .05rem .4rem; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .gute { background: #1e3a8a; color: #dbeafe; } }
.bde-tab th.s { cursor: pointer; user-select: none; white-space: nowrap; }
.bde-tab th.s:hover { background: var(--card); }
.bde-tab th.s::after { content: "\2195"; margin-left: .35rem; color: var(--muted); font-size: .8rem; }
.bde-tab th.s.asc::after { content: "\25B2"; color: var(--primary); }
.bde-tab th.s.desc::after { content: "\25BC"; color: var(--primary); }
.aktion-spalte { display: table-cell; }
.aktion-spalte form { display: inline; }
.stamm-pc { max-height: none; }
.stamm-hand { display: none; }
@media (max-width: 699px) {
    .stamm-pc { display: none; }
    .stamm-hand { display: block; }
    .sort-leiste { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
    .sort-leiste label { font-weight: 600; font-size: .9rem; margin: 0; }
    .sort-leiste select { flex: 1; height: 2.6rem; min-height: 2.6rem; padding: 0 .5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; }
    .sort-leiste button { width: 2.6rem; height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--primary); font-size: 1.1rem; cursor: pointer; }
    .stamm-karten { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
    .stamm-karten li { display: grid; grid-template-columns: 2.2rem 1fr auto; grid-template-rows: auto auto auto; gap: .2rem .5rem; align-items: center; padding: .7rem .6rem; border-bottom: 1px solid var(--border); }
    .stamm-karten li:last-child { border-bottom: 0; }
    .stamm-karten li.neu { background: var(--ok-bg); }
    .stamm-karten .leer { display: block; padding: .8rem; }
    .k-nr { grid-row: 1 / 3; grid-column: 1; align-self: stretch; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; color: var(--primary); background: var(--bg); border-radius: 8px; }
    .k-z1 { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: .4rem; }
    .k-z1 b { margin-right: .9rem; }
    .k-ak { grid-column: 3; grid-row: 1; display: flex; gap: .5rem; }
    .k-ak form { display: block; }
    .k-ak .icon-btn { width: 2.4rem; height: 2.4rem; min-width: 2.4rem; min-height: 2.4rem; font-size: 1.1rem; border: 1px solid var(--border); background: var(--card); margin: 0; display: flex; }
    .k-z2 { grid-column: 2 / 4; grid-row: 2; display: flex; gap: .9rem; white-space: nowrap; color: var(--muted); font-size: .9rem; }
    .k-z2 b { color: var(--text); font-size: 1.1rem; }
    .k-z2 .k-fm { margin-left: auto; }
    .k-zus { grid-column: 2 / 4; grid-row: 3; }
    .k-zus:empty { display: none; }
    .k-summe { display: flex; justify-content: space-between; font-weight: 700; padding: .7rem .8rem; margin-top: .6rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
}
@media (max-width: 350px) {
    .stamm-karten li { grid-template-columns: 1.8rem 1fr auto; gap: .2rem .3rem; padding: .7rem .4rem; }
    .k-ak { gap: .25rem; }
    .k-ak .icon-btn { width: 1.85rem; height: 1.85rem; min-width: 1.85rem; min-height: 1.85rem; }
    .k-z2 { gap: .6rem; }
    .k-z1 b { margin-right: .5rem; }
}

/* Kennzahlen: PC über der Tabelle (klein), Handy unter der Liste */
.pc-nur { display: none; }
@media (min-width: 700px) {
    .pc-nur { display: flex; }
    .hand-nur { display: none !important; }
    .stamm-info { flex-wrap: wrap; gap: .35rem 1.4rem; align-items: baseline; padding: 0 .15rem .5rem; font-size: .85rem; color: var(--muted); }
    .stamm-info b { color: var(--text); font-size: .95rem; margin-left: .3rem; font-variant-numeric: tabular-nums; }
    .stamm-info .ges { margin-left: auto; }
    .stamm-arten { flex-wrap: wrap; gap: .35rem; padding: 0 .15rem .65rem; align-items: center; }
    .stamm-arten .lab { font-size: .8rem; color: var(--muted); margin-right: .2rem; }
    .stamm-arten .chip { font-size: .78rem; padding: .12rem .6rem; }
}

/* Handy: Karten (Entwurf 6) und Kompaktansicht (Entwurf 8) */
.ansicht { display: none; }
.k-kopf, .kp, .k-hinweis { display: none; }
@media (max-width: 699px) {
    .ansicht { display: flex; }
    .ansicht button { width: 2.6rem; height: 2.6rem; border: 1px solid var(--border); background: var(--card); color: var(--primary); font-size: 1.2rem; cursor: pointer; }
    .ansicht button:first-child { border-radius: 10px 0 0 10px; }
    .ansicht button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
    .ansicht button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
    .sort-leiste { gap: .4rem; }
    /* ausführliche Karten: engere Abstände, Umbruch statt Überlauf */
    .stamm-karten .k-ak .icon-btn { width: 2.3rem; height: 2.3rem; min-width: 2.3rem; min-height: 2.3rem; }
    .k-ak { gap: .35rem; flex: none; }
    .k-z1 { min-width: 0; gap: .25rem; flex-wrap: wrap; row-gap: .1rem; }
    .k-z1 b { margin-right: .2rem; flex: none; }
    .k-z1 .gute, .k-z1 .kaefer { flex: none; }
    .k-z1 .kaefer { margin-left: 0; }
    /* Kompaktansicht */
    .stamm-hand.kompakt .k-kopf { display: grid; grid-template-columns: 2rem 1fr 2rem 2.6rem 2rem 2.9rem; gap: .35rem; padding: .35rem .5rem; font-size: .75rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; }
    .k-kopf span:nth-child(2) { margin-left: .45rem; }
    .k-kopf span:nth-child(1), .k-kopf span:nth-child(n+3) { text-align: right; }
    .stamm-hand.kompakt .stamm-karten { border-radius: 0 0 12px 12px; }
    .stamm-hand.kompakt .stamm-karten li { display: block; padding: .45rem .5rem; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; cursor: pointer; transition: background .15s; }
    .stamm-hand.kompakt .stamm-karten li > *:not(.kp) { display: none !important; }
    .stamm-hand.kompakt .kp { display: grid; grid-template-columns: 2rem 1fr 2rem 2.6rem 2rem 2.9rem; gap: .35rem; align-items: center; font-size: 1rem; }
    .stamm-hand.kompakt li.press, .stamm-hand.kompakt li.gewaehlt { background: var(--bg); }
    .kp .n { color: var(--primary); text-align: right; font-weight: 800; }
    .kp .a { display: flex; align-items: center; gap: .3rem; min-width: 0; flex-wrap: wrap; margin-left: .45rem; }
    .kp .a b { font-weight: 600; }
    .kp .gute { font-size: .8rem; }
    .kp .kaefer { margin: 0; font-size: .7rem; }
    .kp .v { text-align: right; font-variant-numeric: tabular-nums; }
    .kp .f { font-weight: 700; }
    .stamm-hand.kompakt .k-hinweis { display: block; font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
}
@media (max-width: 350px) {
    .stamm-karten .k-ak .icon-btn { width: 1.85rem; height: 1.85rem; min-width: 1.85rem; min-height: 1.85rem; }
    .k-ak { gap: .25rem; }
    .stamm-hand.kompakt .kp, .stamm-hand.kompakt .k-kopf { grid-template-columns: 1.6rem 1fr 1.9rem 2.3rem 1.7rem 2.5rem; gap: .25rem; font-size: .92rem; }
    .stamm-hand.kompakt .k-kopf { font-size: .72rem; }
    .kp .a, .k-kopf span:nth-child(2) { margin-left: .35rem; }
    .sort-leiste label { display: none; }
}
/* Menü bei langem Druck */
.sheet-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: none; align-items: flex-end; justify-content: center; z-index: 80; }
.sheet-bg.on { display: flex; }
.sheet { background: var(--card); color: var(--text); width: 100%; max-width: 600px; border-radius: 16px 16px 0 0; padding: .8rem 1rem 1rem; box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
.sheet h3 { margin: .1rem 0 .7rem; font-size: 1.05rem; }
.sheet h3 small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .1rem; }
.sheet button { display: flex; align-items: center; gap: .8rem; width: 100%; height: 3.4rem; border: 1px solid var(--border); background: var(--card); border-radius: 12px; margin-bottom: .5rem; font: inherit; font-size: 1.05rem; color: var(--primary); padding: 0 1rem; cursor: pointer; }
.sheet button i { font-style: normal; font-size: 1.3rem; width: 1.5rem; text-align: center; }
.sheet button.del { color: var(--danger); }
.sheet button.ab { justify-content: center; color: var(--text); background: var(--bg); margin-bottom: 0; }

/* Stamm erfassen: Buttonzeile, Büroklammer für Anmerkung/Bilder */
.stamm-grid .knoepfe { flex-wrap: nowrap; gap: .6rem; align-items: stretch; }
.stamm-grid .knoepfe .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.stamm-grid .knoepfe .btn.plus { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stamm-grid .knoepfe .btn-secondary { flex: 0 0 auto; padding-left: 1rem; padding-right: 1rem; font-size: .95rem; }
.zus-knopf { position: relative; flex: 0 0 auto; width: 3.4rem; border: 1px solid var(--primary); border-radius: 12px; background: var(--card); color: var(--primary); font-size: 1.3rem; cursor: pointer; padding: 0; }
.zus-knopf[aria-expanded="true"] { background: var(--primary); }
.zus-knopf[aria-expanded="true"] .sy { filter: brightness(0) invert(1); }
.zus-knopf .punkt { position: absolute; top: .35rem; right: .35rem; width: .6rem; height: .6rem; border-radius: 50%; background: #f59e0b; border: 1px solid var(--card); }
.zus { margin-top: .8rem; }
.zus input[type=text] { width: 100%; box-sizing: border-box; }
@media (min-width: 700px) {
    .zus-knopf { display: none; }
    #zus[hidden] { display: block; }
    .stamm-grid .knoepfe .btn-secondary { flex: 0 0 38%; font-size: 1rem; padding-left: 0; padding-right: 0; }
}
@media (max-width: 350px) {
    .zus-knopf { width: 2.8rem; }
    .stamm-grid .knoepfe .btn-secondary { font-size: .85rem; padding-left: .55rem; padding-right: .55rem; }
}
@media (max-width: 350px) {
    .stamm-grid .knoepfe { gap: .4rem; }
    .zus-knopf { width: 2.4rem; }
    .stamm-grid .knoepfe .btn:not(.plus):not(.btn-secondary) { font-size: .88rem; padding-left: .3rem; padding-right: .3rem; }
    .stamm-grid .knoepfe .btn-secondary { font-size: .8rem; padding-left: .4rem; padding-right: .4rem; }
}

/* Änderungsprotokoll (Verlauf) */
.lg-bg { align-items: flex-end; justify-content: center; z-index: 90; }
.lg { background: var(--card); color: var(--text); width: 100%; max-width: 600px; max-height: 85vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 1rem; box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
.lg h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.lg-s { color: var(--muted); font-size: .85rem; margin-bottom: .8rem; }
.tl { padding: 0 0 0 1rem; border-left: 2px solid var(--border); margin-top: .2rem; }
.tl .ev { position: relative; margin: 0 0 1rem; padding-left: .6rem; }
.tl .ev::before { content: ""; position: absolute; left: -1.45rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: #f59e0b; border: 2px solid var(--card); }
.tl .ev.neu::before { background: var(--primary); }
.tl .kopf { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.tl .kopf span { color: var(--muted); font-size: .85rem; }
.tl .zl { display: flex; gap: .6rem; font-size: .92rem; padding: .12rem 0; }
.tl .ft { color: var(--muted); min-width: 5.5rem; flex: none; }
.tl .wt { font-weight: 600; text-align: left; }
.lg-zu { margin-top: .6rem; width: 100%; height: 3rem; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 12px; font: inherit; cursor: pointer; }
@media (min-width: 700px) {
    .lg-bg { align-items: center; }
    .lg { width: min(440px, 92vw); border-radius: 14px; padding: 1.2rem 1.3rem; max-height: 80vh; }
}

/* ===== Benutzer & Rechte ===== */
.rb-tabs { display: flex; gap: .4rem; margin: .4rem 0 .9rem; }
.rb-tabs a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 2.8rem; border: 1px solid var(--border); background: var(--card); border-radius: 10px; font-weight: 600; color: var(--text); text-decoration: none; text-align: center; }
.rb-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rb-bdg { font-style: normal; background: #f59e0b; color: #fff; border-radius: 99px; font-size: .75rem; padding: .05rem .45rem; margin-left: .35rem; }
.rb-tabs a.on .rb-bdg { background: #fff; color: var(--primary); }
.rb { max-width: 1000px; }
.rb-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.rb-tools { display: flex; gap: .5rem; margin-bottom: .7rem; }
.rb-tools input { flex: 1; min-width: 0; height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .7rem; font: inherit; background: var(--card); color: var(--text); }
.rb-b { display: inline-flex; align-items: center; justify-content: center; height: 2.6rem; padding: 0 1rem; border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.rb-b.s { background: var(--card); color: var(--primary); }
.rb-b.del { background: var(--card); color: #b42318; border-color: #e5b4ae; }
.rb-b.del2 { background: var(--danger); border-color: var(--danger); }
.rb-b:disabled { opacity: .4; cursor: not-allowed; }
.rb-u { display: grid; grid-template-columns: 2.6rem 1fr auto 14.4rem; gap: .7rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
.rb-u:last-child { border-bottom: 0; }
.rb-u.neu { background: rgba(245,158,11,.1); }
.rb-av { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(37,99,235,.15); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rb-n b { display: block; } .rb-n span { color: var(--muted); font-size: .85rem; display: block; overflow-wrap: anywhere; }
.rb-n small { font-weight: 400; color: var(--muted); }
.rb-n .rb-lg { font-size: .78rem; } .rb-n .rb-wart { color: #b45309; font-weight: 600; font-size: .78rem; }
.rb-u select, .rb-rkopf input, .rb-dlg input, .rb-dlg select { width: 100%; height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .6rem; font: inherit; background: var(--card); color: var(--text); }
.rb-u select:disabled, .rb-rkopf input:disabled { background: var(--bg); color: var(--muted); }
.rb-rs { display: flex; gap: .4rem; } .rb-rs .rb-rolle { flex: 1; min-width: 0; margin: 0; }
.rb-ibtn { flex: none; width: 2.6rem; height: 2.6rem; border: 1px solid var(--border); background: var(--card); color: var(--primary); border-radius: 10px; font-size: 1.15rem; cursor: pointer; }
.rb-sw { justify-self: end; } .rb-sw form { margin: 0; }
.rb-schalter { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; padding: .3rem 0; cursor: pointer; }
.rb-schalter.aus { cursor: default; }
.rb-schalter i { width: 2.5rem; height: 1.45rem; border-radius: 99px; background: #cbd2e1; position: relative; display: inline-block; transition: .15s; }
.rb-schalter i::after { content: ""; position: absolute; top: .17rem; left: .17rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; transition: .15s; }
.rb-schalter.an i { background: #15803d; } .rb-schalter.an i::after { left: 1.22rem; }
.rb-fg { grid-column: 3 / 5; display: flex; gap: .4rem; justify-content: flex-end; }
.rb-fg form { margin: 0; display: flex; gap: .4rem; }
.rb-fg button { height: 2.4rem; padding: 0 .8rem; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid #15803d; background: #15803d; color: #fff; }
.rb-fg .rb-ab { background: var(--card); color: #b42318; border-color: #e5b4ae; }
.rb-frei select { width: auto; max-width: 9.5rem; height: 2.4rem; }
.rb-hint { font-size: .82rem; color: var(--muted); margin-top: .7rem; }
.rb-rollen { display: flex; gap: .4rem; overflow: auto; padding-bottom: .4rem; margin-bottom: .6rem; }
.rb-rollen a, .rb-rollen button { flex: none; display: inline-flex; align-items: center; height: 2.5rem; padding: 0 .9rem; border: 1px solid var(--border); background: var(--card); border-radius: 99px; font: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.rb-rollen a.on { border-color: var(--primary); color: var(--primary); font-weight: 700; background: rgba(37,99,235,.12); }
.rb-rollen .neu { border-style: dashed; color: var(--primary); }
.rb-rollen em { font-style: normal; color: var(--muted); font-size: .8rem; margin-left: .3rem; }
.rb-rkopf { padding: .8rem .9rem; margin-bottom: .7rem; display: grid; grid-template-columns: 1fr 1fr auto auto; gap: .6rem; align-items: end; }
.rb-rkopf label { font-size: .8rem; color: var(--muted); display: block; margin: 0 0 .2rem; }
.rb-info { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.rb-kopf, .rb-bz { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: .5rem; align-items: center; padding: .6rem .9rem; }
.rb-kopf { font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--border); background: rgba(127,127,127,.08); border-radius: 12px 12px 0 0; }
.rb-bz { border-bottom: 1px solid var(--border); }
.rb-rz .rb-l { display: none; color: var(--muted); font-size: .85rem; }
.rb-chip { display: flex; align-items: center; justify-content: center; width: 100%; height: 2.3rem; border-radius: 9px; border: 1px solid transparent; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
span.rb-chip { cursor: default; }
.rb-chip[data-v="0"] { background: rgba(148,163,184,.18); color: var(--muted); }
.rb-chip[data-v="1"] { background: rgba(245,158,11,.2); color: #b45309; }
.rb-chip[data-v="2"], .rb-chip.ja[data-v="1"] { background: var(--ok-bg); color: var(--ok-text); }
.rb-chip.na { background: none; opacity: .35; cursor: default; }
.rb-spez { padding: .7rem .9rem; border-top: 1px solid var(--border); background: rgba(127,127,127,.05); border-radius: 0 0 12px 12px; }
.rb-spez h3 { margin: .1rem 0 .5rem; font-size: .95rem; }
.rb-spez label { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; min-height: 2.2rem; }
.rb-spez input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.rb-std { border-top: 1px dashed var(--border); margin-top: .4rem; padding-top: .6rem !important; }
.rb-leg { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: .7rem 0; }
.rb-leg b { display: inline-block; padding: .05rem .5rem; border-radius: 6px; }
.rb-leg .n { background: rgba(148,163,184,.18); } .rb-leg .e { background: rgba(245,158,11,.2); color: #b45309; } .rb-leg .a { background: var(--ok-bg); color: var(--ok-text); }
.rb-akt { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; } .rb-akt .rb-b { flex: 1 1 8rem; }
.rb-fil { display: flex; gap: .4rem; margin-bottom: .8rem; overflow: auto; }
.rb-fil a { flex: none; display: inline-flex; align-items: center; height: 2.4rem; padding: 0 .9rem; border: 1px solid var(--border); background: var(--card); border-radius: 99px; color: var(--text); text-decoration: none; }
.rb-fil a.on { background: rgba(37,99,235,.12); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.rb-leer { padding: 1rem; text-align: center; color: var(--muted); }
.rb-tl { border-left: 2px solid var(--border); margin-left: .5rem; padding-left: 1rem; }
.rb-ev { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; margin-bottom: .7rem; }
.rb-ev::before { content: ""; position: absolute; left: -1.45rem; top: 1rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg); }
.rb-ev.benutzer::before { background: #f59e0b; }
.rb-ev .k { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.rb-ev .k span { color: var(--muted); font-size: .85rem; }
.rb-ev .k .t { font-size: .72rem; font-weight: 700; border-radius: 5px; padding: .05rem .4rem; background: rgba(37,99,235,.15); color: var(--primary); }
.rb-ev.benutzer .k .t { background: rgba(245,158,11,.2); color: #b45309; }
.rb-ev .z { display: flex; gap: .6rem; font-size: .92rem; padding: .12rem 0; }
.rb-ev .z .ft { color: var(--muted); min-width: 7.5rem; flex: none; } .rb-ev .z .wt { font-weight: 600; }
.rb-dlg { border: 0; border-radius: 14px; padding: 1.1rem 1.2rem; width: min(420px, calc(100% - 2rem)); background: var(--card); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.rb-dlg::backdrop { background: rgba(17,24,39,.5); }
.rb-dlg h3 { margin: 0 0 .7rem; }
.rb-dlg label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0 .2rem; }
.rb-dlg .bt { display: flex; gap: .5rem; margin-top: 1rem; } .rb-dlg .bt .rb-b { flex: 1; }
.rb-dlg .hn { font-size: .82rem; color: var(--muted); margin-top: .6rem; }
.rb-dlg .rb-kp { background: var(--bg); border-radius: 10px; padding: .5rem .7rem; font-size: .88rem; color: var(--muted); margin-bottom: .4rem; }
.rb-dlg .zl2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin: .4rem 0; }
.qr-box canvas { background: #fff; border-radius: 8px; max-width: 100%; height: auto; image-rendering: pixelated; }
.rb-dlg .pw { font-family: ui-monospace, Menlo, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .05em; background: var(--bg); border: 1px dashed var(--border); border-radius: 10px; padding: .7rem; text-align: center; margin: .6rem 0; user-select: all; }
@media (max-width: 699px) {
    .rb-u { grid-template-columns: 2.6rem 1fr auto; grid-template-areas: "a n s" "r r r"; }
    .rb-u .rb-av { grid-area: a; } .rb-u .rb-n { grid-area: n; } .rb-u .rb-sw { grid-area: s; } .rb-u .rb-rs { grid-area: r; }
    .rb-u .rb-fg { grid-area: r; grid-column: auto; justify-content: stretch; flex-wrap: wrap; }
    .rb-fg form, .rb-fg > form { flex: 1; } .rb-fg button { flex: 1; } .rb-frei select { flex: 1; max-width: none; }
    .rb-kopf { display: none; }
    .rb-bz { grid-template-columns: 1fr 1fr; gap: .45rem .6rem; padding: .8rem .9rem; }
    .rb-bz .rb-nm { grid-column: 1 / -1; }
    .rb-rz .rb-l { display: block; margin-bottom: .15rem; }
    .rb-rkopf { grid-template-columns: 1fr 1fr; }
    .rb-rkopf > div:first-child, .rb-rkopf > div:nth-child(2) { grid-column: 1 / -1; }
    .rb-ev .z .ft { min-width: 6rem; }
}

/* ===== Sprache und Formate (Profil) ===== */
.lang-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .4rem; }
.lang-opt { display: block; margin: 0 !important; cursor: pointer; }
.lang-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lang-opt span { display: block; border: 2px solid var(--border); border-radius: 10px; padding: .6rem .7rem; font-weight: 600; text-align: center; background: var(--card); color: var(--text); }
.lang-opt small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.lang-opt input:checked + span { border-color: var(--primary); background: rgba(37,99,235,.12); color: var(--primary); }
.lang-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.fmt-bsp { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.fmt-bsp div { background: var(--bg); border-radius: 10px; padding: .5rem .7rem; }
.fmt-bsp span { display: block; font-size: .75rem; color: var(--muted); }
.fmt-bsp b { font-size: 1.05rem; }

/* ===== Seite Übersetzungen ===== */
.ue-sp { flex-wrap: wrap; }
.ue-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.ue-filter select, .ue-filter input[type=search] { height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .6rem; font: inherit; background: var(--card); color: var(--text); }
.ue-filter input[type=search] { flex: 1; min-width: 8rem; }
.ue-liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.ue-chips { display: flex; flex-wrap: wrap; gap: .2rem; }
.ue-chips .ue-chip { margin-right: 0; }
.ue-zeile { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; }
.ue-zeile.geaendert { border-color: #f59e0b; }
.ue-key { font-size: .75rem; color: var(--muted); } .ue-key em { color: #b45309; font-style: normal; }
.ue-de, .ue-key { overflow-wrap: anywhere; white-space: pre-wrap; }
.ue-de { font-size: .85rem; color: var(--muted); margin: .2rem 0 .3rem; padding-left: .5rem; border-left: 3px solid var(--border); }
.ue-zeile textarea { width: 100%; font: inherit; border: 1px solid var(--border); border-radius: 10px; padding: .5rem .6rem; background: var(--bg); color: var(--text); resize: vertical; }
.ue-reset { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.ue-leiste { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%); padding: .8rem 0 .4rem; }

/* ===== Übersetzungen bei Stammdaten ===== */
.ue-block { border-top: 1px dashed var(--border); margin-top: 1rem; padding-top: .3rem; }
.ue-titel { font-weight: 600; margin: .4rem 0 .2rem; }
.ue-z { display: grid; grid-template-columns: 2.6rem 1fr; gap: .6rem; align-items: center; margin-top: .4rem; }
.ue-z b { background: rgba(37,99,235,.12); color: var(--primary); border-radius: 8px; text-align: center; padding: .6rem 0; font-size: .82rem; }
.ue-chip { display: inline-block; background: rgba(37,99,235,.12); color: var(--primary); border-radius: 99px; padding: .05rem .45rem; font-size: .72rem; margin-right: .2rem; font-weight: 600; }
.ue-chip.fehlt { background: rgba(245,158,11,.2); color: #b45309; }

/* Administration: Technische Daten, Einstellungen */
.td-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: .8rem; margin-bottom: .8rem; }
.td-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .8rem; min-width: 0; }
.td-raster .td-card { margin-bottom: 0; }
.td-card h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.td-liste { margin: 0; }
.td-liste > div { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; border-top: 1px solid var(--border); }
.td-liste > div:first-child { border-top: 0; }
.td-liste dt { color: var(--muted); flex: 0 0 auto; max-width: 45%; }
.td-liste dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.td-ok { color: #15803d; font-weight: 600; } .td-nok { color: #b91c1c; font-weight: 600; }
.td-chip { display: inline-block; border-radius: 99px; padding: .05rem .5rem; font-size: .75rem; margin: .1rem; font-weight: 600; }
.td-chip.ok { background: rgba(21,128,61,.14); color: #15803d; } .td-chip.nok { background: rgba(185,28,28,.14); color: #b91c1c; }
.es-tools { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.es-tools input[type=search] { flex: 1; min-width: 0; height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .7rem; font: inherit; background: var(--card); color: var(--text); }
.es-zahl { width: 5.5rem; height: 2.4rem; border: 1px solid var(--border); border-radius: 8px; padding: 0 .5rem; font: inherit; text-align: right; background: var(--card); color: var(--text); }
.es-std { display: block; }
table.es-tabelle tr[hidden] { display: none; }
.ue-logsuche { width: 100%; height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .7rem; font: inherit; background: var(--card); color: var(--text); margin-bottom: .6rem; }
.ue-lz .ft { overflow-wrap: anywhere; } .ue-lz .wt { overflow-wrap: anywhere; text-align: right; }
.rb-ev[hidden] { display: none; }

/* Verlauf je Eintrag */
.ev-zeile { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.ev-verlauf { font-size: .8rem; margin-top: .2rem; }
.ev-verlauf summary { cursor: pointer; color: var(--primary); }
.ev-verlauf ul { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .3rem; }
.ev-verlauf li { border-left: 3px solid var(--border); padding-left: .5rem; overflow-wrap: anywhere; }
.ev-wann { color: var(--muted); display: block; }
.ev-zurueck { font: inherit; font-size: .75rem; border: 1px solid var(--border); background: var(--card); color: var(--primary); border-radius: 8px; padding: .1rem .5rem; margin-top: .15rem; cursor: pointer; }
.ev-teil { margin-top: .35rem; }
.ev-geaendert { border-color: #f59e0b !important; }

/* Spezifische Gewichte */
.gw-tabelle tr[hidden] { display: none; }
.rb-tools select { height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .6rem; font: inherit; background: var(--card); color: var(--text); max-width: 11rem; }
.rb-tools { flex-wrap: wrap; }
@media (max-width: 699px) { .k-z2 .k-kg { white-space: nowrap; } }
@media (max-width: 699px) { .k-z2 { flex-wrap: wrap; } .k-z2 .k-kg { flex-basis: 100%; text-align: right; font-size: .85rem; } }
.rb-dlg label.check { display: flex; align-items: center; gap: .6rem; color: var(--text); font-size: .95rem; margin: .7rem 0 0; }
.rb-dlg label.check input { width: 1.2rem; height: 1.2rem; flex: none; margin: 0; padding: 0; }
.rb-dlg .bt { flex-wrap: wrap; } .rb-dlg .bt .rb-b { flex: 1 1 auto; min-width: 0; padding-left: .6rem; padding-right: .6rem; }

/* ---- Adressen ---- */
.ad-tabs a { font-size: .95rem; padding: 0 .3rem; }
@media (max-width: 480px) { .ad-tabs { gap: .25rem; } .ad-tabs a { font-size: .8rem; line-height: 1.15; min-height: 3rem; } }
.ad-tabelle .sub { display: block; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.ad-tabelle a { overflow-wrap: anywhere; }
.ad-tabelle .ad-tel { white-space: nowrap; display: block; }
.ad-chip { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: .08rem .45rem; margin: .1rem .25rem .1rem 0; background: #eef2ff; color: #1d4ed8; }
.ad-badge { display: inline-block; font-size: .7rem; font-weight: 700; border-radius: 6px; padding: .05rem .4rem; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.ad-inaktiv td { opacity: .65; }
.ad-dlg { width: min(760px, calc(100% - 1rem)); max-height: calc(100vh - 1.5rem); overflow-y: auto; }
.ad-dlg-s { width: min(480px, calc(100% - 1rem)); }
.ad-dlg-m { width: min(580px, calc(100% - 1rem)); }
.ad-dlg h4 { margin: 1.1rem 0 .1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: .2rem; }
.ad-dlg textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: .5rem .6rem; font: inherit; background: var(--card); color: var(--text); box-sizing: border-box; }
.ad-g2, .ad-g3, .ad-g21 { display: grid; gap: 0 .6rem; }
.ad-g2 { grid-template-columns: 1fr 1fr; } .ad-g3 { grid-template-columns: repeat(3, 1fr); } .ad-g21 { grid-template-columns: 2fr 1fr; }
.ad-g2 > *, .ad-g3 > *, .ad-g21 > * { min-width: 0; }
@media (max-width: 599px) { .ad-g2, .ad-g3 { grid-template-columns: 1fr; } .ad-g21 { grid-template-columns: 2fr 1fr; } }
.ad-chips { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .4rem; }
.rb-dlg .ad-chips label.check, .rb-dlg label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .95rem; margin: .4rem 0 0; }
.ad-zu { display: grid; gap: .4rem; margin-top: .4rem; }
.ad-zu-leer { color: var(--muted); font-size: .9rem; padding: .3rem 0; }
.ad-zu-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; background: var(--bg); border-radius: 10px; padding: .45rem .6rem; }
.ad-zu-t { min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.ad-zu-t small { display: block; color: var(--muted); font-size: .78rem; }
.ad-zu-row label.check { margin: 0; white-space: nowrap; font-size: .85rem; flex: none; }
.ad-zu-x { flex: none; min-width: 32px; min-height: 32px; font-size: 1rem; }
.ad-linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; width: 100%; box-sizing: border-box; }
.ad-linkbtn[hidden] { display: none; }
.ad-warn { color: var(--danger); }
.rb-dlg .del2:disabled { opacity: .4; cursor: not-allowed; }
.rb-dlg .bt { flex-wrap: wrap; }
.ad-dlg .rb-kp { line-height: 1.5; }
/* Kundenauswahl im Projekt */
.kunde-wahl { position: relative; }
.kw-zeile { display: flex; gap: .4rem; align-items: center; }
.kw-zeile input { flex: 1; min-width: 0; }
.kw-liste { position: absolute; left: 0; right: 0; top: 3.2rem; z-index: 20; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: 18rem; overflow-y: auto; }
.kw-it { padding: .55rem .75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.kw-it small { display: block; color: var(--muted); font-size: .8rem; }
.kw-it.on, .kw-it:hover { background: #eef2ff; }
.kw-it mark { background: #fde68a; color: inherit; }
.kw-leer, .kw-fuss { padding: .55rem .75rem; color: var(--muted); font-size: .85rem; }
.kw-info { margin-top: .6rem; line-height: 1.5; overflow-wrap: anywhere; }
.kw-info[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .ad-chip { background: #1e2a4a; color: #9db8ff; } .kw-it.on, .kw-it:hover { background: #1e2a4a; } .kw-it mark { background: #6b5a14; } }
/* Adressen: Kartenansicht am Handy */
@media (max-width: 699px) {
    .ad-tabelle td:first-child, .ad-tabelle td:nth-child(2) { display: block; text-align: left; }
    .ad-tabelle td:first-child::before, .ad-tabelle td:nth-child(2)::before { content: none; }
    .ad-tabelle td:first-child strong { font-size: 1.05rem; }
    .ad-tabelle td:first-child .sub { display: inline; margin-left: .5rem; }
    .ad-tabelle td:nth-child(2) { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
    .ad-tabelle td:empty { display: none; }
    .ad-tabelle td { min-width: 0; }
}
@media (max-width: 400px) { .ad-tabs a { min-width: 0; flex: 1 1 0; overflow-wrap: anywhere; hyphens: auto; font-size: .75rem; padding: 0 .2rem; } }
.rb-ev .z { flex-wrap: wrap; }
.rb-ev .z .wt { min-width: 0; overflow-wrap: anywhere; flex: 1 1 8rem; }
.tl .z { flex-wrap: wrap; } .tl .z .wt { min-width: 0; overflow-wrap: anywhere; flex: 1 1 8rem; }
@media (min-width: 700px) { .ad-tabelle td:nth-child(3) { min-width: 8rem; } .ad-tabelle td:nth-child(3) a { overflow-wrap: normal; } }
.ad-tabelle tr[hidden] { display: none; }
/* Änderungsprotokoll einklappbar (Standard: eingeklappt) */
.rb-fold { margin-top: 1.4rem; }
.rb-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.rb-fold > summary::-webkit-details-marker { display: none; }
.rb-fold > summary::before { content: "▸"; color: var(--muted); font-size: 1.1rem; transition: transform .15s; }
.rb-fold[open] > summary::before { transform: rotate(90deg); }
.rb-fold > summary h2 { margin: 0; }
.rb-fold > :not(summary) { margin-top: .6rem; }
.ad-zerts { display: grid; gap: .5rem; margin-bottom: .4rem; }
.ad-zert { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr; gap: .6rem; align-items: center; }
.ad-zert .check { margin: 0; }
.ad-zert[hidden] { display: none; }
.ad-kopie { margin-left: .2rem; }
@media (max-width: 699px) {
    .ad-tabelle td { flex-wrap: wrap; justify-content: flex-end; }
    .ad-tabelle td::before { margin-right: auto; }
    .ad-tabelle td .ad-chip { max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
}
@media (max-width: 480px) { .rb-tools input[type="search"] { flex: 1 1 100%; } }
a.rb-ibtn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.fremd-banner { margin-bottom: 1rem; }
/* Adressen (PC): Kopfzeile Name/Nr. … bleibt beim Scrollen unter der Menüleiste stehen */
@media (min-width: 700px) {
    .table-wrap:has(.ad-tabelle) { overflow: visible; background: none; border: 0; }
    .ad-tabelle { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; }
    .ad-tabelle thead th { position: sticky; top: var(--kopf-h, 88px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border); }
    .ad-tabelle thead th:first-child { border-top-left-radius: var(--radius); }
    .ad-tabelle thead th:last-child { border-top-right-radius: var(--radius); }
    .ad-tabelle tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
    .ad-tabelle tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
    .ad-tabelle tbody td { border-bottom: 1px solid var(--border); }
    .ad-tabelle tbody tr:last-child td { border-bottom: 0; }
}

/* Artikel */
.art-th { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, #d8e4c9, #a9c08a); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: none; object-fit: cover; overflow: hidden; }
.art-th.art-maschinenstunde { background: linear-gradient(135deg, #f3dcc0, #e0a96b); }
.art-th.art-dienstleistung { background: linear-gradient(135deg, #cfe3f4, #8fb7da); }
.art-th.gross { width: 84px; height: 84px; font-size: 2.2rem; }
.art-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-nm { display: flex; gap: .7rem; align-items: center; }
.art-nm > span { min-width: 0; }
.art-chip { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 6px; padding: .08rem .45rem; margin: .1rem .25rem .1rem 0; background: #eef2ff; color: #1d4ed8; }
.art-chip.art-dienstleistung { background: #ecfdf3; color: #067647; }
.art-chip.art-maschinenstunde { background: #fff4e5; color: #b54708; }
.art-bildzeile { display: flex; gap: .8rem; align-items: center; }
.art-bildzeile > div { min-width: 0; flex: 1; }
.art-info { display: flex; gap: .7rem; align-items: flex-start; }
.art-info-t { min-width: 0; line-height: 1.5; }
.art-info .art-th.gross { width: 56px; height: 56px; font-size: 1.6rem; }
.kw-it .art-chip { margin-left: .25rem; }
@media (max-width: 699px) { .ad-tabelle .art-nm { align-items: flex-start; } }

/* Personal / Kostenstellen */
.st{display:inline-block;font-size:.72rem;font-weight:700;border-radius:6px;padding:.08rem .45rem;margin:.1rem .25rem .1rem 0;background:#ecfdf3;color:#067647}
.st.ok{background:#ecfdf3;color:#067647}.st.bald{background:#fff4e5;color:#b54708}.st.ab{background:#fee4e2;color:#b42318}
.pers-h{margin:1rem 0 .3rem;font-size:1rem}
table.resp{width:100%;border-collapse:collapse;font-size:.85rem}
table.resp th{text-align:left;font-size:.72rem;color:#6b7280;padding:.25rem .3rem;border-bottom:1px solid #e1e5ee}
table.resp td{padding:.3rem;border-bottom:1px solid #eef0f5;vertical-align:middle}
table.resp td input,table.resp td select{height:2.1rem;padding:0 .4rem;font-size:.85rem;width:100%}
table.resp td:first-child{min-width:10rem}
tr.dok-weg td{opacity:.45;text-decoration:line-through}
.pz{display:grid;grid-template-columns:2fr 1fr auto;gap:.5rem;align-items:center;margin:.3rem 0}
.pz.pz-b{grid-template-columns:2fr 1fr 1.4fr auto}
.pz input,.pz select{width:100%;height:2.1rem}
.pz-s{min-width:0}
.satz{border:1px solid #e1e5ee;border-radius:10px;padding:.6rem;margin:.4rem 0;background:#fafbfe}
.satz .kopf{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.4rem}
.satz .raster{display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem}
.satz .raster div{font-size:.78rem;color:#6b7280}
.satz .raster input{width:100%;text-align:right;margin-top:.15rem}
.satz .grp{grid-column:1/-1;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#2563eb}
.aktuell,.aktuell-m{background:#dbe7ff;color:#1d4ed8;font-size:.7rem;font-weight:700;border-radius:999px;padding:.05rem .5rem}
.rad{display:flex;gap:.6rem;align-items:flex-start;border:1px solid #e1e5ee;border-radius:10px;padding:.55rem .7rem;margin:.35rem 0;cursor:pointer}
.rad.on{border-color:#2563eb;background:#eef4ff}
.rad input{margin-top:.25rem;width:auto;height:auto}
.rad .eff,.eff{display:block;font-size:.8rem;color:#475467;margin-top:.15rem}
details.fk{margin:.8rem 0}details.fk summary{cursor:pointer;font-weight:600}
.dz-box{border:2px dashed #cbd5e1;border-radius:10px;padding:.7rem;margin:.4rem 0;background:#fafbfe}
.dz-box label{display:block;font-size:.8rem;color:#6b7280;margin-top:.3rem}
@media(max-width:699px){
 table.resp thead{display:none}
 table.resp tr{display:block;border:1px solid #e1e5ee;border-radius:10px;padding:.4rem;margin:.4rem 0}
 table.resp td{display:flex;justify-content:space-between;align-items:center;gap:.5rem;border:0;padding:.15rem;min-width:0!important}
 table.resp td:before{content:attr(data-l);color:#6b7280;font-size:.78rem;flex:none}
 table.resp td input,table.resp td select{width:60%}
 .pz,.pz.pz-b{grid-template-columns:1fr auto}
 .pz>*:first-child{grid-column:1/-1}
}
.rad>span{display:block;min-width:0}.rad b{display:block}.rad .muted{display:block}
.rb-suche{margin:.6rem 0}.rb-suche input{width:100%;max-width:26rem}
.rb-no{display:inline-block;min-width:1.5rem;margin-right:.45rem;text-align:right;color:#6b7280;font-size:.78rem;font-variant-numeric:tabular-nums}
.rb-bz[hidden],.rb-sz[hidden]{display:none!important}

/* Laufende Zeit: Balken auf jeder Seite */
.lz-balken{background:#ecfdf3;border-bottom:2px solid #16a34a;color:#065f46;font-size:.9rem}
.lz-balken .container{display:flex;gap:.7rem;align-items:center;flex-wrap:wrap;padding-top:.5rem;padding-bottom:.5rem}
.lz-punkt{width:.7rem;height:.7rem;border-radius:50%;background:#16a34a;animation:lzp 1.2s infinite;flex:none}
@keyframes lzp{50%{opacity:.3}}
.lz-text{flex:1;min-width:10rem}
.lz-uhr{font-variant-numeric:tabular-nums;font-size:1.1rem}
.lz-form{margin:0}
.lz-stopp{border:0;cursor:pointer;font:inherit;background:#b42318;color:#fff;border-radius:8px;padding:.35rem .9rem;font-weight:700;text-decoration:none}
.lz-balken.lang{background:#fff4e5;border-color:#d97706;color:#92400e}
.lz-balken.lang .lz-punkt{background:#d97706}
.btn-einstieg{display:block;text-align:center;font-size:1.15rem;padding:.9rem 1rem;margin:0 0 1rem;background:#16a34a}
.btn-einstieg:hover{background:#15803d}
.btn-start{background:#16a34a;color:#fff}
.btn-stopp{color:#b42318}
.btn-start[disabled]{opacity:.45;cursor:not-allowed}
.form-card.konflikt{border-left:4px solid #d97706}
@media (prefers-reduced-motion:reduce){.lz-punkt{animation:none}}

.alert a.flash-link{color:inherit;font-weight:700;text-decoration:underline;display:block}

.lz-link{color:inherit;text-decoration:underline}
.lz-link:hover{text-decoration:none}

/* ---------- Stamm erfassen: kompakteres Layout, feste Polter-Zeile ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.polter-zeile { position: sticky; top: var(--hh, 62px); z-index: 9; }
.s-kopf h2.s-nr { font-size: 2.4rem; line-height: 1; font-weight: 800; }
#stamm.form-card { padding: .7rem .8rem; }
#stamm .s-kopf { margin-bottom: .25rem; }
#stamm .stamm-grid { gap: .4rem; }
#stamm .stamm-grid.mit-plus { grid-template-columns: 2.8rem .75fr 1fr 1fr; }
#stamm .stamm-grid.mit-plus.ohne-gute { grid-template-columns: 2.8rem 1fr 1fr; }
#stamm .stamm-grid .plus-z label { display: block; margin-bottom: .25rem; }
#stamm .stamm-grid .plus-z .plus { width: 100%; height: 3.2rem; min-height: 3.2rem; padding: 0; font-size: 1.8rem; line-height: 1; }
#stamm .stamm-grid .g-z select, #stamm .stamm-grid .z input { height: 3.2rem; min-height: 3.2rem; font-size: 1.35rem; }
#stamm .stamm-grid .art-z select { height: 2.7rem; min-height: 2.7rem; font-size: 1rem; }
#stamm .stamm-grid .g-z label, #stamm .stamm-grid .z label { margin-bottom: .15rem; }
#stamm .stamm-grid .zwei-chk { margin-top: .1rem; }
@media (min-width: 700px) {
    #stamm .stamm-grid.mit-plus { grid-template-columns: 3.2rem 1fr 1fr 1fr 2fr 1fr; gap: .6rem; }
    #stamm .stamm-grid.mit-plus.ohne-gute { grid-template-columns: 3.2rem 1fr 1fr 3fr 1fr; }
    #stamm .stamm-grid .plus-z .plus { height: 3.6rem; min-height: 3.6rem; }
    #stamm .stamm-grid .g-z select, #stamm .stamm-grid .z input { height: 3.6rem; min-height: 3.6rem; }
}
.klickbar tbody tr, ul.klickbar > li { cursor: pointer; }
.klickbar tbody tr:hover { background: var(--bg); }
.polter-link { color: inherit; text-decoration: none; }
.polter-link:hover { text-decoration: underline; }

/* ---------- Menü: kompaktere Abstände, Untermenü scrollbar ---------- */
@media (min-width: 700px) {
    .submenu { max-height: calc(100vh - 6.5rem); overflow-y: auto; overscroll-behavior: contain; }
    .nav .submenu a, .nav .submenu .disabled { padding: .38rem .85rem; }
}
@media (max-width: 699px) {
    .nav { max-height: calc(100vh - 4.5rem); overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .nav .submenu a, .nav .submenu .disabled { padding-top: .42rem; padding-bottom: .42rem; }
}

/* ---------- Dokumente: eine Zeile je Dokumentart ---------- */
.dok-block { margin: .25rem 0 .75rem; }
.dok-block.dok-busy { opacity: .6; pointer-events: none; }
.dok-z { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; align-items: start; padding: .4rem 0; border-bottom: 1px solid var(--border, #d9d9d9); }
.dok-n { font-weight: 600; padding-top: .3rem; overflow-wrap: anywhere; }
.dok-f { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; padding: .15rem 0; }
.dok-f .sub { color: var(--muted, #666); font-size: .8rem; }
.dok-x { border: 0; background: none; color: var(--danger, #b00020); font-size: 1rem; cursor: pointer; padding: .2rem .45rem; }
.dok-up { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .15rem; }
.dok-bez { flex: 1 1 10rem; min-width: 0; }
@media (max-width: 520px) { .dok-z { grid-template-columns: 1fr; gap: .1rem; } .dok-n { padding-top: 0; } }

/* ---------- Stamm erfassen: Layout 2 (Entwurf „schmale Felder, Schalter in einer Zeile“) ---------- */
#stamm .stamm-grid { gap: .3rem; align-items: end; grid-template-columns: 3.4rem 3.9rem 3.4rem minmax(0, 1fr); }
#stamm .stamm-grid.mit-plus { grid-template-columns: 2.7rem 3.4rem 3.9rem 3.4rem minmax(0, 1fr); }
#stamm .stamm-grid.ohne-gute { grid-template-columns: 3.9rem 3.4rem minmax(0, 1fr); }
#stamm .stamm-grid.mit-plus.ohne-gute { grid-template-columns: 2.7rem 3.9rem 3.4rem minmax(0, 1fr); }
#stamm .stamm-grid .art-z, #stamm .stamm-grid.ohne-gute > .art-z { grid-column: auto; }
#stamm .stamm-grid .fm-pc { display: none; }
#stamm .stamm-grid label { font-size: .65rem; margin: 0 0 .1rem .1rem; white-space: nowrap; }
#stamm .stamm-grid .g-z label, #stamm .stamm-grid .z label { text-align: right; margin-bottom: .1rem; }
#stamm .stamm-grid .g-z select, #stamm .stamm-grid .z input, #stamm .stamm-grid .art-z select {
    height: 2.9rem; min-height: 2.9rem; font-size: 1.1rem; font-weight: 600; padding: 0 .35rem; }
#stamm .stamm-grid .art-z select { font-size: .95rem; font-weight: 500; text-align-last: left; text-align: left; }
#stamm .stamm-grid .plus-z .plus { width: 100%; height: 2.9rem; min-height: 2.9rem; font-size: 1.6rem; }
#stamm .stamm-grid .zeile, #stamm .stamm-grid .zwei-chk { grid-column: 1 / -1; }
/* Schalter als Pillen in einer Zeile */
#stamm .stamm-grid .zwei-chk { display: flex !important; flex-wrap: nowrap; justify-content: flex-start; gap: .3rem !important; margin-top: .3rem; }
#stamm .stamm-grid .zwei-chk .check-zeile { min-height: 0; padding: .3rem .5rem; border: 1.5px solid var(--border); border-radius: 999px; font-size: .85rem; gap: .25rem; background: var(--card); }
#stamm .stamm-grid .zwei-chk input[type=checkbox] { width: .95rem; height: .95rem; }
#stamm .stamm-grid .zwei-chk .check-zeile:has(input:checked) { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
#stamm .stamm-grid .zwei-chk .check-zeile.gps-chk:has(input:checked) { background: #dcfce7; border-color: #22c55e; color: #166534; }
#stamm .stamm-grid .zwei-chk .check-zeile:has(#rinde:checked) { background: #e0e7ff; border-color: #6366f1; color: #3730a3; }
/* Aktionszeile: Text-Links statt Büttons */
#stamm .aktionen { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: .1rem; }
#stamm .zus-link { background: none; border: 0; padding: .4rem 0; color: var(--primary); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; position: relative; }
#stamm .zus-link .punkt { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #f59e0b; vertical-align: middle; }
#stamm .reset-link { color: var(--primary); font-weight: 600; font-size: .95rem; text-decoration: none; margin-left: auto; }
#stamm .aktionen .btn { flex: 0 0 auto; min-width: 8rem; }
#stamm #zus[hidden] { display: none; }
@media (min-width: 700px) {
    #stamm .stamm-grid, #stamm .stamm-grid.mit-plus { grid-template-columns: 3.2rem 4.5rem 5rem 4.5rem minmax(0, 1fr) 6.5rem; gap: .5rem; }
    #stamm .stamm-grid.ohne-gute { grid-template-columns: 5rem 4.5rem minmax(0, 1fr) 6.5rem; }
    #stamm .stamm-grid:not(.mit-plus) { grid-template-columns: 4.5rem 5rem 4.5rem minmax(0, 1fr) 6.5rem; }
    #stamm .stamm-grid:not(.mit-plus).ohne-gute { grid-template-columns: 5rem 4.5rem minmax(0, 1fr) 6.5rem; }
    #stamm .stamm-grid.mit-plus.ohne-gute { grid-template-columns: 3.2rem 5rem 4.5rem minmax(0, 1fr) 6.5rem; }
    #stamm .stamm-grid .fm-pc { display: block; }
    #stamm .stamm-grid .g-z select, #stamm .stamm-grid .z input, #stamm .stamm-grid .art-z select, #stamm .stamm-grid .plus-z .plus { height: 3.1rem; min-height: 3.1rem; font-size: 1.2rem; }
    #stamm .stamm-grid .art-z select { font-size: 1.05rem; }
    #stamm .stamm-grid label { font-size: .75rem; }
    #stamm .stamm-grid .fm-box { min-height: 3.1rem; justify-content: center; }
    #stamm .stamm-grid .zwei-chk .check-zeile { font-size: .95rem; }
}
#stamm .stamm-grid .zwei-chk input[type=checkbox] { min-height: 0 !important; min-width: 0; }
#stamm .stamm-grid .zwei-chk .check-zeile { min-height: 0 !important; line-height: 1.2; align-self: flex-start; }
#stamm .stamm-grid .g-z select, #stamm .stamm-grid .z input, #stamm .stamm-grid .art-z select { background: var(--card); }
#stamm .zus-link { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; width: auto; min-height: 0; flex: 0 0 auto; text-align: left; }
#stamm .reset-link { display: inline-flex; align-items: center; min-height: 0; }
#stamm .aktionen { min-height: 0; }

/* ---------- Stämme: Mehrfachauswahl ---------- */
.staemme-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mc { display: none; }
body.mehr-an td.mc, body.mehr-an th.mc { display: table-cell; width: 2.2rem; text-align: center; }
body.mehr-an label.mc-li { display: flex; position: absolute; left: .5rem; top: .6rem; margin: 0; z-index: 2; }
body.mehr-an .stamm-karten li { position: relative; padding-left: 2.4rem; }
.mc-cb { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); margin: 0; }
tr.mc-sel td, li.mc-sel { background: var(--info-bg); }
body.mehr-an #stamm-tab.klickbar tbody tr, body.mehr-an #stamm-karten.klickbar li { cursor: pointer; }
.mehr-bar { position: sticky; bottom: .5rem; z-index: 8; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; background: var(--info-bg); border: 1px solid var(--primary); border-radius: 12px; padding: .5rem .7rem; margin: .6rem 0; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.mehr-bar[hidden] { display: none; }
.mehr-bar .n { font-weight: 800; } .mehr-bar .nrn { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; } .mehr-bar .sp { flex: 1; }
.mehr-bar .btn { min-height: 2.4rem; padding: .35rem .8rem; font-size: .95rem; }
dialog.mehr-dlg { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; width: min(560px, calc(100% - 1.5rem)); background: var(--card); color: var(--text); }
dialog.mehr-dlg::backdrop { background: rgba(0,0,0,.45); }
.mehr-dlg .md-titel { margin: .1rem 0 .3rem; }
.mfz { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem .7rem; align-items: center; margin: .6rem 0; }
.mfz label.k { display: flex; gap: .4rem; align-items: center; font-weight: 700; margin: 0; }
.mfz input[type=checkbox] { width: 1.15rem; height: 1.15rem; }
.mfz select, .mfz input[type=text] { width: 100%; box-sizing: border-box; min-height: 2.6rem; }
.md-knoepfe { display: flex; gap: .6rem; margin-top: .8rem; } .md-knoepfe .btn { flex: 1; margin: 0; } .md-knoepfe .btn:last-child { flex: 2; }
.mv-tab { margin: .6rem 0; width: 100%; }
@media (max-width: 480px) { .mfz { grid-template-columns: 1fr; gap: .15rem; } .mfz label.k { margin-top: .4rem; } }
body.mehr-an .stamm-hand.kompakt .stamm-karten li > label.mc-li { display: flex !important; }
body.mehr-an .stamm-hand.kompakt .stamm-karten li { padding-left: 2.4rem; }
.stamm-karten li.mc-sel, .stamm-hand.kompakt .stamm-karten li.mc-sel { background: var(--info-bg) !important; }
body.mehr-an #stamm-tab, body.mehr-an #stamm-karten { -webkit-user-select: none; user-select: none; }
.mehr-dlg select { width: 100%; box-sizing: border-box; min-height: 2.6rem; }

/* ---------- Stammliste: Kürzel, GPS-Spalte, Aktionszeilen beim Ändern ---------- */
.von, .kp .u { display: inline-block; background: var(--bg); color: var(--muted); font-weight: 700; font-size: .72rem; border-radius: 5px; padding: 0 .3rem; letter-spacing: .03em; border: 1px solid var(--border); }
.kp .u { justify-self: end; }
.k-z1 .von { margin-left: auto; }
.bde-tab .gps-sp { text-align: center; width: 2.4rem; }
.bde-tab .gps-sp a { text-decoration: none; }
.bde-tab th.num { text-align: right; }
#stamm .aktionen-reset { justify-content: flex-start; margin-top: .3rem; }
#stamm .aktionen-reset .reset-link { margin-left: 0; }
#stamm .aktionen-save { justify-content: flex-start; gap: 1rem; margin-top: .6rem; }
#stamm .aktionen-save .btn { flex: 0 0 auto; min-width: 9rem; margin: 0; }
#stamm .aktionen-save .zus-link { margin-left: auto; }
@media (max-width: 699px) {
    #stamm .reset-link { border: 1.5px solid var(--primary); border-radius: 10px; padding: .45rem 1.1rem; background: var(--card); }
}
#stamm .aktionen-save { gap: .6rem; }
#stamm .aktionen-save .btn { min-width: 7.5rem; padding-left: 1.2rem; padding-right: 1.2rem; }
#stamm .aktionen-save .zus-link { font-size: .9rem; }
@media (max-width: 699px) { #stamm .gps-hinweis:empty { display: none; } }
#stamm .stamm-grid .zwei-chk { flex-wrap: wrap !important; row-gap: .3rem; }

/* Fehler im Stamm-Formular: Feld rot markieren */
input.fehler-feld { border: 2px solid var(--danger) !important; box-shadow: 0 0 0 3px rgba(180,35,24,.2); }

/* Handy: Überschrift "Stämme – Polter Nr." entfällt, Sortierleiste kleiner, Mehrfachauswahl als Symbol */
.mehr-ic { display: none; }
@media (max-width: 699px) {
    .staemme-kopf { display: none; }
    .sort-leiste { gap: .35rem; margin: .2rem 0 .5rem; }
    .sort-leiste label { font-size: .85rem; }
    .sort-leiste select { flex: 0 0 5.4rem; width: 5.4rem; height: 2.3rem; min-height: 2.3rem; font-size: .9rem; }
    .sort-leiste button, .ansicht button { width: 2.3rem; height: 2.3rem; font-size: 1rem; }
    .sort-leiste .sp { flex: 1; }
    .sort-leiste .mehr-ic { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--primary); }
    .sort-leiste .mehr-ic[aria-pressed="true"] { background: var(--primary); color: #fff; }
}

/* Hinweis: Backspace im leeren Feld Ø */
.bs-hinweis { background: #fff7e0; border: 1px solid #f0c75e; color: #7a5200; border-radius: 10px; padding: .5rem .7rem; margin: .5rem 0; font-size: .9rem; }

/* Stamm erfassen: letzter Stamm oben, Polterzeile flach (Farbe als Rahmen, "Polter" in Polterfarbe) */
.letzter-stamm { display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .35rem .6rem; margin: .4rem auto .3rem; max-width: 1100px; font-size: .9rem; }
.letzter-stamm .l { color: var(--muted); font-size: .75rem; }
.letzter-stamm .n { font-weight: 800; color: var(--primary); }
.letzter-stamm .sp { flex: 1; }
.letzter-stamm .g { background: var(--info-bg); color: var(--primary); font-weight: 700; font-size: .7rem; border-radius: 5px; padding: 0 .3rem; }
.letzter-stamm .f { font-weight: 800; }
form.polter-zeile { padding: 0 !important; gap: 0 !important; align-items: stretch !important; height: 2.6rem; overflow: hidden; border: 3px solid var(--border) !important; border-radius: 10px !important; background: var(--card) !important; box-shadow: none; margin-top: .3rem !important; }
form.polter-zeile label { padding: 0 .8rem; display: flex; align-items: center; font-weight: 800; background: var(--bg); color: var(--text); }
form.polter-zeile select { border: 0 !important; border-radius: 0 !important; min-height: 0 !important; height: auto; background: transparent !important; }
form.polter-zeile.farbig.f-gelb { border-color: #fbbf24 !important; background: var(--card) !important; } form.polter-zeile.farbig.f-gelb label { background: #fbbf24; color: #422006; }
form.polter-zeile.farbig.f-blau { border-color: #60a5fa !important; background: var(--card) !important; } form.polter-zeile.farbig.f-blau label { background: #60a5fa; color: #172554; }
form.polter-zeile.farbig.f-rot  { border-color: #f87171 !important; background: var(--card) !important; } form.polter-zeile.farbig.f-rot label { background: #f87171; color: #450a0a; }

/* Meldungen schließbar (Wisch nach links am Handy, ✕ am PC) */
.alert { position: relative; touch-action: pan-y; }
.alert .alert-x { display: none; position: absolute; top: .3rem; right: .4rem; border: 0; background: transparent; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; opacity: .6; padding: .2rem .35rem; }
.alert .alert-x:hover { opacity: 1; }
@media (min-width: 700px) { .alert .alert-x { display: block; } .alert { padding-right: 2rem; } }

/* ===== Aushaltung / Preislisten ===== */
.au-form .form-card { margin-bottom: .9rem; }
.au-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 .9rem; }
.au-filter select, .au-filter input[type=date] { height: 2.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0 .6rem; font: inherit; background: var(--card); color: var(--text); max-width: 100%; }
.au-filter .au-am { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 400; }
.au-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.au-chip { display: inline-flex; margin: 0; cursor: pointer; }
.au-chip input { position: absolute; opacity: 0; pointer-events: none; }
.au-chip span { display: inline-block; padding: .35rem .8rem; border: 1px solid var(--border); border-radius: 99px; background: var(--card); font-weight: 600; font-size: .9rem; }
.au-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.au-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.au-re .au-r, .au-r.au-re2 { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(8rem, 12rem); gap: .6rem; align-items: center; margin-bottom: .5rem; }
.au-re .au-r label, .au-r.au-re2 label { margin: 0; text-align: right; }
.au-re .au-r input, .au-re .au-r select, .au-r.au-re2 input { text-align: right; margin: 0; width: 100%; box-sizing: border-box; }
.au-re .au-r select { text-align-last: right; }
.au-re .au-chk { text-align: right; }
.au-re .au-chk input { width: auto; }
.au-gueten { display: flex; flex-direction: column; gap: .5rem; }
.au-g { display: grid; grid-template-columns: 1.4fr 1.2fr 1.2fr 1fr 1fr auto; gap: .35rem; align-items: center; }
.au-g input { min-width: 0; margin: 0; }
.au-g button, .pl-del { height: 2.2rem; padding: 0 .6rem; }
.au-st { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #e5e7eb; color: #374151; }
.au-st-gueltig { background: #dcfce7; color: #166534; }
.au-st-kuenftig { background: #dbeafe; color: #1e40af; }
.au-st-abgeloest, .au-st-abgelaufen { background: #fef3c7; color: #92400e; }
form.inline { display: inline; }
.pl-tab input.pl-p { width: 5.2rem; text-align: right; margin: 0; }
.pl-tab .pl-bez { display: flex; gap: .35rem; min-width: 13rem; }
.pl-tab .pl-bez select, .pl-tab .pl-bez input[type=text] { margin: 0; min-width: 0; flex: 1; }
.pl-tab tr.pl-F td { background: rgba(245,158,11,.07); }
.pl-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
@media (max-width: 640px) {
  .au-g { grid-template-columns: 1fr 1fr; }
  .au-g input:nth-child(1), .au-g input:nth-child(2) { grid-column: span 1; }
  .au-g button { grid-column: span 2; }
  .pl-wrap { overflow-x: auto; }
  .pl-tab, .pl-tab thead, .pl-tab tbody { display: table; width: max-content; }
  .pl-tab tr { display: table-row; }
  .pl-tab td, .pl-tab th { display: table-cell; }
  .pl-tab td::before { content: none; }
}
.pl-tab th, .pl-tab td { padding: .3rem .35rem; white-space: nowrap; }
.pl-tab th { min-width: 5.6rem; text-align: right; }
.pl-tab th:first-child { text-align: left; min-width: 13rem; }
@media (max-width: 480px) { .ad-tabs a { font-size: .68rem; overflow-wrap: anywhere; hyphens: auto; min-width: 0; padding: 0 .15rem; } }
.alert-warning { background: #fef3c7; color: #92400e; }
.aush-info { max-width: 640px; margin: -.8rem auto 0; font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.2; }
.aush-info.neg { color: #b42318; font-weight: 700; }
.aush-info[hidden] { display: none; }
a.letzter-stamm { color: inherit; text-decoration: none; }
.aush-trotzdem { margin: -.4rem 0 1rem; }
.aush-trotzdem .btn { width: 100%; }
.aush-wert .btn { margin: .3rem .3rem 0 0; }
.aush-wert tfoot th { text-align: left; }
.aush-wert tfoot th.num { text-align: right; }
.aush-info b { color: var(--text); font-weight: 800; }
.aush-info.neg b { color: inherit; }
.w-kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .7rem 0; }
.w-kacheln .k { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .5rem .7rem; }
.w-kacheln .k span { display: block; font-size: .72rem; color: var(--muted); }
.w-kacheln .k b { font-size: 1.1rem; }
.w-kacheln .gross { grid-column: 1 / 3; background: var(--info-bg); border-color: transparent; }
.w-kacheln .gross b { font-size: 1.7rem; color: var(--primary); }
.w-warn { background: #fef3c7; color: #92400e; border-radius: 8px; padding: .35rem .6rem; font-size: .8rem; margin-bottom: .6rem; }
.w-tab { width: 100%; border-collapse: collapse; font-size: .88rem; }
.w-tab th { font-size: .72rem; color: var(--muted); text-align: right; padding: .3rem; font-weight: 600; }
.w-tab th:first-child, .w-tab td:first-child { text-align: left; }
.w-tab td { padding: .4rem .3rem; border-top: 1px solid var(--border); text-align: right; position: relative; }
.w-tab td i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); opacity: .35; border-radius: 2px; }
@media (min-width: 700px) { .w-kacheln { grid-template-columns: 2fr 1fr 1fr; } .w-kacheln .gross { grid-column: auto; } }

/* Stammliste (Handy, kompakt): Käfer/Güte ohne Zeilenumbruch, Platz für dreistellige Nummern */
@media (max-width: 699px) {
    .stamm-hand.kompakt .kp, .stamm-hand.kompakt .k-kopf { grid-template-columns: 1.8rem 1fr 2.2rem 2.2rem 1.6rem 2.4rem; gap: .2rem; }
    .kp .a { flex-wrap: nowrap; margin-left: .15rem; gap: .2rem; }
    .k-kopf span:nth-child(2) { margin-left: .15rem; }
    .kp .a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
@media (max-width: 350px) {
    .kp .u { font-size: .6rem; padding: 0 .2rem; letter-spacing: 0; }
    .kp .gute, .kp .kaefer { font-size: .62rem; padding: 0 .25rem; }
    .stamm-hand.kompakt .kp, .stamm-hand.kompakt .k-kopf { grid-template-columns: 1.6rem 1fr 1.9rem 2rem 1.5rem 2.3rem; }
}

/* Mandanten: Registrierung und Firmenseite */
.reg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; }
.reg-tabs a { text-align: center; padding: .65rem .4rem; border: 1px solid var(--border, #d6dbe4); border-radius: 10px; background: #fff; color: inherit; text-decoration: none; font-weight: 600; font-size: .95rem; }
.reg-tabs a.on { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
.firma-card { max-width: 560px; }
.firma-logo { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.firma-logo img, .firma-logo-leer { width: 72px; height: 72px; border-radius: 12px; flex: 0 0 auto; object-fit: cover; background: #e8ebf0; }
.firma-logo-leer { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #6b7280; font-size: .85rem; }
.firma-code { display: flex; gap: .5rem; }
.firma-code input { flex: 1 1 auto; font-family: monospace; letter-spacing: .1em; }
.firma-code .btn { flex: 0 0 auto; }

/* Betreiber */
.betreiber-banner { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: center; background: #fff3c4; color: #7a4a00; border-radius: 12px; padding: .6rem .9rem; margin: 0 0 1rem; }
.betreiber-banner > span { flex: 1 1 14rem; }
.betreiber-banner form { margin: 0; }
.betreiber-banner select { max-width: 14rem; }
.bt-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; margin: .8rem 0 1rem; }
.bt-kacheln .k { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; }
.bt-kacheln .k b { display: block; font-size: 1.4rem; }
.bt-kacheln .k span { font-size: .8rem; color: var(--muted); }
.bt-tabelle td.bt-akt form { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.bt-tabelle .btn { padding: .35rem .8rem; font-size: .9rem; }
tr.bt-gesperrt td { opacity: .65; }
.bt-loeschen { margin: 1.5rem 0; }
.bt-loeschen summary { cursor: pointer; font-weight: 600; }
.bt-loeschen form { max-width: 28rem; margin-top: .8rem; }

/* Daten übertragen */
.ue-card { max-width: 640px; }
.ue-firmen { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ue-firmen select { flex: 1 1 12rem; min-width: 0; }
.ue-pfeil { font-size: 1.3rem; color: var(--primary); }
.ue-h { font-size: 1.05rem; margin: 1.1rem 0 .5rem; }
.ue-bereiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .15rem 1.2rem; }
.ue-bereiche .check { display: flex; align-items: center; gap: .5rem; }
.ue-bereiche .ue-n { margin-left: auto; font-style: normal; color: var(--muted); font-size: .85rem; }
.ue-akt { margin-top: 1rem; }
tr.ue-summe td { border-top: 2px solid var(--border); }

/* Preislisten: Art-Kennzeichen und Mengen-Preisliste */
.pl-art { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #e0e7ff; color: #3730a3; }
.pl-art-M { background: #ffedd5; color: #9a3412; }
#mz-tab th.mz-col { white-space: nowrap; }
#mz-tab th.mz-col input.pl-p { width: 4.5rem; text-align: right; }
#mz-tab td input.pl-p { width: 5.5rem; text-align: right; }
.form-card[hidden], section[hidden] { display: none; }

/* Lizenz */
.lic-banner { padding: .5rem 1rem; text-align: center; font-weight: 600; font-size: .95rem; }
.lic-banner a { margin-left: .5rem; text-decoration: underline; color: inherit; }
.lic-gelb { background: #fef3c7; color: #92400e; }
.lic-rot { background: #fee2e2; color: #991b1b; }
.lic-gesperrt { opacity: .65; }
.lic-karte { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.2rem; margin: .8rem 0 1.2rem; }
.lic-karte h2 { margin: 0 0 .4rem; }
.lic-zeile { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.lic-balken { height: 10px; width: 220px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.lic-balken i { display: block; height: 100%; background: var(--primary, #2563eb); }
.lic-balken.voll i { background: #dc2626; }
.lic-modul { display: inline-block; padding: .1rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #dcfce7; color: #166534; margin: 0 .3rem .2rem 0; }
.lic-modul.aus { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.lic-tab td.r, .lic-tab th.r { text-align: right; }
.lic-summe td { border-top: 2px solid var(--border); font-weight: 700; }
.lic-sperre { text-align: center; max-width: 36rem; margin: 1rem auto; }
.lic-sperre-ic { font-size: 3rem; }
.lic-chk { display: flex; gap: .5rem; align-items: center; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 10px; margin: .25rem 0; background: var(--card); }
.lic-chk input { width: auto; }
.lic-fl { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin: .6rem 0; }
.lic-fl > div { display: flex; flex-direction: column; gap: .2rem; }
.lic-fl input, .lic-fl select { width: auto; min-width: 7rem; max-width: 14rem; }
#erfassen { max-width: none; }
#kaeufe-liste { margin: 1rem 0 1.5rem; }
.pl2-list th, .pl2-list td { padding: .5rem .55rem; font-size: .92rem; }

/* ForstBW-Angebote */
.rb-dlg.fbw-dlg { width: min(900px, calc(100% - 1.5rem)); max-height: 92vh; overflow: auto; }
.fbw-dlg .table-wrap { overflow-x: auto; }
.fbw-dlg input.fbw-mein { width: 6.5rem; text-align: right; }
.fbw-dlg td, .fbw-dlg th { white-space: nowrap; }
.fbw-filter { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 1rem; }
.fbw-filter select { width: auto; min-width: 12rem; height: 2.6rem; }
.fbw-bz { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .45rem .8rem; }
.fbw-bz summary { cursor: pointer; }
.fbw-bz-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .2rem .8rem; margin-top: .5rem; }
.fbw-chk { display: flex; gap: .4rem; align-items: center; font-weight: 400; }
.fbw-chk input { width: auto; }
.fbw-tab td.r, .fbw-tab th.r { text-align: right; }
.fbw-pos { color: #166534; } .fbw-neg { color: #b42318; }
.fbw-warn td { background: #fffbeb; }
.fbw-chart { width: 100%; max-width: 780px; height: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.fbw-karte { max-width: 900px; }
.fbw-karte select, .fbw-karte input[type=text] { max-width: 28rem; }
.fbw-schritte { margin: .3rem 0 1rem 1.2rem; }
/* Mengen-Preisliste: Kopf und Zeilen müssen eine gemeinsame Tabelle bleiben (sonst sind die Spalten verschoben) */
#mz-tab { display: table; width: max-content; min-width: 100%; }
#mz-tab thead { display: table-header-group; }
#mz-tab tbody { display: table-row-group; }
#mz-tab th.mz-col { min-width: 11rem; }

/* Projekt-Leiste und Rechnungs-Stammdaten */
.bl-leiste { display: flex; gap: .25rem; flex-wrap: wrap; margin: .5rem 0 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.bl-leiste a { padding: .5rem .85rem; text-decoration: none; color: inherit; border-bottom: 3px solid transparent; white-space: nowrap; }
.bl-leiste a.on { border-bottom-color: var(--primary, #2e7d32); font-weight: 600; }
.bl-leiste a:hover { background: var(--card); }
.fa-bank { border-bottom: 1px solid var(--border); padding-bottom: .6rem; }
.fa-bank input[type=text], .fa-bank input[type=number] { min-width: 5rem; }
.lic-chk[hidden] { display: none; }

/* E-Mail-Versand: Einstellungen und Verbindungsprotokoll */
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .2rem .9rem; }
.ml-grid label { display: block; margin-top: .5rem; }
.maillog { background: #0f172a; color: #e2e8f0; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; border-radius: 10px; padding: .7rem .9rem; margin: .5rem 0; overflow-x: auto; }
.maillog .ml-ok { color: #86efac; } .maillog .ml-err { color: #fca5a5; } .maillog .ml-hint { color: #cbd5e1; margin-top: .3rem; white-space: normal; }
.mail-vorschau { white-space: pre-wrap; }

/* ===== Vereinsverwaltung (Phase 1) ===== */
.nav-plan > .nav-top { opacity: .55; }
.vm-crumb { color: var(--muted); font-size: .95rem; }
.vm-crumb a { color: inherit; }
.vm-sub { font-size: .95rem; color: var(--muted); font-weight: 600; }
.vm-knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.vm-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.vm-grid > .card, .vm-grid > div > .card { margin-bottom: 0; }
.vm-grid > div { display: grid; gap: 1rem; }
@media (min-width: 900px) {
    .vm-g2, .vm-g11 { grid-template-columns: 1fr 1fr; }
    .vm-g21 { grid-template-columns: 2fr 1fr; }
    .vm-g3 { grid-template-columns: repeat(3, 1fr); }
}
.vm-felder { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 600px) { .vm-felder { grid-template-columns: 1fr 1fr; } .vm-felder.eins { grid-template-columns: 1fr; } }
.vm-plzort { display: grid; grid-template-columns: 7rem 1fr; gap: 0 .75rem; }
.vm-speichern { grid-column: 1 / -1; }
.vm-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.vm-filter select, .vm-filter input { width: auto; min-height: 40px; margin: 0; }
.vm-suche { flex: 1 1 16rem; }
.vm-alter input { width: 3.5rem; }
.vm-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.vm-abstand { margin-bottom: 1rem; }
.vm-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; text-decoration: none; cursor: pointer; }
.vm-chip.an { background: var(--primary); border-color: var(--primary); color: #fff; }
.vm-chip input { margin: 0; width: auto; min-height: 0; }
.vm-pill { display: inline-block; white-space: nowrap; border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.vm-pill.g { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.vm-pill.i { background: var(--info-bg); color: var(--info-text); border-color: transparent; }
.vm-pill.e { background: var(--err-bg); color: var(--err-text); border-color: transparent; }
.vm-pill.w { background: #fef3c7; color: #92400e; border-color: transparent; }
.vm-ok { display: inline-flex; width: 1.3rem; height: 1.3rem; border-radius: 4px; background: #16a34a; color: #fff; align-items: center; justify-content: center; font-size: .8rem; }
.vm-box { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 4px; border: 2px solid #9ca3af; vertical-align: -3px; }
.vm-box.an { background: #16a34a; border-color: #16a34a; }
.vm-av { display: inline-flex; width: 2rem; height: 2rem; border-radius: 50%; background: var(--info-bg); color: var(--info-text); font-weight: 700; font-size: .8rem; align-items: center; justify-content: center; margin-right: .5rem; flex: 0 0 auto; }
.vm-name { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.vm-cb { width: 2rem; }
.vm-cb input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; }
.vm-sel td { background: var(--info-bg); }
.vm-auswahl { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.vm-auswahl select { width: auto; min-height: 36px; margin: 0; }
.vm-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.vm-tabs a, .vm-tabs .aus { padding: .55rem .9rem; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; }
.vm-tabs a.an { font-weight: 700; border-bottom-color: var(--primary); }
.vm-tabs .aus { color: var(--muted); cursor: not-allowed; }
.vm-hint { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, .1); border-radius: 6px; padding: .5rem .8rem; margin: .4rem 0; font-size: .95rem; }
.vm-hint.r { border-color: var(--danger); background: var(--err-bg); color: var(--err-text); }
.vm-hint.g { border-color: #16a34a; background: var(--ok-bg); color: var(--ok-text); }
.vm-hint.b { border-color: var(--primary); background: var(--info-bg); color: var(--info-text); }
.vm-hint a { color: inherit; }
.vm-reihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.vm-reihe select, .vm-reihe input { width: auto; margin: 0; min-height: 38px; }
.vm-reihe .check { margin: 0; }
.vm-inline { display: inline; }
.vm-liste { list-style: none; padding: 0; margin: 0 0 .75rem; }
.vm-liste li { padding: .35rem 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.vm-block { margin-top: 1rem; }
.vm-block > summary { list-style: none; display: inline-block; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.vm-dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.vm-dl dt { color: var(--muted); }
.vm-dl dd { margin: 0; }
.vm-zeiten select, .vm-zeiten input { min-height: 36px; margin: 0; width: 100%; }
.vm-multi { width: 100%; min-height: 10rem; }
.vm-regel { display: flex; gap: .5rem; margin-bottom: .4rem; }
.vm-regel select { margin: 0; }
.vm-ew td { vertical-align: middle; }
.vm-ewform form { display: grid; gap: .3rem; margin-top: .5rem; min-width: 14rem; }
.vm-ewzeile { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.vm-fest { padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); margin-bottom: .5rem; }
.vm-vtwahl { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.vm-ph { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; padding: .1rem .4rem; font-size: .85rem; cursor: pointer; }
.vm-anhang { display: flex; align-items: center; gap: .4rem; margin: .2rem 0; }
.vm-mail { border: 1px solid var(--border); border-radius: 10px; padding: .75rem; margin-top: .5rem; font-size: .9rem; }
.vm-mail pre, .vm-mailtext { white-space: pre-wrap; font-family: inherit; margin: .5rem 0 0; }
.vm-fortschritt { height: .7rem; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.vm-fortschritt div { height: 100%; background: var(--primary); transition: width .4s; }
.vm-zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.vm-zahlen a { display: flex; flex-direction: column; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.vm-zahlen b { font-size: 1.6rem; }
.vm-zahlen span { color: var(--muted); font-size: .9rem; }
.vm-karte { padding: .8rem 1rem; margin-bottom: .6rem; }
.vm-karte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.vm-einzug { margin-left: 2.5rem; }
.vm-warn { color: #b45309; }
.vm-anruf { font-size: 1.6rem; text-decoration: none; padding: .2rem .4rem; }
.vm-loeschen { margin-top: 1rem; }

/* Vereinsverwaltung: Eingabefelder ohne Typ, Suche, Zeit, Zahl, Datum und Auswahllisten wie die übrigen Felder.
   :where() hält die Spezifität bei 0, damit bestehende Seitenregeln Vorrang behalten. */
:where(input:not([type]), input[type=search], input[type=time], input[type=number], input[type=date], input[type=url], select) {
    width: 100%;
    font: inherit;
    font-size: 16px;
    padding: .7rem .9rem;
    min-height: 48px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
}
:where(select[multiple]) { min-height: 9rem; padding: .4rem; }
:where(select:focus, input[type=search]:focus, input[type=time]:focus) { outline: 3px solid rgba(37,99,235,.35); border-color: var(--primary); }

/* ---------- Vereinsverwaltung Phase 2: Training / Anwesenheit ---------- */
.tg-block { margin: 1.4rem 0 .6rem; font-size: 1.1rem; }
.tg-liste { display: grid; gap: .5rem; }
.tg-einheit { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem; margin: 0; color: var(--text); text-decoration: none; }
.tg-einheit:hover { border-color: var(--primary); }
.tg-einheit.offen { border-left: 4px solid #f59e0b; }
.tg-zeit { display: flex; flex-direction: column; align-items: center; min-width: 3.2rem; line-height: 1.2; }
.tg-zeit small, .tg-was small { color: var(--muted); font-size: .85rem; }
.tg-was { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tg-status { margin-left: auto; text-align: right; }
.tg-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tg-kopf h2 { margin: 0; }
.tg-person { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.tg-person:last-of-type { border-bottom: 0; }
.tg-name { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.tg-name small { display: block; }
.tg-wahl { display: flex; gap: .3rem; }
.tg-wahl label { margin: 0; font-weight: 600; cursor: pointer; }
.tg-wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tg-wahl span { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 44px; padding: 0 .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 1.05rem; }
.tg-wahl em { font-style: normal; font-size: .85rem; margin-left: .3rem; }
.tg-wahl input:focus-visible + span { outline: 3px solid rgba(37,99,235,.35); }
.tg-wahl input:disabled + span { opacity: .6; cursor: default; }
.tg-da input:checked + span { background: #16a34a; border-color: #16a34a; color: #fff; }
.tg-fehlt input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.tg-entschuldigt input:checked + span { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.tg-person.s-da .tg-name b { color: #15803d; }
.tg-std { width: 4.5rem !important; text-align: right; }
.tg-leiste { position: sticky; bottom: 0; background: var(--bg); padding: .6rem 0; margin: 0; z-index: 5; }
.tg-tabelle .num { text-align: right; white-space: nowrap; }
.tg-luecke td { background: rgba(245, 158, 11, .08); }
.tg-pt.ent { background: rgba(245, 158, 11, .08); border-radius: 8px; }
.tg-an { background: var(--info-bg); border-radius: 8px; }
@media (max-width: 640px) {
    .tg-wahl em { display: none; }
    .tg-person { flex-wrap: nowrap; }
    .tg-name .vm-av { display: none; }
}
.table-wrap:has(.tg-tabelle) { overflow-x: auto; }
.tg-tabelle th, .tg-tabelle td { padding-left: .55rem; padding-right: .55rem; }

/* ---------- Finanzen (Phase 3) ---------- */
.fz-kacheln { margin-bottom: 1rem; }
.fz-kachel { display: flex; flex-direction: column; gap: .15rem; margin: 0; color: var(--text); text-decoration: none; }
a.fz-kachel:hover { border-color: var(--primary); }
.fz-kachel b { font-size: 1.35rem; }
.fz-kachel.warn { border-left: 4px solid var(--danger); }
.fz-tabelle .num, .fz-saetze .num { text-align: right; white-space: nowrap; }
.table-wrap:has(.fz-tabelle), .table-wrap:has(.fz-saetze) { overflow-x: auto; }
.fz-saetze input, .fz-saetze select { min-width: 6rem; margin: 0; }
.fz-betrag { width: 6.5rem !important; text-align: right; }
.fz-bic { width: 8rem !important; }
.fz-neu td { background: rgba(37, 99, 235, .05); }
.fz-storniert td { color: var(--muted); text-decoration: line-through; }
.fz-storniert td:last-child { text-decoration: none; }
.fz-plus { color: #15803d; }
.fz-minus { color: var(--danger); }
.fz-art { margin-bottom: .5rem; }
.fz-aktionen { display: grid; gap: .5rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.fz-grund { max-width: 16rem; margin: 0; }
.fz-rueck summary { list-style: none; display: inline-flex; }
.fz-rueck summary::-webkit-details-marker { display: none; }
.fz-rueck[open] form { min-width: 14rem; }
.fz-link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; min-height: 0; width: auto; }
.fz-mandat { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.fz-mandat.aus { opacity: .65; }
.fz-schritte ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
.fz-beleg { max-width: 820px; }
.fz-beleg-kopf { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--text); padding-bottom: .5rem; margin-bottom: 1rem; }
.fz-unterschrift { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3.5rem; }
.fz-unterschrift div { border-top: 1px solid var(--text); padding-top: .3rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) { .fz-unterschrift { grid-template-columns: 1fr; gap: 2.5rem; } }
@media print {
    .site-header, .site-footer, .fz-nodruck, .alert { display: none !important; }
    body { background: #fff; color: #000; }
    .fz-beleg { border: 0; box-shadow: none; max-width: none; padding: 0; }
}

/* ---------- Kurse & Abzeichen (Phase 4) ---------- */
.vm-g4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .vm-g4 { grid-template-columns: repeat(4, 1fr); } }
.ku-link { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.ku-link .vm-reihe { flex: 1 1 22rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.ku-link input { flex: 1 1 14rem; margin: 0; min-width: 0; font-size: .9rem; }
.ku-tabelle .num { text-align: right; white-space: nowrap; }
.ku-wl td { background: rgba(245, 158, 11, .07); }
.ku-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.ku-matrix { border-collapse: collapse; width: 100%; font-size: .92rem; }
.ku-matrix th, .ku-matrix td { border-bottom: 1px solid var(--border); padding: .45rem .4rem; text-align: center; white-space: nowrap; }
.ku-matrix th:first-child, .ku-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.ku-matrix th { color: var(--muted); font-weight: 600; }
.ku-matrix th a { color: inherit; text-decoration: none; }
.ku-matrix th.an, .ku-matrix td.an { background: var(--info-bg); }
.ku-matrix .num { text-align: right; }
.ku-a.s-da { color: #15803d; font-weight: 700; }
.ku-a.s-fehlt { color: var(--danger); font-weight: 700; }
.ku-a.s-entschuldigt { color: #b45309; font-weight: 700; }
.ku-cb label { display: inline-flex; margin: 0; cursor: pointer; }
.ku-cb input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ku-cb span { display: inline-flex; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; align-items: center; justify-content: center; background: var(--card); }
.ku-cb input:checked + span { background: #16a34a; border-color: #16a34a; }
.ku-cb input:checked + span::after { content: '✓'; color: #fff; font-weight: 700; }
.ku-cb input:focus-visible + span { outline: 3px solid rgba(37,99,235,.35); }
.ku-cb input:disabled + span { opacity: .7; cursor: default; }
.ku-wahl { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; margin-bottom: .6rem; }
.ku-wahl .check { margin: .2rem 0; }
.ku-anf { margin: 0; padding-left: 1.4rem; display: grid; gap: .25rem; }
.ku-aus { opacity: .65; }
.ku-inaktiv { opacity: .7; }
.ku-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ku-oe { max-width: 1000px; margin: 0 auto; }
.ku-fakten { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: grid; gap: .35rem; }
.ku-fakten li { padding-left: 1rem; border-left: 3px solid var(--border); }
.ku-angebot h2 { margin-bottom: .2rem; }
.ku-druck h1 { margin-bottom: .2rem; }
.ku-papier td { height: 2rem; border: 1px solid #999; }
.ku-papier th { border: 1px solid #999; color: #000; }
.ku-urkunde { max-width: 900px; margin: 0 auto; background: #fff; color: #111; border: 10px double #1e3a8a; padding: 2.5rem 2rem; text-align: center; }
.ku-u-verein { font-size: 1.1rem; letter-spacing: .08em; text-transform: uppercase; color: #1e3a8a; }
.ku-u-titel { font-size: 2.6rem; font-weight: 800; margin: .6rem 0 1rem; color: #1e3a8a; }
.ku-u-text { margin: .4rem 0; }
.ku-u-name { font-size: 2rem; font-weight: 700; margin: .3rem 0; }
.ku-u-geb { color: #555; margin: 0 0 .6rem; }
.ku-u-abz { font-size: 1.8rem; font-weight: 800; margin: .4rem 0 .2rem; }
.ku-u-anf { text-align: left; display: inline-block; margin: .8rem auto; font-size: .9rem; color: #333; }
.ku-u-fuss { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3rem; }
.ku-u-fuss div { border-top: 1px solid #111; padding-top: .3rem; display: flex; flex-direction: column; }
.ku-u-fuss span { font-weight: 600; }
.ku-u-fuss small { color: #555; }
@media (max-width: 600px) { .ku-urkunde { padding: 1.4rem 1rem; border-width: 6px; } .ku-u-titel { font-size: 1.8rem; } .ku-u-name { font-size: 1.5rem; } .ku-u-fuss { gap: 1.2rem; } }
@media print {
    @page quer { size: A4 landscape; margin: 12mm; }
    .ku-urkunde, .ku-druck { page: quer; }
    .ku-druck .ku-papier td:first-child, .ku-druck .ku-papier th:first-child { position: static; }
}

/* ===== Programm-Update ===== */
.up-form { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; max-width: 32rem; }
.up-form input[type=file], .up-form input[type=password] { width: 100%; }
.up-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.up-vorschau .up-liste { margin: .35rem 0; }
.up-liste summary { cursor: pointer; padding: .2rem 0; }
.up-pfade { margin: .3rem 0 .6rem; padding-left: 1.2rem; max-height: 16rem; overflow: auto; font-size: .85rem; }
.up-pfade code, .up-liste code { word-break: break-all; }
.up-fehler { color: var(--err-text); margin-top: .2rem; }
.up-zurueck { display: inline-block; vertical-align: top; }
.up-zurueck summary { list-style: none; }
.up-zurueck summary::-webkit-details-marker { display: none; }
.up-zurueck[open] .up-form { margin-top: .5rem; padding: .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }

/* ===== 4.4: breiter (1400px) und kompakter =====
   Handy: Touch-Größen bleiben, nur weniger Abstand. PC (ab 700px): kleinere Grundschrift, flachere Felder,
   Knöpfe und Tabellenzeilen. Steht bewusst am Ende, damit es die älteren Regeln übersteuert. */
main.container { padding-top: 1rem; padding-bottom: 1.5rem; }
.card, .form-card { padding: 1rem; margin-bottom: .8rem; }
.grid { gap: .8rem; }
label { margin: .75rem 0 .3rem; }
.alert { padding: .6rem .85rem; margin-bottom: .8rem; }
.list tr { padding: .4rem .8rem; margin-bottom: .6rem; }
.list td { padding: .25rem 0; }

@media (min-width: 700px) {
    html { font-size: 15px; }
    body { line-height: 1.45; }
    main.container { padding-top: .8rem; padding-bottom: 1.25rem; }
    h1 { font-size: 1.55rem; margin-bottom: .6rem; }
    h2 { font-size: 1.12rem; margin-bottom: .4rem; }
    .header-inner { min-height: 48px; }
    .nav a { padding: .35rem .6rem; }
    .card, .form-card { padding: .85rem 1rem; margin-bottom: .7rem; }
    .grid { gap: .7rem; margin-bottom: .7rem; }
    .page-head { margin-bottom: .6rem; gap: .5rem; }
    label { margin: .55rem 0 .2rem; }
    .check { margin: .55rem 0 .15rem; }
    input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=datetime-local],
    input:not([type]), input[type=search], input[type=time], input[type=number], input[type=url],
    .form-card select, .bde-filter select, .dz select, select {
        font-size: 15px; padding: .4rem .6rem; min-height: 36px; border-radius: 8px;
    }
    textarea { font-size: 15px; padding: .45rem .6rem; min-height: 0; border-radius: 8px; }
    select[multiple] { min-height: 7rem; }
    .btn { min-height: 36px; padding: .4rem 1rem; border-radius: 8px; }
    .btn-small { min-height: 30px; padding: .2rem .65rem; font-size: .9rem; }
    .btn-block { margin-top: .8rem; }
    .reiter a { min-height: 34px; padding: .3rem .8rem; }
    .filter summary { min-height: 40px; }
    .filter form { padding-bottom: .7rem; }
    .filter-actions { margin-top: .7rem; }
    .pager { margin: .6rem 0; }
    .list th, .list td { padding: .4rem .6rem; }
    .stat-table th, .stat-table td { padding: .35rem .4rem; }
    .stat { padding: .6rem .8rem; }
    .stat .value { font-size: 1.3rem; }
    .stat-grid { gap: .6rem; margin-bottom: .7rem; }
    .alert { padding: .5rem .8rem; margin-bottom: .7rem; }
    .badge { padding: .1rem .55rem; font-size: .8rem; }
    .site-footer { padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom)); font-size: .85rem; }
    table th, table td { padding-top: .35rem; padding-bottom: .35rem; }
}

/* ---------- 4.5: Freibeträge je Jahr, Anfangsbestand mit Stichtag ---------- */
.fz-fb input { margin: 0; min-width: 0; }
.fz-fb td:first-child input { max-width: 7rem; }
.fz-fb .check { display: inline-flex; gap: .3rem; align-items: center; margin: 0; font-weight: normal; }
#finanzen h3 { margin: 1.1rem 0 .4rem; font-size: 1rem; }
tr.fz-anfang td { background: rgba(37, 99, 235, .12); }

/* ---------- 4.7: Ausgangsrechnungen, Gutschriften, Serien ---------- */
.ar-balken { display: block; height: .4rem; margin-top: .45rem; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.ar-balken > span { display: block; height: 100%; background: var(--primary); }
.ar-balken > span.gelb { background: #d97706; }
.ar-balken > span.rot { background: var(--danger); }
.ar-sph { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: 0 .4rem; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.ar-sph.s-i { background: #ede9fe; color: #5b21b6; border-color: transparent; }
.ar-sph.s-v { background: #e0f2fe; color: #075985; border-color: transparent; }
.ar-sph.s-z { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.ar-sph.s-w { background: #fef3c7; color: #92400e; border-color: transparent; }
.ar-treffer { list-style: none; margin: .6rem 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ar-treffer li + li { border-top: 1px solid var(--border); }
.ar-wahl { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; padding: .55rem .8rem; background: var(--card); color: var(--text); border: 0; border-radius: 0; text-align: left; cursor: pointer; font: inherit; min-height: 0; }
.ar-wahl:hover, .ar-wahl:focus-visible { background: var(--info-bg); }
.vm-filter-flach { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.vm-filter-flach input[type=search] { flex: 1 1 14rem; width: auto; }
.vm-filter-flach select { width: auto; }
.ar-layout { display: grid; gap: 1rem; }
.ar-haupt, .ar-seite { min-width: 0; }
.ar-kopf { display: grid; gap: 1rem; }
.ar-adr { font-style: normal; margin: .3rem 0 .4rem; line-height: 1.45; }
.ar-dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: 0; }
.ar-dl dt { color: var(--muted); }
.ar-dl dd { margin: 0; }
.ar-pos textarea { min-height: 2.25rem; resize: vertical; width: 100%; field-sizing: content; }
.ar-pos td:nth-child(2) { min-width: 16rem; }
.ar-serie td:nth-child(2) { min-width: 0; }
.ar-serie td:first-child { min-width: 16rem; }
.ar-pos select { width: auto; max-width: 10rem; }
.ar-seite p { margin: .5rem 0; }
.ar-seite .btn-block { margin-top: 0; }
.ar-zahl { width: 6.5rem; text-align: right; }
.ar-einheit { width: 4.5rem; }
.ar-weg { display: inline-flex; gap: .25rem; align-items: center; color: var(--danger); cursor: pointer; white-space: nowrap; }
.ar-weg input { width: auto; margin: 0; }
.ar-neu td { background: var(--bg); }
.ar-pos-knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .6rem; }
.ar-pos-knoepfe select { width: auto; }
.ar-summen dl { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin: 0; }
.ar-summen dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ar-summen .ar-gesamt { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.ar-korr { margin: .2rem 0 .8rem; padding-left: 1.1rem; }
.nk-gruppe th { background: var(--bg); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.ku-tl { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .6rem; }
.ku-tl h3 { margin: 0 0 .3rem; font-size: 1rem; }
.ku-tl select { width: auto; max-width: 100%; }
@media (min-width: 700px) {
    .ar-kopf { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
}
@media (min-width: 1000px) {
    .ar-layout { grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; }
    .ar-seite { position: sticky; top: 4.5rem; }
}

/* ---------- 4.11: Verlauf, Nachweise, Stundensätze, Forderung entfernen, Sammeländerung ---------- */
.al-alt { color: var(--err-text); background: var(--err-bg); text-decoration: line-through; padding: 0 .25rem; border-radius: 4px; }
.al-neu { color: var(--ok-text); background: var(--ok-bg); padding: 0 .25rem; border-radius: 4px; }
.al-liste td { vertical-align: top; }
.al-liste td > div + div { margin-top: .15rem; }
.al-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.al-filter input[type=search] { width: auto; min-width: 12rem; margin: 0; }
.al-knopf { display: inline-block; }
.al-knopf > summary { list-style: none; }
.al-knopf > summary::-webkit-details-marker { display: none; }
.al-knopf[open] .al-panel { position: relative; margin-top: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card, #fff); max-height: 28rem; overflow: auto; }
.vg-kopf { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.vg-kopf h2 { margin: 0; }
.vg-grid { display: grid; grid-template-columns: minmax(0, 32rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.vg-gruppen tr.vg-an td { background: var(--info-bg); }
tr.vg-jetzt td { background: var(--ok-bg); }
.vg-eingabe td { background: var(--bg); }
.vg-neu { margin-top: .5rem; }
.vg-neu form label, .vg-felder label { display: block; }
.vg-felder, .nw-felder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem .75rem; }
.vg-felder .vg-breit, .nw-felder .nw-breit { grid-column: span 2; }
.nw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: 1rem; align-items: start; }
.nw-w { color: #92400e; }
.nw-e { color: var(--err-text); }
.hint-box { border: 2px dashed var(--info-text, #1e40af); border-radius: 10px; padding: .75rem 1rem; color: var(--info-text, #1e40af); background: var(--info-bg); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--err-text); cursor: pointer; font: inherit; text-decoration: underline; min-height: 0; }
.fo-panel { margin-top: .75rem; }
.fo-panel[open] { border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem; }
.fo-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; margin: .5rem 0; }
.fo-opt { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; cursor: pointer; margin: 0; }
.fo-opt .muted { flex-basis: 100%; }
.fo-neu label.check { display: inline-flex; margin-right: 1rem; }
.sm-felder td { vertical-align: middle; }
.sm-felder select, .sm-felder input { width: auto; margin: 0; }
.al-liste td, .sm-vorschau td { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 900px) {
    .vg-grid, .nw-grid { grid-template-columns: 1fr; }
    .vg-felder, .nw-felder { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .vg-felder, .nw-felder { grid-template-columns: 1fr; }
    .vg-felder .vg-breit, .nw-felder .nw-breit { grid-column: auto; }
}
@media print {
    .fz-nodruck, .site-header, nav.vm-tabs { display: none !important; }
}
.vg-modus { white-space: nowrap; }
.vg-modus select, .vg-modus input { width: auto; max-width: 14rem; margin: 0 .25rem .25rem 0; display: inline-block; }
.sm-knopf { margin: .75rem 0; }
@media (max-width: 699px) {
    .sm-felder thead { display: none; }
    .sm-felder tr { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; }
    .sm-felder td { display: block; border: 0; padding: .25rem; text-align: left; }
    .sm-felder td:nth-child(3) { grid-column: 1 / -1; padding-bottom: .5rem; border-bottom: 1px solid var(--border, #e5e7eb); }
    .sm-felder select, .sm-felder input { max-width: 100%; margin-bottom: .25rem; }
    .al-liste td > div { min-width: 0; }
}

/* ===== 4.12 Handy: Korrekturen für schmale Bildschirme ===== */
/* Training → Anwesenheit „Gehalten von“: Stundenfeld bleibt neben dem Namen (gilt auch am PC) */
.tg-trz { flex-wrap: nowrap; }
.tg-trz > .check, .tg-trz > select { flex: 1 1 auto; min-width: 0; }
.tg-trz .tg-rolle { white-space: nowrap; }
.tg-stdbox { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; flex: 0 0 auto; }
.vm-nw { white-space: nowrap; }
.tp-kat-seite > * { min-width: 0; }

@media (max-width: 699px) {
    /* Listen-Karten: Inhalt fließt normal (Zeilenumbrüche, mehrere Teile in einer Zelle), Beschriftung links */
    .list td { display: block; text-align: right; overflow-wrap: break-word; }
    .list td::before { float: left; margin-right: 1rem; }
    .list td::after { content: ""; display: table; clear: both; }
    .list td.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
    .list td .small, .list td small { line-height: 1.35; }
    .list td input[type="checkbox"] { width: 1.35rem; height: 1.35rem; }

    /* hinterlegte Zeilen: Farbe auf der ganzen Karte statt nur hinter den Zellen */
    .list tr.tg-luecke, .list tr.ku-wl, .list tr.fbw-warn, .list tr.pl-F { background: linear-gradient(rgba(245, 158, 11, .09), rgba(245, 158, 11, .09)), var(--card); border-color: rgba(245, 158, 11, .45); }
    .list tr.vm-sel, .list tr.ich { background: var(--info-bg); border-color: var(--primary); }
    .list tr.fz-neu, .list tr.fz-anfang { background: linear-gradient(rgba(37, 99, 235, .07), rgba(37, 99, 235, .07)), var(--card); }
    .list tr.neu { background: var(--ok-bg); }
    .list tr.ar-neu { background: var(--bg); }
    .list tr.vg-an { background: var(--info-bg); border-color: var(--primary); }
    .list tr.vg-jetzt { background: var(--ok-bg); }
    .list tr.vg-eingabe { background: var(--bg); }
    .list tr.tg-luecke td, .list tr.ku-wl td, .list tr.fbw-warn td, .list tr.pl-F td, .list tr.vm-sel td, .list tr.ich td,
    .list tr.fz-neu td, .list tr.fz-anfang td, .list tr.neu td, .list tr.ar-neu td,
    .list tr.vg-an td, .list tr.vg-jetzt td, .list tr.vg-eingabe td { background: transparent; }

    .tg-trz .tg-rolle { display: none; }

    /* Reiter (Mitglied, Kurs …) kompakter, damit sie in zwei statt vier Zeilen passen */
    .vm-tabs a, .vm-tabs .aus { padding: .5rem .6rem; font-size: .92rem; }

    /* Mitgliederliste: kompakte Karte – Name + Status, darunter eine Zeile mit Nr., Alter, Gruppe, Eltern */
    .list.vm-tab tr { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; padding: .55rem .8rem; margin-bottom: .5rem; }
    .list.vm-tab td { display: inline; width: auto; padding: 0; text-align: left; }
    .list.vm-tab td::before, .list.vm-tab td::after { content: none; }
    .list.vm-tab td.vm-cb { order: 0; flex: 0 0 auto; }
    .list.vm-tab td.vm-k-name { order: 1; flex: 1 1 0; min-width: 0; }
    .list.vm-tab td.vm-k-status { order: 2; flex: 0 0 auto; }
    .list.vm-tab td.vm-k-rm { order: 5; flex: 0 0 auto; font-size: .85rem; }
    .list.vm-tab td.vm-k-name a { display: flex; min-width: 0; }
    .list.vm-tab td.vm-k-name b { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
    .list.vm-tab td.vm-k-info { order: 4; font-size: .85rem; color: var(--muted); }
    .list.vm-tab td.vm-k-info:not(.vm-k-leer)::before { content: attr(data-label) " "; float: none; margin: 0; opacity: .8; }
    .list.vm-tab td.vm-k-info .small, .list.vm-tab td.vm-k-info div { display: inline; }
    .list.vm-tab td.vm-k-info .small::before { content: " · "; }
    .list.vm-tab td.vm-k-leer { display: none; }
    .list.vm-tab tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
    .list.vm-tab .vm-av { width: 1.9rem; height: 1.9rem; font-size: .72rem; }

    /* Kurs → Teilnehmer: Name und Kontakt oben, Preis, Gebühr, Status und Knöpfe in einer Zeile */
    .list.ku-tn tr { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; padding: .6rem .8rem; }
    .list.ku-tn td { display: block; width: auto; padding: 0; text-align: left; }
    .list.ku-tn td::before, .list.ku-tn td::after { content: none; }
    .list.ku-tn td:nth-child(1) { flex: 0 0 auto; font-weight: 700; min-width: 1.2rem; }
    .list.ku-tn td:nth-child(1):empty { display: none; }
    .list.ku-tn td:nth-child(2) { flex: 1 1 calc(100% - 2.5rem); }
    .list.ku-tn td:nth-child(3) { flex: 1 1 100%; font-size: .9rem; }
    .list.ku-tn td:nth-child(4)::before { content: attr(data-label) " "; color: var(--muted); font-size: .85rem; }
    .list.ku-tn td:nth-child(4) { display: flex; align-items: center; gap: .35rem; }
    .list.ku-tn td:nth-child(4) .fz-betrag { width: 5.2rem !important; min-height: 36px; }
    .list.ku-tn td.actions { margin-left: auto; padding: 0; }

    /* Soll/Ist: Werte zweispaltig statt jede Zahl in eigener Zeile */
    .list.tg-tabelle tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; }
    .list.tg-tabelle td { padding: .2rem 0; font-size: .92rem; }
    .list.tg-tabelle td:first-child { grid-column: 1 / -1; font-size: 1rem; padding-bottom: .35rem; }

    /* Gruppen → Trainer: Gruppen untereinander statt über den Rand */
    .vm-trgr .vm-nw { display: block; white-space: normal; }
    .vm-trgr .vm-trsep { display: none; }
    .list td:empty { display: none; }

    /* Übungskatalog: Tabelle scrollt in der Karte, Felder bleiben bedienbar breit */
    .tp-katalog td select { min-width: 7.5rem; }
    .tp-katalog td input[name$="[name]"] { min-width: 11rem; }
    .tp-katalog td input[name$="[sort]"] { min-width: 3.5rem; }
    .tp-katalog .tp-mehrfach-feld, .tp-katalog .tp-hm-wahl { min-width: 8rem; }
    .tp-kat-seite .tp-soll-tab { width: 100%; table-layout: fixed; }
    .tp-kat-seite .tp-soll-tab td, .tp-kat-seite .tp-soll-tab th { overflow-wrap: anywhere; }
    .tp-kat-seite .tp-soll-tab input { width: 100%; min-width: 0; }

    /* Programm-Update: lange Texte umbrechen */
    .list td .muted { overflow-wrap: anywhere; }
}

/* ---------- 4.15 Vollsicherung beim Programm-Update ---------- */
.vs-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.vs-dlg { background: var(--card); color: var(--text); border-radius: 14px; padding: 1.2rem 1.4rem; width: min(560px, 100%); box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.vs-dlg h2 { margin-top: 0; }
.vs-vgl { display: grid; grid-template-columns: auto auto; gap: .2rem 1.2rem; margin: .5rem 0 .8rem; justify-content: start; }
.vs-vgl b { font-size: 1.05rem; }
.vs-warn { color: #b45309; }
.vs-knoepfe { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.vs-knoepfe form { margin: 0; }
.vs-lauf { max-width: 48rem; }
.vs-schritte { list-style: none; padding: 0; margin: .3rem 0; }
.vs-schritte li { padding: .3rem 0; display: flex; gap: .6rem; align-items: baseline; }
.vs-schritte li > span { width: 1.1rem; flex: none; font-weight: 700; }
.vs-schritte li.ok > span { color: #15803d; }
.vs-schritte li.lauf > span { color: var(--primary); }
.vs-schritte li.wart { color: var(--muted); }
.vs-balken { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; margin: .5rem 0 .3rem; }
.vs-balken i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.vs-fertig p { margin: .5rem 0 0; }
.vs-aktion { white-space: nowrap; }
.vs-aktion form { display: inline; }
.vs-aktion .btn[disabled] { opacity: .4; cursor: not-allowed; }
@media (max-width: 699px) { .vs-aktion { white-space: normal; } .vs-knoepfe { justify-content: stretch; } .vs-knoepfe .btn { width: 100%; } .vs-knoepfe form { width: 100%; } }

/* ===== 4.30 Trainerzuordnung: Rolle und „bezahlt“ in der Zeile, Auswahl nur Trainer, Anwesenheit mit Plan-Verknüpfung ===== */
.tz-liste li { gap: .6rem; flex-wrap: nowrap; padding: .45rem 0; }
.tz-liste .tz-name { flex: 1 1 auto; min-width: 0; }
.tz-rolle { width: auto; min-height: 34px; margin: 0; padding: .2rem 2rem .2rem .7rem; font-weight: 600; border-radius: 999px; }
.tz-rolle.haupt { background-color: var(--info-bg); color: var(--info-text); border-color: transparent; }
.tz-bez { margin: 0; white-space: nowrap; font-size: .95rem; }
.tz-ok { color: var(--ok-text); background: var(--ok-bg); border-radius: 999px; font-size: .8rem; padding: .05rem .55rem; white-space: nowrap; }
.tz-ok.fehler { color: var(--err-text); background: var(--err-bg); }
.tz-neu .vm-reihe .tz-wahl { min-width: 16rem; max-width: 100%; }
.tz-such { margin-top: .4rem; }
.tz-such > summary { cursor: pointer; color: var(--primary); font-size: .95rem; }
.tz-such[open] { border: 1px dashed var(--border); border-radius: 10px; padding: .6rem .8rem; }
.tz-such input[type=search] { width: 100%; max-width: 20rem; margin: 0; min-height: 38px; }
.tz-treffer { list-style: none; padding: 0; margin: .3rem 0 0; }
.tz-treffer li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.tz-treffer li > span { flex: 1 1 14rem; }
.tz-treffer .vm-reihe { margin: 0; }
.tz-trz { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .15rem 0; }
.tz-trz > a { min-width: 10rem; }
.tg-trz > .check.tg-bez, .tg-bez { margin: 0; font-size: .85rem; white-space: nowrap; flex: 0 0 auto; }
.vm-pill.tg-bez { font-size: .75rem; }
.tg-unbez .tg-std { opacity: .45; }
.tg-planbox { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .8rem; margin: .5rem 0; background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.tg-plant { font-weight: 700; font-size: 1.05rem; }
.tg-planm { color: var(--muted); font-size: .85rem; margin: .15rem 0 .5rem; }
.tg-plankat { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.tg-planbox .vm-reihe { margin: 0; }
.tg-planneu { display: block; font-size: .9rem; margin: .3rem 0 .6rem; }
@media (max-width: 699px) {
    .tz-liste li { flex-wrap: wrap; }
    .tz-liste .tz-name { flex: 1 1 100%; }
    .tz-liste .tz-rolle { min-height: 44px; }
    .tz-ok { display: none !important; }
    .tz-neu .vm-reihe .tz-wahl { width: 100%; min-width: 0; }
    .tz-neu .vm-reihe button { flex: 1 1 100%; }
    .tz-treffer li > span { flex: 1 1 100%; }
    .tz-treffer .vm-reihe button { flex: 1 1 auto; }
    .tz-trz > a { flex: 1 1 100%; }
}
.tg-trz:has(.tg-bez) .tg-rolle { display: none; }   /* 4.30: Platz für „bezahlt“; die Rolle steht in der Gruppe */

/* ===== 4.33: Mail-Hinweis, Warteliste von Hand, Lizenzarten-Kasten ===== */
.ml-streifen { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; border: 1px solid rgba(245, 158, 11, .55); background: color-mix(in srgb, #f59e0b 13%, var(--card)); border-radius: 12px; padding: .6rem .9rem; margin: 0 0 1rem; }
.ml-streifen .ml-sym { font-size: 1.3rem; line-height: 1; }
.ml-streifen .ml-t { flex: 1 1 20rem; }
.ml-streifen .ml-t b { display: block; }
.ml-hinweis a, .alert .ml-link { white-space: nowrap; }
.ku-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: .6rem 0 .3rem; }
.ku-seg label { margin: 0; padding: .45rem .8rem; font-weight: 600; cursor: pointer; display: flex; gap: .35rem; align-items: center; }
.ku-seg label.an { background: var(--primary); color: #fff; }
.ku-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ku-seg label:focus-within { outline: 2px solid var(--primary); outline-offset: -2px; }
.ku-seg-hint { margin: 0 0 .4rem; }
.ku-wl-karte .tg-kopf { flex-wrap: wrap; }
.ku-wl-pos { display: inline-flex; gap: .2rem; }
.ku-wl-pos .btn { min-width: 2.1rem; padding-left: .4rem; padding-right: .4rem; }
@media (min-width: 901px) {
    .nw-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); }
}
@media (max-width: 900px) {
    .nw-grid { grid-template-columns: minmax(0, 1fr); }
}
.table-wrap.nw-arten-wrap { overflow-x: auto; }
.nw-arten td.num, .nw-arten th.num { white-space: nowrap; }
@media (max-width: 699px) {
    .vm-grid > *, .vm-grid > div > * { min-width: 0; }   /* Gruppenliste u. a.: Karten nie breiter als der Bildschirm */
    .ml-streifen .btn { flex: 1 1 100%; }
    .ku-seg { display: flex; }
    .ku-seg label { flex: 1; justify-content: center; min-height: 44px; }
    .ku-wl-pos .btn { min-height: 40px; }
}

/* ===== 4.38: Trainerabrechnung für Kurse (Summe oben, Aufteilung, Kursstunden, Kurssatz) ===== */
.ta-kopf, .kz-kopf { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: .5rem; }
.ta-kopf h2, .kz-kopf h2 { margin: 0; }
.ta-aus { display: flex; gap: .4rem; flex-wrap: wrap; }
.list tr.ta-summe td { background: color-mix(in srgb, var(--primary) 10%, var(--card)); font-weight: 700; border-bottom: 2px solid var(--primary); }
.list.ta-tab td.num { white-space: nowrap; }
.ta-tog { background: none; border: 0; padding: .1rem 0; min-height: 0; color: var(--primary); cursor: pointer; font-size: .85rem; }
.ta-tog::before { content: '▸ '; } .ta-tog[aria-expanded="true"]::before { content: '▾ '; }
.list tr[hidden] { display: none; }
.list tr.ta-auf-zeile > td { padding-top: 0; padding-left: 3.2rem; background: color-mix(in srgb, var(--primary) 3%, var(--card)); }
.ta-auf-zeile .ta-det { max-width: 60rem; }
.ta-det { margin: .35rem 0 .2rem; width: 100%; border-collapse: collapse; font-size: .86rem; }
.ta-det th, .ta-det td { padding: .2rem .45rem; border-bottom: 1px solid var(--border); text-align: left; font-weight: normal; background: none; }
.ta-det th { color: var(--muted); font-size: .78rem; }
.ta-det td.num, .ta-det th.num { text-align: right; white-space: nowrap; }
.ta-det-m { display: none; }
.ta-det-m > div { padding: .3rem 0; border-bottom: 1px solid var(--border); text-align: left; font-size: .85rem; }
.ta-einzeln { margin-top: .3rem; font-size: .85rem; }
.ta-kz { display: inline-block; font-size: .72rem; font-weight: 700; padding: 0 .4rem; border-radius: 5px; margin-right: .3rem; white-space: nowrap; }
.ta-kz.training { background: color-mix(in srgb, #2563eb 18%, transparent); color: #1d4ed8; }
.ta-kz.kurs { background: color-mix(in srgb, #16a34a 20%, transparent); color: #15803d; }
.ta-kz.einsatz { background: color-mix(in srgb, #9333ea 18%, transparent); color: #7e22ce; }
@media (prefers-color-scheme: dark) { .ta-kz.training { color: #93c5fd; } .ta-kz.kurs { color: #86efac; } .ta-kz.einsatz { color: #d8b4fe; } }
.kz-tab td { vertical-align: top; }
.kz-p { display: flex; gap: .4rem; align-items: center; margin: .15rem 0; flex-wrap: wrap; }
.kz-p .nm { min-width: 18rem; }
.kz-p .kz-ein { display: inline-flex; gap: .35rem; align-items: center; white-space: nowrap; }
.kz-p input { width: 5.2rem; min-height: 34px; margin: 0; text-align: right; }
.kz-p select { width: auto; max-width: 100%; min-height: 34px; margin: 0; }
.kz-vorschlag { opacity: .65; }
.kz-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 .3rem; min-height: 0; }
.kz-add summary { color: var(--primary); cursor: pointer; font-size: .88rem; padding: .2rem 0; }
.kz-warn { color: var(--err-text); }
.list.kz-tab tr.kz-aus td { opacity: .6; }
.list.kz-tab tr.kz-zukunft td { opacity: .8; }
@media (min-width: 700px) { .vg-grid { grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); } .vg-grid .fz-betrag { width: 5.4rem !important; } .vg-grid input[type=date] { width: 9.4rem; } .vg-grid td input[name=bemerkung] { min-width: 6rem; } }
td.vg-kurs, th.vg-kurs { background: color-mix(in srgb, #16a34a 7%, transparent); }
@media (max-width: 699px) {
    .ta-aus { width: 100%; } .ta-aus .btn { flex: 1; }
    .list.ta-tab tr.ta-summe td { border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
    .list tr.ta-auf-zeile > td { display: block; padding: .3rem 0; text-align: left; }
    .list tr.ta-auf-zeile > td::before { content: none; }
    .list table.ta-det { display: none; }
    .ta-det-m { display: block; width: 100%; }
    .list.kz-tab td.kz-zelle { display: block; text-align: left; }
    .list.kz-tab td.kz-zelle::before { display: block; float: none; margin-bottom: .3rem; }
    .list.kz-tab .kz-p { flex-wrap: nowrap; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 10px; margin: .3rem 0; }
    .list.kz-tab .kz-p .nm { flex: 1 1 auto; min-width: 0; }
    .list.kz-tab .kz-add .kz-p { flex-wrap: wrap; } .list.kz-tab .kz-add select { width: 100%; }
    .ku-tl .kz-p .nm { min-width: 0; flex: 1 1 100%; }
}
@media (max-width: 699px) {
    .vg-grid { grid-template-columns: minmax(0, 1fr); }
    .vg-grid > * { min-width: 0; }
    .list td.vg-modus { white-space: normal; flex-wrap: wrap; justify-content: flex-end; }
    .list td.vg-modus select, .list td.vg-modus input { max-width: 100%; }
    .ta-aus .btn { white-space: nowrap; padding-left: .4rem; padding-right: .4rem; }
}

/* ---------- 4.39: Kursnummer, Kurs kopieren, Hinweisstreifen schließen ---------- */
.ku-nr { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; font-weight: 700; padding: .05rem .45rem; border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); white-space: nowrap; vertical-align: middle; }
.ku-nr.ku-nr-h1 { font-size: 1rem; vertical-align: .2em; }
.ku-ro { background: color-mix(in srgb, var(--muted) 8%, var(--card)); color: var(--muted); }
td.ku-nr-td { white-space: nowrap; }
td.ku-kop { text-align: right; white-space: nowrap; }
.ml-x-form { margin: 0 0 0 auto; display: inline; }
.ml-streifen .ml-x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: .25rem .45rem; border-radius: 8px; min-height: 0; width: auto; }
.ml-streifen .ml-x:hover { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--text); }
.kp-modus { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .2rem 0 .5rem; }
.kp-modus label.check { margin: 0; }
.kp-termine { border: 1px solid var(--border); border-radius: 10px; padding: .2rem .8rem .5rem; margin: .8rem 0; }
.kp-termine h3 { margin-top: .5rem; }
.kp-opt { display: grid; gap: 0; margin: .3rem 0 .6rem; }
.kp-opt label.check { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .2rem; border-bottom: 1px solid var(--border); margin: 0; }
.kp-opt label.check:last-child { border-bottom: 0; }
.kp-opt label.check .small { display: block; font-weight: 400; }
.kp-opt label.check.aus { opacity: .5; }
.kp-fix { margin: .2rem 0 .8rem; padding-left: 1.1rem; } .kp-fix li { margin: .15rem 0; }
.kp-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; justify-content: flex-start; }
.kp-zeile label.kp-an { margin: 0; min-width: 2.8rem; }
.kp-zeile input[type=date] { width: 9.6rem; min-height: 34px; padding: 0 .4rem; margin: 0; }
.kp-zeile input[type=time] { width: 7rem; min-height: 34px; padding: 0 .4rem; margin: 0; }
.kp-zeile .kp-zeit { white-space: nowrap; }
.kp-zeile .kp-info { flex: 1 1 auto; text-align: right; }
.kp-zeile.kp-aus > :not(.kp-an):not(.kp-info) { opacity: .45; }
.kp-zeile.kp-aus .kp-an b { opacity: .45; }
@media (max-width: 699px) {
    .ml-streifen { position: relative; padding-right: 2.6rem; }
    .ml-streifen .ml-x-form { position: absolute; top: .3rem; right: .3rem; }
    .ml-streifen .ml-x { min-height: 40px; min-width: 40px; }
    .kp-zeile input[type=date] { width: 9rem; }
    .kp-zeile input[type=time] { width: 5.6rem; }
    .kp-zeile .kp-info { flex: 1 1 100%; text-align: left; }
    td.ku-kop { text-align: right; }
}

/* ---------- 4.40: Rundung der Stunden (Stundensätze) und gerundete Kursstunden ---------- */
.rd-card { margin-bottom: 1rem; }
.rd-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rd-zeile { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.rd-zeile h3 { margin: 0 0 .4rem; font-size: 1rem; }
.rd-zeile select { width: 100%; max-width: 22rem; margin: 0; }
.rd-bsp { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.rd-bsp span { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, transparent); white-space: nowrap; }
.kz-rd { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.kz-rd b { color: var(--text); }
.kz-rdkopf { margin: -.2rem 0 .5rem; }
@media (max-width: 699px) {
    .rd-box { grid-template-columns: 1fr; }
    .rd-zeile select { max-width: none; }
    .list.kz-tab .kz-p { flex-wrap: wrap; }
    .list.kz-tab .kz-p .nm { flex: 1 1 100%; }
}

/* ---------- 4.41: Trainerabrechnung weitere Stunden, Reiter Kurse, Trainer bezahlen im Kurs ---------- */
.ta-kz.weitere { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #b45309; }
.list th.ta-wsp, .list td.ta-wsp { background: color-mix(in srgb, #f59e0b 8%, transparent); }
.ta-wz { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; min-width: 5.6rem; }
.ta-wz input { margin: 0; min-height: 32px; padding: .2rem .4rem; }
.ta-wz .ta-w-std { width: 4.8rem; text-align: right; }
.ta-wz .ta-w-grund { width: 7.5rem; font-size: .78rem; min-height: 28px; }
.ta-w-satz { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.ta-w-satz.ta-w-ohne { color: var(--err-text); }
.ta-wz.ta-w-laeuft { opacity: .5; }
.ta-wz.ta-w-err input { border-color: var(--err-text); }
.ta-plus { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .7rem 0 0; }
.ta-plus select { width: auto; max-width: 100%; margin: 0; min-height: 36px; }
.ta-bar { display: inline-flex; width: 7rem; height: .55rem; border-radius: 999px; background: var(--border); overflow: hidden; vertical-align: middle; }
.ta-bar i { display: block; flex: none; height: 100%; background: var(--ok-text); }
.ta-bar i.t { background: #2563eb; }
.kz-bz-box { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; padding: .6rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--primary) 7%, var(--card)); margin: 0 0 .8rem; font-size: .9rem; }
.kz-bz-box .ta-bar { width: 10rem; }
.kz-st { margin: .1rem 0; }
.kz-st a.vm-pill { text-decoration: none; }
.kz-kopf .btn { margin-left: auto; }
.kz-bz-bg { background: color-mix(in srgb, #000 30%, var(--bg)); border-radius: 12px; padding: 1.2rem .8rem; margin-bottom: 1rem; }
.kz-bz { max-width: 800px; margin: 0 auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.kz-bz-x { font-size: 1.2rem; text-decoration: none; color: var(--muted); margin-left: auto; }
.kz-bz label { display: block; }
.kz-bz label.vm-inline { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0; }
.kz-bz label.vm-inline input[type=date] { width: 10rem; margin: 0; }
.kz-bz label.vm-inline select { width: auto; margin: 0; }
.kz-bz-aus td { opacity: .6; }
.kz-bz-f { display: flex; flex-direction: column; gap: .3rem; margin: .7rem 0; }
.kz-bz-sum { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; border-radius: 10px; background: color-mix(in srgb, var(--primary) 8%, var(--card)); margin: .6rem 0; }
.kz-bz-sum b { font-size: 1.1rem; }
.kz-bz-los { background: #16a34a; border-color: #16a34a; }
@media (prefers-color-scheme: dark) {
    .ta-kz.weitere { color: #fbbf24; }
    .ta-bar i.t { background: #60a5fa; }
}
@media (max-width: 699px) {
    .ta-wz { align-items: stretch; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
    .ta-wz .ta-w-std { width: 5.5rem; }
    .ta-wz .ta-w-grund { width: 100%; }
    .list th.ta-wsp, .list td.ta-wsp { background: none; }
    .kz-bz-bg { padding: .5rem .2rem; }
    .kz-bz-sum { flex-wrap: wrap; }
    .kz-kopf .btn { margin-left: 0; }
}
