/* 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: 960px; 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 ---- */
.kb-tabs a { font-size: .95rem; padding: 0 .3rem; }
@media (max-width: 480px) { .kb-tabs { gap: .25rem; } .kb-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) { .kb-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) { .kb-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: .25rem auto .35rem; 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; }

/* Hinweis in der Stammerfassung: ein anderer Benutzer hat erfasst */
.stamm-neu { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin: .5rem 0; padding: .6rem .8rem; border: 1px solid var(--primary); border-radius: 10px; background: var(--card); }

/* Überschrift „Stamm … ändern“ fett */
#stamm .s-kopf h2 { font-weight: 800; }

/* Statusleiste in der Stammerfassung (anderer Benutzer hat erfasst) */
.stamm-status { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .6rem; padding: .65rem 1rem; margin: 0 0 .6rem; border-radius: 10px; background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; font-weight: 600; transition: opacity .35s; }
.stamm-status::before { content: 'ⓘ'; }
.stamm-status.weg { opacity: 0; }
@media (prefers-color-scheme: dark) { .stamm-status { background: #0c4a6e; color: #e0f2fe; border-color: #0369a1; } }

/* Favoriten bei Baumarten */
.stern { background: none; border: 0; padding: 0 .3rem; font-size: 1.25rem; line-height: 1; color: #9ca3af; cursor: pointer; }
.stern.an { color: #f59e0b; }
span.stern { cursor: default; }

/* Stammliste: Erfassungszeit */
.bde-tab td.zeit { white-space: nowrap; color: var(--muted); font-size: .9rem; }
.k-zeit { display: block; flex-basis: 100%; color: var(--muted); font-size: .72rem; font-weight: 400; }

.form-card.sio-breit { max-width: 1100px; width: 100%; }
.sio-nr { border: 1px solid var(--border); border-radius: 8px; margin: .6rem 0; padding: .4rem .8rem; }
.sio-warn td { background: rgba(245, 158, 11, .14); }
.sio-fehler td { background: rgba(220, 38, 38, .13); }
.sio-skip td { opacity: .55; }
#sio-tab td { vertical-align: top; }
#sio-tab td:last-child { min-width: 14rem; }
.lese-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.lese-fs[disabled] input, .lese-fs[disabled] select, .lese-fs[disabled] textarea { opacity: 1; color: inherit; background: var(--card); }
a.ad-sicht { color: inherit; text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 2px; }
.re-blatt { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 .8rem; }
.re-blatt .re-pos { padding: 0 .5rem; }
.re-blatt .re-ueb { margin-left: auto; }
.re-blatt .disabled { opacity: .45; pointer-events: none; }
@media (max-width: 640px) { .re-blatt { position: sticky; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--border); padding: .5rem; margin: 0 -1rem; } .re-blatt .re-ueb { display: none; } }
.au-r.au-num label { text-align: right; }
.au-r.au-num input { text-align: right; }

/* ---------- Stämme erfassen: Update (Abstände, Chips, Kamera, Abbrechen) ---------- */
main.container:has(#stamm) { padding-top: .45rem; }
#stamm .stamm-grid .g-z label, #stamm .stamm-grid .z label { margin-bottom: .35rem; line-height: 1.1; }
#stamm .stamm-grid .zwei-chk { flex-wrap: nowrap !important; gap: .25rem !important; }
#stamm .stamm-grid .zwei-chk .check-zeile { font-size: .8rem; padding: .25rem .4rem; gap: .2rem; white-space: nowrap; }
#stamm .stamm-grid .zwei-chk input[type=checkbox] { width: .9rem; height: .9rem; }
@media (min-width: 700px) { #stamm .stamm-grid .zwei-chk { gap: .6rem !important; } #stamm .stamm-grid .zwei-chk .check-zeile { font-size: .95rem; padding: .3rem .6rem; } }
#stamm .kam-knopf { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3rem; border: 1.5px solid var(--primary); color: var(--primary); background: transparent; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; margin: .2rem 0; }
#stamm .aktionen-save { flex-wrap: wrap; }
#stamm .aktionen-save .btn-secondary { margin: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
#stamm .aktionen:not(.aktionen-save) { justify-content: flex-start; }
#stamm .aktionen .zus-link { margin-left: 0; }

/* ---------- Gelöschte Stämme (durchgestrichen), Löschen-Knopf, dunkle Auswahllisten ---------- */
.bde-tab tr.gel td, .stamm-karten li.gel { opacity: .55; }
.bde-tab tr.gel td:not(.aktion-spalte):not(.mc), .stamm-karten li.gel .k-nr, .stamm-karten li.gel .k-z1, .stamm-karten li.gel .k-z2, .stamm-karten li.gel .kp { text-decoration: line-through; }
.bde-tab tr.gel td.aktion-spalte, .stamm-karten li.gel .k-ak { opacity: 1; }
.icon-btn.wieder { color: #16a34a; font-weight: 700; }
.gel-info { color: #b42318; font-size: .8rem; margin: .25rem 0 0; text-align: right; }
@media (prefers-color-scheme: dark) { .gel-info { color: #f87171; } .icon-btn.wieder { color: #4ade80; } }
#stamm .aktionen-save .btn-del { background: transparent; color: #b42318; border: 1.5px solid #b42318; }
@media (prefers-color-scheme: dark) { #stamm .aktionen-save .btn-del { color: #f87171; border-color: #f87171; } }
#stamm .aktionen-save { flex-wrap: nowrap; gap: .4rem; }
#stamm .aktionen-save .btn { min-width: 0 !important; flex: 1 1 0; padding-left: .4rem !important; padding-right: .4rem !important; font-size: 1rem; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
    select { color-scheme: dark; }
    select option { background: #1e293b; color: #e2e8f0; }
    select option:checked { background: #2563eb; color: #fff; }
}

td.up-info { font-size: .9rem; min-width: 14rem; max-width: 34rem; }

/* Rechnung: Kopf in Karten, Zahlenspalten rechtsbündig */
.re-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; margin: 0 0 .8rem; }
.re-card h4 { margin: 0 0 .6rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.re-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1rem; }
.re-g > div { min-width: 0; }
.re-g label { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 .2rem; }
.re-g input, .re-g select, .re-g .muted { width: 100%; min-height: 38px; box-sizing: border-box; }
.re-g .muted { display: flex; align-items: center; }
.re-g .re-s2 { grid-column: span 2; }
@media (max-width: 720px) { .re-g { grid-template-columns: 1fr 1fr; } .re-g .re-s2 { grid-column: span 2; } }
.re-ro .re-g input, .re-ro .re-g select { border-color: transparent; background: transparent; padding-left: 0; font-weight: 600; -webkit-appearance: none; appearance: none; opacity: 1; color: inherit; }
.re-ro .re-g .muted { padding-left: 0; font-weight: 600; color: inherit; }
.re-pos { table-layout: fixed; width: 100%; }
.re-pos .c-nr { width: 2.4rem; } .re-pos .c-n { width: 6.5rem; } .re-pos .c-e { width: 4.5rem; } .re-pos .c-p { width: 7.5rem; }
.re-pos .c-r { width: 5.5rem; } .re-pos .c-s { width: 12rem; } .re-pos .c-n2 { width: 8rem; } .re-pos .c-d { width: 5rem; }
.re-pos input, .re-pos select { width: 100%; box-sizing: border-box; }
.re-pos input.re-n { text-align: right; }
.re-pos th.r, .re-pos td.r { text-align: right; }
.re-ro .re-pos input, .re-ro .re-pos select { border-color: transparent; background: transparent; -webkit-appearance: none; appearance: none; color: inherit; opacity: 1; }
@media (max-width: 720px) { .re-pos { table-layout: auto; } }
.tag-ok { color: #16a34a; font-weight: 600; }

/* Firma: Kopfzeilenfarbe */
.kf-zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .3rem 0; }
.kf-sw { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.kf-sw.on { border-color: var(--text); }
.kf-zeile input[type=color] { width: 44px; height: 32px; padding: 0; border: 0; background: none; }
.kf-vorschau { border-radius: 8px; padding: .6rem .9rem; font-weight: 700; margin: .4rem 0; }

/* Offline-Hinweis beim Stammerfassen */
.offline-bar { position: sticky; top: 0; z-index: 60; background: #b91c1c; color: #fff; padding: .55rem .9rem; font-weight: 600; text-align: center; }
.offline-bar.ok { background: #166534; }
.offline-grau { opacity: .45; }

/* Benutzer-Kurzansicht */
.bi-card { display: flex; gap: 1rem; align-items: flex-start; }
.bi-dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.bi-dl dt { color: var(--muted); } .bi-dl dd { margin: 0; font-weight: 600; }
.re-g input, .re-g select { margin: 0; font: inherit; height: 38px; padding: 0 .6rem; line-height: 1.2; }
.re-g .muted { font: inherit; }
.re-ro .re-g input, .re-ro .re-g select { padding-left: 0; }
.re-pos input, .re-pos select { padding: .4rem .5rem; font: inherit; }
.re-pos .c-e { width: 5.2rem; }

/* Rechnungsübersicht */
.re-liste { width: 100%; }
.re-liste th.r, .re-liste td.r { text-align: right; white-space: nowrap; }
.re-liste td:nth-child(1), .re-liste td:nth-child(2), .re-liste td:nth-child(5) { white-space: nowrap; }
.re-liste td.actions { white-space: nowrap; text-align: right; }
.re-st { display: inline-block; border-radius: 99px; padding: 1px 10px; font-size: .85rem; font-weight: 600; background: #1e3a8a; color: #bfdbfe; }
.re-st-entwurf { background: #374151; color: #e5e7eb; } .re-st-versendet { background: #78350f; color: #fde68a; }
.re-st-bezahlt { background: #14532d; color: #bbf7d0; } .re-st-storniert { background: #7f1d1d; color: #fecaca; }
.re-liste { font-size: .93rem; }
.re-liste th, .re-liste td { padding: .55rem .5rem; }
.re-liste th { white-space: nowrap; }

/* ---------- Neue PC-Breite: Kopfzeile, Listen und Dialoge bis 1800 px (ab 1200 px Fensterbreite) ---------- */
@media (min-width: 1200px) {
    .container { max-width: 1800px; padding: 0 1.25rem; }
    .form-card { max-width: 440px; }
    .form-card.wide { max-width: 640px; }
    .form-card.wide.breit.weit { max-width: 100%; }
    .site-header .header-inner { gap: 1.2rem; flex-wrap: nowrap; }
    .site-header .brand { flex: 0 0 auto; }
    .site-header .nav { flex: 1 1 auto; }
}

/* Sofort-Filter */
.fb { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin: 0 0 .8rem; }
.fb > div { display: flex; flex-direction: column; min-width: 0; }
.fb label { font-size: .78rem; color: var(--muted); margin: 0 0 .2rem; }
.fb input, .fb select { height: 38px; box-sizing: border-box; margin: 0; }
.fb .fb-suche { flex: 1 1 16rem; }
.fb .fb-suche input { width: 100%; }
.fb input.fb-aktiv, .fb select.fb-aktiv { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.fb [data-fb-reset] { align-self: flex-end; }
.fb [hidden] { display: none !important; }
.kz { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0 0 .8rem; }
.kz > div { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .9rem; }
.kz span { display: block; font-size: .75rem; color: var(--muted); }
.kz b { font-size: 1.15rem; }

/* Adress-Dialog: Karten im breiten Raster (ab 1200 px), darunter wie bisher einspaltig */
.ad-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.ad-pn { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .2rem .9rem .9rem; min-width: 0; }
.ad-pn h4:first-child { margin-top: .7rem; }
.ad-dlg .bt { position: sticky; bottom: -1.1rem; background: var(--card); padding: .8rem 0 .2rem; margin-top: 1rem; border-top: 1px solid var(--border); z-index: 2; }
@media (min-width: 1200px) {
    #dlg-adresse { width: min(1700px, calc(100% - 3rem)); }
    .ad-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .ad-grid .ad-s4 { grid-column: span 4; }
    .ad-grid .ad-s3 { grid-column: span 3; }
}
@media (min-width: 700px) and (max-width: 1199px) {
    .ad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fb .fb-suche { flex: 0 1 30rem; }

/* Dialoge Ansprechpartner und Rechnungs-/Lieferadresse in der neuen Breite */
@media (min-width: 1200px) {
    #dlg-partner { width: min(1000px, calc(100% - 3rem)); }
    #dlg-liefer { width: min(1500px, calc(100% - 3rem)); }
    #dlg-partner .ad-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .ad-grid .ad-s6 { grid-column: span 6; }
}
@media (min-width: 700px) and (max-width: 1199px) {
    #dlg-partner { width: min(760px, calc(100% - 1rem)); }
    #dlg-partner .ad-s6 { grid-column: auto; }
}

/* Symbolknöpfe (Bearbeiten, Kopieren, Aktivieren, Ansehen, Löschen) */
.ib-conv { display: inline-flex !important; align-items: center; justify-content: center; width: 38px !important; min-width: 38px; height: 38px; padding: 0 !important; flex: 0 0 38px !important; border-radius: 10px !important; margin-left: .25rem; background: var(--card) !important; border: 1px solid var(--border) !important; color: var(--primary) !important; line-height: 1; text-decoration: none; cursor: pointer; }
.ib-conv:hover { background: var(--bg) !important; }
.ib-conv svg { width: 20px; height: 20px; display: block; pointer-events: none; }
.ib-conv.ib-del { color: var(--danger, #b91c1c) !important; border-color: rgba(185,28,28,.45) !important; }
.ib-conv.ib-on { color: #16a34a !important; border-color: rgba(22,163,74,.5) !important; }
.ib-conv.ib-off { color: var(--muted) !important; }
.rb-dlg .bt .ib-conv { flex: 0 0 38px !important; }

/* Preisliste: Kopf in 2 Karten, Preistabelle volle Breite, Leiste unten klebend */
.pl-kopf { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.pl-kopf .ad-pn { padding-top: .9rem; }
@media (min-width: 1000px) { .pl-kopf { grid-template-columns: 3fr 2fr; align-items: start; } }
.au-form .btn-stack { position: sticky; bottom: 0; background: var(--bg-card, #fff); padding: .6rem 0; border-top: 1px solid var(--border); z-index: 5; }
@media (min-width: 1000px) { .au-form .btn-stack { flex-direction: row-reverse; justify-content: flex-start; } .au-form .btn-stack .btn.btn-block { width: auto; min-width: 11rem; } }

/* Aushaltung: breite Anordnung */
.au-grid3 { display: grid; grid-template-columns: 1fr; gap: .8rem; }
.au-grid3 .ad-pn { padding-top: .9rem; }
.au-grid3 h4 { margin: .2rem 0 .7rem; }
@media (min-width: 1200px) { .au-grid3 { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; } }
.au-masse { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: .4rem 2rem; }
.au-masse > h2, .au-masse > .check { grid-column: 1 / -1; }
@media (min-width: 1200px) { .au-masse > .check { grid-column: auto; } }

/* Listen in den Datenbank-Reitern nutzen die volle Breite */
@media (min-width: 1200px) { .rb { max-width: none; } }

/* Spracheingabe Länge / Durchmesser */
.sp-btn { flex: none; margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #2563eb; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.sp-btn[hidden], .sp-msg[hidden] { display: none; }
.sp-btn.sp-an { background: #dc2626; box-shadow: 0 0 0 6px #fecaca; }
.sp-msg { margin: .5rem 0 0; padding: .5rem .75rem; border-radius: 8px; background: #1e3a8a; color: #fff; font-weight: 600; grid-column: 1 / -1; }
.sp-msg.sp-fehler { background: #b91c1c; }
.sp-dauer { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; color: var(--muted, #475569); margin: 0 .3rem 0 auto; cursor: pointer; white-space: nowrap; }
.sp-dauer[hidden] { display: none; }
.sp-dauer input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 36px !important; height: 20px !important; min-height: 0; padding: 0 !important; border: 0 !important; border-radius: 10px; background: #cbd5e1; position: relative; margin: 0; cursor: pointer; transition: background .15s; box-shadow: none; }
.sp-dauer input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.sp-dauer input[type=checkbox]:checked { background: #2563eb; }
.sp-dauer input[type=checkbox]:checked::after { left: 18px; }

/* Dauer-Schalter + Mikrofon in der Kopfzeile (Taste so hoch wie das Fm-Feld) */
.sp-gruppe { display: inline-flex; align-items: center; gap: .5rem; margin: 0 auto; }
.sp-gruppe .sp-dauer { margin: 0; }
.sp-gruppe .sp-btn { width: 2.6rem; height: 2.6rem; font-size: 1.35rem; margin: 0; padding: 0; line-height: 1; }
.sp-gruppe .sp-btn.sp-an { box-shadow: 0 0 0 3px #fecaca; }
