/* ==========================================================================
   Obsthof – Grundgestaltung
   Hellgrauer Hintergrund, weiße Karten (12 px Radius), Grün als Primärfarbe.
   Mobile first: Seitenleiste ab 960 px fest, darunter einklappbar.
   ========================================================================== */

/* Montserrat lokal (SIL Open Font License, siehe assets/fonts/OFL.txt) */
@font-face {
    font-family: "Montserrat";
    src: local("Montserrat"), url("../fonts/Montserrat-Variable.ttf") format("truetype");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f4f5f4;
    --card: #ffffff;
    --surface: #ffffff;
    --surface-2: #fafbfa;
    --hover: #f0f2f1;
    --side-bg: var(--card);
    --side-text: var(--text);
    --side-muted: var(--muted);
    --side-hover: var(--hover);
    --side-active-bg: var(--primary-soft);
    --side-active-text: var(--primary-dark);
    --text: #1f2a24;
    --muted: #6b7570;
    --line: #e3e6e4;
    --line-strong: #cfd4d1;
    --primary: #2f8f4e;
    --primary-dark: #247040;
    --primary-soft: #e6f3ea;
    --danger: #c0392b;
    --danger-soft: #fbeae8;
    --warning: #c98a12;
    --warning-soft: #fdf3dc;
    --info: #2a6f97;
    --info-soft: #e5f0f7;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 2px 8px rgba(20, 40, 30, .05);
    --shadow-lg: 0 10px 40px rgba(20, 40, 30, .18);
    --sidebar-w: 264px;
    --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --kpi-1: #2f8f4e;
    --kpi-2: #e0a526;
    --kpi-3: #2a6f97;
    --kpi-4: #8e44ad;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.6rem; }
.h2 { font-size: 1.35rem; }
.h3 { font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.h4 { font-size: .95rem; margin-top: 1.25rem; display: flex; align-items: center; gap: .4rem; }
p { margin: 0 0 .75em; }
code { font-size: .9em; background: var(--hover); padding: .1em .35em; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: .85em; }
.grow { flex: 1 1 auto; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
.icon-xl { width: 40px; height: 40px; }

/* --------------------------------------------------------------------------
   Layout: Seitenleiste + Inhalt
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: .75rem;
    height: 56px; padding: 0 12px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: var(--sidebar-w); max-width: 86vw;
    display: flex; flex-direction: column;
    background: var(--side-bg); color: var(--side-text);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform .22s ease;
}
body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(20, 30, 25, .35);
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

.sidebar-head { display: flex; align-items: center; gap: .5rem; padding: 14px 14px 10px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--side-text); flex: 1; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary); color: #fff;
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .72rem; color: var(--side-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }

.quick-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 10px; }
.quick-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 68px; padding: 8px 6px; border-radius: var(--radius-sm);
    background: var(--primary); color: #fff; font-weight: 600; font-size: .8rem; text-align: center;
}
.quick-tile .icon { width: 22px; height: 22px; }
.quick-tile:hover { background: var(--primary-dark); text-decoration: none; }
.quick-tile.is-active { outline: 3px solid color-mix(in srgb, var(--primary) 40%, #fff); }

.nav-group { margin-top: 12px; }
.nav-group-title {
    padding: 0 10px 4px;
    font-size: .72rem; font-weight: 700; letter-spacing: .06em;
    font-variant: small-caps; text-transform: lowercase;
    color: var(--muted);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group form { margin: 0; }
.nav-link {
    display: flex; align-items: center; gap: .65rem; width: 100%;
    padding: 7px 10px; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--side-text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
}
.nav-link .icon { color: var(--side-muted); }
.nav-link:hover { background: var(--side-hover); text-decoration: none; }
.nav-link.is-active { background: var(--side-active-bg); color: var(--side-active-text); font-weight: 600; }
.nav-link.is-active .icon { color: var(--side-active-text); }
.nav-soon { margin-left: auto; color: var(--line-strong); font-size: 1.2rem; line-height: 1; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px 12px 14px; }
.flags { display: flex; gap: 6px; margin: 0 0 10px; }
.flags-center { justify-content: center; margin-top: 18px; }
.flag {
    padding: 2px; border: 2px solid transparent; border-radius: 6px;
    background: none; cursor: pointer; line-height: 0; opacity: .6;
}
.flag img { border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.flag:hover { opacity: 1; }
.flag.is-active { border-color: var(--primary); opacity: 1; }
.flag-inline { vertical-align: -2px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

.user-chip { display: flex; align-items: center; gap: .6rem; color: var(--side-text); padding: 4px; border-radius: var(--radius-sm); flex: 1; min-width: 0; }
.user-chip:hover { background: var(--side-hover); text-decoration: none; }
.user-chip-text { display: flex; flex-direction: column; min-width: 0; }
.user-chip-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: .75rem; color: var(--side-muted); }

.avatar {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700; font-size: .82rem;
}
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
a.avatar:hover { text-decoration: none; }

.main { padding: 16px 14px 48px; max-width: 1400px; }

@media (min-width: 960px) {
    .topbar { display: none; }
    .sidebar { transform: none; box-shadow: none; }
    .sidebar .sidebar-close, .sidebar-backdrop { display: none; }
    .main { margin-left: var(--sidebar-w); padding: 28px 32px 56px; }
}

/* --------------------------------------------------------------------------
   Seitenkopf, Karten, Raster
   -------------------------------------------------------------------------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin-bottom: .15em; }
.page-head p { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.info-card { background: var(--surface-2); }

.grid-2, .grid-3 { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.grid-zip { display: grid; grid-template-columns: 110px 1fr; gap: 0 12px; }
.grid-dash { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-dash > .card { margin-bottom: 0; }
@media (min-width: 720px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
    .grid-dash { grid-template-columns: 2fr 1fr; }
}

/* KPI-Karten mit farbiger linker Kante */
.kpi-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
@media (min-width: 600px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px 18px; border-left: 5px solid var(--kpi-1);
}
.kpi-2 { border-left-color: var(--kpi-2); }
.kpi-3 { border-left-color: var(--kpi-3); }
.kpi-4 { border-left-color: var(--kpi-4); }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 4px 0; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: .78rem; color: var(--muted); }
.kpi.is-pending .kpi-value { color: var(--line-strong); }

.tile-big {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    text-align: center; color: var(--text); min-height: 180px;
}
.tile-big .icon { color: var(--primary); }
.tile-big:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.tile-big-title { font-size: 1.2rem; font-weight: 700; }

.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.list-rows li:first-child { border-top: 0; }

.empty { padding: 26px 10px; text-align: center; color: var(--muted); }

.placeholder { text-align: center; padding: 42px 20px; }
.placeholder-icon {
    display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary); margin-bottom: 14px;
}
.placeholder .h3, .placeholder h1 { justify-content: center; }
.placeholder p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Schaltflächen, Chips, Badges
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 40px; padding: 8px 16px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a33024; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-danger-text { color: var(--danger); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: 6px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
    font-size: .85rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-sm { padding: 2px 10px; font-size: .75rem; cursor: default; }

.badge {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    background: var(--hover); color: var(--muted); font-size: .74rem; font-weight: 600; white-space: nowrap;
    vertical-align: 1px;
}
.badge-green { background: var(--primary-soft); color: var(--primary-dark); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-yellow { background: var(--warning-soft); color: #8a5d00; }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-grey { background: var(--hover); color: #7c8580; }
.badge-role-admin { background: var(--primary-soft); color: var(--primary-dark); }
.badge-role-mitarbeiter { background: var(--info-soft); color: var(--info); }
.badge-role-terminal { background: var(--warning-soft); color: #8a5d00; }

/* --------------------------------------------------------------------------
   Reiter
   -------------------------------------------------------------------------- */

/* Reiter (Layout-Runde 30.10.2026): eine Optik für alle Seiten, umbrechen statt Schiebebalken */
.tabs {
    display: flex; flex-wrap: wrap; gap: 2px 4px; margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.tab {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0;
    background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .88rem; white-space: nowrap; cursor: pointer;
}
.tab .icon { width: 16px; height: 16px; }
.tab:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.tab.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-danger.is-active { color: var(--danger); border-bottom-color: var(--danger); }

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */

.form .h3:first-child, .form h2:first-of-type { margin-top: 0; }
.form-narrow { max-width: 620px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; font-size: .84rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=search], input[type=time], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* 16px verhindert Zoom auf iOS */
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 143, 78, .18); }
input:disabled, select:disabled { background: var(--hover); color: var(--muted); }
.input-short { max-width: 110px; }
.input-mid { max-width: 260px; }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field-error { font-size: .8rem; color: var(--danger); margin-top: 4px; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }

.check { display: flex; align-items: center; gap: .55rem; margin: 6px 0; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

.rule-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0; }
.rule-row label, .rule-row span { font-weight: 500; }
.rule-row input { width: 90px; }
.rule-arrow { color: var(--muted); }

/* --------------------------------------------------------------------------
   Tabellen
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    padding: 11px 14px; text-align: left; white-space: nowrap;
    font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
    background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-inactive td { color: var(--muted); }
.row-actions { display: inline-flex; gap: 4px; align-items: center; }
.row-actions form { margin: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; }

@media (max-width: 719px) {
    .hide-sm { display: none !important; }
}

/* --------------------------------------------------------------------------
   Modale Dialoge (<dialog>)
   -------------------------------------------------------------------------- */

.modal {
    width: min(720px, calc(100vw - 20px)); max-height: calc(100vh - 20px);
    padding: 0; border: 0; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); color: var(--text);
}
.modal-sm { width: min(460px, calc(100vw - 20px)); }
.modal::backdrop { background: rgba(20, 30, 25, .45); }
.modal-box { display: flex; flex-direction: column; max-height: calc(100vh - 20px); margin: 0; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}

/* --------------------------------------------------------------------------
   Meldungen
   -------------------------------------------------------------------------- */

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px 11px 14px; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--info); font-weight: 500;
}
.flash > span { flex: 1; }
.flash-success { background: var(--primary-soft); color: var(--primary-dark); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warning-soft); color: #8a5d00; }
.flash-close { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; line-height: 0; opacity: .7; }
.flash-close:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   Gefahrenzone
   -------------------------------------------------------------------------- */

.danger-zone { border: 1px solid #efc6c1; }
.danger-zone .h3 { color: var(--danger); }
.reset-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.reset-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.reset-item:hover { background: #fdf8f7; }
.reset-item input { width: 20px; height: 20px; accent-color: var(--danger); flex: 0 0 auto; }
.reset-text { display: flex; flex-direction: column; flex: 1; }

/* --------------------------------------------------------------------------
   Schlichtes Layout (Anmeldung, Einrichtung)
   -------------------------------------------------------------------------- */

body.plain { min-height: 100vh; }
.plain-wrap { max-width: 460px; margin: 0 auto; padding: 40px 16px; }
.plain-wrap:has(.plain-card-wide) { max-width: 760px; }
.plain-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 22px; font-size: 1.25rem; }
.plain-card { padding: 26px; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li { display: flex; gap: .5rem; align-items: center; padding: 3px 0; font-size: .9rem; }
.checklist .ok { color: var(--primary-dark); }
.checklist .fail { color: var(--danger); font-weight: 600; }
.checklist .warn { color: #8a5d00; }
.steps-text { padding-left: 1.2rem; }
.steps-text li { margin-bottom: .35rem; }
/* Admin-Code: Zifferntastatur auf der zweiten Anmeldeseite (ANNAHMEN 244) */
.pin-display { display: flex; justify-content: center; gap: 10px; margin: 6px 0 16px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.pin-dot.is-set { background: var(--primary); border-color: var(--primary); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto 10px;
    user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pin-key { min-height: 58px; font-size: 1.5rem; font-weight: 600; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--surface); color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pin-key:active { background: var(--surface-2); transform: scale(.97); }
.pin-key-fn { font-size: .95rem; font-weight: 500; color: var(--muted, var(--text)); }
.pin-cancel { text-align: center; margin: 14px 0 0; font-size: .9rem; }
.code-block {
    white-space: pre-wrap; word-break: break-word; font-size: .8rem;
    background: #1f2a24; color: #e8efe9; padding: 12px; border-radius: var(--radius-sm); max-height: 360px; overflow: auto;
}
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin-bottom: .3rem; }

/* --------------------------------------------------------------------------
   Druck
   -------------------------------------------------------------------------- */

@media print {
    .sidebar, .topbar, .sidebar-backdrop, .page-actions, .flashes, .row-actions { display: none !important; }
    .main { margin: 0; padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* --------------------------------------------------------------------------
   Phase 2: Stammdaten
   -------------------------------------------------------------------------- */

.modal-lg { width: min(1040px, calc(100vw - 20px)); }

.color-dot {
    display: inline-block; width: 11px; height: 11px; border-radius: 50%;
    margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip-muted { color: var(--muted); border-style: dashed; }
.chip-warn { color: #8a5a00; background: #fff6e0; border-color: #f2c14e; }
.inline-form { display: inline; margin: 0; }
.link-btn {
    border: 0; background: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer;
    display: inline-flex; align-items: center; gap: .3rem;
}
.link-btn:hover { text-decoration: underline; }

/* Aufklappbare Karten (Obstarten) */
.accordion { padding: 0; overflow: hidden; }
.accordion-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px; cursor: pointer; list-style: none;
}
.accordion-head::-webkit-details-marker { display: none; }
.accordion-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.accordion-arrow { transition: transform .15s; }
.accordion:not([open]) .accordion-arrow { transform: rotate(-90deg); }
.accordion[open] .accordion-head { border-bottom: 1px solid var(--line); }
.accordion .empty { padding: 18px; }

/* Auswahl-Chips mit Häkchen */
.check-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.check-chip {
    margin: 0; padding: 5px 12px 5px 8px; border: 1px solid var(--line-strong); border-radius: 999px;
    font-size: .85rem; background: var(--surface);
}
.check-chip input { width: 16px; height: 16px; }
.check-chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.check-group { margin-top: 10px; }
.check-group-title .check { margin: 0; }

.readonly-value {
    min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm);
    background: var(--hover); font-weight: 700; font-variant-numeric: tabular-nums;
}
input[type=color].input-color { width: 72px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* Karten */
.map { width: 100%; background: #dfe5e1; }
.map-overview { height: 340px; }
.map-edit { height: 380px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
@media (max-width: 719px) { .map-overview { height: 260px; } .map-edit { height: 300px; } }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.leaflet-container { font-family: var(--font); }
.leaflet-draw-tooltip { font-family: var(--font); }

/* Bearbeitbare Tabellen (Sortenblöcke) */
.table-edit td { padding: 6px 6px; vertical-align: top; }
.table-edit th { padding: 8px 6px; }
.table-edit select, .table-edit input { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.table-edit select { min-width: 120px; }
.table-edit .input-num { width: 96px; text-align: right; }
.table-edit .input-year { width: 84px; text-align: right; }
.table-edit tfoot td { border-top: 2px solid var(--line); border-bottom: 0; padding-top: 10px; }
.table-edit tr.is-cleared td { background: #f7f7f5; color: var(--muted); }
.table-edit tr.is-cleared select, .table-edit tr.is-cleared input:not([type=date]) { color: var(--muted); }
.input-with-btn { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn-sm { width: 30px; height: 30px; font-size: .9rem; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.cleared-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cleared-box input { width: 150px; }

/* Drag & Drop */
.col-handle { width: 34px; }
.drag-handle { cursor: grab; font-size: 1.15rem; color: var(--muted); user-select: none; padding: 2px 4px; }
.drag-handle:active { cursor: grabbing; }
tr.is-dragging td { background: var(--primary-soft) !important; opacity: .8; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
    padding: 10px 18px; border-radius: 999px; background: #1f2a24; color: #fff; font-weight: 600;
    box-shadow: var(--shadow-lg);
}
.toast-error { background: var(--danger); }

/* Lagerort-Typen */
.badge-loc-hof { background: #fdf3dc; color: #8a5d00; }
.badge-loc-lager, .badge-loc-kuehl { background: var(--info-soft); color: var(--info); }
.badge-loc-ca { background: #ece4f5; color: #6c3d99; }
.badge-loc-sortierpartner { background: var(--primary-soft); color: var(--primary-dark); }
.badge-loc-extern { background: var(--hover); color: #5f6864; }

/* Aktionsknöpfe in Tabellen: unter 1280 px nur Symbole (Text als Tooltip) */
@media (max-width: 1279px) {
    .row-actions .hide-sm { display: none; }
    .row-actions .btn-sm { padding: 5px 7px; }
}
.nowrap { white-space: nowrap; }

/* Einklappbare Menügruppen und Abzeichen (Video 1, 27.10.2026) */
.nav-group-title {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    border: 0; background: none; cursor: pointer; text-align: left; font-family: inherit;
    border-radius: 6px; padding-top: 3px; padding-bottom: 3px;
}
.nav-group-title:hover { color: var(--text); background: var(--hover); }
.nav-group-arrow { width: 14px; height: 14px; transition: transform .15s; }
.nav-group.is-collapsed .nav-group-arrow { transform: rotate(-90deg); }
.nav-group.is-collapsed ul { display: none; }
.nav-badge {
    margin-left: auto; padding: 1px 7px; border-radius: 999px;
    background: var(--hover); color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .04em;
}
.nav-badge + .nav-soon { margin-left: 6px; }

.dash-blocks > .card { margin-bottom: 16px; }

/* ==========================================================================
   Phase 3 – Etiketten, Drucker
   ========================================================================== */
.chip-inline { margin-top: 0; }
.code-big { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: .12em; background: #f1f4f2; padding: 2px 8px; border-radius: 6px; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.steps-list { margin: .25rem 0 0 1.2rem; padding: 0; line-height: 1.7; }
.text-danger { color: var(--danger, #c0392b); }
.card-pad { padding: 16px 20px 0; }
.input-date { min-width: 9.5rem; }
.table-edit .input-short { width: 4.5rem; }

/* Assistent „Etiketten erstellen“ */
.wizard { max-width: 920px; }
.wizard-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.wizard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; padding: 0; list-style: none; }
.wizard-steps li { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .82rem; font-weight: 600; }
.wizard-steps li .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: .75rem; }
.wizard-steps li.is-current { background: var(--primary); color: #fff; }
.wizard-steps li.is-current .num { color: var(--primary); }
.wizard-steps li.is-done { background: #dff0e4; color: var(--primary); cursor: pointer; }
.wizard-steps li.is-done .num { background: var(--primary); color: #fff; }
.wizard-question { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }
.wizard-sub { color: var(--muted); margin: 0 0 14px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
    padding: 14px 16px; min-height: 76px; border: 2px solid var(--line-strong); border-radius: 14px;
    background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
}
.tile:hover { border-color: var(--primary); }
.tile.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(47, 143, 78, .15); }
.tile-title { font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 6px; }
.tile-sub { color: var(--muted); font-size: .82rem; }
.tile-number { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.tile.tile-num { align-items: center; justify-content: center; min-height: 90px; }
.wizard-map { height: 480px; height: min(480px, 62vh); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.wizard-map-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); margin-bottom: 12px; }
.segmented button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.is-active { background: var(--primary); color: #fff; }
.summary-box { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); margin: 14px 0; }
.summary-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.summary-box dt { color: var(--muted); }
.summary-box dd { margin: 0; font-weight: 600; }
.net-display { font-size: 2.6rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.output-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.wizard-result { text-align: center; padding: 30px 10px; }
.wizard-result .icon-xl { color: var(--primary); }
.wizard-result .btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.big-input { font-size: 1.6rem; font-weight: 700; max-width: 220px; }

/* Etikettenliste */
.label-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; padding: 10px 0; }
.label-code { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .85rem; }
.label-code.has-error { border-color: var(--danger); }
.label-code.is-deleted { opacity: .5; text-decoration: line-through; }
.batch-details td { background: #f7f9f8; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filter-bar .field { margin: 0; min-width: 140px; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .wizard-question { font-size: 1.15rem; }
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-map { height: 60vh; }
}
.btn-lg { min-height: 48px; padding: 10px 22px; font-size: 1.02rem; }

/* Feldnamen fest auf der Karte im Etiketten-Assistenten */
.leaflet-tooltip.field-label {
    background: transparent; border: 0; box-shadow: none; padding: 0;
    color: #fff; font-weight: 700; font-size: .78rem; text-align: center; white-space: nowrap;
    text-shadow: 0 0 3px rgba(0, 0, 0, .9), 0 0 6px rgba(0, 0, 0, .7);
    cursor: pointer; pointer-events: auto;
}
.leaflet-tooltip.field-label::before { display: none; }
.download-box { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px; }
.printer-alert { margin-bottom: 14px; }
.printer-alert .btn { margin-left: auto; }

/* Reihenernte */
.rh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rh-marker { display: grid; place-items: center; }
.rh-marker span {
    display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--surface); color: #222;
    font-size: .74rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
    border: 2px solid var(--rh-color, #a4243b); cursor: pointer;
}
.rh-marker.is-done span { background: #dff0e4; }
.rh-marker.is-dim span { opacity: .45; }
.rh-marker small { font-weight: 500; color: #555; }
.kpi-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.yield-list { display: flex; flex-direction: column; gap: 6px; }
.yield-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 2fr minmax(90px, auto) auto; align-items: center; gap: 10px; }
.yield-bar { height: 12px; background: var(--hover); border-radius: 999px; overflow: hidden; }
.yield-bar span { display: block; height: 100%; border-radius: 999px; }
.yield-value { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.text-good { color: var(--primary); }
.yield-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.legend-low, .legend-high { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.legend-low { background: #f2c14e; }
.legend-high { background: #2f8f4e; }
@media (max-width: 640px) {
    .yield-row { grid-template-columns: 1fr auto; }
    .yield-bar { grid-column: 1 / -1; order: 3; }
    .yield-action { grid-column: 2; }
}
[hidden] { display: none !important; }

/* Phase 4 – Scan */
.scan-page { max-width: 720px; }
.scan-modes { margin-bottom: 12px; }
.scan-camera { position: relative; width: 100%; min-height: 240px; border-radius: 14px; overflow: hidden; background: #1d2420; margin-bottom: 10px; }
.scan-camera video { width: 100% !important; display: block; }
.scan-camera-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #cfd6d2; }
/* Sortierrechnung: Rechnungsempfänger unter der Preisleiste über die ganze Breite */
.invoice-recipient { flex-basis: 100%; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.4fr); gap: 0 14px; }
@media (max-width: 640px) { .invoice-recipient { grid-template-columns: 1fr; } }
/* Rechnungstool (ANNAHMEN 250) */
.invoice-lines td { vertical-align: top; }
.invoice-lines input[type="text"] { width: 100%; min-width: 4.5rem; }
.invoice-lines td:first-child { min-width: 18rem; }
.invoice-lines select { min-width: 6rem; }
.invoice-lines .input-short { min-width: 5.5rem; }
.invoice-lines .input-detail { margin-top: 4px; font-size: .85em; }
.invoice-lines .is-missing { border-color: var(--danger, #c0392b); }
.invoice-lines .has-error { border-color: var(--danger, #c0392b); }
.invoice-new-line td { background: var(--surface-2, rgba(0,0,0,.025)); }
.invoice-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; max-width: 420px; margin: 0 0 0 auto; }
.invoice-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-totals .strong { font-weight: 700; border-top: 1px solid currentColor; padding-top: 4px; }
/* E-Rechnung (ANNAHMEN 251): Schiebeschalter */
.einvoice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.einvoice-row form { margin: 0; }
.einvoice-xml { margin-left: auto; }
.einvoice-problems { margin: 12px 0 0; }
.einvoice-problems ul { margin: 4px 0 0; padding-left: 1.2rem; }
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--line-strong); position: relative; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Rückmeldung über dem Kamerabild (Nutzer 02.11.2026) */
.scan-toast { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 20; padding: 12px 14px; border-radius: 12px;
    font-weight: 700; font-size: 1.05rem; line-height: 1.3; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    opacity: 0; transform: translateY(-140%); transition: transform .25s ease, opacity .25s ease; pointer-events: none; }
.scan-toast.is-show { opacity: 1; transform: none; }
.scan-toast.is-success { background: #2f8f4e; color: #fff; }
.scan-toast.is-warning { background: #f2c230; color: #2b2200; }
.scan-toast.is-error { background: #c62f2f; color: #fff; }
/* Handy: Kamerabild nimmt etwa drei Viertel des Bildschirms ein, Überschrift weg */
@media (max-width: 760px) and (pointer: coarse) {
    .scan-head { display: none; }
    .scan-modes { margin-bottom: 8px; }
    .scan-camera { height: 72vh; height: 72dvh; min-height: 0; }
    .scan-camera #scan-video, .scan-camera #scan-video video { width: 100% !important; height: 100% !important; object-fit: cover; }
}
.scan-manual { margin-top: 14px; }
/* Eigener QR-Leser (ANNAHMEN 317) */
.qr-video { display: block; width: 100%; height: auto; }
.qr-aim { display: none; }
/* Massenscan-Leiste oben nicht unter der Kopfzeile verstecken (Handy/Tablet) */
@media (max-width: 959px) { .scan-page .scan-bar { top: 64px; } }
/* Handy: Kamera über den ganzen Bildschirm, unten eine Leiste mit den gescannten Kisten und Zurück/Fertig */
html.scan-fullscreen, html.scan-fullscreen body { overflow: hidden; }
html.scan-fullscreen .scan-camera { position: fixed; left: 0; right: 0; top: 0; bottom: var(--scan-dock-h, 170px); z-index: 1000;
    height: auto; min-height: 0; margin: 0; border-radius: 0; background: #000; }
html.scan-fullscreen .scan-camera #scan-video, html.scan-fullscreen .qr-video { width: 100% !important; height: 100% !important; object-fit: cover; }
html.scan-fullscreen .qr-aim { display: block; position: absolute; left: 50%; top: 50%; width: 64vmin; height: 64vmin; transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .22); pointer-events: none; }
html.scan-fullscreen .scan-toast { top: calc(env(safe-area-inset-top, 0px) + 12px); }
.scan-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #1d2420; color: #fff; }
.scan-dock-head { display: flex; align-items: center; gap: 10px; }
.scan-dock-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scan-dock-title .small { color: rgba(255, 255, 255, .7); }
.scan-dock-title strong { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-dock .badge { font-size: 1rem; padding: 4px 12px; }
.scan-dock-list { list-style: none; margin: 0; padding: 0 0 2px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.scan-dock-list::-webkit-scrollbar { display: none; }
.scan-chip { flex: none; display: flex; flex-direction: column; max-width: 58vw; padding: 6px 10px; border-radius: 10px;
    background: rgba(255, 255, 255, .1); border-left: 4px solid #9aa39e; font-size: .8rem; line-height: 1.3; }
.scan-chip .code { font-weight: 700; letter-spacing: .04em; }
.scan-chip .small { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-chip.is-ok { border-left-color: #4cc274; }
.scan-chip.is-warn { border-left-color: #f2c14e; }
.scan-chip.is-error { border-left-color: #e05a4f; background: rgba(198, 47, 47, .35); }
.scan-chip.is-empty { border-left-color: transparent; opacity: .75; }
.scan-dock-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; }
.scan-dock-actions .btn { min-height: 50px; font-size: 1rem; justify-content: center; }
.scan-dock-actions .btn:not(.btn-primary) { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }
.scan-again { margin-bottom: 14px; }
.scan-manual label { font-weight: 600; display: block; margin-bottom: 4px; }
.scan-manual input { font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.scan-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px;
    background: var(--primary); color: #fff; border-radius: 14px; }
.scan-bar > div { flex: 1; display: flex; flex-direction: column; }
.scan-bar .muted { color: rgba(255, 255, 255, .8); }
.scan-bar .badge { font-size: 1rem; padding: 4px 12px; }
.scan-group-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.scan-target { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; margin-bottom: 6px;
    border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.scan-target:hover:not(:disabled) { border-color: var(--primary); }
.scan-target:disabled { opacity: .5; cursor: not-allowed; }
.scan-target.is-current { background: var(--primary-soft); border-color: var(--primary); }
.scan-target.is-danger { color: var(--danger); border-color: #f0c5bf; }
.scan-new-dn { padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.scan-new-dn .field { display: block; margin-bottom: 10px; }
.scan-new-dn .field > span:first-child { display: block; margin-bottom: 4px; font-size: .84rem; font-weight: 600; }
.scan-new-dn .field-hint { display: block; }
.scan-new-dn .field-error { margin: 0 0 10px; }
.scan-box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.scan-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0; }
.scan-facts dt { color: var(--muted); }
.scan-facts dd { margin: 0; font-weight: 600; }
.scan-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.scan-history li { display: flex; gap: 10px; font-size: .88rem; }
.scan-list { list-style: none; padding: 0 16px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.scan-item { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; border-left: 4px solid var(--line-strong); background: var(--surface-2); }
.scan-item.is-ok { border-left-color: var(--primary); }
.scan-item.is-warn { border-left-color: #f2c14e; }
.scan-item.is-error { border-left-color: var(--danger); background: var(--danger-soft); }
.scan-item.is-pending { border-left-color: #9aa39e; }

/* Phase 4 – Lagerbestand */
.stock-toolbar { display: flex; flex-direction: column; gap: 10px; }
.stock-toolbar .segmented { margin-bottom: 0; align-self: flex-start; }
.stock-search { max-width: 420px; }
.stock-buttons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stock-buttons .is-active { background: var(--primary); color: #fff; }
.stock-summary { margin: 4px 2px 10px; color: var(--muted); font-size: .88rem; }
.stock-group { padding: 0; overflow: hidden; }
.stock-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 14px 16px 8px;
    border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stock-group-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.stock-group-amount { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.stock-bar { display: flex; height: 10px; margin: 0 16px; border-radius: 999px; overflow: hidden; background: var(--hover); }
.stock-bar span { height: 100%; }
.stock-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 16px 12px; font-size: .76rem; color: var(--muted); }
.stock-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.stock-positions { border-top: 1px solid var(--line); }
.stock-position { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.stock-position:last-child { border-bottom: 0; }
.stock-position.is-selected { background: var(--primary-soft); }
.stock-select-all { grid-template-columns: auto 1fr auto; cursor: pointer; font-weight: 600; background: var(--surface-2, transparent); }
.stock-position-label, .stock-position-amount { display: flex; flex-direction: column; }
.stock-position-amount { align-items: flex-end; font-variant-numeric: tabular-nums; }
.stock-position-actions { display: flex; gap: 4px; }
.stock-icon { font-size: 1.05rem; line-height: 1; }
.stock-actionbar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px;
    background: #1d2420; color: #fff; border-radius: 14px; box-shadow: var(--shadow); margin-top: 12px; }
.stock-actionbar .btn-ghost { color: #fff; }
.stock-actionbar .spacer { flex: 1; }
.move-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.move-field { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.move-field input { width: 7rem; }
@media (max-width: 640px) {
    .move-row { grid-template-columns: 1fr 1fr; }
    .move-row > div:first-child { grid-column: 1 / -1; }
}

/* Sortierung (Phase 5) */
.flash-info { background: var(--info-soft); color: var(--info); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.sorting-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.sorting-meta strong { color: var(--text); }
.sorting-locked { align-items: center; }
.danger-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.sub-form { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px 4px; margin: 0 0 12px; }
.sub-form legend { font-weight: 700; font-size: .85rem; padding: 0 6px; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover { background: var(--surface-2); }
.mini-bar { height: 5px; background: var(--hover); border-radius: 999px; overflow: hidden; margin-top: 4px; min-width: 70px; }
.mini-bar span { display: block; height: 100%; background: var(--primary); }
.show-sm { display: none; }
@media (max-width: 640px) { .show-sm { display: inline; } }
.show-md { display: none; }
@media (max-width: 1199px) { .hide-md { display: none; } .show-md { display: inline; } }
.sort-cockpit { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .sort-cockpit { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); } }
.sort-main, .sort-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sort-cockpit .card, #sorting-app > .card { margin-bottom: 0; }
#sorting-app > * + * { margin-top: 16px; }
.card-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
.size-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 10px 12px;
    border: 2px solid var(--line-strong); border-radius: 12px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.size-tile:hover:not(:disabled) { border-color: var(--primary); }
.size-tile.is-selected { border-color: var(--primary); background: #e9f5ec; box-shadow: 0 0 0 3px rgba(47, 143, 78, .18); }
.size-tile:disabled, .size-tile.is-disabled { opacity: .7; cursor: default; }
.size-name { font-weight: 800; font-size: 1.05rem; padding-right: 18px; hyphens: auto; }
.size-sub { font-size: .76rem; color: var(--muted); }
.size-key { position: absolute; top: 6px; right: 8px; font-size: .68rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.size-tile.is-waste { padding: 0; border-color: #e8c3bd; background: var(--danger-soft); flex-direction: row; align-items: stretch; }
.waste-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; background: none; font: inherit; color: var(--danger); cursor: pointer; text-align: left; position: relative; }
.waste-minus { border: 0; border-left: 1px solid #e8c3bd; background: none; color: var(--danger); font-size: 1.2rem; width: 30px; cursor: pointer; }
.size-tile.is-add { border-style: dashed; color: var(--muted); align-items: center; justify-content: center; }
.scale-card { background: #f3f8ec; border: 1px solid #d5e6c6; }
.scale-card.is-idle { background: var(--card); border-color: var(--line); }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.scale-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; padding: 6px 0 12px; border-bottom: 1px solid #d5e6c6; }
.scale-label { color: var(--muted); font-size: .88rem; }
.scale-input { font-size: 2.4rem; font-weight: 800; text-align: right; width: 12rem; max-width: 50vw; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.scale-tare { font-size: 1.4rem; font-weight: 700; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-net { font-size: 2.8rem; font-weight: 800; text-align: right; color: var(--primary); font-variant-numeric: tabular-nums; border-top: 2px solid var(--text); padding-top: 4px; }
.scale-net.is-negative { color: var(--danger); }
.format-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.format-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 8px 30px 8px 12px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--surface); font: inherit; cursor: pointer; }
.format-btn.is-selected { border-color: var(--text); background: var(--text); color: #fff; }
.format-btn.is-selected .size-key { color: #fff; border-color: rgba(255, 255, 255, .5); }
.scale-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.input-list { list-style: none; margin: 10px 0 0; padding: 0; }
.input-list li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.progress-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; }
.progress-big strong { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dist-list { display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; align-items: center; gap: 8px; font-size: .85rem; }
.dist-row.is-waste .dist-name { color: var(--danger); }
.dist-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-new td { background: var(--primary-soft); }
.result-row { display: grid; grid-template-columns: 1fr 7rem 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.result-sum { margin: 10px 0 0; font-size: .9rem; }
.sizes-search { width: 100%; margin-bottom: 10px; }
.sizes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px 10px; max-height: 50vh; overflow-y: auto; }
.pdf-frame { width: 100%; height: 78vh; border: 0; display: block; border-radius: var(--radius); }
@media (max-width: 640px) {
    .result-row { grid-template-columns: 1fr 6rem; }
    .scale-input { font-size: 1.9rem; width: 9rem; }
    .scale-net { font-size: 2.2rem; }
}
.input-panel { border: 2px solid var(--primary); }
.input-panel .input-with-btn { margin: 10px 0; }
.input-camera { margin: 8px 0; }
.input-camera .scan-camera { margin-bottom: 8px; }
.from-stock { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.from-stock summary, .input-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 4px 0; }
.from-stock-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.from-stock-row select { min-width: 220px; }
.from-stock-row input { width: 6rem; }
.input-panel .scan-list { padding: 0; }
.cost-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.cost-row input { width: 10rem; }
.cost-result { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; font-size: 1.05rem; }
.result-row { grid-template-columns: 1fr 8rem auto; }
/* „Wo abziehen?“ (externe Sortierung, Ergebnis verringert) */
.alloc-class { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.alloc-class:last-child { border-bottom: 0; }
.alloc-row { display: grid; grid-template-columns: 1fr 7rem; gap: 10px; align-items: center; margin: 6px 0; font-size: .92rem; }

/* ---- Verkauf, Kunden, Lieferschein (Phase 6) ---------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.spacer { flex: 1; }
.text-warn { color: #8a5a00; }
label.is-disabled { opacity: .45; }
.kpi-link { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s; }
.kpi-link:hover { box-shadow: var(--shadow-lg); }
.kpi-5 { border-left-color: #7b61c4; }
@media (min-width: 1200px) { .kpi-grid-5 { grid-template-columns: repeat(5, 1fr); } }
.kpi-grid-5 .kpi-value { font-size: 1.45rem; }
.sales-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1100px) { .sales-layout { grid-template-columns: 290px minmax(0, 1fr); } }
.sales-customers { position: sticky; top: 12px; }
@media (max-width: 1099px) { .sales-customers { position: static; } .sales-customer-list { max-height: 240px; } }
.sales-customer-list { display: flex; flex-direction: column; max-height: 75vh; overflow-y: auto; }
.sales-customer { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 16px; color: inherit; text-decoration: none; border-left: 4px solid transparent; border-top: 1px solid var(--line); }
.sales-customer:hover { background: var(--surface-2); }
.sales-customer.is-active { background: var(--primary-soft); border-left-color: var(--primary); }
.sales-customer.is-inactive strong { color: var(--muted); }
.sales-customer > .muted { grid-column: 1; }
.sales-customer-badges { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sales-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sales-main > .kpi-grid { margin-bottom: 0; }
.sales-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sales-head h2 { margin: 0; }
.sales-mirror tbody tr { cursor: pointer; }
.sales-mirror tbody tr:hover { background: var(--surface-2); }
.sales-mirror tbody tr.is-active td { background: var(--primary-soft); }
.dn-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 0; }
.dn-toolbar input[type=search] { flex: 1 1 220px; max-width: 320px; }
.dn-month-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dn { border-bottom: 1px solid var(--line); }
.dn-head { display: grid; grid-template-columns: 52px minmax(90px, 140px) minmax(0, 1fr) 80px 90px auto 100px 20px; gap: 10px; align-items: center;
    width: 100%; padding: 10px 16px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.dn-head:hover { background: #f9faf9; }
.dn-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.dn-no { font-weight: 700; }
.dn-content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.dn-boxes, .dn-kg, .dn-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dn-kg { font-weight: 600; }
.dn-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.dn-arrow .icon { transition: transform .15s; }
.dn.is-open .dn-arrow .icon { transform: rotate(180deg); }
.dn.is-open > .dn-head { background: var(--primary-soft); }
.dn.is-storniert .dn-head { opacity: .6; }
.dn.is-storniert .dn-no { text-decoration: line-through; }
.dn-body { padding: 4px 16px 16px; background: #fcfdfc; }
.dn-state { margin: 6px 0 10px; }
.dn-items .input-num { width: 6.5rem; text-align: right; }
.dn-items tfoot td { border-top: 2px solid var(--line-strong); }
.dn-items td.actions { width: 1%; white-space: nowrap; }
.dn-changes { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 8px 0 4px; }
.dn-changes ul { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; }
.dn-items .icon-btn-inline { display: inline-flex; vertical-align: middle; width: 26px; height: 26px; margin-left: 2px; }
.dn-head-fields { margin-top: 12px; }
.dn-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
@media (max-width: 900px) {
    .dn-head { grid-template-columns: 48px 1fr auto 20px; grid-template-areas: "date no kg arrow" "content content badges badges"; row-gap: 4px; }
    .dn-date { grid-area: date; } .dn-no { grid-area: no; } .dn-kg { grid-area: kg; } .dn-arrow { grid-area: arrow; }
    .dn-content { grid-area: content; } .dn-badges { grid-area: badges; }
    .dn-boxes, .dn-amount { display: none; }
}
.out-rows { display: flex; flex-direction: column; }
.out-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 32px; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.out-row-main select { width: 100%; }
.out-row .move-field input { width: 6.5rem; }
@media (max-width: 640px) {
    .out-row { grid-template-columns: 1fr 1fr 32px; }
    .out-row-main { grid-column: 1 / -1; }
}
.out-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.out-text { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.out-text summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 4px 0; }
.tpl-box { margin-top: 8px; }
.tpl-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tpl-row select, .tpl-row input { flex: 1; min-width: 0; }
.tpl-msg { margin-bottom: 8px; }
.split-rows { display: flex; flex-direction: column; gap: 8px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 6rem 32px; gap: 8px; align-items: end; }
.split-row select { width: 100%; }
.split-row .move-field input { width: 100%; }
.customers-table td:first-child { min-width: 190px; }
.customers-table .chip-list { gap: 4px; }

/* ==========================================================================
   Phase 7: Personal, Lohn, Zeiterfassung, Tablet
   ========================================================================== */
.list-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-toolbar input[type=search] { flex: 1 1 220px; max-width: 320px; }
.list-toolbar select { width: auto; min-width: 200px; }
.link-back { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.link-back .icon { width: 16px; height: 16px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 4px; margin: 6px 0 12px; }
.fieldset legend { font-size: .84rem; font-weight: 700; padding: 0 6px; }
.pick-list { max-height: 220px; overflow-y: auto; }
.input-code { font-size: 1.4rem; letter-spacing: .15em; text-transform: uppercase; text-align: center; }
.table tr.is-alert td { background: var(--danger-soft); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 640px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Zeiterfassung */
.time-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.time-toolbar input[type=date] { width: auto; }
.time-toolbar select { width: auto; min-width: 180px; }
.time-changes { margin-top: 4px; font-size: .8rem; }
.time-changes summary { cursor: pointer; list-style: none; display: inline-block; }
.time-changes summary::-webkit-details-marker { display: none; }
.time-changes ul { margin: 6px 0 0; padding: 0; list-style: none; min-width: 200px; }
.time-changes li { padding: 4px 0; border-top: 1px solid var(--line); line-height: 1.4; }
.time-weekday { font-weight: 600; min-width: 6.5em; }
.break-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.break-row input[type=time] { width: 9rem; }
.time-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.time-range input[type=date] { width: auto; }

/* Tablet (Video 26): groß, gut zu treffen, Farbe je Status */
.terminal-body { background: var(--bg); }
.terminal { max-width: 1400px; margin: 0 auto; padding: 20px 24px 40px; }
.terminal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.terminal-head h1 { font-size: 1.5rem; margin: 0 0 2px; }
.terminal-right { display: flex; align-items: center; gap: 16px; }
.terminal-right .flags { margin: 0; }
.terminal-clock { font-size: 2.6rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1; }
.terminal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 12px 22px; border: 0; border-radius: 12px;
    font: inherit; font-size: 1.05rem; font-weight: 700; color: #fff; cursor: pointer; }
.t-btn .icon { width: 22px; height: 22px; }
.t-btn:disabled { opacity: .35; cursor: not-allowed; }
.t-start { background: #2f8f4e; }
.t-pause { background: #2a6f97; }
.t-resume { background: var(--surface); color: #2a6f97; box-shadow: inset 0 0 0 2px #2a6f97; }
.t-stop { background: #c0392b; }
.terminal-message { min-height: 8px; }
.terminal-message .flash { margin: 0 0 10px; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.t-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 120px; padding: 14px 16px; text-align: left;
    border: 1px solid var(--line-strong); border-left-width: 6px; border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; }
.t-tile:active { transform: scale(.98); }
.t-initials { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0, 0, 0, .06); font-weight: 700; font-size: .9rem; }
.t-name { font-weight: 700; font-size: 1.05rem; }
.t-state { font-size: .88rem; color: var(--muted); }
.t-tile.t-work { background: #e8f5ec; border-color: #9fd3b0; border-left-color: #2f8f4e; }
.t-tile.t-break { background: #e5f0f7; border-color: #a8cbe0; border-left-color: #2a6f97; }
.t-tile.t-done { background: #f1f2f1; border-left-color: #8a938e; }
.t-tile.t-none { border-left-color: var(--line-strong); }
.terminal-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: .88rem; color: var(--muted); }
.t-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--surface); border: 1px solid var(--line-strong); }
.t-legend.t-work i { background: #2f8f4e; border-color: #2f8f4e; }
.t-legend.t-break i { background: #2a6f97; border-color: #2a6f97; }
.t-legend.t-done i { background: #8a938e; border-color: #8a938e; }
.terminal-dialog .t-person-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.terminal-dialog .t-person-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.t-pick { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.t-pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.t-pick-row input { width: 24px; height: 24px; }
@media (max-width: 700px) {
    .terminal { padding: 14px; }
    .terminal-head { flex-direction: column; }
    .terminal-clock { font-size: 2rem; }
    .t-btn { flex: 1 1 45%; }
}

/* ---- Aufgaben (Phase 8) ---------------------------------------------------- */
.task-desc { margin-top: 2px; max-width: 520px; }
.task-field-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 10px; }
.task-map { height: 320px; border-radius: var(--radius, 10px); overflow: hidden; margin-bottom: 12px; }
.task-cards { display: grid; gap: 12px; }
.task-card { margin: 0; }
.task-card h2 { margin: 0 0 6px; }
.task-card.is-overdue { border-left: 4px solid var(--danger); }
.task-card.is-done { opacity: .75; }
.task-text { margin: 0 0 8px; white-space: normal; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .icon { width: 15px; height: 15px; }
.task-meta .text-danger { color: var(--danger); }
.chips-end { margin-left: auto; }
.task-every { display: flex; align-items: center; gap: 8px; }
.icon-xs { width: 13px; height: 13px; vertical-align: -2px; }

/* ---- Auswertung (Phase 9a) ---------------------------------------------------- */
.eval-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.eval-side { position: sticky; top: 12px; padding: 14px; }
.eval-side-block { margin-bottom: 14px; }
.eval-side-title { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0; }
.eval-tree { display: flex; flex-direction: column; gap: 1px; }
.eval-node { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; font-size: .9rem; cursor: pointer; }
.eval-node:hover { background: var(--primary-soft); text-decoration: none; }
.eval-node.is-active { background: var(--primary); color: #fff; }
.eval-node.is-active .muted { color: rgba(255,255,255,.8); }
.eval-node .icon { width: 15px; height: 15px; }
.eval-fruit { font-weight: 700; margin-top: 4px; }
.eval-variety { padding-left: 20px; }
.eval-rest summary { list-style: none; }
.eval-rest summary::-webkit-details-marker { display: none; }
.eval-main { min-width: 0; }
.eval-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); gap: 18px; }
.eval-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.eval-kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.eval-kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.eval-kpi-note { font-size: .8rem; }
.eval-kpi-note.is-up, .eval-delta.is-up { color: var(--primary-dark); }
.eval-kpi-note.is-down, .eval-delta.is-down { color: var(--danger); }
.eval-kpi-open .eval-kpi-value { color: #8a5d00; }
.eval-vbars { display: flex; align-items: flex-end; gap: 8px; min-height: 120px; overflow-x: auto; padding-bottom: 4px; }
.eval-vbar { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 44px; color: inherit; text-decoration: none; font-size: .72rem; position: relative; }
.eval-vbar:hover { text-decoration: none; }
.eval-vbar-col { width: 26px; background: #b9d8c3; border-radius: 4px 4px 0 0; }
.eval-vbar.is-active .eval-vbar-col { background: var(--primary); }
.eval-vbar.is-active .eval-vbar-lab { font-weight: 700; }
.eval-vbar-val { color: var(--muted); white-space: nowrap; }
.eval-vbar-badge { font-size: .6rem; background: var(--info-soft); color: var(--info); border-radius: 6px; padding: 0 4px; }
.eval-tabs { margin: 14px 0 12px; }
.eval-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }
.eval-pane .card { margin-bottom: 16px; }
.eval-donut-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.eval-donut { width: 170px; height: 170px; flex: none; }
.eval-donut path.is-click { cursor: pointer; }
.eval-donut-main { font-size: 15px; font-weight: 700; fill: var(--text, #1d2b24); }
.eval-donut-sub { font-size: 10px; fill: var(--muted); }
.eval-legend { flex: 1; min-width: 200px; }
.eval-legend-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; font-size: .88rem; }
.eval-legend-row.is-click { cursor: pointer; }
.eval-legend-row.is-click:hover { background: var(--primary-soft); }
.eval-legend-row.is-indent { padding-left: 24px; font-size: .82rem; }
.eval-legend-row i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.eval-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eval-legend-val { font-weight: 600; white-space: nowrap; }
.eval-legend-pct { font-size: .78rem; white-space: nowrap; }
.eval-chev { display: inline-block; transition: transform .15s; color: var(--muted); font-weight: 700; }
.eval-chev.is-open { transform: rotate(90deg); }
.eval-class-legend { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 8px; }
.eval-class-legend .eval-legend-row { grid-template-columns: 12px auto; padding: 2px 4px; font-size: .75rem; }
.eval-class-legend .eval-legend-val, .eval-class-legend .eval-legend-pct { display: none; }
.eval-bar-row { display: grid; grid-template-columns: minmax(80px, 26%) minmax(70px, 1fr) auto; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 6px; }
.eval-bar-row.is-click { cursor: pointer; }
.eval-bar-row.is-click:hover { background: var(--primary-soft); }
.eval-bar-label { display: flex; flex-direction: column; font-size: .86rem; overflow: hidden; }
.eval-bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eval-bar-track { height: 14px; background: var(--hover); border-radius: 7px; overflow: hidden; }
.eval-bar-fill { height: 100%; display: flex; border-radius: 7px; overflow: hidden; }
.eval-bar-fill span { height: 100%; }
.eval-bar-value { font-size: .84rem; font-weight: 600; white-space: nowrap; text-align: right; }
.eval-band-row { display: grid; grid-template-columns: minmax(80px, 20%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 6px; }
.eval-band-track { position: relative; height: 12px; background: var(--hover); border-radius: 6px; }
.eval-band { position: absolute; top: 2px; height: 8px; border-radius: 4px; opacity: .75; }
.eval-band-avg { position: absolute; top: -2px; width: 4px; height: 16px; margin-left: -2px; background: var(--text, #1d2b24); border-radius: 2px; }
.eval-lines { width: 100%; height: auto; }
.eval-line { fill: none; stroke-width: 2.5; }
.eval-grid { stroke: #e3e8e5; stroke-width: 1; }
.eval-axis { font-size: 10px; fill: var(--muted); }
.eval-line-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; margin-top: 6px; }
.eval-line-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.eval-map { height: 320px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.eval-best td { font-weight: 700; background: var(--primary-soft); }
.eval-delta { font-weight: 600; }
.eval-empty { padding: 12px 0; }
.table-compact td, .table-compact th { padding: 6px 8px; }
.segmented-sm { margin-bottom: 8px; }
.segmented-sm button { padding: 4px 12px; font-size: .82rem; }
@media (max-width: 1150px) {
    .eval-layout { grid-template-columns: minmax(0, 1fr); }
    .eval-side { position: static; }
}
@media (max-width: 980px) {
    .eval-head, .eval-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Saison nachtragen (Phase 9b) ------------------------------------------------------------- */
.bf-season { margin-bottom: 4px; }
.bf-season .field { min-width: min(100%, 360px); }
.bf-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bf-boxes { display: flex; flex-direction: column; gap: 8px; }
.bf-box-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 6rem minmax(5.5rem, auto) 32px; gap: 8px; align-items: center; }
.bf-box-row select { width: 100%; }
.bf-boxes-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 6px; }
.bf-items input.input-num { width: 6rem; text-align: right; }
.bf-items tr[hidden] { display: none; }
.bf-box-sum { font-size: .95rem; }
.bf-more { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; }
.bf-more[hidden] { display: none; }
.bf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.bf-pool { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; margin: 4px 0 14px;
    border-radius: 10px; background: var(--surface-2); }
.bf-pool > div { display: flex; flex-direction: column; gap: 2px; }
.bf-pool.is-warn { background: var(--warning-soft); }
.bf-pool-warn { grid-column: 1 / -1; margin: 0; color: #8a5d00; display: flex; gap: 6px; align-items: center; }
.bf-pool-warn[hidden] { display: none; }
@media (max-width: 1440px) {
    .bf-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .bf-box-row { grid-template-columns: minmax(0, 1fr) 5rem 32px; }
    .bf-box-row > span:nth-of-type(1) { display: none; }
    .bf-box-row > span.small { grid-column: 1 / -1; order: 5; }
    .bf-pool { grid-template-columns: minmax(0, 1fr); }
}

/* Ernteschätzung (Phase 9c) */
.he-table td { vertical-align: top; }
.he-table .he-group th { background: var(--surface-2); font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.he-own-inputs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.he-own-inputs input.input-num { width: 5.2rem; text-align: right; }
.he-last { color: var(--info); margin-top: 2px; }
.he-state { display: block; min-height: 1em; }
.he-state.is-ok { color: var(--primary-dark); }
.he-state.is-error { color: var(--danger); }
.he-why-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.he-why-btn:hover strong { text-decoration: underline dotted; }
.he-why { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: #f4f6f5; max-width: 26rem; }
.he-why[hidden] { display: none; }
.he-trend { font-weight: 700; }
.he-trend-up { color: var(--primary); }
.he-trend-down { color: var(--danger); }
.he-trend-flat { color: var(--muted); }
.he-conf-hoch { background: var(--primary-soft); color: var(--primary-dark); }
.he-conf-mittel { background: var(--warning-soft); color: #8a5d00; }
.he-conf-niedrig { background: var(--hover); color: #5f6864; }
.he-done-col { text-align: center; width: 1%; white-space: nowrap; }
.he-done input { width: 20px; height: 20px; cursor: pointer; }
.he-done input:disabled { cursor: not-allowed; }
.he-expected { color: var(--info); }
.he-table .is-up { color: var(--primary-dark); }
.he-table .is-down { color: var(--danger); }
.he-beta { margin-left: 6px; font-size: .65rem; vertical-align: middle; }
.he-how { margin-top: 16px; }
.he-how summary { cursor: pointer; font-weight: 600; }
.he-how ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.he-how li { margin-bottom: 6px; }
.segmented a { padding: 6px 16px; border-radius: 999px; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented a.is-active { background: var(--primary); color: #fff; }
.he-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.he-card { margin: 0; }
.he-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.he-card-sum { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.he-card-sum strong { font-size: 1.3rem; white-space: nowrap; }
.he-warn { margin: 0; color: #8a5d00; background: var(--warning-soft); display: flex; gap: 6px; align-items: center; }
.he-edit { border: 0; background: none; padding: 2px 4px; font: inherit; color: inherit; cursor: pointer;
    border-bottom: 1px dashed var(--line-strong); border-radius: 0; }
.he-edit:hover { color: var(--primary-dark); border-bottom-color: var(--primary); }
.he-edit.is-over { font-weight: 700; color: var(--info); border-bottom-color: var(--info); }
.he-reset { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: .95rem; }
.he-reset:hover { color: var(--danger); }
.he-input { width: 5.5rem; text-align: right; }
.he-error { display: block; color: var(--danger); white-space: normal; }
.he-classes tr[hidden] { display: none; }
.he-more { padding-top: 6px; padding-bottom: 10px; }
@media (max-width: 900px) {
    .he-table thead { display: none; }
    .he-table, .he-table tbody, .he-table tfoot, .he-table tr, .he-table td, .he-table th { display: block; width: 100%; }
    .he-table tr.he-row { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
    .he-table tr.he-row > td { padding: 0; border: 0; text-align: left; }
    .he-table tr.he-row > td:first-child, .he-table tr.he-row > td.he-own { grid-column: 1 / -1; }
    .he-table td.num { text-align: left; }
    .he-table td.he-done-col { text-align: left; }
    .he-table tfoot tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 12px; }
    .he-table tfoot th { padding: 0; border: 0; text-align: left; }
    .he-table td.num::before, .he-table td.he-comp::before, .he-table td.he-own::before, .he-table td.he-done-col::before {
        content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
}

/* ---- Pflanzenschutz: Geräte (Video 27) ------------------------------------------- */
.sd-settings { padding: 8px 14px; }
.sd-settings summary { cursor: pointer; font-size: .84rem; font-weight: 700; padding: 2px 0 6px; }
.sd-settings[open] summary { margin-bottom: 4px; }
.sd-parts { align-items: end; }
.sd-parts .check { margin-bottom: 14px; }
.sd-jki-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: #f7faf8; }
.sd-jki-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-jki-head [data-sd-jki-remove] { margin-left: auto; }
.sd-jki-type { margin-top: 6px; font-weight: 600; }
.sd-jki-cond { margin-top: 4px; line-height: 1.4; }
.sd-jki-full { margin-top: 4px; line-height: 1.4; }
.sd-jki-full summary { cursor: pointer; }
.sd-applied { color: var(--primary); margin: -4px 0 8px; }
.sd-nozzle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sd-nozzle:first-child { padding-top: 0; }
[data-sd-nozzles]:not(:empty) { margin-bottom: 10px; }
.jp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.jp-bar input[type=search] { flex: 1 1 220px; }
.jp-bar .check { margin: 0; }
.jp-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.jp-item { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; }
.jp-item:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 143, 78, .12); }
.jp-item.is-expired { opacity: .7; }
.jp-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jp-item-type { margin-top: 4px; font-weight: 600; font-size: .92rem; }
.jp-item-cond { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sd-table td { vertical-align: top; }
.sd-nozzle-cell { white-space: nowrap; }
.sd-nozzle-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sd-nozzle-manual { display: flex; gap: 8px; margin-top: 10px; }
.sd-nozzle-manual input { flex: 1 1 auto; min-width: 0; }
[data-sd-jki-optional] { margin: 0 0 8px; }

/* ---- Pflanzenschutz: Mittel (Video 28) -------------------------------------------- */
.psm-sync { margin-bottom: 12px; }
.psm-filter { margin-bottom: 10px; padding-bottom: 14px; }   /* Haken „Sondergenehmigungen“ klebte am Rand (31.10.2026) */
.psm-search { display: flex; gap: 8px; margin-bottom: 10px; }
.psm-search input { flex: 1 1 auto; min-width: 0; }
.psm-bbch-row { display: flex; align-items: center; gap: 6px; }
.psm-bbch-row input { width: 64px; }
.psm-permit { margin: 10px 0 0; }
.psm-count { margin: 6px 2px 10px; }
.psm-list { list-style: none; margin: 0; padding: 0; }
.psm-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.psm-item:first-child { border-top: 0; }
.psm-item > details, .psm-item > .psm-static { flex: 1 1 auto; min-width: 0; }
.psm-item summary { cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; list-style: none; }
.psm-item summary::-webkit-details-marker { display: none; }
.psm-item summary::before { content: '▸'; color: var(--muted); margin-right: 2px; }
.psm-item details[open] > summary::before { content: '▾'; }
.psm-name { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.psm-meta { white-space: nowrap; }
.psm-action { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.psm-body { padding: 10px 0 4px 14px; }
.pd-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pd-ingredients { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pd-title { margin: 12px 0 8px; font-size: .95rem; }
.pd-use { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.pd-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.pd-awg { margin-left: auto; }
.pd-dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.pd-dl dt { color: var(--muted); font-weight: 600; font-size: .8rem; }
.pd-dl dd { margin: 0; }
.pd-cond summary { cursor: pointer; color: var(--primary-dark); font-size: .85rem; }
.pd-cond-product { margin-top: 6px; }
.pd-cond-product h5 { margin: 10px 0 4px; font-size: .82rem; }
.pd-cond-list { margin: 6px 0 0; padding-left: 18px; font-size: .84rem; line-height: 1.45; }
.pd-cond-list li { margin-bottom: 6px; }
.pd-code { font-family: ui-monospace, monospace; font-size: .78rem; background: #eef2ef; border-radius: 4px; padding: 1px 5px; }
.pd-reduced { color: var(--primary-dark); font-weight: 600; }
.psm-em-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.psm-em-bar .check { margin: 0; }
.psm-em-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.psm-em { display: flex; flex-direction: column; gap: 8px; }
.psm-em.is-expired { opacity: .7; }
.psm-em-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.psm-em-uses { line-height: 1.45; }
.psm-em-period { color: var(--muted); }
.psm-em-bar-track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.psm-em-bar-track span { display: block; height: 100%; background: var(--primary); }
.psm-em-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
@media (max-width: 640px) {
    .pd-dl { grid-template-columns: 1fr; gap: 2px; }
    .pd-dl dd { margin-bottom: 6px; }
    .psm-item { flex-direction: column; }
    .psm-action { justify-content: flex-start; }
    .psm-body { padding-left: 0; }
    .psm-em-grid { grid-template-columns: 1fr; }
}
.psm-name .badge { align-self: flex-start; }

/* ---- Pflanzenschutz: Spritztagebuch (Video 29) --------------------------------------- */
.sd-year select { min-width: 96px; }
.sd-export { position: relative; }
.sd-export > summary { list-style: none; cursor: pointer; }
.sd-export > summary::-webkit-details-marker { display: none; }
.sd-export-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; min-width: 200px; }
.sd-export-menu a { padding: 9px 14px; color: var(--text); }
.sd-export-menu a:hover { background: #f2f6f3; text-decoration: none; }
.cu-pill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; margin: 0 0 12px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); width: fit-content; max-width: 100%; }
.cu-pill:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--primary); }
.cu-pill-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.cu-pill-bar, .cu-track { position: relative; display: inline-block; height: 8px; border-radius: 4px; background: var(--line); }
.cu-pill-bar { width: 120px; overflow: hidden; }
.cu-pill-bar span, .cu-fill { display: block; height: 100%; border-radius: 4px; background: #2f8f4e; }
.cu-1 .cu-pill-bar span, .cu-1 .cu-fill { background: #b8a200; }
.cu-2 .cu-pill-bar span, .cu-2 .cu-fill { background: #e08a00; }
.cu-near .cu-pill-bar span, .cu-near .cu-fill, .cu-over .cu-pill-bar span, .cu-over .cu-fill { background: var(--danger); }
.cu-pill.cu-near, .cu-pill.cu-over { border-color: var(--danger); }
.cu-card { margin-bottom: 14px; }
.cu-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cu-big { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.cu-big span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.cu-msg { max-width: 420px; font-weight: 600; }
.cu-2 .cu-msg, .cu-1 .cu-msg { color: #8a5d00; }
.cu-near .cu-msg, .cu-over .cu-msg { color: var(--danger); }
.cu-scale { margin: 14px 0 6px; }
.cu-track { display: block; height: 14px; border-radius: 7px; }
.cu-track .cu-fill { border-radius: 7px; }
.cu-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #555; }
.cu-ticks { display: flex; justify-content: space-between; margin-top: 4px; }
.sd-grid { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 14px; align-items: start; }
.sd-fields { position: sticky; top: 10px; max-height: calc(100vh - 20px); display: flex; flex-direction: column; }
.sd-fields-head h2, .sd-form h2 { font-size: 1.05rem; margin: 0 0 8px; }
.sd-quick-row { display: flex; gap: 8px; margin-top: 8px; }
.sd-quick-row select { flex: 1 1 auto; min-width: 0; }
.sd-field-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.sd-f { border-bottom: 1px solid var(--line); }
.sd-f.is-on { background: var(--primary-soft); }
.sd-f-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; }
.sd-f-row input[type=checkbox] { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.sd-f-name { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.sd-f-none { color: #8a5d00; }
.sd-f-part { color: var(--primary-dark); font-weight: 600; }
.sd-f-caret { color: var(--muted); }
.sd-f-body { padding: 0 14px 10px 42px; }
.sd-f-fruit { margin-bottom: 4px; }
.sd-f-fruit .check { margin: 4px 0; }
.sd-block { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.sd-block h3 { font-size: .92rem; margin: 0 0 8px; }
.sd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.sd-chip-x { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 4px; color: var(--muted); }
.btn-link { border: 0; background: none; padding: 0; color: var(--primary-dark); cursor: pointer; text-decoration: underline; font: inherit; }
.sd-area-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.sd-area-row span:first-child { flex: 1 1 auto; }
.sd-area-row input { width: 90px; }
.sd-inv { margin-bottom: 8px; }
.sd-cu-tag { font-size: .7rem; font-weight: 800; color: #8a5d00; background: #fff3cf; border-radius: 4px; padding: 0 4px; }
.sd-em-tag { font-size: .7rem; font-weight: 700; color: #8a5d00; }
.sd-search { margin-bottom: 8px; }
.sd-search input { width: 100%; }
.sd-search-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.sd-search-item { text-align: left; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; font: inherit; }
.sd-search-item:hover { border-color: var(--primary); }
.sd-prod { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
.sd-prod-head { display: flex; align-items: center; gap: 8px; }
.sd-prod-head button { margin-left: auto; }
.sd-prod-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sd-dose, .sd-ind { display: flex; flex-direction: column; gap: 2px; }
.sd-ind { flex: 1 1 240px; min-width: 0; }
.sd-ind select { width: 100%; }
.sd-dose-in { display: flex; gap: 4px; }
.sd-dose-in input { width: 90px; }
.sd-prod-info { margin-top: 6px; line-height: 1.5; }
.sd-cu-line { color: #8a5d00; }
.sd-cu-preview { border-radius: var(--radius-sm); padding: 8px 10px; background: var(--primary-soft); margin-top: 6px; }
.sd-cu-preview.cu-1, .sd-cu-preview.cu-2 { background: var(--warning-soft); color: #8a5d00; }
.sd-cu-preview.cu-near, .sd-cu-preview.cu-over { background: var(--danger-soft); color: var(--danger); }
.sd-dirs { display: flex; flex-wrap: wrap; gap: 4px; }
.sd-dir-field .label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.sd-submit { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.sd-submit p { margin: 0; }
.sd-list-filter { margin-bottom: 8px; }
.sd-cu-filter { margin: 0 0 6px; }
.sd-month { font-size: .95rem; margin: 16px 0 8px; color: var(--muted); }
.sd-job { margin-bottom: 8px; }
.sd-job-sum { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; list-style: none; }
.sd-job-sum::-webkit-details-marker { display: none; }
.sd-job-date { display: flex; flex-direction: column; min-width: 92px; }
.sd-job-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.sd-job-badges { display: flex; gap: 6px; }
.sd-job-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.sd-job-warn { margin-top: 10px; }
.sd-job-warn ul { margin: 4px 0; padding-left: 18px; }
.sd-dl { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 12px 0; font-size: .9rem; }
.sd-dl dt { color: var(--muted); font-weight: 600; font-size: .8rem; }
.sd-dl dd { margin: 0; }
.table-sm th, .table-sm td { padding: 6px 10px; font-size: .88rem; }
.sd-water { background: #eef5fb; border-radius: var(--radius-sm); padding: 8px 10px; margin: 10px 0; line-height: 1.5; }
.sd-job-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 900px) {
    .sd-grid { grid-template-columns: 1fr; }
    .sd-fields { position: static; max-height: none; }
    .sd-field-list { max-height: 50vh; }
    .sd-job-sum { flex-wrap: wrap; }
    .sd-dl { grid-template-columns: 1fr; }
}

/* ---- Spritztagebuch: Karte und Altes Land Pflanzenschutzverordnung ----------------------- */
.sd-fields-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.sd-fields-title h2 { margin: 0; }
.sd-view { margin: 0; }
.sd-map { height: 460px; height: min(460px, 60vh); }
.sd-alv { background: #eef5fb; border-radius: var(--radius-sm); padding: 10px 12px; border-top: 0; }
.sd-alv-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sd-alv-list li { line-height: 1.45; }
.sd-alv-list .ok, .sd-alv-list li.ok { color: #1f6b3a; }
.sd-alv-list .bad, .sd-alv-list li.bad { color: var(--danger); font-weight: 600; }
.sd-alv-grid { display: grid; grid-template-columns: 110px repeat(3, minmax(0, 1fr)); gap: 6px 8px; align-items: center; margin-bottom: 8px; }
.sd-alv-grid input { width: 100%; min-width: 0; }
.sd-alv-rec { background: #eef5fb; border-radius: var(--radius-sm); padding: 8px 10px; margin: 10px 0; line-height: 1.5; }
@media (max-width: 640px) {
    .sd-alv-grid { grid-template-columns: 80px repeat(3, minmax(0, 1fr)); }
}

/* Notfallzulassung: Anwendungen laut Bescheid (Dialog + Inventar) */
.psm-em-use { display: block; }
.psm-em-links { display: inline-flex; flex-direction: column; gap: 2px; }
.psm-em-links .icon { width: 15px; height: 15px; vertical-align: -2px; }
.psm-em-rows { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.psm-em-row { border: 1px solid var(--border, #e3e6e1); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.psm-em-row [data-em-remove] { align-self: flex-end; }
.psm-em-grid-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.psm-em-grid-row .field { margin: 0; }
.psm-em-grid-row .field span { font-size: .78rem; color: var(--muted, #6b7280); }
.psm-em-eppo { grid-column: span 2; }
.psm-em-pest { grid-column: span 4; }
.psm-em-dose, .psm-em-unit { grid-column: span 1; }
.psm-em-crown { grid-column: span 2; }
.psm-em-max { grid-column: span 2; }
.psm-em-apps, .psm-em-interval, .psm-em-wait { grid-column: span 2; }
@media (max-width: 640px) {
    .psm-em-grid-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .psm-em-eppo, .psm-em-pest, .psm-em-crown { grid-column: span 2; }
    .psm-em-dose, .psm-em-unit, .psm-em-max, .psm-em-apps, .psm-em-interval, .psm-em-wait { grid-column: span 1; }
}

/* Spritztagebuch: Hinweis im Export-Menü (nur intern, nicht im Ausdruck) */
.sd-export-warn { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; margin-bottom: 4px; border-radius: 8px;
    background: var(--warn-bg, #fff4dc); color: var(--warn-text, #7a4b00); max-width: 300px; line-height: 1.35; }
.sd-export-warn .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.sd-export-menu .sd-export-warn a { display: inline; padding: 0; text-decoration: underline; color: inherit; }

/* Auswertung: Preisentwicklung „Preis je Saison“ (Tafelware durchgezogen, alle Klassen gestrichelt) */
.eval-ptrend-sub { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.eval-ptrend-legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.eval-ptrend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.eval-ptrend-legend i.is-tafel { background: var(--ptrend-tafel, #26302b); }
.eval-ptrend-legend i.is-all { background: var(--ptrend-all, #8b9590); }
.eval-ptrend-tafel { fill: none; stroke: var(--ptrend-tafel, #26302b); stroke-width: 2.5; stroke-linejoin: round; }
.eval-ptrend-all { fill: none; stroke: var(--ptrend-all, #8b9590); stroke-width: 1.8; stroke-dasharray: 6 5; }
.eval-ptrend-dot-tafel { fill: var(--ptrend-tafel, #26302b); }
.eval-ptrend-dot-all { fill: var(--ptrend-all, #8b9590); }
.eval-ptrend-val { font-size: 11px; font-weight: 700; fill: var(--ptrend-tafel, #26302b); }
.eval-ptrend-val.is-all { font-weight: 500; fill: var(--ptrend-all, #8b9590); }
.eval-ptrend-now { fill: rgba(120, 130, 125, .12); }
.eval-ptrend-year.is-now { font-weight: 700; fill: var(--text, #1d2521); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --ptrend-tafel: #e4ebe7; --ptrend-all: #9aa5a0; }
}
:root[data-theme="dark"] { --ptrend-tafel: #e4ebe7; --ptrend-all: #9aa5a0; }

/* ---- Düngung: Dünger, Düngetagebuch, Blattdünger im Spritztagebuch ---------------------------------- */
.fert-kind { font-weight: 500; }
.fert-kind-mineral { background: #e6eef9; color: #2c5694; }
.fert-kind-organic { background: #f3ece2; color: #7a5122; }
.fert-kind-foliar { background: var(--primary-soft); color: var(--primary-dark); }
.fert-kind-bio { background: #eef5e0; color: #4d6b12; }
.fert-kind-lime { background: #ececec; color: #555555; }
.fert-pct-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.fert-preview { color: var(--muted); margin: 0; min-height: 1.2em; }
.fert-tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fert-tpl-list li { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.fert-pill { cursor: default; }
.fert-pill:hover { box-shadow: none; }
.fd-ferts { display: grid; gap: 8px; margin-bottom: 8px; }
.fd-fert-group > .small { display: block; margin-bottom: 2px; }
.fd-unit { align-self: center; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.fd-sum { border-radius: var(--radius-sm); padding: 8px 10px; background: var(--primary-soft); margin-top: 6px; line-height: 1.5; }
.sd-foliar-line { margin: 6px 0; }
@media (max-width: 640px) {
    .fert-pct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .fert-kind-mineral { background: #22324a; color: #a9c4ef; }
    :root:not([data-theme="light"]) .fert-kind-organic { background: #3a2e20; color: #e2c29a; }
    :root:not([data-theme="light"]) .fert-kind-lime { background: #333333; color: #cccccc; }
    :root:not([data-theme="light"]) .fert-kind-bio { background: #2c3a1a; color: #c4dc8e; }
    :root:not([data-theme="light"]) .fd-sum { background: rgba(47, 143, 78, .15); }
}
:root[data-theme="dark"] .fert-kind-mineral { background: #22324a; color: #a9c4ef; }
:root[data-theme="dark"] .fert-kind-organic { background: #3a2e20; color: #e2c29a; }
:root[data-theme="dark"] .fert-kind-lime { background: #333333; color: #cccccc; }
:root[data-theme="dark"] .fert-kind-bio { background: #2c3a1a; color: #c4dc8e; }
:root[data-theme="dark"] .fd-sum { background: rgba(47, 143, 78, .15); }
/* lange Dünger-/Mittelnamen mit Art-Abzeichen dürfen das Formular auf dem Handy nicht verbreitern */
.sd-grid > * { min-width: 0; }
.sd-prod-head { flex-wrap: wrap; }
/* Nährstoffvergleich (Düngetagebuch) */
.bal-form .card { margin-bottom: 14px; }
.bal-table input { width: 80px; text-align: right; }
.bal-table .bal-factor { width: 60px; }
.bal-table .bal-empty td { color: var(--muted); }
.bal-table .bal-sum td { border-top: 2px solid var(--line); }
.bal-diff { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 8px; }
.bal-diff-item { display: flex; flex-direction: column; min-width: 110px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--line); }
.bal-diff-item strong { font-size: 1.4rem; }
.bal-diff-item.bal-plus { background: var(--primary-soft); color: var(--primary-dark); }
.bal-diff-item.bal-minus { background: var(--warning-soft); color: #8a5d00; }
.bal-table td, .bal-table th { white-space: nowrap; }
/* Düngeplan + Bodenproben (Düngung Schritt 2) */
.plan-tools { display: grid; gap: 8px; margin-bottom: 12px; }
.plan-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plan-tools-row input[type=text] { width: 70px; }
.plan-card { margin-bottom: 12px; }
.plan-card.has-plan { border-left: 4px solid var(--primary); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plan-head .badge { margin-left: auto; }
.plan-info { margin: 4px 0 8px; line-height: 1.5; }
.plan-grid { display: grid; grid-template-columns: minmax(90px, auto) repeat(3, minmax(60px, 90px)) auto; gap: 4px 10px; align-items: center; }
.plan-grid input { width: 100%; text-align: right; }
.plan-sug, .plan-sum, .plan-ist { text-align: right; }
.plan-sum.plan-ok { color: var(--primary-dark); font-weight: 600; }
.plan-sum.plan-low { color: #8a5d00; font-weight: 600; }
.plan-sum.plan-high { color: var(--danger); font-weight: 600; }
.plan-items { display: grid; gap: 6px; margin-top: 10px; }
.plan-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.plan-item select { max-width: 220px; }
.plan-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.plan-note { flex: 1 1 180px; }
.plan-save { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 8px 0; z-index: 2; }
.plan-st-none { background: var(--line); color: var(--muted); }
.plan-st-open { background: #e6eef9; color: #2c5694; }
.plan-st-partial { background: var(--warning-soft); color: #8a5d00; }
.plan-st-done { background: var(--primary-soft); color: var(--primary-dark); }
.plan-st-over { background: var(--danger-soft); color: var(--danger); }
.bal-backfill { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.bal-backfill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.bal-backfill-grid label { display: flex; flex-direction: column; gap: 2px; }
.bal-backfill-grid input { width: 110px; }
.soil-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.soil-actions p { margin: 0; flex: 1 1 260px; }
.soil-card { margin-bottom: 12px; }
.soil-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.soil-head h3 { margin: 0; }
.soil-head-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.soil-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 640px) {
    .soil-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plan-grid { grid-template-columns: minmax(70px, auto) repeat(3, minmax(50px, 1fr)); }
    .plan-grid > button, .plan-grid > span:empty { grid-column: 1 / -1; justify-self: start; }
}
.plan-warn { color: #8a5d00; background: var(--warning-soft); border-radius: var(--radius-sm); padding: 2px 8px; margin: 0 0 6px; }
.plan-item-warn { flex-basis: 100%; margin: 0; }
.plan-tools-row input[data-plan-phmin] { width: 55px; }
.fd-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.fd-block-head h3 { margin: 0; }
#einkauf .bal-table input { width: 64px; }
#einkauf .bal-table td, #einkauf .bal-table th { padding-left: 6px; padding-right: 6px; }
#einkauf .bal-table th { white-space: normal; }
/* Wetter */
.weather-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 4px; }
.weather-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.weather-tile strong { font-size: 1.5rem; }
.weather-tile.is-wet { border-color: var(--primary); background: var(--primary-soft); }
.weather-chart-head, .weather-month { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.weather-chart-head h2, .weather-month h2 { margin: 0; }
.weather-svg { width: 100%; height: auto; display: block; }
.weather-svg .w-label { font-size: 10px; font-weight: 600; fill: var(--muted); }
.weather-svg .w-value { font-size: 10px; font-weight: 600; fill: var(--text, #222); }
.weather-svg .w-tick { font-size: 9px; fill: var(--muted); }
.weather-svg .w-axis { stroke: var(--line); stroke-width: 1; }
.weather-svg .w-grid { stroke: var(--line); stroke-width: .5; stroke-dasharray: 2 3; }
.weather-svg .w-zero { stroke: #2c5694; stroke-width: 1; stroke-dasharray: 4 3; }
.weather-svg .w-temp { fill: none; stroke: #c0392b; stroke-width: 1.6; }
.weather-svg .w-hum { fill: none; stroke: #2c5694; stroke-width: 1.3; }
.weather-svg .w-wind { fill: none; stroke: #7a5122; stroke-width: 1.3; }
.weather-svg .w-rain { fill: #3b82c4; }
.weather-svg .w-wet { fill: #2f8f4e; }
.weather-svg .w-strip-bg { fill: var(--line); opacity: .5; }
.weather-daily .is-frost td:nth-child(2) { color: #2c5694; font-weight: 600; }
.weather-test { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
.weather-status { margin-top: 14px; }
.weather-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; margin: 12px 0; color: inherit; }
.weather-strip:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--primary); }
.weather-strip-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sd-weather-auto { color: var(--primary-dark); }
.weather-daily td:first-child { white-space: nowrap; }
.rain-bad { color: #b45309; }
.weather-svg .w-rain-bad { fill: #f59e0b; opacity: .55; }
.psm-scab { display: inline-flex; align-items: center; gap: 4px; }
.psm-scab select { width: auto; padding: 2px 6px; font-size: .85rem; }
.weather-map { height: 320px; border-radius: var(--radius-sm); margin: 6px 0; }
.weather-fc { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.weather-fc-day { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.weather-fc-day .fc-min { color: #2c5694; }
.weather-fc-day .fc-max { color: #c0392b; font-weight: 600; }
.dash-scab { display: flex; gap: 8px; text-decoration: none; color: inherit; }
.psm-scab { flex-wrap: wrap; }
.psm-belag { display: inline-flex; align-items: center; gap: 3px; }
.psm-belag input { width: 3.6em; padding: 2px 4px; font-size: .85rem; }
.sd-belag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sd-belag input { width: 4.5em; }
.ann-status { margin: -4px 0 10px; }
.ann-upload-btn { cursor: pointer; }
.ann-upload-log { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface, #fff); }
.ann-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ann-filter-row input[type=search] { flex: 1 1 220px; min-width: 0; }
.ann-list { padding: 0; }
.ann-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ann-row:last-child { border-bottom: 0; }
.ann-row.is-new { background: var(--info-soft); }
.ann-main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: inherit; text-decoration: none; }
.ann-main:hover strong { text-decoration: underline; }
.ann-topics { flex-basis: 100%; color: var(--muted); }
.ann-snippet { flex-basis: 100%; font-style: italic; }
.ann-meta { flex: 0 0 auto; white-space: nowrap; padding-top: 2px; }
.ann-mailbox { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.ann-mb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.ann-mb-grid > * { min-width: 0; }
@media (max-width: 640px) { .ann-row { flex-wrap: wrap; } .ann-meta { white-space: normal; } }
.ann-ai-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
:root { --tl-s1: #e3f0e1; --tl-s2: #c6e2c6; --tl-s3: #9fcea5; --tl-s4: #72b583; --tl-s5: #4a9a65; --tl-s6: #2f7d4b; --tl-s7: #1b5c35; --tl-a: #1baf7a; --tl-b: #eb6834; --tl-e: #2a78d6; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --tl-s1: #24352a; --tl-s2: #2c4a35; --tl-s3: #2f6242; --tl-s4: #357b50; --tl-s5: #49985f; --tl-s6: #70b980; --tl-s7: #a9dcb1; --tl-a: #199e70; --tl-b: #d95926; --tl-e: #3987e5; }
}
:root[data-theme="dark"] { --tl-s1: #24352a; --tl-s2: #2c4a35; --tl-s3: #2f6242; --tl-s4: #357b50; --tl-s5: #49985f; --tl-s6: #70b980; --tl-s7: #a9dcb1; --tl-a: #199e70; --tl-b: #d95926; --tl-e: #3987e5; }
.tl { display: grid; gap: 14px; min-width: 0; font-variant-numeric: tabular-nums; }
.tl-card { display: grid; gap: 10px; min-width: 0; }
.tl-ago-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.tl-ago-head h2 { margin: 0; }
.tl-ago-nav { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tl-ago-line { margin: 0; }
.tl-ago-table { min-width: 720px; }
.tl-ago-table td, .tl-ago-table th { vertical-align: top; }
.tl-ago-now { background: var(--primary-soft); }
.tl-card h2, .tl-card h3 { margin: 0; }
.tl-card h3 { font-size: 15px; margin-top: 6px; }
.tl-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tl-fact { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.tl-fact b { display: block; font-size: 20px; line-height: 1.25; }
.tl-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.tl-ctl { display: grid; gap: 3px; }
.tl-ctl > span { font-size: 12px; color: var(--muted); }
.tl-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.tl-seg button { font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; border-right: 1px solid var(--line); padding: 6px 11px; cursor: pointer; }
.tl-seg button:last-child { border-right: 0; }
.tl-seg button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 600; }
.tl-seg button:disabled { opacity: .45; cursor: not-allowed; }
.tl-scroll { overflow-x: auto; }
.tl-svg { min-width: 680px; width: 100%; height: auto; display: block; }
.tl-svg text { fill: var(--muted); font: 12px var(--font); }
.tl-svg .tl-strong { fill: var(--text); font-weight: 600; }
.tl-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tl-table th, .tl-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tl-table th { font-weight: 600; color: var(--muted); font-size: 13px; }
.tl-table .num { text-align: right; white-space: nowrap; }
.tl-table .tl-hl, .tl-table .tl-sel td { background: var(--primary-soft); }
.tl-narrow { max-width: 420px; }
.tl-when { white-space: nowrap; font-weight: 600; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); align-items: center; }
.tl-key { display: inline-flex; align-items: center; gap: 6px; }
.tl-sw { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.tl-sw-a { background: var(--tl-a); } .tl-sw-b { background: var(--tl-b); } .tl-sw-e { background: var(--tl-e); width: 10px; border-radius: 50%; } .tl-sw-d { background: var(--text); width: 8px; height: 8px; border-radius: 50%; }
.tl-ramp { display: inline-flex; gap: 2px; }
.tl-ramp i { width: 14px; height: 10px; border-radius: 2px; display: block; }
.tl-grid { --tl-lab: 190px; display: grid; gap: 1px; min-width: 760px; }
.tl-grp { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 0 2px; }
.tl-row { display: grid; grid-template-columns: var(--tl-lab) 1fr; align-items: center; cursor: pointer; border-radius: 4px; background: none; border: 0; padding: 0; width: 100%; font: inherit; color: inherit; text-align: left; }
.tl-row:hover .tl-lab { color: var(--primary); }
.tl-row.is-open { background: var(--primary-soft); }
.tl-lab { font-size: 14px; padding: 1px 8px 1px 2px; overflow-wrap: anywhere; }
.tl-cells { display: grid; gap: 1px; height: 20px; }
.tl-cells i { display: block; position: relative; border-radius: 2px; }
.tl-cells i.is-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 1.5px var(--card); }
.tl-axis { display: grid; grid-template-columns: var(--tl-lab) 1fr; font-size: 12px; color: var(--muted); }
.tl-ticks { display: grid; }
.tl-ticks span { white-space: nowrap; border-left: 1px solid var(--line); padding-left: 3px; }
.tl-detail { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; margin: 4px 0 8px; }
.tl-win { display: grid; gap: 3px; border-left: 3px solid var(--primary); padding-left: 10px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.tl-chip { background: var(--primary-soft); border-radius: 6px; padding: 1px 7px; font-size: 13px; }
.tl-chip b { font-weight: 600; }
.tl-edit summary { cursor: pointer; font-size: 14px; }
.tl-edit-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
.tl-edit-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.tl-tip { position: fixed; z-index: 200; max-width: 300px; background: var(--text); color: var(--card); font-size: 13px; line-height: 1.35; padding: 6px 9px; border-radius: 6px; pointer-events: none; display: none; }
@media (max-width: 640px) { .tl-grid { --tl-lab: 130px; } .tl-when { white-space: normal; } }
/* Sammelzeile in Händler-Abrechnungen */
.ts-collective { display: flex; align-items: center; gap: 6px; }
.ts-collective input { width: auto; }
/* Neue Ordnung der Seitenleiste (ANNAHMEN 353): Unterseiten eingerückt */
.nav-sub { list-style: none; margin: 0 0 2px; padding: 0 0 0 22px; }
.nav-sub .nav-link { font-size: .8rem; padding-top: 3px; padding-bottom: 3px; opacity: .85; }
.nav-sub .nav-link .icon { width: 14px; height: 14px; }
.nav-sub .nav-link.is-active { opacity: 1; }
.filter-memory-list { font-weight: 600; }
.eval-gap { margin: 8px 0 0; }
/* Startseite „Heute“ (ANNAHMEN 355) */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 14px 0; }
@media (min-width: 980px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.dash-sec { padding: 14px 16px; }
.dash-sec > .h3, .dash-sec .card-head .h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.dash-sec .card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-attention { margin: 12px 0; border-left: 4px solid var(--danger, #b42318); }
.dash-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.dash-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; color: inherit; text-decoration: none; line-height: 1.35; }
.dash-row .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--muted); }
.dash-row > span:first-of-type { flex: 1; }
a.dash-row:hover { background: var(--hover); }
.dash-go { color: var(--muted); font-size: 1.2rem; line-height: 1; }
.dash-warn .icon { color: var(--warning, #b54708); }
.dash-bad .icon { color: var(--danger, #b42318); }
.dash-bad > span:first-of-type { font-weight: 600; }
.dash-cal { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.dash-yesterday { white-space: nowrap; }
.dash-money { margin: 16px 0; }
.dash-money > .h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.kpi-est { font-size: .72rem; font-weight: 600; color: var(--muted); vertical-align: middle; }
/* Steckbrief Sorte (ANNAHMEN 356) */
.vp-dot { width: 14px; height: 14px; margin-right: 8px; vertical-align: middle; }
.vp-years { margin: 0 0 12px; }
.vp-kpis { margin-bottom: 4px; }
.vp-bars { display: flex; flex-direction: column; gap: 4px; }
.vp-bar-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 6px; color: inherit; text-decoration: none; }
.vp-bar-row:hover, .vp-bar-row.is-active { background: var(--hover); }
.vp-bar-row.is-active .vp-bar-label { font-weight: 700; }
.vp-bar { height: 10px; background: var(--surface-2, #eee); border-radius: 5px; overflow: hidden; }
.vp-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.vp-bar-val { white-space: nowrap; font-size: .9rem; }
.vp-prices { margin: 10px 0 0; }
.vp-quality { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.vp-q { display: flex; flex-direction: column; min-width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.vp-q strong { font-size: 1.2rem; }
.vp-sub { margin: 14px 0 6px; }
.vp-open { margin-bottom: 10px; }
.fp-map { display: block; width: 100%; max-height: 320px; }
.cp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.cp-badges .badge { text-decoration: none; }
.cp-weeks { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 6px; }
.cp-week { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 8px; }
.cp-week span { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; }
.cp-week small { font-size: .62rem; color: var(--muted); margin-top: 2px; }
.cp-scroll { max-height: 360px; overflow-y: auto; }
.kpi-warn .kpi-value { color: var(--warning, #b54708); }
.ep-pay td, .ep-pay th { padding: 5px 8px; }
.ep-pay-sum td { border-top: 2px solid var(--line); }
.ep-done { opacity: .75; }
@media (min-width: 980px) { .vp-wide { grid-column: 1 / -1; } }
.stock-profile-link { display: inline-block; margin: 0 14px 6px; }
/* Gemeinsame Jahreswahl (ANNAHMEN 361) */
.year-scope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; padding: 6px 10px; border-radius: 8px; background: var(--warning-soft, #fff4e0); font-size: .88rem; }
.year-scope .icon { width: 15px; height: 15px; }
.year-scope a { margin-left: auto; font-weight: 600; }
.eval-yearpick { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.eval-yearpick label { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.eval-yearpick select { width: auto; }
/* BBCH-Vorschlag im Spritztagebuch */
.sd-bbch-hints { display: grid; gap: 6px; margin: 6px 0 2px; padding: 8px 10px; border-radius: 6px; background: var(--primary-soft); }
.sd-bbch-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; align-items: center; }
@media (max-width: 640px) { .sd-bbch-row { grid-template-columns: minmax(0, 1fr); } }
/* Blüh-Uhr */
.bloom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 12px; }
.bloom-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.bloom-card h2, .bloom-card p { margin: 0; }
.bloom-date { font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bloom-date-quiet { font-size: 1rem; font-weight: 600; color: var(--muted); }
.bloom-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bloom-bar span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.bloom-test summary { cursor: pointer; }
.bloom-test .table { font-size: .82rem; }
.bloom-test .table th, .bloom-test .table td { padding: 4px 6px; letter-spacing: 0; }
/* Preise unter Mittel und Dünger */
.psm-item:has(> .ip-box) { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.psm-item > .ip-box { grid-column: 1 / -1; }
@media (max-width: 640px) { .psm-item:has(> .ip-box) { grid-template-columns: minmax(0, 1fr); } }
.ip-box { display: grid; gap: 6px; min-width: 200px; }
.ip-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.ip-suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 8px; border-radius: 6px; background: var(--primary-soft); }
.ip-suggest > span { flex: 1 1 220px; min-width: 0; }
.ip-form { display: grid; gap: 8px; justify-items: start; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ip-form h3 { margin: 0; font-size: 15px; }
.ip-form .grid-3, .ip-form .field, .ip-form select { width: 100%; }
.ip-custom { padding: 12px 14px; margin-top: 12px; }
.ip-custom summary { cursor: pointer; font-weight: 600; }
.ip-custom-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ip-custom-form .field { margin: 0; }
.ts-deleted { padding: 12px 14px; margin-top: 12px; }
.ts-deleted summary { cursor: pointer; font-weight: 600; }
.circ-deadlines { padding: 12px 14px; margin-bottom: 12px; }
.circ-deadlines ul { list-style: none; margin: 6px 0 0; padding: 0; }
.circ-deadlines li { display: flex; gap: 10px; padding: 3px 0; }
.circ-deadlines time { flex: 0 0 auto; font-weight: 600; }
.circ-doc { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.circ-doc:last-child { border-bottom: 0; }
.circ-doc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.circ-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.circ-point { padding-left: 10px; border-left: 3px solid var(--line); }
.circ-point.is-w3 { border-left-color: var(--primary); }
.circ-point p { margin: 2px 0 0; }
.circ-point-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ann-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ann-pdf { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ann-sec { margin-bottom: 14px; }
.ann-sec h3 { margin: 0 0 6px; font-size: 1rem; }
.ann-sec ul { margin: 4px 0; padding-left: 18px; }
.ann-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; font-size: .92rem; }
.ann-kv dt { color: var(--muted); }
.ann-kv dd { margin: 0; }
.ann-apply { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.ann-apply select, .ann-apply input { padding: 3px 6px; font-size: .88rem; }
.ann-apply input { width: 5em; }
.ann-apply input[type=date] { width: auto; }
.ann-belag { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; }
@media (max-width: 900px) { .ann-detail { grid-template-columns: 1fr; } .ann-pdf { height: 60vh; } }
.ann-cmp td { vertical-align: top; }
.ann-cmp-mark { font-weight: 700; }
.ann-cmp-ok .ann-cmp-mark { color: var(--success, #2e7d32); }
.ann-cmp-similar .ann-cmp-mark { color: #b07d00; }
.ann-cmp-off .ann-cmp-mark { color: var(--danger); }
.ann-cmp-off td { background: var(--danger-soft); }
.ann-stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.ann-stat > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.prog-durchsagen { margin: 8px 0; }
.prog-durchsagen ul { margin: 4px 0; padding-left: 18px; }
.prog-variante { display: inline-flex; gap: 6px; align-items: center; }
.ann-periods { list-style: none; padding: 0; margin: 6px 0 14px; }
.ann-periods li { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* ---- QS-Handbuch (Teil A) ---------------------------------------------------------------- */
.qs-work { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 960px) { .qs-work { grid-template-columns: 280px minmax(0, 1fr); } }
.qs-side { display: flex; flex-direction: column; max-height: calc(100vh - 150px); overflow: hidden; }
@media (max-width: 959px) { .qs-side { max-height: 260px; } }
.qs-tabs { display: flex; border-bottom: 1px solid var(--line); }
.qs-tab { flex: 1; border: 0; background: none; padding: 9px 4px; font: inherit; font-weight: 600; font-size: .78rem; color: var(--muted); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; justify-content: center; }
.qs-tab .icon { width: 14px; height: 14px; }
.qs-tab.is-active { color: var(--primary-dark); box-shadow: inset 0 -2px 0 var(--primary); }
.qs-count { background: var(--line); border-radius: 10px; padding: 0 6px; font-size: .75rem; }
.qs-panel { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.qs-panel > p { margin: 0 0 6px; }
.qs-filter { width: 100%; margin-bottom: 6px; }
.qs-pagelist { list-style: none; margin: 0; padding: 0; }
.qs-pagelist button { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; width: 100%; text-align: left; border: 0; background: none; padding: 5px 6px; border-radius: var(--radius-sm); font: inherit; font-size: .8rem; cursor: pointer; color: var(--text); }
.qs-pagelist button:hover { background: var(--bg); }
.qs-pagelist button.is-current { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.qs-pn { color: var(--muted); text-align: right; }
.qs-pl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-pc { color: var(--muted); font-size: .75rem; }
.qs-side-foot { border-top: 1px solid var(--line); padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.qs-side-foot form { margin-left: auto; }
.qs-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.qs-toolbar { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 6px 10px; position: sticky; top: 8px; z-index: 5; }
.qs-group { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.qs-pageno input { width: 64px; text-align: right; padding: 4px 6px; }
.qs-mode .btn.is-active, .qs-group [data-qs-tool].is-active { background: var(--primary-soft); color: var(--primary-dark); border-color: var(--primary); }
.icon-btn.is-active { color: var(--warning); }
.qs-status { margin-left: auto; }
.qs-menu { position: relative; display: inline-block; }
.qs-menu-list { position: absolute; top: 100%; left: 0; z-index: 20; min-width: 240px; max-height: 360px; overflow-y: auto; padding: 6px; margin-top: 4px; box-shadow: var(--shadow-lg); }
.qs-menu-list > button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: var(--radius-sm); font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); }
.qs-menu-list > button:hover { background: var(--bg); }
.qs-menu-list p { margin: 4px 8px; }
.qs-font { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.qs-font label { display: flex; gap: 6px; align-items: center; font-size: .85rem; }
.qs-font input { width: 70px; }
.qs-font .btn { justify-content: flex-start; }
.qs-progress progress, .modal progress { width: 100%; }
.qs-progress p { margin: 0 0 6px; }
.qs-stage { position: relative; overflow: auto; height: calc(100vh - 150px); min-height: 420px; background: #8a908c; border-radius: var(--radius); padding: 8px 12px 12px; }
.qs-sheet { width: fit-content; margin: 0 auto 18px; }
.qs-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; font-size: .78rem; padding: 2px 0 4px; }
.qs-sheet-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qs-sheet-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }
.qs-sheet-btn { border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .15); color: #fff; border-radius: 6px; padding: 1px 8px; font: inherit; cursor: pointer; }
.qs-sheet-btn:hover { background: rgba(0, 0, 0, .3); }
.qs-sheet .qs-menu-list { left: auto; right: 0; min-width: 210px; }
.qs-page { position: relative; background: var(--surface); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.qs-page canvas { display: block; position: absolute; inset: 0; }
.qs-layer { position: absolute; inset: 0; }
.qs-stage.is-drawing .qs-layer { cursor: crosshair; }
.qs-field { position: absolute; box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; }
.qs-field textarea, .qs-field input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0 1px; border: 0; border-radius: 0; background: rgba(42, 111, 151, .10); color: #0b2a6b; font: inherit; line-height: inherit; resize: none; overflow: hidden; white-space: pre; box-shadow: none; min-height: 0; }
.qs-field.is-multi textarea { white-space: pre-wrap; }
.qs-field textarea:focus, .qs-field input:focus { outline: 2px solid var(--info); outline-offset: 0; background: rgba(255, 255, 255, .9); }
.qs-field.is-over textarea, .qs-field.is-over input { box-shadow: inset 0 0 0 1px var(--danger); }
.qs-checkbox { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 1px solid rgba(42, 111, 151, .6); background: rgba(42, 111, 151, .10); color: #0b2a6b; font: inherit; font-weight: 700; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qs-checkbox:focus-visible { outline: 2px solid var(--info); }
.qs-star { position: absolute; top: -8px; right: -8px; font-size: 11px; line-height: 1; color: var(--warning); pointer-events: none; text-shadow: 0 0 2px #fff; }
.qs-handle { display: none; position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; background: var(--primary); border: 1px solid #fff; cursor: nwse-resize; }
.qs-stage.is-edit .qs-field { outline: 1px dashed rgba(47, 143, 78, .9); cursor: move; }
.qs-stage.is-edit .qs-field textarea, .qs-stage.is-edit .qs-field input, .qs-stage.is-edit .qs-checkbox { pointer-events: none; background: rgba(47, 143, 78, .12); }
.qs-stage.is-edit .qs-field.is-selected { outline: 2px solid var(--primary); z-index: 2; }
.qs-stage.is-edit .qs-field.is-selected .qs-handle { display: block; }
.qs-field.is-selected:not(:focus-within) textarea, .qs-field.is-selected:not(:focus-within) input { background: rgba(42, 111, 151, .22); }
.qs-ghost { position: absolute; border: 1px dashed var(--primary); background: rgba(47, 143, 78, .15); pointer-events: none; }
.qs-import-result { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--info-soft); margin: 8px 0; font-size: .9rem; }
.qs-deleted { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; align-items: center; padding: 5px 6px; font-size: .8rem; border-bottom: 1px solid var(--line); }
.qs-deleted .qs-pl { white-space: normal; }
.qs-howto { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.qs-howto .check { align-items: flex-start; }
.qs-doclist { list-style: none; margin: 0 0 8px; padding: 0; }
.qs-doclist li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.qs-doc-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 280px; }
.qs-doc-rename { display: flex; gap: 6px; }
.qs-doc-rename input { flex: 1; min-width: 0; }
.qs-doc-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qs-doc-actions form { margin: 0; }
.qs-doc-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qs-doc-upload label.btn { cursor: pointer; }
/* QS-Handbuch Teil B: Unterschriften, PDF */
.qs-signature { display: flex; }
.qs-sigselect { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0 2px; border: 1px dashed rgba(142, 68, 173, .7); border-radius: 0; background: rgba(142, 68, 173, .08); color: #5b2c6f; font: inherit; font-size: max(10px, .9em); min-height: 0; }
.qs-field.is-signed .qs-sigselect { background: rgba(142, 68, 173, .16); }
.qs-stage.is-edit .qs-sigselect { pointer-events: none; }
.qs-siglist { list-style: none; margin: 0 0 14px; padding: 0; }
.qs-siglist li[data-id] { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qs-sig-img { height: 44px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 6px; font-size: .72rem; color: var(--muted); background: var(--surface); overflow: hidden; }
.qs-sig-img img { max-width: 100%; max-height: 100%; }
.qs-sig-who { display: flex; flex-direction: column; min-width: 0; }
.qs-sig-btns { display: inline-flex; gap: 4px; align-items: center; }
.qs-sig-new { border-top: 1px solid var(--line); padding-top: 10px; }
.qs-sig-formbtns { display: flex; gap: 8px; }
.qs-pad-wrap { position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.qs-pad { display: block; width: 100%; height: 240px; touch-action: none; cursor: crosshair; }
.qs-pad-line { position: absolute; left: 6%; right: 6%; bottom: 28%; border-bottom: 1px solid #c9cfcb; pointer-events: none; }
.qs-pad-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 10px; }
@media (max-width: 700px) {
    .qs-sign-modal { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
    .qs-sign-modal .modal-box { max-height: 100vh; height: 100%; }
    .qs-sign-modal.is-pad .qs-pad { height: calc(100vh - 230px); min-height: 220px; }
    .qs-siglist li[data-id] { grid-template-columns: 90px 1fr; }
    .qs-sig-btns { grid-column: 1 / -1; }
}
.qs-chapters { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; max-height: 220px; overflow-y: auto; }
.qs-range { display: flex; gap: 12px; padding-left: 26px; }
.qs-range input { width: 80px; }
.qs-overflow { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
.qs-annex-pick { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.qs-annex-pick legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.qs-signerpick { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; padding: 2px 8px; border-radius: var(--radius-sm); background: rgba(142, 68, 173, .1); color: #5b2c6f; }
.qs-signerpick select { padding: 3px 6px; font-size: .85rem; max-width: 220px; }

/* ==========================================================================
   Layout-Runde (30.10.2026): Darstellung je Benutzer – Farben, Schrift, Navigation, Kopfleiste, Handy-Leiste
   ========================================================================== */

/* ---- Farbvorschläge ------------------------------------------------------- */
/* Helle Farben (Nutzer 30.10.2026: hellerer Hintergrund) – Karten mit feiner Kante statt Schatten */
html[data-theme="frutavo"], html[data-theme="apfel"], html[data-theme="wiese"], html[data-theme="weiss"] {
    --shadow: 0 1px 2px rgba(20, 40, 30, .04);
}
html[data-theme="frutavo"] .card, html[data-theme="apfel"] .card, html[data-theme="wiese"] .card, html[data-theme="weiss"] .card { border: 1px solid var(--line); }
/* Klassisch hell: nah an frutavo, sehr helles warmes Weiß */
html[data-theme="frutavo"] { --bg: #fbfaf7; --line: #ece8e1; --line-strong: #dcd6cc; }
/* Apfel: frisches Grün, grüne Seitenleiste (heller als der erste Entwurf) */
html[data-theme="apfel"] {
    --bg: #f8faf6; --line: #e5ebe1; --line-strong: #d0d9cb;
    --primary: #4c9a2a; --primary-dark: #3a7a1e; --primary-soft: #eaf4e4;
    --side-bg: #2f5a41; --side-text: #f1f7f2; --side-muted: #b5cfbd; --side-hover: rgba(255, 255, 255, .10);
    --side-active-bg: #5aa832; --side-active-text: #ffffff;
}
html[data-theme="apfel"] .sidebar { border-right-color: #2f5a41; }
html[data-theme="apfel"] .sidebar-foot, html[data-theme="apfel"] .nav-favs { border-color: rgba(255, 255, 255, .15); }
html[data-theme="apfel"] .nav-acc ul { border-left-color: rgba(255, 255, 255, .18); }
html[data-theme="apfel"] .sidebar .icon-btn { color: var(--side-text); }
html[data-theme="apfel"] .nav-acc-title.is-active .icon:first-child { color: #c9ecb3; }
/* Wiese: ganz hell, hellgrüne Seitenleiste */
html[data-theme="wiese"] {
    --bg: #fafcf9; --line: #e4ebe1; --line-strong: #cfd9cb;
    --primary: #4c9a2a; --primary-dark: #3a7a1e; --primary-soft: #e9f4e3;
    --side-bg: #e9f3e6; --side-text: #1f3a29; --side-muted: #5f7a66; --side-hover: rgba(76, 154, 42, .10);
    --side-active-bg: #4c9a2a; --side-active-text: #ffffff;
}
html[data-theme="wiese"] .sidebar { border-right-color: #d6e6d0; }
/* Salbei (Nutzer 06.11.2026): Standard, gedecktes warmes Grün auf Creme */
html[data-theme="salbei"] {
    --shadow: 0 1px 2px rgba(60, 40, 20, .05);
    --tl-s1: color-mix(in srgb, var(--primary) 12%, var(--card)); --tl-s2: color-mix(in srgb, var(--primary) 25%, var(--card)); --tl-s3: color-mix(in srgb, var(--primary) 38%, var(--card));
    --tl-s4: color-mix(in srgb, var(--primary) 52%, var(--card)); --tl-s5: color-mix(in srgb, var(--primary) 68%, var(--card)); --tl-s6: var(--primary); --tl-s7: var(--primary-dark);
    --bg: #f8f6ef; --card: #fffefa; --surface: #fffefa; --surface-2: #f7f4ea; --hover: #f0eee1;
    --text: #2f3327; --muted: #686c5c; --line: #e8e5d8; --line-strong: #d8d5c4;
    --primary: #66784b; --primary-dark: #4f5e39; --primary-soft: #eef0df;
    --side-bg: #eceedd; --side-text: #333a28; --side-muted: #646c52; --side-hover: rgba(102, 120, 75, .12);
    --side-active-bg: #66784b; --side-active-text: #ffffff;
}
html[data-theme="salbei"] .card { border: 1px solid var(--line); }
html[data-theme="salbei"] .sidebar { border-right-color: #dfe2cc; }
/* Weiß: reines Weiß, Flächen nur durch feine Linien getrennt */
html[data-theme="weiss"] {
    --bg: #ffffff; --line: #e7ebe8; --line-strong: #d3d9d5; --side-bg: #f6f8f5;
}
/* Dunkel – auch für „wie das Gerät“, wenn das Gerät dunkel eingestellt ist */
html[data-theme="dunkel"] {
    --bg: #121614; --card: #1b211e; --surface: #1b211e; --surface-2: #202723; --hover: #27302b;
    --text: #e3eae5; --muted: #9aa69f; --line: #2c3631; --line-strong: #3b4741;
    --primary: #4fb06e; --primary-dark: #8fd6a6; --primary-soft: #1f3a2a;
    --danger: #e0685a; --danger-soft: #3a2220; --warning: #e0a83a; --warning-soft: #3a3020; --info: #6aa9d1; --info-soft: #1f2f3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --bg: #121614; --card: #1b211e; --surface: #1b211e; --surface-2: #202723; --hover: #27302b;
        --text: #e3eae5; --muted: #9aa69f; --line: #2c3631; --line-strong: #3b4741;
        --primary: #4fb06e; --primary-dark: #8fd6a6; --primary-soft: #1f3a2a;
        --danger: #e0685a; --danger-soft: #3a2220; --warning: #e0a83a; --warning-soft: #3a3020; --info: #6aa9d1; --info-soft: #1f2f3a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 40px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}
@media (prefers-color-scheme: light) { html[data-theme="auto"] { --bg: #f6f3ee; } }
html[data-theme="dunkel"] input, html[data-theme="dunkel"] select, html[data-theme="dunkel"] textarea { color: var(--text); }
html[data-theme="dunkel"] .qs-stage, html[data-theme="dunkel"] .leaflet-container { filter: none; }

/* ---- Schriftgröße ----------------------------------------------------------- */
html[data-font="gross"] { font-size: 112.5%; }
html[data-font="gross"] body { font-size: 17px; }
html[data-font="gross"] .nav-link { font-size: 1rem; padding-top: 9px; padding-bottom: 9px; }

/* ---- Seitenleiste: Bereiche, Favoriten, Akkordeon ------------------------------ */
.nav-section-title { display: flex; align-items: center; gap: 6px; padding: 8px 10px 4px; font-size: .72rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--side-muted); }
.nav-section-title .icon { width: 14px; height: 14px; }
.nav-favs ul, .nav-areas { list-style: none; margin: 0; padding: 0; }
.nav-favs { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.nav-areas { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-area { padding-top: 10px; padding-bottom: 10px; font-weight: 600; }
.nav-count { margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--side-muted); }
.nav-link.is-active .nav-count { color: inherit; opacity: .8; }
.nav-acc { margin-top: 2px; }
.nav-acc-title { display: flex; align-items: center; gap: .65rem; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--side-text); font: inherit; font-size: .92rem; font-weight: 600; text-align: left; cursor: pointer; }
.nav-acc-title .icon { color: var(--side-muted); }
.nav-acc-title:hover { background: var(--side-hover); }
.nav-acc-title.is-active .icon:first-child { color: var(--primary); }
.nav-acc-title .nav-group-arrow { margin-left: auto; }
.nav-acc ul { padding-left: 14px; margin-bottom: 4px; border-left: 2px solid var(--line); margin-left: 18px; }
.nav-acc .nav-link { font-size: .86rem; padding-top: 6px; padding-bottom: 6px; }
.user-row { display: flex; align-items: center; gap: 4px; }
.user-row form { margin: 0; }
.user-row .icon-btn { color: var(--side-muted); }

/* ---- Kopfleiste über dem Inhalt: Bereich › Seite, Favorit, Reiter ------------------- */
.pagebar { margin: -6px 0 16px; }
.pagebar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); min-width: 0; }
.crumbs .icon { width: 15px; height: 15px; }
.crumb-area { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.crumb-page { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; background: none; color: var(--muted);
    font: inherit; font-size: .8rem; padding: 3px 8px; border-radius: 999px; cursor: pointer; }
.fav-btn:hover { border-color: var(--line-strong); }
.fav-btn .icon { width: 16px; height: 16px; }
.fav-btn.is-on { color: var(--warning); }
.fav-btn.is-on .icon { fill: currentColor; }

/* ---- Handy-Leiste unten ------------------------------------------------------- */
.bottombar { display: none; }
@media (max-width: 959px) {
    .bottombar {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
        background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bb-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px;
        border: 0; background: none; color: var(--muted); font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; padding: 6px 2px; }
    .bb-item .icon { width: 22px; height: 22px; }
    .bb-item.is-active { color: var(--primary); }
    .bb-item:hover { text-decoration: none; }
    .main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    .pagebar { margin-top: 0; }
}

/* ---- Fenster „Darstellung“ ------------------------------------------------------- */
.ui-choices { display: grid; gap: 8px; }
.ui-choices.ui-row { display: flex; gap: 18px; }
.ui-choice { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.ui-choice:has(input:checked), .ui-theme:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ui-nav-sketch { position: relative; flex: 0 0 64px; height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ui-nav-sketch i { position: absolute; left: 4px; width: 14px; height: 4px; border-radius: 2px; background: var(--primary); }
.ui-nav-sketch i:nth-child(1) { top: 8px; } .ui-nav-sketch i:nth-child(2) { top: 16px; } .ui-nav-sketch i:nth-child(3) { top: 24px; }
.ui-nav-sketch b { position: absolute; left: 24px; right: 4px; top: 8px; bottom: 6px; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); }
.ui-nav-areas b { border-top: 6px solid var(--primary-soft); }
.ui-nav-groups i:nth-child(2) { left: 8px; width: 10px; opacity: .6; } .ui-nav-groups i:nth-child(3) { left: 8px; width: 10px; opacity: .6; }
.ui-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ui-theme { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.ui-theme input, .ui-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ui-swatch { position: relative; height: 46px; border-radius: 6px; border: 1px solid var(--line-strong); overflow: hidden; }
.ui-swatch span:first-child { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; }
.ui-swatch span:last-child { position: absolute; left: 38%; right: 10%; top: 14px; height: 10px; border-radius: 5px; }
.ui-favs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* ==========================================================================
   Layout-Runde (30.10.2026): Seiten aufräumen – Grundregeln
   ========================================================================== */
.pagebar .tabs { margin: 8px 0 0; }
/* Reiter der zusammengefassten Seiten (Navigation zusammengefasst 31.10.2026) – auch am Handy */
.family-tabs { margin: -4px 0 14px; }
@media print { .family-tabs { display: none; } }
@media (max-width: 959px) {
    .pagebar { display: none; }
    .topbar .fav-btn { padding: 6px; border: 0; }
    .page-head { margin-bottom: 12px; }
    .page-head h1 { font-size: 1.35rem; }
}
.topbar .fav-btn .icon { width: 20px; height: 20px; }

/* Erklärtext: erster Satz, Rest hinter ⓘ */
.info-btn { border: 0; background: none; color: var(--primary); font-size: 1rem; line-height: 1; padding: 0 2px; cursor: pointer; vertical-align: baseline; }
.info-btn[aria-expanded="true"] { color: var(--muted); }
.intro-more { display: block; margin-top: 4px; }

/* Filter einklappbar */
.filter-toggle-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; align-self: flex-end; min-height: 38px; }
.filter-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; cursor: pointer; }
.filter-chip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.filter-bar.is-collapsed .filter-more { display: none !important; }
.psm-filter .filter-bar.is-collapsed { margin-top: 6px; }

/* „⋯ Mehr“ */
.more-menu { position: relative; display: inline-block; }
.more-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 230px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
    box-shadow: var(--shadow-lg); margin: 0; }
.more-list[hidden] { display: none; }
.more-list { max-width: calc(100vw - 16px); }   /* nie breiter als der Bildschirm (31.10.2026) */
.more-list > *, .more-list form > .btn { width: 100%; justify-content: flex-start; }
.more-list .btn { border-color: transparent; background: none; box-shadow: none; }
.more-list .btn:hover { background: var(--hover); }
.more-list .hide-sm { display: inline !important; }
.more-list form { margin: 0; }

/* Einstellungen: Liste links statt Reiter */
.side-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.side-nav-select { width: 100%; }
.side-nav-list { display: none; list-style: none; margin: 0; padding: 6px; }
.side-nav-link { display: flex; align-items: center; gap: .6rem; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: .9rem; }
.side-nav-link .icon { color: var(--muted); }
.side-nav-link:hover { background: var(--hover); text-decoration: none; }
.side-nav-link.is-active { background: var(--primary-soft); color: var(--primary-dark); }
.side-nav-link.is-active .icon { color: var(--primary); }
.side-nav-link.is-danger { color: var(--danger); }
.side-body { min-width: 0; }
@media (min-width: 900px) {
    .side-layout { grid-template-columns: 230px minmax(0, 1fr); }
    .side-nav { position: sticky; top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
    .side-nav-select { display: none; }
    .side-nav-list { display: block; }
}

/* Handy: Listen-Tabellen als Karten */
@media (max-width: 700px) {
    table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
    table.table-cards thead { display: none; }
    table.table-cards tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 10px; padding: 6px 10px; background: var(--card); }
    table.table-cards tr[hidden] { display: none; }
    table.table-cards td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
    table.table-cards td[data-label]::before { content: attr(data-label); font-size: .75rem; font-weight: 600; color: var(--muted); text-align: left; flex: 0 0 38%; }
    table.table-cards td:not([data-label]) { display: block; text-align: left; }
    .table-wrap:has(> table.table-cards) { overflow: visible; }
}

/* Layout-Runde (30.10.2026): einzelne Seiten */
.hide-mobile { }
@media (max-width: 700px) { .hide-mobile { display: none !important; } }
/* Dashboard: Drucker-Warnung als schmale Zeile, Kennzahlen am Handy 2 × 2 */
.printer-alert { padding: 6px 12px; font-size: .85rem; gap: 8px; }
.printer-alert .btn { padding: 3px 10px; }
@media (min-width: 700px) { .printer-alert > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 599px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-grid .kpi { padding: 12px; }
    .kpi-grid .kpi-value { font-size: 1.3rem; }
}
/* Spritztagebuch: Kupfer-Anzeige am Handy schmal */
@media (max-width: 700px) {
    .cu-pill-compact { padding: 4px 10px; gap: 6px; font-size: .8rem; }
    .cu-pill-compact .cu-pill-bar { width: 70px; }
    .cu-pill-compact .muted.small { display: none; }
}
/* Ernteschätzung u. a.: Erklärung zum Aufklappen */
.info-fold { margin: 0 0 12px; }
.info-fold > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--primary-dark); font-size: .85rem; font-weight: 600; list-style: none; }
.info-fold > summary::-webkit-details-marker { display: none; }
.info-fold > summary .icon { width: 16px; height: 16px; }
.info-fold[open] > p { margin: 6px 0 0; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
/* Felder: Karte am Handy kleiner */
@media (max-width: 719px) { .map-overview { height: 190px; } }
@media (max-width: 700px) {
    .tabs { gap: 0 2px; }
    .tab { padding: 8px 9px; font-size: .8rem; }
    .tab .icon { display: none; }
}

/* ==========================================================================
   Kundenportal (30.10.2026)
   ========================================================================== */
body.portal { background: var(--bg); }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--side-bg); color: var(--side-text); }
.portal-brand { display: flex; align-items: center; gap: 10px; color: var(--side-text); }
.portal-brand:hover { text-decoration: none; }
.portal-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.portal-sub { font-size: .75rem; color: var(--side-muted); }
.portal-user { display: flex; align-items: center; gap: 10px; text-align: right; font-size: .85rem; }
.portal-user form { margin: 0; }
.portal-main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.portal-main h1 { font-size: 1.4rem; }
.portal-card { max-width: 440px; margin: 40px auto; padding: 24px; }
.portal-alt { margin-top: 14px; text-align: center; }
.portal-stock { border-top: 1px solid var(--line); padding: 8px 0; }
.portal-stock > summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; flex-wrap: wrap; }
.portal-sum { margin-left: auto; font-weight: 600; }
.portal-stock .table-wrap { margin-top: 6px; }
.portal-users { list-style: none; margin: 0 0 12px; padding: 0; }
.portal-users li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.portal-u-who { display: flex; flex-direction: column; min-width: 0; }
.portal-u-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.portal-invite { border-top: 1px solid var(--line); padding-top: 10px; }
.dn-mail-to { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
@media (max-width: 600px) {
    .portal-main { padding: 14px 10px 40px; }
    .portal-main .card { padding: 12px; }
    .portal-main .table th, .portal-main .table td { padding: 6px 5px; font-size: .8rem; }
    .portal-head { padding: 8px 10px; }
    .portal-who .small { display: none; }
}

/* ---- Nachrichten (Kundenportal und Lager & Verkauf → Nachrichten) ---- */
.msg { max-width: 80%; align-self: flex-start; }
.tabs .tab .badge { margin-left: 4px; }
@media (max-width: 760px) {
    .msg-layout { grid-template-columns: 1fr; }
    .msg-layout.has-current .msg-list { display: none; }
    .msg-layout:not(.has-current) .msg-main { display: none; }
    .msg-back { display: inline-flex; }
    .msg { max-width: 92%; }
    .msg-form { flex-direction: column; align-items: stretch; }
}

/* ---- Kundenportal: Begrüßungs-Animation nach der Anmeldung (ca. 12 s, überspringbar) ----
   Ablauf: 0–2,4 s Jasper grüßt · 2,2–4,1 s geht zum Traktor, steigt ein · 4,3–6,6 s Fahrt zum Lager (Marco ruft) ·
   6,9–8,6 s Kisten abladen (Marcel antwortet) · ab 9,3 s „Verkauft!“ mit Münzen · 11,6–12,6 s ausblenden */
.portal-intro { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(240, 246, 236, .97); animation: pi-out 12.6s linear forwards; cursor: pointer; }
.pi-box { position: relative; width: 100%; max-width: 680px; text-align: center; }
.pi-scene { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 12px 40px rgba(30, 60, 30, .18); background: #e6f3fa; }
.pi-caption { display: grid; margin: 14px 0 6px; font-size: 1.2rem; font-weight: 700; color: #2f5a41; min-height: 1.6em; }
.pi-caption span { grid-area: 1 / 1; opacity: 0; }
.pi-t1 { animation: pi-t1 12s linear forwards; }
.pi-t2 { animation: pi-t2 12s linear forwards; }
.pi-t3 { animation: pi-t3 12s linear forwards; }
.pi-skip { margin-top: 4px; }
.pi-scene * { transform-box: view-box; }
.pi-man { animation: pi-man 12s linear forwards; }
.pi-leg { transform-origin: 0 -18px; }
.pi-leg.l1 { animation: pi-step .4s ease-in-out 2.2s 4 alternate; }
.pi-leg.l2 { animation: pi-step2 .4s ease-in-out 2.2s 4 alternate; }
.pi-arm { transform-origin: 0 -32px; animation: pi-step2 .4s ease-in-out 2.2s 4 alternate; }
.pi-driver { opacity: 0; animation: pi-driver 12s linear forwards; }
.pi-tractor { animation: pi-drive 12s linear forwards; }
.pi-wheel { transform-origin: 0 0; animation: pi-wheel 12s linear forwards; }
.pi-smoke circle { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pi-smoke .9s ease-out 4.4s 3; }
.pi-smoke .s2 { animation-delay: 4.85s; }
.pi-crate.c3 { animation: pi-c3 12s linear forwards; }
.pi-crate.c2 { animation: pi-c2 12s linear forwards; }
.pi-crate.c1 { animation: pi-c1 12s linear forwards; }
.pi-door { animation: pi-door 12s linear forwards; }
.pi-wave { transform-origin: 5px -32px; }
.pi-marco .pi-wave { animation: pi-wave .45s ease-in-out 4.6s 5 alternate; }
.pi-marcel .pi-wave { animation: pi-wave .45s ease-in-out 7.1s 5 alternate; }
.pi-bubble { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.pi-b-jasper { animation: pi-b-jasper 12s linear forwards; }
.pi-b-marco { animation: pi-b-marco 12s linear forwards; }
.pi-b-marcel { animation: pi-b-marcel 12s linear forwards; }
.pi-sold { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pi-sold 12s linear forwards; }
.pi-coin { opacity: 0; animation: pi-coin 1.4s ease-out both; }
.pi-coin.k1 { animation-delay: 9.5s; }
.pi-coin.k2 { animation-delay: 9.75s; }
.pi-coin.k3 { animation-delay: 10s; }
.pi-coin.k4 { animation-delay: 10.25s; }
.pi-cloud { animation: pi-cloud 12s linear forwards; }
@keyframes pi-out { 0% { opacity: 0; } 2.4% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes pi-t1 { 0%, 1.5% { opacity: 0; } 3%, 29% { opacity: 1; } 31.5%, 100% { opacity: 0; } }
@keyframes pi-t2 { 0%, 32% { opacity: 0; } 34.5%, 72% { opacity: 1; } 74.5%, 100% { opacity: 0; } }
@keyframes pi-t3 { 0%, 75% { opacity: 0; } 78%, 100% { opacity: 1; } }
@keyframes pi-man { 0%, 18.3% { transform: translate(112px, 0); opacity: 1; } 31.7% { transform: translate(190px, 0); opacity: 1; }
    34.2%, 100% { transform: translate(198px, -16px); opacity: 0; } }
@keyframes pi-step { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }
@keyframes pi-step2 { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes pi-driver { 0%, 33% { opacity: 0; } 35%, 100% { opacity: 1; } }
@keyframes pi-drive { 0%, 35.8% { transform: translateX(0); animation-timing-function: ease-in-out; } 55%, 100% { transform: translateX(205px); } }
@keyframes pi-wheel { 0%, 35.8% { transform: rotate(0); animation-timing-function: ease-in-out; } 55%, 100% { transform: rotate(720deg); } }
@keyframes pi-smoke { 0% { opacity: .8; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(-14px, -26px) scale(2.2); } }
@keyframes pi-c3 { 0%, 57.5% { transform: translate(0, 0); opacity: 1; animation-timing-function: ease-out; } 60.4% { transform: translate(80px, -58px); animation-timing-function: ease-in; }
    63.3% { transform: translate(160px, 20px); opacity: 1; } 64.6%, 100% { transform: translate(160px, 26px); opacity: 0; } }
@keyframes pi-c2 { 0%, 60.8% { transform: translate(0, 0); opacity: 1; animation-timing-function: ease-out; } 63.8% { transform: translate(92px, -58px); animation-timing-function: ease-in; }
    66.7% { transform: translate(184px, 20px); opacity: 1; } 68%, 100% { transform: translate(184px, 26px); opacity: 0; } }
@keyframes pi-c1 { 0%, 64.2% { transform: translate(0, 0); opacity: 1; animation-timing-function: ease-out; } 67.1% { transform: translate(104px, -58px); animation-timing-function: ease-in; }
    70% { transform: translate(208px, 20px); opacity: 1; } 71.3%, 100% { transform: translate(208px, 26px); opacity: 0; } }
@keyframes pi-door { 0%, 55.8% { opacity: 1; } 58%, 72.5% { opacity: 0; } 75%, 100% { opacity: 1; } }
@keyframes pi-wave { from { transform: rotate(-150deg); } to { transform: rotate(-110deg); } }
@keyframes pi-b-jasper { 0%, 2% { opacity: 0; transform: scale(.6); } 4%, 20% { opacity: 1; transform: scale(1); } 23%, 100% { opacity: 0; transform: scale(1); } }
@keyframes pi-b-marco { 0%, 37.5% { opacity: 0; transform: scale(.6); } 40%, 55.8% { opacity: 1; transform: scale(1); } 57.5%, 100% { opacity: 0; transform: scale(1); } }
@keyframes pi-b-marcel { 0%, 58.3% { opacity: 0; transform: scale(.6); } 60.8%, 75% { opacity: 1; transform: scale(1); } 77%, 100% { opacity: 0; transform: scale(1); } }
@keyframes pi-sold { 0%, 77.5% { opacity: 0; transform: scale(.2); } 80.8% { opacity: 1; transform: scale(1.12); } 83.3%, 100% { opacity: 1; transform: scale(1); } }
@keyframes pi-coin { 0% { opacity: 0; transform: translateY(12px); } 20% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-64px); } }
@keyframes pi-cloud { from { transform: translateX(0); } to { transform: translateX(60px); } }
@media (prefers-reduced-motion: reduce) {
    .portal-intro { display: none; }
}
@media (max-width: 600px) {
    .pi-caption { font-size: 1rem; }
}

/* ---- Phase 10a: Export-Knopf und Druckansicht für alle Seiten ---- */
.export-menu { position: relative; display: inline-block; }
@media print {
    /* ohne Seitenrand druckt der Browser keine Adresse/Datum; Rand kommt von .print-frame (app.js), Nutzer 31.10.2026 */
    @page { margin: 0; }
    .print-frame { width: 100%; border-collapse: collapse; }
    .print-frame > thead > tr > td, .print-frame > tfoot > tr > td { height: 12mm; padding: 0; border: 0; }
    .print-frame > tbody > tr > td { padding: 0 12mm; border: 0; }
    .bottombar, .pagebar, .export-menu, .more-menu, .page-actions, .btn, .icon-btn, dialog, .modal, .flash, .no-print,
    .filter-toggle, .portal-intro, .msg-form, .info-btn, .chip:not(.is-active), .segmented button:not(.is-active),
    input[type="search"]:placeholder-shown, .dn-arrow, .stock-buttons, .stock-actionbar { display: none !important; }
    html, body, .main, .app, .content { background: #fff !important; }
    .main, .content { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    .table-wrap { overflow: visible !important; }
    .table th, .table td { padding: 3px 5px; }
    thead { display: table-header-group; }
    tr { page-break-inside: avoid; }
    .card { break-inside: auto; box-shadow: none !important; }
    a { color: inherit; text-decoration: none; }
    .tabs .tab:not(.is-active) { display: none; }
    .msg-thread { max-height: none; overflow: visible; }
}
html.is-exporting, html.is-exporting * { cursor: progress !important; }

/* ---- Phase 10b: Feinschliff Handy (Tippflächen ≥ 40 px, Häkchen 24 px, Auswahlfelder 16 px gegen iPhone-Zoom) ---- */
.sd-f-check { display: flex; align-items: flex-start; flex: none; padding: 10px 6px 10px 14px; margin: -10px 0 -10px -14px; cursor: pointer; }
.sd-f-check input[type=checkbox] { margin: 4px 0 0; width: 18px; height: 18px; }
@media (max-width: 700px) {
    .chip { min-height: 40px; padding: 8px 14px; }
    .chip-sm, .chip-inline { min-height: 0; padding: 2px 10px; }
    .segmented button { min-height: 40px; padding: 8px 14px; }
    .link-btn { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; }
    .info-btn { padding: 6px 8px; margin: -6px -4px; }
    .sd-f-check { padding: 12px 10px 12px 14px; margin: -12px 0 -12px -14px; }
    .sd-f-check input[type=checkbox], .he-done input[type=checkbox] { width: 24px; height: 24px; margin-top: 2px; }
    .he-done { display: inline-flex; padding: 8px; margin: -8px; }
    select, input, textarea { font-size: 16px; }
    table.table-cards td { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 700px) {
    html .weather-month input, html .prog-page .feld select, html .prog-page .feld input, html .prog-page .feld textarea { font-size: 16px; }
}
@media (max-width: 700px) {
    table.table-cards .chip-list { justify-content: flex-end; }
    table.table-cards .chip { white-space: normal; text-align: left; }
}
.tc-val { display: contents; }
@media (max-width: 700px) {
    table.table-cards .tc-val { display: block; flex: 1 1 auto; min-width: 0; text-align: right; }
}

/* ---- Feldmarkierungen (Video 6) ---- */
.fm-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.fm-ask { text-align: center; padding: 28px 16px; }
.fm-ask-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.fm-ask-btns .btn { min-height: 52px; padding: 10px 20px; font-size: 1rem; }
.fm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.fm-toolbar .chips { margin: 0; }
.fm-toolbar select { width: auto; min-width: 150px; }
.fm-toolbar .btn[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.fm-map-wrap { position: relative; margin-bottom: 8px; }
.fm-map { height: min(62vh, 560px); border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.fm-mark-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 0; }
.fm-mark-bar p { margin: 0; }
.fm-mark-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-mark-btns .btn { min-height: 46px; }
.fm-cluster { background: none; border: 0; }
.fm-cluster span { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(47, 90, 65, .92);
    color: #fff; font-weight: 700; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.fm-pin { background: none; border: 0; }
.fm-pin span { position: absolute; left: 3px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; background: #ffdd00; border: 3px solid #2f3b45;
    transform: rotate(-45deg); box-shadow: 0 2px 5px rgba(0,0,0,.45); }
.fm-pop { font-size: .85rem; }
.fm-pop-note { margin: 6px 0; white-space: pre-line; }
.fm-pop-photos { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.fm-pop-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.fm-pop-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fm-done { color: var(--primary-dark); }
.fm-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fm-list-head h2 { margin: 0; }
.fm-group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 14px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fm-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding-right: 10px; }
.fm-row.is-done { opacity: .65; }
.fm-row-main { flex: 1; display: flex; align-items: flex-start; gap: 4px; text-align: left; background: none; border: 0; padding: 10px 14px; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.fm-row-main:hover { background: var(--hover); }
.fm-row-main .fm-dot { margin-top: 4px; }
.fm-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fm-row-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-dist { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.fm-row-check { min-width: 40px; min-height: 40px; font-size: 1.1rem; justify-content: center; }
.fm-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 1500; background: #2f5a41; color: #fff; padding: 10px 16px;
    border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: calc(100vw - 32px); font-size: .9rem; }
.fm-toast.is-error { background: var(--danger); }
.fm-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fm-thumb { position: relative; display: inline-block; }
.fm-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.fm-thumb.is-new img { border-color: var(--primary); }
.fm-thumb-x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.fm-photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-photo-btns .btn { cursor: pointer; }
.fm-status { margin-bottom: 12px; }
.fm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.fm-stat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fm-stat-head h3 { margin: 0; }
.fm-stat-types { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-stat-types li { display: flex; flex-direction: column; gap: 4px; }
.fm-types-table input[type=color] { width: 44px; height: 36px; padding: 2px; }
@media (max-width: 700px) {
    .fm-map { height: 58vh; }
    .fm-toolbar select { flex: 1 1 140px; }
    .fm-mark-btns { width: 100%; }
    .fm-mark-btns .btn { flex: 1 1 auto; justify-content: center; }
}
.fm-map-wrap { scroll-margin-top: 72px; }
.fm-map .leaflet-interactive:focus { outline: none; }
/* Karten allgemein: angeklickte Fläche ohne Fokus-Rechteck des Browsers (Nutzer 31.10.2026) */
.leaflet-container .leaflet-interactive:focus, .leaflet-container path:focus { outline: none; }

/* ---- Wurzelschnitt-Karte ---- */
.rc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; }
.rc-toolbar select { width: auto; min-width: 90px; }
.rc-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-modes .btn.is-active { outline: 3px solid var(--primary-soft); }
.rc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.rc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rc-key { display: inline-block; width: 26px; height: 0; border-top: 4px solid; }
.rc-key-cut { border-color: #22c55e; }
.rc-key-prev { border-top-style: dashed; border-color: #f59e0b; }
.rc-key-note { border-color: #3b82f6; }
.rc-panel { padding: 12px 14px; }
.rc-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rc-cut { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.rc-big { min-height: 64px; font-size: 1.2rem; justify-content: center; }
.rc-status { margin: 0; font-weight: 600; }
.rc-editbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border: 2px solid var(--primary); }
.rc-map-wrap { margin-bottom: 8px; }
.rc-map { height: min(66vh, 620px); border-radius: var(--radius); border: 1px solid var(--line); z-index: 0; }
.rc-map .leaflet-interactive:focus { outline: none; }
.rc-me { background: none; border: 0; }
.rc-me span { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #2b6cb0; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.rc-me span::after { content: ""; position: absolute; left: 50%; top: -13px; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 10px solid #2b6cb0; }
.rc-me span.no-dir::after { display: none; }
.rc-pop { font-size: .85rem; }
.rc-pop-note { margin: 6px 0; white-space: pre-line; }
.rc-pop-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.rc-note-tip { font-weight: 600; }
.rc-settings { padding: 10px 14px; }
.rc-settings summary { cursor: pointer; font-weight: 600; }
.rc-offset { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.rc-offset .field { margin: 0; }
.rc-offset input { width: 90px; }
.rc-offset p { flex-basis: 100%; margin: 0; }
@media (max-width: 700px) {
    .rc-map { height: 60vh; }
    .rc-modes { width: 100%; }
    .rc-modes .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
}

/* ---- Rechtegruppen ---- */
html[data-readonly] main form[method="post"]:not([data-keep]), html[data-readonly] main [data-open-dialog]:not([data-keep]),
html[data-readonly] main .row-actions, html[data-readonly] main .page-actions .btn-primary { display: none !important; }
.perm-area-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.perm-area-head h2 { margin: 0; }
.perm-area-head select { width: auto; }
.perm-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 6px 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.perm-page { display: flex; align-items: center; gap: 8px; }
.perm-levels { margin: 0; }
.perm-level { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; }
.perm-level input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.perm-level.is-active { background: var(--primary); color: #fff; }
.perm-level:focus-within { outline: 2px solid var(--primary-soft); }
.perm-rights { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 18px; padding-left: 28px; }
.perm-rights.is-off { opacity: .45; }
.perm-rights .check { margin: 2px 0; font-weight: 400; font-size: .9rem; }
@media (max-width: 700px) {
    .perm-row { grid-template-columns: 1fr; }
    .perm-level { min-height: 40px; }
    .perm-rights { padding-left: 0; }
}

/* ---- Lagerkontrolle ---- */
.sc-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.sc-room { display: flex; flex-direction: column; gap: 6px; border-top: 5px solid var(--line); }
.sc-room.sc-good { border-top-color: #2f8f4e; }
.sc-room.sc-warn { border-top-color: #e0a526; }
.sc-room.sc-bad { border-top-color: #c0392b; }
.sc-room.sc-stale { border-top-color: #9aa5a0; }
.sc-room-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-room-head h2 { margin: 0; }
.sc-badge { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--hover); white-space: nowrap; }
.sc-badge-good { background: #e3f4e8; color: #1f6b3a; }
.sc-badge-warn { background: #fff4d6; color: #8a5d00; }
.sc-badge-bad { background: #fde3df; color: #a12a1b; }
.sc-badge-stale { background: #eceeed; color: #5f6b66; }
.sc-temp { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.sc-temp small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.sc-syms { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-sym { font-size: .75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.sc-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 6px 0 0; }
.sc-vals dt { font-size: .75rem; color: var(--muted); }
.sc-vals dd { margin: 0; font-weight: 600; }
.sc-vals small { font-weight: 400; color: var(--muted); }
.sc-room .sc-change { align-self: flex-start; margin-top: 4px; }
.sc-chart-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sc-chart-head h2 { margin: 0 auto 0 0; }
.sc-chart-head .segmented { margin: 0; }
.sc-chart { height: 260px; }
.sc-chart-gas { height: 200px; }
.sc-tabs { margin: 6px 0 10px; }
.sc-cmd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-cmd-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.sc-cmd-list small { flex-basis: 100%; }
.sc-cmd-st { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--hover); }
.sc-cmd-done { background: #e3f4e8; color: #1f6b3a; }
.sc-cmd-failed, .sc-cmd-expired { background: #fde3df; color: #a12a1b; }
.sc-cmd-queued, .sc-cmd-running { background: #fff4d6; color: #8a5d00; }
.sc-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sc-chart-bar { height: 220px; }
@media (max-width: 760px) { .sc-bars { grid-template-columns: 1fr; } }
.sc-errors { margin-bottom: 10px; }
.sc-report-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.sc-report-row .field { margin-bottom: 0; min-width: 160px; }
.sc-report-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sc-report-btns form { margin: 0; }
.sc-report .sc-report-row + .sc-report-row { margin-top: 12px; }
.sc-main-switch { margin: 4px 0 8px; }
.sc-secret { display: flex; gap: 6px; align-items: center; }
.sc-secret input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
[data-copy].is-done { color: var(--brand, #2f5a41); }
.stock-climate { font-size: .82rem; font-weight: 600; padding: 2px 14px 6px; color: var(--muted); }
.stock-climate.sc-line-good { color: #1f6b3a; }
.stock-climate.sc-line-warn { color: #8a5d00; }
.stock-climate.sc-line-bad { color: #a12a1b; }

/* ---- Terminplaner (Kalender, Dashboard-Kachel) ---- */
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; vertical-align: middle; }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { margin: 0 0 0 6px; }
.cal-toolbar .segmented { margin: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: .85rem; }
.cal-leg { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cal-synced { margin: 8px 0 0; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card));
    color: var(--text); font: inherit; font-size: .76rem; line-height: 1.25; padding: 1px 4px; margin-top: 2px; border-radius: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip.is-allday { background: var(--c); color: #fff; border-left-color: var(--c); }
.cal-chip-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-month .cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd div { font-size: .75rem; color: var(--muted); padding: 2px 4px; text-transform: capitalize; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-cell { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 3px 4px; min-width: 0; cursor: default; }
.cal-cell.is-out { background: var(--surface-2); }
.cal-cell.is-out .cal-daynum { color: var(--muted); }
.cal-daynum { border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600; padding: 1px 5px; border-radius: 999px; cursor: pointer; color: var(--text); }
.cal-cell.is-today .cal-daynum { background: var(--primary); color: #fff; }
.cal-more { border: 0; background: none; color: var(--primary-dark); font-size: .75rem; padding: 1px 4px; cursor: pointer; }
.cal-tg { --gutter: 48px; }
.cal-tg-head, .cal-tg-allday { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.cal-tg-day { border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; padding: 4px; cursor: pointer; color: var(--text); text-align: center; }
.cal-tg-day.is-today { color: var(--primary-dark); }
.cal-tg-allday { border-bottom: 1px solid var(--line-strong); }
.cal-tg-allday > div:first-child { padding: 4px 2px; }
.cal-tg-adcell { border-left: 1px solid var(--line); min-height: 26px; padding: 1px 2px 3px; min-width: 0; }
.cal-tg-scroll { max-height: 62vh; overflow-y: auto; }
.cal-tg-grid { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.cal-tg-hours div { font-size: .7rem; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); box-sizing: border-box; }
.cal-tg-col { position: relative; border-left: 1px solid var(--line);
    background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 44px); cursor: copy; }
.cal-tg-col.is-today { background-color: color-mix(in srgb, var(--primary) 5%, transparent); }
.cal-tg-ev { position: absolute; overflow: hidden; border: 0; border-left: 3px solid var(--c); border-radius: 4px; text-align: left; padding: 2px 4px; font: inherit;
    font-size: .74rem; line-height: 1.2; color: var(--text); background: color-mix(in srgb, var(--c) 20%, var(--card)); cursor: pointer; }
.cal-tg-ev small { display: block; color: var(--muted); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }
.cal-list-day h3 { margin: 14px 0 4px; text-transform: none; }
.cal-list-day.is-today h3 { color: var(--primary-dark); }
.cal-list-day ul { list-style: none; margin: 0; padding: 0; }
.cal-list-ev { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--c); background: var(--surface-2); color: var(--text);
    font: inherit; padding: 8px 10px; margin-bottom: 4px; border-radius: 6px; cursor: pointer; min-height: 44px; align-items: center; }
.cal-list-time { flex: 0 0 104px; font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.cal-list-title { display: flex; flex-direction: column; min-width: 0; }
.cal-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cal-steps { margin: 4px 0 12px; padding-left: 20px; }
.cal-tile { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cal-tile ul { list-style: none; margin: 2px 0 0; padding: 0; }
.cal-tile ul li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.cal-tile-date { font-weight: 700; font-size: .85rem; }
.cal-tile-day.is-today .cal-tile-date { color: var(--primary-dark); }
.cal-tile-time { flex: 0 0 64px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
@media (max-width: 700px) {
    .cal-cell { min-height: 64px; padding: 1px; }
    .cal-chip { font-size: .68rem; padding: 0 2px; }
    .cal-chip-time { display: none; }
    .cal-tg { --gutter: 38px; }
    .cal-list-time { flex-basis: 84px; }
}

/* ---- Kistenfoto ---- */
.bp-code-row { display: flex; gap: 8px; }
.bp-code-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.bp-cam { max-width: 420px; margin: 8px 0; }
.bp-linked { margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bp-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.bp-file { cursor: pointer; min-height: 48px; }
.bp-tips ul { margin: 6px 0 0; padding-left: 20px; }
.bp-list { display: flex; flex-direction: column; gap: 10px; }
.bp-item { display: flex; gap: 14px; align-items: flex-start; }
.bp-thumb { flex: 0 0 180px; }
.bp-thumb img { width: 180px; height: auto; max-height: 220px; object-fit: cover; border-radius: 8px; display: block; background: var(--surface-2); }
.bp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bp-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.bp-vals { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 14px; margin: 4px 0 0; }
.bp-vals dt { font-size: .75rem; color: var(--muted); }
.bp-vals dd { margin: 0; font-weight: 600; }
.bp-dist { display: flex; flex-direction: column; gap: 3px; max-width: 460px; }
.bp-dist-row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 8px; align-items: center; font-size: .8rem; }
.bp-dist-bar { height: 10px; background: var(--hover); border-radius: 5px; overflow: hidden; }
.bp-dist-bar span { display: block; height: 100%; background: var(--primary); }
.bp-dist-pct { text-align: right; font-variant-numeric: tabular-nums; }
.bp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-dist-inline .chip { margin: 1px 0; }
@media (max-width: 600px) {
    .bp-item { flex-direction: column; }
    .bp-thumb, .bp-thumb img { width: 100%; flex-basis: auto; max-height: 260px; }
}
.bp-bins td.bp-bin-top { font-weight: 700; }
.bp-bins th, .bp-bins td { white-space: nowrap; }
.bp-var-toggle { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.bp-var-toggle:hover { color: var(--primary, inherit); }
.bp-chev { display: inline-block; width: 1em; transition: transform .15s; }
.bp-var-toggle[aria-expanded="true"] .bp-chev { transform: rotate(90deg); }
.bp-var-row td { font-weight: 600; }
.bp-var-row td.bp-bin-top { font-weight: 800; }
.bp-field-row td:first-child { padding-left: 2.2rem; }
.bp-field-row td { background: var(--surface-2, rgba(0,0,0,.025)); }

/* ---- Spurführung ---- */
.sr-runs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sr-run { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.sr-run .btn { align-self: flex-start; margin-top: 4px; }
.sr-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; border: 0; padding: 0; margin: 0 0 10px; }
.sr-drive { display: flex; flex-direction: column; height: calc(100dvh - 120px); min-height: 520px; margin: -8px -8px 0; }
.sr-top { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.sr-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-map-wrap { flex: 1; min-height: 260px; position: relative; display: flex; }
.sr-map { flex: 1; min-height: 260px; border-radius: 10px; }
.sr-notice { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 1000; padding: 18px 14px; border-radius: 12px; color: #fff; font-size: 1.35rem; font-weight: 800; text-align: center; line-height: 1.25; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); cursor: pointer; }
.sr-notice-on { background: #1f9d55; }
.sr-notice-off { background: #d9480f; }
.sr-notice-tank { background: #1c64c8; }
.sr-where { margin: 0; font-weight: 700; }
.sr-fieldlist { margin: 0; }
.sr-tank.is-low { border-color: #d9480f; background: #fff1e8; }
.sr-auto { margin-right: auto; }
.sr-order { display: flex; flex-direction: column; gap: 4px; }
.sr-order p { margin: 0; }
.sr-stats.sr-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sr-mix { font-weight: 700; }
.sr-ofields ul { list-style: none; margin: 4px 0 0; padding: 0; }
.sr-ofields li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.so-fruits { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.so-detail { margin: 0 0 12px; }
.so-vars { margin-bottom: 4px; }
.so-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 14px; margin-top: 8px; }
.so-fieldbox { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.so-plot { padding-left: 1.4rem; }
.so-detail summary { cursor: pointer; color: var(--primary-dark, inherit); }
.so-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 14px; margin: 8px 0; }
.so-group > strong { grid-column: 1 / -1; }
.so-products { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.so-product { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.so-product select { flex: 1 1 180px; min-width: 0; }
.so-product input { width: 90px; }
.so-sum { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.so-sum > div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.sr-enter-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.sr-panel { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.sr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sr-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; display: flex; flex-direction: column; }
.sr-k { font-size: .7rem; color: var(--muted); }
.sr-v { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sr-gps { margin: 0; }
.sr-spray { width: 100%; min-height: 64px; border: 0; border-radius: 12px; font: inherit; font-size: 1.15rem; font-weight: 700; color: #fff; background: #6b7570; cursor: pointer; }
.sr-spray.is-on { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31, 157, 85, .3); }
.sr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sr-actions form { margin: 0; }
.sr-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sr-sw { display: inline-block; width: 18px; height: 5px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.sr-sw-open { background: #bfc6c2; }
.sr-sw-done { background: #21c25e; }
.sr-sw-side { background: #9be7b4; }
.sr-sw-part { background: linear-gradient(90deg, #21c25e 50%, #bfc6c2 50%); }
.sr-net { white-space: nowrap; }
.sr-pop .btn { margin-top: 6px; }
@media (max-width: 600px) { .sr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sr-drive { height: calc(100dvh - 140px); } .sr-notice { font-size: 1.2rem; } }

/* ---- Reihen aus Luftbild (Bearbeiten) ---- */
.fr-edit { display: flex; flex-direction: column; gap: 10px; }
.fr-map { height: min(68vh, 640px); min-height: 360px; border-radius: 10px; }
.fr-map .leaflet-interactive:focus { outline: none; }
.fr-panel { display: flex; flex-direction: column; gap: 8px; }
.fr-panel p { margin: 0; }
.fr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fr-tools form { margin: 0; }
.fr-save { border-top: 1px solid var(--line); padding-top: 8px; }
.fr-handle { background: #ffe14d; border: 2px solid #1f2a24; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); cursor: grab; }
.fr-handle.is-sel { background: #ffffff; }
.fr-assign { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fr-assign select { max-width: 220px; }
.fr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.fr-leg i { display: inline-block; width: 18px; height: 5px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.fr-area-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }

/* ---- Nachrüstungen 31.10.2026 ---- */
/* weicher Übergang beim Seitenwechsel (Chrome/Edge/Safari; andere wechseln wie bisher) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
/* Karte (Leaflet bringt eigene Ebenen bis 1000 mit) bleibt unter Handy-Leiste und Menü (Nutzer: Karte verdeckte die untere Leiste) */
.leaflet-container { isolation: isolate; z-index: 0; }
/* Hinweis „Gemerkte Filter aktiv“ */
.filter-memory { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; padding: 6px 10px; border-radius: 8px;
    background: var(--hover); color: var(--text); font-size: .85rem; }
.filter-memory .icon { width: 15px; height: 15px; }
.filter-memory a { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
/* PDF-Ansicht in der App (31.10.2026) */
.pdfv-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 0; background: var(--bg); }
.pdfv-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 80px; }
.pdfv-pages canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* Fenster (Dialoge) auf dem Handy (Nutzer 31.10.2026: bei „Neues Gerät“ waren die Knöpfe unten verdeckt): 100vh ist auf
   dem iPhone höher als der sichtbare Bereich (Safari-Leiste) – sichtbare Höhe (dvh) nehmen und Abstand zum Home-Balken */
.modal { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.modal-box { max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.modal-body { min-height: 0; overscroll-behavior: contain; }
.modal-foot { flex-shrink: 0; }
.modal-head { flex-shrink: 0; }
/* Fenster ohne seitliche Bildlaufleiste (Nutzer 31.10.2026: „Neues Gerät“ – Knopf „Von Hand eintragen“ brach nicht um,
   Rahmen (fieldset) waren nie schmaler als ihr Inhalt); senkrechte Leiste schmal und unaufdringlich */
.modal-body { overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.modal-body fieldset { min-width: 0; }
.modal-body .btn { max-width: 100%; white-space: normal; }
.sd-nozzle-actions { flex-wrap: wrap; }
/* „Feld bearbeiten“: Kasten „Reihen aus Luftbild“ (ANNAHMEN 224) */
.field-rows-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
    margin: 14px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.field-rows-box h3 { margin: 0 0 2px; }
.field-rows-box p { margin: 0; }

/* Reihen aller Felder: auf dem Handy ohne seitliches Schieben (Nutzer 31.10.2026) – Stand darf umbrechen, schmalere Ränder */
@media (max-width: 600px) {
    #fr-list .badge { white-space: normal; }
    #fr-list .table th, #fr-list .table td { padding-left: 6px; padding-right: 6px; white-space: normal; }
}

/* ---- Auswertung auf dem Handy (Nutzer 31.10.2026, ANNAHMEN 227) ---- */
.eval-filter > summary { list-style: none; }
.eval-filter > summary::-webkit-details-marker { display: none; }
.eval-filter-sum { display: none; }
.eval-more-btn, .eval-xchev, .eval-vbar-note { display: none; }
.eval-xrow { display: none; }
@media (max-width: 700px) {
    /* 1 Filter als eine Zeile */
    .eval-side { padding: 10px 12px; }
    .eval-filter-sum { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .92rem; }
    .eval-filter-sum .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
    .eval-filter-sum > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .eval-filter-change { color: var(--primary-dark); font-size: .82rem; white-space: nowrap; }
    .eval-filter-change::after { content: ' ▾'; }
    .eval-filter[open] .eval-filter-change::after { content: ' ▴'; }
    .eval-filter[open] > summary { margin-bottom: 10px; }
    /* 2 Kennzahlen kompakt, Saison-Balken ohne Überlappen */
    .eval-head { gap: 12px; padding: 12px; }
    .eval-kpis { gap: 10px 12px; }
    .eval-kpi-label { font-size: .72rem; }
    .eval-kpi-value { font-size: 1.12rem; white-space: nowrap; }
    .eval-kpi-note { font-size: .72rem; line-height: 1.3; }
    .eval-vbars { gap: 4px; min-height: 100px; }
    .eval-vbar { min-width: 0; flex: 1 1 0; font-size: .64rem; }
    .eval-vbar-col { width: 70%; max-width: 26px; }
    .eval-vbar-badge { display: none; }
    .eval-vbar.is-backfilled .eval-vbar-col { background: repeating-linear-gradient(135deg, #b9d8c3 0 4px, #dcebe1 4px 8px); }
    .eval-vbar.is-backfilled.is-active .eval-vbar-col { background: repeating-linear-gradient(135deg, var(--primary) 0 4px, #8fbf9f 4px 8px); }
    .eval-vbar-note { display: block; font-size: .7rem; margin: 2px 0 0; }
    /* 3 Reiter in einer Zeile, wischbar, bleiben oben stehen */
    .eval-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; position: sticky; top: 56px; z-index: 6;
        background: var(--bg); margin: 10px -14px 12px; padding: 0 14px; }
    .eval-tabs::-webkit-scrollbar { display: none; }
    .eval-tabs .tab { padding: 10px 10px; font-size: .84rem; }
    /* 4 + 5 Legenden und Balken: Rest hinter „Weitere“ / „Alle anzeigen“; Sortennamen ganz */
    .eval-more { display: none !important; }
    .is-all > .eval-more { display: grid !important; }
    .eval-more-btn { display: inline-block; margin: 6px 6px 0; font-size: .85rem; }
    .eval-bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 5px 4px; }
    .eval-bar-row .eval-bar-label { grid-column: 1; grid-row: 1; }
    .eval-bar-row .eval-bar-value { grid-column: 2; grid-row: 1; }
    .eval-bar-row .eval-bar-track { grid-column: 1 / -1; grid-row: 2; height: 10px; }
    .eval-bar-label { flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
    .eval-bar-label span { white-space: normal; }
    .eval-class-legend { gap: 0 6px; }
    /* 6 Tabellen: nur wichtige Spalten, Zeile antippen = Rest */
    .eval-xtable .eval-xcol { display: none; }
    .eval-xtable tr.eval-xmain { cursor: pointer; }
    .eval-xchev { display: inline-block; margin-right: 6px; color: var(--muted); font-weight: 700; transition: transform .15s; }
    .eval-xmain.is-open .eval-xchev { transform: rotate(90deg); }
    .eval-xmain.is-open + .eval-xrow { display: table-row; }
    .eval-xrow > td { background: var(--hover); padding: 6px 10px 8px 24px; }
    .eval-xlist { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .84rem; }
    .eval-xlist dt { color: var(--muted); font-weight: 600; }
    .eval-xlist dd { margin: 0; text-align: right; }
    .eval-xtable td.nowrap { white-space: normal; }
    .eval-xtable .eval-delta { display: block; font-size: .72rem; }
    .eval-xtable th, .eval-xtable td { padding-left: 6px; padding-right: 6px; }
    /* Umschalter (t/ha, Woche …) und Kopfzeilen der Karten umbrechen statt die Seite zu verbreitern */
    .eval-pane .card-head-row { flex-wrap: wrap; gap: 6px 10px; }
    .eval-pane .segmented { flex-wrap: wrap; max-width: 100%; border-radius: 14px; }
    .eval-donut-row { flex-direction: column; align-items: stretch; }
    .eval-donut-row .eval-donut { align-self: center; }
    .eval-legend { min-width: 0; width: 100%; flex: none; }
    .eval-legend .eval-legend-row { grid-template-columns: 12px minmax(0, 1fr) auto auto; row-gap: 0; }
    .eval-legend .eval-legend-pct { grid-column: 2 / -1; grid-row: 2; white-space: normal; font-size: .74rem; }
    .eval-legend .eval-legend-pct:empty { display: none; }
}

/* Datensicherung (ANNAHMEN 231) */
.backup-last { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--ok, #2f7a3e); }
.backup-last.is-old { color: var(--danger, #b3261e); }
.backup-headline { margin: 6px 0; }
.backup-diff { list-style: none; margin: 8px 0 12px; padding: 0; border-top: 1px solid var(--line); }
.backup-diff li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.backup-diff .bk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-chip { padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--hover); white-space: nowrap; }
.bk-chip.is-add { background: #e3f1e5; color: #22622f; }
.bk-chip.is-chg { background: #fdf1d8; color: #7a5300; }
.bk-chip.is-del { background: #fbe4e2; color: #8f1f17; }
.backup-other summary { cursor: pointer; margin: 4px 0; }
.backup-pick .danger-zone { margin-top: 12px; }
tr.is-selected td { background: var(--hover); }

/* Jahresmappe im Export-Menü (ANNAHMEN 233) */
.sd-export-menu .sd-export-book { border-top: 1px solid var(--line); font-weight: 600; }

/* Düngeplan: passende Dünger (ANNAHMEN 234) */
.plan-match { margin: 8px 0 4px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.plan-match summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.plan-match ul { list-style: none; margin: 6px 0; padding: 0; }
.plan-match li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.plan-match li:first-child { border-top: 0; }
.plan-fit { background: var(--hover); }
/* Mittel: FiBL-Eintrag (ANNAHMEN 234) */
.pd-fibl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--hover); }
.pd-fibl-label { font-weight: 600; font-size: .85rem; }
.pd-fibl-edit { flex-basis: 100%; }
.pd-fibl-edit summary { cursor: pointer; }
.pd-fibl-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 6px 8px; align-items: end; margin-top: 6px; }
.pd-fibl-form label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 700px) { .pd-fibl-form { grid-template-columns: 1fr; } }

/* Nährstoffe je Feld (ANNAHMEN 235) */
.npk-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.npk-pick select { max-width: 100%; }
.npk-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); }
.npk-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.npk-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px 22px; }
@media (max-width: 700px) { .npk-charts { grid-template-columns: 1fr; } }
.npk-box h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 4px 0; }
.npk-box h3 .bal-plus, .npk-box h3 .bal-minus { margin-left: auto; font-weight: 600; }
.npk-chart { width: 100%; height: auto; display: block; }
.npk-chart .npk-grid { stroke: var(--line); stroke-width: 1; }
.npk-chart .npk-base { stroke: var(--muted); stroke-width: 1; }
.npk-chart .npk-ax { fill: var(--muted); font-size: 13px; }
.npk-chart .npk-saldo { fill: var(--muted); font-size: 13px; font-weight: 600; }
.npk-chart .npk-saldo.is-plus { fill: #2f7a3e; }
.npk-chart .npk-saldo.is-minus { fill: #b3261e; }
.npk-in { fill: #4f8f5b; background: #4f8f5b; }
.npk-out { fill: #e0913a; background: #e0913a; }
.npk-table td a { font-weight: 600; }

.npk-table .bal-minus, .npk-box .bal-minus { color: #b3261e; }
.npk-table .bal-plus, .npk-box .bal-plus { color: #2f7a3e; }
/* Spurführung: Bildschirm aus mit Traccar Client, Benachrichtigungen (ANNAHMEN 238) */
.trk-card h2 .icon, .trk-h .icon { vertical-align: -3px; }
.trk-token { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; margin: 8px 0; border-radius: var(--radius-sm); background: var(--hover); }
.trk-token code { font-size: 1.15rem; font-weight: 700; letter-spacing: .04em; user-select: all; }
.trk-steps { margin: 8px 0 10px 1.2em; padding: 0; display: grid; gap: 4px; }
.trk-steps code { word-break: break-all; }
.trk-status, .trk-push { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.trk-status form { margin: 0; }
.trk-h { margin-top: 14px; }
.sr-trk { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
/* Assistent „Handy einrichten“ (ANNAHMEN 239) */
.ps { display: grid; gap: 12px; max-width: 760px; }
.ps-step h2 { display: flex; align-items: center; gap: 10px; }
.ps-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hover); font-size: .95rem; font-weight: 700; flex: none; }
.ps-step.is-done .ps-n { background: var(--primary); color: #fff; }
.ps-step.is-done { border-color: var(--primary-soft); }
.ps-ok { color: var(--primary); margin-left: auto; }
.ps-ok .icon { width: 24px; height: 24px; }
.ps-list { margin: 6px 0 8px 1.2em; padding: 0; display: grid; gap: 4px; }
.ps-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.ps-desk { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.ps-desk code { word-break: break-all; }
.ps-qr { background: #fff; padding: 8px; border-radius: var(--radius-sm); display: inline-block; line-height: 0; }
.ps-qr svg { max-width: 220px; height: auto; }
.ps-qr-box { margin-top: 10px; }
.sr-setup-hint { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warning-soft); color: #6b4a00; text-decoration: none; font-size: .9rem; flex-basis: 100%; }
.sr-setup-hint .icon { flex: none; margin-top: 2px; }
.ph-state { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ps-keep { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; margin: 8px 0; border-radius: var(--radius-sm); background: var(--info-soft); font-size: .9rem; }
.ps-keep .icon { flex: none; margin-top: 2px; color: var(--info); }
.ps-keep p { margin: 4px 0 0; }
/* Jahresabschlüsse (ANNAHMEN 242) */
.fin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-checks ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.fin-chk { display: flex; gap: 6px; align-items: flex-start; }
.fin-chk .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.fin-chk-ok { color: var(--primary-dark); }
.fin-chk-bad { color: var(--danger); }
.fin-chk-na { color: var(--muted, #7c8580); }
.fin-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 8px; align-items: end; }
.fin-totals label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin-totals .fin-note { grid-column: 1 / -1; }
.fin-upload form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.fin-pages { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.fin-page { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border-radius: var(--radius-sm); background: var(--hover); }
.fin-page-failed { outline: 1px solid var(--danger); }
.fin-thumb { width: 56px; height: 72px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: #fff; }
.fin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fin-page-info { display: flex; flex-direction: column; min-width: 0; }
.fin-page-act { display: flex; gap: 4px; align-items: center; }
.fin-page-act form { margin: 0; }
.fin-lines { margin-bottom: 12px; }
.fin-edit input[type="text"], .fin-edit select { width: 100%; min-width: 0; padding: 4px 6px; font-size: .88rem; }
.fin-edit td { padding: 3px 4px; vertical-align: top; }
.fin-edit .fin-acc-in { width: 7.5em; }
.fin-edit .fin-num, .fin-cult .fin-num { text-align: right; }
.fin-edit tr.fin-err { background: var(--danger-soft); }
.fin-extra { display: block; margin-top: 2px; }
.fin-filter { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; }
.fin-filter label { display: flex; flex-direction: column; gap: 2px; }
.fin-notes ul { margin: 6px 0 0 1.1em; padding: 0; display: grid; gap: 2px; font-size: .92rem; }
.fin-chart { width: 100%; height: 280px; }
.fin-chart-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.fin-cmp tbody tr[data-fin-row] { cursor: pointer; }
.fin-cmp tbody tr[data-fin-row]:hover, .fin-cmp tbody tr.is-sel { background: var(--hover); }
.fin-cmp tbody th { font-weight: 500; white-space: normal; }
.fin-cmp .fin-sec th { background: var(--hover); font-weight: 700; padding-top: 10px; }
.fin-cmp td.fin-up { color: var(--primary-dark); font-weight: 600; }
.fin-cmp td.fin-down { color: var(--danger); font-weight: 600; }
.fin-acc select { min-width: 12em; }
.fin-acc tr.fin-new-acc { background: var(--warning-soft); }
.fin-cult input { width: 6.5em; padding: 3px 5px; }
.fin-cult .fin-pct { width: 4em; }
.fin-cult input[data-src="obsthof"] { background: var(--primary-soft); }
.fin-cult-h { text-align: center; border-left: 1px solid var(--border, #e3e6e4); }
.fin-sync { margin-bottom: 10px; }
@media print { .fin-filter, .tabs, .fin-chart-card { display: none !important; } }
.fin-alloc-cell label { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.fin-alloc-cell label + label { margin-top: 4px; }
.fin-alloc-cell select { min-width: 9.5em; }
/* Auswertung im Fenster des Hofbüros (ANNAHMEN 270): Filter als eine Zeile wie auf dem Handy */
@media (max-width: 1150px) {
    html.in-beam .eval-filter-sum { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .92rem; }
    html.in-beam .eval-filter-sum .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
    html.in-beam .eval-filter-sum > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    html.in-beam .eval-filter-change { color: var(--primary-dark); font-size: .82rem; white-space: nowrap; }
    html.in-beam .eval-filter-change::after { content: ' ▾'; }
    html.in-beam .eval-filter[open] .eval-filter-change::after { content: ' ▴'; }
    html.in-beam .eval-filter[open] > summary { margin-bottom: 10px; }
}

/* Düngeplan als Liste, Nährstoffvergleich auf einen Blick, Bodenproben als Karten, Karten-Ansicht merken (ANNAHMEN 283) – nur im Hofbüro (html.in-beam), die normalen Seiten bleiben wie vorher */
html.in-beam .plan-card:not(.is-open) { padding-top: 10px; padding-bottom: 10px; }
html.in-beam .plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html.in-beam .plan-open { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: 10px;
    padding: 4px 10px; cursor: pointer; color: inherit; font: inherit; }
html.in-beam .plan-open:hover { border-color: var(--primary); }
html.in-beam .plan-mini { display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2, #f4f6f2); font-size: .8rem; }
html.in-beam .plan-mini b { font-variant-numeric: tabular-nums; }
html.in-beam .plan-mini.plan-ok { background: color-mix(in srgb, #3f8f2a 16%, transparent); }
html.in-beam .plan-mini.plan-low { background: color-mix(in srgb, #e0a32c 22%, transparent); }
html.in-beam .plan-mini.plan-high { background: color-mix(in srgb, #c23b2f 16%, transparent); }
html.in-beam .plan-chev { color: var(--muted); }
html.in-beam .plan-body { margin-top: 10px; }
html.in-beam .bal-glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 6px; }
html.in-beam .bal-glance-card { padding: 14px 16px; border-top: 4px solid var(--muted); }
html.in-beam .bal-glance-card.bal-plus { border-top-color: #3f8f2a; }
html.in-beam .bal-glance-card.bal-minus { border-top-color: #e0a32c; }
html.in-beam .bal-glance-card header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
html.in-beam .bal-glance-card header strong { font-size: 1.1rem; }
html.in-beam .bal-glance-saldo { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
html.in-beam .bal-glance-saldo small { font-size: .7rem; font-weight: 400; color: var(--muted); }
html.in-beam .bal-plus .bal-glance-saldo { color: #3f8f2a; }
html.in-beam .bal-minus .bal-glance-saldo { color: #b7700a; }
html.in-beam .bal-glance-row { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 8px; margin-bottom: 6px; }
html.in-beam .bal-glance-row b { text-align: right; font-variant-numeric: tabular-nums; }
html.in-beam .bal-glance-bar { height: 12px; border-radius: 6px; background: var(--surface-2, #eef1ec); overflow: hidden; }
html.in-beam .bal-glance-bar i { display: block; height: 100%; border-radius: 6px; }
html.in-beam .bal-glance-bar i.is-in { background: #4c9a2a; }
html.in-beam .bal-glance-bar i.is-out { background: #e0832c; }
html.in-beam .bal-more { margin-top: 8px; }
html.in-beam .bal-more > summary { cursor: pointer; font-weight: 600; padding: 10px 2px; color: var(--primary-dark); }
html.in-beam .soil-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
html.in-beam .soil-cards .soil-card { margin: 0; }
html.in-beam .soil-latest-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
html.in-beam .soil-tools { display: inline-flex; gap: 2px; align-items: center; }
html.in-beam .soil-tools form { display: inline; }
html.in-beam .soil-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
html.in-beam .soil-tile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 10px; background: var(--surface-2, #f4f6f2); text-align: center; }
html.in-beam .soil-tile small { color: var(--muted); font-size: .7rem; }
html.in-beam .soil-tile b { font-size: 1.2rem; }
html.in-beam .soil-tile.is-low { background: color-mix(in srgb, #e0a32c 25%, transparent); }
html.in-beam .soil-c-a { background: color-mix(in srgb, #c23b2f 22%, transparent); }
html.in-beam .soil-c-b { background: color-mix(in srgb, #e0a32c 24%, transparent); }
html.in-beam .soil-c-c { background: color-mix(in srgb, #3f8f2a 22%, transparent); }
html.in-beam .soil-c-d { background: color-mix(in srgb, #2f6fa8 18%, transparent); }
html.in-beam .soil-c-e { background: color-mix(in srgb, #2f6fa8 32%, transparent); }
html.in-beam .soil-older { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
html.in-beam .soil-older-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; }
html.in-beam .sd-map-tools { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
@media (max-width: 700px) { html.in-beam .soil-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } html.in-beam .soil-cards { grid-template-columns: 1fr; } }
html:not(.in-beam) .bal-glance, html:not(.in-beam) .bal-glance-note, html:not(.in-beam) .soil-beam, html:not(.in-beam) .sd-map-tools { display: none; }
html:not(.in-beam) .bal-more > summary { display: none; }
html.in-beam .soil-std { display: none; }

/* Knopf „Frag den Hof“ (ANNAHMEN 312) */
.assist-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary); color: #fff; box-shadow: var(--shadow-lg); text-decoration: none; }
.assist-fab:hover { background: var(--primary-dark); text-decoration: none; }
.assist-fab .icon { width: 22px; height: 22px; }
html.in-farm3d .assist-fab { display: none; }
@media (max-width: 900px) { .assist-fab { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 44px; height: 44px; } }
@media print { .assist-fab { display: none; } }

/* Regenradar (ANNAHMEN 313) */
.rain-radar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; margin: 12px 0; color: inherit; }
a.rain-radar:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--primary); }
.rain-radar.is-soon, .rain-radar.is-now { border-color: var(--primary); background: var(--primary-soft); }
.rain-radar-text { display: inline-flex; align-items: center; gap: 8px; }
.rain-radar-name { display: block; line-height: 1.2; }
.rain-radar-chart { flex: 1 1 200px; max-width: 420px; display: block; }
.rain-radar-chart svg { display: block; width: 100%; height: 34px; }
.rain-radar-chart rect { fill: var(--line); }
.rain-radar-chart rect.is-wet { fill: #3b82d6; }
.rain-radar-chart rect.is-gap { fill: transparent; }
.rain-radar-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.rain-radar-at { margin-left: auto; }

/* „Nächste Lieferschein-Nummer übernehmen“ (ANNAHMEN 314) */
.scan-next-dn, [data-out-next] { margin: 2px 0 10px; border: 1px solid var(--line-strong); }
[data-out-next] { margin-top: 6px; }
[data-out-last] { display: block; }

/* Kistenfoto gegen Sortierung, Herkunft des Klassenmixes (ANNAHMEN 325) */
.bp-cmp-list { display: grid; gap: 6px; }
.bp-cmp { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.bp-cmp > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.bp-cmp-field { margin-left: 18px; }
.bp-cmp-mid { margin-left: auto; }
.bp-cmp .table-wrap { margin-top: 6px; }
.bp-cmp td.bp-cmp-big { font-weight: 700; color: #8a5d00; }
.he-source { color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) { .bp-cmp-field { margin-left: 8px; } .bp-cmp-mid { margin-left: 0; } }

/* ---- Händler-Abrechnungen (ANNAHMEN 328) ---- */
.ts-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ts-pick .btn { cursor: pointer; }
.ts-queue { margin: 4px 0 8px; padding-left: 20px; font-size: .9rem; }
.ts-queue li { display: flex; align-items: center; gap: 6px; }
.ts-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .ts-grid { grid-template-columns: 1fr; } }
.ts-file-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ts-file-list li { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 96px; text-align: center; overflow-wrap: anywhere; }
.ts-thumb { width: 72px; height: 96px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: #fff; border: 1px solid var(--line); }
.ts-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ts-siblings { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.ts-siblings .chip.is-active { background: var(--primary); color: #fff; }
.ts-hints { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.ts-hints li::before { content: '• '; }
.ts-hint-good { color: var(--primary-dark); }
.ts-hint-good::before { content: '✓ ' !important; }
.ts-hint-bad { color: var(--danger); }
.ts-hint-warn { color: #a86b00; }
.ts-group h3 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ts-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin: 6px 0 10px; }
.ts-compare > div { display: flex; flex-direction: column; gap: 2px; }
.ts-ok { display: inline-flex; vertical-align: -3px; }
.ts-ok .icon { width: 16px; height: 16px; }
.ts-ok-yes { color: var(--primary-dark); }
.ts-ok-no { color: var(--danger); }
.ts-unused td { color: var(--muted, #7c8580); }
.ts-edit summary { list-style: none; }
.ts-edit summary::-webkit-details-marker { display: none; }
.ts-edit[open] { position: relative; }
.ts-edit-form { position: absolute; right: 0; z-index: 5; width: min(340px, 86vw); background: var(--card, #fff); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); display: grid; gap: 6px; }
.ts-edit-form .field { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.ts-edit-form input, .ts-edit-form select { width: 100%; }
@media (max-width: 700px) { .ts-edit-form { position: fixed; left: 8px; right: 8px; top: 20%; width: auto; } }
.ts-file-list li .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.ts-rows td.num, .ts-lines td.num { white-space: nowrap; }

/* ---- Bio-Zertifikate (ANNAHMEN 329) ---- */
.oc-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.oc-actions form { margin: 0; }
.oc-dialog { width: min(640px, 94vw); max-height: 86dvh; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--card, #fff); color: inherit; }
.oc-dialog::backdrop { background: rgba(0,0,0,.35); }
.oc-dialog-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; }
.oc-dialog-search { display: flex; gap: 6px; }
.oc-dialog-search input { flex: 1; min-width: 0; }
.oc-hits { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; overflow: auto; max-height: 60dvh; }
.oc-hits li { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 8px; border-radius: var(--radius-sm); background: var(--hover); }
.oc-hits li > div { min-width: 0; }

/* ---- Eingangsrechnungen aus Paperless (ANNAHMEN 330) ---- */
.pl-settings { display: grid; gap: 12px; margin-top: 8px; }
.pl-actions { display: flex; gap: 2px; justify-content: flex-end; }
.pl-actions form { margin: 0; }
.pl-cat { max-width: 190px; }
.pl-cat.pl-saved { outline: 2px solid var(--primary); }
.pl-cat.pl-error { outline: 2px solid var(--danger); }
.pl-more summary { cursor: pointer; color: var(--muted, #7c8580); }
.pl-more ul { margin: 4px 0; padding-left: 18px; }
.pl-dup { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 400; }
.pl-dup-form { display: inline-flex; gap: 4px; }
.pl-cmp-row > td { padding-top: 0; }
.pl-trash { margin-top: 6px; }
.pl-cmp summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.pl-cmp-table th:first-child { width: 110px; }
.pl-cmp-table .pl-diff td { background: var(--warning-soft); font-weight: 700; }
.pl-cmp-pdfs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.pl-cmp-pdfs iframe { width: 100%; height: 640px; border: 1px solid var(--border, #e3e7e4); border-radius: 6px; background: #fff; }
@media (max-width: 900px) { .pl-cmp-pdfs { grid-template-columns: 1fr; } .pl-cmp-pdfs iframe { height: 460px; } }
.pl-dup-row td > strong, .pl-dup-row .num { opacity: .55; }
.pl-dup-row .num { text-decoration: line-through; }
.pl-progress { margin: 8px 0; }
.pl-progress-line { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.pl-pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.pl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted, #7c8580); flex: none; }
.pl-dot.is-aktiv { background: var(--primary); animation: pl-pulse 1.4s ease-in-out infinite; }
.pl-dot.is-wartet { background: #d9a400; }
.pl-dot.is-fertig { background: var(--primary); }
@keyframes pl-pulse { 50% { opacity: .35; transform: scale(.8); } }
.pl-bar { height: 10px; border-radius: 5px; background: var(--border, #e3e7e4); overflow: hidden; }
.pl-bar span { display: block; height: 100%; border-radius: 5px; background: var(--primary); transition: width .4s ease; }
.pl-bar span.is-moving { background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 60px 100%; background-repeat: no-repeat; animation: pl-move 1.3s linear infinite; }
@keyframes pl-move { from { background-position: -60px 0; } to { background-position: calc(100% + 60px) 0; } }
@media (prefers-reduced-motion: reduce) { .pl-dot.is-aktiv, .pl-bar span.is-moving { animation: none; } }
.pl-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.pl-sort:hover { text-decoration: underline; }
.pl-split summary { cursor: pointer; color: var(--muted, #7c8580); margin-top: 4px; }
.pl-split-form { display: grid; gap: 6px; margin-top: 6px; min-width: 260px; }
.pl-split-row { display: flex; gap: 6px; }
.pl-split-row select { flex: 1; min-width: 0; }
.pl-split-row input { width: 100px; }
.pl-parts { margin: 4px 0 0; padding-left: 16px; }
