/* Einsätze und Dienstabende (shared/svo.js) – Dashboard, Web-Version und Helferportal.
   Eigene --sv-* Variablen mit Rückfall auf beide Farbwelten (Dashboard: --accent/--border/--surface, Portal: --red/--line/--card). */
.sv-form, .sv-stats, .sv-check, .sv-csum, .sv-problems, .sv-dl, .sv-sug, .sv-bar-top, .sv-cards, .sv-card, .sv-detail, .sv-checks, .sv-exp, .sv-dialog, .sv-page,
.sv-wiz, .sv-led2, .sv-period, .sv-edbar, .sv-sttools, .sv-fl {
  --sv-accent: var(--accent, var(--red, #e30613));
  --sv-text: var(--text, #16181d);
  --sv-muted: var(--muted, #5d6573);
  --sv-line: var(--border, var(--line, #d0d5dd));
  --sv-bg: var(--surface-2, var(--bg, #fff));
  --sv-card: var(--surface, var(--card, #fff));
  --sv-solid: var(--surface-solid, var(--card, #fff));
  --sv-ok: var(--ok, #15803d);
  --sv-bad: var(--bad, var(--due, #c81e1e));
  --sv-warn: var(--warn, var(--soon, #b45309));
  --sv-radius: var(--radius-sm, 12px);
  --sv-soft: rgba(128, 128, 128, .12);
  --sv-edge: rgba(128, 128, 128, .5);
  --sv-tint: rgba(227, 6, 19, .1);
  --sv-ok-t: rgba(21, 128, 61, .13);
  --sv-bad-t: rgba(200, 30, 30, .12);
  --sv-warn-t: rgba(245, 158, 11, .15);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .sv-form, .sv-stats, .sv-check, .sv-csum, .sv-problems, .sv-dl, .sv-sug, .sv-bar-top, .sv-cards, .sv-card, .sv-detail, .sv-checks, .sv-exp, .sv-dialog, .sv-page,
.sv-wiz, .sv-led2, .sv-period, .sv-edbar, .sv-sttools, .sv-fl {
    --sv-soft: color-mix(in srgb, var(--sv-text) 8%, transparent);
    --sv-edge: color-mix(in srgb, var(--sv-text) 26%, transparent);
    --sv-tint: color-mix(in srgb, var(--sv-accent) 12%, transparent);
    --sv-ok-t: color-mix(in srgb, var(--sv-ok) 14%, transparent);
    --sv-bad-t: color-mix(in srgb, var(--sv-bad) 13%, transparent);
    --sv-warn-t: color-mix(in srgb, var(--sv-warn) 16%, transparent);
  }
}
.sv-form *, .sv-stats *, .sv-check *, .sv-cards * { box-sizing: border-box; }
/* Material-Check und Dialoge nutzen Knöpfe aus felder.css, stehen aber nicht immer in einem .ff-form: Farben weiterreichen */
.sv-check, .sv-dialog, .sv-period {
  --ff-accent: var(--sv-accent); --ff-text: var(--sv-text); --ff-muted: var(--sv-muted); --ff-line: var(--sv-line); --ff-bg: var(--sv-bg);
  --ff-card: var(--sv-card); --ff-ok: var(--sv-ok); --ff-bad: var(--sv-bad); --ff-radius: var(--sv-radius); --ff-edge: var(--sv-edge);
  --ff-tint: var(--sv-tint); --ff-soft: var(--sv-soft); --ff-ring: var(--sv-tint);
}

/* ---------- Dialog im Dashboard ---------- */
#xDialog .modal-box.sv-dialog.sv-wide { width: min(980px, 96vw); }
.sv-dialog .sv-okline { color: var(--sv-ok); font-weight: 650; margin: 8px 0 0; }

/* ---------- Formular ---------- */
.sv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 18px; align-items: start; }
.sv-sec { display: flex; flex-direction: column; gap: 16px; }
.sv-addr { grid-template-columns: minmax(0, 2fr) minmax(96px, .7fr) minmax(0, 1.3fr); }
.sv-static { display: flex; align-items: center; min-height: 48px; padding: 10px 14px; border-radius: var(--sv-radius); background: var(--sv-soft); font-weight: 650; font-variant-numeric: tabular-nums; }
.sv-calc { padding: 10px 14px; border-radius: var(--sv-radius); border-left: 4px solid var(--sv-accent); background: var(--sv-tint); font-weight: 650; font-variant-numeric: tabular-nums; }
.sv-form .sv-seg, .sv-check .sv-seg { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); max-width: 560px; }
.sv-seg .ff-seg-btn { min-height: 46px; font-size: 15px; padding: 6px 10px; line-height: 1.2; }

/* Mehrfachauswahl (Einsatzmittel, Helfer) */
.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 14px; font: inherit; font-size: 15px; font-weight: 600; color: var(--sv-text); background: var(--sv-bg); border: 1px solid var(--sv-edge); border-radius: 999px; cursor: pointer; touch-action: manipulation; }
.sv-chip.on { border-color: var(--sv-accent); background: var(--sv-tint); box-shadow: inset 0 0 0 1px var(--sv-accent); }
.sv-chip-mark { position: relative; width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1.5px solid var(--sv-edge); }
.sv-chip.on .sv-chip-mark { background: var(--sv-accent); border-color: var(--sv-accent); }
.sv-chip.on .sv-chip-mark::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sv-add { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.sv-form .sv-add .ff-input { flex: 1 1 auto; min-width: 0; }
.sv-add .ff-btn { flex: none; }

/* Patienten */
.sv-pats { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sv-pats:empty { display: none; }
.sv-pat { display: grid; grid-template-columns: 26px minmax(0, 1fr) 96px 150px 46px; gap: 8px; align-items: center; }
.sv-form .sv-pat .ff-input { max-width: none; min-width: 0; }
.sv-pat-no { font-weight: 700; color: var(--sv-muted); text-align: center; font-variant-numeric: tabular-nums; }
.sv-x { min-width: 44px; padding-left: 0; padding-right: 0; color: var(--sv-bad); }

/* Einstellungen */
.sv-togs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.sv-tog { min-height: 46px; font-size: 15px; }
.sv-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Checkliste bauen */
.sv-secs { display: flex; flex-direction: column; gap: 16px; }
.sv-sec-ed { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-soft); }
.sv-sec-head { display: flex; gap: 8px; align-items: center; }
.sv-form .sv-sec-head .ff-input { flex: 1 1 auto; min-width: 0; font-weight: 650; }
.sv-sec-head .ff-btn { flex: none; }
.sv-item-head, .sv-item-ed { display: grid; grid-template-columns: minmax(0, 1fr) 92px 100px 44px 44px; gap: 8px; align-items: center; }
.sv-item-head { font-size: 13px; color: var(--sv-muted); font-weight: 600; padding: 0 2px; }
.sv-form .sv-item-ed .ff-input { max-width: none; min-width: 0; }
.sv-item-ed .ff-btn { min-width: 44px; padding-left: 0; padding-right: 0; }
.sv-ab { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.sv-form .sv-ab input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--sv-accent); }

/* ---------- Material prüfen ---------- */
.sv-check { display: flex; flex-direction: column; gap: 18px; color: var(--sv-text); }
.sv-prog { position: sticky; top: -2px; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: var(--sv-solid); }
.sv-prog-t { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sv-prog-b { flex: 1; height: 10px; border-radius: 5px; background: var(--sv-soft); overflow: hidden; }
.sv-prog-b .sv-bar { display: block; height: 100%; width: 0; background: var(--sv-ok); border-radius: 5px; transition: width .2s; }
.sv-csec { display: flex; flex-direction: column; gap: 8px; }
.sv-csec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sv-ci { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); grid-template-areas: "h s" "x x"; gap: 10px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--sv-line); border-left: 4px solid var(--sv-edge); border-radius: var(--sv-radius); background: var(--sv-bg); }
.sv-ci > .ff-help { grid-column: 1 / -1; margin: 0; }
.sv-ci-head { grid-area: h; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.sv-ci-t { font-weight: 650; overflow-wrap: anywhere; }
.sv-ci-soll { font-size: 13.5px; color: var(--sv-muted); font-weight: 600; white-space: nowrap; }
.sv-ci .sv-seg { grid-area: s; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.sv-ci-x { grid-area: x; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sv-mini { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sv-muted); min-width: 0; }
.sv-check .ff-input { display: block; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 9px 11px; font: inherit; font-size: 15px; color: var(--sv-text); background: var(--sv-solid); border: 1px solid var(--sv-edge); border-radius: var(--sv-radius); }
.sv-check .ff-input:focus { outline: none; border-color: var(--sv-accent); box-shadow: 0 0 0 3px var(--sv-tint); }
.sv-mini .ff-input { flex: 1 1 auto; }
.sv-ci.sv-ok { border-left-color: var(--sv-ok); }
.sv-ci.sv-soon { border-left-color: var(--sv-warn); background: var(--sv-warn-t); }
.sv-ci.sv-bad { border-left-color: var(--sv-bad); background: var(--sv-bad-t); }
.sv-ci .ff-seg-btn.ff-on[data-v="ok"] { background: var(--sv-ok); border-color: var(--sv-ok); }
.sv-ci .ff-seg-btn.ff-on[data-v="fehlt"], .sv-ci .ff-seg-btn.ff-on[data-v="defekt"] { background: var(--sv-bad); border-color: var(--sv-bad); }

/* Ergebnis eines Checks */
.sv-csum { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.sv-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; line-height: 1.4; background: var(--sv-soft); color: var(--sv-text); white-space: nowrap; }
.sv-pill.ok { color: var(--sv-ok); background: var(--sv-ok-t); }
.sv-pill.bad { color: var(--sv-bad); background: var(--sv-bad-t); }
.sv-pill.warn { color: var(--sv-warn); background: var(--sv-warn-t); }
.sv-problems { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--sv-bad); }
.sv-problems li + li { margin-top: 2px; }
.sv-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-checks > li { padding: 10px 12px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-soft); font-size: 14.5px; }
.sv-exp { font-size: 14px; margin: 4px 0; }
.sv-exp ul { margin: 4px 0 0; padding-left: 18px; }
.sv-exp li.bad { color: var(--sv-bad); font-weight: 600; }

/* ---------- Anwesenheit ---------- */
.sv-anw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sv-anw-n { flex: 1 1 100%; font-weight: 650; font-variant-numeric: tabular-nums; }
.sv-anw { display: flex; flex-direction: column; gap: 6px; }
.sv-anw-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 390px); gap: 8px 12px; align-items: center; padding: 8px 10px 8px 12px; border: 1px solid var(--sv-line); border-left: 4px solid var(--sv-edge); border-radius: var(--sv-radius); background: var(--sv-bg); }
.sv-anw-row.sv-da { border-left-color: var(--sv-ok); }
.sv-anw-row.sv-off { opacity: .75; }
.sv-anw-row.sv-off .sv-anw-name { font-style: italic; }
.sv-anw-name { font-weight: 650; overflow-wrap: anywhere; }
.sv-anw-name small { color: var(--sv-muted); font-weight: 500; }
.sv-anw-row .sv-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.sv-anw-row .ff-seg-btn { min-height: 44px; font-size: 14.5px; }
.sv-anw-row .ff-seg-btn.ff-on[data-v="da"] { background: var(--sv-ok); border-color: var(--sv-ok); }
.sv-anw-row .ff-seg-btn.ff-on[data-v="entschuldigt"] { background: var(--sv-warn); border-color: var(--sv-warn); }
.sv-anw-row .ff-seg-btn.ff-on[data-v="fehlt"] { background: var(--sv-bad); border-color: var(--sv-bad); }

/* ---------- Statistik ---------- */
.sv-stats { display: flex; flex-direction: column; gap: 14px; color: var(--sv-text); }
.sv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.sv-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-card); min-width: 0; }
.sv-kpi b { font-size: 26px; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sv-kpi span { font-size: 14px; font-weight: 600; }
.sv-kpi small { font-size: 12.5px; color: var(--sv-muted); }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sv-card { padding: 16px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-card); min-width: 0; overflow-x: auto; display: flex; flex-direction: column; gap: 6px; }
.sv-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sv-card p { margin: 0; }
.sv-card .row { margin-top: 4px; }
.sv-card > .btn, .sv-card > .per-switch { align-self: flex-start; }
.sv-wide { grid-column: 1 / -1; }
.sv-empty { color: var(--sv-muted); margin: 0; padding: 6px 0; }
.sv-note { color: var(--sv-muted); font-size: 13px; margin: 8px 0 0; }
.sv-bars { display: flex; flex-direction: column; gap: 8px; }
.sv-barrow { display: grid; grid-template-columns: minmax(80px, 44%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.sv-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* lange Namen in zwei Zeilen statt abgeschnitten */
.sv-bars:not(.sv-cols) .sv-bl { white-space: normal; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sv-bt { display: block; height: 12px; border-radius: 4px; background: var(--sv-soft); overflow: hidden; }
.sv-bar { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--sv-accent); }
.sv-bn { font-weight: 700; white-space: nowrap; text-align: right; min-width: 2.5em; font-variant-numeric: tabular-nums; }
.sv-bn small { font-weight: 400; color: var(--sv-muted); }
/* Säulen je Monat */
.sv-bars.sv-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(22px, 1fr); gap: 6px; align-items: end; overflow-x: auto; padding-bottom: 2px; }
.sv-cols .sv-barrow { display: grid; grid-template-columns: 1fr; grid-template-areas: "n" "t" "l"; gap: 4px; justify-items: center; font-size: 12px; }
.sv-cols .sv-bl { grid-area: l; color: var(--sv-muted); max-width: 100%; }
.sv-cols .sv-bt { grid-area: t; width: 100%; max-width: 38px; height: 120px; display: flex; align-items: flex-end; }
.sv-cols .sv-bar { width: 100%; height: 0; }
.sv-cols .sv-bn { grid-area: n; text-align: center; min-width: 0; font-size: 12.5px; }
.sv-cols .sv-bn small { display: none; }
.sv-yn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--sv-line); }
.sv-yn:last-child { border-bottom: 0; }
.sv-yn b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sv-yn small { grid-column: 1 / -1; color: var(--sv-muted); font-size: 13px; }
.sv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sv-table th { text-align: left; font-size: 12.5px; color: var(--sv-muted); font-weight: 650; }
.sv-table th, .sv-table td { padding: 7px 8px; border-bottom: 1px solid var(--sv-line); }
.sv-table tr:last-child td { border-bottom: 0; }
.sv-table th:not(:first-child), .sv-table td:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sv-table tr.sv-off td { color: var(--sv-muted); font-style: italic; }
.sv-rate { display: inline-block; width: 56px; height: 8px; border-radius: 4px; background: var(--sv-soft); overflow: hidden; vertical-align: middle; margin-right: 4px; }
.sv-rate .sv-bar { background: var(--sv-ok); }

/* ---------- Ein Einsatz zum Lesen ---------- */
.sv-dl { display: grid; grid-template-columns: minmax(140px, 34%) minmax(0, 1fr); gap: 7px 16px; margin: 0; color: var(--sv-text); }
.sv-dl dt { color: var(--sv-muted); font-size: 14px; }
.sv-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sv-detail .ff-display { margin-top: 14px; }

/* ---------- Ansicht ---------- */
.sv-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; margin: 0 0 10px; border: 1px solid var(--sv-accent); border-radius: var(--sv-radius); background: var(--sv-tint); color: var(--sv-text); }
.sv-sug > div { flex: 1 1 220px; min-width: 0; }
.sv-sug b { display: block; overflow-wrap: anywhere; }
.sv-sug small { color: var(--sv-muted); }
.sv-bar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.sv-grow { flex: 1; }
.sv-year { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.sv-year select { width: auto; min-width: 110px; }
.sv-subs { margin: 0 0 12px; }
.sv-maprow { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.sv-maprow input { flex: 1 1 120px; min-width: 0; width: auto; }
.sv-maprow .btn { flex: none; }
.sv-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Statistik zum Selbstgestalten (ab 3.3.1) ---------- */
.sv-stats [hidden], .sv-dialog [hidden], .sv-bar-top [hidden], .sv-sttools [hidden], .sv-edbar [hidden], .sv-period [hidden], .sv-led2 [hidden], .sv-wiz [hidden] { display: none !important; }
/* Farben für Aufteilungen: feste Reihenfolge, auf Farbsehschwäche geprüft, hell und dunkel getrennt abgestimmt */
.sv-stats { --sv-p0: #2a78d6; --sv-p1: #eb6834; --sv-p2: #1baf7a; --sv-p3: #eda100; --sv-p4: #e87ba4; --sv-p5: #008300; --sv-p6: #6250d6; --sv-p7: #e34948; }
:root[data-theme="dark"] .sv-stats { --sv-p0: #3987e5; --sv-p1: #d95926; --sv-p2: #199e70; --sv-p3: #c98500; --sv-p4: #d55181; --sv-p5: #008300; --sv-p6: #9085e9; --sv-p7: #e66767; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .sv-stats { --sv-p0: #3987e5; --sv-p1: #d95926; --sv-p2: #199e70; --sv-p3: #c98500; --sv-p4: #d55181; --sv-p5: #008300; --sv-p6: #9085e9; --sv-p7: #e66767; }
}
.sv-c0 { --sv-c: var(--sv-p0); } .sv-c1 { --sv-c: var(--sv-p1); } .sv-c2 { --sv-c: var(--sv-p2); } .sv-c3 { --sv-c: var(--sv-p3); }
.sv-c4 { --sv-c: var(--sv-p4); } .sv-c5 { --sv-c: var(--sv-p5); } .sv-c6 { --sv-c: var(--sv-p6); } .sv-c7 { --sv-c: var(--sv-p7); }
.sv-cx { --sv-c: var(--sv-muted); }

/* Abschnitte zum Auf- und Zuklappen */
.sv-sect { border-top: 1px solid var(--sv-line); }
.sv-stats > .sv-sect:first-child, .sv-stats > .sv-cmp + .sv-sect { border-top: 0; }
.sv-sect > summary { display: block; position: relative; padding: 12px 2px 12px 28px; cursor: pointer; list-style: none; user-select: none; }
.sv-sect > summary::-webkit-details-marker { display: none; }
.sv-sect > summary::before { content: ""; position: absolute; left: 6px; top: 19px; width: 8px; height: 8px; border: solid var(--sv-muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
.sv-sect[open] > summary::before { transform: rotate(45deg); top: 17px; }
.sv-sect > summary:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 2px; border-radius: 6px; }
.sv-sect-t { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sv-sect > summary small { margin-left: 10px; font-size: 13px; color: var(--sv-muted); white-space: nowrap; }
.sv-sect > .sv-grid { padding: 2px 0 16px; }
.sv-cmp { margin: 0; }

/* Kennzahlen: Kacheln oder Kasten wie in der Excel-Tabelle */
.sv-kset { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sv-kset > h4 { margin: 0; font-size: 15px; font-weight: 700; }
.sv-kset > .sv-note { margin: 0; }
.sv-kpi b.sv-long { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.sv-delta { color: var(--sv-muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sv-ktab { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sv-ktab th, .sv-ktab td { padding: 8px 0; border-bottom: 1px solid var(--sv-line); vertical-align: top; }
.sv-ktab th { text-align: left; font-weight: 600; padding-right: 12px; }
.sv-ktab td { text-align: right; font-variant-numeric: tabular-nums; }
.sv-ktab td b { font-size: 16px; font-weight: 750; overflow-wrap: break-word; }
.sv-ktab td small { display: block; color: var(--sv-muted); font-size: 12.5px; }
.sv-ktab td .sv-delta { font-size: 12px; }
.sv-ktab tr:last-child th, .sv-ktab tr:last-child td { border-bottom: 0; }

/* Balken: Sonstige und ohne Angabe grau, gestapelte Teile mit Lücke */
.sv-rest .sv-bl { color: var(--sv-muted); font-style: italic; }
.sv-rest > .sv-bt:not(.sv-stack) .sv-bar { background: var(--sv-muted); opacity: .55; }
.sv-bt.sv-stack { background: none; }
.sv-stack .sv-bar { display: flex; gap: 2px; background: none; overflow: hidden; }
.sv-sg { display: block; flex: 0 1 auto; height: 100%; min-width: 2px; background: var(--sv-c); }
.sv-cols .sv-stack .sv-bar { flex-direction: column-reverse; }
.sv-cols .sv-sg { width: 100%; min-width: 0; min-height: 2px; }
.sv-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.sv-legend li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sv-sw { display: block; width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--sv-c); }

/* Kreis */
.sv-pie { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }
.sv-donut { display: block; width: 150px; height: 150px; flex: none; }
.sv-dn { stroke: var(--sv-c); }
.sv-dn-bg { stroke: var(--sv-soft); }
.sv-dn-t { fill: var(--sv-text); font-size: 27px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sv-dn-t.sv-dn-l { font-size: 18px; }
.sv-pie .sv-legend { flex: 1 1 140px; flex-direction: column; flex-wrap: nowrap; gap: 7px; margin: 0; font-size: 14px; }
.sv-pie .sv-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.sv-pie .sv-legend span { overflow-wrap: anywhere; }
.sv-pie .sv-legend b { font-variant-numeric: tabular-nums; }
.sv-pie .sv-legend small { min-width: 3.4em; text-align: right; color: var(--sv-muted); font-variant-numeric: tabular-nums; }

/* Tabellen und Listen */
.sv-tscroll { max-width: 100%; overflow-x: auto; }
.sv-table tfoot td { font-weight: 700; border-top: 2px solid var(--sv-line); border-bottom: 0; }
.sv-ltab { font-size: 13.5px; }
.sv-table.sv-ltab th:not(:first-child), .sv-table.sv-ltab td:not(:first-child) { text-align: left; }
.sv-table.sv-ltab th { white-space: nowrap; }
.sv-table.sv-ltab td { white-space: normal; min-width: 4.5em; vertical-align: top; overflow-wrap: break-word; }
.sv-table.sv-ltab td:first-child { white-space: nowrap; }
.sv-text { border-left: 4px solid var(--sv-accent); }
.sv-text p { overflow-wrap: anywhere; }
.sv-note.sv-own { color: var(--sv-text); }
.sv-busy { opacity: .5; transition: opacity .2s; }

/* Zeitraum */
.sv-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--sv-text); }
.sv-plabel { font-size: 14px; font-weight: 650; }
.sv-period .sv-psel, .sv-period .sv-pdate { width: auto; min-width: 0; min-height: 42px; margin: 0; padding: 8px 12px; font: inherit; font-size: 15px; color: var(--sv-text); background: var(--sv-bg); border: 1px solid var(--sv-edge); border-radius: var(--sv-radius); }
.sv-period .sv-psel { min-width: 104px; }
.sv-period .sv-pdate { min-width: 148px; }
.sv-pdash { font-size: 14px; color: var(--sv-muted); }
.sv-pcmp { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; font-size: 14.5px; cursor: pointer; }
.sv-pcmp input { width: 20px; height: 20px; margin: 0; flex: none; transform: none; accent-color: var(--sv-accent); }
.sv-pcmp.sv-dim { opacity: .5; cursor: default; }
.sv-stbar { align-items: center; }
.sv-sttools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }

/* Knöpfe (felder.css kennt nur die schlichten) */
.ff-btn-primary { background: var(--ff-accent); border-color: var(--ff-accent); color: #fff; }
.ff-btn-primary:hover:not(:disabled) { border-color: var(--ff-accent); filter: brightness(1.07); }
.ff-btn-ghost { background: transparent; }

/* Baukasten */
.sv-edbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; margin: 0 0 14px; color: var(--sv-text); border: 1px solid var(--sv-accent); border-radius: var(--sv-radius); background: linear-gradient(var(--sv-tint), var(--sv-tint)), var(--sv-solid); }
.sv-edbar-t { flex: 1 1 320px; min-width: 0; }
.sv-edbar-t b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.sv-edbar-t p { margin: 4px 0 0; }
.sv-edbar-b { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-led2 { display: flex; flex-direction: column; gap: 14px; color: var(--sv-text); }
.sv-ed-top { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-card); }
.sv-ed-tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sv-ed-tpl .sv-wl-t { margin-right: 4px; }
.ff-form .sv-ed-tpl .ff-input { flex: 1 1 240px; width: auto; max-width: 440px; min-width: 0; min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
.sv-tdesc { margin: 0; }
.sv-ed-adds { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--sv-line); }
.sv-ed-sec { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-soft); }
.sv-ed-sec > .ff-btn { align-self: flex-start; }
.sv-ed-sechead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ff-form .sv-ed-sechead .ff-input { flex: 1 1 220px; width: auto; min-width: 0; min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-weight: 700; }
.sv-ed-closed { white-space: nowrap; margin-right: 4px; }
.sv-ed-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sv-ed-card { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-card); }
.sv-ed-kind { justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--sv-soft); color: var(--sv-text); }
.sv-k-kpis { background: var(--sv-tint); }
.sv-ed-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-ed-main b { overflow-wrap: anywhere; }
.sv-ed-main small { color: var(--sv-muted); font-size: 13px; overflow-wrap: anywhere; }
.sv-ed-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.sv-ed-acts .ff-btn { min-width: 44px; padding-left: 10px; padding-right: 10px; }
.sv-ed-none { padding: 6px 2px; color: var(--sv-muted); font-size: 14px; }
.sv-flash { animation: sv-flash 1.8s ease-out; }
@keyframes sv-flash { from { box-shadow: 0 0 0 3px var(--sv-accent); } to { box-shadow: 0 0 0 3px transparent; } }

/* Assistent */
.sv-wizdlg .vr-dbody { min-width: 0; }
.sv-wizdlg .actions { position: sticky; bottom: 0; z-index: 2; align-items: center; padding-top: 12px; background: var(--sv-solid); }
.sv-wiz-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sv-wiz { display: flex; flex-direction: column; gap: 14px; color: var(--sv-text); }
.sv-wiz-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sv-wstep button { min-height: 36px; padding: 6px 12px; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--sv-muted); background: transparent; border: 1px solid var(--sv-line); border-radius: 999px; cursor: pointer; }
.sv-wstep:not(.seen) button { opacity: .55; cursor: default; }
.sv-wstep.seen button:not(:disabled) { color: var(--sv-text); border-color: var(--sv-edge); }
.sv-wstep.seen button:not(:disabled):hover { border-color: var(--sv-text); }
.sv-wstep.on button { color: #fff; background: var(--sv-accent); border-color: var(--sv-accent); opacity: 1; cursor: default; }
.sv-wstep > span { display: inline-block; padding: 6px 4px; color: var(--sv-muted); }
.sv-wiz-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sv-wiz-body .ff-heading { font-size: 17px; }
.sv-wiz-body .ff-help { margin: -6px 0 0; }
.sv-wiz-body > .ff-btn { align-self: flex-start; }
.sv-wiz-body > .sv-wl { max-width: 600px; }
.sv-mt { margin-top: 10px !important; }
.sv-wl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sv-wl-t { font-size: 14px; font-weight: 650; }
.sv-wl small { margin-top: -4px; color: var(--sv-muted); font-size: 12.5px; }
.sv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sv-tiles2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 660px; }
.sv-tiles4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sv-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 92px; padding: 14px 16px; font: inherit; text-align: left; color: var(--sv-text); background: var(--sv-bg); border: 1px solid var(--sv-edge); border-radius: var(--sv-radius); cursor: pointer; touch-action: manipulation; }
.sv-tile:hover { border-color: var(--sv-text); }
.sv-tile:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 2px; }
.sv-tile.on { border-color: var(--sv-accent); background: var(--sv-tint); box-shadow: inset 0 0 0 1px var(--sv-accent); }
.sv-tile b { font-size: 16px; }
.sv-tile span { font-size: 13.5px; line-height: 1.35; color: var(--sv-muted); }
/* kleine Bildchen für die Darstellungen */
.sv-tico { display: block; width: 30px; height: 22px; margin-bottom: 4px; color: var(--sv-accent); --g: linear-gradient(currentColor, currentColor); }
.sv-tico-balken { background: var(--g) 0 1px / 90% 5px no-repeat, var(--g) 0 8.5px / 60% 5px no-repeat, var(--g) 0 16px / 34% 5px no-repeat; }
.sv-tico-saeulen { background: var(--g) 1px 100% / 6px 55% no-repeat, var(--g) 12px 100% / 6px 100% no-repeat, var(--g) 23px 100% / 6px 35% no-repeat; }
.sv-tico-kreis { width: 22px; border-radius: 50%; background: conic-gradient(currentColor 0 62%, var(--sv-edge) 62% 100%); -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%); mask: radial-gradient(circle, transparent 42%, #000 44%); }
.sv-tico-tabelle { border: 2px solid currentColor; border-radius: 3px; background: var(--g) 50% 0 / 2px 100% no-repeat, var(--g) 0 33% / 100% 2px no-repeat, var(--g) 0 70% / 100% 2px no-repeat; }
/* Felder zum Aufteilen */
.sv-dimpick { display: flex; flex-direction: column; gap: 12px; }
.sv-dimgrp { display: flex; flex-direction: column; gap: 6px; }
.sv-dimh { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sv-muted); }
.sv-dimpick .sv-chip, .sv-vchips .sv-chip, .sv-wiz .sv-idea { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.sv-chip.sv-offf { opacity: .6; border-style: dashed; }
.sv-chip small { color: var(--sv-muted); font-weight: 500; }
/* Kennzahlen im Assistenten */
.sv-kitems { display: flex; flex-direction: column; gap: 10px; }
.sv-kitem { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-soft); }
.sv-krow { display: grid; grid-template-columns: 28px minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.sv-kno { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; background: var(--sv-accent); }
.sv-krow > .sv-kno { margin-bottom: 10px; }
.sv-kbtn { display: flex; gap: 6px; }
.sv-kbtn .ff-btn { min-width: 44px; padding-left: 0; padding-right: 0; }
.sv-kparams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; padding-left: 38px; }
.sv-kparams:empty { display: none; }
.sv-kfil { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-left: 38px; }
.sv-kfw { width: 100%; }
.sv-wgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sv-wchecks { display: flex; flex-direction: column; gap: 6px; }
.sv-wchk { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 15px; cursor: pointer; }
.sv-wchk input { width: 20px; height: 20px; margin: 0; flex: none; transform: none; accent-color: var(--sv-accent); }
.sv-mcols { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sv-mcol { display: grid; grid-template-columns: 28px minmax(0, 380px) 44px; gap: 8px; align-items: center; width: 100%; }
.sv-colorder { margin-top: -4px; font-size: 13.5px; color: var(--sv-muted); }
.sv-werr { margin: 0; color: var(--sv-bad); font-weight: 650; }
.sv-werr:empty { display: none; }
.sv-wiz-pvbox { padding: 12px 14px 14px; border: 1px dashed var(--sv-edge); border-radius: var(--sv-radius); background: var(--sv-soft); }
.sv-wiz-pvh { margin-bottom: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sv-muted); }
.sv-wiz-pv .sv-grid { grid-template-columns: minmax(0, 1fr); }
/* Bedingungen */
.sv-fl { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--sv-text); }
.sv-frow { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--sv-line); border-radius: var(--sv-radius); background: var(--sv-card); }
.sv-fhead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 150px) 44px; gap: 8px; align-items: center; }
.sv-fvals:empty { display: none; }
.sv-vadd { display: inline-flex; }
.ff-form .sv-vchips .sv-vfree { width: 190px; min-height: 40px; padding: 7px 12px; font-size: 14px; }

/* Pflichtfelder in den Einstellungen */
.sv-reqs { display: flex; flex-direction: column; gap: 6px; }
.sv-reqrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px); gap: 8px 12px; align-items: center; padding: 6px 8px 6px 12px; border: 1px solid var(--sv-line); border-left: 4px solid var(--sv-edge); border-radius: var(--sv-radius); background: var(--sv-bg); }
.sv-reqrow[data-mode="pflicht"] { border-left-color: var(--sv-accent); }
.sv-reqrow[data-mode="aus"] .sv-reqlabel { color: var(--sv-muted); }
.sv-reqlabel { font-weight: 650; overflow-wrap: anywhere; }
.sv-form .sv-reqrow .sv-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.sv-reqrow .sv-seg > :first-child:nth-last-child(2) { grid-column: 2; }
.sv-reqrow .ff-seg-btn { min-height: 42px; font-size: 14.5px; }
.sv-reqrow .ff-seg-btn.ff-on[data-v="aus"] { background: var(--sv-muted); border-color: var(--sv-muted); color: var(--sv-solid); }
.sv-reqrow .ff-seg-btn.ff-on[data-v="frei"] { background: var(--sv-edge); border-color: var(--sv-edge); color: var(--sv-text); }
.sv-reqfix { justify-self: end; padding: 0 8px; font-size: 14px; font-weight: 650; color: var(--sv-muted); }
.sv-reqnote { margin: 0; }

/* ---------- Schmal (Handy, kleines Fenster) ---------- */
@media (max-width: 640px) {
  .sv-addr { grid-template-columns: 96px minmax(0, 1fr); }
  .sv-addr > :first-child { grid-column: 1 / -1; }
  .sv-pat { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .sv-pat > :nth-child(2) { grid-column: 2 / -1; }
  .sv-pat > :nth-child(3) { grid-column: 2; }
  .sv-item-head { display: none; }
  .sv-item-ed { grid-template-columns: minmax(0, 1fr) auto 44px 44px; padding-bottom: 8px; border-bottom: 1px dashed var(--sv-line); }
  .sv-item-ed > :first-child { grid-column: 1 / -1; }
  .sv-ci { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "s" "x"; }
  .sv-anw-row { grid-template-columns: minmax(0, 1fr); }
  .sv-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sv-dl dd { margin-bottom: 8px; }
  .sv-barrow { grid-template-columns: minmax(70px, 40%) minmax(0, 1fr) auto; }
  .sv-grid, .sv-cards { grid-template-columns: minmax(0, 1fr); }
  .sv-bars.sv-cols { grid-auto-columns: minmax(16px, 1fr); gap: 3px; }
  .sv-cols .sv-bl { font-size: 10.5px; overflow: visible; text-overflow: clip; }
  .sv-cols .sv-bn { font-size: 11px; }
  .sv-reqrow { grid-template-columns: minmax(0, 1fr); padding-right: 12px; }
  .sv-reqfix { justify-self: start; padding: 0; }
  .sv-pie { flex-direction: column; align-items: stretch; }
  .sv-donut { align-self: center; width: 140px; height: 140px; }
  .sv-pie .sv-legend { flex-basis: auto; }
  .sv-period .sv-psel, .sv-period .sv-pdate { flex: 1 1 130px; }
  .sv-plabel { flex: 1 1 100%; }
  .sv-ed-card { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sv-ed-acts { justify-content: flex-start; }
  .sv-edbar { position: static; }
  .sv-krow { grid-template-columns: 28px minmax(0, 1fr); }
  .sv-krow > .sv-wl, .sv-krow > .sv-kbtn { grid-column: 2; }
  .sv-krow > .sv-kno { margin-bottom: 0; align-self: start; }
  .sv-kparams, .sv-kfil { padding-left: 0; }
  .sv-fhead { grid-template-columns: minmax(0, 1fr) 44px; }
  .sv-fhead > .sv-fdim { grid-column: 1 / -1; }
  .sv-mcol { grid-template-columns: 28px minmax(0, 1fr) 44px; }
  .sv-tile { min-height: 0; padding: 12px 14px; }
  .sv-sect-t { font-size: 16px; }
}

/* Nur ansehen (z. B. Rotkreuzleitung) */
.sv-ro-form .sv-anw-bar .ff-btn { display: none; }
.sv-ro-form input:disabled, .sv-ro-form textarea:disabled { opacity: 1; cursor: default; }
.sv-ro { margin: .25rem 0 .6rem; }
